@loaders.gl/tiles-3d 5.0.0-beta.2 → 5.0.0-beta.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.
Files changed (54) hide show
  1. package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
  2. package/dist/3d-tiles/dist.dev.js +502 -342
  3. package/dist/3d-tiles/dist.min.js +19 -19
  4. package/dist/3d-tiles/index.cjs +307 -183
  5. package/dist/3d-tiles/index.cjs.map +3 -3
  6. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.d.ts.map +1 -1
  7. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js +12 -8
  8. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js.map +1 -1
  9. package/dist/3d-tiles/lib/utils/version.js +1 -1
  10. package/dist/3d-tiles-archive-writer.cjs +1 -1
  11. package/dist/cesium-ion-loader-with-parser.cjs +301 -177
  12. package/dist/cesium-ion-loader-with-parser.cjs.map +3 -3
  13. package/dist/copc/copc-source-loader.js +1 -1
  14. package/dist/copc/copc-writer.js +1 -1
  15. package/dist/copc/index.cjs +358 -9
  16. package/dist/copc/index.cjs.map +3 -3
  17. package/dist/dist.min.js +2 -2
  18. package/dist/i3s/arcgis-webscene-loader.js +1 -1
  19. package/dist/i3s/dist.dev.js +3731 -694
  20. package/dist/i3s/dist.min.js +43 -35
  21. package/dist/i3s/i3s-attribute-loader.js +1 -1
  22. package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
  23. package/dist/i3s/i3s-content-loader.js +1 -1
  24. package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
  25. package/dist/i3s/i3s-loader.js +1 -1
  26. package/dist/i3s/i3s-node-page-loader.js +1 -1
  27. package/dist/i3s/i3s-slpk-loader.js +1 -1
  28. package/dist/i3s/i3s-slpk-writer.js +1 -1
  29. package/dist/i3s/index.cjs +2542 -373
  30. package/dist/i3s/index.cjs.map +3 -3
  31. package/dist/i3s-content-worker-node.js +11 -11
  32. package/dist/i3s-content-worker-node.js.map +4 -4
  33. package/dist/i3s-content-worker.js +392 -56
  34. package/dist/i3s-lepcc-worker-node.js +369 -37
  35. package/dist/i3s-lepcc-worker-node.js.map +4 -4
  36. package/dist/i3s-lepcc-worker.js +340 -33
  37. package/dist/i3s-mesh-writer.cjs +2464 -295
  38. package/dist/i3s-mesh-writer.cjs.map +3 -3
  39. package/dist/i3s-slpk-writer.cjs +1 -1
  40. package/dist/index.cjs +1 -1
  41. package/dist/point-cloud-tile-source-loader-types.js +1 -1
  42. package/dist/point-cloud-tile-source-loader.cjs +1 -1
  43. package/dist/potree/dist.dev.js +84 -28
  44. package/dist/potree/dist.min.js +26 -26
  45. package/dist/potree/index.cjs +11 -6
  46. package/dist/potree/index.cjs.map +1 -1
  47. package/dist/potree/potree-bin-loader.js +1 -1
  48. package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
  49. package/dist/potree/potree-loader-types.js +1 -1
  50. package/dist/potree/potree-source-loader.js +1 -1
  51. package/dist/potree/potree-writer.js +1 -1
  52. package/dist/potree-loader.cjs +1 -1
  53. package/package.json +13 -13
  54. package/src/3d-tiles/lib/classes/tile-3d-batch-table.ts +12 -8
@@ -1,26 +1,26 @@
1
- "use strict";var QC=Object.create;var L1=Object.defineProperty;var eD=Object.getOwnPropertyDescriptor;var tD=Object.getOwnPropertyNames;var rD=Object.getPrototypeOf,nD=Object.prototype.hasOwnProperty;var p=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var ae=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},ir=(e,t)=>{for(var r in t)L1(e,r,{get:t[r],enumerable:!0})},iD=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tD(t))!nD.call(e,i)&&i!==r&&L1(e,i,{get:()=>t[i],enumerable:!(n=eD(t,i))||n.enumerable});return e};var pe=(e,t,r)=>(r=e!=null?QC(rD(e)):{},iD(t||!e||!e.__esModule?L1(r,"default",{value:e,enumerable:!0}):r,e));var D_,RD,LD,OD,BD,CD,DD,ND,FD,GD,kD,UD,jD,zD,qD,f,Yi=p(()=>{D_=e=>typeof e<"u"&&e!==null,RD=e=>typeof e=="object",LD=e=>Object.prototype.toString.call(e)==="[object Object]",OD=e=>typeof e=="function",BD=e=>typeof e=="boolean",CD=e=>e instanceof Buffer,DD=e=>{if(D_(e))switch(e.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},ND=e=>e instanceof ArrayBuffer,FD=e=>typeof e=="string"&&e.length>0,GD=e=>typeof e=="number"&&Number.isFinite(e),kD=e=>Number.isInteger(e),UD=(e,t,r)=>e>=t&&e<=r,jD=(e,t)=>t.includes(e),zD=(e,t,r)=>{let n;try{n=String(r).slice(0,100)}catch{}return new Error(`Expected ${t} for ${e} but received ${n} of type ${typeof r}`)},qD=(e,t)=>(t.message=e.message,t),f={defined:D_,object:RD,plainObject:LD,fn:OD,bool:BD,buffer:CD,typedArray:DD,arrayBuffer:ND,string:FD,number:GD,integer:kD,inRange:UD,inArray:jD,invalidParameterError:zD,nativeError:qD}});var G_=ae((DX,F_)=>{"use strict";var N_=()=>process.platform==="linux",ud=null,VD=()=>{if(!ud)if(N_()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,ud=process.report.getReport(),process.report.excludeNetwork=e}else ud={};return ud};F_.exports={isLinux:N_,getReport:VD}});var U_=ae((NX,k_)=>{"use strict";var pl=require("fs"),WD="/usr/bin/ldd",HD="/proc/self/exe",fd=2048,$D=e=>{let t=pl.openSync(e,"r"),r=Buffer.alloc(fd),n=pl.readSync(t,r,0,fd,0);return pl.close(t,()=>{}),r.subarray(0,n)},KD=e=>new Promise((t,r)=>{pl.open(e,"r",(n,i)=>{if(n)r(n);else{let o=Buffer.alloc(fd);pl.read(i,o,0,fd,0,(s,a)=>{t(o.subarray(0,a)),pl.close(i,()=>{})})}})});k_.exports={LDD_PATH:WD,SELF_PATH:HD,readFileSync:$D,readFile:KD}});var z_=ae((FX,j_)=>{"use strict";var XD=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),r=e.readUInt16LE(54),n=e.readUInt16LE(56);for(let i=0;i<n;i++){let o=t+i*r;if(e.readUInt32LE(o)===3){let a=e.readUInt32LE(o+8),c=e.readUInt32LE(o+32);return e.subarray(a,a+c).toString().replace(/\0.*$/g,"")}}return null};j_.exports={interpreterPath:XD}});var dd=ae((GX,sS)=>{"use strict";var V_=require("child_process"),{isLinux:gl,getReport:W_}=G_(),{LDD_PATH:hd,SELF_PATH:H_,readFile:G1,readFileSync:k1}=U_(),{interpreterPath:$_}=z_(),Zi,Ji,Qi,K_="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",Ss="",X_=()=>Ss||new Promise(e=>{V_.exec(K_,(t,r)=>{Ss=t?" ":r,e(Ss)})}),Y_=()=>{if(!Ss)try{Ss=V_.execSync(K_,{encoding:"utf8"})}catch{Ss=" "}return Ss},Lo="glibc",Z_=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Xa="musl",YD=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),J_=()=>{let e=W_();return e.header&&e.header.glibcVersionRuntime?Lo:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(YD)?Xa:null},Q_=e=>{let[t,r]=e.split(/[\r\n]+/);return t&&t.includes(Lo)?Lo:r&&r.includes(Xa)?Xa:null},eS=e=>{if(e){if(e.includes("/ld-musl-"))return Xa;if(e.includes("/ld-linux-"))return Lo}return null},tS=e=>(e=e.toString(),e.includes("musl")?Xa:e.includes("GNU C Library")?Lo:null),ZD=async()=>{if(Ji!==void 0)return Ji;Ji=null;try{let e=await G1(hd);Ji=tS(e)}catch{}return Ji},JD=()=>{if(Ji!==void 0)return Ji;Ji=null;try{let e=k1(hd);Ji=tS(e)}catch{}return Ji},QD=async()=>{if(Zi!==void 0)return Zi;Zi=null;try{let e=await G1(H_),t=$_(e);Zi=eS(t)}catch{}return Zi},eN=()=>{if(Zi!==void 0)return Zi;Zi=null;try{let e=k1(H_),t=$_(e);Zi=eS(t)}catch{}return Zi},rS=async()=>{let e=null;if(gl()&&(e=await QD(),!e&&(e=await ZD(),e||(e=J_()),!e))){let t=await X_();e=Q_(t)}return e},nS=()=>{let e=null;if(gl()&&(e=eN(),!e&&(e=JD(),e||(e=J_()),!e))){let t=Y_();e=Q_(t)}return e},tN=async()=>gl()&&await rS()!==Lo,rN=()=>gl()&&nS()!==Lo,nN=async()=>{if(Qi!==void 0)return Qi;Qi=null;try{let t=(await G1(hd)).match(Z_);t&&(Qi=t[1])}catch{}return Qi},iN=()=>{if(Qi!==void 0)return Qi;Qi=null;try{let t=k1(hd).match(Z_);t&&(Qi=t[1])}catch{}return Qi},iS=()=>{let e=W_();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},q_=e=>e.trim().split(/\s+/)[1],oS=e=>{let[t,r,n]=e.split(/[\r\n]+/);return t&&t.includes(Lo)?q_(t):r&&n&&r.includes(Xa)?q_(n):null},oN=async()=>{let e=null;if(gl()&&(e=await nN(),e||(e=iS()),!e)){let t=await X_();e=oS(t)}return e},sN=()=>{let e=null;if(gl()&&(e=iN(),e||(e=iS()),!e)){let t=Y_();e=oS(t)}return e};sS.exports={GLIBC:Lo,MUSL:Xa,family:rS,familySync:nS,isNonGlibcLinux:tN,isNonGlibcLinuxSync:rN,version:oN,versionSync:sN}});var yl=ae((kX,aS)=>{"use strict";var aN="2.0.0",cN=Number.MAX_SAFE_INTEGER||9007199254740991,lN=16,uN=250,fN=["major","premajor","minor","preminor","patch","prepatch","prerelease"];aS.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:lN,MAX_SAFE_BUILD_LENGTH:uN,MAX_SAFE_INTEGER:cN,RELEASE_TYPES:fN,SEMVER_SPEC_VERSION:aN,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var cf=ae((UX,cS)=>{"use strict";var hN=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};cS.exports=hN});var bl=ae((eo,lS)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:U1,MAX_SAFE_BUILD_LENGTH:dN,MAX_LENGTH:mN}=yl(),pN=cf();eo=lS.exports={};var gN=eo.re=[],yN=eo.safeRe=[],Y=eo.src=[],bN=eo.safeSrc=[],Z=eo.t={},wN=0,j1="[a-zA-Z0-9-]",xN=[["\\s",1],["\\d",mN],[j1,dN]],_N=e=>{for(let[t,r]of xN)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},Pe=(e,t,r)=>{let n=_N(t),i=wN++;pN(e,i,t),Z[e]=i,Y[i]=t,bN[i]=n,gN[i]=new RegExp(t,r?"g":void 0),yN[i]=new RegExp(n,r?"g":void 0)};Pe("NUMERICIDENTIFIER","0|[1-9]\\d*");Pe("NUMERICIDENTIFIERLOOSE","\\d+");Pe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${j1}*`);Pe("MAINVERSION",`(${Y[Z.NUMERICIDENTIFIER]})\\.(${Y[Z.NUMERICIDENTIFIER]})\\.(${Y[Z.NUMERICIDENTIFIER]})`);Pe("MAINVERSIONLOOSE",`(${Y[Z.NUMERICIDENTIFIERLOOSE]})\\.(${Y[Z.NUMERICIDENTIFIERLOOSE]})\\.(${Y[Z.NUMERICIDENTIFIERLOOSE]})`);Pe("PRERELEASEIDENTIFIER",`(?:${Y[Z.NONNUMERICIDENTIFIER]}|${Y[Z.NUMERICIDENTIFIER]})`);Pe("PRERELEASEIDENTIFIERLOOSE",`(?:${Y[Z.NONNUMERICIDENTIFIER]}|${Y[Z.NUMERICIDENTIFIERLOOSE]})`);Pe("PRERELEASE",`(?:-(${Y[Z.PRERELEASEIDENTIFIER]}(?:\\.${Y[Z.PRERELEASEIDENTIFIER]})*))`);Pe("PRERELEASELOOSE",`(?:-?(${Y[Z.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[Z.PRERELEASEIDENTIFIERLOOSE]})*))`);Pe("BUILDIDENTIFIER",`${j1}+`);Pe("BUILD",`(?:\\+(${Y[Z.BUILDIDENTIFIER]}(?:\\.${Y[Z.BUILDIDENTIFIER]})*))`);Pe("FULLPLAIN",`v?${Y[Z.MAINVERSION]}${Y[Z.PRERELEASE]}?${Y[Z.BUILD]}?`);Pe("FULL",`^${Y[Z.FULLPLAIN]}$`);Pe("LOOSEPLAIN",`[v=\\s]*${Y[Z.MAINVERSIONLOOSE]}${Y[Z.PRERELEASELOOSE]}?${Y[Z.BUILD]}?`);Pe("LOOSE",`^${Y[Z.LOOSEPLAIN]}$`);Pe("GTLT","((?:<|>)?=?)");Pe("XRANGEIDENTIFIERLOOSE",`${Y[Z.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Pe("XRANGEIDENTIFIER",`${Y[Z.NUMERICIDENTIFIER]}|x|X|\\*`);Pe("XRANGEPLAIN",`[v=\\s]*(${Y[Z.XRANGEIDENTIFIER]})(?:\\.(${Y[Z.XRANGEIDENTIFIER]})(?:\\.(${Y[Z.XRANGEIDENTIFIER]})(?:${Y[Z.PRERELEASE]})?${Y[Z.BUILD]}?)?)?`);Pe("XRANGEPLAINLOOSE",`[v=\\s]*(${Y[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[Z.XRANGEIDENTIFIERLOOSE]})(?:${Y[Z.PRERELEASELOOSE]})?${Y[Z.BUILD]}?)?)?`);Pe("XRANGE",`^${Y[Z.GTLT]}\\s*${Y[Z.XRANGEPLAIN]}$`);Pe("XRANGELOOSE",`^${Y[Z.GTLT]}\\s*${Y[Z.XRANGEPLAINLOOSE]}$`);Pe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${U1}})(?:\\.(\\d{1,${U1}}))?(?:\\.(\\d{1,${U1}}))?`);Pe("COERCE",`${Y[Z.COERCEPLAIN]}(?:$|[^\\d])`);Pe("COERCEFULL",Y[Z.COERCEPLAIN]+`(?:${Y[Z.PRERELEASE]})?(?:${Y[Z.BUILD]})?(?:$|[^\\d])`);Pe("COERCERTL",Y[Z.COERCE],!0);Pe("COERCERTLFULL",Y[Z.COERCEFULL],!0);Pe("LONETILDE","(?:~>?)");Pe("TILDETRIM",`(\\s*)${Y[Z.LONETILDE]}\\s+`,!0);eo.tildeTrimReplace="$1~";Pe("TILDE",`^${Y[Z.LONETILDE]}${Y[Z.XRANGEPLAIN]}$`);Pe("TILDELOOSE",`^${Y[Z.LONETILDE]}${Y[Z.XRANGEPLAINLOOSE]}$`);Pe("LONECARET","(?:\\^)");Pe("CARETTRIM",`(\\s*)${Y[Z.LONECARET]}\\s+`,!0);eo.caretTrimReplace="$1^";Pe("CARET",`^${Y[Z.LONECARET]}${Y[Z.XRANGEPLAIN]}$`);Pe("CARETLOOSE",`^${Y[Z.LONECARET]}${Y[Z.XRANGEPLAINLOOSE]}$`);Pe("COMPARATORLOOSE",`^${Y[Z.GTLT]}\\s*(${Y[Z.LOOSEPLAIN]})$|^$`);Pe("COMPARATOR",`^${Y[Z.GTLT]}\\s*(${Y[Z.FULLPLAIN]})$|^$`);Pe("COMPARATORTRIM",`(\\s*)${Y[Z.GTLT]}\\s*(${Y[Z.LOOSEPLAIN]}|${Y[Z.XRANGEPLAIN]})`,!0);eo.comparatorTrimReplace="$1$2$3";Pe("HYPHENRANGE",`^\\s*(${Y[Z.XRANGEPLAIN]})\\s+-\\s+(${Y[Z.XRANGEPLAIN]})\\s*$`);Pe("HYPHENRANGELOOSE",`^\\s*(${Y[Z.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[Z.XRANGEPLAINLOOSE]})\\s*$`);Pe("STAR","(<|>)?=?\\s*\\*");Pe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Pe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var md=ae((jX,uS)=>{"use strict";var SN=Object.freeze({loose:!0}),MN=Object.freeze({}),vN=e=>e?typeof e!="object"?SN:e:MN;uS.exports=vN});var z1=ae((zX,dS)=>{"use strict";var fS=/^[0-9]+$/,hS=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=fS.test(e),n=fS.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},EN=(e,t)=>hS(t,e);dS.exports={compareIdentifiers:hS,rcompareIdentifiers:EN}});var _r=ae((qX,pS)=>{"use strict";var pd=cf(),{MAX_LENGTH:mS,MAX_SAFE_INTEGER:gd}=yl(),{safeRe:yd,t:bd}=bl(),AN=md(),{compareIdentifiers:q1}=z1(),TN=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(q1(e[n],r[n])!==0)return!1;return!0},V1=class e{constructor(t,r){if(r=AN(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>mS)throw new TypeError(`version is longer than ${mS} characters`);pd("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?yd[bd.LOOSE]:yd[bd.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>gd||this.major<0)throw new TypeError("Invalid major version");if(this.minor>gd||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>gd||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<gd)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(pd("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(pd("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return q1(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(pd("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return q1(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?yd[bd.PRERELEASELOOSE]:yd[bd.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];if(n===!1&&(o=[r]),TN(this.prerelease,r)){let s=this.prerelease[r.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};pS.exports=V1});var Ms=ae((VX,yS)=>{"use strict";var gS=_r(),IN=(e,t,r=!1)=>{if(e instanceof gS)return e;try{return new gS(e,t)}catch(n){if(!r)return null;throw n}};yS.exports=IN});var wS=ae((WX,bS)=>{"use strict";var PN=Ms(),RN=(e,t)=>{let r=PN(e,t);return r?r.version:null};bS.exports=RN});var _S=ae((HX,xS)=>{"use strict";var LN=Ms(),ON=(e,t)=>{let r=LN(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};xS.exports=ON});var vS=ae(($X,MS)=>{"use strict";var SS=_r(),BN=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new SS(e instanceof SS?e.version:e,r).inc(t,n,i).version}catch{return null}};MS.exports=BN});var TS=ae((KX,AS)=>{"use strict";var ES=Ms(),CN=(e,t)=>{let r=ES(e,null,!0),n=ES(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};AS.exports=CN});var PS=ae((XX,IS)=>{"use strict";var DN=_r(),NN=(e,t)=>new DN(e,t).major;IS.exports=NN});var LS=ae((YX,RS)=>{"use strict";var FN=_r(),GN=(e,t)=>new FN(e,t).minor;RS.exports=GN});var BS=ae((ZX,OS)=>{"use strict";var kN=_r(),UN=(e,t)=>new kN(e,t).patch;OS.exports=UN});var DS=ae((JX,CS)=>{"use strict";var jN=Ms(),zN=(e,t)=>{let r=jN(e,t);return r&&r.prerelease.length?r.prerelease:null};CS.exports=zN});var li=ae((QX,FS)=>{"use strict";var NS=_r(),qN=(e,t,r)=>new NS(e,r).compare(new NS(t,r));FS.exports=qN});var kS=ae((eY,GS)=>{"use strict";var VN=li(),WN=(e,t,r)=>VN(t,e,r);GS.exports=WN});var jS=ae((tY,US)=>{"use strict";var HN=li(),$N=(e,t)=>HN(e,t,!0);US.exports=$N});var wd=ae((rY,qS)=>{"use strict";var zS=_r(),KN=(e,t,r)=>{let n=new zS(e,r),i=new zS(t,r);return n.compare(i)||n.compareBuild(i)};qS.exports=KN});var WS=ae((nY,VS)=>{"use strict";var XN=wd(),YN=(e,t)=>e.sort((r,n)=>XN(r,n,t));VS.exports=YN});var $S=ae((iY,HS)=>{"use strict";var ZN=wd(),JN=(e,t)=>e.sort((r,n)=>ZN(n,r,t));HS.exports=JN});var lf=ae((oY,KS)=>{"use strict";var QN=li(),eF=(e,t,r)=>QN(e,t,r)>0;KS.exports=eF});var xd=ae((sY,XS)=>{"use strict";var tF=li(),rF=(e,t,r)=>tF(e,t,r)<0;XS.exports=rF});var W1=ae((aY,YS)=>{"use strict";var nF=li(),iF=(e,t,r)=>nF(e,t,r)===0;YS.exports=iF});var H1=ae((cY,ZS)=>{"use strict";var oF=li(),sF=(e,t,r)=>oF(e,t,r)!==0;ZS.exports=sF});var _d=ae((lY,JS)=>{"use strict";var aF=li(),cF=(e,t,r)=>aF(e,t,r)>=0;JS.exports=cF});var Sd=ae((uY,QS)=>{"use strict";var lF=li(),uF=(e,t,r)=>lF(e,t,r)<=0;QS.exports=uF});var $1=ae((fY,eM)=>{"use strict";var fF=W1(),hF=H1(),dF=lf(),mF=_d(),pF=xd(),gF=Sd(),yF=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return fF(e,r,n);case"!=":return hF(e,r,n);case">":return dF(e,r,n);case">=":return mF(e,r,n);case"<":return pF(e,r,n);case"<=":return gF(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};eM.exports=yF});var rM=ae((hY,tM)=>{"use strict";var bF=_r(),wF=Ms(),{safeRe:Md,t:vd}=bl(),xF=(e,t)=>{if(e instanceof bF)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Md[vd.COERCEFULL]:Md[vd.COERCE]);else{let c=t.includePrerelease?Md[vd.COERCERTLFULL]:Md[vd.COERCERTL],l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return wF(`${n}.${i}.${o}${s}${a}`,t)};tM.exports=xF});var iM=ae((dY,nM)=>{"use strict";var _F=Ms(),SF=yl(),MF=_r(),vF=(e,t,r)=>{if(!SF.RELEASE_TYPES.includes(t))return null;let n=EF(e,r);return n&&AF(n,t)},EF=(e,t)=>{let r=e instanceof MF?e.version:e;return _F(r,t)},AF=(e,t)=>{if(TF(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},TF=e=>e.startsWith("pre");nM.exports=vF});var sM=ae((mY,oM)=>{"use strict";var K1=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}};oM.exports=K1});var ui=ae((pY,uM)=>{"use strict";var IF=/\s+/g,X1=class e{constructor(t,r){if(r=RF(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Y1)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(IF," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!cM(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&kF(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(GF,"");let n=((this.options.includePrerelease&&NF)|(this.options.loose&&FF))+":"+t,i=aM.get(n);if(i)return i;let o=this.options.loose,s=o?Zr[Sr.HYPHENRANGELOOSE]:Zr[Sr.HYPHENRANGE];t=t.replace(s,YF(this.options.includePrerelease)),vt("hyphen replace",t),t=t.replace(Zr[Sr.COMPARATORTRIM],BF),vt("comparator trim",t),t=t.replace(Zr[Sr.TILDETRIM],CF),vt("tilde trim",t),t=t.replace(Zr[Sr.CARETTRIM],DF),vt("caret trim",t);let a=t.split(" ").map(h=>UF(h,this.options)).join(" ").split(/\s+/).map(h=>XF(h,this.options));o&&(a=a.filter(h=>(vt("loose invalid filter",h,this.options),!!h.match(Zr[Sr.COMPARATORLOOSE])))),vt("range list",a);let c=new Map,l=a.map(h=>new Y1(h,this.options));for(let h of l){if(cM(h))return[h];c.set(h.value,h)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return aM.set(n,u),u}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>lM(n,r)&&t.set.some(i=>lM(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new LF(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(ZF(this.set[r],t,this.options))return!0;return!1}};uM.exports=X1;var PF=sM(),aM=new PF,RF=md(),Y1=uf(),vt=cf(),LF=_r(),{safeRe:Zr,src:OF,t:Sr,comparatorTrimReplace:BF,tildeTrimReplace:CF,caretTrimReplace:DF}=bl(),{FLAG_INCLUDE_PRERELEASE:NF,FLAG_LOOSE:FF}=yl(),GF=new RegExp(OF[Sr.BUILD],"g"),cM=e=>e.value==="<0.0.0-0",kF=e=>e.value==="",lM=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,t)),i=n.pop();return r},UF=(e,t)=>(e=e.replace(Zr[Sr.BUILD],""),vt("comp",e,t),e=VF(e,t),vt("caret",e),e=zF(e,t),vt("tildes",e),e=HF(e,t),vt("xrange",e),e=KF(e,t),vt("stars",e),e),or=e=>!e||e.toLowerCase()==="x"||e==="*",jF=(e,t,r)=>or(e)&&!or(t)||or(t)&&r&&!or(r),zF=(e,t)=>e.trim().split(/\s+/).map(r=>qF(r,t)).join(" "),qF=(e,t)=>{let r=t.loose?Zr[Sr.TILDELOOSE]:Zr[Sr.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{vt("tilde",e,i,o,s,a,c);let l;return or(o)?l="":or(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:or(a)?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c?(vt("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,vt("tilde return",l),l})},VF=(e,t)=>e.trim().split(/\s+/).map(r=>WF(r,t)).join(" "),WF=(e,t)=>{vt("caret",e,t);let r=t.loose?Zr[Sr.CARETLOOSE]:Zr[Sr.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{vt("caret",e,i,o,s,a,c);let l;return or(o)?l="":or(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:or(a)?o==="0"?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:c?(vt("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(vt("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),vt("caret return",l),l})},HF=(e,t)=>(vt("replaceXRanges",e,t),e.split(/\s+/).map(r=>$F(r,t)).join(" ")),$F=(e,t)=>{e=e.trim();let r=t.loose?Zr[Sr.XRANGELOOSE]:Zr[Sr.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{if(vt("xRange",e,n,i,o,s,a,c),jF(o,s,a))return e;let l=or(o),u=l||or(s),h=u||or(a),d=h;return i==="="&&d&&(i=""),c=t.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&d?(u&&(s=0),a=0,i===">"?(i=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",u?o=+o+1:s=+s+1),i==="<"&&(c="-0"),n=`${i+o}.${s}.${a}${c}`):u?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:h&&(n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),vt("xRange return",n),n})},KF=(e,t)=>(vt("replaceStars",e,t),e.trim().replace(Zr[Sr.STAR],"")),XF=(e,t)=>(vt("replaceGTE0",e,t),e.trim().replace(Zr[t.includePrerelease?Sr.GTE0PRE:Sr.GTE0],"")),YF=e=>(t,r,n,i,o,s,a,c,l,u,h,d)=>(or(n)?r="":or(i)?r=`>=${n}.0.0${e?"-0":""}`:or(o)?r=`>=${n}.${i}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,or(l)?c="":or(u)?c=`<${+l+1}.0.0-0`:or(h)?c=`<${l}.${+u+1}.0-0`:d?c=`<=${l}.${u}.${h}-${d}`:e?c=`<${l}.${u}.${+h+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),ZF=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(vt(e[n].semver),e[n].semver!==Y1.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var uf=ae((gY,gM)=>{"use strict";var ff=Symbol("SemVer ANY"),Q1=class e{static get ANY(){return ff}constructor(t,r){if(r=fM(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),J1("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===ff?this.value="":this.value=this.operator+this.semver.version,J1("comp",this)}parse(t){let r=this.options.loose?hM[dM.COMPARATORLOOSE]:hM[dM.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new mM(n[2],this.options.loose):this.semver=ff}toString(){return this.value}test(t){if(J1("Comparator.test",t,this.options.loose),this.semver===ff||t===ff)return!0;if(typeof t=="string")try{t=new mM(t,this.options)}catch{return!1}return Z1(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new pM(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new pM(this.value,r).test(t.semver):(r=fM(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||Z1(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||Z1(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};gM.exports=Q1;var fM=md(),{safeRe:hM,t:dM}=bl(),Z1=$1(),J1=cf(),mM=_r(),pM=ui()});var hf=ae((yY,yM)=>{"use strict";var JF=ui(),QF=(e,t,r)=>{try{t=new JF(t,r)}catch{return!1}return t.test(e)};yM.exports=QF});var wM=ae((bY,bM)=>{"use strict";var e7=ui(),t7=(e,t)=>new e7(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));bM.exports=t7});var _M=ae((wY,xM)=>{"use strict";var r7=_r(),n7=ui(),i7=(e,t,r)=>{let n=null,i=null,o=null;try{o=new n7(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new r7(n,r))}),n};xM.exports=i7});var MM=ae((xY,SM)=>{"use strict";var o7=_r(),s7=ui(),a7=(e,t,r)=>{let n=null,i=null,o=null;try{o=new s7(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new o7(n,r))}),n};SM.exports=a7});var AM=ae((_Y,EM)=>{"use strict";var eg=_r(),c7=ui(),vM=lf(),l7=(e,t)=>{e=new c7(e,t);let r=new eg("0.0.0");if(e.test(r)||(r=new eg("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;i.forEach(s=>{let a=new eg(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||vM(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||vM(r,o))&&(r=o)}return r&&e.test(r)?r:null};EM.exports=l7});var IM=ae((SY,TM)=>{"use strict";var u7=ui(),f7=(e,t)=>{try{return new u7(e,t).range||"*"}catch{return null}};TM.exports=f7});var Ed=ae((MY,OM)=>{"use strict";var h7=_r(),LM=uf(),{ANY:d7}=LM,m7=ui(),p7=hf(),PM=lf(),RM=xd(),g7=Sd(),y7=_d(),b7=(e,t,r,n)=>{e=new h7(e,n),t=new m7(t,n);let i,o,s,a,c;switch(r){case">":i=PM,o=g7,s=RM,a=">",c=">=";break;case"<":i=RM,o=y7,s=PM,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(p7(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],h=null,d=null;if(u.forEach(m=>{m.semver===d7&&(m=new LM(">=0.0.0")),h=h||m,d=d||m,i(m.semver,h.semver,n)?h=m:s(m.semver,d.semver,n)&&(d=m)}),h.operator===a||h.operator===c||(!d.operator||d.operator===a)&&o(e,d.semver))return!1;if(d.operator===c&&s(e,d.semver))return!1}return!0};OM.exports=b7});var CM=ae((vY,BM)=>{"use strict";var w7=Ed(),x7=(e,t,r)=>w7(e,t,">",r);BM.exports=x7});var NM=ae((EY,DM)=>{"use strict";var _7=Ed(),S7=(e,t,r)=>_7(e,t,"<",r);DM.exports=S7});var kM=ae((AY,GM)=>{"use strict";var FM=ui(),M7=(e,t,r)=>(e=new FM(e,r),t=new FM(t,r),e.intersects(t,r));GM.exports=M7});var jM=ae((TY,UM)=>{"use strict";var v7=hf(),E7=li();UM.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((u,h)=>E7(u,h,r));for(let u of s)v7(u,t,r)?(o=u,i||(i=u)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[u,h]of n)u===h?a.push(u):!h&&u===s[0]?a.push("*"):h?u===s[0]?a.push(`<=${h}`):a.push(`${u} - ${h}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t}});var $M=ae((IY,HM)=>{"use strict";var zM=ui(),ng=uf(),{ANY:tg}=ng,rg=hf(),ig=li(),A7=(e,t,r={})=>{if(e===t)return!0;e=new zM(e,r),t=new zM(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=I7(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},T7=[new ng(">=0.0.0-0")],qM=[new ng(">=0.0.0")],I7=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===tg){if(t.length===1&&t[0].semver===tg)return!0;r.includePrerelease?e=T7:e=qM}if(t.length===1&&t[0].semver===tg){if(r.includePrerelease)return!0;t=qM}let n=new Set,i,o;for(let m of e)m.operator===">"||m.operator===">="?i=VM(i,m,r):m.operator==="<"||m.operator==="<="?o=WM(o,m,r):n.add(m.semver);if(n.size>1)return null;let s;if(i&&o){if(s=ig(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let m of n){if(i&&!rg(m,String(i),r)||o&&!rg(m,String(o),r))return null;for(let g of t)if(!rg(m,String(g),r))return!1;return!0}let a,c,l,u,h=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&o.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let m of t){if(u=u||m.operator===">"||m.operator===">=",l=l||m.operator==="<"||m.operator==="<=",i){if(d&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===d.major&&m.semver.minor===d.minor&&m.semver.patch===d.patch&&(d=!1),m.operator===">"||m.operator===">="){if(a=VM(i,m,r),a===m&&a!==i)return!1}else if(i.operator===">="&&!m.test(i.semver))return!1}if(o){if(h&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===h.major&&m.semver.minor===h.minor&&m.semver.patch===h.patch&&(h=!1),m.operator==="<"||m.operator==="<="){if(c=WM(o,m,r),c===m&&c!==o)return!1}else if(o.operator==="<="&&!m.test(o.semver))return!1}if(!m.operator&&(o||i)&&s!==0)return!1}return!(i&&l&&!o&&s!==0||o&&u&&!i&&s!==0||d||h)},VM=(e,t,r)=>{if(!e)return t;let n=ig(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},WM=(e,t,r)=>{if(!e)return t;let n=ig(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};HM.exports=A7});var ZM=ae((PY,YM)=>{"use strict";var og=bl(),KM=yl(),P7=_r(),XM=z1(),R7=Ms(),L7=wS(),O7=_S(),B7=vS(),C7=TS(),D7=PS(),N7=LS(),F7=BS(),G7=DS(),k7=li(),U7=kS(),j7=jS(),z7=wd(),q7=WS(),V7=$S(),W7=lf(),H7=xd(),$7=W1(),K7=H1(),X7=_d(),Y7=Sd(),Z7=$1(),J7=rM(),Q7=iM(),e9=uf(),t9=ui(),r9=hf(),n9=wM(),i9=_M(),o9=MM(),s9=AM(),a9=IM(),c9=Ed(),l9=CM(),u9=NM(),f9=kM(),h9=jM(),d9=$M();YM.exports={parse:R7,valid:L7,clean:O7,inc:B7,diff:C7,major:D7,minor:N7,patch:F7,prerelease:G7,compare:k7,rcompare:U7,compareLoose:j7,compareBuild:z7,sort:q7,rsort:V7,gt:W7,lt:H7,eq:$7,neq:K7,gte:X7,lte:Y7,cmp:Z7,coerce:J7,truncate:Q7,Comparator:e9,Range:t9,satisfies:r9,toComparators:n9,maxSatisfying:i9,minSatisfying:o9,minVersion:s9,validRange:a9,outside:c9,gtr:l9,ltr:u9,intersects:f9,simplifyRange:h9,subset:d9,SemVer:P7,re:og.re,src:og.src,tokens:og.t,SEMVER_SPEC_VERSION:KM.SEMVER_SPEC_VERSION,RELEASE_TYPES:KM.RELEASE_TYPES,compareIdentifiers:XM.compareIdentifiers,rcompareIdentifiers:XM.rcompareIdentifiers}});var Oo,Ad=p(()=>{Oo={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.5",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unneb\xE4ck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix B\xFCnemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","J\xE9r\xE9my Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kot\u011B\u0161ovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouci\xF1o <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugu\xE9 <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.5","@img/sharp-darwin-x64":"0.35.5","@img/sharp-freebsd-wasm32":"0.35.5","@img/sharp-libvips-darwin-arm64":"1.3.4","@img/sharp-libvips-darwin-x64":"1.3.4","@img/sharp-libvips-linux-arm":"1.3.4","@img/sharp-libvips-linux-arm64":"1.3.4","@img/sharp-libvips-linux-ppc64":"1.3.4","@img/sharp-libvips-linux-riscv64":"1.3.4","@img/sharp-libvips-linux-s390x":"1.3.4","@img/sharp-libvips-linux-x64":"1.3.4","@img/sharp-libvips-linuxmusl-arm64":"1.3.4","@img/sharp-libvips-linuxmusl-x64":"1.3.4","@img/sharp-linux-arm":"0.35.5","@img/sharp-linux-arm64":"0.35.5","@img/sharp-linux-ppc64":"0.35.5","@img/sharp-linux-riscv64":"0.35.5","@img/sharp-linux-s390x":"0.35.5","@img/sharp-linux-x64":"0.35.5","@img/sharp-linuxmusl-arm64":"0.35.5","@img/sharp-linuxmusl-x64":"0.35.5","@img/sharp-webcontainers-wasm32":"0.35.5","@img/sharp-win32-arm64":"0.35.5","@img/sharp-win32-ia32":"0.35.5","@img/sharp-win32-x64":"0.35.5"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.14","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.3","@img/sharp-libvips-dev":"1.3.4","@img/sharp-libvips-dev-wasm32":"1.3.4","@img/sharp-libvips-win32-arm64":"1.3.4","@img/sharp-libvips-win32-ia32":"1.3.4","@img/sharp-libvips-win32-x64":"1.3.4","@types/node":"*",emnapi:"^1.11.3","exif-reader":"^2.0.3",icc:"^4.0.0","node-addon-api":"^8.9.2","node-gyp":"^12.4.0",publint:"^0.3.24","tar-fs":"^3.1.3",tsd:"^0.33.0",yauzl:"^3.4.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.7"},funding:{url:"https://opencollective.com/libvips"}}});var xl,QM,df,ag,p9,e3,g9,cg,y9,t3,b9,wl,w9,x9,_9,S9,r3,M9,JM,v9,E9,n3,A9,T9,i3,sg,I9,Td,lg=p(()=>{xl=require("node:child_process"),QM=require("node:crypto"),df=pe(ZM(),1),ag=pe(dd(),1);Ad();p9=process.env.npm_package_config_libvips||Oo.config.libvips,e3=df.default.coerce(p9).version,g9=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],cg={encoding:"utf8",shell:!0},y9=e=>{e instanceof Error?console.error(`sharp: Installation error: ${e.message}`):console.log(`sharp: ${e}`)},t3=()=>ag.default.isNonGlibcLinuxSync()?ag.default.familySync():"",b9=()=>`${process.platform}${t3()}-${process.arch}`,wl=()=>{if(r3())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=process.env,n=typeof r=="string"?r:t3();return`${t||process.platform}${n}-${e||process.arch}`},w9=()=>{try{return require(`@img/sharp-libvips-dev-${wl()}/include`)}catch{try{return require("@img/sharp-libvips-dev/include")}catch{}}return""},x9=()=>{try{return require("@img/sharp-libvips-dev/cplusplus")}catch{}return""},_9=()=>{try{return require(`@img/sharp-libvips-dev-${wl()}/lib`)}catch{try{return require(`@img/sharp-libvips-${wl()}/lib`)}catch{}}return""},S9=()=>{var e;if(((e=process.release)==null?void 0:e.name)==="node"&&process.versions&&!df.default.satisfies(process.versions.node,Oo.engines.node))return{found:process.versions.node,expected:Oo.engines.node}},r3=()=>{let{CC:e}=process.env;return!!(e!=null&&e.endsWith("/emcc"))},M9=()=>process.platform==="darwin"&&process.arch==="x64"?((0,xl.spawnSync)("sysctl sysctl.proc_translated",cg).stdout||"").trim()==="sysctl.proc_translated: 1":!1,JM=e=>(0,QM.createHash)("sha512").update(e).digest("hex"),v9=()=>{try{let e=JM(`imgsharp-libvips-${wl()}`),t=df.default.coerce(Oo.optionalDependencies[`@img/sharp-libvips-${wl()}`],{includePrerelease:!0}).version;return JM(`${e}npm:${t}`).slice(0,10)}catch{}return""},E9=()=>(0,xl.spawnSync)(`node-gyp rebuild --directory=src ${r3()?"--nodedir=emscripten":""}`,{...cg,stdio:"inherit"}).status,n3=()=>process.platform!=="win32"?((0,xl.spawnSync)("pkg-config --modversion vips-cpp",{...cg,env:{...process.env,PKG_CONFIG_PATH:i3()}}).stdout||"").trim():"",A9=()=>{try{let e=((0,xl.spawnSync)("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(e)return`${e}/lib/pkgconfig`}catch{}},T9=()=>{try{let e=((0,xl.spawnSync)("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(e)return e}catch{}},i3=()=>process.platform!=="win32"?[A9(),T9(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":"):"",sg=(e,t,r)=>(r&&r(`Detected ${t}, skipping search for globally-installed libvips`),e),I9=e=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return sg(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return sg(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(M9())return sg(!1,"Rosetta",e);let t=n3();return!!t&&df.default.gte(t,e3)},Td={minimumLibvipsVersion:e3,prebuiltPlatforms:g9,buildPlatformArch:wl,buildSharpLibvipsIncludeDir:w9,buildSharpLibvipsCPlusPlusDir:x9,buildSharpLibvipsLibDir:_9,isUnsupportedNodeRuntime:S9,runtimePlatformArch:b9,log:y9,yarnLocator:v9,spawnRebuild:E9,globalLibvipsVersion:n3,pkgConfigPath:i3,useGlobalLibvips:I9}});var s3,Id,O9,sr,a3,P9,o3,R9,L9,Bo,gt,vs,rt,mf=p(()=>{s3=require("node:module"),Id=pe(dd(),1);lg();Ad();O9={};sr=(0,s3.createRequire)(O9.url),{version:a3}=Oo,{runtimePlatformArch:P9,isUnsupportedNodeRuntime:o3,prebuiltPlatforms:R9,minimumLibvipsVersion:L9}=Td,Bo=P9(),vs=[];try{gt=sr(`../src/build/Release/sharp-${Bo}-${a3}.node`)}catch(e){vs.push(e)}if(!gt)try{gt=sr(`../src/build/Release/sharp-wasm32-${a3}.node`)}catch(e){vs.push(e)}if(!gt)try{switch(Bo){case"darwin-arm64":gt=sr("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":gt=sr("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":gt=sr("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":gt=sr("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":gt=sr("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":gt=sr("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":gt=sr("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":gt=sr("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":gt=sr("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":gt=sr("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":gt=sr("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":gt=sr("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":gt=sr("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":gt=sr("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":gt=sr("@img/sharp-webcontainers-wasm32/sharp.node");break}if(gt&&["linux-x64","linuxmusl-x64"].includes(Bo)&&!gt._isUsingX64V2()){let e=new Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");e.code="Unsupported CPU",vs.push(e),gt=null}gt&&process.versions.electron&&Bo.startsWith("linux")&&process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(e){vs.push(e)}if(!gt)try{gt=sr("@img/sharp-wasm32/sharp.node")}catch(e){vs.push(e)}if(!gt){let[e,t,r]=["linux","darwin","win32"].map(o=>Bo.startsWith(o)),n=[`Could not load the "sharp" module using the ${Bo} runtime`];vs.forEach(o=>{var s;(s=o.code)!=null&&s.endsWith("MODULE_NOT_FOUND")||n.push(o.code?`${o.code}: ${o.message}`:o.message)});let i=vs.map(o=>o.message).join(" ");if(n.push("Possible solutions:"),o3()){let{found:o,expected:s}=o3();n.push("- Please upgrade Node.js:",` Found ${o}`,` Requires ${s}`)}else if(R9.includes(Bo)&&!/libstdc\+\+\.so/.test(i)){let[o,s]=Bo.split("-"),a=o.endsWith("musl")?" --libc=musl":"";n.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${o.replace("musl","")}${a} --cpu=${s} sharp`)}else n.push(`- Manually install libvips >= ${L9}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(i))try{let{config:o}=sr(`@img/sharp-libvips-${Bo}/package`),s=`${(0,Id.familySync)()} ${(0,Id.versionSync)()}`,a=`${o.musl?"musl":"glibc"} ${o.musl||o.glibc}`;n.push("- Update your OS:",` Found ${s}`,` Requires ${a}`)}catch{}throw e&&/\/snap\/core[0-9]{2}/.test(i)&&n.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(i)&&n.push("- Update Homebrew:"," brew update && brew upgrade vips"),vs.some(o=>o.code==="ERR_DLOPEN_DISABLED")&&n.push("- Run Node.js without using the --no-addons flag"),r&&/The specified procedure could not be found/.test(i)&&n.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),n.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(n.join(`
2
- `))}rt=gt});function D9(){let e=this.constructor.call(),{debuglog:t,queueListener:r,...n}=this.options;return e.options=structuredClone(n),e.options.debuglog=t,e.options.queueListener=r,this._isStreamInput()&&this._whenStreamInFinished(()=>{this._flattenBufferIn(),e.options.input.buffer=this.options.input.buffer,e.emit("finish")}),e}var c3,Pd,B9,C9,Ya,to,l3=p(()=>{c3=pe(require("node:util"),1),Pd=pe(require("node:stream"),1);Yi();mf();B9=c3.default.debuglog("sharp"),C9=e=>{Ya.queue.emit("change",e)},Ya=function(e,t){if(arguments.length===1&&!f.defined(e))throw new Error("Invalid input");return this instanceof Ya?(Pd.default.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:r=>{this.emit("warning",r),B9(r)},queueListener:C9},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this):new Ya(e,t)};Object.setPrototypeOf(Ya.prototype,Pd.default.Duplex.prototype);Object.setPrototypeOf(Ya,Pd.default.Duplex);Object.assign(Ya.prototype,{clone:D9});to=Ya});function u3(e){let t=F9.filter(r=>f.defined(e[r])).map(r=>[r,e[r]]);return t.length?Object.fromEntries(t):void 0}function G9(e,t,r){let n={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(f.string(e))n.file=e;else if(f.buffer(e)){if(e.length===0)throw Error("Input Buffer is empty");n.buffer=e}else if(f.arrayBuffer(e)){if(e.byteLength===0)throw Error("Input bit Array is empty");n.buffer=Buffer.from(e,0,e.byteLength)}else if(f.typedArray(e)){if(e.length===0)throw Error("Input Bit Array is empty");n.buffer=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(f.plainObject(e)&&!f.defined(t))t=e,u3(t)&&(n.buffer=[]);else if(!f.defined(e)&&!f.defined(t)&&f.object(r)&&r.allowStream)n.buffer=[];else if(Array.isArray(e))if(e.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=e.map(i=>this._createInputDescriptor(i));else throw new Error("Recursive join is unsupported");else throw new Error("Expected at least two images to join");else throw new Error(`Unsupported input '${e}' of type ${typeof e}${f.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(f.object(t)){if(f.defined(t.failOn))if(f.string(t.failOn)&&f.inArray(t.failOn,["none","truncated","error","warning"]))n.failOn=t.failOn;else throw f.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(f.defined(t.autoOrient))if(f.bool(t.autoOrient))n.autoOrient=t.autoOrient;else throw f.invalidParameterError("autoOrient","boolean",t.autoOrient);if(f.defined(t.density))if(f.number(t.density)&&f.inRange(t.density,1,1e5))n.density=t.density;else throw f.invalidParameterError("density","number between 1 and 100000",t.density);if(f.defined(t.ignoreIcc))if(f.bool(t.ignoreIcc))n.ignoreIcc=t.ignoreIcc;else throw f.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(f.defined(t.limitInputPixels))if(f.bool(t.limitInputPixels))n.limitInputPixels=t.limitInputPixels?16383**2:0;else if(f.integer(t.limitInputPixels)&&f.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))n.limitInputPixels=t.limitInputPixels;else throw f.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(f.defined(t.limitInputChannels))if(f.bool(t.limitInputChannels))n.limitInputChannels=t.limitInputChannels?5:0;else if(f.integer(t.limitInputChannels)&&f.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))n.limitInputChannels=t.limitInputChannels;else throw f.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(f.defined(t.unlimited))if(f.bool(t.unlimited))n.unlimited=t.unlimited;else throw f.invalidParameterError("unlimited","boolean",t.unlimited);if(f.defined(t.sequentialRead))if(f.bool(t.sequentialRead))n.sequentialRead=t.sequentialRead;else throw f.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(f.defined(t.raw)){if(f.object(t.raw)&&f.integer(t.raw.width)&&f.inRange(t.raw.width,1,1e8)&&f.integer(t.raw.height)&&f.inRange(t.raw.height,1,1e8)&&f.integer(t.raw.channels)&&f.inRange(t.raw.channels,1,4))switch(n.rawWidth=t.raw.width,n.rawHeight=t.raw.height,n.rawChannels=t.raw.channels,e.constructor){case Uint8Array:case Uint8ClampedArray:n.rawDepth="uchar";break;case Int8Array:n.rawDepth="char";break;case Uint16Array:n.rawDepth="ushort";break;case Int16Array:n.rawDepth="short";break;case Uint32Array:n.rawDepth="uint";break;case Int32Array:n.rawDepth="int";break;case Float32Array:n.rawDepth="float";break;case Float64Array:n.rawDepth="double";break;default:n.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(n.rawPremultiplied=!1,f.defined(t.raw.premultiplied))if(f.bool(t.raw.premultiplied))n.rawPremultiplied=t.raw.premultiplied;else throw f.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(n.rawPageHeight=0,f.defined(t.raw.pageHeight))if(f.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw new Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);n.rawPageHeight=t.raw.pageHeight}else throw f.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(f.defined(t.animated))if(f.bool(t.animated))n.pages=t.animated?-1:1;else throw f.invalidParameterError("animated","boolean",t.animated);if(f.defined(t.pages))if(f.integer(t.pages)&&f.inRange(t.pages,-1,1e5))n.pages=t.pages;else throw f.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(f.defined(t.page))if(f.integer(t.page)&&f.inRange(t.page,0,1e5))n.page=t.page;else throw f.invalidParameterError("page","integer between 0 and 100000",t.page);if(f.object(t.openSlide)&&f.defined(t.openSlide.level))if(f.integer(t.openSlide.level)&&f.inRange(t.openSlide.level,0,256))n.openSlideLevel=t.openSlide.level;else throw f.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(f.defined(t.level))if(f.integer(t.level)&&f.inRange(t.level,0,256))n.openSlideLevel=t.level;else throw f.invalidParameterError("level","integer between 0 and 256",t.level);if(f.object(t.tiff)&&f.defined(t.tiff.subifd))if(f.integer(t.tiff.subifd)&&f.inRange(t.tiff.subifd,-1,1e5))n.tiffSubifd=t.tiff.subifd;else throw f.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(f.defined(t.subifd))if(f.integer(t.subifd)&&f.inRange(t.subifd,-1,1e5))n.tiffSubifd=t.subifd;else throw f.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(f.object(t.svg)){if(f.defined(t.svg.stylesheet))if(f.string(t.svg.stylesheet))n.svgStylesheet=t.svg.stylesheet;else throw f.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(f.defined(t.svg.highBitdepth))if(f.bool(t.svg.highBitdepth))n.svgHighBitdepth=t.svg.highBitdepth;else throw f.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(f.object(t.pdf)&&f.defined(t.pdf.background)?n.pdfBackground=this._getBackgroundColourOption(t.pdf.background):f.defined(t.pdfBackground)&&(n.pdfBackground=this._getBackgroundColourOption(t.pdfBackground)),f.object(t.jp2)&&f.defined(t.jp2.oneshot))if(f.bool(t.jp2.oneshot))n.jp2Oneshot=t.jp2.oneshot;else throw f.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(f.defined(t.create))if(f.object(t.create)&&f.integer(t.create.width)&&f.inRange(t.create.width,1,1e8)&&f.integer(t.create.height)&&f.inRange(t.create.height,1,1e8)&&f.integer(t.create.channels)){if(n.createWidth=t.create.width,n.createHeight=t.create.height,n.createChannels=t.create.channels,n.createPageHeight=0,f.defined(t.create.pageHeight))if(f.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw new Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);n.createPageHeight=t.create.pageHeight}else throw f.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(f.defined(t.create.noise)){if(!f.object(t.create.noise))throw new Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(n.createNoiseType=t.create.noise.type,!f.inRange(t.create.channels,1,4))throw f.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(n.createNoiseMean=128,f.defined(t.create.noise.mean))if(f.number(t.create.noise.mean)&&f.inRange(t.create.noise.mean,0,1e4))n.createNoiseMean=t.create.noise.mean;else throw f.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(n.createNoiseSigma=30,f.defined(t.create.noise.sigma))if(f.number(t.create.noise.sigma)&&f.inRange(t.create.noise.sigma,0,1e4))n.createNoiseSigma=t.create.noise.sigma;else throw f.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(f.defined(t.create.background)){if(!f.inRange(t.create.channels,3,4))throw f.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);n.createBackground=this._getBackgroundColourOption(t.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete n.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(f.defined(t.text))if(f.object(t.text)&&f.string(t.text.text)){if(n.textValue=t.text.text,f.defined(t.text.height)&&f.defined(t.text.dpi))throw new Error("Expected only one of dpi or height");if(f.defined(t.text.font))if(f.string(t.text.font))n.textFont=t.text.font;else throw f.invalidParameterError("text.font","string",t.text.font);if(f.defined(t.text.fontfile))if(f.string(t.text.fontfile))n.textFontfile=t.text.fontfile;else throw f.invalidParameterError("text.fontfile","string",t.text.fontfile);if(f.defined(t.text.width))if(f.integer(t.text.width)&&f.inRange(t.text.width,1,1e6))n.textWidth=t.text.width;else throw f.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(f.defined(t.text.height))if(f.integer(t.text.height)&&f.inRange(t.text.height,1,1e6))n.textHeight=t.text.height;else throw f.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(f.defined(t.text.align))if(f.string(t.text.align)&&f.string(this.constructor.align[t.text.align]))n.textAlign=this.constructor.align[t.text.align];else throw f.invalidParameterError("text.align","valid alignment",t.text.align);if(f.defined(t.text.justify))if(f.bool(t.text.justify))n.textJustify=t.text.justify;else throw f.invalidParameterError("text.justify","boolean",t.text.justify);if(f.defined(t.text.dpi))if(f.integer(t.text.dpi)&&f.inRange(t.text.dpi,1,1e6))n.textDpi=t.text.dpi;else throw f.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(f.defined(t.text.rgba))if(f.bool(t.text.rgba))n.textRgba=t.text.rgba;else throw f.invalidParameterError("text.rgba","bool",t.text.rgba);if(f.defined(t.text.spacing))if(f.integer(t.text.spacing)&&f.inRange(t.text.spacing,-1e6,1e6))n.textSpacing=t.text.spacing;else throw f.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(f.defined(t.text.wrap))if(f.string(t.text.wrap)&&f.inArray(t.text.wrap,["word","char","word-char","none"]))n.textWrap=t.text.wrap;else throw f.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete n.buffer}else throw new Error("Expected a valid string to create an image with text.");if(f.defined(t.join))if(f.defined(this.options.join)){if(f.defined(t.join.animated))if(f.bool(t.join.animated))n.joinAnimated=t.join.animated;else throw f.invalidParameterError("join.animated","boolean",t.join.animated);if(f.defined(t.join.across))if(f.integer(t.join.across)&&f.inRange(t.join.across,1,1e6))n.joinAcross=t.join.across;else throw f.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(f.defined(t.join.shim))if(f.integer(t.join.shim)&&f.inRange(t.join.shim,0,1e6))n.joinShim=t.join.shim;else throw f.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(f.defined(t.join.background)&&(n.joinBackground=this._getBackgroundColourOption(t.join.background)),f.defined(t.join.halign))if(f.string(t.join.halign)&&f.string(this.constructor.align[t.join.halign]))n.joinHalign=this.constructor.align[t.join.halign];else throw f.invalidParameterError("join.halign","valid alignment",t.join.halign);if(f.defined(t.join.valign))if(f.string(t.join.valign)&&f.string(this.constructor.align[t.join.valign]))n.joinValign=this.constructor.align[t.join.valign];else throw f.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(f.defined(t))throw new Error(`Invalid input options ${t}`);return n}function k9(e,t,r){Array.isArray(this.options.input.buffer)?f.buffer(e)?(this.options.input.buffer.push(e),r()):r(new Error("Non-Buffer data on Writable Stream")):r(new Error("Unexpected data on Writable Stream"))}function U9(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function j9(){return Array.isArray(this.options.input.buffer)}function z9(e){this.writableFinished?e():this.once("finish",e)}function q9(e){let t=Error();return f.fn(e)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),rt.metadata(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)})}):rt.metadata(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),rt.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}):new Promise((r,n)=>{rt.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}function V9(e){let t=Error();return f.fn(e)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),rt.stats(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)})}):rt.stats(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),rt.stats(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}):new Promise((r,n)=>{rt.stats(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}var N9,F9,f3,h3=p(()=>{Yi();mf();N9={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},F9=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"];f3=e=>{Object.assign(e.prototype,{_inputOptionsFromObject:u3,_createInputDescriptor:G9,_write:k9,_flattenBufferIn:U9,_isStreamInput:j9,_whenStreamInFinished:z9,metadata:q9,stats:V9}),e.align=N9}});function fg(e){return e.angle%360!==0||e.rotationAngle!==0}function Rd(e){return e.width!==-1||e.height!==-1}function $9(e,t,r){if(Rd(this.options)&&this.options.debuglog("ignoring previous resize options"),this.options.widthPost!==-1&&this.options.debuglog("operation order will be: extract, resize, extract"),f.defined(e))if(f.object(e)&&!f.defined(r))r=e;else if(f.integer(e)&&f.inRange(e,1,1e8))this.options.width=e;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",e);else this.options.width=-1;if(f.defined(t))if(f.integer(t)&&f.inRange(t,1,1e8))this.options.height=t;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",t);else this.options.height=-1;if(f.object(r)){if(f.defined(r.width))if(f.integer(r.width)&&f.inRange(r.width,1,1e8))this.options.width=r.width;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",r.width);if(f.defined(r.height))if(f.integer(r.height)&&f.inRange(r.height,1,1e8))this.options.height=r.height;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",r.height);if(f.defined(r.fit)){let n=H9[r.fit];if(f.string(n))this.options.canvas=n;else throw f.invalidParameterError("fit","valid fit",r.fit)}if(f.defined(r.position)){let n=f.integer(r.position)?r.position:g3[r.position]||p3[r.position]||m3[r.position];if(f.integer(n)&&(f.inRange(n,0,8)||f.inRange(n,16,17)))this.options.position=n;else throw f.invalidParameterError("position","valid position/gravity/strategy",r.position)}if(this._setBackgroundColourOption("resizeBackground",r.background),f.defined(r.kernel))if(f.string(ug[r.kernel]))this.options.kernel=ug[r.kernel];else throw f.invalidParameterError("kernel","valid kernel name",r.kernel);f.defined(r.withoutEnlargement)&&this._setBooleanOption("withoutEnlargement",r.withoutEnlargement),f.defined(r.withoutReduction)&&this._setBooleanOption("withoutReduction",r.withoutReduction),f.defined(r.fastShrinkOnLoad)&&this._setBooleanOption("fastShrinkOnLoad",r.fastShrinkOnLoad)}return fg(this.options)&&Rd(this.options)&&(this.options.rotateBefore=!0),this}function K9(e){if(f.integer(e))if(f.inRange(e,1,1e8))this.options.extendTop=e,this.options.extendBottom=e,this.options.extendLeft=e,this.options.extendRight=e;else throw f.invalidParameterError("extend","integer between 1 and 100000000",e);else if(f.object(e)){if(f.defined(e.top))if(f.integer(e.top)&&f.inRange(e.top,0,1e8))this.options.extendTop=e.top;else throw f.invalidParameterError("top","integer between 0 and 100000000",e.top);if(f.defined(e.bottom))if(f.integer(e.bottom)&&f.inRange(e.bottom,0,1e8))this.options.extendBottom=e.bottom;else throw f.invalidParameterError("bottom","integer between 0 and 100000000",e.bottom);if(f.defined(e.left))if(f.integer(e.left)&&f.inRange(e.left,0,1e8))this.options.extendLeft=e.left;else throw f.invalidParameterError("left","integer between 0 and 100000000",e.left);if(f.defined(e.right))if(f.integer(e.right)&&f.inRange(e.right,0,1e8))this.options.extendRight=e.right;else throw f.invalidParameterError("right","integer between 0 and 100000000",e.right);if(this._setBackgroundColourOption("extendBackground",e.background),f.defined(e.extendWith))if(f.string(d3[e.extendWith]))this.options.extendWith=d3[e.extendWith];else throw f.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",e.extendWith)}else throw f.invalidParameterError("extend","integer or object",e);return this}function X9(e){let t=Rd(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${t}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(r){let n=e[r];if(f.integer(n)&&f.inRange(n,0,1e8))this.options[r+(r==="left"||r==="top"?"Offset":"")+t]=n;else throw f.invalidParameterError(r,"integer between 0 and 100000000",n)},this),fg(this.options)&&!Rd(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function Y9(e){if(this.options.trimThreshold=10,f.defined(e))if(f.object(e)){if(f.defined(e.background)&&this._setBackgroundColourOption("trimBackground",e.background),f.defined(e.threshold))if(f.number(e.threshold)&&e.threshold>=0)this.options.trimThreshold=e.threshold;else throw f.invalidParameterError("threshold","positive number",e.threshold);if(f.defined(e.lineArt)&&this._setBooleanOption("trimLineArt",e.lineArt),f.defined(e.margin))if(f.integer(e.margin)&&f.inRange(e.margin,0,1e7))this.options.trimMargin=e.margin;else throw f.invalidParameterError("margin","integer between 0 and 10000000",e.margin)}else throw f.invalidParameterError("trim","object",e);return fg(this.options)&&(this.options.rotateBefore=!0),this}var m3,p3,d3,g3,ug,W9,H9,y3,b3=p(()=>{Yi();m3={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},p3={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},d3={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},g3={entropy:16,attention:17},ug={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},W9={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},H9={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};y3=e=>{Object.assign(e.prototype,{resize:$9,extend:K9,extract:X9,trim:Y9}),e.gravity=m3,e.strategy=g3,e.kernel=ug,e.fit=W9,e.position=p3}});function Z9(e){if(!Array.isArray(e))throw f.invalidParameterError("images to composite","array",e);return this.options.composite=e.map(t=>{if(!f.object(t))throw f.invalidParameterError("image to composite","object",t);let r=this._inputOptionsFromObject(t),n={input:this._createInputDescriptor(t.input,r,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(f.defined(t.blend))if(f.string(hg[t.blend]))n.blend=hg[t.blend];else throw f.invalidParameterError("blend","valid blend name",t.blend);if(f.defined(t.tile))if(f.bool(t.tile))n.tile=t.tile;else throw f.invalidParameterError("tile","boolean",t.tile);if(f.defined(t.left))if(f.integer(t.left)&&f.inRange(t.left,-1e8,1e8))n.left=t.left;else throw f.invalidParameterError("left","integer between -100000000 and 100000000",t.left);if(f.defined(t.top))if(f.integer(t.top)&&f.inRange(t.top,-1e8,1e8))n.top=t.top;else throw f.invalidParameterError("top","integer between -100000000 and 100000000",t.top);if(f.defined(t.top)!==f.defined(t.left))throw new Error("Expected both left and top to be set");if(n.hasOffset=f.integer(t.top)&&f.integer(t.left),f.defined(t.gravity))if(f.integer(t.gravity)&&f.inRange(t.gravity,0,8))n.gravity=t.gravity;else if(f.string(t.gravity)&&f.integer(this.constructor.gravity[t.gravity]))n.gravity=this.constructor.gravity[t.gravity];else throw f.invalidParameterError("gravity","valid gravity",t.gravity);if(f.defined(t.premultiplied))if(f.bool(t.premultiplied))n.premultiplied=t.premultiplied;else throw f.invalidParameterError("premultiplied","boolean",t.premultiplied);return n}),this}var hg,w3,x3=p(()=>{Yi();hg={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};w3=e=>{e.prototype.composite=Z9,e.blend=hg}});function J9(e,t){if(!f.defined(e))return this.autoOrient();if((this.options.angle||this.options.rotationAngle)&&(this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0),f.integer(e)&&!(e%90))this.options.angle=e;else if(f.number(e))this.options.rotationAngle=e,f.object(t)&&t.background&&this._setBackgroundColourOption("rotationBackground",t.background);else throw f.invalidParameterError("angle","numeric",e);return this}function Q9(){return this.options.input.autoOrient=!0,this}function eG(e){return this.options.flip=f.bool(e)?e:!0,this}function tG(e){return this.options.flop=f.bool(e)?e:!0,this}function rG(e,t){let n=Array.isArray(e)&&(e.length===4&&e.every(f.number)||e.length===2&&e.every(i=>Array.isArray(i)&&i.length===2))?e.flat():[];if(n.length===4&&n.every(f.number))this.options.affineMatrix=n;else throw f.invalidParameterError("matrix","1x4 or 2x2 array",e);if(f.defined(t))if(f.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),f.defined(t.idx))if(f.number(t.idx))this.options.affineIdx=t.idx;else throw f.invalidParameterError("options.idx","number",t.idx);if(f.defined(t.idy))if(f.number(t.idy))this.options.affineIdy=t.idy;else throw f.invalidParameterError("options.idy","number",t.idy);if(f.defined(t.odx))if(f.number(t.odx))this.options.affineOdx=t.odx;else throw f.invalidParameterError("options.odx","number",t.odx);if(f.defined(t.ody))if(f.number(t.ody))this.options.affineOdy=t.ody;else throw f.invalidParameterError("options.ody","number",t.ody);if(f.defined(t.interpolator))if(f.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw f.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw f.invalidParameterError("options","object",t);return this}function nG(e){if(f.plainObject(e)){if(f.number(e.sigma)&&f.inRange(e.sigma,1e-6,10))this.options.sharpenSigma=e.sigma;else throw f.invalidParameterError("options.sigma","number between 0.000001 and 10",e.sigma);if(f.defined(e.m1))if(f.number(e.m1)&&f.inRange(e.m1,0,1e6))this.options.sharpenM1=e.m1;else throw f.invalidParameterError("options.m1","number between 0 and 1000000",e.m1);if(f.defined(e.m2))if(f.number(e.m2)&&f.inRange(e.m2,0,1e6))this.options.sharpenM2=e.m2;else throw f.invalidParameterError("options.m2","number between 0 and 1000000",e.m2);if(f.defined(e.x1))if(f.number(e.x1)&&f.inRange(e.x1,0,1e6))this.options.sharpenX1=e.x1;else throw f.invalidParameterError("options.x1","number between 0 and 1000000",e.x1);if(f.defined(e.y2))if(f.number(e.y2)&&f.inRange(e.y2,0,1e6))this.options.sharpenY2=e.y2;else throw f.invalidParameterError("options.y2","number between 0 and 1000000",e.y2);if(f.defined(e.y3))if(f.number(e.y3)&&f.inRange(e.y3,0,1e6))this.options.sharpenY3=e.y3;else throw f.invalidParameterError("options.y3","number between 0 and 1000000",e.y3)}else this.options.sharpenSigma=-1;return this}function iG(e){if(!f.defined(e))this.options.medianSize=3;else if(f.integer(e)&&f.inRange(e,1,1e3))this.options.medianSize=e;else throw f.invalidParameterError("size","integer between 1 and 1000",e);return this}function oG(e){let t;if(f.number(e))t=e;else if(f.plainObject(e)){if(!f.number(e.sigma))throw f.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=e.sigma,"precision"in e)if(f.string(_3[e.precision]))this.options.precision=_3[e.precision];else throw f.invalidParameterError("precision","one of: integer, float, approximate",e.precision);if("minAmplitude"in e)if(f.number(e.minAmplitude)&&f.inRange(e.minAmplitude,.001,1))this.options.minAmpl=e.minAmplitude;else throw f.invalidParameterError("minAmplitude","number between 0.001 and 1",e.minAmplitude)}if(!f.defined(e))this.options.blurSigma=-1;else if(f.bool(e))this.options.blurSigma=e?-1:0;else if(f.number(t)&&f.inRange(t,.3,1e3))this.options.blurSigma=t;else throw f.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function sG(e){if(!f.defined(e))this.options.dilateWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.dilateWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function aG(e){if(!f.defined(e))this.options.erodeWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.erodeWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function cG(e){return this.options.flatten=f.bool(e)?e:!0,f.object(e)&&this._setBackgroundColourOption("flattenBackground",e.background),this}function lG(){return this.options.unflatten=!0,this}function uG(e,t){if(!f.defined(e))this.options.gamma=2.2;else if(f.number(e)&&f.inRange(e,1,3))this.options.gamma=e;else throw f.invalidParameterError("gamma","number between 1.0 and 3.0",e);if(!f.defined(t))this.options.gammaOut=this.options.gamma;else if(f.number(t)&&f.inRange(t,1,3))this.options.gammaOut=t;else throw f.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function fG(e){if(this.options.negate=f.bool(e)?e:!0,f.plainObject(e)&&"alpha"in e)if(f.bool(e.alpha))this.options.negateAlpha=e.alpha;else throw f.invalidParameterError("alpha","should be boolean value",e.alpha);return this}function hG(e){if(f.plainObject(e)){if(f.defined(e.lower))if(f.number(e.lower)&&f.inRange(e.lower,0,99))this.options.normaliseLower=e.lower;else throw f.invalidParameterError("lower","number between 0 and 99",e.lower);if(f.defined(e.upper))if(f.number(e.upper)&&f.inRange(e.upper,1,100))this.options.normaliseUpper=e.upper;else throw f.invalidParameterError("upper","number between 1 and 100",e.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw f.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function dG(e){return this.normalise(e)}function mG(e){if(f.plainObject(e)){if(f.integer(e.width)&&f.inRange(e.width,1,65536))this.options.claheWidth=e.width;else throw f.invalidParameterError("width","integer between 1 and 65536",e.width);if(f.integer(e.height)&&f.inRange(e.height,1,65536))this.options.claheHeight=e.height;else throw f.invalidParameterError("height","integer between 1 and 65536",e.height);if(f.defined(e.maxSlope))if(f.integer(e.maxSlope)&&f.inRange(e.maxSlope,0,100))this.options.claheMaxSlope=e.maxSlope;else throw f.invalidParameterError("maxSlope","integer between 0 and 100",e.maxSlope)}else throw f.invalidParameterError("options","plain object",e);return this}function pG(e){if(!f.object(e)||!Array.isArray(e.kernel)||!f.integer(e.width)||!f.integer(e.height)||!f.inRange(e.width,3,1001)||!f.inRange(e.height,3,1001)||e.height*e.width!==e.kernel.length||!e.kernel.every(f.number))throw new Error("Invalid convolution kernel");return f.integer(e.scale)||(e.scale=e.kernel.reduce((t,r)=>t+r,0)),e.scale<1&&(e.scale=1),f.integer(e.offset)||(e.offset=0),this.options.convKernel=e,this}function gG(e,t){if(!f.defined(e))this.options.threshold=128;else if(f.bool(e))this.options.threshold=e?128:0;else if(f.integer(e)&&f.inRange(e,0,255))this.options.threshold=e;else throw f.invalidParameterError("threshold","integer between 0 and 255",e);return!f.object(t)||t.greyscale===!0||t.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function yG(e,t,r){if(this.options.boolean=this._createInputDescriptor(e,r),f.string(t)&&f.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw f.invalidParameterError("operator","one of: and, or, eor",t);return this}function bG(e,t){if(!f.defined(e)&&f.number(t)?e=1:f.number(e)&&!f.defined(t)&&(t=0),!f.defined(e))this.options.linearA=[];else if(f.number(e))this.options.linearA=[e];else if(Array.isArray(e)&&f.inRange(e.length,1,1e6)&&e.every(f.number))this.options.linearA=e;else throw f.invalidParameterError("a","number or array of numbers",e);if(!f.defined(t))this.options.linearB=[];else if(f.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&f.inRange(t.length,1,1e6)&&t.every(f.number))this.options.linearB=t;else throw f.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw new Error("Expected a and b to be arrays of the same length");return this}function wG(e){if(!Array.isArray(e))throw f.invalidParameterError("inputMatrix","array",e);let t=e.length;if(t!==3&&t!==4)throw f.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!e.every(n=>Array.isArray(n)&&n.length===t))throw f.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,e);let r=e.flat();if(!r.every(f.number))throw f.invalidParameterError("inputMatrix","array of numbers",r);return this.options.recombMatrix=r,this}function xG(e){if(!f.plainObject(e))throw f.invalidParameterError("options","plain object",e);if("brightness"in e)if(f.number(e.brightness)&&e.brightness>=0)this.options.brightness=e.brightness;else throw f.invalidParameterError("brightness","number above zero",e.brightness);if("saturation"in e)if(f.number(e.saturation)&&e.saturation>=0)this.options.saturation=e.saturation;else throw f.invalidParameterError("saturation","number above zero",e.saturation);if("hue"in e)if(f.integer(e.hue))this.options.hue=e.hue%360;else throw f.invalidParameterError("hue","number",e.hue);if("lightness"in e)if(f.number(e.lightness))this.options.lightness=e.lightness;else throw f.invalidParameterError("lightness","number",e.lightness);return this}var _3,S3,M3=p(()=>{Yi();_3={integer:"integer",float:"float",approximate:"approximate"};S3=e=>{Object.assign(e.prototype,{autoOrient:Q9,rotate:J9,flip:eG,flop:tG,affine:rG,sharpen:nG,erode:aG,dilate:sG,median:iG,blur:oG,flatten:cG,unflatten:lG,gamma:uG,negate:fG,normalise:hG,normalize:dG,clahe:mG,convolve:pG,threshold:gG,boolean:yG,linear:bG,recomb:wG,modulate:xG})}});var P3=ae((KY,I3)=>{var yg=Object.defineProperty,_G=Object.getOwnPropertyDescriptor,SG=Object.getOwnPropertyNames,MG=Object.prototype.hasOwnProperty,vG=(e,t)=>{for(var r in t)yg(e,r,{get:t[r],enumerable:!0})},EG=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of SG(t))!MG.call(e,i)&&i!==r&&yg(e,i,{get:()=>t[i],enumerable:!(n=_G(t,i))||n.enumerable});return e},AG=e=>EG(yg({},"__esModule",{value:!0}),e),v3={};vG(v3,{default:()=>UG});I3.exports=AG(v3);var dg={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in dg)Object.freeze(dg[e]);var ro=Object.freeze(dg),E3=Object.create(null);for(let e in ro)Object.hasOwn(ro,e)&&(E3[ro[e]]=e);var pn={to:{},get:{}};pn.get=function(e){let t=e.slice(0,3).toLowerCase(),r,n;switch(t){case"hsl":{r=pn.get.hsl(e),n="hsl";break}case"hwb":{r=pn.get.hwb(e),n="hwb";break}default:{r=pn.get.rgb(e),n="rgb";break}}return r?{model:n,value:r}:null};pn.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,r=/^#([a-f\d]{6})([a-f\d]{2})?$/i,n=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,i=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,o=/^(\w+)$/,s=[0,0,0,1],a,c,l;if(a=e.match(r)){for(l=a[2],a=a[1],c=0;c<3;c++){let u=c*2;s[c]=Number.parseInt(a.slice(u,u+2),16)}l&&(s[3]=Number.parseInt(l,16)/255)}else if(a=e.match(t)){for(a=a[1],l=a[3],c=0;c<3;c++)s[c]=Number.parseInt(a[c]+a[c],16);l&&(s[3]=Number.parseInt(l+l,16)/255)}else if(a=e.match(n)){for(c=0;c<3;c++)s[c]=Number.parseFloat(a[c+1]);a[4]&&(s[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else if(a=e.match(i)){for(c=0;c<3;c++)s[c]=Math.round(Number.parseFloat(a[c+1])*2.55);a[4]&&(s[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else return(a=e.toLowerCase().match(o))?a[1]==="transparent"?[0,0,0,0]:Object.hasOwn(ro,a[1])?(s=ro[a[1]].slice(),s[3]=1,s):null:null;for(c=0;c<3;c++)s[c]=Es(s[c],0,255);return s[3]=Es(s[3],0,1),s};pn.get.hsl=function(e){if(!e)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,o=Es(Number.parseFloat(r[2]),0,100),s=Es(Number.parseFloat(r[3]),0,100),a=Es(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};pn.get.hwb=function(e){if(!e)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,o=Es(Number.parseFloat(r[2]),0,100),s=Es(Number.parseFloat(r[3]),0,100),a=Es(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};pn.to.hex=function(...e){return"#"+Ld(e[0])+Ld(e[1])+Ld(e[2])+(e[3]<1?Ld(Math.round(e[3]*255)):"")};pn.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};pn.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"};pn.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};pn.to.hwb=function(...e){let t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};pn.to.keyword=function(...e){return E3[e.slice(0,3)]};function Es(e,t,r){return Math.min(Math.max(t,e),r)}function Ld(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var _l=pn,A3={};for(let e of Object.keys(ro))A3[ro[e]]=e;var X={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Za=X,Co=(6/29)**3;function Ml(e){let t=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,t),1)}function vl(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(X)){if(!("channels"in X[e]))throw new Error("missing channels property: "+e);if(!("labels"in X[e]))throw new Error("missing channel labels property: "+e);if(X[e].labels.length!==X[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=X[e];delete X[e].channels,delete X[e].labels,Object.defineProperty(X[e],"channels",{value:t}),Object.defineProperty(X[e],"labels",{value:r})}X.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=o-i,a,c;switch(o){case i:{a=0;break}case t:{a=(r-n)/s;break}case r:{a=2+(n-t)/s;break}case n:{a=4+(t-r)/s;break}}a=Math.min(a*60,360),a<0&&(a+=360);let l=(i+o)/2;return o===i?c=0:l<=.5?c=s/(o+i):c=s/(2-o-i),[a,c*100,l*100]};X.rgb.hsv=function(e){let t,r,n,i,o,s=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(s,a,c),u=l-Math.min(s,a,c),h=function(d){return(l-d)/6/u+1/2};if(u===0)i=0,o=0;else{switch(o=u/l,t=h(s),r=h(a),n=h(c),l){case s:{i=n-r;break}case a:{i=1/3+t-n;break}case c:{i=2/3+r-t;break}}i<0?i+=1:i>1&&(i-=1)}return[i*360,o*100,l*100]};X.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],i=X.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[i,o*100,n*100]};X.rgb.oklab=function(e){let t=vl(e[0]/255),r=vl(e[1]/255),n=vl(e[2]/255),i=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*n),o=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*n),s=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*n),a=.2104542553*i+.793617785*o-.0040720468*s,c=1.9779984951*i-2.428592205*o+.4505937099*s,l=.0259040371*i+.7827717662*o-.808675766*s;return[a*100,c*100,l*100]};X.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(1-t,1-r,1-n),o=(1-t-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function TG(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}X.rgb.keyword=function(e){let t=A3[e];if(t)return t;let r=Number.POSITIVE_INFINITY,n;for(let i of Object.keys(ro)){let o=ro[i],s=TG(e,o);s<r&&(r=s,n=i)}return n};X.keyword.rgb=function(e){return[...ro[e]]};X.rgb.xyz=function(e){let t=vl(e[0]/255),r=vl(e[1]/255),n=vl(e[2]/255),i=t*.4124564+r*.3575761+n*.1804375,o=t*.2126729+r*.7151522+n*.072175,s=t*.0193339+r*.119192+n*.9503041;return[i*100,o*100,s*100]};X.rgb.lab=function(e){let t=X.rgb.xyz(e),r=t[0],n=t[1],i=t[2];r/=95.047,n/=100,i/=108.883,r=r>Co?r**(1/3):7.787*r+16/116,n=n>Co?n**(1/3):7.787*n+16/116,i=i>Co?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};X.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i,o;if(r===0)return o=n*255,[o,o,o];let s=n<.5?n*(1+r):n+r-n*r,a=2*n-s,c=[0,0,0];for(let l=0;l<3;l++)i=t+1/3*-(l-1),i<0&&i++,i>1&&i--,6*i<1?o=a+(s-a)*6*i:2*i<1?o=s:3*i<2?o=a+(s-a)*(2/3-i)*6:o=a,c[l]=o*255;return c};X.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[t,a*100,s*100]};X.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,i=Math.floor(t)%6,o=t-Math.floor(t),s=255*n*(1-r),a=255*n*(1-r*o),c=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,c,s];case 1:return[a,n,s];case 2:return[s,n,c];case 3:return[s,a,n];case 4:return[c,s,n];case 5:return[n,s,a]}};X.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[t,o*100,s*100]};X.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*t),a=1-n;o=6*t-s,(s&1)!==0&&(o=1-o);let c=r+o*(a-r),l,u,h;switch(s){default:case 6:case 0:{l=a,u=c,h=r;break}case 1:{l=c,u=a,h=r;break}case 2:{l=r,u=a,h=c;break}case 3:{l=r,u=c,h=a;break}case 4:{l=c,u=r,h=a;break}case 5:{l=a,u=r,h=c;break}}return[l*255,u*255,h*255]};X.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100,o=1-Math.min(1,t*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};X.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i,o,s;return i=t*3.2404542+r*-1.5371385+n*-.4985314,o=t*-.969266+r*1.8760108+n*.041556,s=t*.0556434+r*-.2040259+n*1.0572252,i=Ml(i),o=Ml(o),s=Ml(s),[i*255,o*255,s*255]};X.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>Co?t**(1/3):7.787*t+16/116,r=r>Co?r**(1/3):7.787*r+16/116,n=n>Co?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(t-r),s=200*(r-n);return[i,o,s]};X.xyz.oklab=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=Math.cbrt(.8189330101*t+.3618667424*r-.1288597137*n),o=Math.cbrt(.0329845436*t+.9293118715*r+.0361456387*n),s=Math.cbrt(.0482003018*t+.2643662691*r+.633851707*n),a=.2104542553*i+.793617785*o-.0040720468*s,c=1.9779984951*i-2.428592205*o+.4505937099*s,l=.0259040371*i+.7827717662*o-.808675766*s;return[a*100,c*100,l*100]};X.oklab.oklch=function(e){return X.lab.lch(e)};X.oklab.xyz=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(.999999998*t+.396337792*r+.215803758*n)**3,o=(1.000000008*t-.105561342*r-.063854175*n)**3,s=(1.000000055*t-.089484182*r-1.291485538*n)**3,a=1.227013851*i-.55779998*o+.281256149*s,c=-.040580178*i+1.11225687*o-.071676679*s,l=-.076381285*i-.421481978*o+1.58616322*s;return[a*100,c*100,l*100]};X.oklab.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(t+.3963377774*r+.2158037573*n)**3,o=(t-.1055613458*r-.0638541728*n)**3,s=(t-.0894841775*r-1.291485548*n)**3,a=Ml(4.0767416621*i-3.3077115913*o+.2309699292*s),c=Ml(-1.2684380046*i+2.6097574011*o-.3413193965*s),l=Ml(-.0041960863*i-.7034186147*o+1.707614701*s);return[a*255,c*255,l*255]};X.oklch.oklab=function(e){return X.lch.lab(e)};X.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],i,o,s;o=(t+16)/116,i=r/500+o,s=o-n/200;let a=o**3,c=i**3,l=s**3;return o=a>Co?a:(o-16/116)/7.787,i=c>Co?c:(i-16/116)/7.787,s=l>Co?l:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};X.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[t,s,i]};X.lch.lab=function(e){let t=e[0],r=e[1],i=e[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[t,o,s]};X.rgb.ansi16=function(e,t=null){let[r,n,i]=e,o=t===null?X.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};X.hsv.ansi16=function(e){return X.rgb.ansi16(X.hsv.rgb(e),e[2])};X.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];return t>>4===r>>4&&r>>4===n>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};X.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(Math.trunc(e>50)+1)*.5,n=(t&1)*r*255,i=(t>>1&1)*r*255,o=(t>>2&1)*r*255;return[n,i,o]};X.ansi256.rgb=function(e){if(e=e[0],e>=232){let o=(e-232)*10+8;return[o,o,o]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[r,n,i]};X.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r};X.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=[...r].map(a=>a+a).join(""));let n=Number.parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};X.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(Math.max(t,r),n),o=Math.min(Math.min(t,r),n),s=i-o,a,c=s<1?o/(1-s):0;return s<=0?a=0:i===t?a=(r-n)/s%6:i===r?a=2+(n-t)/s:a=4+(t-r)/s,a/=6,a%=1,[a*360,s*100,c*100]};X.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[e[0],n*100,i*100]};X.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],n*100,i*100]};X.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=t%1*6,s=o%1,a=1-s,c=0;switch(Math.floor(o)){case 0:{i[0]=1,i[1]=s,i[2]=0;break}case 1:{i[0]=a,i[1]=1,i[2]=0;break}case 2:{i[0]=0,i[1]=1,i[2]=s;break}case 3:{i[0]=0,i[1]=a,i[2]=1;break}case 4:{i[0]=s,i[1]=0,i[2]=1;break}default:i[0]=1,i[1]=0,i[2]=a}return c=(1-r)*n,[(r*i[0]+c)*255,(r*i[1]+c)*255,(r*i[2]+c)*255]};X.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),i=0;return n>0&&(i=t/n),[e[0],i*100,n*100]};X.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,i=0;return n>0&&n<.5?i=t/(2*n):n>=.5&&n<1&&(i=t/(2*(1-n))),[e[0],i*100,n*100]};X.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};X.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,i=n-t,o=0;return i<1&&(o=(n-i)/(1-i)),[e[0],i*100,o*100]};X.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};X.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};X.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};X.gray.hsl=function(e){return[0,0,e[0]]};X.gray.hsv=X.gray.hsl;X.gray.hwb=function(e){return[0,100,e[0]]};X.gray.cmyk=function(e){return[0,0,0,e[0]]};X.gray.lab=function(e){return[e[0],0,0]};X.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(n.length)+n};X.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function IG(){let e={},t=Object.keys(Za);for(let{length:r}=t,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function PG(e){let t=IG(),r=[e];for(t[e].distance=0;r.length>0;){let n=r.pop(),i=Object.keys(Za[n]);for(let{length:o}=i,s=0;s<o;s++){let a=i[s],c=t[a];c.distance===-1&&(c.distance=t[n].distance+1,c.parent=n,r.unshift(a))}}return t}function RG(e,t){return function(r){return t(e(r))}}function LG(e,t){let r=[t[e].parent,e],n=Za[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)r.unshift(t[i].parent),n=RG(Za[t[i].parent][i],n),i=t[i].parent;return n.conversion=r,n}function OG(e){let t=PG(e),r={},n=Object.keys(t);for(let{length:i}=n,o=0;o<i;o++){let s=n[o];t[s].parent!==null&&(r[s]=LG(s,t))}return r}var BG=OG,Sl={},CG=Object.keys(Za);function DG(e){let t=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function NG(e){let t=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=e(r);if(typeof i=="object")for(let{length:o}=i,s=0;s<o;s++)i[s]=Math.round(i[s]);return i};return"conversion"in e&&(t.conversion=e.conversion),t}for(let e of CG){Sl[e]={},Object.defineProperty(Sl[e],"channels",{value:Za[e].channels}),Object.defineProperty(Sl[e],"labels",{value:Za[e].labels});let t=BG(e),r=Object.keys(t);for(let n of r){let i=t[n];Sl[e][n]=NG(i),Sl[e][n].raw=DG(i)}}var Cn=Sl,T3=["keyword","gray","hex"],mg={};for(let e of Object.keys(Cn))mg[[...Cn[e].labels].sort().join("")]=e;var pg={};function gr(e,t){if(!(this instanceof gr))return new gr(e,t);if(t&&t in T3&&(t=null),t&&!(t in Cn))throw new Error("Unknown model: "+t);let r,n;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof gr)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){let i=_l.get(e);if(i===null)throw new Error("Unable to parse color from string: "+e);this.model=i.model,n=Cn[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=Cn[this.model].channels;let i=Array.prototype.slice.call(e,0,n);this.color=gg(i,n),this.valpha=typeof e[n]=="number"?e[n]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let i=Object.keys(e);"alpha"in e&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);let o=i.sort().join("");if(!(o in mg))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=mg[o];let{labels:s}=Cn[this.model],a=[];for(r=0;r<s.length;r++)a.push(e[s[r]]);this.color=gg(a)}if(pg[this.model])for(n=Cn[this.model].channels,r=0;r<n;r++){let i=pg[this.model][r];i&&(this.color[r]=i(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}gr.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in _l.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return _l.to[t.model](...r)},percentString(e){let t=this.rgb().round(typeof e=="number"?e:1),r=t.valpha===1?t.color:[...t.color,this.valpha];return _l.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=Cn[this.model],{labels:r}=Cn[this.model];for(let n=0;n<t;n++)e[r[n]]=this.color[n];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new gr([...this.color.map(GG(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new gr([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:zt("rgb",0,ar(255)),green:zt("rgb",1,ar(255)),blue:zt("rgb",2,ar(255)),hue:zt(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:zt("hsl",1,ar(100)),lightness:zt("hsl",2,ar(100)),saturationv:zt("hsv",1,ar(100)),value:zt("hsv",2,ar(100)),chroma:zt("hcg",1,ar(100)),gray:zt("hcg",2,ar(100)),white:zt("hwb",1,ar(100)),wblack:zt("hwb",2,ar(100)),cyan:zt("cmyk",0,ar(100)),magenta:zt("cmyk",1,ar(100)),yellow:zt("cmyk",2,ar(100)),black:zt("cmyk",3,ar(100)),x:zt("xyz",0,ar(95.047)),y:zt("xyz",1,ar(100)),z:zt("xyz",2,ar(108.833)),l:zt("lab",0,ar(100)),a:zt("lab",1),b:zt("lab",2),keyword(e){return e!==void 0?new gr(e):Cn[this.model].keyword(this.color)},hex(e){return e!==void 0?new gr(e):_l.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new gr(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r="0"+r),_l.to.hex(...t)+r},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[r,n]of e.entries()){let i=n/255;t[r]=i<=.04045?i/12.92:((i+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return gr.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let r=e.rgb(),n=this.rgb(),i=t===void 0?.5:t,o=2*i-1,s=r.alpha()-n.alpha(),a=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,c=1-a;return gr.rgb(a*r.red()+c*n.red(),a*r.green()+c*n.green(),a*r.blue()+c*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};for(let e of Object.keys(Cn)){if(T3.includes(e))continue;let{channels:t}=Cn[e];gr.prototype[e]=function(...r){return this.model===e?new gr(this):r.length>0?new gr(r,e):new gr([...kG(Cn[this.model][e].raw(this.color)),this.valpha],e)},gr[e]=function(...r){let n=r[0];return typeof n=="number"&&(n=gg(r,t)),new gr(n,e)}}function FG(e,t){return Number(e.toFixed(t))}function GG(e){return function(t){return FG(t,e)}}function zt(e,t,r){e=Array.isArray(e)?e:[e];for(let n of e)(pg[n]||=[])[t]=r;return e=e[0],function(n){let i;return n!==void 0?(r&&(n=r(n)),i=this[e](),i.color[t]=n,i):(i=this[e]().color[t],r&&(i=r(i)),i)}}function ar(e){return function(t){return Math.max(0,Math.min(e,t))}}function kG(e){return Array.isArray(e)?e:[e]}function gg(e,t){for(let r=0;r<t;r++)typeof e[r]!="number"&&(e[r]=0);return e}var UG=gr});var L3=ae((XY,R3)=>{R3.exports=P3().default});function jG(e){return this._setBackgroundColourOption("tint",e),this}function zG(e){return this.options.greyscale=f.bool(e)?e:!0,this}function qG(e){return this.greyscale(e)}function VG(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function WG(e){return this.pipelineColourspace(e)}function HG(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function $G(e){return this.toColourspace(e)}function C3(e){if(f.object(e)||f.string(e)&&e.length>=3&&e.length<=200){let t=(0,B3.default)(e),r=t.red(),n=t.green(),i=t.blue(),o=Math.round(t.alpha()*255);for(let[s,a]of[["red",r],["green",n],["blue",i],["alpha",o]])if(!f.number(a))throw f.invalidParameterError(`background.${s}`,"number",a);return[r,n,i,o]}else throw f.invalidParameterError("background","object or string",e)}function KG(e,t){f.defined(t)&&(this.options[e]=C3(t))}var B3,O3,D3,N3=p(()=>{B3=pe(L3(),1);Yi();O3={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};D3=e=>{Object.assign(e.prototype,{tint:jG,greyscale:zG,grayscale:qG,pipelineColourspace:VG,pipelineColorspace:WG,toColourspace:HG,toColorspace:$G,_getBackgroundColourOption:C3,_setBackgroundColourOption:KG}),e.colourspace=O3,e.colorspace=O3}});function YG(){return this.options.removeAlpha=!0,this}function ZG(e){if(f.defined(e))if(f.number(e)&&f.inRange(e,0,1))this.options.ensureAlpha=e;else throw f.invalidParameterError("alpha","number between 0 and 1",e);else this.options.ensureAlpha=1;return this}function JG(e){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(e)&&(e=t[e]),f.integer(e)&&f.inRange(e,0,4))this.options.extractChannel=e;else throw f.invalidParameterError("channel","integer or one of: red, green, blue, alpha",e);return this}function QG(e,t){return Array.isArray(e)?e.forEach(function(r){this.options.joinChannelIn.push(this._createInputDescriptor(r,t))},this):this.options.joinChannelIn.push(this._createInputDescriptor(e,t)),this}function ek(e){if(f.string(e)&&f.inArray(e,["and","or","eor"]))this.options.bandBoolOp=e;else throw f.invalidParameterError("boolOp","one of: and, or, eor",e);return this}var XG,F3,G3=p(()=>{Yi();XG={and:"and",or:"or",eor:"eor"};F3=e=>{Object.assign(e.prototype,{removeAlpha:YG,ensureAlpha:ZG,extractChannel:JG,joinChannel:QG,bandbool:ek}),e.bool=XG}});function rk(e,t){let r;if(f.string(e)?f.string(this.options.input.file)&&Od.default.resolve(this.options.input.file)===Od.default.resolve(e)?r=new Error("Cannot use same file for input and output"):tk.test(Od.default.extname(e))&&!this.constructor.format.jp2.output.file&&(r=U3()):r=new Error("Missing output file path"),r)if(f.fn(t))t(r);else return Promise.reject(r);else{this.options.fileOut=e;let n=Error();return this._pipeline(t,n)}return this}function nk(e,t){f.object(e)?this._setBooleanOption("resolveWithObject",e.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let r=Error();return this._pipeline(f.fn(e)?e:t,r)}function ik(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let e=Error();return this._pipeline(null,e)}function ok(e){if(f.number(e)&&e>0)this.options.withMetadataDensity=e;else throw f.invalidParameterError("density","positive number",e);return this.keepExif()}function sk(){return this.options.keepMetadata|=1,this}function ak(e){if(f.object(e))for(let[t,r]of Object.entries(e))if(f.object(r))for(let[n,i]of Object.entries(r))if(f.string(i))this.options.withExif[`exif-${t.toLowerCase()}-${n}`]=i;else throw f.invalidParameterError(`${t}.${n}`,"string",i);else throw f.invalidParameterError(t,"object",r);else throw f.invalidParameterError("exif","object",e);return this.options.withExifMerge=!1,this.keepExif()}function ck(e){return this.withExif(e),this.options.withExifMerge=!0,this}function lk(){return this.options.keepMetadata|=8,this}function uk(e,t){if(f.string(e))this.options.withIccProfile=e;else throw f.invalidParameterError("icc","string",e);if(this.keepIccProfile(),f.object(t)&&f.defined(t.attach))if(f.bool(t.attach))t.attach||(this.options.keepMetadata&=-9);else throw f.invalidParameterError("attach","boolean",t.attach);return this}function fk(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function hk(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function dk(){return this.options.keepMetadata|=2,this}function mk(e){if(f.string(e)&&e.length>0)this.options.withXmp=e,this.options.keepMetadata|=2;else throw f.invalidParameterError("xmp","non-empty string",e);return this}function pk(){return this.options.keepMetadata|=31,this}function gk(e){if(this.keepMetadata(),this.withIccProfile("srgb"),f.object(e)){if(f.defined(e.orientation))if(f.integer(e.orientation)&&f.inRange(e.orientation,1,8))this.options.withMetadataOrientation=e.orientation;else throw f.invalidParameterError("orientation","integer between 1 and 8",e.orientation);if(f.defined(e.density))if(f.number(e.density)&&e.density>0)this.options.withMetadataDensity=e.density;else throw f.invalidParameterError("density","positive number",e.density);f.defined(e.icc)&&this.withIccProfile(e.icc),f.defined(e.exif)&&this.withExifMerge(e.exif)}return this}function yk(e,t){let r=k3.get((f.object(e)&&f.string(e.id)?e.id:e).toLowerCase());if(!r)throw f.invalidParameterError("format",`one of: ${[...k3.keys()].join(", ")}`,e);return this[r](t)}function bk(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jpegQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.progressive)&&this._setBooleanOption("jpegProgressive",e.progressive),f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);let t=f.bool(e.optimizeCoding)?e.optimizeCoding:e.optimiseCoding;if(f.defined(t)&&this._setBooleanOption("jpegOptimiseCoding",t),f.defined(e.mozjpeg))if(f.bool(e.mozjpeg))e.mozjpeg&&(this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3);else throw f.invalidParameterError("mozjpeg","boolean",e.mozjpeg);let r=f.bool(e.trellisQuantization)?e.trellisQuantization:e.trellisQuantisation;f.defined(r)&&this._setBooleanOption("jpegTrellisQuantisation",r),f.defined(e.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",e.overshootDeringing);let n=f.bool(e.optimizeScans)?e.optimizeScans:e.optimiseScans;f.defined(n)&&(this._setBooleanOption("jpegOptimiseScans",n),n&&(this.options.jpegProgressive=!0));let i=f.number(e.quantizationTable)?e.quantizationTable:e.quantisationTable;if(f.defined(i))if(f.integer(i)&&f.inRange(i,0,8))this.options.jpegQuantisationTable=i;else throw f.invalidParameterError("quantisationTable","integer between 0 and 8",i)}return this._updateFormatOut("jpeg",e)}function wk(e){if(f.object(e)){if(f.defined(e.progressive)&&this._setBooleanOption("pngProgressive",e.progressive),f.defined(e.compressionLevel))if(f.integer(e.compressionLevel)&&f.inRange(e.compressionLevel,0,9))this.options.pngCompressionLevel=e.compressionLevel;else throw f.invalidParameterError("compressionLevel","integer between 0 and 9",e.compressionLevel);f.defined(e.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",e.adaptiveFiltering);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.pngBitdepth=j3(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.palette)?this._setBooleanOption("pngPalette",e.palette):[e.quality,e.effort,e.colours,e.colors,e.dither].some(f.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,0,100))this.options.pngQuality=e.quality;else throw f.invalidParameterError("quality","integer between 0 and 100",e.quality);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.pngEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.pngDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither)}}return this._updateFormatOut("png",e)}function xk(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.webpQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.alphaQuality))if(f.integer(e.alphaQuality)&&f.inRange(e.alphaQuality,0,100))this.options.webpAlphaQuality=e.alphaQuality;else throw f.invalidParameterError("alphaQuality","integer between 0 and 100",e.alphaQuality);if(f.defined(e.lossless)&&this._setBooleanOption("webpLossless",e.lossless),f.defined(e.nearLossless)&&this._setBooleanOption("webpNearLossless",e.nearLossless),f.defined(e.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",e.smartSubsample),f.defined(e.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",e.smartDeblock),f.defined(e.preset))if(f.string(e.preset)&&f.inArray(e.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=e.preset;else throw f.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",e.preset);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,6))this.options.webpEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 6",e.effort);f.defined(e.minSize)&&this._setBooleanOption("webpMinSize",e.minSize),f.defined(e.mixed)&&this._setBooleanOption("webpMixed",e.mixed),f.defined(e.exact)&&this._setBooleanOption("webpExact",e.exact)}return bg(e,this.options),this._updateFormatOut("webp",e)}function _k(e){if(f.object(e)){f.defined(e.reuse)&&this._setBooleanOption("gifReuse",e.reuse),f.defined(e.progressive)&&this._setBooleanOption("gifProgressive",e.progressive);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.gifBitdepth=j3(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.gifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.gifDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither);if(f.defined(e.interFrameMaxError))if(f.number(e.interFrameMaxError)&&f.inRange(e.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=e.interFrameMaxError;else throw f.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",e.interFrameMaxError);if(f.defined(e.interPaletteMaxError))if(f.number(e.interPaletteMaxError)&&f.inRange(e.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=e.interPaletteMaxError;else throw f.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",e.interPaletteMaxError);if(f.defined(e.keepDuplicateFrames))if(f.bool(e.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",e.keepDuplicateFrames);else throw f.invalidParameterError("keepDuplicateFrames","boolean",e.keepDuplicateFrames)}return bg(e,this.options),this._updateFormatOut("gif",e)}function Sk(e){if(!this.constructor.format.jp2.output.buffer)throw U3();if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jp2Quality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jp2Lossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.jp2TileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.jp2TileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling)}return this._updateFormatOut("jp2",e)}function bg(e,t){if(f.object(e)&&f.defined(e.loop))if(f.integer(e.loop)&&f.inRange(e.loop,0,65535))t.loop=e.loop;else throw f.invalidParameterError("loop","integer between 0 and 65535",e.loop);if(f.object(e)&&f.defined(e.delay))if(f.integer(e.delay)&&f.inRange(e.delay,0,65535))t.delay=[e.delay];else if(Array.isArray(e.delay)&&f.inRange(e.delay.length,1,1e6)&&e.delay.every(f.integer)&&e.delay.every(r=>f.inRange(r,0,65535)))t.delay=e.delay;else throw f.invalidParameterError("delay","integer or an array of integers between 0 and 65535",e.delay)}function Mk(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.tiffQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[1,2,4]))this.options.tiffBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","1, 2 or 4",e.bitdepth);if(f.defined(e.tile)&&this._setBooleanOption("tiffTile",e.tile),f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.tiffTileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.tiffTileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.miniswhite)&&this._setBooleanOption("tiffMiniswhite",e.miniswhite),f.defined(e.pyramid)&&this._setBooleanOption("tiffPyramid",e.pyramid),f.defined(e.xres))if(f.number(e.xres)&&f.inRange(e.xres,.001,1e6))this.options.tiffXres=e.xres;else throw f.invalidParameterError("xres","number between 0.001 and 1000000",e.xres);if(f.defined(e.yres))if(f.number(e.yres)&&f.inRange(e.yres,.001,1e6))this.options.tiffYres=e.yres;else throw f.invalidParameterError("yres","number between 0.001 and 1000000",e.yres);if(f.defined(e.compression))if(f.string(e.compression)&&f.inArray(e.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=e.compression;else throw f.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",e.compression);if(f.defined(e.bigtiff)&&this._setBooleanOption("tiffBigtiff",e.bigtiff),f.defined(e.predictor))if(f.string(e.predictor)&&f.inArray(e.predictor,["none","horizontal","float"]))this.options.tiffPredictor=e.predictor;else throw f.invalidParameterError("predictor","one of: none, horizontal, float",e.predictor);if(f.defined(e.resolutionUnit))if(f.string(e.resolutionUnit)&&f.inArray(e.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=e.resolutionUnit;else throw f.invalidParameterError("resolutionUnit","one of: inch, cm",e.resolutionUnit)}return this._updateFormatOut("tiff",e)}function vk(e){return this.heif({...e,compression:"av1"})}function Ek(e){if(f.object(e)){if(f.string(e.compression)&&f.inArray(e.compression,["av1","hevc"]))this.options.heifCompression=e.compression;else throw f.invalidParameterError("compression","one of: av1, hevc",e.compression);if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.heifQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.heifLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,9))this.options.heifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 9",e.effort);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[8,10,12]))this.options.heifBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","8, 10 or 12",e.bitdepth);if(f.defined(e.tune))if(f.string(e.tune)&&f.inArray(e.tune,["auto","iq","psnr","ssim"]))this.options.heifLossless&&e.tune==="iq"?this.options.heifTune="ssim":this.options.heifTune=e.tune;else throw f.invalidParameterError("tune","one of: auto, iq, psnr, ssim",e.tune)}else throw f.invalidParameterError("options","Object",e);return this._updateFormatOut("heif",e)}function Ak(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jxlDistance=e.quality>=30?.1+(100-e.quality)*.09:53/3e3*e.quality*e.quality-23/20*e.quality+25;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);else if(f.defined(e.distance))if(f.number(e.distance)&&f.inRange(e.distance,0,15))this.options.jxlDistance=e.distance;else throw f.invalidParameterError("distance","number between 0.0 and 15.0",e.distance);if(f.defined(e.decodingTier))if(f.integer(e.decodingTier)&&f.inRange(e.decodingTier,0,4))this.options.jxlDecodingTier=e.decodingTier;else throw f.invalidParameterError("decodingTier","integer between 0 and 4",e.decodingTier);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jxlLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,9))this.options.jxlEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 9",e.effort)}return bg(e,this.options),this._updateFormatOut("jxl",e)}function Tk(e){if(f.object(e)&&f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=e.depth;else throw f.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",e.depth);return this._updateFormatOut("raw")}function Ik(e){if(f.object(e)){if(f.defined(e.size))if(f.integer(e.size)&&f.inRange(e.size,1,8192))this.options.tileSize=e.size;else throw f.invalidParameterError("size","integer between 1 and 8192",e.size);if(f.defined(e.overlap))if(f.integer(e.overlap)&&f.inRange(e.overlap,0,8192)){if(e.overlap>this.options.tileSize)throw f.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,e.overlap);this.options.tileOverlap=e.overlap}else throw f.invalidParameterError("overlap","integer between 0 and 8192",e.overlap);if(f.defined(e.container))if(f.string(e.container)&&f.inArray(e.container,["fs","zip"]))this.options.tileContainer=e.container;else throw f.invalidParameterError("container","one of: fs, zip",e.container);if(f.defined(e.layout))if(f.string(e.layout)&&f.inArray(e.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=e.layout;else throw f.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",e.layout);if(f.defined(e.angle))if(f.integer(e.angle)&&!(e.angle%90))this.options.tileAngle=e.angle;else throw f.invalidParameterError("angle","positive/negative multiple of 90",e.angle);if(this._setBackgroundColourOption("tileBackground",e.background),f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["onepixel","onetile","one"]))this.options.tileDepth=e.depth;else throw f.invalidParameterError("depth","one of: onepixel, onetile, one",e.depth);if(f.defined(e.skipBlanks))if(f.integer(e.skipBlanks)&&f.inRange(e.skipBlanks,-1,65535))this.options.tileSkipBlanks=e.skipBlanks;else throw f.invalidParameterError("skipBlanks","integer between -1 and 255/65535",e.skipBlanks);else f.defined(e.layout)&&e.layout==="google"&&(this.options.tileSkipBlanks=5);let t=f.bool(e.center)?e.center:e.centre;if(f.defined(t)&&this._setBooleanOption("tileCentre",t),f.defined(e.id))if(f.string(e.id))this.options.tileId=e.id;else throw f.invalidParameterError("id","string",e.id);if(f.defined(e.basename))if(f.string(e.basename))this.options.tileBasename=e.basename;else throw f.invalidParameterError("basename","string",e.basename)}if(f.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw f.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function Pk(e){if(!f.plainObject(e))throw f.invalidParameterError("options","object",e);if(f.integer(e.seconds)&&f.inRange(e.seconds,0,3600))this.options.timeoutSeconds=e.seconds;else throw f.invalidParameterError("seconds","integer between 0 and 3600",e.seconds);return this}function Rk(e,t){return f.object(t)&&t.force===!1||(this.options.formatOut=e),this}function Lk(e,t){if(f.bool(t))this.options[e]=t;else throw f.invalidParameterError(e,"boolean",t)}function Ok(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function Bk(e,t){return typeof e=="function"?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),rt.pipeline(this.options,(r,n,i)=>{r?e(f.nativeError(r,t)):e(null,n,i)})}):rt.pipeline(this.options,(r,n,i)=>{r?e(f.nativeError(r,t)):e(null,n,i)}),this):this.options.streamOut?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),rt.pipeline(this.options,(r,n,i)=>{r?this.emit("error",f.nativeError(r,t)):(this.emit("info",i),this.push(n)),this.push(null),this.on("end",()=>this.emit("close"))})}):rt.pipeline(this.options,(r,n,i)=>{r?this.emit("error",f.nativeError(r,t)):(this.emit("info",i),this.push(n)),this.push(null),this.on("end",()=>this.emit("close"))}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),rt.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,t)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}):new Promise((r,n)=>{rt.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,t)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}var Od,k3,tk,U3,j3,z3,q3=p(()=>{Od=pe(require("node:path"),1);Yi();mf();k3=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),tk=/\.(jp[2x]|j2[kc])$/i,U3=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),j3=e=>1<<32-Math.clz32(Math.ceil(Math.log2(e))-1);z3=e=>{Object.assign(e.prototype,{toFile:rk,toBuffer:nk,toUint8Array:ik,withDensity:ok,keepExif:sk,withExif:ak,withExifMerge:ck,keepIccProfile:lk,withIccProfile:uk,keepGainMap:fk,withGainMap:hk,keepXmp:dk,withXmp:mk,keepMetadata:pk,withMetadata:gk,toFormat:yk,jpeg:bk,jp2:Sk,png:wk,webp:xk,tiff:Mk,avif:vk,heif:Ek,jxl:Ak,gif:_k,raw:Tk,tile:Ik,timeout:Pk,_updateFormatOut:Rk,_setBooleanOption:Lk,_read:Ok,_pipeline:Bk})}});function K3(e){if(f.bool(e))return e?rt.cache(50,20,100):rt.cache(0,0,0);if(f.object(e)){for(let t of["memory","files","items"]){let r=e[t];if(f.defined(r)&&!(f.integer(r)&&r>=0))throw f.invalidParameterError(t,"a positive integer",r)}return rt.cache(e.memory,e.files,e.items)}else return rt.cache()}function Dk(e){return rt.concurrency(f.integer(e)?e:null)}function Fk(){return rt.counters()}function Gk(e){return rt.simd(f.bool(e)?e:null)}function kk(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))rt.block(e.operation,!0);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}function Uk(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))rt.block(e.operation,!1);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}var W3,H3,$3,pf,jk,wg,V3,xg,As,Ck,El,Nk,X3,Y3=p(()=>{W3=pe(require("node:events"),1),H3=require("node:module"),$3=require("node:os"),pf=pe(dd(),1);Yi();lg();mf();Ad();jk={};wg=(0,H3.createRequire)(jk.url),V3=Td.runtimePlatformArch(),xg=rt.libvipsVersion(),As=rt.format();As.heif.output.alias=["avif","heic"];As.jpeg.output.alias=["jpe","jpg"];As.tiff.output.alias=["tif"];As.jp2.output.alias=["j2c","j2k","jp2","jpx"];Ck={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},El={vips:xg.semver};if(!xg.isGlobal)if(xg.isWasm)try{El=wg("@img/sharp-wasm32/versions")}catch{}else try{El=wg(`@img/sharp-${V3}/versions`)}catch{try{El=wg(`@img/sharp-libvips-${V3}/versions`)}catch{}}El.sharp=Oo.version;El.heif&&As.heif&&(As.heif.input.fileSuffix=[".avif"],As.heif.output.alias=["avif"]);K3(!0);!process.env.MALLOC_ARENA_MAX&&pf.default.familySync()===pf.default.GLIBC&&!rt._isUsingJemalloc()?rt.concurrency(1):pf.default.familySync()===pf.default.MUSL&&rt.concurrency()===1024&&rt.concurrency((0,$3.availableParallelism)());Nk=new W3.default.EventEmitter;X3=e=>{e.cache=K3,e.concurrency=Dk,e.counters=Fk,e.simd=Gk,e.format=As,e.interpolators=Ck,e.versions=El,e.queue=Nk,e.block=kk,e.unblock=Uk}});var Z3={};ir(Z3,{default:()=>zk});var zk,J3=p(()=>{l3();h3();b3();x3();M3();N3();G3();q3();Y3();f3(to);y3(to);w3(to);S3(to);D3(to);F3(to);z3(to);X3(to);zk=to});async function Tl(e,t,r,n){return n._parse(e,t,r,n)}var fv=p(()=>{"use strict"});function Il(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var hv=p(()=>{"use strict"});var no,Yk,Zk,Jk,Qk,$d,dv,eU,mv=p(()=>{"use strict";no={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Yk=no.self||no.window||no.global||{},Zk=no.window||no.self||no.global||{},Jk=no.global||no.self||no.window||{},Qk=no.document||{},$d=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),dv=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),eU=dv&&parseFloat(dv[1])||0});function Pl(e,t){return new Promise((r,n)=>{let i=!1;function o(a){i||(i=!0,n(a))}function s(a){if(!i){i=!0;try{r(t(a))}catch(c){n(c)}}}try{let a=e(s,o);a==null||a.then(s,o)}catch(a){o(a)}})}var pv=p(()=>{"use strict"});function Rg(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Lg(e){var r,n;return((n=(r=globalThis.loaders)==null?void 0:r.modules)==null?void 0:n[e])||null}var Og=p(()=>{"use strict"});function tU(){let e="5.0.0-beta.2";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=e,e}var gv,yv=p(()=>{"use strict";gv=tU()});function bv(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var wv=p(()=>{"use strict"});var io,yJ,bJ,wJ,xJ,Ti,Qa,_J,xv,SJ,Bg=p(()=>{"use strict";io={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},yJ=io.self||io.window||io.global||{},bJ=io.window||io.self||io.global||{},wJ=io.global||io.self||io.window||{},xJ=io.document||{},Ti=typeof process!="object"||String(process)!=="[object process]"||process.browser,Qa=typeof importScripts=="function",_J=typeof window<"u"&&typeof window.orientation<"u",xv=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),SJ=xv&&parseFloat(xv[1])||0});var Cg,_v,Sv=p(()=>{Cg=require("worker_threads"),_v=Cg.parentPort});function vv(e,t=!0,r){let n=r||new Set,i=new Set;function o(s){if(!(!s||typeof s!="object"||i.has(s))){if(i.add(s),Mv(s))n.add(s);else if(ArrayBuffer.isView(s))Mv(s.buffer)&&n.add(s.buffer);else if(t&&s instanceof Map)for(let[a,c]of s)o(a),o(c);else if(t&&s instanceof Set)for(let a of s)o(a);else if(t)for(let a of Object.keys(s))o(s[a])}}return o(e),r===void 0?Array.from(n):[]}function Mv(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=p(()=>{});async function Rl(){return _v}function rU(e){if(!e||typeof e!="object")return null;let t="data"in e&&e.type==="message"?e.data:e;return t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")?t:null}var Kd,Mr,Av=p(()=>{Ev();Sv();Kd=new Map,Mr=class{static async inWorkerThread(){let t=globalThis.WorkerGlobalScope;return typeof t=="function"&&globalThis instanceof t||!!await Rl()}static set onmessage(t){async function r(n){let i=await Rl(),{type:o,payload:s}=i?n:n.data;t(o,s)}Rl().then(n=>{n?(n.on("message",i=>{r(i)}),n.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=r})}static async addEventListener(t){let r=Kd.get(t);r||(r=i=>{let o=rU(i);o&&t(o.type,o.payload)},Kd.set(t,r));let n=await Rl();n?n.on("message",r):globalThis.addEventListener("message",r)}static async removeEventListener(t){let r=Kd.get(t);if(Kd.delete(t),!r)return;let n=await Rl();n?n.off("message",r):globalThis.removeEventListener("message",r)}static async postMessage(t,r){let n={source:"loaders.gl",type:t,payload:r},i=vv(r),o=await Rl();o?o.postMessage(n,i):globalThis.postMessage(n,i)}}});var Ll,Tv=p(()=>{Ll=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(t){return this.enqueue(t)}enqueue(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let r=this._settlers.shift();t instanceof Error?r.reject(t):r.resolve({value:t})}else this._values.push(t)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let t=this._values.shift();return t instanceof Error?Promise.reject(t):Promise.resolve({done:!1,value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((t,r)=>{this._settlers.push({resolve:t,reject:r})})}}});var Xd,Iv=p(()=>{Xd=class{constructor(t){if(typeof SharedArrayBuffer>"u"||!(t instanceof SharedArrayBuffer)||t.byteLength!==16)throw new Error("Expected a 16-byte shared worker control buffer");this.buffer=t,this.values=new Int32Array(t)}get snapshot(){return{cancelled:Atomics.load(this.values,0)!==0,completed:Atomics.load(this.values,1),total:Atomics.load(this.values,2),revision:Atomics.load(this.values,3)}}cancel(){Atomics.store(this.values,0,1),Atomics.add(this.values,3,1),Atomics.notify(this.values,0)}throwIfCancelled(){if(Atomics.load(this.values,0)!==0){let t=new Error("Shared worker task was cancelled");throw t.name="AbortError",t}}setProgress(t,r=-1){if(!Number.isInteger(t)||t<0||t>2147483647||!Number.isInteger(r)||r<-1||r>2147483647)throw new RangeError("Shared progress requires nonnegative int32 counts (or total -1)");Atomics.store(this.values,1,t),Atomics.store(this.values,2,r),Atomics.add(this.values,3,1)}}});async function yf(e,t){if(!await Mr.inWorkerThread())return;let r={process:oU};Mr.onmessage=async(n,i)=>{var h;if(n==="cancel"){Fo==null||Fo.abort(),No==null||No.close(),ec==null||ec.close();return}let o=n==="process"||n==="process-in-batches"?new AbortController:void 0;o&&(Fo=o);let s=performance.now(),a=n==="process"||n==="process-in-batches"?sU():void 0,c,l=()=>{o==null||o.signal.throwIfAborted(),c==null||c.throwIfCancelled()},u={...r,signal:o==null?void 0:o.signal,sharedState:c,throwIfAborted:l,reportProgress:d=>{!(o!=null&&o.signal.aborted)&&!(c!=null&&c.snapshot.cancelled)&&(a==null||a.report(d))}};try{switch(o&&((h=i.options)!=null&&h.sharedState)&&(c=new Xd(i.options.sharedState),u.sharedState=c),n){case"preload":Mr.postMessage("done",{});break;case"process":if(l(),!e)throw new Error("Worker does not support atomic processing");let d=await e(i.input,i.options||{},u,i.context||{});l(),a==null||a.finish(),await Mr.postMessage("done",{result:d,executionMs:performance.now()-s});break;case"process-in-batches":if(l(),!t)throw new Error("Worker does not support batched processing");let m=new Ll,g=new Ll;No=m,ec=g;try{let y=t(iU(m),i.options||{},u,i.context||{});for await(let b of y)l(),await Mr.postMessage("output-batch",{result:b}),await g.next();l(),a==null||a.finish(),await Mr.postMessage("done",{executionMs:performance.now()-s})}finally{No=null,ec=null}break;case"input-batch":if(!No)throw new Error("Worker has no active batched processing session");No.push(i.input);break;case"input-done":if(!No)throw new Error("Worker has no active batched processing session");No.close();break;case"output-ack":if(!ec)throw new Error("Worker has no active batched processing session");ec.push(void 0);break;default:}}catch(d){a==null||a.finish((o==null?void 0:o.signal.aborted)||(c==null?void 0:c.snapshot.cancelled));let m=d instanceof Error?d.message:"";await Mr.postMessage("error",{error:m,errorName:d instanceof Error?d.name:"Error"})}finally{o&&Fo===o&&(Fo=null)}},await Mr.postMessage("ready",{})}async function*iU(e){for(;;){await Mr.postMessage("input-request",{});let t=await e.next();if(t.done)return;yield t.value}}function oU(e,t={},r={}){let n=Fo==null?void 0:Fo.signal;return n==null||n.throwIfAborted(),new Promise((i,o)=>{let s=nU++,a=()=>{n==null||n.removeEventListener("abort",c),Mr.removeEventListener(l)},c=()=>{a(),o(n==null?void 0:n.reason)},l=(u,h)=>{h.id===s&&(u==="done"?(a(),i(h.result)):u==="error"&&(a(),o(h.error)))};Mr.addEventListener(l).then(async()=>{if(n!=null&&n.aborted){c();return}n==null||n.addEventListener("abort",c,{once:!0}),await Mr.postMessage("process",{id:s,input:e,options:t,context:r})}).catch(u=>{a(),o(u)})})}function sU(){let e,t=!1,r=!1,n=()=>{r=!1,e&&(Mr.postMessage("progress",{progress:e}),e=void 0)};return{report(i){t||(e&&e.phase!==i.phase&&n(),e={...i},r||(r=!0,setTimeout(n,0)))},finish(i=!1){i&&(e=void 0),n(),t=!0}}}var nU,Fo,No,ec,Pv=p(()=>{Iv();Tv();Av();nU=0,Fo=null,No=null,ec=null});var aU,Dg,DJ,Rv=p(()=>{Pv();aU={},Dg=typeof __filename=="string"?__filename.replace(/\\/g,"/"):"",DJ=Dg?`file://${Dg.startsWith("/")?"":"/"}${encodeURI(Dg).replace(/#/g,"%23").replace(/\?/g,"%3F")}`:aU.url});var Lv=p(()=>{Rv()});var Ov=p(()=>{"use strict";Lv()});function tc(e={}){var i,o;let t=e.useLocalLibraries??((i=e.core)==null?void 0:i.useLocalLibraries),r=cU(e.CDN,(o=e.core)==null?void 0:o.CDN),n=e.modules;return{...t!==void 0?{useLocalLibraries:t}:{},...r!==void 0?{CDN:r}:{},...n!==void 0?{modules:n}:{}}}function cU(e,t){if(typeof e=="string"||e===null)return e;if(typeof t=="string"||t===null)return t}async function Ol(e,t=null,r={},n=null,i=null){var a,c;let o=e;if(t){let l=n||e,u=(a=r.modules)==null?void 0:a[l];if(u!==void 0&&typeof u!="string")return u;e=Fg(e,t,r,n),o=i&&(!(typeof u=="string")||typeof((c=r.modules)==null?void 0:c[i])=="string")?Fg(i,t,r,i):e}let s=lU(e,o,Qa);return Ng[s]=Ng[s]||uU(e,o),await Ng[s]}function lU(e,t,r){return r?JSON.stringify([e,t]):e}function Fg(e,t,r={},n=null){if(r!=null&&r.core)throw new Error("loadLibrary: options.core must be pre-normalized");n=n||e;let i=r.modules||{};if(typeof i[n]=="string")return i[n];if(!r.useLocalLibraries&&e.startsWith("http"))return e;if(!Ti)return`modules/${t}/dist/libs/${n}`;if(r.CDN){if(typeof r.CDN!="string")throw new Error("loadLibrary: options.CDN must be a string or null");return bv(r.CDN.startsWith("http")),`${r.CDN}/${t}@${gv}/dist/libs/${n}`}return Qa?n.endsWith(".mjs")?`./libs/${n}`:`../src/libs/${n}`:`modules/${t}/src/libs/${n}`}async function uU(e,t){if(e.endsWith("wasm"))return await dU(e);if(!Ti){let{requireFromFile:n}=globalThis.loaders||{};try{let i=await(n==null?void 0:n(e));return i||!e.includes("/dist/libs/")?i:await(n==null?void 0:n(e.replace("/dist/libs/","/src/libs/")))}catch(i){if(e.includes("/dist/libs/"))try{return await(n==null?void 0:n(e.replace("/dist/libs/","/src/libs/")))}catch{}return console.error(i),null}}if(Qa)return fU(e,t);let r=await mU(e);return hU(r,e)}async function fU(e,t=e){try{importScripts()}catch{let n=await import(new URL(t,globalThis.location.href).href);return n.default??n}return importScripts(e)}function hU(e,t){let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function dU(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};if(Ti||!t||e.startsWith("http"))return await(await fetch(e)).arrayBuffer();try{return await t(e)}catch{if(e.includes("/dist/libs/"))return await t(e.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load ArrayBuffer from ${e}`)}}async function mU(e){let{readFileAsText:t}=globalThis.loaders||{};if(Ti||!t||e.startsWith("http"))return await(await fetch(e)).text();try{return await t(e)}catch{if(e.includes("/dist/libs/"))return await t(e.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load text from ${e}`)}}var Ng,Bv=p(()=>{"use strict";Bg();wv();yv();Ng={}});var rc=p(()=>{"use strict";Bg();Ov();Bv()});async function kg(e,t=()=>e){await yf((r,n,i,o)=>pU(t(n||{}),r,n,i,o),(r,n,i,o)=>Cv(t(n||{}),r,n,i,o))}async function pU(e,t,r={},n,i={}){let o=await yU({loader:e,arrayBuffer:t,options:r,context:{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:Dv(),_parse:Nv(n==null?void 0:n.process)}});return e.serializeWorkerResult?e.serializeWorkerResult(o,r,i):o}async function*Cv(e,t,r={},n,i={}){if(!e.parseInBatches)throw new Error(`${e.id} loader does not support batched parsing`);let o=Gv(e,r),s=e.parseInBatches(t,o,{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:Dv(),_parse:Nv(n==null?void 0:n.process)});for await(let a of s)yield e.serializeWorkerBatch?e.serializeWorkerBatch(a,r,i):a}function Dv(){let e=t=>()=>{throw new Error(`context.coreApi.${t} is unavailable inside worker loaders.`)};return{fetchFile:async(t,r)=>await fetch(t,r),parseSync:e("parseSync"),parse:e("parse"),parseFile:e("parseFile"),parseInBatches:e("parseInBatches"),load:e("load"),loadInBatches:e("loadInBatches")}}function Nv(e){return(t,r,n,i)=>{if(!e)throw new Error("Worker not set up to parse on main thread");let o=gU(r,n,i);return e(t,o.options,{...o.context,...Array.isArray(r)||r&&Fv(r)?{_loaderIsArray:Array.isArray(r),_loaderIds:(Array.isArray(r)?r:[r]).map(s=>s.id)}:{}})}}function gU(e,t,r){return t?{options:t,context:Gg(r)}:Array.isArray(e)||e&&Fv(e)?{options:void 0,context:Gg(r)}:e&&!Array.isArray(e)?{options:e}:{options:void 0,context:Gg(r)}}function Fv(e){return"id"in e&&"extensions"in e}function Gg(e){if(!e)return;let{fetch:t,loaders:r,coreApi:n,signal:i,reportProgress:o,_parse:s,_parseSync:a,_parseInBatches:c,...l}=e;return JSON.parse(JSON.stringify(l))}async function yU({loader:e,arrayBuffer:t,options:r,context:n}){let i,o;if(e.parse||e.parseSync)i=t,o=e.parse||e.parseSync;else if(e.parseTextSync)i=new TextDecoder().decode(t),o=e.parseTextSync;else throw new Error(`Could not load data with ${e.name} loader`);return r=Gv(e,r),await o(i,{...r},n,e)}function Gv(e,t){var r;return{...t,modules:{...(r=e.options)==null?void 0:r.modules,...t.modules},core:{...t.core,worker:!1}}}var kv=p(()=>{"use strict";rc()});function Yd(e={}){if(e.coordinateEpoch!==void 0&&!Number.isFinite(e.coordinateEpoch))throw new Error("Spatial reference coordinate epoch must be a finite decimal year");return Object.freeze({crs:Uv(e.crs||{state:"absent",provenance:"unknown"}),vertical:e.vertical?Uv(e.vertical):void 0,coordinateEpoch:e.coordinateEpoch,coordinateFrame:e.coordinateFrame||"unknown",coordinateOrder:Object.freeze([...e.coordinateOrder||[]]),units:e.units?Object.freeze([...e.units]):void 0})}function yr(e){if(typeof e=="object")return"projjson";let t=e.trim();return/^[A-Z][A-Z0-9_]*\s*[\[(]/i.test(t)?"wkt":/(?:^|\s)\+?proj=/i.test(t)?"proj-string":/^[A-Z][A-Z0-9._-]*(?::[A-Z0-9._-]+)+$/i.test(t)||/^urn:ogc:def:crs:/i.test(t)||/^https?:\/\//i.test(t)||/^[A-Z][A-Z0-9._-]*$/i.test(t)?"identifier":"opaque"}function Uv(e){return e.state==="explicit"||e.state==="default"?Object.freeze({...e,definition:jv(e.definition),alternatives:e.alternatives?Object.freeze(e.alternatives.map(t=>Object.freeze({...t,definition:jv(t.definition)}))):void 0}):Object.freeze({...e})}function jv(e){return typeof e=="string"?e:Ug(e)}function Ug(e){return Array.isArray(e)?Object.freeze(e.map(t=>Ug(t))):e&&typeof e=="object"?Object.freeze(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Ug(r)]))):e}var Bl=p(()=>{});function wf(e,t){let n={type:"wkt-crs",root:new jg(e).parse()};if(t!=null&&t.strict){let i=Wv(n,{profile:t.profile,allowExtensions:!1});if(i.length>0)throw new Jd(i)}return n}function Wv(e,t){var a;if(!e||e.type!=="wkt-crs"||((a=e.root)==null?void 0:a.type)!=="node")throw new TypeError("validateWKTCRS expects a WKTCRSAst");let r=IU(e.root.keyword,(t==null?void 0:t.profile)||"auto"),n=AU[r],i=TU[r],o=[],s=e.root.keyword.toUpperCase();return n.has(s)||o.push({code:"invalid-root",message:`${e.root.keyword} is not a ${r} root keyword`,path:[],keyword:e.root.keyword}),Hv(e.root,[],c=>{let l=c.node.keyword.toUpperCase();!(t!=null&&t.allowExtensions)&&!i.has(l)&&o.push({code:"unknown-keyword",message:`${c.node.keyword} is not defined by the ${r} profile`,path:c.path,keyword:c.node.keyword}),c.node.values.length===0&&o.push({code:"empty-node",message:`${c.node.keyword} must contain at least one value`,path:c.path,keyword:c.node.keyword});let u=PU(c.node);u&&o.push({code:"invalid-value",message:u,path:c.path,keyword:c.node.keyword})}),o}function IU(e,t){return t!=="auto"?t:bf.has(e.toUpperCase())?"wkt1":"wkt2:2019"}function PU(e){let t=e.keyword.toUpperCase(),r=e.values,n=(o,...s)=>!!(r[o]&&s.includes(r[o].type)),i=(o,...s)=>r.length===o&&s.every((a,c)=>n(c,a));if(["ANGLEUNIT","LENGTHUNIT","PARAMETRICUNIT","SCALEUNIT","TIMEUNIT","TEMPORALQUANTITY","UNIT"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"number")))return`${e.keyword} must start with a quoted name and numeric conversion factor`;if(t==="CS"&&!i(2,"enumeration","number"))return`${e.keyword} must contain a coordinate-system type and dimension`;if(t==="BBOX"&&!i(4,"number","number","number","number"))return`${e.keyword} must contain four numeric bounds`;if(["ENSEMBLEACCURACY","EPOCH","COORDEPOCH","FRAMEEPOCH","OPERATIONACCURACY","ORDER"].includes(t)&&!i(1,"number"))return`${e.keyword} must contain one number`;if(["ANCHOR","AREA","CALENDAR","CITATION","REMARK","SCOPE","URI","VERSION"].includes(t)&&!i(1,"string"))return`${e.keyword} must contain one quoted string`;if(["ELLIPSOID","SPHEROID","TRIAXIAL"].includes(t)&&!(r.length>=3&&n(0,"string")&&n(1,"number")&&n(2,"number")))return`${e.keyword} must start with a quoted name and numeric ellipsoid axes`;if(["PARAMETER"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"number")))return`${e.keyword} must start with a quoted name and numeric value`;if(t==="PARAMETERFILE"&&!i(2,"string","string"))return`${e.keyword} must contain a quoted name and file name`;if(["AUTHORITY","ID"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"string","number")))return`${e.keyword} must start with a quoted authority and identifier`;if(["AXIS"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"enumeration")))return`${e.keyword} must start with a quoted name and axis direction`;if(["METHOD","PROJECTION"].includes(t)&&!(r.length>=1&&n(0,"string")))return`${e.keyword} must start with a quoted name`;if(t==="TIMEEXTENT"){let o=s=>n(s,"enumeration","string");if(r.length!==2||!o(0)||!o(1))return`${e.keyword} must contain two date-time or quoted values`}if(t==="VERTICALEXTENT"&&(r.length<2||r.length>3||!n(0,"number")||!n(1,"number")||r.length===3&&!n(2,"node")))return`${e.keyword} must contain two numeric bounds and an optional unit`;if(t==="COORDINATEMETADATA"&&(r.length<1||r.length>2||!n(0,"node")||r.length===2&&(!n(1,"node")||!["EPOCH","COORDEPOCH"].includes(r[1].keyword.toUpperCase()))))return`${e.keyword} must contain a CRS and an optional coordinate epoch`;if(t==="BOUNDCRS"){let o=r.slice(0,3).map(s=>s.type==="node"?s.keyword.toUpperCase():"");if(o[0]!=="SOURCECRS"||o[1]!=="TARGETCRS"||o[2]!=="ABRIDGEDTRANSFORMATION")return`${e.keyword} must start with SOURCECRS, TARGETCRS, and ABRIDGEDTRANSFORMATION`}return["COMPOUNDCRS","CONCATENATEDOPERATION","COORDINATEOPERATION","DERIVEDPROJCRS","ENGCRS","ENGINEERINGCRS","GEODCRS","GEODETICCRS","GEOGCRS","GEOGRAPHICCRS","PARAMETRICCRS","POINTMOTIONOPERATION","PROJCRS","PROJECTEDCRS","TIMECRS","VERTCRS","VERTICALCRS"].includes(t)&&!n(0,"string")?`${e.keyword} must start with a quoted name`:null}function Hv(e,t,r){r({node:e,path:t});for(let n=0;n<e.values.length;n++){let i=e.values[n];i.type==="node"&&Hv(i,[...t,n],r)}}function RU(e,t){let r=1,n=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
3
- `?(r++,n=1):n++;return{line:r,column:n}}var Zd,Jd,bU,wU,bf,zg,xU,_U,SU,MU,zv,qv,Vv,vU,EU,AU,TU,jg,qg=p(()=>{Zd=class extends SyntaxError{constructor(t,r,n){let i=RU(r,n);super(`${t} at ${i.line}:${i.column}`),this.name="WKTCRSSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}},Jd=class extends Error{constructor(t){var r;super(((r=t[0])==null?void 0:r.message)||"WKT validation failed"),this.name="WKTCRSValidationError",this.issues=t}},bU=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?$/,wU=/^[A-Za-z][A-Za-z0-9_]*/,bf=new Set(["COMPD_CS","CONCAT_MT","FITTED_CS","GEOCCS","GEOGCS","INVERSE_MT","LOCAL_CS","PARAM_MT","PASSTHROUGH_MT","PROJCS","VERT_CS"]),zg=new Set([...bf,"AUTHORITY","AXIS","CONCAT_MT","DATUM","INVERSE_MT","LOCAL_DATUM","PARAMETER","PARAM_MT","PASSTHROUGH_MT","PRIMEM","PROJECTION","SPHEROID","TOWGS84","UNIT","VERT_DATUM"]),xU=new Set(bf),_U=new Set([...zg,"EXTENSION"]),SU=new Set([...bf,"COMPDCS","LOCALCS","VERTCS"]),MU=new Set([...zg,"COMPDCS","LOCALCS","VDATUM","VERTCS"]),zv=new Set(["BOUNDCRS","COMPOUNDCRS","COORDINATEOPERATION","ENGCRS","ENGINEERINGCRS","GEODCRS","GEODETICCRS","PARAMETRICCRS","PROJCRS","PROJECTEDCRS","TIMECRS","VERTCRS","VERTICALCRS"]),qv=new Set([...zv,"CONCATENATEDOPERATION","COORDINATEMETADATA","DERIVEDPROJCRS","GEOGCRS","GEOGRAPHICCRS","POINTMOTIONOPERATION"]),Vv=new Set([...qv,"ABRIDGEDTRANSFORMATION","ANCHOR","ANGLEUNIT","AREA","AXIS","BASEENGCRS","BASEGEODCRS","BASEGEOGCRS","BASEPARAMCRS","BASEPROJCRS","BASETIMECRS","BASEVERTCRS","BBOX","BEARING","CALENDAR","CITATION","CONVERSION","COORDEPOCH","CS","DATUM","DERIVINGCONVERSION","DYNAMIC","EDATUM","ELLIPSOID","ENGINEERINGDATUM","ENSEMBLE","ENSEMBLEACCURACY","EPOCH","FRAMEEPOCH","GEODETICDATUM","GEOIDMODEL","ID","INTERPOLATIONCRS","LENGTHUNIT","MEMBER","MERIDIAN","METHOD","MODEL","OPERATIONACCURACY","ORDER","PARAMETER","PARAMETERFILE","PARAMETRICDATUM","PARAMETRICUNIT","PDATUM","PRIMEM","PRIMEMERIDIAN","REMARK","SCALEUNIT","SCOPE","SOURCECRS","STEP","TARGETCRS","TDATUM","TEMPORALQUANTITY","TIMEEXTENT","TIMEORIGIN","TIMEUNIT","TIMEDATUM","TRIAXIAL","TRF","URI","USAGE","VDATUM","VERSION","VERTICALDATUM","VERTICALEXTENT","VELOCITYGRID","VRF"]),vU=new Set(["BASEGEOGCRS","CALENDAR","CONCATENATEDOPERATION","COORDEPOCH","COORDINATEMETADATA","DERIVEDPROJCRS","DYNAMIC","ENSEMBLE","ENSEMBLEACCURACY","EPOCH","FRAMEEPOCH","GEOGCRS","GEOGRAPHICCRS","GEOIDMODEL","MEMBER","MODEL","POINTMOTIONOPERATION","STEP","TEMPORALQUANTITY","TRF","TRIAXIAL","VELOCITYGRID","VRF"]),EU=new Set([...Vv].filter(e=>!vU.has(e))),AU={wkt1:bf,gdal:xU,esri:SU,"wkt2:2015":zv,"wkt2:2019":qv},TU={wkt1:zg,gdal:_U,esri:MU,"wkt2:2015":EU,"wkt2:2019":Vv};jg=class{constructor(t){this.offset=0,this.source=t}parse(){this.skipWhitespace();let t=this.parseNode();return this.skipWhitespace(),this.offset!==this.source.length&&this.fail("Unexpected content after WKT root"),t}parseNode(){let t=this.parseKeyword();return this.parseNodeAfterKeyword(t)}parseNodeAfterKeyword(t){this.skipWhitespace();let r=this.source[this.offset];r!=="["&&r!=="("&&this.fail(`Expected '[' or '(' after ${t}`),this.offset++;let n=r==="["?"bracket":"parenthesis",i=r==="["?"]":")",o=[];if(this.skipWhitespace(),this.source[this.offset]===i)return this.offset++,{type:"node",keyword:t,delimiter:n,values:o};for(;this.offset<this.source.length;){o.push(this.parseValue()),this.skipWhitespace();let s=this.source[this.offset];if(s===","){this.offset++,this.skipWhitespace(),this.source[this.offset]===i&&this.fail("Expected a WKT value after comma");continue}if(s===i)return this.offset++,{type:"node",keyword:t,delimiter:n,values:o};(s==="]"||s===")")&&this.fail(`Expected '${i}' to close ${t}`),this.fail(`Expected ',' or '${i}' in ${t}`)}this.fail(`Unterminated ${t} node`)}parseValue(){if(this.skipWhitespace(),this.source[this.offset]==='"')return this.parseString();let r=this.offset;for(;this.offset<this.source.length&&!/[\s,\[\]()"]/.test(this.source[this.offset]);)this.offset++;r===this.offset&&this.fail("Expected a WKT value");let n=this.source.slice(r,this.offset);return this.source[this.offset]==='"'&&this.fail("Unexpected quote in unquoted WKT value"),this.skipWhitespace(),this.source[this.offset]==="["||this.source[this.offset]==="("?(/^[A-Za-z][A-Za-z0-9_]*$/.test(n)||this.fail(`Invalid WKT keyword '${n}'`),this.parseNodeAfterKeyword(n)):bU.test(n)?{type:"number",value:Number(n),raw:n}:{type:"enumeration",value:n}}parseKeyword(){let t=this.source.slice(this.offset).match(wU);return t||this.fail("Expected a WKT keyword"),this.offset+=t[0].length,t[0]}parseString(){this.offset++;let t="";for(;this.offset<this.source.length;){let r=this.source[this.offset++];if(r==='"'){if(this.source[this.offset]==='"'){t+='"',this.offset++;continue}return{type:"string",value:t}}t+=r}this.fail("Unterminated WKT string")}skipWhitespace(){for(;this.offset<this.source.length&&/\s/.test(this.source[this.offset]);)this.offset++}fail(t){throw new Zd(t,this.source,this.offset)}}});function xf(e){let t=BU(e);if(t.length===0)throw new Go("PROJ string is empty",e,0);return{type:"proj-string",parameters:t.map(n=>OU(n.raw,n.offset,e))}}function OU(e,t,r){let n=e.startsWith("+")?e.slice(1):e;if(!n)throw new Go("Expected a parameter after '+'",r,t);let i=n.indexOf("="),o=i<0?n:n.slice(0,i);if(!o||/[\s+=]/.test(o))throw new Go(`Invalid PROJ parameter name '${o}'`,r,t);if(i<0)return{type:"parameter",name:o};let s=n.slice(i+1),a=CU(s,r,t+i+1);return{type:"parameter",name:o,value:a,rawValue:s}}function BU(e){let t=[],r=0;for(;r<e.length;){for(;r<e.length&&/\s/.test(e[r]);)r++;if(r>=e.length)break;let n=r,i=null,o=!1;for(;r<e.length;){let s=e[r];if(o){o=!1,r++;continue}if(s==="\\"&&i){o=!0,r++;continue}if(i){s===i&&(i=null),r++;continue}if((s==='"'||s==="'")&&e[r-1]==="="){i=s,r++;continue}if(/\s/.test(s))break;r++}if(i)throw new Go("Unterminated quoted PROJ value",e,n);t.push({raw:e.slice(n,r),offset:n})}return t}function CU(e,t,r){if(!e)return"";let n=e[0];if(n!=='"'&&n!=="'"){if((e.includes('"')||e.includes("'"))&&!LU.test(e))throw new Go("Quote must begin a PROJ parameter value",t,r);return e}if(e[e.length-1]!==n)throw new Go("Unterminated quoted PROJ value",t,r);let i="";for(let o=1;o<e.length-1;o++){let s=e[o];s==="\\"&&o+1<e.length-1?i+=e[++o]:i+=s}return i}function DU(e,t){let r=1,n=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
4
- `?(r++,n=1):n++;return{line:r,column:n}}var Go,LU,Vg=p(()=>{Go=class extends SyntaxError{constructor(t,r,n){let i=DU(r,n);super(`${t} at ${i.line}:${i.column}`),this.name="PROJStringSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}};LU=/^[+-]?\d+(?:\.\d*)?d(?:\d+(?:\.\d*)?'(?:\d+(?:\.\d*)?")?)?[NSEW]?$/i});var _f,$v=p(()=>{_f={m:{name:"meters",metersPerUnit:1},mm:{name:"millimeters",metersPerUnit:.001},cm:{name:"centimeters",metersPerUnit:.01},ft:{name:"feet",metersPerUnit:.3048},"us-ft":{name:"us-survey-feet",metersPerUnit:.3048006096012192},fath:{name:"fathoms",metersPerUnit:1.8288},kmi:{name:"nautical-miles",metersPerUnit:1852},"us-ch":{name:"us-survey-chains",metersPerUnit:20.1168402336805},"us-mi":{name:"us-survey-miles",metersPerUnit:1609.34721869444},km:{name:"kilometers",metersPerUnit:1e3},"ind-ft":{name:"indian-feet",metersPerUnit:.30479841},"ind-yd":{name:"indian-yards",metersPerUnit:.91439523},mi:{name:"miles",metersPerUnit:1609.344},yd:{name:"yards",metersPerUnit:.9144},ch:{name:"chains",metersPerUnit:20.1168},link:{name:"links",metersPerUnit:.201168},dm:{name:"decimeters",metersPerUnit:.1},in:{name:"inches",metersPerUnit:.0254},"ind-ch":{name:"indian-chains",metersPerUnit:20.11669506},"us-in":{name:"us-survey-inches",metersPerUnit:.025400050800101},"us-yd":{name:"us-survey-yards",metersPerUnit:.914401828803658}}});function Kv(e){return JSON.stringify([e.coordinateFrame,e.projection,Object.keys(e.parameters).sort().map(t=>[t,e.parameters[t]]),[e.ellipsoid.semiMajorAxis,e.ellipsoid.semiMinorAxis],e.axis,[e.xUnit.name,e.xUnit.metersPerUnit,e.xUnit.degreesPerUnit],[e.yUnit.name,e.yUnit.metersPerUnit,e.yUnit.degreesPerUnit],[e.zUnit.name,e.zUnit.metersPerUnit,e.zUnit.degreesPerUnit],e.lossy,e.areaOfUse])}var Wg=p(()=>{$v()});var Hg=p(()=>{Bl();qg();Vg()});var Qd={};ir(Qd,{EPSILON1:()=>NU,EPSILON10:()=>WU,EPSILON11:()=>HU,EPSILON12:()=>$U,EPSILON13:()=>KU,EPSILON14:()=>XU,EPSILON15:()=>YU,EPSILON16:()=>ZU,EPSILON17:()=>JU,EPSILON18:()=>QU,EPSILON19:()=>ej,EPSILON2:()=>FU,EPSILON20:()=>tj,EPSILON3:()=>GU,EPSILON4:()=>kU,EPSILON5:()=>UU,EPSILON6:()=>jU,EPSILON7:()=>zU,EPSILON8:()=>qU,EPSILON9:()=>VU,PI:()=>oj,PI_OVER_FOUR:()=>nj,PI_OVER_SIX:()=>ij,PI_OVER_TWO:()=>rj,TWO_PI:()=>sj});var NU,FU,GU,kU,UU,jU,zU,qU,VU,WU,HU,$U,KU,XU,YU,ZU,JU,QU,ej,tj,rj,nj,ij,oj,sj,Xv=p(()=>{NU=.1,FU=.01,GU=.001,kU=1e-4,UU=1e-5,jU=1e-6,zU=1e-7,qU=1e-8,VU=1e-9,WU=1e-10,HU=1e-11,$U=1e-12,KU=1e-13,XU=1e-14,YU=1e-15,ZU=1e-16,JU=1e-17,QU=1e-18,ej=1e-19,tj=1e-20,rj=Math.PI/2,nj=Math.PI/4,ij=Math.PI/6,oj=Math.PI,sj=Math.PI*2});function $g(e,{precision:t=wt.precision}={}){return e=uj(e),`${parseFloat(e.toPrecision(t))}`}function oo(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Kg(e){return Yv(e)}function Xg(e){return Zv(e)}function Yv(e,t){return Jv(e,r=>r*cj,t)}function Zv(e,t){return Jv(e,r=>r*aj,t)}function em(e,t,r){let n=wt.EPSILON;r&&(wt.EPSILON=r);try{if(e===t)return!0;if(oo(e)&&oo(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!em(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=wt.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{wt.EPSILON=n}}function uj(e){return Math.round(e/wt.EPSILON)*wt.EPSILON}function fj(e){return e.clone?e.clone():new Array(e.length)}function Jv(e,t,r){if(oo(e)){let n=e;r=r||fj(n);for(let i=0;i<r.length&&i<n.length;++i){let o=typeof e=="number"?e:e[i];r[i]=t(o,i,r)}return r}return t(e)}var aj,cj,lj,wt,Cl=p(()=>{aj=1/Math.PI*180,cj=1/180*Math.PI,lj={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...lj}};wt=globalThis.mathgl.config});var Ts,tm=p(()=>{Cl();Ts=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:oo(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toString(){return this.formatString(wt)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+$g(this[n],t);return`${t.printTypes?this.constructor.name:""}[${r}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!em(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let i=0;i<this.ELEMENTS;++i){let o=t[i],s=typeof r=="number"?r:r[i];this[i]=o+n*(s-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(wt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}}});function hj(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function $t(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function Dl(e,t,r=""){if(wt.debug&&!hj(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}var nc=p(()=>{Cl()});var Nl,Yg=p(()=>{tm();nc();Cl();Nl=class extends Ts{toString(){let t="[";if(wt.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+r]}`}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=` ${this[r]}`}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=$t(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(t,r){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}}});function Ii(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var Zg=p(()=>{});var rm,Qv=p(()=>{tm();nc();Zg();rm=class extends Ts{get x(){return this[0]}set x(t){this[0]=$t(t)}get y(){return this[1]}set y(t){this[1]=$t(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-t[n];r+=i*i}return $t(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return $t(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return Ii(t>=0&&t<this.ELEMENTS,"index is out of range"),$t(this[t])}setComponent(t,r){return Ii(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]+=t[n]*r;return this.check()}}});var nm,vQ,eE=p(()=>{nm=typeof Float32Array<"u"?Float32Array:Array,vQ=Math.PI/180});function tE(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function rE(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var im=p(()=>{});function nE(e,t,r){let n=t[0],i=t[1],o=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/o,e[1]=(r[1]*n+r[5]*i)/o,e}function om(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[3]*n+r[7]*i+r[11]*o||1;return e[0]=(r[0]*n+r[4]*i+r[8]*o)/s,e[1]=(r[1]*n+r[5]*i+r[9]*o)/s,e[2]=(r[2]*n+r[6]*i+r[10]*o)/s,e}function iE(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function oE(e,t,r){let n=t[0],i=t[1],o=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*o,e[1]=r[1]*n+r[4]*i+r[7]*o,e[2]=r[2]*n+r[5]*i+r[8]*o,e[3]=t[3],e}var sm=p(()=>{});function sE(){let e=new nm(3);return nm!==Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function mj(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function Jg(e,t,r){let n=new nm(3);return n[0]=e,n[1]=t,n[2]=r,n}function aE(e,t){let r=t[0],n=t[1],i=t[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Qg(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Fl(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[0],a=r[1],c=r[2];return e[0]=i*c-o*a,e[1]=o*s-n*c,e[2]=n*a-i*s,e}function am(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return s=s||1,e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/s,e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,e}function cm(e,t,r){let n=t[0],i=t[1],o=t[2];return e[0]=n*r[0]+i*r[3]+o*r[6],e[1]=n*r[1]+i*r[4]+o*r[7],e[2]=n*r[2]+i*r[5]+o*r[8],e}function cE(e,t,r){let n=r[0],i=r[1],o=r[2],s=r[3],a=t[0],c=t[1],l=t[2],u=i*l-o*c,h=o*a-n*l,d=n*c-i*a,m=i*d-o*h,g=o*u-n*d,y=n*h-i*u,b=s*2;return u*=b,h*=b,d*=b,m*=2,g*=2,y*=2,e[0]=a+u+m,e[1]=c+h+g,e[2]=l+d+y,e}function lE(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function uE(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function fE(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function hE(e,t){let r=e[0],n=e[1],i=e[2],o=t[0],s=t[1],a=t[2],c=Math.sqrt((r*r+n*n+i*i)*(o*o+s*s+a*a)),l=c&&Qg(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}var dE,Gl=p(()=>{eE();dE=mj});var ey,lm,J,mE=p(()=>{Qv();Cl();nc();Gl();sm();ey=[0,0,0],J=class e extends rm{static get ZERO(){return lm||(lm=new e(0,0,0),Object.freeze(lm)),lm}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&oo(t)?this.copy(t):(wt.debug&&($t(t),$t(r),$t(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return wt.debug&&($t(t.x),$t(t.y),$t(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=$t(t)}angle(t){return hE(this,t)}cross(t){return Fl(this,this,t),this.check()}rotateX({radians:t,origin:r=ey}){return lE(this,this,r,t),this.check()}rotateY({radians:t,origin:r=ey}){return uE(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=ey}){return fE(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return am(this,this,t),this.check()}transformAsVector(t){return om(this,this,t),this.check()}transformByMatrix3(t){return cm(this,this,t),this.check()}transformByMatrix2(t){return iE(this,this,t),this.check()}transformByQuaternion(t){return cE(this,this,t),this.check()}}});function pE(e,t){if(e===t){let r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function gE(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],c=t[6],l=t[7],u=t[8],h=u*s-a*l,d=-u*o+a*c,m=l*o-s*c,g=r*h+n*d+i*m;return g?(g=1/g,e[0]=h*g,e[1]=(-u*n+i*l)*g,e[2]=(a*n-i*s)*g,e[3]=d*g,e[4]=(u*r-i*c)*g,e[5]=(-a*r+i*o)*g,e[6]=m*g,e[7]=(-l*r+n*c)*g,e[8]=(s*r-n*o)*g,e):null}function yE(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],c=e[7],l=e[8];return t*(l*o-s*c)+r*(-l*i+s*a)+n*(c*i-o*a)}function ty(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=r[0],m=r[1],g=r[2],y=r[3],b=r[4],w=r[5],S=r[6],M=r[7],v=r[8];return e[0]=d*n+m*s+g*l,e[1]=d*i+m*a+g*u,e[2]=d*o+m*c+g*h,e[3]=y*n+b*s+w*l,e[4]=y*i+b*a+w*u,e[5]=y*o+b*c+w*h,e[6]=S*n+M*s+v*l,e[7]=S*i+M*a+v*u,e[8]=S*o+M*c+v*h,e}function bE(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=r[0],m=r[1];return e[0]=n,e[1]=i,e[2]=o,e[3]=s,e[4]=a,e[5]=c,e[6]=d*n+m*s+l,e[7]=d*i+m*a+u,e[8]=d*o+m*c+h,e}function wE(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=Math.sin(r),m=Math.cos(r);return e[0]=m*n+d*s,e[1]=m*i+d*a,e[2]=m*o+d*c,e[3]=m*s-d*n,e[4]=m*a-d*i,e[5]=m*c-d*o,e[6]=l,e[7]=u,e[8]=h,e}function ry(e,t,r){let n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function xE(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,a=n+n,c=i+i,l=r*s,u=n*s,h=n*a,d=i*s,m=i*a,g=i*c,y=o*s,b=o*a,w=o*c;return e[0]=1-h-g,e[3]=u-w,e[6]=d+b,e[1]=u+w,e[4]=1-l-g,e[7]=m-y,e[2]=d-b,e[5]=m+y,e[8]=1-l-h,e}var ny=p(()=>{});function yj(){return um||(um=new ic([0,0,0,0,0,0,0,0,0]),Object.freeze(um)),um}function bj(){return fm||(fm=new ic,Object.freeze(fm)),fm}var iy,gj,ic,um,fm,_E=p(()=>{Yg();nc();sm();ny();im();Gl();(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(iy||(iy={}));gj=Object.freeze([1,0,0,0,1,0,0,0,1]),ic=class extends Nl{static get IDENTITY(){return bj()}static get ZERO(){return yj()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return iy}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(gj)}fromObject(t){return this.check()}fromQuaternion(t){return xE(this,t),this.check()}fromMatrix4(t){return this.set(t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10])}set(t,r,n,i,o,s,a,c,l){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=l,this.check()}setRowMajor(t,r,n,i,o,s,a,c,l){return this[0]=t,this[1]=i,this[2]=a,this[3]=r,this[4]=o,this[5]=c,this[6]=n,this[7]=s,this[8]=l,this.check()}determinant(){return yE(this)}transpose(){return pE(this,this),this.check()}invert(){return gE(this,this),this.check()}multiplyLeft(t){return ty(this,t,this),this.check()}multiplyRight(t){return ty(this,this,t),this.check()}rotate(t){return wE(this,this,t),this.check()}scale(t){return Array.isArray(t)?ry(this,this,t):ry(this,this,[t,t]),this.check()}translate(t){return bE(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=tE(r||[-0,-0],t,this);break;case 3:n=cm(r||[-0,-0,-0],t,this);break;case 4:n=oE(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Dl(n,t.length),n}},fm=null});function wj(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 SE(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=i,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function ME(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],c=t[6],l=t[7],u=t[8],h=t[9],d=t[10],m=t[11],g=t[12],y=t[13],b=t[14],w=t[15],S=r*a-n*s,M=r*c-i*s,v=r*l-o*s,T=n*c-i*a,O=n*l-o*a,P=i*l-o*c,_=u*y-h*g,U=u*b-d*g,C=u*w-m*g,L=h*b-d*y,A=h*w-m*y,W=d*w-m*b,G=S*W-M*A+v*L+T*C-O*U+P*_;return G?(G=1/G,e[0]=(a*W-c*A+l*L)*G,e[1]=(i*A-n*W-o*L)*G,e[2]=(y*P-b*O+w*T)*G,e[3]=(d*O-h*P-m*T)*G,e[4]=(c*C-s*W-l*U)*G,e[5]=(r*W-i*C+o*U)*G,e[6]=(b*v-g*P-w*M)*G,e[7]=(u*P-d*v+m*M)*G,e[8]=(s*A-a*C+l*_)*G,e[9]=(n*C-r*A-o*_)*G,e[10]=(g*O-y*v+w*S)*G,e[11]=(h*v-u*O-m*S)*G,e[12]=(a*U-s*L-c*_)*G,e[13]=(r*L-n*U+i*_)*G,e[14]=(y*M-g*T-b*S)*G,e[15]=(u*T-h*M+d*S)*G,e):null}function vE(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],c=e[7],l=e[8],u=e[9],h=e[10],d=e[11],m=e[12],g=e[13],y=e[14],b=e[15],w=t*s-r*o,S=t*a-n*o,M=r*a-n*s,v=l*g-u*m,T=l*y-h*m,O=u*y-h*g,P=t*O-r*T+n*v,_=o*O-s*T+a*v,U=l*M-u*S+h*w,C=m*M-g*S+y*w;return c*P-i*_+b*U-d*C}function oy(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=t[9],m=t[10],g=t[11],y=t[12],b=t[13],w=t[14],S=t[15],M=r[0],v=r[1],T=r[2],O=r[3];return e[0]=M*n+v*a+T*h+O*y,e[1]=M*i+v*c+T*d+O*b,e[2]=M*o+v*l+T*m+O*w,e[3]=M*s+v*u+T*g+O*S,M=r[4],v=r[5],T=r[6],O=r[7],e[4]=M*n+v*a+T*h+O*y,e[5]=M*i+v*c+T*d+O*b,e[6]=M*o+v*l+T*m+O*w,e[7]=M*s+v*u+T*g+O*S,M=r[8],v=r[9],T=r[10],O=r[11],e[8]=M*n+v*a+T*h+O*y,e[9]=M*i+v*c+T*d+O*b,e[10]=M*o+v*l+T*m+O*w,e[11]=M*s+v*u+T*g+O*S,M=r[12],v=r[13],T=r[14],O=r[15],e[12]=M*n+v*a+T*h+O*y,e[13]=M*i+v*c+T*d+O*b,e[14]=M*o+v*l+T*m+O*w,e[15]=M*s+v*u+T*g+O*S,e}function EE(e,t,r){let n=r[0],i=r[1],o=r[2],s,a,c,l,u,h,d,m,g,y,b,w;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*o+t[12],e[13]=t[1]*n+t[5]*i+t[9]*o+t[13],e[14]=t[2]*n+t[6]*i+t[10]*o+t[14],e[15]=t[3]*n+t[7]*i+t[11]*o+t[15]):(s=t[0],a=t[1],c=t[2],l=t[3],u=t[4],h=t[5],d=t[6],m=t[7],g=t[8],y=t[9],b=t[10],w=t[11],e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=u,e[5]=h,e[6]=d,e[7]=m,e[8]=g,e[9]=y,e[10]=b,e[11]=w,e[12]=s*n+u*i+g*o+t[12],e[13]=a*n+h*i+y*o+t[13],e[14]=c*n+d*i+b*o+t[14],e[15]=l*n+m*i+w*o+t[15]),e}function AE(e,t,r){let n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function TE(e,t,r,n){let i=n[0],o=n[1],s=n[2],a=Math.sqrt(i*i+o*o+s*s),c,l,u,h,d,m,g,y,b,w,S,M,v,T,O,P,_,U,C,L,A,W,G,E;return a<1e-6?null:(a=1/a,i*=a,o*=a,s*=a,l=Math.sin(r),c=Math.cos(r),u=1-c,h=t[0],d=t[1],m=t[2],g=t[3],y=t[4],b=t[5],w=t[6],S=t[7],M=t[8],v=t[9],T=t[10],O=t[11],P=i*i*u+c,_=o*i*u+s*l,U=s*i*u-o*l,C=i*o*u-s*l,L=o*o*u+c,A=s*o*u+i*l,W=i*s*u+o*l,G=o*s*u-i*l,E=s*s*u+c,e[0]=h*P+y*_+M*U,e[1]=d*P+b*_+v*U,e[2]=m*P+w*_+T*U,e[3]=g*P+S*_+O*U,e[4]=h*C+y*L+M*A,e[5]=d*C+b*L+v*A,e[6]=m*C+w*L+T*A,e[7]=g*C+S*L+O*A,e[8]=h*W+y*G+M*E,e[9]=d*W+b*G+v*E,e[10]=m*W+w*G+T*E,e[11]=g*W+S*G+O*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function IE(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[4],s=t[5],a=t[6],c=t[7],l=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+l*n,e[5]=s*i+u*n,e[6]=a*i+h*n,e[7]=c*i+d*n,e[8]=l*i-o*n,e[9]=u*i-s*n,e[10]=h*i-a*n,e[11]=d*i-c*n,e}function PE(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],a=t[2],c=t[3],l=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-l*n,e[1]=s*i-u*n,e[2]=a*i-h*n,e[3]=c*i-d*n,e[8]=o*n+l*i,e[9]=s*n+u*i,e[10]=a*n+h*i,e[11]=c*n+d*i,e}function RE(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],a=t[2],c=t[3],l=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+l*n,e[1]=s*i+u*n,e[2]=a*i+h*n,e[3]=c*i+d*n,e[4]=l*i-o*n,e[5]=u*i-s*n,e[6]=h*i-a*n,e[7]=d*i-c*n,e}function LE(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,a=n+n,c=i+i,l=r*s,u=n*s,h=n*a,d=i*s,m=i*a,g=i*c,y=o*s,b=o*a,w=o*c;return e[0]=1-h-g,e[1]=u+w,e[2]=d-b,e[3]=0,e[4]=u-w,e[5]=1-l-g,e[6]=m+y,e[7]=0,e[8]=d+b,e[9]=m-y,e[10]=1-l-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function OE(e,t,r,n,i,o,s){let a=1/(r-t),c=1/(i-n),l=1/(o-s);return e[0]=o*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*c,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(i+n)*c,e[10]=(s+o)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*o*2*l,e[15]=0,e}function xj(e,t,r,n,i){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let s=1/(n-i);e[10]=(i+n)*s,e[14]=2*i*n*s}else e[10]=-1,e[14]=-2*n;return e}function _j(e,t,r,n,i,o,s){let a=1/(t-r),c=1/(n-i),l=1/(o-s);return e[0]=-2*a,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*l,e[11]=0,e[12]=(t+r)*a,e[13]=(i+n)*c,e[14]=(s+o)*l,e[15]=1,e}function DE(e,t,r,n){let i,o,s,a,c,l,u,h,d,m,g=t[0],y=t[1],b=t[2],w=n[0],S=n[1],M=n[2],v=r[0],T=r[1],O=r[2];return Math.abs(g-v)<1e-6&&Math.abs(y-T)<1e-6&&Math.abs(b-O)<1e-6?wj(e):(h=g-v,d=y-T,m=b-O,i=1/Math.sqrt(h*h+d*d+m*m),h*=i,d*=i,m*=i,o=S*m-M*d,s=M*h-w*m,a=w*d-S*h,i=Math.sqrt(o*o+s*s+a*a),i?(i=1/i,o*=i,s*=i,a*=i):(o=0,s=0,a=0),c=d*a-m*s,l=m*o-h*a,u=h*s-d*o,i=Math.sqrt(c*c+l*l+u*u),i?(i=1/i,c*=i,l*=i,u*=i):(c=0,l=0,u=0),e[0]=o,e[1]=c,e[2]=h,e[3]=0,e[4]=s,e[5]=l,e[6]=d,e[7]=0,e[8]=a,e[9]=u,e[10]=m,e[11]=0,e[12]=-(o*g+s*y+a*b),e[13]=-(c*g+l*y+u*b),e[14]=-(h*g+d*y+m*b),e[15]=1,e)}var BE,CE,sy=p(()=>{BE=xj;CE=_j});function NE(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function FE(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function GE(e){let t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}function kE(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function UE(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=r*s,e[1]=n*s,e[2]=i*s,e[3]=o*s,e}function jE(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function zE(e,t,r,n){let i=t[0],o=t[1],s=t[2],a=t[3];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=s+n*(r[2]-s),e[3]=a+n*(r[3]-a),e}function qE(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,e}var hm=p(()=>{});function Aj(){return dm||(dm=new gn([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(dm)),dm}function Tj(){return mm||(mm=new gn,Object.freeze(mm)),mm}function VE(e){if(e>Math.PI*2)throw Error("expected radians")}function Ij(e,t,r,n,i,o){let s=2*o/(r-t),a=2*o/(i-n),c=(r+t)/(r-t),l=(i+n)/(i-n),u=-1,h=-1,d=-2*o;return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=c,e[9]=l,e[10]=u,e[11]=h,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}var ly,Mj,vj,ay,cy,Ej,gn,dm,mm,WE=p(()=>{Yg();nc();sm();sy();im();Gl();hm();(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"})(ly||(ly={}));Mj=45*Math.PI/180,vj=1,ay=.1,cy=500,Ej=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),gn=class extends Nl{static get IDENTITY(){return Tj()}static get ZERO(){return Aj()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return ly}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,o,s,a,c,l,u,h,d,m,g,y,b){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=l,this[9]=u,this[10]=h,this[11]=d,this[12]=m,this[13]=g,this[14]=y,this[15]=b,this.check()}setRowMajor(t,r,n,i,o,s,a,c,l,u,h,d,m,g,y,b){return this[0]=t,this[1]=o,this[2]=l,this[3]=m,this[4]=r,this[5]=s,this[6]=u,this[7]=g,this[8]=n,this[9]=a,this[10]=h,this[11]=y,this[12]=i,this[13]=c,this[14]=d,this[15]=b,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(Ej)}fromObject(t){return this.check()}fromQuaternion(t){return LE(this,t),this.check()}fromMatrix3(t){return this.set(t[0],t[1],t[2],0,t[3],t[4],t[5],0,t[6],t[7],t[8],0,0,0,0,1)}frustum(t){let{left:r,right:n,bottom:i,top:o,near:s=ay,far:a=cy}=t;return a===1/0?Ij(this,r,n,i,o,s):OE(this,r,n,i,o,s,a),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return DE(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:s=ay,far:a=cy}=t;return CE(this,r,n,i,o,s,a),this.check()}orthographic(t){let{fovy:r=Mj,aspect:n=vj,focalDistance:i=1,near:o=ay,far:s=cy}=t;VE(r);let a=r/2,c=i*Math.tan(a),l=c*n;return this.ortho({left:-l,right:l,bottom:-c,top:c,near:o,far:s})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=t;return VE(r),BE(this,r,n,i,o),this.check()}determinant(){return vE(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*s,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*o,t[6]=this[6]*s,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*o,t[10]=this[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*s,t[3]=this[4]*i,t[4]=this[5]*o,t[5]=this[6]*s,t[6]=this[8]*i,t[7]=this[9]*o,t[8]=this[10]*s,t}transpose(){return SE(this,this),this.check()}invert(){return ME(this,this),this.check()}multiplyLeft(t){return oy(this,t,this),this.check()}multiplyRight(t){return oy(this,this,t),this.check()}rotateX(t){return IE(this,this,t),this.check()}rotateY(t){return PE(this,this,t),this.check()}rotateZ(t){return RE(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return TE(this,this,t,r),this.check()}scale(t){return AE(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return EE(this,this,t),this.check()}transform(t,r){return t.length===4?(r=qE(r||[-0,-0,-0,-0],t,this),Dl(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=rE(r||[-0,-0],t,this);break;case 3:i=am(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Dl(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=nE(r||[-0,-0],t,this);break;case 3:n=om(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Dl(n,t.length),n}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}}});function HE(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function uy(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function fy(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=r[0],c=r[1],l=r[2],u=r[3];return e[0]=n*u+s*a+i*l-o*c,e[1]=i*u+s*c+o*a-n*l,e[2]=o*u+s*l+n*c-i*a,e[3]=s*u-n*a-i*c-o*l,e}function $E(e,t,r){r*=.5;let n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+s*a,e[1]=i*c+o*a,e[2]=o*c-i*a,e[3]=s*c-n*a,e}function KE(e,t,r){r*=.5;let n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c-o*a,e[1]=i*c+s*a,e[2]=o*c+n*a,e[3]=s*c-i*a,e}function XE(e,t,r){r*=.5;let n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+i*a,e[1]=i*c-n*a,e[2]=o*c+s*a,e[3]=s*c-o*a,e}function YE(e,t){let r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e}function ZE(e,t,r,n){let i=t[0],o=t[1],s=t[2],a=t[3],c=r[0],l=r[1],u=r[2],h=r[3],d,m,g,y,b;return d=i*c+o*l+s*u+a*h,d<0&&(d=-d,c=-c,l=-l,u=-u,h=-h),1-d>1e-6?(m=Math.acos(d),b=Math.sin(m),g=Math.sin((1-n)*m)/b,y=Math.sin(n*m)/b):(g=1-n,y=n),e[0]=g*i+y*c,e[1]=g*o+y*l,e[2]=g*s+y*u,e[3]=g*a+y*h,e}function JE(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-i*a,e[3]=o*a,e}function QE(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function e4(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);let o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[o*3+o]-t[s*3+s]+1),e[i]=.5*n,n=.5/n,e[3]=(t[o*3+s]-t[s*3+o])*n,e[o]=(t[o*3+i]+t[i*3+o])*n,e[s]=(t[s*3+i]+t[i*3+s])*n}return e}var t4,r4,n4,i4,o4,s4,Pj,a4,hy=p(()=>{Gl();hm();t4=NE,r4=FE,n4=jE,i4=zE,o4=GE,s4=kE,Pj=UE,a4=(function(){let e=sE(),t=Jg(1,0,0),r=Jg(0,1,0);return function(n,i,o){let s=Qg(i,o);return s<-.999999?(Fl(e,t,i),dE(e)<1e-6&&Fl(e,r,i),aE(e,e),uy(n,e,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Fl(e,i,o),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+s,Pj(n,n))}})()});var Mf,c4=p(()=>{tm();nc();hy();Mf=class extends Ts{constructor(t=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return e4(this,t),this.check()}fromEuler(t){switch(this.identity(),t.order){case"xyz":return this.rotateX(t.x).rotateY(t.y).rotateZ(t.z);case"yxz":return this.rotateY(t.y).rotateX(t.x).rotateZ(t.z);case"zxy":return this.rotateZ(t.z).rotateX(t.x).rotateY(t.y);case"zyx":return this.rotateZ(t.z).rotateY(t.y).rotateX(t.x);case"yzx":return this.rotateY(t.y).rotateZ(t.z).rotateX(t.x);case"xzy":return this.rotateX(t.x).rotateZ(t.z).rotateY(t.y);default:throw new Error("Unknown Euler angle order")}}fromAxisRotation(t,r){return uy(this,t,r),this.check()}identity(){return HE(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=$t(t)}get y(){return this[1]}set y(t){this[1]=$t(t)}get z(){return this[2]}set z(t){this[2]=$t(t)}get w(){return this[3]}set w(t){this[3]=$t(t)}len(){return o4(this)}lengthSquared(){return s4(this)}dot(t){return n4(this,t)}rotationTo(t,r){return a4(this,t,r),this.check()}add(t){return t4(this,this,t),this.check()}calculateW(){return YE(this,this),this.check()}conjugate(){return QE(this,this),this.check()}invert(){return JE(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(i4(this,t,r,n),this.check())}multiplyRight(t){return fy(this,this,t),this.check()}multiplyLeft(t){return fy(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return $E(this,this,t),this.check()}rotateY(t){return KE(this,this,t),this.check()}rotateZ(t){return XE(this,this,t),this.check()}scale(t){return r4(this,this,t),this.check()}slerp(t,r,n){let i,o,s;return arguments.length===2?(i=this,o=t,s=r):(i=t,o=r,s=n),ZE(this,i,o,s),this.check()}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}}});function my(){return{eastX:0,eastY:1,northZ:1,upX:1,upY:0,upZ:0}}function py(e,t,r){let n=e.x,i=e.y,o=e.z,s=t.x,a=t.y,c=t.z;return o!==0?!1:Rj(r,n,i,s*i-a*n,s,a,c)}function gy(e,t,r,n,i,o){let s=dy(r),a=dy(n),c=dy(i),l=Math.abs(s),u=Math.abs(a),h=Math.abs(c);if(!l||!u||!h||l===u||l===h||u===h||(l%3+1===u?1:-1)*Math.sign(s*a*c)!==1||!Array.isArray(o)&&o.length<16)return!1;let m=e.eastX,g=e.eastY,y=e.northZ,b=e.upX,w=e.upY,S=e.upZ,M=-S*g,v=S*m,T=t.x,O=t.y,P=t.z,_=(l===1?m:l===2?M:b)*Math.sign(s),U=(l===1?g:l===2?v:w)*Math.sign(s),C=(l===1?0:l===2?y:S)*Math.sign(s),L=(u===1?m:u===2?M:b)*Math.sign(a),A=(u===1?g:u===2?v:w)*Math.sign(a),W=(u===1?0:u===2?y:S)*Math.sign(a),G=(h===1?m:h===2?M:b)*Math.sign(c),E=(h===1?g:h===2?v:w)*Math.sign(c),B=(h===1?0:h===2?y:S)*Math.sign(c);return!Number.isFinite(_)||!Number.isFinite(U)||!Number.isFinite(C)||!Number.isFinite(L)||!Number.isFinite(A)||!Number.isFinite(W)||!Number.isFinite(G)||!Number.isFinite(E)||!Number.isFinite(B)||!Number.isFinite(T)||!Number.isFinite(O)||!Number.isFinite(P)||o instanceof Float32Array&&(!Number.isFinite(Math.fround(_))||!Number.isFinite(Math.fround(U))||!Number.isFinite(Math.fround(C))||!Number.isFinite(Math.fround(L))||!Number.isFinite(Math.fround(A))||!Number.isFinite(Math.fround(W))||!Number.isFinite(Math.fround(G))||!Number.isFinite(Math.fround(E))||!Number.isFinite(Math.fround(B))||!Number.isFinite(Math.fround(T))||!Number.isFinite(Math.fround(O))||!Number.isFinite(Math.fround(P)))?!1:(o[0]=_,o[1]=U,o[2]=C,o[3]=0,o[4]=L,o[5]=A,o[6]=W,o[7]=0,o[8]=G,o[9]=E,o[10]=B,o[11]=0,o[12]=T,o[13]=O,o[14]=P,o[15]=1,!0)}function dy(e){switch(e){case"east":return 1;case"west":return-1;case"north":return 2;case"south":return-2;case"up":return 3;case"down":return-3;default:return 0}}function Rj(e,t,r,n,i,o,s){return!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)?!1:(e.eastX=t,e.eastY=r,e.northZ=n,e.upX=i,e.upY=o,e.upZ=s,!0)}var l4=p(()=>{});function vf(e,t,r=e){let n=e.x,i=e.y,o=e.z,{semiMajorAxis:s,semiMinorAxis:a,eccentricitySquared:c}=t,l=Math.sin(i),u=Math.abs(i)===Math.PI/2?0:Math.cos(i),h=a/s,d=c<.9?s/Math.sqrt(1-c*l*l):s/Math.hypot(u,h*l),m=(d+o)*u*Math.cos(n),g=(d+o)*u*Math.sin(n),y=(d*(c<.9?1-c:h*h)+o)*l;return kl(r,m,g,y)}function Ef(e,t,r=e){let n=e.x,i=e.y,o=e.z,{semiMajorAxis:s,semiMinorAxis:a,eccentricitySquared:c}=t,l=Math.atan2(i,n),u=Math.hypot(n,i),h=Math.hypot(n,i,o);if(!(h>0)||!Number.isFinite(h))return!1;if(c===0)return kl(r,u===0?0:l,Math.atan2(o,u),h-s);if(u===0)return kl(r,0,Math.sign(o)*Math.PI/2,Math.abs(o)-a);let d=u/s,m=o/a;if(d*d+m*m<1-16*gm||c>=.9)return yy(n,i,o,u,s,a,r);let g=o/h,y=u/h,b=1/Math.sqrt(1-c*(2-c)*y*y),w=y*(1-c)*b,S=g*b;for(let M=0;M<30;M++){let v=s/Math.sqrt(1-c*S*S),T=u*w+o*S-v*(1-c*S*S),O=c*v/(v+T);b=1/Math.sqrt(1-O*(2-O)*y*y);let P=y*(1-O)*b,_=g*b;if(Math.abs(_*w-P*S)<=1e-12){if(!Number.isFinite(T))break;return kl(r,l,Math.atan2(_,Math.abs(P)),T)}w=P,S=_}return yy(n,i,o,u,s,a,r)}function yy(e,t,r,n,i,o,s){let a=Math.atan2(t,e),c=o/i,l=c*c,u=n/i,h=r/i,d=1-l;if(!(l>0)||c>1)return!1;let m=i*i,g=o*o,y=Number.isFinite(m)&&m>0?(g-l*m+Is(o,o,g)-l*Is(i,i,m)-Is(l,m,l*m))/m:0,b=n*n,w=e*e,S=t*t,M=w+S,v=Number.isFinite(b)&&b>0?(M-b+pm(w,S,M)+Is(e,e,w)+Is(t,t,S)-Is(n,n,b))/(2*n):0,T=i*l,O=n-i,P=O+T,_=v+pm(n,-i,O)+pm(O,T,P)+Is(i,l,T)+i*y;if(r===0)return P+_<0?!1:kl(s,a,0,O);let U=Math.abs(h)*c,C=0,L=l+Math.hypot(u,h*c);if(!Number.isFinite(L))return!1;let A=Math.max(U,u-d);A>C&&A<L||(A=L/2);let W=-(P+_)/i,G=Math.sqrt(W*(u+d))/d,E=W>0&&Math.abs(r)/G/i*c<=gm*W?Math.atan2(Math.sign(r)*G/c,u/d):void 0;for(let B=0;B<1024&&E===void 0;B++){let N=d+A,D=u/N,R=r/A/i,I=R*c,j=i*A,we=P-j,ne=(we+(pm(P,-j,we)+_-Is(i,A,j)))/(i*N)*(D+1),Oe=ne+I*I;if(!Number.isFinite(Oe))return!1;Oe>0?C=A:L=A;let oe=-2*(D*D/N+I*I/A),Se=A-Oe/oe,Be=Se>C&&Se<L?Se:C+(L-C)/2;if(Math.abs(Oe)<=4*gm*(Math.abs(ne)+I*I)||L-C<=4*gm*A){E=Math.atan2(R,D);break}A=Be}return E!==void 0&&Lj(s,a,E,n,r,i,c)}function pm(e,t,r){let n=r-e;return e-(r-n)+(t-n)}function Is(e,t,r){let n=134217729*e,i=134217729*t;if(!Number.isFinite(n)||!Number.isFinite(i))return 0;let o=n-(n-e),s=i-(i-t),a=e-o,c=t-s;return o*s-r+o*c+a*s+a*c}function Lj(e,t,r,n,i,o,s){let a=Math.sin(r),c=Math.cos(r);return kl(e,t,r,n*c+i*a-o*Math.hypot(c,s*a))}function kl(e,t,r,n){return!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)?!1:(e.x=t,e.y=r,e.z=n,!0)}var gm,u4=p(()=>{gm=Number.EPSILON});function ym(){return Ul??Uint16Array}var Ul,f4=p(()=>{Ul=globalThis.Float16Array});var h4=p(()=>{f4()});var d4=p(()=>{h4()});var m4=p(()=>{ny()});var p4=p(()=>{sy()});var g4=p(()=>{hy()});var y4=p(()=>{im()});var b4=p(()=>{Gl()});var w4=p(()=>{hm()});var Dn=p(()=>{mE();_E();WE();c4();Xv();Zg();Cl();l4();u4();d4();m4();p4();g4();y4();b4();w4()});var ko,qee,x4=p(()=>{ko=6356752314245179e-9,qee={radii:[6378137,6378137,ko],radiiSquared:[6378137*6378137,6378137*6378137,ko*ko],oneOverRadii:[1/6378137,1/6378137,1/ko],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(ko*ko)],maximumRadius:Math.max(6378137,6378137,ko),centerToleranceSquared:.1}});function by(e){return e}function Uo(e,t=[],r=by){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function _4(e,t=[]){return Uo(e,t,wt._cartographicRadians?by:Kg)}function wy(e,t,r,n){let i=wt._cartographicRadians?by:Xg,o=i(e),s=i(t);return"longitude"in n?(n.longitude=o,n.latitude=s,n.height=r):"x"in n?(n.x=o,n.y=s,n.z=r):(n[0]=o,n[1]=s,n[2]=r),n}var Hee,S4=p(()=>{Dn();Hee=new J});function so(e,t,r,n,i,o,s){let c=[n,i,o,Math.abs(e),Math.abs(t),Math.abs(r)].map(P=>{let _=P.toString(2),U=_.indexOf(".");return{integer:BigInt("0b"+_.replace(".","")),exponent:U<0?0:U+1-_.length}}),l=Math.min(...c.filter(P=>P.integer!==0n).map(P=>P.exponent)),u=c.map(P=>P.integer<<BigInt(P.exponent-l)),h=u.slice(0,3).map(P=>P*P),d=h.reduce((P,_)=>P<_?P:_),m=h.map(P=>P-d),g=h.map((P,_)=>u[_]*u[_+3]),y=64;if(!g.some((P,_)=>m[_]===0n&&P!==0n)){let P=-1n,_=1n;for(let L=0;L<3;L++){if(m[L]===0n)continue;let A=m[L]*m[L];P=P*A+g[L]*g[L]*_,_*=A}if(P<0n)return!1;if(P===0n)return O(0n,1n);let C=m.filter(L=>L>0n).reduce((L,A)=>L<A?L:A);y=Math.max(64,(2n*(_+P)).toString(2).length-(P*C).toString(2).length+128)}let b=1n<<BigInt(y),w=m.map(P=>P*b),S=g.map(P=>P*b),M=S.map(P=>P*P),v=0n,T=S.reduce((P,_)=>P+_,0n);if(T===0n)return!1;for(let P=0;P<4096;P++){let _=v+T>>1n;if(_===v)return!1;let U=w[0]+_,C=w[1]+_,L=w[2]+_,A=U*U,W=C*C,G=L*L,E=M[0]*W*G+M[1]*A*G+M[2]*A*W-A*W*G;if(E===0n)return O(_,b);if(E>0n?v=_:T=_,v>0n&&T-v<=v>>60n)return O(v+T>>1n,b)}return!1;function O(P,_){let U=h.map((W,G)=>{let E=m[G]*_+P;return E===0n?0:Uj(W*u[G+3]*_,E,l)});if(!U.every(Number.isFinite))return!1;let C=Math.sign(e)*U[0],L=Math.sign(t)*U[1],A=Math.sign(r)*U[2];return s.x=C,s.y=L,s.z=A,!0}}function Uj(e,t,r){if(e===0n)return 0;let n=52-(e.toString(2).length-t.toString(2).length),i=n>=0?e<<BigInt(n):e,o=n>=0?t:t<<BigInt(-n),s=i/o,a=i%o;(2n*a>o||2n*a===o&&s&1n)&&s++;let c=r-n,l=Math.max(-1022,Math.min(1023,c));return Number(s)*2**l*2**(c-l)}var M4=p(()=>{});function v4(e,t,r,n,i,o,s){let a=Math.min(n,i,o),c=a*a,l=n*n,u=i*i,h=o*o;if(!(a>0)||!(c>0)||!Number.isFinite(Math.max(l,u,h)))return!1;let d=oc(a,a,c),m=l-c,g=u-c,y=h-c,b=jo(l,-c,m)+oc(n,n,l)-d,w=jo(u,-c,g)+oc(i,i,u)-d,S=jo(h,-c,y)+oc(o,o,h)-d,M=n*Math.abs(e),v=i*Math.abs(t),T=o*Math.abs(r);if(c<2**-1022||e!==0&&M<2**-1022||t!==0&&v<2**-1022||r!==0&&T<2**-1022)return so(e,t,r,n,i,o,s);let O=oc(n,Math.abs(e),M),P=oc(i,Math.abs(t),v),_=oc(o,Math.abs(r),T);if(Math.hypot(m===0?M===0?0:1/0:M/(m+b),g===0?v===0?0:1/0:v/(g+w),y===0?T===0?0:1/0:T/(y+S))<=1+64*Number.EPSILON)return so(e,t,r,n,i,o,s);if((e!==0?1:0)+(t!==0?1:0)+(r!==0?1:0)==1)return s.x=e===0?e:Math.sign(e)*n,s.y=t===0?t:Math.sign(t)*i,s.z=r===0?r:Math.sign(r)*o,!0;let C=Math.hypot(m===0?M:0,g===0?v:0,y===0?T:0),L=Math.hypot(M,v,T);if(!(L>0)||!Number.isFinite(L))return so(e,t,r,n,i,o,s);let A=C>0?C:L;for(let W=0;W<512;W++){let G=m+A,E=g+A,B=y+A,N=jo(m,A,G)+b,D=jo(g,A,E)+w,R=jo(y,A,B)+S,I=M/G,j=v/E,we=T/B,_e,ne;I>=j&&I>=we?(_e=xy(M,O,m,b,A,G)*(I+1),ne=(j*(1-D/E))**2+(we*(1-R/B))**2):j>=we?(_e=xy(v,P,g,w,A,E)*(j+1),ne=(I*(1-N/G))**2+(we*(1-R/B))**2):(_e=xy(T,_,y,S,A,B)*(we+1),ne=(I*(1-N/G))**2+(j*(1-D/E))**2);let Oe=-2*(I*I/G+j*j/E+we*we/B),oe=4*Number.EPSILON*(Math.abs(_e)+ne),Se=_e+ne;if(!Number.isFinite(Se))return so(e,t,r,n,i,o,s);if(Math.abs(Se)<=4*Number.EPSILON*(Math.abs(_e)+ne)||L-C<=4*Number.EPSILON*A){let je=oe/Math.abs(Oe);if(!Number.isFinite(Oe)||!(Math.abs(Oe)>0)||je>2e-13*A)return so(e,t,r,n,i,o,s);let Ke=Math.sign(e)*n*(I*(1-N/G)),ut=Math.sign(t)*i*(j*(1-D/E)),ft=Math.sign(r)*o*(we*(1-R/B)),mt=2*je*Math.max(Math.abs(Ke/G),Math.abs(ut/E),Math.abs(ft/B));return!Number.isFinite(mt)||mt>2e-13*Math.max(n,i,o)?so(e,t,r,n,i,o,s):!Number.isFinite(Ke)||!Number.isFinite(ut)||!Number.isFinite(ft)?so(e,t,r,n,i,o,s):(s.x=Ke,s.y=ut,s.z=ft,!0)}Se>0?C=A:L=A;let Be=A-Se/Oe,V=Be>C&&Be<L?Be:C+(L-C)/2;if(V===A)return so(e,t,r,n,i,o,s);A=V}return so(e,t,r,n,i,o,s)}function xy(e,t,r,n,i,o){let s=e-r,a=jo(e,-r,s)+t-n,c=s+a,l=jo(s,a,c),u=c-i;return(u+(jo(c,-i,u)+l))/o}function jo(e,t,r){let n=r-e;return e-(r-n)+(t-n)}function oc(e,t,r){let n=134217729*e,i=134217729*t;if(!Number.isFinite(n)||!Number.isFinite(i))return 0;let o=n-(n-e),s=i-(i-t),a=e-o,c=t-s;return o*s-r+o*c+a*s+a*c}var E4=p(()=>{M4()});function A4(e,t,r=[]){let n=e,i="x"in e?n.x:e[0],o="x"in e?n.y:e[1],s="x"in e?n.z:e[2];if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(i*i+o*o+s*s))return;let{radii:a}=t;if(v4(i,o,s,a.x,a.y,a.z,bm))return ao(r,bm.x,bm.y,bm.z)}function ao(e,t,r,n){if(oo(e))e[0]=t,e[1]=r,e[2]=n;else{let i=e;i.x=t,i.y=r,i.z=n}return e}var bm,T4=p(()=>{Dn();E4();bm={x:0,y:0,z:0}});function I4(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0||t>e)throw new Error("Spheroid requires finite positive axes with semiMinorAxis <= semiMajorAxis")}function _m(e,t,r,n){let i=Math.max(Math.abs(e),Math.abs(t),Math.abs(r));if(!(i>0)||!Number.isFinite(i))return;let o=e/i,s=t/i,a=r/i,c=Math.hypot(o,s,a);return ao(n,o/c,s/c,a/c)}var yn,wm,qj,fi,xm,Et,P4=p(()=>{Dn();Dn();x4();S4();T4();yn={x:0,y:0,z:0},wm=new J,qj=new J,fi=new J,xm=new J,Et=class e{static fromSpheroid(t){let{semiMajorAxis:r,semiMinorAxis:n}=t;return I4(r,n),new e(r,r,n)}constructor(t=0,r=0,n=0){this.centerToleranceSquared=Qd.EPSILON1,Ii(Number.isFinite(t)&&t>=0),Ii(Number.isFinite(r)&&r>=0),Ii(Number.isFinite(n)&&n>=0),this.radii=new J(t,r,n),this.radiiSquared=new J(t*t,r*r,n*n),this.radiiToTheFourth=new J(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new J(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new J(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),n!==0&&(this.squaredXOverSquaredZ=(t/n)**2),t===r&&n>0&&n<=t&&Number.isFinite(this.radiiSquared.x)&&this.radiiSquared.z>0&&(this.spheroidGeometry=Object.freeze({semiMajorAxis:t,semiMinorAxis:n,eccentricitySquared:1-(n/t)**2})),Object.freeze(this.radii),Object.freeze(this.radiiSquared),Object.freeze(this.radiiToTheFourth),Object.freeze(this.oneOverRadii),Object.freeze(this.oneOverRadiiSquared),Object.freeze(this)}toSpheroid(){let{x:t,y:r,z:n}=this.radii;if(t!==r)throw new Error("Spheroid requires equal X/Y radii");return I4(t,n),Object.freeze({semiMajorAxis:t,semiMinorAxis:n})}equals(t){return this===t||!!(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=_4(t,xm),i=n[0],o=n[1],s=n[2];if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)||!(this.minimumRadius>0)||!Number.isFinite(this.maximumRadius*this.maximumRadius))return;if(this.spheroidGeometry&&(wt._cartographicRadians||Math.abs(o)<=Math.PI/4))return yn.x=i,yn.y=o,yn.z=s,vf(yn,this.spheroidGeometry)?ao(r,yn.x,yn.y,yn.z):void 0;let a=qj;this.geodeticSurfaceNormalCartographic(t,a);let c=a.x,l=a.y,u=a.z,h=this.radii.x,d=this.radii.y,m=this.radii.z,g=Math.hypot(h*c,d*l,m*u),y=h*(h*c/g)+s*c,b=d*(d*l/g)+s*l,w=m*(m*u/g)+s*u;if(!(!Number.isFinite(y)||!Number.isFinite(b)||!Number.isFinite(w)))return ao(r,y,b,w)}cartesianToCartographic(t,r=[0,0,0]){let n=t,i="x"in t?n.x:t[0],o="x"in t?n.y:t[1],s="x"in t?n.z:t[2];if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s))return;if(this.spheroidGeometry&&Number.isFinite(i*i+o*o+s*s)&&Number.isFinite(this.oneOverRadiiSquared.x)&&Number.isFinite(this.oneOverRadiiSquared.z)){yn.x=i,yn.y=o,yn.z=s;let S=this.spheroidGeometry;if(!(s===0&&S.semiMinorAxis<S.semiMajorAxis&&Math.abs(Math.hypot(i,o)-S.semiMajorAxis*S.eccentricitySquared)<=64*Number.EPSILON*S.semiMajorAxis)&&Ef(yn,S)){let v=i===0&&o===0?Math.atan2(o,i):yn.x;return wy(v,yn.y,yn.z,r)}}if(!(this.minimumRadius>0)||!Number.isFinite(this.maximumRadius*this.maximumRadius)||!Number.isFinite(1/(this.minimumRadius*this.minimumRadius)))return;xm.set(i,o,s);let a=this.scaleToGeodeticSurface(xm,fi);if(!a)return;let c=a[0]*this.oneOverRadiiSquared.x,l=a[1]*this.oneOverRadiiSquared.y,u=a[2]*this.oneOverRadiiSquared.z,h=Math.hypot(c,l,u);if(!(h>0)||!Number.isFinite(h))return;let d=c/h,m=l/h,g=u/h,y=Math.atan2(m,d),b=Math.atan2(g,Math.hypot(d,m)),w=(i-a[0])*d+(o-a[1])*m+(s-a[2])*g;return wy(y,b,w,r)}geocentricSurfaceNormal(t,r=[0,0,0]){Uo(t,wm);let n=wm;return _m(n.x,n.y,n.z,r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=Uo(t,xm),i=wt._cartographicRadians?n[0]:n[0]*Math.PI/180,o=wt._cartographicRadians?n[1]:n[1]*Math.PI/180,s=!wt._cartographicRadians&&Math.abs(n[1])>45,a=(90-Math.abs(n[1]))*Math.PI/180,c=s?Math.sin(a):Math.abs(o)===Math.PI/2?0:Math.cos(o),l=s?Math.sign(n[1])*Math.cos(a):Math.sin(o);return _m(c*Math.cos(i),c*Math.sin(i),l,r)}geodeticSurfaceNormal(t,r=[0,0,0]){if(!(this.minimumRadius>0))return;Uo(t,wm);let n=wm,i=Math.max(Math.abs(n.x),Math.abs(n.y),Math.abs(n.z));if(!(i>0)||!Number.isFinite(i))return;let o=n.x/i*(this.minimumRadius/this.radii.x)**2,s=n.y/i*(this.minimumRadius/this.radii.y)**2,a=n.z/i*(this.minimumRadius/this.radii.z)**2;if((n.x===0||Math.abs(o)>=2**-1022)&&(n.y===0||Math.abs(s)>=2**-1022)&&(n.z===0||Math.abs(a)>=2**-1022))return _m(o,s,a,r);let c=n.x===0?0:Math.min(1023,Math.floor(Math.log2(Math.abs(n.x)))),l=n.y===0?0:Math.min(1023,Math.floor(Math.log2(Math.abs(n.y)))),u=n.z===0?0:Math.min(1023,Math.floor(Math.log2(Math.abs(n.z)))),h=Math.min(1023,Math.floor(Math.log2(this.radii.x))),d=Math.min(1023,Math.floor(Math.log2(this.radii.y))),m=Math.min(1023,Math.floor(Math.log2(this.radii.z))),g=Math.max(n.x===0?-1/0:c-2*h,n.y===0?-1/0:l-2*d,n.z===0?-1/0:u-2*m);return _m(n.x===0?n.x:n.x/2**c/(this.radii.x/2**h)**2*2**(c-2*h-g),n.y===0?n.y:n.y/2**l/(this.radii.y/2**d)**2*2**(l-2*d-g),n.z===0?n.z:n.z/2**u/(this.radii.z/2**m)**2*2**(u-2*m-g),r)}scaleToGeodeticSurface(t,r){return A4(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){Uo(t,fi);let n=fi,i=Math.max(Math.abs(n.x),Math.abs(n.y),Math.abs(n.z));if(!(this.minimumRadius>0)||!(i>0)||!Number.isFinite(i))return;let o=n.x*n.x*this.oneOverRadiiSquared.x+n.y*n.y*this.oneOverRadiiSquared.y+n.z*n.z*this.oneOverRadiiSquared.z;if(o>=2**-1022&&Number.isFinite(o)&&i*i>=2**-1022&&Number.isFinite(i*i)){let u=1/Math.sqrt(o);return ao(r,n.x*u,n.y*u,n.z*u)}let s=n.x/i,a=n.y/i,c=n.z/i,l=Math.hypot(s/this.radii.x,a/this.radii.y,c/this.radii.z);if(!(!(l>0)||!Number.isFinite(l)))return ao(r,s/l,a/l,c/l)}transformPositionToScaledSpace(t,r=[0,0,0]){Uo(t,fi);let n=fi.scale(this.oneOverRadii);return ao(r,n.x,n.y,n.z)}transformPositionFromScaledSpace(t,r=[0,0,0]){Uo(t,fi);let n=fi.scale(this.radii);return ao(r,n.x,n.y,n.z)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){if(Ii(this.radii.x===this.radii.y&&this.minimumRadius>0),Uo(t,fi),!Number.isFinite(fi.x)||!Number.isFinite(fi.y)||!Number.isFinite(fi.z)||!Number.isFinite(r))return;let i=fi.z*(1-this.squaredXOverSquaredZ);if(Number.isFinite(i)&&!(Math.abs(i)>=this.radii.z-r))return ao(n,0,0,i)}};Et.WGS84=new Et(6378137,6378137,ko)});var Zt,R4=p(()=>{Zt={};Zt.Constants={};Zt.Math={};Zt.Accumulator={};(function(e){"use strict";e.WGS84={a:6378137,f:1/298.257223563},e.version={major:2,minor:2,patch:0},e.version_string="2.2.0"})(Zt.Constants);(function(e){"use strict";e.digits=53,e.epsilon=Math.pow(.5,e.digits-1),e.degree=Math.PI/180,e.sq=function(t){return t*t},e.hypot=function(t,r){return Math.sqrt(t*t+r*r)},e.cbrt=Math.cbrt||function(t){var r=Math.pow(Math.abs(t),.3333333333333333);return t>0?r:t<0?-r:t},e.log1p=Math.log1p||function(t){var r=1+t,n=r-1;return n===0?t:t*Math.log(r)/n},e.atanh=Math.atanh||function(t){var r=Math.abs(t);return r=e.log1p(2*r/(1-r))/2,t>0?r:t<0?-r:t},e.copysign=function(t,r){return Math.abs(t)*(r<0||r===0&&1/r<0?-1:1)},e.sum=function(t,r){var n=t+r,i=n-r,o=n-i,s;return i-=t,o-=r,s=n&&0-(i+o),{s:n,t:s}},e.polyval=function(t,r,n,i){for(var o=t<0?0:r[n++];--t>=0;)o=o*i+r[n++];return o},e.AngRound=function(t){var r=.0625,n=Math.abs(t);return n=n<r?r-(r-n):n,e.copysign(n,t)},e.remainder=function(t,r){return t%=r,t<-r/2?t+r:t<r/2?t:t-r},e.AngNormalize=function(t){var r=e.remainder(t,360);return Math.abs(r)===180?e.copysign(180,t):r},e.LatFix=function(t){return Math.abs(t)>90?NaN:t},e.AngDiff=function(t,r){var n=e.sum(e.remainder(-t,360),e.remainder(r,360)),i,o;return n=e.sum(e.remainder(n.s,360),n.t),i=n.s,o=n.t,(i===0||Math.abs(i)===180)&&(i=e.copysign(i,o===0?r-t:-o)),{d:i,e:o}},e.sincosd=function(t){var r,n,i,o,s,a,c;switch(r=t%360,i=Math.round(r/90),r-=90*i,n=r*this.degree,o=Math.sin(n),s=Math.cos(n),Math.abs(r)===45?(s=Math.sqrt(.5),o=e.copysign(s,n)):Math.abs(r)===30&&(s=Math.sqrt(.75),o=e.copysign(.5,n)),i&3){case 0:a=o,c=s;break;case 1:a=s,c=-o;break;case 2:a=-o,c=-s;break;default:a=-s,c=o;break}return c+=0,a===0&&(a=e.copysign(a,t)),{s:a,c}},e.sincosde=function(t,r){var n,i,o,s,a,c,l;switch(n=t%360,o=Math.round(n/90),n=e.AngRound(n-90*o+r),i=n*this.degree,s=Math.sin(i),a=Math.cos(i),Math.abs(n)===45?(a=Math.sqrt(.5),s=e.copysign(a,i)):Math.abs(n)===30&&(a=Math.sqrt(.75),s=e.copysign(.5,i)),o&3){case 0:c=s,l=a;break;case 1:c=a,l=-s;break;case 2:c=-s,l=-a;break;default:c=-a,l=s;break}return l+=0,c===0&&(c=e.copysign(c,t+r)),{s:c,c:l}},e.atan2d=function(t,r){var n=0,i;switch(Math.abs(t)>Math.abs(r)&&([t,r]=[r,t],n=2),e.copysign(1,r)<0&&(r=-r,++n),i=Math.atan2(t,r)/this.degree,n){case 1:i=e.copysign(180,t)-i;break;case 2:i=90-i;break;case 3:i=-90+i;break;default:break}return i}})(Zt.Math);(function(e,t){"use strict";e.Accumulator=function(r){this.Set(r)},e.Accumulator.prototype.Set=function(r){r||(r=0),r.constructor===e.Accumulator?(this._s=r._s,this._t=r._t):(this._s=r,this._t=0)},e.Accumulator.prototype.Add=function(r){var n=t.sum(r,this._t),i=t.sum(n.s,this._s);n=n.t,this._s=i.s,this._t=i.t,this._s===0?this._s=n:this._t+=n},e.Accumulator.prototype.Sum=function(r){var n;return r?(n=new e.Accumulator(this),n.Add(r),n._s):this._s},e.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1},e.Accumulator.prototype.Remainder=function(r){this._s=t.remainder(this._s,r),this.Add(0)}})(Zt.Accumulator,Zt.Math);Zt.Geodesic={};Zt.GeodesicLine={};Zt.PolygonArea={};(function(e,t,r,n,i){"use strict";var o=6,s=o,a=o,c=o,l=c,u,h,d=20,m=d+n.digits+10,g=n.epsilon,y=200*g,b=Math.sqrt(g),w=g,S=1e3*b,M=0,v=31,T=32640,O,P,_,U,C,L,A,W,G;e.tiny_=Math.sqrt(Number.MIN_VALUE/Number.EPSILON),e.nC1_=o,e.nC1p_=o,e.nC2_=o,e.nC3_=o,e.nC4_=o,u=e.nC3_*(e.nC3_-1)/2,h=e.nC4_*(e.nC4_+1)/2,e.CAP_C1=1,e.CAP_C1p=2,e.CAP_C2=4,e.CAP_C3=8,e.CAP_C4=16,e.NONE=0,e.ARC=64,e.LATITUDE=128|M,e.LONGITUDE=256|e.CAP_C3,e.AZIMUTH=512|M,e.DISTANCE=1024|e.CAP_C1,e.STANDARD=e.LATITUDE|e.LONGITUDE|e.AZIMUTH|e.DISTANCE,e.DISTANCE_IN=2048|e.CAP_C1|e.CAP_C1p,e.REDUCEDLENGTH=4096|e.CAP_C1|e.CAP_C2,e.GEODESICSCALE=8192|e.CAP_C1|e.CAP_C2,e.AREA=16384|e.CAP_C4,e.ALL=T|v,e.LONG_UNROLL=32768,e.OUT_MASK=T|e.LONG_UNROLL,e.SinCosSeries=function(E,B,N,D,R){if(R!==void 0){var I=R/2,j=Math.sin(I),we=Math.cos(I);return-2*e.SinCosSeries(!1,N*we-B*j,B*we+N*j,D.map(function(Be,V){return(V%2?-Be:Be)*Math.sin((2*V+1)*I)}))}var _e=D.length,ne=_e-(E?1:0),Oe=2*(N-B)*(N+B),oe=ne&1?D[--_e]:0,Se=0;for(ne=Math.floor(ne/2);ne--;)Se=Oe*oe-Se+D[--_e],oe=Oe*Se-oe+D[--_e];return E?2*B*N*oe:N*(oe-Se)},O=function(E,B){var N,D=n.sq(E),R=n.sq(B),I=(D+R-1)/6,j,we,_e,ne,Oe,oe,Se,Be,V,je,Ke;return R===0&&I<=0?N=0:(j=D*R/4,we=n.sq(I),_e=I*we,ne=j*(j+2*_e),Oe=I,ne>=0?(oe=j+_e,oe+=oe<0?-Math.sqrt(ne):Math.sqrt(ne),Se=n.cbrt(oe),Oe+=Se+(Se!==0?we/Se:0)):(Be=Math.atan2(Math.sqrt(-ne),-(j+_e)),Oe+=2*I*Math.cos(Be/3)),V=Math.sqrt(n.sq(Oe)+R),je=Oe<0?R/(V-Oe):Oe+V,Ke=(je-R)/(2*V),N=je/(Math.sqrt(je+n.sq(Ke))+Ke)),N},P=[1,4,64,0,256],e.A1m1f=function(E){var B=Math.floor(s/2),N=n.polyval(B,P,0,n.sq(E))/P[B+1];return(N+E)/(1-E)},_=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],e.C1f=function(E,B){var N=n.sq(E),D=E,R=0,I,j;for(I=1;I<=e.nC1_;++I)j=Math.floor((e.nC1_-I)/2),B[I]=D*n.polyval(j,_,R,N)/_[R+j+1],R+=j+2,D*=E},U=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],e.C1pf=function(E,B){var N=n.sq(E),D=E,R=0,I,j;for(I=1;I<=e.nC1p_;++I)j=Math.floor((e.nC1p_-I)/2),B[I]=D*n.polyval(j,U,R,N)/U[R+j+1],R+=j+2,D*=E},C=[-11,-28,-192,0,256],e.A2m1f=function(E){var B=Math.floor(a/2),N=n.polyval(B,C,0,n.sq(E))/C[B+1];return(N-E)/(1+E)},L=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],e.C2f=function(E,B){var N=n.sq(E),D=E,R=0,I,j;for(I=1;I<=e.nC2_;++I)j=Math.floor((e.nC2_-I)/2),B[I]=D*n.polyval(j,L,R,N)/L[R+j+1],R+=j+2,D*=E},e.Geodesic=function(E,B){if(this.a=E,this.f=B,this._f1=1-this.f,this._e2=this.f*(2-this.f),this._ep2=this._e2/n.sq(this._f1),this._n=this.f/(2-this.f),this._b=this.a*this._f1,this._c2=(n.sq(this.a)+n.sq(this._b)*(this._e2===0?1:(this._e2>0?n.atanh(Math.sqrt(this._e2)):Math.atan(Math.sqrt(-this._e2)))/Math.sqrt(Math.abs(this._e2))))/2,this._etol2=.1*b/Math.sqrt(Math.max(.001,Math.abs(this.f))*Math.min(1,1-this.f/2)/2),!(isFinite(this.a)&&this.a>0))throw new Error("Equatorial radius is not positive");if(!(isFinite(this._b)&&this._b>0))throw new Error("Polar semi-axis is not positive");this._A3x=new Array(l),this._C3x=new Array(u),this._C4x=new Array(h),this.A3coeff(),this.C3coeff(),this.C4coeff()},A=[-3,128,-2,-3,64,-1,-3,-1,16,3,-1,-2,8,1,-1,2,1,1],e.Geodesic.prototype.A3coeff=function(){var E=0,B=0,N,D;for(N=c-1;N>=0;--N)D=Math.min(c-N-1,N),this._A3x[B++]=n.polyval(D,A,E,this._n)/A[E+D+1],E+=D+2},W=[3,128,2,5,128,-1,3,3,64,-1,0,1,8,-1,1,4,5,256,1,3,128,-3,-2,3,64,1,-3,2,32,7,512,-10,9,384,5,-9,5,192,7,512,-14,7,512,21,2560],e.Geodesic.prototype.C3coeff=function(){var E=0,B=0,N,D,R;for(N=1;N<e.nC3_;++N)for(D=e.nC3_-1;D>=N;--D)R=Math.min(e.nC3_-D-1,D),this._C3x[B++]=n.polyval(R,W,E,this._n)/W[E+R+1],E+=R+2},G=[97,15015,1088,156,45045,-224,-4784,1573,45045,-10656,14144,-4576,-858,45045,64,624,-4576,6864,-3003,15015,100,208,572,3432,-12012,30030,45045,1,9009,-2944,468,135135,5792,1040,-1287,135135,5952,-11648,9152,-2574,135135,-64,-624,4576,-6864,3003,135135,8,10725,1856,-936,225225,-8448,4992,-1144,225225,-1440,4160,-4576,1716,225225,-136,63063,1024,-208,105105,3584,-3328,1144,315315,-128,135135,-2560,832,405405,128,99099],e.Geodesic.prototype.C4coeff=function(){var E=0,B=0,N,D,R;for(N=0;N<e.nC4_;++N)for(D=e.nC4_-1;D>=N;--D)R=e.nC4_-D-1,this._C4x[B++]=n.polyval(R,G,E,this._n)/G[E+R+1],E+=R+2},e.Geodesic.prototype.A3f=function(E){return n.polyval(l-1,this._A3x,0,E)},e.Geodesic.prototype.C3f=function(E,B){var N=1,D=0,R,I;for(R=1;R<e.nC3_;++R)I=e.nC3_-R-1,N*=E,B[R]=N*n.polyval(I,this._C3x,D,E),D+=I+1},e.Geodesic.prototype.C4f=function(E,B){var N=1,D=0,R,I;for(R=0;R<e.nC4_;++R)I=e.nC4_-R-1,B[R]=N*n.polyval(I,this._C4x,D,E),D+=I+1,N*=E},e.Geodesic.prototype.Lengths=function(E,B,N,D,R,I,j,we,_e,ne,Oe,oe,Se){Oe&=e.OUT_MASK;var Be={},V=0,je=0,Ke=0,ut=0,ft,mt,Rt,Yt,mr;if(Oe&(e.DISTANCE|e.REDUCEDLENGTH|e.GEODESICSCALE)&&(Ke=e.A1m1f(E),e.C1f(E,oe),Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(ut=e.A2m1f(E),e.C2f(E,Se),V=Ke-ut,ut=1+ut),Ke=1+Ke),Oe&e.DISTANCE)ft=e.SinCosSeries(!0,I,j,oe)-e.SinCosSeries(!0,N,D,oe),Be.s12b=Ke*(B+ft),Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(mt=e.SinCosSeries(!0,I,j,Se)-e.SinCosSeries(!0,N,D,Se),je=V*B+(Ke*ft-ut*mt));else if(Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)){for(Rt=1;Rt<=e.nC2_;++Rt)Se[Rt]=Ke*oe[Rt]-ut*Se[Rt];je=V*B+(e.SinCosSeries(!0,I,j,Se)-e.SinCosSeries(!0,N,D,Se))}return Oe&e.REDUCEDLENGTH?(Be.m0=V,Be.m12b=we*(D*I)-R*(N*j)-D*j*je):Be.m12b=NaN,Oe&e.GEODESICSCALE&&(Yt=D*j+N*I,mr=this._ep2*(_e-ne)*(_e+ne)/(R+we),Be.M12=Yt+(mr*I-j*je)*N/R,Be.M21=Yt-(mr*N-D*je)*I/we),Be},e.Geodesic.prototype.InverseStart=function(E,B,N,D,R,I,j,we,_e,ne,Oe){var oe={},Se=D*B-R*E,Be=R*B+D*E,V,je,Ke,ut,ft,mt,Rt,Yt,mr,Ve,qe,We,jt,pr,xs,_s,Zu,Xi,tt,Xr,xr,hn,Bn;return oe.sig12=-1,V=D*B,V+=R*E,je=Be>=0&&Se<.5&&R*j<.5,je?(ut=n.sq(E+D),ut/=ut+n.sq(B+R),oe.dnm=Math.sqrt(1+this._ep2*ut),Ke=j/(this._f1*oe.dnm),ft=Math.sin(Ke),mt=Math.cos(Ke)):(ft=we,mt=_e),oe.salp1=R*ft,oe.calp1=mt>=0?Se+R*E*n.sq(ft)/(1+mt):V-R*E*n.sq(ft)/(1-mt),Yt=n.hypot(oe.salp1,oe.calp1),mr=E*D+B*R*mt,je&&Yt<this._etol2?(oe.salp2=B*ft,oe.calp2=Se-B*D*(mt>=0?n.sq(ft)/(1+mt):1-mt),Rt=n.hypot(oe.salp2,oe.calp2),oe.salp2/=Rt,oe.calp2/=Rt,oe.sig12=Math.atan2(Yt,mr)):Math.abs(this._n)>.1||mr>=0||Yt>=6*Math.abs(this._n)*Math.PI*n.sq(B)||(Bn=Math.atan2(-we,-_e),this.f>=0?(pr=n.sq(E)*this._ep2,xs=pr/(2*(1+Math.sqrt(1+pr))+pr),We=this.f*B*this.A3f(xs)*Math.PI,jt=We*B,Ve=Bn/We,qe=V/jt):(_s=R*B-D*E,Zu=Math.atan2(V,_s),Xr=this.Lengths(this._n,Math.PI+Zu,E,-B,N,D,R,I,B,R,e.REDUCEDLENGTH,ne,Oe),Xi=Xr.m12b,tt=Xr.m0,Ve=-1+Xi/(B*R*tt*Math.PI),jt=Ve<-.01?V/Ve:-this.f*n.sq(B)*Math.PI,We=jt/B,qe=j/We),qe>-y&&Ve>-1-S?this.f>=0?(oe.salp1=Math.min(1,-Ve),oe.calp1=-Math.sqrt(1-n.sq(oe.salp1))):(oe.calp1=Math.max(Ve>-y?0:-1,Ve),oe.salp1=Math.sqrt(1-n.sq(oe.calp1))):(xr=O(Ve,qe),hn=We*(this.f>=0?-Ve*xr/(1+xr):-qe*(1+xr)/xr),ft=Math.sin(hn),mt=-Math.cos(hn),oe.salp1=R*ft,oe.calp1=V-R*E*n.sq(ft)/(1-mt))),oe.salp1<=0?(oe.salp1=1,oe.calp1=0):(Rt=n.hypot(oe.salp1,oe.calp1),oe.salp1/=Rt,oe.calp1/=Rt),oe},e.Geodesic.prototype.Lambda12=function(E,B,N,D,R,I,j,we,_e,ne,Oe,oe,Se,Be){var V={},je,Ke,ut,ft,mt,Rt,Yt,mr,Ve,qe,We,jt,pr;return E===0&&we===0&&(we=-e.tiny_),Ke=j*B,ut=n.hypot(we,j*E),V.ssig1=E,ft=Ke*E,V.csig1=mt=we*B,je=n.hypot(V.ssig1,V.csig1),V.ssig1/=je,V.csig1/=je,V.salp2=R!==B?Ke/R:j,V.calp2=R!==B||Math.abs(D)!==-E?Math.sqrt(n.sq(we*B)+(B<-E?(R-B)*(B+R):(E-D)*(E+D)))/R:Math.abs(we),V.ssig2=D,Rt=Ke*D,V.csig2=Yt=V.calp2*R,je=n.hypot(V.ssig2,V.csig2),V.ssig2/=je,V.csig2/=je,V.sig12=Math.atan2(Math.max(0,V.csig1*V.ssig2-V.ssig1*V.csig2),V.csig1*V.csig2+V.ssig1*V.ssig2),mr=Math.max(0,mt*Rt-ft*Yt),Ve=mt*Yt+ft*Rt,We=Math.atan2(mr*ne-Ve*_e,Ve*ne+mr*_e),jt=n.sq(ut)*this._ep2,V.eps=jt/(2*(1+Math.sqrt(1+jt))+jt),this.C3f(V.eps,Be),qe=e.SinCosSeries(!0,V.ssig2,V.csig2,Be)-e.SinCosSeries(!0,V.ssig1,V.csig1,Be),V.domg12=-this.f*this.A3f(V.eps)*Ke*(V.sig12+qe),V.lam12=We+V.domg12,Oe&&(V.calp2===0?V.dlam12=-2*this._f1*N/E:(pr=this.Lengths(V.eps,V.sig12,V.ssig1,V.csig1,N,V.ssig2,V.csig2,I,B,R,e.REDUCEDLENGTH,oe,Se),V.dlam12=pr.m12b,V.dlam12*=this._f1/(V.calp2*R))),V},e.Geodesic.prototype.Inverse=function(E,B,N,D,R){var I,j;return R||(R=e.STANDARD),R===e.LONG_UNROLL&&(R|=e.STANDARD),R&=e.OUT_MASK,I=this.InverseInt(E,B,N,D,R),j=I.vals,R&e.AZIMUTH&&(j.azi1=n.atan2d(I.salp1,I.calp1),j.azi2=n.atan2d(I.salp2,I.calp2)),j},e.Geodesic.prototype.InverseInt=function(E,B,N,D,R){var I={},j,we,_e,ne,Oe,oe,Se,Be,V,je,Ke,ut,ft,mt,Rt,Yt,mr,Ve,qe,We,jt,pr,xs,_s,Zu,Xi,tt,Xr,xr,hn,Bn,Qh,ed,fl,$a,Ju,Qu,ef,tf,td,x1,hl,_1,rd,S1,M1,v1,M_,E1,nd,A1,id,v_,rf,E_,A_,nf,od,of,T1,I1,sd,ad,P1,R1;if(I.lat1=E=n.LatFix(E),I.lat2=N=n.LatFix(N),E=n.AngRound(E),N=n.AngRound(N),j=n.AngDiff(B,D),we=j.e,j=j.d,R&e.LONG_UNROLL?(I.lon1=B,I.lon2=B+j+we):(I.lon1=n.AngNormalize(B),I.lon2=n.AngNormalize(D)),_e=n.copysign(1,j),j*=_e,we*=_e,Rt=j*n.degree,ne=n.sincosde(j,we),Yt=ne.s,mr=ne.c,we=180-j-we,Oe=Math.abs(E)<Math.abs(N)||isNaN(N)?-1:1,Oe<0&&(_e*=-1,[N,E]=[E,N]),oe=n.copysign(1,-E),E*=oe,N*=oe,ne=n.sincosd(E),Se=this._f1*ne.s,Be=ne.c,ne=n.hypot(Se,Be),Se/=ne,Be/=ne,Be=Math.max(e.tiny_,Be),ne=n.sincosd(N),V=this._f1*ne.s,je=ne.c,ne=n.hypot(V,je),V/=ne,je/=ne,je=Math.max(e.tiny_,je),Be<-Se?je===Be&&(V=n.copysign(Se,V)):Math.abs(V)===-Se&&(je=Be),ft=Math.sqrt(1+this._ep2*n.sq(Se)),mt=Math.sqrt(1+this._ep2*n.sq(V)),xs=new Array(e.nC1_+1),_s=new Array(e.nC2_+1),Zu=new Array(e.nC3_),Xi=E===-90||Yt===0,Xi&&(qe=mr,We=Yt,jt=1,pr=0,Xr=Se,xr=qe*Be,hn=V,Bn=jt*je,Ve=Math.atan2(Math.max(0,xr*hn-Xr*Bn),xr*Bn+Xr*hn),tt=this.Lengths(this._n,Ve,Xr,xr,ft,hn,Bn,mt,Be,je,R|e.DISTANCE|e.REDUCEDLENGTH,xs,_s),Ke=tt.s12b,ut=tt.m12b,R&e.GEODESICSCALE&&(I.M12=tt.M12,I.M21=tt.M21),Ve<b||ut>=0?((Ve<3*e.tiny_||Ve<g&&(Ke<0||ut<0))&&(Ve=ut=Ke=0),ut*=this._b,Ke*=this._b,I.a12=Ve/n.degree):Xi=!1),nf=2,!Xi&&Se===0&&(this.f<=0||we>=this.f*180))qe=jt=0,We=pr=1,Ke=this.a*Rt,Ve=ed=Rt/this._f1,ut=this._b*Math.sin(Ve),R&e.GEODESICSCALE&&(I.M12=I.M21=Math.cos(Ve)),I.a12=j/this._f1;else if(!Xi)if(tt=this.InverseStart(Se,Be,ft,V,je,mt,Rt,Yt,mr,xs,_s),Ve=tt.sig12,We=tt.salp1,qe=tt.calp1,Ve>=0)pr=tt.salp2,jt=tt.calp2,fl=tt.dnm,Ke=Ve*this._b*fl,ut=n.sq(fl)*this._b*Math.sin(Ve/fl),R&e.GEODESICSCALE&&(I.M12=I.M21=Math.cos(Ve/fl)),I.a12=Ve/n.degree,ed=Rt/(this._f1*fl);else{for($a=0,Ju=e.tiny_,Qu=1,ef=e.tiny_,tf=-1,td=!1,x1=!1;tt=this.Lambda12(Se,Be,ft,V,je,mt,We,qe,Yt,mr,$a<d,xs,_s,Zu),hl=tt.lam12,pr=tt.salp2,jt=tt.calp2,Ve=tt.sig12,Xr=tt.ssig1,xr=tt.csig1,hn=tt.ssig2,Bn=tt.csig2,Qh=tt.eps,of=tt.domg12,_1=tt.dlam12,!(x1||!(Math.abs(hl)>=(td?8:1)*g)||$a==m);++$a){if(hl>0&&($a<d||qe/We>tf/ef)?(ef=We,tf=qe):hl<0&&($a<d||qe/We<Qu/Ju)&&(Ju=We,Qu=qe),$a<d&&_1>0&&(rd=-hl/_1,Math.abs(rd)<Math.PI&&(S1=Math.sin(rd),M1=Math.cos(rd),v1=We*M1+qe*S1,v1>0))){qe=qe*M1-We*S1,We=v1,ne=n.hypot(We,qe),We/=ne,qe/=ne,td=Math.abs(hl)<=16*g;continue}We=(Ju+ef)/2,qe=(Qu+tf)/2,ne=n.hypot(We,qe),We/=ne,qe/=ne,td=!1,x1=Math.abs(Ju-We)+(Qu-qe)<w||Math.abs(We-ef)+(qe-tf)<w}M_=R|(R&(e.REDUCEDLENGTH|e.GEODESICSCALE)?e.DISTANCE:e.NONE),tt=this.Lengths(Qh,Ve,Xr,xr,ft,hn,Bn,mt,Be,je,M_,xs,_s),Ke=tt.s12b,ut=tt.m12b,R&e.GEODESICSCALE&&(I.M12=tt.M12,I.M21=tt.M21),ut*=this._b,Ke*=this._b,I.a12=Ve/n.degree,R&e.AREA&&(P1=Math.sin(of),R1=Math.cos(of),nf=Yt*R1-mr*P1,od=mr*R1+Yt*P1)}return R&e.DISTANCE&&(I.s12=0+Ke),R&e.REDUCEDLENGTH&&(I.m12=0+ut),R&e.AREA&&(E1=We*Be,nd=n.hypot(qe,We*Se),nd!==0&&E1!==0?(Xr=Se,xr=qe*Be,hn=V,Bn=jt*je,id=n.sq(nd)*this._ep2,Qh=id/(2*(1+Math.sqrt(1+id))+id),v_=n.sq(this.a)*nd*E1*this._e2,ne=n.hypot(Xr,xr),Xr/=ne,xr/=ne,ne=n.hypot(hn,Bn),hn/=ne,Bn/=ne,rf=new Array(e.nC4_),this.C4f(Qh,rf),E_=e.SinCosSeries(!1,Xr,xr,rf),A_=e.SinCosSeries(!1,hn,Bn,rf),I.S12=v_*(Ve<.01?e.SinCosSeries(!1,Xr,xr,rf,Ve):A_-E_)):I.S12=0,!Xi&&nf==2&&(nf=Math.sin(ed),od=Math.cos(ed)),!Xi&&od>-.7071&&V-Se<1.75?(of=1+od,T1=1+Be,I1=1+je,A1=2*Math.atan2(nf*(Se*I1+V*T1),of*(Se*V+T1*I1))):(sd=pr*qe-jt*We,ad=jt*qe+pr*We,sd===0&&ad<0&&(sd=e.tiny_*qe,ad=-1),A1=Math.atan2(sd,ad)),I.S12+=this._c2*A1,I.S12*=Oe*_e*oe,I.S12+=0),Oe<0&&([pr,We]=[We,pr],[jt,qe]=[qe,jt],R&e.GEODESICSCALE&&([I.M21,I.M12]=[I.M12,I.M21])),We*=Oe*_e,qe*=Oe*oe,pr*=Oe*_e,jt*=Oe*oe,{vals:I,salp1:We,calp1:qe,salp2:pr,calp2:jt}},e.Geodesic.prototype.GenDirect=function(E,B,N,D,R,I){var j;return I?I===e.LONG_UNROLL&&(I|=e.STANDARD):I=e.STANDARD,D||(I|=e.DISTANCE_IN),j=new t.GeodesicLine(this,E,B,N,I),j.GenPosition(D,R,I)},e.Geodesic.prototype.Direct=function(E,B,N,D,R){return this.GenDirect(E,B,N,!1,D,R)},e.Geodesic.prototype.ArcDirect=function(E,B,N,D,R){return this.GenDirect(E,B,N,!0,D,R)},e.Geodesic.prototype.Line=function(E,B,N,D){return new t.GeodesicLine(this,E,B,N,D)},e.Geodesic.prototype.DirectLine=function(E,B,N,D,R){return this.GenDirectLine(E,B,N,!1,D,R)},e.Geodesic.prototype.ArcDirectLine=function(E,B,N,D,R){return this.GenDirectLine(E,B,N,!0,D,R)},e.Geodesic.prototype.GenDirectLine=function(E,B,N,D,R,I){var j;return I||(I=e.STANDARD|e.DISTANCE_IN),D||(I|=e.DISTANCE_IN),j=new t.GeodesicLine(this,E,B,N,I),j.GenSetDistance(D,R),j},e.Geodesic.prototype.InverseLine=function(E,B,N,D,R){var I,j,we;return R||(R=e.STANDARD|e.DISTANCE_IN),I=this.InverseInt(E,B,N,D,e.ARC),we=n.atan2d(I.salp1,I.calp1),R&(e.OUT_MASK&e.DISTANCE_IN)&&(R|=e.DISTANCE),j=new t.GeodesicLine(this,E,B,we,R,I.salp1,I.calp1),j.SetArc(I.vals.a12),j},e.Geodesic.prototype.Polygon=function(E){return new r.PolygonArea(this,E)},e.WGS84=new e.Geodesic(i.WGS84.a,i.WGS84.f)})(Zt.Geodesic,Zt.GeodesicLine,Zt.PolygonArea,Zt.Math,Zt.Constants);(function(e,t,r){"use strict";t.GeodesicLine=function(n,i,o,s,a,c,l){var u,h,d,m,g,y;a||(a=e.STANDARD|e.DISTANCE_IN),this.a=n.a,this.f=n.f,this._b=n._b,this._c2=n._c2,this._f1=n._f1,this.caps=a|e.LATITUDE|e.AZIMUTH|e.LONG_UNROLL,this.lat1=r.LatFix(i),this.lon1=o,typeof c>"u"||typeof l>"u"?(this.azi1=r.AngNormalize(s),u=r.sincosd(r.AngRound(this.azi1)),this.salp1=u.s,this.calp1=u.c):(this.azi1=s,this.salp1=c,this.calp1=l),u=r.sincosd(r.AngRound(this.lat1)),d=this._f1*u.s,h=u.c,u=r.hypot(d,h),d/=u,h/=u,h=Math.max(e.tiny_,h),this._dn1=Math.sqrt(1+n._ep2*r.sq(d)),this._salp0=this.salp1*h,this._calp0=r.hypot(this.calp1,this.salp1*d),this._ssig1=d,this._somg1=this._salp0*d,this._csig1=this._comg1=d!==0||this.calp1!==0?h*this.calp1:1,u=r.hypot(this._ssig1,this._csig1),this._ssig1/=u,this._csig1/=u,this._k2=r.sq(this._calp0)*n._ep2,m=this._k2/(2*(1+Math.sqrt(1+this._k2))+this._k2),this.caps&e.CAP_C1&&(this._A1m1=e.A1m1f(m),this._C1a=new Array(e.nC1_+1),e.C1f(m,this._C1a),this._B11=e.SinCosSeries(!0,this._ssig1,this._csig1,this._C1a),g=Math.sin(this._B11),y=Math.cos(this._B11),this._stau1=this._ssig1*y+this._csig1*g,this._ctau1=this._csig1*y-this._ssig1*g),this.caps&e.CAP_C1p&&(this._C1pa=new Array(e.nC1p_+1),e.C1pf(m,this._C1pa)),this.caps&e.CAP_C2&&(this._A2m1=e.A2m1f(m),this._C2a=new Array(e.nC2_+1),e.C2f(m,this._C2a),this._B21=e.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&e.CAP_C3&&(this._C3a=new Array(e.nC3_),n.C3f(m,this._C3a),this._A3c=-this.f*this._salp0*n.A3f(m),this._B31=e.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&e.CAP_C4&&(this._C4a=new Array(e.nC4_),n.C4f(m,this._C4a),this._A4=r.sq(this.a)*this._calp0*this._salp0*n._e2,this._B41=e.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=NaN},t.GeodesicLine.prototype.GenPosition=function(n,i,o,s={}){var a,c,l,u,h,d,m,g,y,b,w,S,M,v,T,O,P,_,U,C,L,A,W,G,E,B,N,D,R;return o?o===e.LONG_UNROLL&&(o|=e.STANDARD):o=e.STANDARD,o&=this.caps&e.OUT_MASK,s.lat1=this.lat1,s.azi1=this.azi1,s.lon1=o&e.LONG_UNROLL?this.lon1:r.AngNormalize(this.lon1),n?s.a12=i:s.s12=i,n||this.caps&e.DISTANCE_IN&e.OUT_MASK?(u=0,h=0,n?(a=i*r.degree,B=r.sincosd(i),c=B.s,l=B.c):(g=i/(this._b*(1+this._A1m1)),y=Math.sin(g),b=Math.cos(g),u=-e.SinCosSeries(!0,this._stau1*b+this._ctau1*y,this._ctau1*b-this._stau1*y,this._C1pa),a=g-(u-this._B11),c=Math.sin(a),l=Math.cos(a),Math.abs(this.f)>.01&&(d=this._ssig1*l+this._csig1*c,m=this._csig1*l-this._ssig1*c,u=e.SinCosSeries(!0,d,m,this._C1a),w=(1+this._A1m1)*(a+(u-this._B11))-i/this._b,a=a-w/Math.sqrt(1+this._k2*r.sq(d)),c=Math.sin(a),l=Math.cos(a))),d=this._ssig1*l+this._csig1*c,m=this._csig1*l-this._ssig1*c,A=Math.sqrt(1+this._k2*r.sq(d)),o&(e.DISTANCE|e.REDUCEDLENGTH|e.GEODESICSCALE)&&((n||Math.abs(this.f)>.01)&&(u=e.SinCosSeries(!0,d,m,this._C1a)),h=(1+this._A1m1)*(u-this._B11)),O=this._calp0*d,P=r.hypot(this._salp0,this._calp0*m),P===0&&(P=m=e.tiny_),C=this._salp0,L=this._calp0*m,n&&o&e.DISTANCE&&(s.s12=this._b*((1+this._A1m1)*a+h)),o&e.LONGITUDE&&(_=this._salp0*d,U=m,T=r.copysign(1,this._salp0),S=o&e.LONG_UNROLL?T*(a-(Math.atan2(d,m)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(T*_,U)-Math.atan2(T*this._somg1,this._comg1))):Math.atan2(_*this._comg1-U*this._somg1,U*this._comg1+_*this._somg1),M=S+this._A3c*(a+(e.SinCosSeries(!0,d,m,this._C3a)-this._B31)),v=M/r.degree,s.lon2=o&e.LONG_UNROLL?this.lon1+v:r.AngNormalize(r.AngNormalize(this.lon1)+r.AngNormalize(v))),o&e.LATITUDE&&(s.lat2=r.atan2d(O,this._f1*P)),o&e.AZIMUTH&&(s.azi2=r.atan2d(C,L)),o&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(W=e.SinCosSeries(!0,d,m,this._C2a),G=(1+this._A2m1)*(W-this._B21),E=(this._A1m1-this._A2m1)*a+(h-G),o&e.REDUCEDLENGTH&&(s.m12=this._b*(A*(this._csig1*d)-this._dn1*(this._ssig1*m)-this._csig1*m*E)),o&e.GEODESICSCALE&&(B=this._k2*(d-this._ssig1)*(d+this._ssig1)/(this._dn1+A),s.M12=l+(B*d-m*E)*this._ssig1/this._dn1,s.M21=l-(B*this._ssig1-this._csig1*E)*d/A)),o&e.AREA&&(N=e.SinCosSeries(!1,d,m,this._C4a),this._calp0===0||this._salp0===0?(D=C*this.calp1-L*this.salp1,R=L*this.calp1+C*this.salp1):(D=this._calp0*this._salp0*(l<=0?this._csig1*(1-l)+c*this._ssig1:c*(this._csig1*c/(1+l)+this._ssig1)),R=r.sq(this._salp0)+r.sq(this._calp0)*this._csig1*m),s.S12=this._c2*Math.atan2(D,R)+this._A4*(Math.abs(a)<.01?e.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a,a):N-this._B41)),n||(s.a12=a/r.degree),s):(s.a12=NaN,s)},t.GeodesicLine.prototype.Position=function(n,i){return this.GenPosition(!1,n,i)},t.GeodesicLine.prototype.ArcPosition=function(n,i){return this.GenPosition(!0,n,i)},t.GeodesicLine.prototype.GenSetDistance=function(n,i){n?this.SetArc(i):this.SetDistance(i)},t.GeodesicLine.prototype.SetDistance=function(n){var i;this.s13=n,i=this.GenPosition(!1,this.s13,e.ARC),this.a13=0+i.a12},t.GeodesicLine.prototype.SetArc=function(n){var i;this.a13=n,i=this.GenPosition(!0,this.a13,e.DISTANCE),this.s13=0+i.s12}})(Zt.Geodesic,Zt.GeodesicLine,Zt.Math)});function L4(e){if(!Number.isFinite(e))throw new Error("Nonfinite axis, azimuth, distance or arc")}function O4({semiMajorAxis:e,semiMinorAxis:t}){return L4(e),L4(t),new _y.Geodesic(e,(e-t)/e)}var _y,Af,B4=p(()=>{R4();_y=Zt.Geodesic;Af=_y.ALL&~_y.AREA});function N4(e,t,r,n,i,o){let s=D4[t]&&D4[t][r];Ii(s&&(!n||n===s));let a,c,l,u=Wj.copy(i);if(!Number.isFinite(u.x)||!Number.isFinite(u.y)||!Number.isFinite(u.z)||!Array.isArray(o)&&o.length<16)throw new Error("Unsupported local frame");let h=Vj*Math.min(1,e.maximumRadius),d=Math.abs(u.x)<=h&&Math.abs(u.y)<=h,m=e.radii;if(m.x===m.y&&m.x>0&&m.z>0&&m.z<=m.x&&(!d||u.z!==0)){let{east:C,up:L}=jl;if(d)C.set(0,1,0),L.set(0,0,Math.sign(u.z));else{let A=Math.max(Math.abs(u.x),Math.abs(u.y));C.set(-u.y/A,u.x/A,0).normalize(),e.geodeticSurfaceNormal(u,L)}if(!py(C,L,C4)||!gy(C4,u,t,r,n,o))throw new Error("Unsupported local frame");return o}if(d){let C=Math.sign(u.z);a=Hj.fromArray(Sy[t]),t!=="east"&&t!=="west"&&a.scale(C),c=$j.fromArray(Sy[r]),r!=="east"&&r!=="west"&&c.scale(C),l=Kj.fromArray(Sy[n]),n!=="east"&&n!=="west"&&l.scale(C)}else{let{up:C,east:L,north:A}=jl,W=Math.max(Math.abs(u.x),Math.abs(u.y));L.set(-u.y/W,u.x/W,0).normalize(),e.geodeticSurfaceNormal(u,C),A.copy(C).cross(L);let{down:G,west:E,south:B}=jl;G.copy(C).scale(-1),E.copy(L).scale(-1),B.copy(A).scale(-1),a=jl[t],c=jl[r],l=jl[n]}let g=a.x,y=a.y,b=a.z,w=c.x,S=c.y,M=c.z,v=l.x,T=l.y,O=l.z,P=u.x,_=u.y,U=u.z;return o[0]=g,o[1]=y,o[2]=b,o[3]=0,o[4]=w,o[5]=S,o[6]=M,o[7]=0,o[8]=v,o[9]=T,o[10]=O,o[11]=0,o[12]=P,o[13]=_,o[14]=U,o[15]=1,o}var Vj,Wj,C4,D4,Sy,jl,Hj,$j,Kj,F4=p(()=>{Dn();Dn();Vj=1e-14,Wj=new J,C4=my(),D4={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"}},Sy={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},jl={east:new J,north:new J,up:new J,west:new J,south:new J,down:new J},Hj=new J,$j=new J,Kj=new J});function My(e,t,r=new gn){return N4(e,"east","north","up",t,r)}var G4=p(()=>{Dn();F4()});var k4=p(()=>{P4();G4()});var vy,Ey,Ps,U4=p(()=>{vy={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Ey={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635},Ps={...vy,...Ey}});var j4=p(()=>{U4()});var z4=p(()=>{j4()});var q4=p(()=>{});var V4=p(()=>{});function re(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))return r;let n=e[t];if(typeof n!="string"||!/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i.test(n))throw new Error(`Invalid numeric PROJ parameter: +${t}`);let i=Number(n);if(!Number.isFinite(i))throw new Error(`Invalid numeric PROJ parameter: +${t}`);return i}function Tf(e,t){let r=re(e,t,0);if(Math.abs(r)>=90)throw new Error(`+${t} must be between -90 and 90 degrees`);return r*At}function Kt(e,t=!1){if(t||Math.abs(e)<=Math.PI)return e;let r=2*Math.PI;return((e+Math.PI)%r+r)%r-Math.PI}var At,qt=p(()=>{At=Math.PI/180});function Lt(e,t){let r=[e[0]*t[0],e[0]*t[1],e[1]*t[0],e[1]*t[1]];return[Math.min(...r),Math.max(...r)]}function If([e,t]){let r=[Math.sin(e),Math.sin(t)];for(let[n,i]of[[Math.PI/2,1],[-Math.PI/2,-1]])Math.ceil((e-n)/(2*Math.PI))<=Math.floor((t-n)/(2*Math.PI))&&r.push(i);return[Math.min(...r),Math.max(...r)]}function ct(e,t){let r=n=>Math.max(1,Rs(n))*1e-12;if(![...e,...t].every(Number.isFinite))throw new Error("Projection rendering bounds are not finite");return[[e[0]-r(e),t[0]-r(t),0],[e[1]+r(e),t[1]+r(t),0]]}function Or(e,t,r=!1){let n=e[0][0]-t,i=e[1][0]-t;if(r)return[n,i];let o=i-n;if(o>=2*Math.PI-1e-12)return[-Math.PI,Math.PI];let s=Kt(n);o>0&&Math.abs(s-Math.PI)<1e-12&&(s=-Math.PI);let a=s+o;return a>Math.PI+1e-12?[-Math.PI,Math.PI]:[s,Math.min(a,Math.PI)]}function Br(e,t,r,n=!1){let i=Or(t,r,n),o=[t[0][1],t[1][1],Math.max(t[0][1],Math.min(t[1][1],0))],s=i.flatMap(a=>o.map(c=>e(r+a,c)));return ct([Math.min(...s.map(a=>a[0])),Math.max(...s.map(a=>a[0]))],[Math.min(...s.map(a=>a[1])),Math.max(...s.map(a=>a[1]))])}function zl(e,t,r,n=!1,i=0){let o=Or(t,r,n);if(Rs(o)>Math.PI/6+1e-12)throw new Error("Unsupported transverse rendering coverage");let s=[o[0],o[1],Math.max(o[0],Math.min(o[1],0))],a=[t[0][1],t[1][1],Math.max(t[0][1],Math.min(t[1][1],i))],c=s.flatMap(l=>a.map(u=>e(r+l,u)));return ct([Math.min(...c.map(l=>l[0])),Math.max(...c.map(l=>l[0]))],[Math.min(...c.map(l=>l[1])),Math.max(...c.map(l=>l[1]))])}function W4(e,t,r,n=!1){let i=Or(t,r,n),o=[i[0],i[1],Math.max(i[0],Math.min(i[1],0))],s=[t[0][1],t[1][1],Math.max(t[0][1],Math.min(t[1][1],0))],a=o.flatMap(c=>s.map(l=>e(r+c,l)));return ct([Math.min(...a.map(c=>c[0])),Math.max(...a.map(c=>c[0]))],[Math.min(...a.map(c=>c[1])),Math.max(...a.map(c=>c[1]))])}function ql(e,t,r,n,i,o,s=!1){let a=Fe(Or(t,r,s),n),c=hi(o-e(r,t[0][1])[1],o-e(r,t[1][1])[1]);return ct(Ce([i,i],Lt(c,If(a))),Ce([o,o],Fe(Lt(c,Sm(a)),-1)))}var hi,Ce,Fe,Sm,Rs,Ot=p(()=>{qt();hi=(e,t)=>[Math.min(e,t),Math.max(e,t)],Ce=(e,t)=>[e[0]+t[0],e[1]+t[1]],Fe=(e,t)=>hi(e[0]*t,e[1]*t);Sm=e=>If([e[0]+Math.PI/2,e[1]+Math.PI/2]),Rs=e=>Math.max(Math.abs(e[0]),Math.abs(e[1]))});function Q(e,t,r,n){return[[e,t],[r,n]]}function Pi(e){return e>=-180&&e<180?e:((e+180)%360+360)%360-180}function Yj(e,t,r,n){if(![e,t,r,n].every(Number.isFinite)||t<-90||n>90||t>n||r-e<-360||r-e>360+1e-10)throw new Error("Invalid geographic coverage");if(r-e>=360-1e-10)return[-180,t,180,n];let i=Pi(r);return[Pi(e),t,i===-180&&r>e?180:i,n]}function Ay(e){let t=e[2]-e[0];return t<0?t+360:t}function H4(e){let[t,r,n,i]=e;return t<=n?[e]:[[t,r,180,i],[-180,r,n,i]]}function Zj(e,t){let[r,n,i,o]=e,s=Pi(t[0]);return t[1]>=n&&t[1]<=o&&(r<=i?s>=r&&s<=i||s===-180&&i===180:s>=r||s<=i)}function Mm(e,t){let r=Math.max(e[1],t[1]),n=Math.min(e[3],t[3]);if(r>n)return[];let i=[];for(let s of H4(e))for(let a of H4(t)){let c=Math.max(s[0],a[0]),l=Math.min(s[2],a[2]);c<=l?i.push([c,l]):(s[2]===180&&a[0]===-180||a[2]===180&&s[0]===-180)&&i.push([-180,-180])}i.sort((s,a)=>s[0]-a[0]);let o=[];for(let s of i){let a=o[o.length-1];a&&s[0]<=a[1]?a[1]=Math.max(a[1],s[1]):o.push([...s])}if(o.length>1&&o[0][0]===-180&&o[o.length-1][1]===180){let s=o.shift();return[[o.pop()[0],r,s[1],n],...o.map(([c,l])=>[c,r,l,n])]}return o.map(([s,a])=>[s,r,a,n])}function $4(e,t){let r=Pi(t[0]),n=Math.max(e[1],Math.min(e[3],t[1]));if(!Zj(e,[r,n])){let i=Math.abs(Pi(r-e[0])),o=Math.abs(Pi(r-e[2]));r=i<=o?e[0]:e[2]}return[r,n]}function Ls(e,t=0,r=0){let n=Ay(e),i=e[0]*zo-t,o=i+n*zo/2,s=Math.round((r-o)/(2*Math.PI))*2*Math.PI;return Q(n===360?r-Math.PI:i+s,e[1]*zo,n===360?r+Math.PI:i+s+n*zo,e[3]*zo)}function Nn(e,t=0){return Yj((e[0][0]+t)/zo,e[0][1]/zo,(e[1][0]+t)/zo,e[1][1]/zo)}function K4(e){if(!e.length)throw new Error("CRS coverage does not intersect the rendering target");return[[0,1,2].map(t=>Math.min(...e.map(r=>r[0][t]))),[0,1,2].map(t=>Math.max(...e.map(r=>r[1][t])))]}var zo,Je=p(()=>{zo=Math.PI/180});function X4(e,t){if(t)try{let n=e(t);return Ty(n)}catch{}let r=e();return Ty(r)}function Ty(e){var r;let t=e.bounds;if(t.some(n=>n.some(i=>!Number.isFinite(i))))throw new Error("Projection rendering bounds must be finite");return{bounds:t,normalize:(r=e.normalize)==null?void 0:r.bind(e)}}function Os(e,t=0){return r=>{let n=r.x*Math.PI/180-t,i=r.y*Math.PI/180,o={x:n,y:i,z:r.z};e(o),o.x!==n&&(r.x=(o.x+t)*180/Math.PI),o.y!==i&&(r.y=o.y*180/Math.PI)}}function vm(e,t){let r=[];for(let n of e){let i=t(n);i!==null&&r.push(Ty(i))}return r.length?r.length===1?r[0]:{bounds:K4(r.map(n=>n.bounds)),normalize(n){var a;let i=n.x,o=n.y,s=1/0;for(let c of r){let l={x:n.x,y:n.y,z:n.z};(a=c.normalize)==null||a.call(c,l);let u=Math.sin((l.y-n.y)*Math.PI/360)**2+Math.cos(n.y*Math.PI/180)*Math.cos(l.y*Math.PI/180)*Math.sin((l.x-n.x)*Math.PI/360)**2;u<s&&(s=u,i=l.x,o=l.y)}n.x=i,n.y=o}}:null}var sc=p(()=>{Je()});function Em(e,t,r=0,n=!1){let i=Ay(t),o=i===360?r-180:t[0]+Math.round((r-t[0]-i/2)/360)*360,s=o+i;if(n){e.x=Math.max(o,Math.min(s,e.x)),e.y=Math.max(t[1],Math.min(t[3],e.y));return}let a=$4(t,[e.x,e.y]),c=a[0];a[0]===Pi(e.x)&&e.x>=o&&e.x<=s?c=e.x:(c<o||c>s)&&(c+=Math.round(((o+s)/2-c)/360)*360);let l=c-r;e.x=Math.abs(l)<=180?c:r+Pi(l),e.y=a[1]}function cr(e,t,r=0,n=0,i=!1){let o=(r+n)*180/Math.PI;return{get bounds(){return e(Ls(t,n,r))},normalize(s){Em(s,t,o,i)}}}function Jj(e,t,r,n,i){let o=vm(t,s=>cr(e,s,r,n,i));if(!o)throw new Error("CRS coverage does not intersect the rendering target");return o}function De(e,t,r,n=0,i=!1){let o=(t[0][0]+t[1][0])/2,s=Nn(t,n),a=(o+n)*180/Math.PI;return{...e,longitudeOrigin:o,getRenderingProfile(c){if(!c)return{bounds:r(t),normalize(l){Em(l,s,a,i)}};try{let l=cr(r,c,o,n,i);return{bounds:l.bounds,normalize:l.normalize}}catch{return Jj(r,Mm(c,s),o,n,i)}}}}var lt=p(()=>{Je();sc()});function Y4(){return{x:0,y:0,z:0}}var Bs,Am=p(()=>{Bs=class{constructor(){this.point=Y4(),this.points=[this.point],this.active=0}get depth(){return this.active}acquire(){var t;let r=this.active++;return(t=this.points)[r]||(t[r]=Y4()),this.points[r]}release(t){this.active>0&&this.points[this.active-1]===t&&this.active--}}});function di(e,t){let r=new Bs,n=(i,o,s)=>{let a=r.acquire();try{return a.x=i,a.y=o,a.z=0,s(a),[a.x,a.y]}finally{r.release(a)}};return{forward(i,o){return n(i,o,e)},inverse(i,o){return n(i,o,t)},forwardInPlace:e,inverseInPlace:t}}function qo(e,t,r=!1){let n=t?e.inverseInPlace:e.forwardInPlace;if(n)return n.bind(e);if(r){let o=t?e.inverse3D:e.forward3D;return s=>{let a=o.call(e,[s.x,s.y,s.z]);s.x=a[0],s.y=a[1],s.z=a[2]}}let i=t?e.inverse:e.forward;return o=>{let s=i.call(e,o.x,o.y);o.x=s[0],o.y=s[1]}}var ac=p(()=>{Am()});function Cs(e,t,r=0){let n=re(e,t,r);if(t!=="lon_0"&&Math.abs(n)>90)throw new Error("Latitude parameter must be between -90 and 90 degrees: +"+t);return n*At}function Ri(e,t){let r=Object.prototype.hasOwnProperty.call(e,t);if(r&&e[t]!==void 0)throw new Error("Expected a flag without a value: +"+t);return r}function br({semiMajorAxis:e,eccentricitySquared:t,parameters:r,primeMeridian:n=0}){let i=re(r,"k_0",re(r,"k",1));if(i<=0)throw new Error("Projection scale must be positive");return{primeMeridian:n,a:e,b:e*Math.sqrt(1-t),es:t,e:Math.sqrt(t),ep2:t/(1-t),sphere:t===0,over:Ri(r,"over"),long0:Cs(r,"lon_0"),lat0:Cs(r,"lat_0"),lat1:Cs(r,"lat_1"),lat2:Cs(r,"lat_2",re(r,"lat_1",0)),lat_ts:Cs(r,"lat_ts",NaN),x0:re(r,"x_0",0),y0:re(r,"y_0",0),k0:i}}function Vl(e,t){if(!Object.prototype.hasOwnProperty.call(t,"lat_1"))throw new Error("Conic projections require +lat_1");if(Math.abs(e.lat1+e.lat2)<1e-10||Math.abs(e.lat1)>=Math.PI/2||Math.abs(e.lat2)>=Math.PI/2)throw new Error("Conic standard parallels must not be opposite or at a pole")}function lr(e,t,r,n,i=di){let o=(s,a)=>{let c=s(t,a);if(!c||typeof c!="object"||!Number.isFinite(c.x)||!Number.isFinite(c.y))throw new Error(e+": coordinate outside projection domain or inverse did not converge");a.x=c.x,a.y=c.y};return i(s=>o(r,s),s=>o(n,s))}function Ds(e,t){let r=qo(t,!1);return di(n=>{let i=n.x,o=n.y,s=Math.atan2(Math.sin(i-e.long0),Math.cos(i-e.long0)),a=Math.abs(Math.abs(e.lat0)-Math.PI/2)<1e-10;if(Math.abs(o+e.lat0)<1e-10&&(a||Math.abs(Math.abs(s)-Math.PI)<1e-10))throw new Error("Azimuthal projection is undefined at the antipode");r(n)},qo(t,!0))}var vr,Vo,Fn=p(()=>{ac();qt();vr=["lon_0","lat_0","x_0","y_0"],Vo=["k","k_0"]});function Li(e,t){return{...di(e,t),createForwardFlat(r){return this.forwardInPlace===e?Z4(e,!1,r):void 0},createInverseFlat(r){return this.inverseInPlace===t?Z4(t,!0,r):void 0}}}function Z4(e,t,{inputScale:r,outputScale:n}){let i=new Bs;return(o,s)=>{let a=i.acquire();try{let c=o instanceof Float32Array;for(let l=0;l<o.length;l+=s){if(a.x=o[l],a.y=o[l+1],a.z=s>=3?o[l+2]:0,!Number.isFinite(a.x)||!Number.isFinite(a.y)||!Number.isFinite(a.z))throw new Error("Coordinates must contain finite x, y and optional z values");if(r!==1&&(a.x*=r,a.y*=r),t&&e(a),Math.abs(a.y)>Math.PI/2||!Number.isFinite(a.x)||!Number.isFinite(a.y))throw new Error("Coordinate is outside the geographic domain");if(a.x+=0,a.x-=0,t||e(a),n!==1&&(a.x/=n,a.y/=n),!Number.isFinite(a.x)||!Number.isFinite(a.y))throw new Error("Projection produced non-finite coordinates");if(c&&(Math.abs(a.x)>34028234663852886e22||Math.abs(a.y)>34028234663852886e22))throw new Error("Projected coordinate exceeds Float32 range");o[l]=a.x,o[l+1]=a.y}}finally{i.release(a)}}}var Wl=p(()=>{ac();Am()});function cc(e){var t=Math.exp(e);return t=(t-1/t)/2,t}var Tm=p(()=>{});function Jt(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),n=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}var lc=p(()=>{});function J4(e){var t=1+e,r=t-1;return r===0?e:e*Math.log(t)/r}var Q4=p(()=>{});function e8(e){var t=Math.abs(e);return t=J4(t*(1+t/(Jt(1,t)+1))),e<0?-t:t}var t8=p(()=>{lc();Q4()});function Im(e,t){for(var r=2*Math.cos(2*t),n=e.length-1,i=e[n],o=0,s;--n>=0;)s=-o+r*i+e[n],o=i,i=s;return t+s*Math.sin(2*t)}var r8=p(()=>{});function n8(e,t){for(var r=2*Math.cos(t),n=e.length-1,i=e[n],o=0,s;--n>=0;)s=-o+r*i+e[n],o=i,i=s;return Math.sin(t)*s}var i8=p(()=>{});function Pf(e){var t=Math.exp(e);return t=(t+1/t)/2,t}var Iy=p(()=>{});function Py(e,t,r,n){for(var i=Math.sin(t),o=Math.cos(t),s=cc(r),a=Pf(r),c=2*o*a,l=-2*i*s,u=e.length-1,h=e[u],d=0,m=0,g=0,y,b;--u>=0;)y=m,b=d,m=h,d=g,h=-y+c*m-l*d+e[u],g=-b+l*m+c*d;c=i*a,l=o*s,n.x=c*h-l*g,n.y=c*g+l*h}var o8=p(()=>{Tm();Iy()});var F,Qe,Ns,s8,Ry,Ly,Rf,Bt=p(()=>{F=Math.PI/2,Qe=Math.PI/4,Ns=Math.PI*2,s8=3.14159265359,Ry=Math.PI/180,Ly=180/Math.PI,Rf=Math.PI/(180*3600)});function Fs(e){return e<0?-1:1}var Lf=p(()=>{});function k(e,t){return t||Math.abs(e)<=s8?e:e-Fs(e)*Ns}var xt=p(()=>{Bt();Lf()});function Qj(e){e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.long0=e.long0!==void 0?e.long0:0,e.lat0=e.lat0!==void 0?e.lat0:0,e.k0=e.k0!==void 0?e.k0:1,e.cgb=[],e.cbg=[],e.utg=[],e.gtu=[];var t=e.es/(1+Math.sqrt(1-e.es)),r=t/(2-t),n=r;e.cgb[0]=r*(2+r*(-2/3+r*(-2+r*(116/45+r*(26/45+r*(-2854/675)))))),e.cbg[0]=r*(-2+r*(2/3+r*(4/3+r*(-82/45+r*(32/45+r*(4642/4725)))))),n=n*r,e.cgb[1]=n*(7/3+r*(-8/5+r*(-227/45+r*(2704/315+r*(2323/945))))),e.cbg[1]=n*(5/3+r*(-16/15+r*(-13/9+r*(904/315+r*(-1522/945))))),n=n*r,e.cgb[2]=n*(56/15+r*(-136/35+r*(-1262/105+r*(73814/2835)))),e.cbg[2]=n*(-26/15+r*(34/21+r*(8/5+r*(-12686/2835)))),n=n*r,e.cgb[3]=n*(4279/630+r*(-332/35+r*(-399572/14175))),e.cbg[3]=n*(1237/630+r*(-12/5+r*(-24832/14175))),n=n*r,e.cgb[4]=n*(4174/315+r*(-144838/6237)),e.cbg[4]=n*(-734/315+r*(109598/31185)),n=n*r,e.cgb[5]=n*(601676/22275),e.cbg[5]=n*(444337/155925),n=Math.pow(r,2),e.Qn=e.k0/(1+r)*(1+n*(1/4+n*(1/64+n/256))),e.utg[0]=r*(-.5+r*(2/3+r*(-37/96+r*(1/360+r*(81/512+r*(-96199/604800)))))),e.gtu[0]=r*(.5+r*(-2/3+r*(5/16+r*(41/180+r*(-127/288+r*(7891/37800)))))),e.utg[1]=n*(-1/48+r*(-1/15+r*(437/1440+r*(-46/105+r*(1118711/3870720))))),e.gtu[1]=n*(13/48+r*(-3/5+r*(557/1440+r*(281/630+r*(-1983433/1935360))))),n=n*r,e.utg[2]=n*(-17/480+r*(37/840+r*(209/4480+r*(-5569/90720)))),e.gtu[2]=n*(61/240+r*(-103/140+r*(15061/26880+r*(167603/181440)))),n=n*r,e.utg[3]=n*(-4397/161280+r*(11/504+r*(830251/7257600))),e.gtu[3]=n*(49561/161280+r*(-179/168+r*(6601661/7257600))),n=n*r,e.utg[4]=n*(-4583/161280+r*(108847/3991680)),e.gtu[4]=n*(34729/80640+r*(-3418889/1995840)),n=n*r,e.utg[5]=n*(-20648693/638668800),e.gtu[5]=n*(212378941/319334400);var i=Im(e.cbg,e.lat0);e.Zb=-e.Qn*(i+n8(e.gtu,2*i))}function a8(e,t){var r=k(t.x-e.long0,e.over),n=t.y;n=Im(e.cbg,n);var i=Math.sin(n),o=Math.cos(n),s=Math.sin(r),a=Math.cos(r);n=Math.atan2(i,a*o),r=Math.atan2(s*o,Jt(i,o*a)),r=e8(Math.tan(r)),Py(e.gtu,2*n,2*r,t),n=n+t.x,r=r+t.y;var c,l;return Math.abs(r)<=2.623395162778?(c=e.a*(e.Qn*r)+e.x0,l=e.a*(e.Qn*n+e.Zb)+e.y0):(c=1/0,l=1/0),t.x=c,t.y=l,t}function c8(e,t){var r=(t.x-e.x0)*(1/e.a),n=(t.y-e.y0)*(1/e.a);n=(n-e.Zb)/e.Qn,r=r/e.Qn;var i,o;if(Math.abs(r)<=2.623395162778){Py(e.utg,2*n,2*r,t),n=n+t.x,r=r+t.y,r=Math.atan(cc(r));var s=Math.sin(n),a=Math.cos(n),c=Math.sin(r),l=Math.cos(r);n=Math.atan2(s*l,Jt(c,l*a)),r=Math.atan2(c,l*a),i=k(r+e.long0,e.over),o=Im(e.cgb,n)}else i=1/0,o=1/0;return t.x=i,t.y=o,t}function l8(e){let t={...e,cgb:[],cbg:[],utg:[],gtu:[],Qn:0,Zb:0};return Qj(t),t}var u8=p(()=>{Tm();lc();t8();r8();i8();o8();xt()});function co(e){var t=[];t[0]=ez-e*(tz+e*(f8+e*(h8+e*d8))),t[1]=e*(rz-e*(f8+e*(h8+e*d8)));var r=e*e;return t[2]=r*(nz-e*(iz+e*oz)),r*=e,t[3]=r*(sz-e*az),t[4]=r*e*cz,t}var ez,tz,f8,h8,d8,rz,nz,iz,oz,sz,az,cz,Hl=p(()=>{ez=1,tz=.25,f8=.046875,h8=.01953125,d8=.01068115234375,rz=.75,nz=.46875,iz=.013020833333333334,oz=.007120768229166667,sz=.3645833333333333,az=.005696614583333333,cz=.3076171875});function wr(e,t,r,n){return r*=t,t*=t,n[0]*e-r*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var uc=p(()=>{});function lo(e,t,r){for(var n=1/(1-t),i=e,o=lz;o;--o){var s=Math.sin(i),a=1-t*s*s;if(a=(wr(i,s,Math.cos(i),r)-e)*(a*Math.sqrt(a))*n,i-=a,Math.abs(a)<1e-10)return i}return i}var lz,$l=p(()=>{uc();lz=20});function uz(e){e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.long0=e.long0!==void 0?e.long0:0,e.lat0=e.lat0!==void 0?e.lat0:0,e.es&&(e.en=co(e.es),e.ml0=wr(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en))}function m8(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over),o,s,a,c=Math.sin(n),l=Math.cos(n);if(e.es){var h=l*i,d=Math.pow(h,2),m=e.ep2*Math.pow(l,2),g=Math.pow(m,2),y=Math.abs(l)>1e-10?Math.tan(n):0,b=Math.pow(y,2),w=Math.pow(b,2);o=1-e.es*Math.pow(c,2),h=h/Math.sqrt(o);var S=wr(n,c,l,e.en);s=e.a*(e.k0*h*(1+d/6*(1-b+m+d/20*(5-18*b+w+14*m-58*b*m+d/42*(61+179*w-w*b-479*b)))))+e.x0,a=e.a*(e.k0*(S-e.ml0+c*i*h/2*(1+d/12*(5-b+9*m+4*g+d/30*(61+w-58*b+270*m-330*b*m+d/56*(1385+543*w-w*b-3111*b))))))+e.y0}else{var u=l*Math.sin(i);if(Math.abs(Math.abs(u)-1)<1e-10)return 93;if(s=.5*e.a*e.k0*Math.log((1+u)/(1-u))+e.x0,a=l*Math.cos(i)/Math.sqrt(1-Math.pow(u,2)),u=Math.abs(a),u>=1){if(u-1>1e-10)return 93;a=0}else a=Math.acos(a);n<0&&(a=-a),a=e.a*e.k0*(a-e.lat0)+e.y0}return t.x=s,t.y=a,t}function p8(e,t){var r,n,i,o,s=(t.x-e.x0)*(1/e.a),a=(t.y-e.y0)*(1/e.a);if(e.es)if(r=e.ml0+a/e.k0,n=lo(r,e.es,e.en),Math.abs(n)<F){var d=Math.sin(n),m=Math.cos(n),g=Math.abs(m)>1e-10?Math.tan(n):0,y=e.ep2*Math.pow(m,2),b=Math.pow(y,2),w=Math.pow(g,2),S=Math.pow(w,2);r=1-e.es*Math.pow(d,2);var M=s*Math.sqrt(r)/e.k0,v=Math.pow(M,2);r=r*g,i=n-r*v/(1-e.es)*.5*(1-v/12*(5+3*w-9*y*w+y-4*b-v/30*(61+90*w-252*y*w+45*S+46*y-v/56*(1385+3633*w+4095*S+1574*S*w)))),o=k(e.long0+M*(1-v/6*(1+2*w+y-v/20*(5+28*w+24*S+8*y*w+6*y-v/42*(61+662*w+1320*S+720*S*w))))/m,e.over)}else i=F*Fs(a),o=0;else{var c=Math.exp(s/e.k0),l=.5*(c-1/c),u=e.lat0+a/e.k0,h=Math.cos(u);r=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(l,2))),i=Math.asin(r),Math.sin(u)<0&&(i=-i),l===0&&h===0?o=0:o=k(Math.atan2(l,h)+e.long0,e.over)}return t.x=o,t.y=i,t}function g8(e){let t={...e,en:[],ml0:0};return uz(t),t}var y8=p(()=>{Hl();uc();$l();xt();Bt();Lf()});function Pm(e){let t=br(e),r=n=>De(n,Q(t.long0-Math.PI/6,-Math.PI/2,t.long0+Math.PI/6,Math.PI/2),i=>zl(n.forward,i,t.long0,t.over),t.primeMeridian,t.over);if(Ri(e.parameters,"approx"))return r({...lr("tmerc +approx",g8(t),m8,p8,Li)});if(t.sphere)throw new Error("Spherical transverse Mercator requires +approx");return r({...lr("etmerc",l8(t),a8,c8,Li)})}var Oy,By,Cy=p(()=>{Wl();Ot();Je();lt();Fn();u8();y8();Oy={name:"tmerc",aliases:["Fast_Transverse_Mercator","Fast Transverse Mercator","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger"],parameters:[...vr,...Vo,"approx"],flags:["approx"],create:Pm},By={name:"etmerc",aliases:["Extended_Transverse_Mercator","Extended Transverse Mercator"],parameters:[...vr,...Vo,"approx"],flags:["approx"],create:Pm}});var Dy,b8=p(()=>{Ot();Je();lt();qt();Fn();Cy();Dy={name:"utm",aliases:["Universal Transverse Mercator System"],parameters:["zone","south","approx"],flags:["south","approx"],create(e){let t=re(e.parameters,"zone",NaN);if(!Number.isInteger(t)||t<1||t>60)throw new Error("UTM requires an integer +zone from 1 to 60");let r=Ri(e.parameters,"south"),n=Pm({...e,parameters:{...e.parameters,lat_0:"0",lon_0:String(6*t-183),x_0:"500000",y_0:r?"10000000":"0",k_0:"0.9996"}}),i=(6*t-183)*Math.PI/180;return De(n,Q(i-Math.PI/60,r?-80*Math.PI/180:0,i+Math.PI/60,r?0:84*Math.PI/180),o=>zl(n.forward,o,i),e.primeMeridian??0,Object.prototype.hasOwnProperty.call(e.parameters,"over"))}}});function Fy(e,t){return[Math.cos(t)*Math.cos(e),Math.cos(t)*Math.sin(e),Math.sin(t)]}function Rm(e,t,r,n,i){let o=Math.hypot(e,t);if(!o||Math.abs(r)>o+1e-14)return[];let s=Math.atan2(t,e),a=Math.acos(Math.max(-1,Math.min(1,r/o))),c=[];for(let l of[s-a,s+a])for(let u=Math.ceil((n-l)/(2*Math.PI));u<=Math.floor((i-l)/(2*Math.PI));u++)c.push(l+u*2*Math.PI);return c}function Gs(e,t,r,n=!0){let[[i,o],[s,a]]=t,c=(i+s)/2,l=r?[Math.cos(r.latitude),0,Math.sin(r.latitude)]:[1,0,0],u=r?Math.cos(r.distance):-1,h=n?-1/0:1/0,d=[NaN,NaN],m=(y,b)=>{if(y=c+Kt(y-c),y<i-1e-12||y>s+1e-12||b<o-1e-12||b>a+1e-12)return;let w=Fy(y,b);if(r&&Ny(l,w)<u-1e-13)return;let S=Ny(e,w);(n?S>h:S<h)&&(h=S,d=[y,b])},g=[i,s,...Rm(-e[1],e[0],0,i,s)];for(let y of g){let b=e[0]*Math.cos(y)+e[1]*Math.sin(y);for(let w of[o,a,...Rm(e[2],-b,0,o,a)])m(y,w)}if(r){let[y,,b]=l;for(let v of[o,a])for(let T of Rm(y*Math.cos(v),0,u-b*Math.sin(v),i,s))m(T,v);for(let v of[i,s])for(let T of Rm(y*Math.cos(v),b,u,o,a))m(v,T);let w=Ny(e,l),S=e.map((v,T)=>v-w*l[T]),M=Math.hypot(...S);if(M<=1e-14&&(S=[-l[2],0,l[0]],M=1),M>1e-14)for(let v of[-1,1]){let T=l.map((O,P)=>O*u+v*S[P]*Math.sin(r.distance)/M);m(Math.atan2(T[1],T[0]),Math.atan2(T[2],Math.hypot(T[0],T[1])))}}if(!Number.isFinite(h))throw new Error("CRS coverage does not intersect the rendering domain");return{value:h,point:d}}function ht(e,t,r){return[Gs(e,t,r,!1).value,Gs(e,t,r).value]}function ks(e,t,r,n,i){let o=ht(e,n,i),s=ht(t,n,i).map(c=>c+r);if(s[0]<=0)throw new Error("Projection rendering denominator is not positive");let a=o.flatMap(c=>s.map(l=>c/l));return[!1,!0].map(c=>{let l=Math.min(...a),u=Math.max(...a);for(let h=0;h<60;h++){let d=(l+u)/2,m=e.map((y,b)=>y-d*t[b]);Gs(m,n,i,c).value-d*r>0?l=d:u=d}return c?u:l})}var Ny,fc=p(()=>{qt();Ny=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]});function fz(e,t,r,n=Math.PI){let i=[-180,-90,180,90],o=(s,a)=>{let c=Ls(s,e.primeMeridian,e.long0),l=Q(c[0][0]-e.long0,c[0][1],c[1][0]-e.long0,c[1][1]),u=[Math.cos(e.lat0),0,Math.sin(e.lat0)],h=a?Gs(u,l,void 0,!1).value:-1,m=!a||h<=Math.cos(n)+1e-13?{latitude:e.lat0,distance:t}:void 0,g=cr(()=>r(l,m),s,e.long0,e.primeMeridian),y=Math.abs(Math.cos(e.lat0))<1e-12,b=(Math.PI/2-t)*180/Math.PI,w=m&&!y&&Os(S=>{let M=Fy(S.x-e.long0,S.y);if(M[0]*Math.cos(e.lat0)+M[2]*Math.sin(e.lat0)>=Math.cos(m.distance)-1e-14)return;if(Math.hypot(M[0]+u[0],M[1],M[2]+u[2])<1e-12){let T=e.lat0+m.distance,O=(l[0][0]+l[1][0])/2,P=O+Kt((Math.cos(T)<0?Math.PI:0)-O),_=Math.atan2(Math.sin(T),Math.abs(Math.cos(T)));if(P>=l[0][0]&&P<=l[1][0]&&_>=l[0][1]&&_<=l[1][1]){S.x=P+e.long0,S.y=_;return}}let v=Gs(M,l,m);[S.x,S.y]=[v.point[0]+e.long0,v.point[1]]},e.primeMeridian);return{get bounds(){return r(l,m)},normalize(S){g.normalize(S),m&&y?S.y=e.lat0>0?Math.max(b,S.y):Math.min(-b,S.y):w==null||w(S);let M=(e.long0+e.primeMeridian)*180/Math.PI,v=S.x-M;Math.abs(v)>180&&(S.x=M+Pi(v))}}};return s=>o(s??i,!!s)}function bn(e,t,r,n,i=Math.PI){return{...e,longitudeOrigin:t.long0,getRenderingProfile:fz(t,r,n,i)}}var Us=p(()=>{Je();lt();fc();qt();sc()});function Lm(e,t,r,n){let i=[-Math.sin(e.lat0),0,Math.cos(e.lat0)],o=[Math.cos(e.lat0),0,Math.sin(e.lat0)],s=[0,1,0],a=n==="stere"?1:0,c=u=>n==="ortho"?ht(u,t,r):ks(u,o,a,t,r),l=e.a*(n==="stere"?2*e.k0:1);return ct(Ce([e.x0,e.x0],Fe(c(s),l)),Ce([e.y0,e.y0],Fe(c(i),l)))}function w8(e,t,r){let n=Math.sin(e.lat0),i=Math.cos(e.lat0),o=ht([0,0,1],t,r);if(Math.abs(n)<1e-15&&(!r||Math.abs(r.distance-Math.PI/2)<1e-15)){let h=m=>{let g=Gs([0,1,0],t,r,m);return g.value/Math.sqrt(1-e.es*Math.sin(g.point[1])**2)},d=m=>(1-e.es)*m/Math.sqrt(1-e.es*m*m);return ct(Ce([e.x0,e.x0],Fe([h(!1),h(!0)],e.a*e.k0)),Ce([e.y0,e.y0],Fe([d(o[0]),d(o[1])],e.a*e.k0)))}let s=o[0]<=0&&o[1]>=0?0:Math.min(o[0]**2,o[1]**2),a=Math.max(o[0]**2,o[1]**2),c=hi(1/Math.sqrt(1-e.es*s),1/Math.sqrt(1-e.es*a)),l=e.a*e.k0,u=e.es*n*i/Math.sqrt(1-e.es*n*n);return ct(Ce([e.x0,e.x0],Fe(Lt(ht([0,1,0],t,r),c),l)),Ce([e.y0+l*u,e.y0+l*u],Fe(Lt(ht([-n,0,(1-e.es)*i],t,r),c),l)))}function x8(e,t,r){let n=ht([Math.cos(e.lat0),0,Math.sin(e.lat0)],t,r)[0],i=e.a/Math.sqrt(1-e.es)*Math.acos(Math.max(-1,Math.min(1,n)));return ct([e.x0-i,e.x0+i],[e.y0-i,e.y0+i])}function _8(e,t,r,n,i,o,s){let a=i&&ht([0,0,1],n,i),c=Q(n[0][0],s(a?Math.asin(Math.max(-1,a[0])):n[0][1]),n[1][0],s(a?Math.asin(Math.min(1,a[1])):n[1][1])),l=i&&{latitude:o,distance:Math.PI-(1-e.es)**2*(Math.PI-i.distance)},u=[Math.cos(o),0,Math.sin(o)],h=[-Math.sin(o),0,Math.cos(o)],d=ht(u,c,l),m=[Math.sqrt(2/(1+Math.min(1,d[1]))),d[0]>-1+1e-14?Math.sqrt(2/(1+d[0])):1/0],g=(y,b)=>{let w=ht(y,c,l),S=w[0]===0?0:w[0]*(w[0]<0?m[1]:m[0]),M=w[1]===0?0:w[1]*(w[1]>0?m[1]:m[0]);return Fe([Math.max(-2,S),Math.min(2,M)],e.a*b)};return ct(Ce([e.x0,e.x0],g([0,1,0],t)),Ce([e.y0,e.y0],g(h,r)))}function Om(e,t,r,n,i,o,s=1,a=e.e*Math.atanh(e.e)){let c=Q(i[0][0]*s,t(i[0][1]),i[1][0]*s,t(i[1][1])),l=2*a+Math.PI*Math.abs(s-1),u=o&&s===1?Math.min(o.distance+l,Math.PI-(1-e.es)*(Math.PI-o.distance)):o&&o.distance+l,h=u&&u<Math.PI?{latitude:r,distance:u}:void 0,d=[Math.cos(r),0,Math.sin(r)],m=[-Math.sin(r),0,Math.cos(r)],y=c[1][0]-c[0][0]>=2*Math.PI?Q(-Math.PI,c[0][1],Math.PI,c[1][1]):c,b=ks([0,1,0],d,1,y,h),w=ks(m,d,1,y,h);return ct(Ce([e.x0,e.x0],Fe(b,n)),Ce([e.y0,e.y0],Fe(w,n)))}function S8(e,t,r,n,i,o){let s=[Math.cos(e.lat0),0,Math.sin(e.lat0)],a=[-Math.sin(e.lat0),0,Math.cos(e.lat0)],c=[0,1,0],l=Math.cos(n),u=Math.sin(n),h=Math.cos(r),d=Math.sin(r),m=a.map((S,M)=>l*S+u*c[M]),g=c.map((S,M)=>l*S-u*a[M]),y=s.map((S,M)=>-h*S+d*m[M]),b=ks(g,y,h*t,i,o),w=ks(m,y,h*t,i,o);return ct(Ce([e.x0,e.x0],Fe(b,e.a*(t-1)*h)),Ce([e.y0,e.y0],Fe(w,e.a*(t-1))))}function M8(e,t,r){let n=ht([Math.cos(e.lat0),0,Math.sin(e.lat0)],t,r)[0],i=Math.acos(Math.max(-1,Math.min(1,n))),o=1-e.es,s=e.a*i/Math.sqrt(o),a=Math.cos(i/o);if(!(a>0))throw new Error("Gnomonic rendering coverage approaches its ellipsoidal horizon");let c=s/a;return ct([e.x0-c,e.x0+c],[e.y0-c,e.y0+c])}var js=p(()=>{Je();fc();Ot()});function Oi(e,t,r,n,i,o,s){let a=i*r/s,c=n*t-o*r*e/s,l=n*e+o*r*t/s;return Math.atan2(l,Math.hypot(a,c))}var Of=p(()=>{});function wn(e,t,r){var n=e*t;return r/Math.sqrt(1-n*n)}var Kl=p(()=>{});function Jr(e,t,r){let n=Math.cos(t);return Math.exp(e*Math.atanh(e*r))*(r>0?n/(1+r):(1-r)/n)}var Bf=p(()=>{});function hc(e,t){for(var r=.5*e,n,i,o=F-2*Math.atan(t),s=0;s<=15;s++)if(n=e*Math.sin(o),i=F-2*Math.atan(t*Math.pow((1-n)/(1+n),r))-o,o+=i,Math.abs(i)<=1e-10)return o;return-9999}var Bm=p(()=>{Bt()});function v8(e,t,r){return t*=r,Math.tan(.5*(F+e))*Math.pow((1-t)/(1+t),.5*r)}function hz(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0,e.coslat0=Math.cos(e.lat0),e.sinlat0=Math.sin(e.lat0),e.sphere?!Number.isNaN(e.lat_ts)&&Math.abs(e.coslat0)<=1e-10&&(e.k0=.5*(1+Fs(e.lat0)*Math.sin(e.lat_ts))):(Math.abs(e.coslat0)<=1e-10&&(e.lat0>0?e.con=1:e.con=-1),e.cons=Math.sqrt(Math.pow(1+e.e,1+e.e)*Math.pow(1-e.e,1-e.e)),!Number.isNaN(e.lat_ts)&&Math.abs(e.coslat0)<=1e-10&&Math.abs(Math.cos(e.lat_ts))>1e-10&&(e.k0=.5*e.cons*wn(e.e,Math.sin(e.lat_ts),Math.cos(e.lat_ts))/Jr(e.e,e.con*e.lat_ts,e.con*Math.sin(e.lat_ts))),e.ms1=wn(e.e,e.sinlat0,e.coslat0),e.X0=2*Math.atan(v8(e.lat0,e.sinlat0,e.e))-F,e.cosX0=Math.cos(e.X0),e.sinX0=Math.sin(e.X0))}function E8(e,t){var r=t.x,n=t.y,i=Math.sin(n),o=Math.cos(n),s,a,c,l,u,h,d=k(r-e.long0,e.over);if(Math.abs(Math.abs(r-e.long0)-Math.PI)<=1e-10&&Math.abs(n+e.lat0)<=1e-10)return t.x=NaN,t.y=NaN,t;if(e.sphere&&Math.abs(e.coslat0)<=1e-10){let m=e.lat0>0?1:-1,g=2*e.a*e.k0*Math.tan(Math.PI/4-m*n/2);return t.x=e.x0+g*Math.sin(d),t.y=e.y0-m*g*Math.cos(d),t}return e.sphere?(s=2*e.k0/(1+e.sinlat0*i+e.coslat0*o*Math.cos(d)),t.x=e.a*s*o*Math.sin(d)+e.x0,t.y=e.a*s*(e.coslat0*i-e.sinlat0*o*Math.cos(d))+e.y0,t):(a=2*Math.atan(v8(n,i,e.e))-F,l=Math.cos(a),c=Math.sin(a),Math.abs(e.coslat0)<=1e-10?(u=Jr(e.e,n*e.con,e.con*i),h=2*e.a*e.k0*u/e.cons,t.x=e.x0+h*Math.sin(r-e.long0),t.y=e.y0-e.con*h*Math.cos(r-e.long0),t):(Math.abs(e.sinlat0)<1e-10?(s=2*e.a*e.k0/(1+l*Math.cos(d)),t.y=s*c+e.y0):(s=2*e.a*e.k0*e.ms1/(e.cosX0*(1+e.sinX0*c+e.cosX0*l*Math.cos(d))),t.y=s*(e.cosX0*c-e.sinX0*l*Math.cos(d))+e.y0),t.x=s*l*Math.sin(d)+e.x0,t))}function A8(e,t){t.x-=e.x0,t.y-=e.y0;var r,n,i,o,s,a=Math.sqrt(t.x*t.x+t.y*t.y);if(e.sphere){var c=2*Math.atan(a/(2*e.a*e.k0));return r=e.long0,n=e.lat0,a<=1e-10?(t.x=r,t.y=n,t):(n=Oi(e.sinlat0,e.coslat0,Math.sin(c),Math.cos(c),t.x,t.y,a),Math.abs(e.coslat0)<1e-10?e.lat0>0?r=k(e.long0+Math.atan2(t.x,-1*t.y),e.over):r=k(e.long0+Math.atan2(t.x,t.y),e.over):r=k(e.long0+Math.atan2(t.x*Math.sin(c),a*e.coslat0*Math.cos(c)-t.y*e.sinlat0*Math.sin(c)),e.over),t.x=r,t.y=n,t)}else if(Math.abs(e.coslat0)<=1e-10){if(a<=1e-10)return n=e.lat0,r=e.long0,t.x=r,t.y=n,t;t.x*=e.con,t.y*=e.con,i=a*e.cons/(2*e.a*e.k0),n=e.con*hc(e.e,i),r=e.con*k(e.con*e.long0+Math.atan2(t.x,-1*t.y),e.over)}else o=2*Math.atan(a*e.cosX0/(2*e.a*e.k0*e.ms1)),r=e.long0,a<=1e-10?s=e.X0:(s=Oi(e.sinX0,e.cosX0,Math.sin(o),Math.cos(o),t.x,t.y,a),r=k(e.long0+Math.atan2(t.x*Math.sin(o),a*e.cosX0*Math.cos(o)-t.y*e.sinX0*Math.sin(o)),e.over)),n=-1*hc(e.e,Math.tan(.5*(F+s)));return t.x=r,t.y=n,t}function T8(e){let t={...e,coslat0:0,sinlat0:0,con:0,cons:0,ms1:0,X0:0,cosX0:0,sinX0:0};return hz(t),t}var I8=p(()=>{Of();Bt();Lf();Kl();Bf();Bm();xt()});var Gy,P8=p(()=>{Us();js();Fn();I8();Gy={name:"stere",aliases:["Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],parameters:[...vr,...Vo,"lat_ts"],create(e){let t=br(e),r=T8(t),n=Ds(t,lr("stere",r,E8,A8));return bn(n,t,150*Math.PI/180,(i,o)=>r.sphere?Lm(r,i,o,"stere"):Om(r,s=>2*Math.atan(Math.tan(Math.PI/4+s/2)*Math.pow((1-r.e*Math.sin(s))/(1+r.e*Math.sin(s)),r.e/2))-Math.PI/2,r.X0,2*r.a*r.k0*(Math.abs(r.coslat0)<1e-10?1/r.cons:r.ms1/r.cosX0),i,o))}}});var Cf=p(()=>{k4();q4();V4()});var zs=p(()=>{"use strict";fv();hv();mv();pv();Og();Og();kv()});function R8(e){return!gz(e,"ftyp",4)||(e[8]&96)===0?null:dz(e)}function dz(e){switch(mz(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function mz(e,t,r){return String.fromCharCode(...e.slice(t,r))}function pz(e){return[...e].map(t=>t.charCodeAt(0))}function gz(e,t,r=0){let n=pz(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var L8=p(()=>{"use strict"});function Cm(e){let t=Nf(e);return bz(t)||_z(t)||wz(t)||xz(t)||yz(t)}function yz(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=R8(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function bz(e){let t=Nf(e);return t.byteLength>=33&&t.getUint32(0,Gn)===2303741511&&t.getUint32(4,Gn)===218765834&&t.getUint32(8,Gn)===13&&t.getUint32(12,Gn)===1229472850?{mimeType:"image/png",width:t.getUint32(16,Gn),height:t.getUint32(20,Gn)}:null}function wz(e){let t=Nf(e);return t.byteLength>=10&&t.getUint32(0,Gn)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,Df),height:t.getUint16(8,Df)}:null}function xz(e){let t=Nf(e);return t.byteLength>=14&&t.getUint16(0,Gn)===16973&&t.getUint32(2,Df)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,Df),height:t.getUint32(22,Df)}:null}function _z(e){let t=Nf(e);if(!(t.byteLength>=3&&t.getUint16(0,Gn)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=Sz(),o=2;for(;o+9<t.byteLength;){let s=t.getUint16(o,Gn);if(i.has(s))return{mimeType:"image/jpeg",height:t.getUint16(o+5,Gn),width:t.getUint16(o+7,Gn)};if(!n.has(s))return null;o+=2,o+=t.getUint16(o,Gn)}return null}function Sz(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Nf(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")}var Gn,Df,ky=p(()=>{"use strict";L8();Gn=!1,Df=!0});var Mz,vz,Ez,O8,B8=p(()=>{"use strict";ky();Mz=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],vz=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Ez={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:vz,extensions:Mz,tests:[e=>!!Cm(new DataView(e))]},O8={...Ez,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var Xl,Dm=p(()=>{"use strict";Xl="5.0.0-beta.2"});function Yl(e){if(!e)return!1;if(Az.test(e))return!0;for(let t=e.indexOf(".svg");t>=0;t=e.indexOf(".svg",t+4)){let r=e[t+4];if(r===void 0||r==="?"||r==="#")return!0}return!1}function C8(e,t){if(Yl(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Uy(e,t)}function Uy(e,t){if(Yl(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}var Az,Nm=p(()=>{"use strict";Az=/^data:image\/svg\+xml/});async function D8(e,t,r){let n=C8(e,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await Tz(o||n,t)}finally{o&&i.revokeObjectURL(o)}}async function Tz(e,t){var n;let r=new Image;return r.src=e,(n=t==null?void 0:t.image)!=null&&n.decode&&r.decode?(await r.decode(),r):await new Promise((i,o)=>{try{r.onload=()=>i(r),r.onerror=s=>{let a=s instanceof Error?s.message:"error";o(new Error(a))}}catch(s){o(s)}})}var N8=p(()=>{"use strict";Nm()});async function G8(e,t,r){let n;Yl(r)?n=await D8(e,t,r):n=Uy(e,r);let i=t&&t.imagebitmap;return await U8(n,i)}async function k8(e,t){let r=t&&t.imagebitmap;return await U8(e,r)}async function U8(e,t=null){if((Iz(t)||!F8)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),F8=!1}return await createImageBitmap(e)}function Iz(e){if(!e)return!0;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}var F8,j8=p(()=>{"use strict";Nm();N8();F8=!0});async function z8(e,t){var s,a;let{mimeType:r}=Cm(e)||{},n=(s=globalThis.loaders)==null?void 0:s.parseImageNode;Il(n);let i=(a=globalThis.loaders)==null?void 0:a.createImageBitmapNode;if(!i)throw new Error("Install '@loaders.gl/core/polyfills' to parse images under Node.js");let o=await n(e,r);return i(o)}var q8=p(()=>{"use strict";zs();ky()});async function jy(e,t,r){var i;t=t||{},H8(t);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!$d||n)return await z8(e,t);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(V8);return await G8(e,t,r==null?void 0:r.url)}async function W8(e,t,r){var i;t=t||{},H8(t);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!$d||n||Yl(r==null?void 0:r.url)||e.type.startsWith("image/svg+xml"))return await jy(await e.arrayBuffer(),t,r);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(V8);return await k8(e,t)}function H8(e){var r;let t=(r=e.image)==null?void 0:r.type;if(t&&t!=="imagebitmap")throw new Error(Pz)}var Pz,V8,$8=p(()=>{"use strict";zs();j8();Nm();q8();Pz="@loaders.gl/images: ImageLoader only accepts options.image.type='imagebitmap'. Remove legacy image/data/auto values and call getImageData(image) if you need raw pixels.",V8="@loaders.gl/images: ImageLoader requires browser ImageBitmap support. Use a browser with createImageBitmap support or load images under Node.js with @loaders.gl/core/polyfills."});var K8={};ir(K8,{ImageLoaderWithParser:()=>Lz});var Rie,Rz,Lz,X8=p(()=>{"use strict";$8();zy();({preload:Rie,...Rz}=Wo),Lz={...Rz,parse:jy,parseBlob:W8}});async function Bz(){let{ImageLoaderWithParser:e}=await Promise.resolve().then(()=>(X8(),K8));return e}var Oz,Wo,zy=p(()=>{"use strict";Dm();B8();Oz={image:{}};Wo={dataType:null,batchType:null,...O8,version:Xl,options:Oz,preload:Bz}});function Z8(e){let t=Fz(e);if(!t)throw new Error("Not an image");return t}function Fm(e){switch(Z8(e)){case"data":return e;case"imagebitmap":return Cz(e)?Dz(e):Y8(e);case"image":return Y8(e);default:throw new Error("getImageData")}}function Cz(e){var r;let t=(r=globalThis.loaders)==null?void 0:r.isImageBitmapNode;return!!(t!=null&&t(e))}function Dz(e){var r;let t=(r=globalThis.loaders)==null?void 0:r.getImageBitmapDataNode;if(!t)throw new Error("getImageData");return t(e)}function Y8(e){let t=Nz(e.width,e.height),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height)}function Nz(e,t){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(e,t);if(typeof document<"u"){let r=document.createElement("canvas");return r.width=e,r.height=t,r}throw new Error("getImageData")}function Fz(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 J8=p(()=>{"use strict"});var Q8,eA,qy=p(()=>{"use strict";Q8={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]},eA={name:"Texture Containers",id:"compressed-texture",module:"images",encoding:"image",format:"compressed-texture",extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0}});function rA(e){if(!Gm){e=e||kz()||void 0,Gm=new Set;for(let t of Gz)for(let r in tA)if(e&&e.getExtension(`${t}${r}`))for(let n of tA[r])Gm.add(n)}return Gm}function kz(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var Gz,tA,Gm,nA=p(()=>{"use strict";Gz=["","WEBKIT_","MOZ_"],tA={WEBGL_compressed_texture_s3tc:["bc1-rgb-unorm-webgl","bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"],WEBGL_compressed_texture_s3tc_srgb:["bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"],EXT_texture_compression_rgtc:["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"],EXT_texture_compression_bptc:["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"],WEBGL_compressed_texture_etc1:["etc1-rgb-unorm-webgl"],WEBGL_compressed_texture_etc:["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"],WEBGL_compressed_texture_pvrtc:["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"],WEBGL_compressed_texture_atc:["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"],WEBGL_compressed_texture_astc:["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]},Gm=null});function oA(e=rA(),t,r={}){let n=new Set(e);if(!t)return jz(n);if(t.isHDR){let i=iA(t);return r.astcHDR&&(i==="astc-4x4"||i==="astc-6x6")&&km(n,i.slice(5))?i==="astc-4x4"?"astc-hdr-4x4":"astc-hdr-6x6":n.has("bc6h-rgb-ufloat")?"bc6h":"rgba16f"}if(t.codec==="xubc7")return Wy(n)?"bc7":"rgba32";if(t.codec.startsWith("xuastc-ldr-")||t.codec.startsWith("astc-ldr-")){let i=iA(t);return i&&km(n,i.slice(5))?i:Vy(n,t,["bc7","bc","etc2","atc"])}return t.codec==="uastc-ldr-4x4"?km(n,"4x4")?"astc-4x4":Vy(n,t,["bc7","bc","etc2","etc1","pvrtc","atc"]):Vy(n,t,["etc2","etc1","bc7","bc","pvrtc","atc"])}function jz(e){return km(e,"4x4")?"astc-4x4":Wy(e)?"bc7":sA(e)?{alpha:"bc3",noAlpha:"bc1"}:aA(e)?"etc2":e.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:cA(e)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:lA(e)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function Vy(e,t,r){for(let n of r)switch(n){case"bc7":if(Wy(e))return"bc7";break;case"bc":if(sA(e))return t.hasAlpha?"bc3":"bc1";break;case"etc2":if(aA(e))return"etc2";break;case"etc1":if(!t.hasAlpha&&e.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(cA(e))return t.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(lA(e))return t.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return t.hasAlpha?"rgba32":"rgb565"}function iA(e){let t=`${e.blockWidth}x${e.blockHeight}`;return Uz.includes(t)?`astc-${t}`:null}function km(e,t){return Zl(e,[`astc-${t}-unorm`,`astc-${t}-unorm-srgb`])}function Wy(e){return Zl(e,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function sA(e){return Zl(e,["bc1-rgb-unorm-webgl","bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb"])}function aA(e){return Zl(e,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function cA(e){return Zl(e,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function lA(e){return Zl(e,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function Zl(e,t){return t.some(r=>e.has(r))}var Uz,uA=p(()=>{"use strict";nA();Uz=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function dA(e){Rg(e.modules);let t=Lg("basis");return t||(hA||=zz(e),await hA)}async function zz(e){let t=null,r=null;return[t,r]=await Promise.all([await Ol(fA.TRANSCODER,"images",e,null,"basis_transcoder.mjs"),await Ol(fA.TRANSCODER_WASM,"images",e)]),t=t||globalThis.BASIS,await qz(t,r)}function qz(e,t){let r={};return t&&(r.wasmBinary=t),Pl(()=>e(r),n=>{let{BasisFile:i,KTX2File:o,getBasisTexFormatBlockHeight:s,getBasisTexFormatBlockWidth:a,initializeBasis:c,isFormatSupported:l}=n;return c(),{BasisFile:i,KTX2File:o,getBasisTexFormatBlockHeight:s,getBasisTexFormatBlockWidth:a,isFormatSupported:l}})}var fA,hA,mA=p(()=>{"use strict";zs();rc();fA={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function zm(e){if(e!==void 0)return UA[e]}function jA(e){if(e!==void 0)return aq[e]}var UA,aq,i2=p(()=>{"use strict";UA={34836:"rgba32float",33776:"bc1-rgb-unorm-webgl",35916:"bc1-rgb-unorm-srgb-webgl",33777:"bc1-rgba-unorm",35917:"bc1-rgba-unorm-srgb",33778:"bc2-rgba-unorm",35918:"bc2-rgba-unorm-srgb",33779:"bc3-rgba-unorm",35919:"bc3-rgba-unorm-srgb",36283:"bc4-r-unorm",36284:"bc4-r-snorm",36285:"bc5-rg-unorm",36286:"bc5-rg-snorm",37492:"etc2-rgb8unorm",37494:"etc2-rgb8unorm-srgb",37496:"etc2-rgb8a1unorm",37497:"etc2-rgb8a1unorm-srgb",37493:"etc2-rgba8unorm",37495:"etc2-rgba8unorm-srgb",37488:"eac-r11unorm",37489:"eac-r11snorm",37490:"eac-rg11unorm",37491:"eac-rg11snorm",37808:"astc-4x4-unorm",37840:"astc-4x4-unorm-srgb",37809:"astc-5x4-unorm",37841:"astc-5x4-unorm-srgb",37810:"astc-5x5-unorm",37842:"astc-5x5-unorm-srgb",37811:"astc-6x5-unorm",37843:"astc-6x5-unorm-srgb",37812:"astc-6x6-unorm",37844:"astc-6x6-unorm-srgb",37813:"astc-8x5-unorm",37845:"astc-8x5-unorm-srgb",37814:"astc-8x6-unorm",37846:"astc-8x6-unorm-srgb",37815:"astc-8x8-unorm",37847:"astc-8x8-unorm-srgb",37816:"astc-10x5-unorm",37848:"astc-10x5-unorm-srgb",37817:"astc-10x6-unorm",37849:"astc-10x6-unorm-srgb",37818:"astc-10x8-unorm",37850:"astc-10x8-unorm-srgb",37819:"astc-10x10-unorm",37851:"astc-10x10-unorm-srgb",37820:"astc-12x10-unorm",37852:"astc-12x10-unorm-srgb",37821:"astc-12x12-unorm",37853:"astc-12x12-unorm-srgb",35840:"pvrtc-rgb4unorm-webgl",35842:"pvrtc-rgba4unorm-webgl",35841:"pvrtc-rgb2unorm-webgl",35843:"pvrtc-rgba2unorm-webgl",36196:"etc1-rgb-unorm-webgl",35986:"atc-rgb-unorm-webgl",35987:"atc-rgba-unorm-webgl",34798:"atc-rgbai-unorm-webgl"},aq=Object.fromEntries(Object.entries(UA).map(([e,t])=>[t,Number(e)]))});function Jl(e,t){let r=new Array(t.mipMapLevels),n=t.textureFormat||zm(t.internalFormat),i=t.internalFormat||jA(t.textureFormat),o=t.width,s=t.height,a=0;for(let c=0;c<t.mipMapLevels;++c){let l=lq(t,o,s,e,c),h={shape:"texture-level",compressed:!0,data:cq(e,c,a,l),width:o,height:s,levelSize:l};i!==void 0&&(h.format=i),n&&(h.textureFormat=n),r[c]=h,o=Math.max(1,o>>1),s=Math.max(1,s>>1),a+=l}return r}function cq(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function lq(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var qm=p(()=>{"use strict";i2()});function fq(e){return uq[e]}function zA(e){return zm(fq(e))}var uq,qA=p(()=>{"use strict";i2();uq={131:33776,132:35916,133:33777,134:35917,135:33778,136:35918,137:33779,138:35919,139:36283,140:36284,141:36285,142:36286,147:37492,148:37494,149:37496,150:37497,151:37493,152:37495,153:37488,154:37489,155:37490,156:37491,157:37808,158:37840,159:37809,160:37841,161:37810,162:37842,163:37811,164:37843,165:37812,166:37844,167:37813,168:37845,169:37814,170:37846,171:37815,172:37847,173:37816,174:37848,175:37817,176:37849,177:37818,178:37850,179:37819,180:37851,181:37820,182:37852,183:37821,184:37853,1000054e3:35843,1000054001:35842,1000066e3:37808,1000066001:37809,1000066002:37810,1000066003:37811,1000066004:37812,1000066005:37813,1000066006:37814,1000066007:37815,1000066008:37816,1000066009:37817,1000066010:37818,1000066011:37819,1000066012:37820,1000066013:37821}});function qs(e){if(e.byteLength<o2.byteLength)return!1;let t=new Uint8Array(e,0,o2.byteLength);return o2.every((r,n)=>t[n]===r)}function WA(e){let t=l2(e);if(t.pixelDepth>0)throw new Error("CompressedTextureLoader does not support 3D KTX2 textures");if(t.supercompressionScheme!==hq)throw new Error(`KTX2 supercompression scheme ${t.supercompressionScheme} requires BasisLoader`);if(t.vkFormat===0)throw new Error("KTX2 vkFormat is undefined; decode this texture with BasisLoader");let r=zA(t.vkFormat);if(!r)throw new Error(`Unsupported KTX2 Vulkan format ${t.vkFormat}`);return Jl(t.levels,{mipMapLevels:t.levelCount,width:t.pixelWidth,height:Math.max(1,t.pixelHeight),sizeFunction:n=>n.uncompressedByteLength,textureFormat:r})}function l2(e){if(!qs(e))throw new Error("Invalid KTX2 identifier");if(e.byteLength<s2)throw new Error("Truncated KTX2 header");let t=new DataView(e),r=Math.max(1,t.getUint32(40,!0)),n=dq(r,VA,"KTX2 level index");c2(s2,n,e.byteLength,"KTX2 level index");let i={vkFormat:t.getUint32(12,!0),pixelWidth:t.getUint32(20,!0),pixelHeight:t.getUint32(24,!0),pixelDepth:t.getUint32(28,!0),layerCount:t.getUint32(32,!0),faceCount:t.getUint32(36,!0),levelCount:r,supercompressionScheme:t.getUint32(44,!0),levels:[]};if(i.pixelWidth===0)throw new Error("KTX2 texture width must be non-zero");if(i.faceCount!==1&&i.faceCount!==6)throw new Error(`Invalid KTX2 face count ${i.faceCount}`);a2(t.getUint32(48,!0),t.getUint32(52,!0),e.byteLength,"KTX2 data format descriptor"),a2(t.getUint32(56,!0),t.getUint32(60,!0),e.byteLength,"KTX2 key/value data"),a2(Ff(t,64,"KTX2 supercompression global data offset"),Ff(t,72,"KTX2 supercompression global data length"),e.byteLength,"KTX2 supercompression global data");for(let o=0;o<r;o++){let s=s2+o*VA,a=Ff(t,s,`KTX2 level ${o} offset`),c=Ff(t,s+8,`KTX2 level ${o} length`),l=Ff(t,s+16,`KTX2 level ${o} uncompressed length`);c2(a,c,e.byteLength,`KTX2 level ${o}`),i.levels.push({levelData:new Uint8Array(e,a,c),uncompressedByteLength:l})}return i}function Ff(e,t,r){let n=e.getUint32(t,!0),o=e.getUint32(t+4,!0)*4294967296+n;if(!Number.isSafeInteger(o))throw new Error(`${r} exceeds JavaScript's safe integer range`);return o}function dq(e,t,r){let n=e*t;if(!Number.isSafeInteger(n))throw new Error(`${r} size exceeds JavaScript's safe integer range`);return n}function a2(e,t,r,n){t>0&&c2(e,t,r,n)}function c2(e,t,r,n){if(!Number.isSafeInteger(e)||!Number.isSafeInteger(t)||e<0||t<0)throw new Error(`${n} has an invalid byte range`);let i=e+t;if(!Number.isSafeInteger(i)||i>r)throw new Error(`${n} is outside the KTX2 container`)}var o2,s2,VA,hq,Vm=p(()=>{"use strict";qm();qA();o2=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10]),s2=80,VA=24,hq=0});async function pq(e){let t=HA,r;HA=new Promise(n=>{r=n}),await t;try{return await e()}finally{r()}}async function Wm(e,t={}){return await pq(async()=>{var o;let r=await dA(tc(t)),n=((o=t.basis)==null?void 0:o.containerFormat)||"auto";if(n==="ktx2"||n==="auto"&&qs(e)){if(!r.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return yq(r,e,t)}return gq(r,e,t)})}function gq(e,t,r){let n=new e.BasisFile(new Uint8Array(t));try{let i=XA(n,!1);if(!n.startTranscoding())throw new Error("Failed to start Basis transcoding");let o=[];for(let s=0;s<n.getNumImages();s++){let a=[];for(let c=0;c<n.getNumLevels(s);c++){let l=n.getImageWidth(s,c),u=n.getImageHeight(s,c);a.push(KA(n,i,l,u,r,h=>n.getImageTranscodedSizeInBytes(s,c,h),(h,d)=>n.transcodeImage(h,s,c,d,0,0)))}o.push(a)}return o}finally{n.close(),n.delete()}}function yq(e,t,r){let n=new e.KTX2File(new Uint8Array(t));try{if(!n.isValid())throw new Error("Invalid KTX2 texture");if(n.getHeader().pixelDepth>0)throw new Error("BasisLoader does not support 3D KTX2 textures");let o=XA(n,!0);if(!n.startTranscoding())throw new Error("Failed to start KTX2 transcoding");let s=Math.max(1,n.getLayers()),a=Math.max(1,n.getFaces()),c=[];for(let l=0;l<s;l++)for(let u=0;u<a;u++){let h=[];for(let d=0;d<n.getLevels();d++){let m=n.getImageLevelInfo(d,l,u);h.push(KA(n,{...o,hasAlpha:!!m.alphaFlag},m.width,m.height,r,g=>n.getImageTranscodedSizeInBytes(d,l,u,g),(g,y)=>n.transcodeImage(g,d,l,u,y,0,-1,-1)))}c.push(h)}return c}finally{n.close(),n.delete()}}function KA(e,t,r,n,i,o,s){let a=wq(i,t);bq(t,u2(i,t));let c=o(a.basisFormat),l=_q(c,a.dataType);if(!s(l,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${u2(i,t)}`);let u=t.isSRGB&&a.srgbTextureFormat;return{shape:"texture-level",width:r,height:n,data:l,compressed:a.compressed,format:u&&a.srgbFormat||a.format,textureFormat:u?a.srgbTextureFormat:a.textureFormat,levelSize:c,hasAlpha:t.hasAlpha}}function bq(e,t){let r=t==="bc6h"||t==="rgba16f"||t==="rgb9e5"||t.startsWith("astc-hdr-");if(e.isHDR!==r)throw new Error(`Basis source codec ${e.codec} cannot be transcoded to ${t}`);if(e.codec==="xubc7"&&t!=="bc7"&&t!=="rgba32")throw new Error(`Basis source codec ${e.codec} cannot be transcoded to ${t}`)}function wq(e,t){let r=u2(e,t),n=$A[r];if(!n)throw new Error(`Unknown Basis format ${r}`);return n}function u2(e,t){var n,i,o;let r=((n=e.basis)==null?void 0:n.format)||"auto";return r==="auto"&&(r=oA((i=e.basis)==null?void 0:i.supportedTextureFormats,t,(o=e.basis)==null?void 0:o.supportedTextureFeatures)),typeof r=="object"&&(r=t.hasAlpha?r.alpha:r.noAlpha),r.toLowerCase()}function XA(e,t){let r=e.getBasisTexFormat(),n=xq[r];if(!n)throw new Error(`Unsupported Basis source texture format ${r}`);return{codec:n,isHDR:!!e.isHDR(),isSRGB:t?!!e.isSRGB():!1,hasAlpha:!!e.getHasAlpha(),blockWidth:e.getBlockWidth(),blockHeight:e.getBlockHeight()}}function _q(e,t){return t==="uint16"?new Uint16Array(e/Uint16Array.BYTES_PER_ELEMENT):t==="uint32"?new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function Er(e,t,r){return{basisFormat:e,compressed:!0,format:t,textureFormat:r}}function Ql(e,t,r,n,i){return{basisFormat:e,compressed:!1,format:t,textureFormat:r,srgbFormat:n,srgbTextureFormat:i}}function _n(e,t,r,n){return{...Er(e,t,`astc-${n}-unorm`),srgbFormat:r,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var xn,$A,hoe,HA,xq,f2=p(()=>{"use strict";rc();uA();mA();Vm();xn={"4x4":_n(10,37808,37840,"4x4"),"5x4":_n(28,37809,37841,"5x4"),"5x5":_n(29,37810,37842,"5x5"),"6x5":_n(30,37811,37843,"6x5"),"6x6":_n(31,37812,37844,"6x6"),"8x5":_n(32,37813,37845,"8x5"),"8x6":_n(33,37814,37846,"8x6"),"8x8":_n(36,37815,37847,"8x8"),"10x5":_n(34,37816,37848,"10x5"),"10x6":_n(35,37817,37849,"10x6"),"10x8":_n(37,37818,37850,"10x8"),"10x10":_n(38,37819,37851,"10x10"),"12x10":_n(39,37820,37852,"12x10"),"12x12":_n(40,37821,37853,"12x12")},$A={etc1:Er(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...Er(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...Er(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...Er(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:Er(4,36283,"bc4-r-unorm"),bc5:Er(5,36285,"bc5-rg-unorm"),bc7:{...Er(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":Er(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":Er(9,35842,"pvrtc-rgba4unorm-webgl"),"astc-4x4":xn["4x4"],"astc-5x4":xn["5x4"],"astc-5x5":xn["5x5"],"astc-6x5":xn["6x5"],"astc-6x6":xn["6x6"],"astc-8x5":xn["8x5"],"astc-8x6":xn["8x6"],"astc-8x8":xn["8x8"],"astc-10x5":xn["10x5"],"astc-10x6":xn["10x6"],"astc-10x8":xn["10x8"],"astc-10x10":xn["10x10"],"astc-12x10":xn["12x10"],"astc-12x12":xn["12x12"],"atc-rgb":Er(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":Er(12,34798,"atc-rgbai-unorm-webgl"),rgba32:Ql(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:Ql(14,36194,"rgb565unorm-webgl"),bgr565:Ql(15,36194,"rgb565unorm-webgl"),rgba4444:Ql(16,32854,"rgba4unorm-webgl"),"eac-r11":Er(20,37488,"eac-r11unorm"),"eac-rg11":Er(21,37490,"eac-rg11unorm"),bc6h:Er(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":Er(23,37808,"astc-4x4-unorm"),rgba16f:{...Ql(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...Ql(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":Er(27,37812,"astc-6x6-unorm")},hoe=Object.freeze(Object.keys($A)),HA=Promise.resolve();xq={0:"etc1s",1:"uastc-ldr-4x4",2:"uastc-hdr-4x4",3:"astc-hdr-6x6",4:"uastc-hdr-6x6",5:"xuastc-ldr-4x4",6:"xuastc-ldr-5x4",7:"xuastc-ldr-5x5",8:"xuastc-ldr-6x5",9:"xuastc-ldr-6x6",10:"xuastc-ldr-8x5",11:"xuastc-ldr-8x6",12:"xuastc-ldr-10x5",13:"xuastc-ldr-10x6",14:"xuastc-ldr-8x8",15:"xuastc-ldr-10x8",16:"xuastc-ldr-10x10",17:"xuastc-ldr-12x10",18:"xuastc-ldr-12x12",19:"astc-ldr-4x4",20:"astc-ldr-5x4",21:"astc-ldr-5x5",22:"astc-ldr-6x5",23:"astc-ldr-6x6",24:"astc-ldr-8x5",25:"astc-ldr-8x6",26:"astc-ldr-10x5",27:"astc-ldr-10x6",28:"astc-ldr-8x8",29:"astc-ldr-10x8",30:"astc-ldr-10x10",31:"astc-ldr-12x10",32:"astc-ldr-12x12",33:"xubc7"}});var YA={};ir(YA,{BasisLoaderWithParser:()=>Eq,BasisWorkerLoaderWithParser:()=>vq});var yoe,Sq,boe,Mq,vq,Eq,ZA=p(()=>{"use strict";f2();Hm();Hm();({preload:yoe,...Sq}=uo),{preload:boe,...Mq}=uo,vq={...Sq},Eq={...Mq,parse:Wm}});async function Aq(){let{BasisLoaderWithParser:e}=await Promise.resolve().then(()=>(ZA(),YA));return e}var uo,Hm=p(()=>{"use strict";qy();Dm();uo={...Q8,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:Xl,worker:!0,workerNode:"basis-worker-node.cjs",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",containerFormat:"auto"}},preload:Aq}});function JA(e){return new Uint32Array(e,0,kn.HEADER_LENGTH)[kn.MAGIC_NUMBER_INDEX]===kn.MAGIC_NUMBER}function QA(e){let t=new Int32Array(e,0,kn.HEADER_LENGTH),r=t[kn.HEADER_PF_FOURCC_INDEX];Il(!!(t[kn.HEADER_PF_FLAGS_INDEX]&kn.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=Oq(r),i=Tq[n],o=Lq[n];Il(i&&o,`DDS: Unknown pixel format ${r}`);let s=1;t[kn.HEADER_FLAGS_INDEX]&kn.DDSD_MIPMAPCOUNT&&(s=Math.max(1,t[kn.MIPMAPCOUNT_INDEX]));let a=t[kn.HEADER_WIDTH_INDEX],c=t[kn.HEADER_HEIGHT_INDEX],l=t[kn.HEADER_SIZE_INDEX]+4,u=new Uint8Array(e,l);return Jl(u,{mipMapLevels:s,width:a,height:c,sizeFunction:o,textureFormat:i})}function eT(e,t){return(e+3>>2)*(t+3>>2)*8}function $m(e,t){return(e+3>>2)*(t+3>>2)*16}function Oq(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var kn,Tq,Iq,Pq,Rq,Lq,tT=p(()=>{"use strict";zs();qm();kn={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},Tq={DXT1:"bc1-rgb-unorm-webgl",DXT3:"bc2-rgba-unorm",DXT5:"bc3-rgba-unorm","ATC ":"atc-rgb-unorm-webgl",ATCA:"atc-rgba-unorm-webgl",ATCI:"atc-rgbai-unorm-webgl"},Iq=eT,Pq=$m,Rq=$m,Lq={DXT1:eT,DXT3:$m,DXT5:$m,"ATC ":Iq,ATCA:Pq,ATCI:Rq}});function iT(e){let r=new Uint32Array(e,0,mi.HEADER_LENGTH)[mi.MAGIC_NUMBER_INDEX];return r===mi.MAGIC_NUMBER||r===mi.MAGIC_NUMBER_EXTRA}function oT(e){let t=new Uint32Array(e,0,mi.HEADER_LENGTH),r=t[mi.PIXEL_FORMAT_INDEX],n=t[mi.COLOUR_SPACE_INDEX],i=Bq[r]||[],o=i.length>1&&n?i[1]:i[0],s=Cq[r],a=t[mi.MIPMAPCOUNT_INDEX],c=t[mi.WIDTH_INDEX],l=t[mi.HEIGHT_INDEX],u=mi.HEADER_SIZE+t[mi.METADATA_SIZE_INDEX],h=new Uint8Array(e,u);return Jl(h,{mipMapLevels:a,width:c,height:l,sizeFunction:s,textureFormat:o})}function rT(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function nT(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function Gf(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function kf(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function Dq(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function Nq(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function Fq(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function Gq(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function kq(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function Uq(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function jq(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function zq(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function qq(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function Vq(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function Wq(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function Hq(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function $q(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}var mi,Bq,Cq,sT=p(()=>{"use strict";qm();mi={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},Bq={0:["pvrtc-rgb2unorm-webgl"],1:["pvrtc-rgba2unorm-webgl"],2:["pvrtc-rgb4unorm-webgl"],3:["pvrtc-rgba4unorm-webgl"],6:["etc1-rgb-unorm-webgl"],7:["bc1-rgb-unorm-webgl"],9:["bc2-rgba-unorm"],11:["bc3-rgba-unorm"],22:["etc2-rgb8unorm"],23:["etc2-rgba8unorm"],24:["etc2-rgb8a1unorm"],25:["eac-r11unorm"],26:["eac-rg11unorm"],27:["astc-4x4-unorm","astc-4x4-unorm-srgb"],28:["astc-5x4-unorm","astc-5x4-unorm-srgb"],29:["astc-5x5-unorm","astc-5x5-unorm-srgb"],30:["astc-6x5-unorm","astc-6x5-unorm-srgb"],31:["astc-6x6-unorm","astc-6x6-unorm-srgb"],32:["astc-8x5-unorm","astc-8x5-unorm-srgb"],33:["astc-8x6-unorm","astc-8x6-unorm-srgb"],34:["astc-8x8-unorm","astc-8x8-unorm-srgb"],35:["astc-10x5-unorm","astc-10x5-unorm-srgb"],36:["astc-10x6-unorm","astc-10x6-unorm-srgb"],37:["astc-10x8-unorm","astc-10x8-unorm-srgb"],38:["astc-10x10-unorm","astc-10x10-unorm-srgb"],39:["astc-12x10-unorm","astc-12x10-unorm-srgb"],40:["astc-12x12-unorm","astc-12x12-unorm-srgb"]},Cq={0:rT,1:rT,2:nT,3:nT,6:Gf,7:Gf,9:kf,11:kf,22:Gf,23:kf,24:Gf,25:Gf,26:kf,27:kf,28:Dq,29:Nq,30:Fq,31:Gq,32:kq,33:Uq,34:jq,35:zq,36:qq,37:Vq,38:Wq,39:Hq,40:$q}});function h2(e){if(qs(e))return WA(e);if(JA(e))return QA(e);if(iT(e))return oT(e);throw new Error("Texture container format not recognized")}var aT=p(()=>{"use strict";Vm();tT();sT()});var cT={};ir(cT,{CompressedTextureLoaderWithParser:()=>Zq,CompressedTextureWorkerLoaderWithParser:()=>Yq});var Noe,Kq,Foe,Xq,Yq,Zq,lT=p(()=>{"use strict";aT();f2();Vm();Km();Km();({preload:Noe,...Kq}=Ho),{preload:Foe,...Xq}=Ho,Yq={...Kq},Zq={...Xq,parse:async(e,t)=>{var r,n;if(t={...t},(r=t==null?void 0:t["compressed-texture"])!=null&&r.useBasis||qs(e)){let i=qs(e)?l2(e):null;return!((n=t==null?void 0:t["compressed-texture"])!=null&&n.useBasis||(i==null?void 0:i.supercompressionScheme)!==0||(i==null?void 0:i.vkFormat)===0)?h2(e):(t.basis={...t.basis,containerFormat:"ktx2"},(await Wm(e,t))[0])}return h2(e)}}});async function Jq(){let{CompressedTextureLoaderWithParser:e}=await Promise.resolve().then(()=>(lT(),cT));return e}var Ho,Km=p(()=>{"use strict";qy();Dm();Ho={...eA,dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"images",version:Xl,worker:!0,encoding:"image",format:"compressed-texture",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":{useBasis:!1},basis:{format:"auto",containerFormat:"auto"}},preload:Jq}});var Uf=p(()=>{"use strict";zy();J8();Hm();Km()});var uT=p(()=>{"use strict"});function hT(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function H(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(h){s(h)}}function c(u){try{l(n.throw(u))}catch(h){s(h)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})}function fT(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Me(e){return this instanceof Me?(this.v=e,this):new Me(e)}function Qr(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(m){return function(g){return Promise.resolve(g).then(m,h)}}function a(m,g){n[m]&&(i[m]=function(y){return new Promise(function(b,w){o.push([m,y,b,w])>1||c(m,y)})},g&&(i[m]=g(i[m])))}function c(m,g){try{l(n[m](g))}catch(y){d(o[0][3],y)}}function l(m){m.value instanceof Me?Promise.resolve(m.value.v).then(u,h):d(o[0][2],m)}function u(m){c("next",m)}function h(m){c("throw",m)}function d(m,g){m(g),o.shift(),o.length&&c(o[0][0],o[0][1])}}function eu(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(s){return(r=!r)?{value:Me(e[i](s)),done:!1}:o?o(s):s}:o}}function Un(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof fT=="function"?fT(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),i(a,c,s.done,s.value)})}}function i(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}var Ar=p(()=>{});var dT,tu,Qq,jn,$o=p(()=>{dT=new TextDecoder("utf-8"),tu=dT.decode.bind(dT),Qq=new TextEncoder,jn=e=>Qq.encode(e)});var eV,mT,ur,en,zn,qn,Sn,Xm,Ym,Zm,Jm,Qm,pT,jf,gT,e0,yT,Ko=p(()=>{eV=e=>typeof e=="number",mT=e=>typeof e=="boolean",ur=e=>typeof e=="function",en=e=>e!=null&&Object(e)===e,zn=e=>en(e)&&ur(e.then),qn=e=>en(e)&&ur(e[Symbol.iterator]),Sn=e=>en(e)&&ur(e[Symbol.asyncIterator]),Xm=e=>en(e)&&en(e.schema),Ym=e=>en(e)&&"done"in e&&"value"in e,Zm=e=>en(e)&&ur(e.stat)&&eV(e.fd),Jm=e=>en(e)&&jf(e.body),Qm=e=>"_getDOMStream"in e&&"_getNodeStream"in e,pT=e=>en(e)&&ur(e.abort)&&ur(e.getWriter)&&!Qm(e),jf=e=>en(e)&&ur(e.cancel)&&ur(e.getReader)&&!Qm(e),gT=e=>en(e)&&ur(e.end)&&ur(e.write)&&mT(e.writable)&&!Qm(e),e0=e=>en(e)&&ur(e.read)&&ur(e.pipe)&&mT(e.readable)&&!Qm(e),yT=e=>en(e)&&ur(e.clear)&&ur(e.bytes)&&ur(e.position)&&ur(e.setPosition)&&ur(e.capacity)&&ur(e.getBufferIdentifier)&&ur(e.createLong)});var b2={};ir(b2,{compareArrayLike:()=>y2,joinUint8Arrays:()=>Vn,memcpy:()=>zf,rebaseValueOffsets:()=>t0,toArrayBufferView:()=>Re,toArrayBufferViewAsyncIterator:()=>Bi,toArrayBufferViewIterator:()=>fo,toBigInt64Array:()=>qf,toBigUint64Array:()=>sV,toFloat32Array:()=>aV,toFloat32ArrayAsyncIterator:()=>MV,toFloat32ArrayIterator:()=>pV,toFloat64Array:()=>cV,toFloat64ArrayAsyncIterator:()=>vV,toFloat64ArrayIterator:()=>gV,toInt16Array:()=>nV,toInt16ArrayAsyncIterator:()=>wV,toInt16ArrayIterator:()=>fV,toInt32Array:()=>dc,toInt32ArrayAsyncIterator:()=>xV,toInt32ArrayIterator:()=>hV,toInt8Array:()=>rV,toInt8ArrayAsyncIterator:()=>bV,toInt8ArrayIterator:()=>uV,toUint16Array:()=>iV,toUint16ArrayAsyncIterator:()=>_V,toUint16ArrayIterator:()=>dV,toUint32Array:()=>oV,toUint32ArrayAsyncIterator:()=>SV,toUint32ArrayIterator:()=>mV,toUint8Array:()=>se,toUint8ArrayAsyncIterator:()=>g2,toUint8ArrayIterator:()=>p2,toUint8ClampedArray:()=>lV,toUint8ClampedArrayAsyncIterator:()=>EV,toUint8ClampedArrayIterator:()=>yV});function tV(e){let t=e[0]?[e[0]]:[],r,n,i,o;for(let s,a,c=0,l=0,u=e.length;++c<u;){if(s=t[l],a=e[c],!s||!a||s.buffer!==a.buffer||a.byteOffset<s.byteOffset){a&&(t[++l]=a);continue}if({byteOffset:r,byteLength:i}=s,{byteOffset:n,byteLength:o}=a,r+i<n||n+o<r){a&&(t[++l]=a);continue}t[l]=new Uint8Array(s.buffer,r,n-r+o)}return t}function zf(e,t,r=0,n=t.byteLength){let i=e.byteLength,o=new Uint8Array(e.buffer,e.byteOffset,i),s=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,i));return o.set(s,r),e}function Vn(e,t){let r=tV(e),n=r.reduce((u,h)=>u+h.byteLength,0),i,o,s,a=0,c=-1,l=Math.min(t||Number.POSITIVE_INFINITY,n);for(let u=r.length;++c<u;){if(i=r[c],o=i.subarray(0,Math.min(i.length,l-a)),l<=a+o.length){o.length<i.length?r[c]=i.subarray(o.length):o.length===i.length&&c++,s?zf(s,o,a):s=o;break}zf(s||(s=new Uint8Array(l)),o,a),a+=o.length}return[s||new Uint8Array(0),r.slice(c),n-(s?s.byteLength:0)]}function Re(e,t){let r=Ym(t)?t.value:t;return r instanceof e?e===Uint8Array?new e(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=jn(r)),r instanceof ArrayBuffer?new e(r):r instanceof m2?new e(r):yT(r)?Re(e,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new e(0):new e(r.buffer,r.byteOffset,r.byteLength/e.BYTES_PER_ELEMENT):e.from(r)):new e(0)}function*fo(e,t){let r=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof m2?r(t):qn(t)?t:r(t);return yield*d2((function*(i){let o=null;do o=i.next(yield Re(e,o));while(!o.done)})(n[Symbol.iterator]())),new e}function Bi(e,t){return Qr(this,arguments,function*(){if(zn(t))return yield Me(yield Me(yield*eu(Un(Bi(e,yield Me(t))))));let n=function(s){return Qr(this,arguments,function*(){yield yield Me(yield Me(s))})},i=function(s){return Qr(this,arguments,function*(){yield Me(yield*eu(Un(d2((function*(a){let c=null;do c=a.next(yield c==null?void 0:c.value);while(!c.done)})(s[Symbol.iterator]())))))})},o=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof m2?n(t):qn(t)?i(t):Sn(t)?t:n(t);return yield Me(yield*eu(Un(d2((function(s){return Qr(this,arguments,function*(){let a=null;do a=yield Me(s.next(yield yield Me(Re(e,a))));while(!a.done)})})(o[Symbol.asyncIterator]()))))),yield Me(new e)})}function t0(e,t,r){if(e!==0){r=r.slice(0,t);let n=typeof r[0]=="bigint"?BigInt(e):e;for(let i=-1,o=r.length;++i<o;)r[i]+=n}return r.subarray(0,t)}function y2(e,t){let r=0,n=e.length;if(n!==t.length)return!1;if(n>0)do if(e[r]!==t[r])return!1;while(++r<n);return!0}var m2,rV,nV,dc,qf,se,iV,oV,sV,aV,cV,lV,d2,uV,fV,hV,p2,dV,mV,pV,gV,yV,bV,wV,xV,g2,_V,SV,MV,vV,EV,fr=p(()=>{Ar();$o();Ko();m2=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;rV=e=>Re(Int8Array,e),nV=e=>Re(Int16Array,e),dc=e=>Re(Int32Array,e),qf=e=>Re(BigInt64Array,e),se=e=>Re(Uint8Array,e),iV=e=>Re(Uint16Array,e),oV=e=>Re(Uint32Array,e),sV=e=>Re(BigUint64Array,e),aV=e=>Re(Float32Array,e),cV=e=>Re(Float64Array,e),lV=e=>Re(Uint8ClampedArray,e),d2=e=>(e.next(),e);uV=e=>fo(Int8Array,e),fV=e=>fo(Int16Array,e),hV=e=>fo(Int32Array,e),p2=e=>fo(Uint8Array,e),dV=e=>fo(Uint16Array,e),mV=e=>fo(Uint32Array,e),pV=e=>fo(Float32Array,e),gV=e=>fo(Float64Array,e),yV=e=>fo(Uint8ClampedArray,e);bV=e=>Bi(Int8Array,e),wV=e=>Bi(Int16Array,e),xV=e=>Bi(Int32Array,e),g2=e=>Bi(Uint8Array,e),_V=e=>Bi(Uint16Array,e),SV=e=>Bi(Uint32Array,e),MV=e=>Bi(Float32Array,e),vV=e=>Bi(Float64Array,e),EV=e=>Bi(Uint8ClampedArray,e)});function*AV(e){let t,r=!1,n=[],i,o,s,a=0;function c(){return o==="peek"?Vn(n,s)[0]:([i,n,a]=Vn(n,s),i)}({cmd:o,size:s}=(yield null)||{cmd:"read",size:0});let l=p2(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(s-a)?l.next():l.next(s-a),!t&&i.byteLength>0&&(n.push(i),a+=i.byteLength),t||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!t)}catch(u){r=!0,typeof l.throw=="function"&&l.throw(u)}finally{r===!1&&typeof l.return=="function"&&l.return(null)}return null}function TV(e){return Qr(this,arguments,function*(){let r,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Vn(i,a)[0]:([o,i,c]=Vn(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=g2(e)[Symbol.asyncIterator]();try{do if({done:r,value:o}=Number.isNaN(a-c)?yield Me(u.next()):yield Me(u.next(a-c)),!r&&o.byteLength>0&&(i.push(o),c+=o.byteLength),r||a<=c)do({cmd:s,size:a}=yield yield Me(l()));while(a<c);while(!r)}catch(h){n=!0,typeof u.throw=="function"&&(yield Me(u.throw(h)))}finally{n===!1&&typeof u.return=="function"&&(yield Me(u.return(new Uint8Array(0))))}return yield Me(null)})}function IV(e){return Qr(this,arguments,function*(){let r=!1,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Vn(i,a)[0]:([o,i,c]=Vn(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=new x2(e);try{do if({done:r,value:o}=Number.isNaN(a-c)?yield Me(u.read()):yield Me(u.read(a-c)),!r&&o.byteLength>0&&(i.push(se(o)),c+=o.byteLength),r||a<=c)do({cmd:s,size:a}=yield yield Me(l()));while(a<c);while(!r)}catch(h){n=!0,yield Me(u.cancel(h))}finally{n===!1?yield Me(u.cancel()):e.locked&&u.releaseLock()}return yield Me(null)})}function PV(e){return Qr(this,arguments,function*(){let r=[],n="error",i=!1,o=null,s,a,c=0,l=[],u;function h(){return s==="peek"?Vn(l,a)[0]:([u,l,c]=Vn(l,a),u)}if({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0},e.isTTY)return yield yield Me(new Uint8Array(0)),yield Me(null);try{r[0]=w2(e,"end"),r[1]=w2(e,"error");do{if(r[2]=w2(e,"readable"),[n,o]=yield Me(Promise.race(r.map(m=>m[2]))),n==="error")break;if((i=n==="end")||(Number.isFinite(a-c)?(u=se(e.read(a-c)),u.byteLength<a-c&&(u=se(e.read()))):u=se(e.read()),u.byteLength>0&&(l.push(u),c+=u.byteLength)),i||a<=c)do({cmd:s,size:a}=yield yield Me(h()));while(a<c)}while(!i)}finally{yield Me(d(r,n==="error"?o:null))}return yield Me(null);function d(m,g){return u=l=null,new Promise((y,b)=>{for(let[w,S]of m)e.off(w,S);try{let w=e.destroy;w&&w.call(e,g),g=void 0}catch(w){g=w||g}finally{g!=null?b(g):y()}})}})}var hr,r0,x2,w2,ru=p(()=>{Ar();fr();hr={fromIterable(e){return r0(AV(e))},fromAsyncIterable(e){return r0(TV(e))},fromDOMStream(e){return r0(IV(e))},fromNodeStream(e){return r0(PV(e))},toDOMStream(e,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(e,t){throw new Error('"toNodeStream" not available in this environment')}},r0=e=>(e.next(),e);x2=class{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return H(this,void 0,void 0,function*(){let{reader:r,source:n}=this;r&&(yield r.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return H(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=yield this.reader.read();return!r.done&&(r.value=se(r)),r})}},w2=(e,t)=>{let r=i=>n([t,i]),n;return[t,r,new Promise(i=>(n=i)&&e.once(t,r))]}});var nt,n0=p(()=>{(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(nt||(nt={}))});var Ze,_2=p(()=>{(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(Ze||(Ze={}))});var He,S2=p(()=>{(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(He||(He={}))});var ot,M2=p(()=>{(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(ot||(ot={}))});var q,Vf=p(()=>{(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(q||(q={}))});var ke,v2=p(()=>{(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(ke||(ke={}))});var i0=ae(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.SIZE_PREFIX_LENGTH=ho.FILE_IDENTIFIER_LENGTH=ho.SIZEOF_INT=ho.SIZEOF_SHORT=void 0;ho.SIZEOF_SHORT=2;ho.SIZEOF_INT=4;ho.FILE_IDENTIFIER_LENGTH=4;ho.SIZE_PREFIX_LENGTH=4});var E2=ae(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.isLittleEndian=pi.float64=pi.float32=pi.int32=void 0;pi.int32=new Int32Array(2);pi.float32=new Float32Array(pi.int32.buffer);pi.float64=new Float64Array(pi.int32.buffer);pi.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var A2=ae(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});o0.Encoding=void 0;var bT;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(bT||(o0.Encoding=bT={}))});var I2=ae(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.ByteBuffer=void 0;var mo=i0(),RV=A2(),Mn=E2(),T2=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return Mn.int32[0]=this.readInt32(t),Mn.float32[0]}readFloat64(t){return Mn.int32[Mn.isLittleEndian?0:1]=this.readInt32(t),Mn.int32[Mn.isLittleEndian?1:0]=this.readInt32(t+4),Mn.float64[0]}writeInt8(t,r){this.bytes_[t]=r}writeUint8(t,r){this.bytes_[t]=r}writeInt16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeUint16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeInt32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeUint32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeInt64(t,r){this.writeInt32(t,Number(BigInt.asIntN(32,r))),this.writeInt32(t+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(t,r){this.writeUint32(t,Number(BigInt.asUintN(32,r))),this.writeUint32(t+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(t,r){Mn.float32[0]=r,this.writeInt32(t,Mn.int32[0])}writeFloat64(t,r){Mn.float64[0]=r,this.writeInt32(t,Mn.int32[Mn.isLittleEndian?0:1]),this.writeInt32(t+4,Mn.int32[Mn.isLittleEndian?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+mo.SIZEOF_INT+mo.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let r=0;r<mo.FILE_IDENTIFIER_LENGTH;r++)t+=String.fromCharCode(this.readInt8(this.position_+mo.SIZEOF_INT+r));return t}__offset(t,r){let n=t-this.readInt32(t);return r<this.readInt16(n)?this.readInt16(n+r):0}__union(t,r){return t.bb_pos=r+this.readInt32(r),t.bb=this,t}__string(t,r){t+=this.readInt32(t);let n=this.readInt32(t);t+=mo.SIZEOF_INT;let i=this.bytes_.subarray(t,t+n);return r===RV.Encoding.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(t,r){return typeof t=="string"?this.__string(r):this.__union(t,r)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+mo.SIZEOF_INT}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=mo.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+mo.FILE_IDENTIFIER_LENGTH);for(let r=0;r<mo.FILE_IDENTIFIER_LENGTH;r++)if(t.charCodeAt(r)!=this.readInt8(this.position()+mo.SIZEOF_INT+r))return!1;return!0}createScalarList(t,r){let n=[];for(let i=0;i<r;++i){let o=t(i);o!==null&&n.push(o)}return n}createObjList(t,r){let n=[];for(let i=0;i<r;++i){let o=t(i);o!==null&&n.push(o.unpack())}return n}};s0.ByteBuffer=T2});var xT=ae(a0=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});a0.Builder=void 0;var wT=I2(),Wn=i0(),P2=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let r;t?r=t:r=1024,this.bb=wT.ByteBuffer.allocate(r),this.space=r}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,r){t>this.minalign&&(this.minalign=t);let n=~(this.bb.capacity()-this.space+r)+1&t-1;for(;this.space<n+t+r;){let i=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)}pad(t){for(let r=0;r<t;r++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,r,n){(this.force_defaults||r!=n)&&(this.addInt8(r),this.slot(t))}addFieldInt16(t,r,n){(this.force_defaults||r!=n)&&(this.addInt16(r),this.slot(t))}addFieldInt32(t,r,n){(this.force_defaults||r!=n)&&(this.addInt32(r),this.slot(t))}addFieldInt64(t,r,n){(this.force_defaults||r!==n)&&(this.addInt64(r),this.slot(t))}addFieldFloat32(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat32(r),this.slot(t))}addFieldFloat64(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat64(r),this.slot(t))}addFieldOffset(t,r,n){(this.force_defaults||r!=n)&&(this.addOffset(r),this.slot(t))}addFieldStruct(t,r,n){r!=n&&(this.nested(r),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let r=t.capacity();if(r&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=r<<1,i=wT.ByteBuffer.allocate(n);return i.setPosition(n-r),i.bytes().set(t.bytes(),n-r),i}addOffset(t){this.prep(Wn.SIZEOF_INT,0),this.writeInt32(this.offset()-t+Wn.SIZEOF_INT)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let r=0;r<t;r++)this.vtable[r]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let t=this.offset(),r=this.vtable_in_use-1;for(;r>=0&&this.vtable[r]==0;r--);let n=r+1;for(;r>=0;r--)this.addInt16(this.vtable[r]!=0?t-this.vtable[r]:0);let i=2;this.addInt16(t-this.object_start);let o=(n+i)*Wn.SIZEOF_SHORT;this.addInt16(o);let s=0,a=this.space;e:for(r=0;r<this.vtables.length;r++){let c=this.bb.capacity()-this.vtables[r];if(o==this.bb.readInt16(c)){for(let l=Wn.SIZEOF_SHORT;l<o;l+=Wn.SIZEOF_SHORT)if(this.bb.readInt16(a+l)!=this.bb.readInt16(c+l))continue e;s=this.vtables[r];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,r,n){let i=n?Wn.SIZE_PREFIX_LENGTH:0;if(r){let o=r;if(this.prep(this.minalign,Wn.SIZEOF_INT+Wn.FILE_IDENTIFIER_LENGTH+i),o.length!=Wn.FILE_IDENTIFIER_LENGTH)throw new TypeError("FlatBuffers: file identifier must be length "+Wn.FILE_IDENTIFIER_LENGTH);for(let s=Wn.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,Wn.SIZEOF_INT+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,r){this.finish(t,r,!0)}requiredField(t,r){let n=this.bb.capacity()-t,i=n-this.bb.readInt32(n);if(!(r<this.bb.readInt16(i)&&this.bb.readInt16(i+r)!=0))throw new TypeError("FlatBuffers: field "+r+" must be set")}startVector(t,r,n){this.notNested(),this.vector_num_elems=r,this.prep(Wn.SIZEOF_INT,t*r),this.prep(n,t*r)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let r=this.createString(t);return this.string_maps.set(t,r),r}createString(t){if(t==null)return 0;let r;return t instanceof Uint8Array?r=t:r=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,r.length,1),this.bb.setPosition(this.space-=r.length),this.bb.bytes().set(r,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let r=[];for(let n=0;n<t.length;++n){let i=t[n];if(i!==null)r.push(this.createObjectOffset(i));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return r}createStructOffsetList(t,r){return r(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};a0.Builder=P2});var ze=ae(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.Encoding=Tt.ByteBuffer=Tt.Builder=Tt.isLittleEndian=Tt.int32=Tt.float64=Tt.float32=Tt.SIZE_PREFIX_LENGTH=Tt.SIZEOF_SHORT=Tt.SIZEOF_INT=Tt.FILE_IDENTIFIER_LENGTH=void 0;var c0=i0();Object.defineProperty(Tt,"FILE_IDENTIFIER_LENGTH",{enumerable:!0,get:function(){return c0.FILE_IDENTIFIER_LENGTH}});Object.defineProperty(Tt,"SIZEOF_INT",{enumerable:!0,get:function(){return c0.SIZEOF_INT}});Object.defineProperty(Tt,"SIZEOF_SHORT",{enumerable:!0,get:function(){return c0.SIZEOF_SHORT}});Object.defineProperty(Tt,"SIZE_PREFIX_LENGTH",{enumerable:!0,get:function(){return c0.SIZE_PREFIX_LENGTH}});var l0=E2();Object.defineProperty(Tt,"float32",{enumerable:!0,get:function(){return l0.float32}});Object.defineProperty(Tt,"float64",{enumerable:!0,get:function(){return l0.float64}});Object.defineProperty(Tt,"int32",{enumerable:!0,get:function(){return l0.int32}});Object.defineProperty(Tt,"isLittleEndian",{enumerable:!0,get:function(){return l0.isLittleEndian}});var LV=xT();Object.defineProperty(Tt,"Builder",{enumerable:!0,get:function(){return LV.Builder}});var OV=I2();Object.defineProperty(Tt,"ByteBuffer",{enumerable:!0,get:function(){return OV.ByteBuffer}});var BV=A2();Object.defineProperty(Tt,"Encoding",{enumerable:!0,get:function(){return BV.Encoding}})});var mc,R2=p(()=>{(function(e){e[e.BUFFER=0]="BUFFER"})(mc||(mc={}))});var Tr,nu=p(()=>{(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(Tr||(Tr={}))});var _T,Xo,L2=p(()=>{_T=pe(ze(),1);R2();nu();Xo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBodyCompression(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,r){return t.setPosition(t.position()+_T.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):Tr.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):mc.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,r){t.addFieldInt8(0,r,Tr.LZ4_FRAME)}static addMethod(t,r){t.addFieldInt8(1,r,mc.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,r,n){return e.startBodyCompression(t),e.addCodec(t,r),e.addMethod(t,n),e.endBodyCompression(t)}}});var iu,O2=p(()=>{iu=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,r,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(r??0)),t.offset()}}});var ou,B2=p(()=>{ou=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,r,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(r??0)),t.offset()}}});var ST,Cr,C2=p(()=>{ST=pe(ze(),1);L2();O2();B2();Cr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsRecordBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,r){return t.setPosition(t.position()+ST.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new ou).__init(this.bb.__vector(this.bb_pos+n)+t*16,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new iu).__init(this.bb.__vector(this.bb_pos+n)+t*16,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let r=this.bb.__offset(this.bb_pos,10);return r?(t||new Xo).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}variadicBufferCounts(t){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+t*8):BigInt(0)}variadicBufferCountsLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startRecordBatch(t){t.startObject(5)}static addLength(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addNodes(t,r){t.addFieldOffset(1,r,0)}static startNodesVector(t,r){t.startVector(16,r,8)}static addBuffers(t,r){t.addFieldOffset(2,r,0)}static startBuffersVector(t,r){t.startVector(16,r,8)}static addCompression(t,r){t.addFieldOffset(3,r,0)}static addVariadicBufferCounts(t,r){t.addFieldOffset(4,r,0)}static createVariadicBufferCountsVector(t,r){t.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)t.addInt64(r[n]);return t.endVector()}static startVariadicBufferCountsVector(t,r){t.startVector(8,r,8)}static endRecordBatch(t){return t.endObject()}}});var MT,Yo,vT=p(()=>{MT=pe(ze(),1);C2();Yo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,r){return t.setPosition(t.position()+MT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Cr).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addData(t,r){t.addFieldOffset(1,r,0)}static addIsDelta(t,r){t.addFieldInt8(2,+r,0)}static endDictionaryBatch(t){return t.endObject()}}});var Vs,D2=p(()=>{(function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"})(Vs||(Vs={}))});var Wf,ET=p(()=>{(function(e){e[e.DenseArray=0]="DenseArray"})(Wf||(Wf={}))});var AT,Ci,u0=p(()=>{AT=pe(ze(),1),Ci=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInt(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,r){return t.setPosition(t.position()+AT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,r){t.addFieldInt32(0,r,0)}static addIsSigned(t,r){t.addFieldInt8(1,+r,0)}static endInt(t){return t.endObject()}static createInt(t,r,n){return e.startInt(t),e.addBitWidth(t,r),e.addIsSigned(t,n),e.endInt(t)}}});var TT,po,N2=p(()=>{TT=pe(ze(),1);ET();u0();po=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryEncoding(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,r){return t.setPosition(t.position()+TT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}indexType(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Ci).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):Wf.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addIndexType(t,r){t.addFieldOffset(1,r,0)}static addIsOrdered(t,r){t.addFieldInt8(2,+r,0)}static addDictionaryKind(t,r){t.addFieldInt16(3,r,Wf.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}});var IT,Ct,su=p(()=>{IT=pe(ze(),1),Ct=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsKeyValue(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,r){return t.setPosition(t.position()+IT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}key(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}value(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,r){t.addFieldOffset(0,r,0)}static addValue(t,r){t.addFieldOffset(1,r,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,r,n){return e.startKeyValue(t),e.addKey(t,r),e.addValue(t,n),e.endKeyValue(t)}}});var PT,Hf,RT=p(()=>{PT=pe(ze(),1),Hf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,r){return t.setPosition(t.position()+PT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return e.startBinary(t),e.endBinary(t)}}});var LT,$f,OT=p(()=>{LT=pe(ze(),1),$f=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBinaryView(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinaryView(t,r){return t.setPosition(t.position()+LT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinaryView(t){t.startObject(0)}static endBinaryView(t){return t.endObject()}static createBinaryView(t){return e.startBinaryView(t),e.endBinaryView(t)}}});var BT,Kf,CT=p(()=>{BT=pe(ze(),1),Kf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBool(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,r){return t.setPosition(t.position()+BT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return e.startBool(t),e.endBool(t)}}});var DT,Ws,F2=p(()=>{DT=pe(ze(),1);M2();Ws=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDate(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,r){return t.setPosition(t.position()+DT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ot.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,ot.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,r){return e.startDate(t),e.addUnit(t,r),e.endDate(t)}}});var NT,go,G2=p(()=>{NT=pe(ze(),1),go=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDecimal(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,r){return t.setPosition(t.position()+NT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,r){t.addFieldInt32(0,r,0)}static addScale(t,r){t.addFieldInt32(1,r,0)}static addBitWidth(t,r){t.addFieldInt32(2,r,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,r,n,i){return e.startDecimal(t),e.addPrecision(t,r),e.addScale(t,n),e.addBitWidth(t,i),e.endDecimal(t)}}});var FT,Hs,k2=p(()=>{FT=pe(ze(),1);Vf();Hs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDuration(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,r){return t.setPosition(t.position()+FT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,q.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,r){return e.startDuration(t),e.addUnit(t,r),e.endDuration(t)}}});var GT,$s,U2=p(()=>{GT=pe(ze(),1),$s=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,r){return t.setPosition(t.position()+GT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,r){t.addFieldInt32(0,r,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,r){return e.startFixedSizeBinary(t),e.addByteWidth(t,r),e.endFixedSizeBinary(t)}}});var kT,Ks,j2=p(()=>{kT=pe(ze(),1),Ks=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,r){return t.setPosition(t.position()+kT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,r){t.addFieldInt32(0,r,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,r){return e.startFixedSizeList(t),e.addListSize(t,r),e.endFixedSizeList(t)}}});var UT,Xs,z2=p(()=>{UT=pe(ze(),1);S2();Xs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFloatingPoint(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,r){return t.setPosition(t.position()+UT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):He.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,r){t.addFieldInt16(0,r,He.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,r){return e.startFloatingPoint(t),e.addPrecision(t,r),e.endFloatingPoint(t)}}});var jT,Ys,q2=p(()=>{jT=pe(ze(),1);v2();Ys=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInterval(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,r){return t.setPosition(t.position()+jT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ke.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,ke.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,r){return e.startInterval(t),e.addUnit(t,r),e.endInterval(t)}}});var zT,Xf,qT=p(()=>{zT=pe(ze(),1),Xf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,r){return t.setPosition(t.position()+zT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return e.startLargeBinary(t),e.endLargeBinary(t)}}});var VT,Yf,WT=p(()=>{VT=pe(ze(),1),Yf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeList(t,r){return t.setPosition(t.position()+VT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeList(t){t.startObject(0)}static endLargeList(t){return t.endObject()}static createLargeList(t){return e.startLargeList(t),e.endLargeList(t)}}});var HT,Zf,$T=p(()=>{HT=pe(ze(),1),Zf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,r){return t.setPosition(t.position()+HT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return e.startLargeUtf8(t),e.endLargeUtf8(t)}}});var KT,Jf,XT=p(()=>{KT=pe(ze(),1),Jf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,r){return t.setPosition(t.position()+KT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return e.startList(t),e.endList(t)}}});var YT,Zs,V2=p(()=>{YT=pe(ze(),1),Zs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMap(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,r){return t.setPosition(t.position()+YT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,r){t.addFieldInt8(0,+r,0)}static endMap(t){return t.endObject()}static createMap(t,r){return e.startMap(t),e.addKeysSorted(t,r),e.endMap(t)}}});var ZT,Qf,JT=p(()=>{ZT=pe(ze(),1),Qf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsNull(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,r){return t.setPosition(t.position()+ZT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return e.startNull(t),e.endNull(t)}}});var QT,eh,eI=p(()=>{QT=pe(ze(),1),eh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsStruct_(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,r){return t.setPosition(t.position()+QT.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return e.startStruct_(t),e.endStruct_(t)}}});var tI,Zo,W2=p(()=>{tI=pe(ze(),1);Vf();Zo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTime(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,r){return t.setPosition(t.position()+tI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,r){t.addFieldInt16(0,r,q.MILLISECOND)}static addBitWidth(t,r){t.addFieldInt32(1,r,32)}static endTime(t){return t.endObject()}static createTime(t,r,n){return e.startTime(t),e.addUnit(t,r),e.addBitWidth(t,n),e.endTime(t)}}});var rI,Jo,H2=p(()=>{rI=pe(ze(),1);Vf();Jo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTimestamp(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,r){return t.setPosition(t.position()+rI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.SECOND}timezone(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,r){t.addFieldInt16(0,r,q.SECOND)}static addTimezone(t,r){t.addFieldOffset(1,r,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,r,n){return e.startTimestamp(t),e.addUnit(t,r),e.addTimezone(t,n),e.endTimestamp(t)}}});var nI,Di,$2=p(()=>{nI=pe(ze(),1);_2();Di=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUnion(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,r){return t.setPosition(t.position()+nI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}mode(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ze.Sparse}typeIds(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readInt32(this.bb.__vector(this.bb_pos+r)+t*4):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,r){t.addFieldInt16(0,r,Ze.Sparse)}static addTypeIds(t,r){t.addFieldOffset(1,r,0)}static createTypeIdsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addInt32(r[n]);return t.endVector()}static startTypeIdsVector(t,r){t.startVector(4,r,4)}static endUnion(t){return t.endObject()}static createUnion(t,r,n){return e.startUnion(t),e.addMode(t,r),e.addTypeIds(t,n),e.endUnion(t)}}});var iI,th,oI=p(()=>{iI=pe(ze(),1),th=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,r){return t.setPosition(t.position()+iI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}}});var sI,rh,aI=p(()=>{sI=pe(ze(),1),rh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUtf8View(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8View(t,r){return t.setPosition(t.position()+sI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8View(t){t.startObject(0)}static endUtf8View(t){return t.endObject()}static createUtf8View(t){return e.startUtf8View(t),e.endUtf8View(t)}}});var me,f0=p(()=>{(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.RunEndEncoded=22]="RunEndEncoded",e[e.BinaryView=23]="BinaryView",e[e.Utf8View=24]="Utf8View",e[e.ListView=25]="ListView",e[e.LargeListView=26]="LargeListView"})(me||(me={}))});var cI,Dr,K2=p(()=>{cI=pe(ze(),1);N2();su();f0();Dr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsField(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,r){return t.setPosition(t.position()+cI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}name(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):me.NONE}type(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(t,this.bb_pos+r):null}dictionary(t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new po).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(t,r){let n=this.bb.__offset(this.bb_pos,14);return n?(r||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,16);return n?(r||new Ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,r){t.addFieldOffset(0,r,0)}static addNullable(t,r){t.addFieldInt8(1,+r,0)}static addTypeType(t,r){t.addFieldInt8(2,r,me.NONE)}static addType(t,r){t.addFieldOffset(3,r,0)}static addDictionary(t,r){t.addFieldOffset(4,r,0)}static addChildren(t,r){t.addFieldOffset(5,r,0)}static createChildrenVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startChildrenVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(6,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endField(t){return t.endObject()}}});var lI,vn,X2=p(()=>{lI=pe(ze(),1);D2();K2();su();vn=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsSchema(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,r){return t.setPosition(t.position()+lI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Vs.Little}fields(t,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new Dr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,r){t.addFieldInt16(0,r,Vs.Little)}static addFields(t,r){t.addFieldOffset(1,r,0)}static createFieldsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startFieldsVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(2,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static addFeatures(t,r){t.addFieldOffset(3,r,0)}static createFeaturesVector(t,r){t.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)t.addInt64(r[n]);return t.endVector()}static startFeaturesVector(t,r){t.startVector(8,r,8)}static endSchema(t){return t.endObject()}static createSchema(t,r,n,i,o){return e.startSchema(t),e.addEndianness(t,r),e.addFields(t,n),e.addCustomMetadata(t,i),e.addFeatures(t,o),e.endSchema(t)}}});var Ge,h0=p(()=>{(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(Ge||(Ge={}))});var x,Ne,Dt=p(()=>{n0();_2();S2();M2();Vf();v2();h0();(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.BinaryView=23]="BinaryView",e[e.Utf8View=24]="Utf8View",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e[e.DurationSecond=-27]="DurationSecond",e[e.DurationMillisecond=-28]="DurationMillisecond",e[e.DurationMicrosecond=-29]="DurationMicrosecond",e[e.DurationNanosecond=-30]="DurationNanosecond",e[e.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(x||(x={}));(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(Ne||(Ne={}))});var Y2={};ir(Y2,{valueToString:()=>Ni});function Ni(e){if(e===null)return"null";if(e===void 0)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(t=>Ni(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,r)=>typeof r=="bigint"?`${r}`:r)}var nh=p(()=>{});function Le(e){if(typeof e=="bigint"&&(e<Number.MIN_SAFE_INTEGER||e>Number.MAX_SAFE_INTEGER))throw new TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function Z2(e,t){return Le(e/t)+Le(e%t)/Le(t)}var yo=p(()=>{});var eb={};ir(eb,{BN:()=>pc,bigNumToBigInt:()=>fI,bigNumToNumber:()=>Q2,bigNumToString:()=>lu,isArrowBigNumSymbol:()=>uI});function Fi(e,...t){return t.length===0?Object.setPrototypeOf(Re(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}function au(...e){return Fi.apply(this,e)}function cu(...e){return Fi.apply(this,e)}function ih(...e){return Fi.apply(this,e)}function Q2(e,t){let{buffer:r,byteOffset:n,byteLength:i,signed:o}=e,s=new BigUint64Array(r,n,i/8),a=o&&s.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),l=0;if(a){for(let u of s)c|=(u^DV)*(BigInt(1)<<BigInt(64*l++));c*=BigInt(-1),c-=BigInt(1)}else for(let u of s)c|=u*(BigInt(1)<<BigInt(64*l++));if(typeof t=="number"&&t>0){let u=BigInt("1".padEnd(t+1,"0")),h=c/u,d=a?-(c%u):c%u,m=Le(h),g=`${d}`.padStart(t,"0");return+`${a&&m===0?"-":""}${m}.${g}`}return Le(c)}function lu(e){if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return J2(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return J2(e);t=t.slice();let n=1;for(let o=0;o<t.length;o++){let s=t[o],a=~s+n;t[o]=a,n&=s===0?1:0}return`-${J2(t)}`}function fI(e){return e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:lu(e)}function J2(e){let t="",r=new Uint32Array(2),n=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),o=-1,s=n.length-1;do{for(r[0]=n[o=0];o<s;)n[o++]=r[1]=r[0]/10,r[0]=(r[0]-r[1]*10<<16)+n[o];n[o]=r[1]=r[0]/10,r[0]=r[0]-r[1]*10,t=`${r[0]}${t}`}while(i[0]||i[1]||i[2]||i[3]);return t??"0"}var uI,CV,DV,pc,d0=p(()=>{fr();yo();uI=Symbol.for("isArrowBigNum");Fi.prototype[uI]=!0;Fi.prototype.toJSON=function(){return`"${lu(this)}"`};Fi.prototype.valueOf=function(e){return Q2(this,e)};Fi.prototype.toString=function(){return lu(this)};Fi.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return Q2(this);case"string":return lu(this);case"default":return fI(this)}return lu(this)};Object.setPrototypeOf(au.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(cu.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(ih.prototype,Object.create(Uint32Array.prototype));Object.assign(au.prototype,Fi.prototype,{constructor:au,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(cu.prototype,Fi.prototype,{constructor:cu,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(ih.prototype,Fi.prototype,{constructor:ih,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});CV=BigInt(4294967296)*BigInt(4294967296),DV=CV-BigInt(1);pc=class e{static new(t,r){switch(r){case!0:return new au(t);case!1:return new cu(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new au(t)}return t.byteLength===16?new ih(t):new cu(t)}static signed(t){return new au(t)}static unsigned(t){return new cu(t)}static decimal(t){return new ih(t)}constructor(t,r){return e.new(t,r)}}});function Qn(e){let t=e;switch(e.typeId){case x.Decimal:return e.bitWidth/32;case x.Interval:return t.unit===ke.MONTH_DAY_NANO?4:1+t.unit;case x.BinaryView:case x.Utf8View:return 16;case x.FixedSizeList:return t.listSize;case x.FixedSizeBinary:return t.byteWidth;default:return 1}}var hI,dI,mI,pI,gI,yI,bI,wI,xI,_I,SI,MI,vI,EI,AI,TI,II,PI,RI,LI,OI,BI,CI,DI,NI,FI,z,Vt,It,Hn,$n,Xt,Kn,Xn,Yn,tn,Gi,Nr,ki,rn,Zn,En,Ee,Ui,Fr,nn,ji,Gr,An,on,Js,Qs,Ir,ea,ta,ra,na,Pr,ia,bo,oa,sa,kr,aa,ca,oh,sn,sh,ah,ch,lh,Qt,Jn,et,an,Qo,la,Tn,Wt,Ur,NV,er,st=p(()=>{yo();Dt();FI=Symbol.for("apache-arrow/DataType"),z=class e{static isDataType(t){return(t==null?void 0:t[FI])===!0}static isNull(t){return(t==null?void 0:t.typeId)===x.Null}static isInt(t){return(t==null?void 0:t.typeId)===x.Int}static isFloat(t){return(t==null?void 0:t.typeId)===x.Float}static isBinary(t){return(t==null?void 0:t.typeId)===x.Binary}static isBinaryView(t){return(t==null?void 0:t.typeId)===x.BinaryView}static isLargeBinary(t){return(t==null?void 0:t.typeId)===x.LargeBinary}static isUtf8(t){return(t==null?void 0:t.typeId)===x.Utf8}static isUtf8View(t){return(t==null?void 0:t.typeId)===x.Utf8View}static isLargeUtf8(t){return(t==null?void 0:t.typeId)===x.LargeUtf8}static isBool(t){return(t==null?void 0:t.typeId)===x.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===x.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===x.Date}static isTime(t){return(t==null?void 0:t.typeId)===x.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===x.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===x.Interval}static isDuration(t){return(t==null?void 0:t.typeId)===x.Duration}static isList(t){return(t==null?void 0:t.typeId)===x.List}static isLargeList(t){return(t==null?void 0:t.typeId)===x.LargeList}static isStruct(t){return(t==null?void 0:t.typeId)===x.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===x.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===x.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===x.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===x.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===x.Dictionary}static isDenseUnion(t){return e.isUnion(t)&&t.mode===Ze.Dense}static isSparseUnion(t){return e.isUnion(t)&&t.mode===Ze.Sparse}constructor(t){this.typeId=t}};hI=Symbol.toStringTag;z[hI]=(e=>(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[FI]=!0,e[Symbol.toStringTag]="DataType"))(z.prototype);Vt=class extends z{constructor(){super(x.Null)}toString(){return"Null"}};dI=Symbol.toStringTag;Vt[dI]=(e=>e[Symbol.toStringTag]="Null")(Vt.prototype);It=class extends z{constructor(t,r){super(x.Int),this.isSigned=t,this.bitWidth=r}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};mI=Symbol.toStringTag;It[mI]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(It.prototype);Hn=class extends It{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},$n=class extends It{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Xt=class extends It{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Kn=class extends It{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Xn=class extends It{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Yn=class extends It{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},tn=class extends It{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Gi=class extends It{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Hn.prototype,"ArrayType",{value:Int8Array});Object.defineProperty($n.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Xt.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Kn.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Xn.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Yn.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(tn.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Gi.prototype,"ArrayType",{value:BigUint64Array});Nr=class extends z{constructor(t){super(x.Float),this.precision=t}get ArrayType(){switch(this.precision){case He.HALF:return Uint16Array;case He.SINGLE:return Float32Array;case He.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};pI=Symbol.toStringTag;Nr[pI]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(Nr.prototype);ki=class extends Nr{constructor(){super(He.HALF)}},rn=class extends Nr{constructor(){super(He.SINGLE)}},Zn=class extends Nr{constructor(){super(He.DOUBLE)}};Object.defineProperty(ki.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(rn.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Zn.prototype,"ArrayType",{value:Float64Array});En=class extends z{constructor(){super(x.Binary)}toString(){return"Binary"}};gI=Symbol.toStringTag;En[gI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(En.prototype);Ee=class extends z{constructor(){super(x.BinaryView)}toString(){return"BinaryView"}};yI=Symbol.toStringTag;Ee.ELEMENT_WIDTH=16;Ee.INLINE_CAPACITY=12;Ee.LENGTH_OFFSET=0;Ee.INLINE_OFFSET=4;Ee.BUFFER_INDEX_OFFSET=8;Ee.BUFFER_OFFSET_OFFSET=12;Ee[yI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="BinaryView"))(Ee.prototype);Ui=class extends z{constructor(){super(x.LargeBinary)}toString(){return"LargeBinary"}};bI=Symbol.toStringTag;Ui[bI]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeBinary"))(Ui.prototype);Fr=class extends z{constructor(){super(x.Utf8)}toString(){return"Utf8"}};wI=Symbol.toStringTag;Fr[wI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(Fr.prototype);nn=class extends z{constructor(){super(x.Utf8View)}toString(){return"Utf8View"}};xI=Symbol.toStringTag;nn.ELEMENT_WIDTH=Ee.ELEMENT_WIDTH;nn.INLINE_CAPACITY=Ee.INLINE_CAPACITY;nn[xI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8View"))(nn.prototype);ji=class extends z{constructor(){super(x.LargeUtf8)}toString(){return"LargeUtf8"}};_I=Symbol.toStringTag;ji[_I]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeUtf8"))(ji.prototype);Gr=class extends z{constructor(){super(x.Bool)}toString(){return"Bool"}};SI=Symbol.toStringTag;Gr[SI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(Gr.prototype);An=class extends z{constructor(t,r,n=128){super(x.Decimal),this.scale=t,this.precision=r,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};MI=Symbol.toStringTag;An[MI]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(An.prototype);on=class extends z{constructor(t){super(x.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${ot[this.unit]}>`}get ArrayType(){return this.unit===ot.DAY?Int32Array:BigInt64Array}};vI=Symbol.toStringTag;on[vI]=(e=>(e.unit=null,e[Symbol.toStringTag]="Date"))(on.prototype);Js=class extends on{constructor(){super(ot.DAY)}},Qs=class extends on{constructor(){super(ot.MILLISECOND)}},Ir=class extends z{constructor(t,r){super(x.Time),this.unit=t,this.bitWidth=r}toString(){return`Time${this.bitWidth}<${q[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};EI=Symbol.toStringTag;Ir[EI]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(Ir.prototype);ea=class extends Ir{constructor(){super(q.SECOND,32)}},ta=class extends Ir{constructor(){super(q.MILLISECOND,32)}},ra=class extends Ir{constructor(){super(q.MICROSECOND,64)}},na=class extends Ir{constructor(){super(q.NANOSECOND,64)}},Pr=class extends z{constructor(t,r){super(x.Timestamp),this.unit=t,this.timezone=r}toString(){return`Timestamp<${q[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};AI=Symbol.toStringTag;Pr[AI]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Timestamp"))(Pr.prototype);ia=class extends Pr{constructor(t){super(q.SECOND,t)}},bo=class extends Pr{constructor(t){super(q.MILLISECOND,t)}},oa=class extends Pr{constructor(t){super(q.MICROSECOND,t)}},sa=class extends Pr{constructor(t){super(q.NANOSECOND,t)}},kr=class extends z{constructor(t){super(x.Interval),this.unit=t}toString(){return`Interval<${ke[this.unit]}>`}};TI=Symbol.toStringTag;kr[TI]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(kr.prototype);aa=class extends kr{constructor(){super(ke.DAY_TIME)}},ca=class extends kr{constructor(){super(ke.YEAR_MONTH)}},oh=class extends kr{constructor(){super(ke.MONTH_DAY_NANO)}},sn=class extends z{constructor(t){super(x.Duration),this.unit=t}toString(){return`Duration<${q[this.unit]}>`}};II=Symbol.toStringTag;sn[II]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(sn.prototype);sh=class extends sn{constructor(){super(q.SECOND)}},ah=class extends sn{constructor(){super(q.MILLISECOND)}},ch=class extends sn{constructor(){super(q.MICROSECOND)}},lh=class extends sn{constructor(){super(q.NANOSECOND)}},Qt=class extends z{constructor(t){super(x.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};PI=Symbol.toStringTag;Qt[PI]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(Qt.prototype);Jn=class extends z{constructor(t){super(x.LargeList),this.children=[t]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};RI=Symbol.toStringTag;Jn[RI]=(e=>(e.children=null,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeList"))(Jn.prototype);et=class extends z{constructor(t){super(x.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};LI=Symbol.toStringTag;et[LI]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(et.prototype);an=class extends z{constructor(t,r,n){super(x.Union),this.mode=t,this.children=n,this.typeIds=r=Int32Array.from(r),this.typeIdToChildIndex=r.reduce((i,o,s)=>(i[o]=s)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};OI=Symbol.toStringTag;an[OI]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(an.prototype);Qo=class extends an{constructor(t,r){super(Ze.Dense,t,r)}},la=class extends an{constructor(t,r){super(Ze.Sparse,t,r)}},Tn=class extends z{constructor(t){super(x.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};BI=Symbol.toStringTag;Tn[BI]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(Tn.prototype);Wt=class extends z{constructor(t,r){super(x.FixedSizeList),this.listSize=t,this.children=[r]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};CI=Symbol.toStringTag;Wt[CI]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(Wt.prototype);Ur=class extends z{constructor(t,r=!1){var n,i,o;if(super(x.Map),this.children=[t],this.keysSorted=r,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){let s=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];s&&(s.name="key");let a=(o=t==null?void 0:t.type)===null||o===void 0?void 0:o.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};DI=Symbol.toStringTag;Ur[DI]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(Ur.prototype);NV=(e=>()=>++e)(-1),er=class extends z{constructor(t,r,n,i){super(x.Dictionary),this.indices=r,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?NV():Le(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};NI=Symbol.toStringTag;er[NI]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(er.prototype)});function FV(e,t,r=!0){return typeof t=="number"?uu(e,t,r):typeof t=="string"&&t in x?uu(e,x[t],r):t&&t instanceof z?uu(e,kI(t),r):t!=null&&t.type&&t.type instanceof z?uu(e,kI(t.type),r):uu(e,x.NONE,r)}function uu(e,t,r=!0){let n=null;switch(t){case x.Null:n=e.visitNull;break;case x.Bool:n=e.visitBool;break;case x.Int:n=e.visitInt;break;case x.Int8:n=e.visitInt8||e.visitInt;break;case x.Int16:n=e.visitInt16||e.visitInt;break;case x.Int32:n=e.visitInt32||e.visitInt;break;case x.Int64:n=e.visitInt64||e.visitInt;break;case x.Uint8:n=e.visitUint8||e.visitInt;break;case x.Uint16:n=e.visitUint16||e.visitInt;break;case x.Uint32:n=e.visitUint32||e.visitInt;break;case x.Uint64:n=e.visitUint64||e.visitInt;break;case x.Float:n=e.visitFloat;break;case x.Float16:n=e.visitFloat16||e.visitFloat;break;case x.Float32:n=e.visitFloat32||e.visitFloat;break;case x.Float64:n=e.visitFloat64||e.visitFloat;break;case x.Utf8:n=e.visitUtf8;break;case x.LargeUtf8:n=e.visitLargeUtf8;break;case x.Utf8View:n=e.visitUtf8View||e.visitUtf8;break;case x.Binary:n=e.visitBinary;break;case x.LargeBinary:n=e.visitLargeBinary;break;case x.BinaryView:n=e.visitBinaryView||e.visitBinary;break;case x.FixedSizeBinary:n=e.visitFixedSizeBinary;break;case x.Date:n=e.visitDate;break;case x.DateDay:n=e.visitDateDay||e.visitDate;break;case x.DateMillisecond:n=e.visitDateMillisecond||e.visitDate;break;case x.Timestamp:n=e.visitTimestamp;break;case x.TimestampSecond:n=e.visitTimestampSecond||e.visitTimestamp;break;case x.TimestampMillisecond:n=e.visitTimestampMillisecond||e.visitTimestamp;break;case x.TimestampMicrosecond:n=e.visitTimestampMicrosecond||e.visitTimestamp;break;case x.TimestampNanosecond:n=e.visitTimestampNanosecond||e.visitTimestamp;break;case x.Time:n=e.visitTime;break;case x.TimeSecond:n=e.visitTimeSecond||e.visitTime;break;case x.TimeMillisecond:n=e.visitTimeMillisecond||e.visitTime;break;case x.TimeMicrosecond:n=e.visitTimeMicrosecond||e.visitTime;break;case x.TimeNanosecond:n=e.visitTimeNanosecond||e.visitTime;break;case x.Decimal:n=e.visitDecimal;break;case x.List:n=e.visitList;break;case x.LargeList:n=e.visitLargeList;break;case x.Struct:n=e.visitStruct;break;case x.Union:n=e.visitUnion;break;case x.DenseUnion:n=e.visitDenseUnion||e.visitUnion;break;case x.SparseUnion:n=e.visitSparseUnion||e.visitUnion;break;case x.Dictionary:n=e.visitDictionary;break;case x.Interval:n=e.visitInterval;break;case x.IntervalDayTime:n=e.visitIntervalDayTime||e.visitInterval;break;case x.IntervalYearMonth:n=e.visitIntervalYearMonth||e.visitInterval;break;case x.IntervalMonthDayNano:n=e.visitIntervalMonthDayNano||e.visitInterval;break;case x.Duration:n=e.visitDuration;break;case x.DurationSecond:n=e.visitDurationSecond||e.visitDuration;break;case x.DurationMillisecond:n=e.visitDurationMillisecond||e.visitDuration;break;case x.DurationMicrosecond:n=e.visitDurationMicrosecond||e.visitDuration;break;case x.DurationNanosecond:n=e.visitDurationNanosecond||e.visitDuration;break;case x.FixedSizeList:n=e.visitFixedSizeList;break;case x.Map:n=e.visitMap;break}if(typeof n=="function")return n;if(!r)return()=>null;throw new Error(`Unrecognized type '${x[t]}'`)}function kI(e){switch(e.typeId){case x.Null:return x.Null;case x.Int:{let{bitWidth:t,isSigned:r}=e;switch(t){case 8:return r?x.Int8:x.Uint8;case 16:return r?x.Int16:x.Uint16;case 32:return r?x.Int32:x.Uint32;case 64:return r?x.Int64:x.Uint64}return x.Int}case x.Float:switch(e.precision){case He.HALF:return x.Float16;case He.SINGLE:return x.Float32;case He.DOUBLE:return x.Float64}return x.Float;case x.Binary:return x.Binary;case x.LargeBinary:return x.LargeBinary;case x.BinaryView:return x.BinaryView;case x.Utf8:return x.Utf8;case x.LargeUtf8:return x.LargeUtf8;case x.Utf8View:return x.Utf8View;case x.Bool:return x.Bool;case x.Decimal:return x.Decimal;case x.Time:switch(e.unit){case q.SECOND:return x.TimeSecond;case q.MILLISECOND:return x.TimeMillisecond;case q.MICROSECOND:return x.TimeMicrosecond;case q.NANOSECOND:return x.TimeNanosecond}return x.Time;case x.Timestamp:switch(e.unit){case q.SECOND:return x.TimestampSecond;case q.MILLISECOND:return x.TimestampMillisecond;case q.MICROSECOND:return x.TimestampMicrosecond;case q.NANOSECOND:return x.TimestampNanosecond}return x.Timestamp;case x.Date:switch(e.unit){case ot.DAY:return x.DateDay;case ot.MILLISECOND:return x.DateMillisecond}return x.Date;case x.Interval:switch(e.unit){case ke.DAY_TIME:return x.IntervalDayTime;case ke.YEAR_MONTH:return x.IntervalYearMonth;case ke.MONTH_DAY_NANO:return x.IntervalMonthDayNano}return x.Interval;case x.Duration:switch(e.unit){case q.SECOND:return x.DurationSecond;case q.MILLISECOND:return x.DurationMillisecond;case q.MICROSECOND:return x.DurationMicrosecond;case q.NANOSECOND:return x.DurationNanosecond}return x.Duration;case x.Map:return x.Map;case x.List:return x.List;case x.LargeList:return x.LargeList;case x.Struct:return x.Struct;case x.Union:switch(e.mode){case Ze.Dense:return x.DenseUnion;case Ze.Sparse:return x.SparseUnion}return x.Union;case x.FixedSizeBinary:return x.FixedSizeBinary;case x.FixedSizeList:return x.FixedSizeList;case x.Dictionary:return x.Dictionary}throw new Error(`Unrecognized type '${x[e.typeId]}'`)}var ie,In=p(()=>{Dt();st();ie=class{visitMany(t,...r){return t.map((n,i)=>this.visit(n,...r.map(o=>o[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,r=!0){return FV(this,t,r)}getVisitFnByTypeId(t,r=!0){return uu(this,t,r)}visitNull(t,...r){return null}visitBool(t,...r){return null}visitInt(t,...r){return null}visitFloat(t,...r){return null}visitUtf8(t,...r){return null}visitLargeUtf8(t,...r){return null}visitUtf8View(t,...r){return null}visitBinary(t,...r){return null}visitLargeBinary(t,...r){return null}visitBinaryView(t,...r){return null}visitFixedSizeBinary(t,...r){return null}visitDate(t,...r){return null}visitTimestamp(t,...r){return null}visitTime(t,...r){return null}visitDecimal(t,...r){return null}visitList(t,...r){return null}visitLargeList(t,...r){return null}visitStruct(t,...r){return null}visitUnion(t,...r){return null}visitDictionary(t,...r){return null}visitInterval(t,...r){return null}visitDuration(t,...r){return null}visitFixedSizeList(t,...r){return null}visitMap(t,...r){return null}};ie.prototype.visitInt8=null;ie.prototype.visitInt16=null;ie.prototype.visitInt32=null;ie.prototype.visitInt64=null;ie.prototype.visitUint8=null;ie.prototype.visitUint16=null;ie.prototype.visitUint32=null;ie.prototype.visitUint64=null;ie.prototype.visitFloat16=null;ie.prototype.visitFloat32=null;ie.prototype.visitFloat64=null;ie.prototype.visitDateDay=null;ie.prototype.visitDateMillisecond=null;ie.prototype.visitTimestampSecond=null;ie.prototype.visitTimestampMillisecond=null;ie.prototype.visitTimestampMicrosecond=null;ie.prototype.visitTimestampNanosecond=null;ie.prototype.visitTimeSecond=null;ie.prototype.visitTimeMillisecond=null;ie.prototype.visitTimeMicrosecond=null;ie.prototype.visitTimeNanosecond=null;ie.prototype.visitDenseUnion=null;ie.prototype.visitSparseUnion=null;ie.prototype.visitIntervalDayTime=null;ie.prototype.visitIntervalYearMonth=null;ie.prototype.visitIntervalMonthDayNano=null;ie.prototype.visitDuration=null;ie.prototype.visitDurationSecond=null;ie.prototype.visitDurationMillisecond=null;ie.prototype.visitDurationMicrosecond=null;ie.prototype.visitDurationNanosecond=null});var tb={};ir(tb,{float64ToUint16:()=>uh,uint16ToFloat64:()=>m0});function m0(e){let t=(e&31744)>>10,r=(e&1023)/1024,n=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return n*(r?Number.NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*Math.pow(2,t-15)*(1+r)}function uh(e){if(e!==e)return 32256;UI[0]=e;let t=(fu[1]&2147483648)>>16&65535,r=fu[1]&2146435072,n=0;return r>=1089470464?fu[0]>0?r=31744:(r=(r&2080374784)>>16,n=(fu[1]&1048575)>>10):r<=1056964608?(n=1048576+(fu[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(fu[1]&1048575)+512>>10),t|r|n&65535}var UI,fu,fh=p(()=>{UI=new Float64Array(1),fu=new Uint32Array(UI.buffer)});function be(e){return(t,r,n)=>{if(t.setValid(r,n!=null))return e(t,r,n)}}var de,GV,jI,kV,es,rb,zI,UV,p0,g0,nb,qI,jV,VI,zV,WI,qV,ib,y0,b0,w0,x0,ob,_0,S0,M0,v0,sb,ab,HI,VV,WV,HV,$V,KV,XV,YV,$I,KI,ZV,cb,E0,A0,T0,I0,P0,R0,L0,lb,JV,Rr,ei=p(()=>{jr();In();yo();$o();fh();Dt();st();de=class extends ie{};GV=(e,t,r)=>{e[t]=Math.floor(r/864e5)},jI=(e,t,r,n)=>{if(r+1<t.length){let i=Le(t[r]),o=Le(t[r+1]);e.set(n.subarray(0,o-i),i)}},kV=({offset:e,values:t},r,n)=>{let i=e+r;n?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},es=({values:e},t,r)=>{e[t]=r},rb=({values:e},t,r)=>{e[t]=r},zI=({values:e},t,r)=>{e[t]=uh(r)},UV=(e,t,r)=>{switch(e.type.precision){case He.HALF:return zI(e,t,r);case He.SINGLE:case He.DOUBLE:return rb(e,t,r)}},p0=({values:e},t,r)=>{GV(e,t,r.valueOf())},g0=({values:e},t,r)=>{e[t]=BigInt(r)},nb=({stride:e,values:t},r,n)=>{t.set(n.subarray(0,e),e*r)},qI=({values:e,valueOffsets:t},r,n)=>jI(e,t,r,n),jV=e=>{let t=e.variadicBuffers;return(!Array.isArray(t)||Object.isFrozen(t))&&(t=Array.from(t),e.variadicBuffers=t),t},VI=(e,t,r)=>{var n,i,o,s;let a=e.values;if(!a)throw new Error("BinaryView data is missing view buffer");let c=Ee.ELEMENT_WIDTH,l=t*c,u=l+c;if(l<0||u>a.length)throw new RangeError(`BinaryView index ${t} out of bounds`);a.fill(0,l,u);let h=new DataView(a.buffer,a.byteOffset+l,c),d=r.length;if(h.setInt32(Ee.LENGTH_OFFSET,d,!0),d<=Ee.INLINE_CAPACITY){a.set(r,l+Ee.INLINE_OFFSET);return}let m=((n=r[0])!==null&&n!==void 0?n:0)|((i=r[1])!==null&&i!==void 0?i:0)<<8|((o=r[2])!==null&&o!==void 0?o:0)<<16|((s=r[3])!==null&&s!==void 0?s:0)<<24;h.setUint32(Ee.INLINE_OFFSET,m>>>0,!0);let g=jV(e),y=r.slice(),b=g.push(y)-1;h.setInt32(Ee.BUFFER_INDEX_OFFSET,b,!0),h.setInt32(Ee.BUFFER_OFFSET_OFFSET,0,!0)},zV=(e,t,r)=>{let n=r instanceof Uint8Array?r:new Uint8Array(r);VI(e,t,n)},WI=({values:e,valueOffsets:t},r,n)=>jI(e,t,r,jn(n)),qV=(e,t,r)=>{let n=jn(r);VI(e,t,n)},ib=(e,t,r)=>{e.type.unit===ot.DAY?p0(e,t,r):g0(e,t,r)},y0=({values:e},t,r)=>{e[t]=BigInt(r/1e3)},b0=({values:e},t,r)=>{e[t]=BigInt(r)},w0=({values:e},t,r)=>{e[t]=BigInt(r*1e3)},x0=({values:e},t,r)=>{e[t]=BigInt(r*1e6)},ob=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return y0(e,t,r);case q.MILLISECOND:return b0(e,t,r);case q.MICROSECOND:return w0(e,t,r);case q.NANOSECOND:return x0(e,t,r)}},_0=({values:e},t,r)=>{e[t]=r},S0=({values:e},t,r)=>{e[t]=r},M0=({values:e},t,r)=>{e[t]=r},v0=({values:e},t,r)=>{e[t]=r},sb=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return _0(e,t,r);case q.MILLISECOND:return S0(e,t,r);case q.MICROSECOND:return M0(e,t,r);case q.NANOSECOND:return v0(e,t,r)}},ab=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},HI=(e,t,r)=>{let n=e.children[0],i=e.valueOffsets,o=Rr.getVisitFn(n),s=Le(i[t]),a=Le(i[t+1]);if(Array.isArray(r))for(let c=-1,l=s;l<a;)o(n,l++,r[++c]);else for(let c=-1,l=s;l<a;)o(n,l++,r.get(++c))},VV=(e,t,r)=>{let n=e.children[0],{valueOffsets:i}=e,o=Rr.getVisitFn(n),{[t]:s,[t+1]:a}=i,c=r instanceof Map?r.entries():Object.entries(r);for(let l of c)if(o(n,s,l),++s>=a)break},WV=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[o]),HV=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(o)),$V=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(i.name)),KV=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[i.name]),XV=(e,t,r)=>{let n=e.type.children.map(o=>Rr.getVisitFn(o.type)),i=r instanceof Map?$V(t,r):r instanceof $?HV(t,r):Array.isArray(r)?WV(t,r):KV(t,r);e.type.children.forEach((o,s)=>i(n[s],e.children[s],o,s))},YV=(e,t,r)=>{e.type.mode===Ze.Dense?$I(e,t,r):KI(e,t,r)},$I=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];Rr.visit(i,e.valueOffsets[t],r)},KI=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];Rr.visit(i,t,r)},ZV=(e,t,r)=>{var n;(n=e.dictionary)===null||n===void 0||n.set(e.values[t],r)},cb=(e,t,r)=>{switch(e.type.unit){case ke.YEAR_MONTH:return A0(e,t,r);case ke.DAY_TIME:return E0(e,t,r);case ke.MONTH_DAY_NANO:return T0(e,t,r)}},E0=({values:e},t,r)=>{e.set(r.subarray(0,2),2*t)},A0=({values:e},t,r)=>{e[t]=r[0]*12+r[1]%12},T0=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},I0=({values:e},t,r)=>{e[t]=r},P0=({values:e},t,r)=>{e[t]=r},R0=({values:e},t,r)=>{e[t]=r},L0=({values:e},t,r)=>{e[t]=r},lb=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return I0(e,t,r);case q.MILLISECOND:return P0(e,t,r);case q.MICROSECOND:return R0(e,t,r);case q.NANOSECOND:return L0(e,t,r)}},JV=(e,t,r)=>{let{stride:n}=e,i=e.children[0],o=Rr.getVisitFn(i);if(Array.isArray(r))for(let s=-1,a=t*n;++s<n;)o(i,a+s,r[s]);else for(let s=-1,a=t*n;++s<n;)o(i,a+s,r.get(s))};de.prototype.visitBool=be(kV);de.prototype.visitInt=be(es);de.prototype.visitInt8=be(es);de.prototype.visitInt16=be(es);de.prototype.visitInt32=be(es);de.prototype.visitInt64=be(es);de.prototype.visitUint8=be(es);de.prototype.visitUint16=be(es);de.prototype.visitUint32=be(es);de.prototype.visitUint64=be(es);de.prototype.visitFloat=be(UV);de.prototype.visitFloat16=be(zI);de.prototype.visitFloat32=be(rb);de.prototype.visitFloat64=be(rb);de.prototype.visitUtf8=be(WI);de.prototype.visitLargeUtf8=be(WI);de.prototype.visitUtf8View=be(qV);de.prototype.visitBinary=be(qI);de.prototype.visitLargeBinary=be(qI);de.prototype.visitBinaryView=be(zV);de.prototype.visitFixedSizeBinary=be(nb);de.prototype.visitDate=be(ib);de.prototype.visitDateDay=be(p0);de.prototype.visitDateMillisecond=be(g0);de.prototype.visitTimestamp=be(ob);de.prototype.visitTimestampSecond=be(y0);de.prototype.visitTimestampMillisecond=be(b0);de.prototype.visitTimestampMicrosecond=be(w0);de.prototype.visitTimestampNanosecond=be(x0);de.prototype.visitTime=be(sb);de.prototype.visitTimeSecond=be(_0);de.prototype.visitTimeMillisecond=be(S0);de.prototype.visitTimeMicrosecond=be(M0);de.prototype.visitTimeNanosecond=be(v0);de.prototype.visitDecimal=be(ab);de.prototype.visitList=be(HI);de.prototype.visitLargeList=be(HI);de.prototype.visitStruct=be(XV);de.prototype.visitUnion=be(YV);de.prototype.visitDenseUnion=be($I);de.prototype.visitSparseUnion=be(KI);de.prototype.visitDictionary=be(ZV);de.prototype.visitInterval=be(cb);de.prototype.visitIntervalDayTime=be(E0);de.prototype.visitIntervalYearMonth=be(A0);de.prototype.visitIntervalMonthDayNano=be(T0);de.prototype.visitDuration=be(lb);de.prototype.visitDurationSecond=be(I0);de.prototype.visitDurationMillisecond=be(P0);de.prototype.visitDurationMicrosecond=be(R0);de.prototype.visitDurationNanosecond=be(L0);de.prototype.visitFixedSizeList=be(JV);de.prototype.visitMap=be(VV);Rr=new de});var zi,hu,wo,ub,fb,QV,O0=p(()=>{nh();gc();ei();zi=Symbol.for("parent"),hu=Symbol.for("rowIndex"),wo=class{constructor(t,r){return this[zi]=t,this[hu]=r,new Proxy(this,QV)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[hu],r=this[zi],n=r.type.children,i={};for(let o=-1,s=n.length;++o<s;)i[n[o].name]=tr.visit(r.children[o],t);return i}toString(){return`{${[...this].map(([t,r])=>`${Ni(t)}: ${Ni(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new ub(this[zi],this[hu])}},ub=class{constructor(t,r){this.childIndex=0,this.children=t.children,this.rowIndex=r,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,tr.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(wo.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[zi]:{writable:!0,enumerable:!1,configurable:!1,value:null},[hu]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});fb=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[zi].type.children.map(r=>r.name)}has(t,r){return t[zi].type.children.some(n=>n.name===r)}getOwnPropertyDescriptor(t,r){if(t[zi].type.children.some(n=>n.name===r))return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[zi].type.children.findIndex(i=>i.name===r);if(n!==-1){let i=tr.visit(t[zi].children[n],t[hu]);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[zi].type.children.findIndex(o=>o.name===r);return i!==-1?(Rr.visit(t[zi].children[i],t[hu],n),Reflect.set(t,r,n)):Reflect.has(t,r)||typeof r=="symbol"?Reflect.set(t,r,n):!1}},QV=new fb});function ge(e){return(t,r)=>t.getValid(r)?e(t,r):null}var le,eW,du,tW,rW,XI,nW,YI,ZI,ua,iW,JI,oW,QI,e6,sW,t6,aW,cW,lW,uW,r6,n6,i6,o6,fW,s6,a6,c6,l6,hW,dW,u6,mW,pW,gW,f6,h6,yW,bW,d6,m6,p6,g6,y6,b6,w6,wW,xW,tr,gc=p(()=>{d0();jr();In();hh();O0();yo();$o();fh();Dt();le=class extends ie{};eW=(e,t)=>864e5*e[t],du=16,tW=12,rW=(e,t)=>null,XI=(e,t,r)=>{if(r+1>=t.length)return null;let n=Le(t[r]),i=Le(t[r+1]);return e.subarray(n,i)},nW=({offset:e,values:t},r)=>{let n=e+r;return(t[n>>3]&1<<n%8)!==0},YI=({values:e},t)=>eW(e,t),ZI=({values:e},t)=>Le(e[t]),ua=({stride:e,values:t},r)=>t[e*r],iW=({stride:e,values:t},r)=>m0(t[e*r]),JI=({values:e},t)=>e[t],oW=({stride:e,values:t},r)=>t.subarray(e*r,e*(r+1)),QI=({values:e,valueOffsets:t},r)=>XI(e,t,r),e6=(e,t)=>{var r;let n=e.values;if(!n)throw new Error("BinaryView data is missing view buffer");let i=t*du,o=i+du;if(i<0||o>n.length)throw new Error(`BinaryView data buffer is too short: expected ${du} bytes, got ${Math.max(0,n.length-i)}`);let s=n.subarray(i,o);if(s.length<du)throw new Error(`BinaryView data buffer is too short: expected ${du} bytes, got ${s.length}`);let a=new DataView(n.buffer,s.byteOffset,du),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=tW)return s.subarray(4,4+c);let l=a.getInt32(8,!0),u=a.getInt32(12,!0),h=(r=e.variadicBuffers)===null||r===void 0?void 0:r[l];if(!h)throw new Error(`BinaryView variadic buffer ${l} is missing`);return h.subarray(u,u+c)},sW=(e,t)=>e6(e,t),t6=({values:e,valueOffsets:t},r)=>{let n=XI(e,t,r);return n!==null?tu(n):null},aW=(e,t)=>{let r=e6(e,t);return tu(r)},cW=({values:e},t)=>e[t],lW=({type:e,values:t},r)=>e.precision!==He.HALF?t[r]:m0(t[r]),uW=(e,t)=>e.type.unit===ot.DAY?YI(e,t):ZI(e,t),r6=({values:e},t)=>1e3*Le(e[t]),n6=({values:e},t)=>Le(e[t]),i6=({values:e},t)=>Z2(e[t],BigInt(1e3)),o6=({values:e},t)=>Z2(e[t],BigInt(1e6)),fW=(e,t)=>{switch(e.type.unit){case q.SECOND:return r6(e,t);case q.MILLISECOND:return n6(e,t);case q.MICROSECOND:return i6(e,t);case q.NANOSECOND:return o6(e,t)}},s6=({values:e},t)=>e[t],a6=({values:e},t)=>e[t],c6=({values:e},t)=>e[t],l6=({values:e},t)=>e[t],hW=(e,t)=>{switch(e.type.unit){case q.SECOND:return s6(e,t);case q.MILLISECOND:return a6(e,t);case q.MICROSECOND:return c6(e,t);case q.NANOSECOND:return l6(e,t)}},dW=({values:e,stride:t},r)=>pc.decimal(e.subarray(t*r,t*(r+1))),u6=(e,t)=>{let{valueOffsets:r,stride:n,children:i}=e,o=Le(r[t*n]),s=Le(r[t*n+1]),c=i[0].slice(o,s-o);return new $([c])},mW=(e,t)=>{let{valueOffsets:r,children:n}=e,{[t]:i,[t+1]:o}=r,s=n[0];return new gi(s.slice(i,o-i))},pW=(e,t)=>new wo(e,t),gW=(e,t)=>e.type.mode===Ze.Dense?f6(e,t):h6(e,t),f6=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return tr.visit(n,e.valueOffsets[t])},h6=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return tr.visit(n,t)},yW=(e,t)=>{var r;return(r=e.dictionary)===null||r===void 0?void 0:r.get(e.values[t])},bW=(e,t)=>e.type.unit===ke.MONTH_DAY_NANO?p6(e,t):e.type.unit===ke.DAY_TIME?d6(e,t):m6(e,t),d6=({values:e},t)=>e.subarray(2*t,2*(t+1)),m6=({values:e},t)=>{let r=e[t],n=new Int32Array(2);return n[0]=Math.trunc(r/12),n[1]=Math.trunc(r%12),n},p6=({values:e},t)=>e.subarray(4*t,4*(t+1)),g6=({values:e},t)=>e[t],y6=({values:e},t)=>e[t],b6=({values:e},t)=>e[t],w6=({values:e},t)=>e[t],wW=(e,t)=>{switch(e.type.unit){case q.SECOND:return g6(e,t);case q.MILLISECOND:return y6(e,t);case q.MICROSECOND:return b6(e,t);case q.NANOSECOND:return w6(e,t)}},xW=(e,t)=>{let{stride:r,children:n}=e,o=n[0].slice(t*r,r);return new $([o])};le.prototype.visitNull=ge(rW);le.prototype.visitBool=ge(nW);le.prototype.visitInt=ge(cW);le.prototype.visitInt8=ge(ua);le.prototype.visitInt16=ge(ua);le.prototype.visitInt32=ge(ua);le.prototype.visitInt64=ge(JI);le.prototype.visitUint8=ge(ua);le.prototype.visitUint16=ge(ua);le.prototype.visitUint32=ge(ua);le.prototype.visitUint64=ge(JI);le.prototype.visitFloat=ge(lW);le.prototype.visitFloat16=ge(iW);le.prototype.visitFloat32=ge(ua);le.prototype.visitFloat64=ge(ua);le.prototype.visitUtf8=ge(t6);le.prototype.visitLargeUtf8=ge(t6);le.prototype.visitUtf8View=ge(aW);le.prototype.visitBinary=ge(QI);le.prototype.visitLargeBinary=ge(QI);le.prototype.visitBinaryView=ge(sW);le.prototype.visitFixedSizeBinary=ge(oW);le.prototype.visitDate=ge(uW);le.prototype.visitDateDay=ge(YI);le.prototype.visitDateMillisecond=ge(ZI);le.prototype.visitTimestamp=ge(fW);le.prototype.visitTimestampSecond=ge(r6);le.prototype.visitTimestampMillisecond=ge(n6);le.prototype.visitTimestampMicrosecond=ge(i6);le.prototype.visitTimestampNanosecond=ge(o6);le.prototype.visitTime=ge(hW);le.prototype.visitTimeSecond=ge(s6);le.prototype.visitTimeMillisecond=ge(a6);le.prototype.visitTimeMicrosecond=ge(c6);le.prototype.visitTimeNanosecond=ge(l6);le.prototype.visitDecimal=ge(dW);le.prototype.visitList=ge(u6);le.prototype.visitLargeList=ge(u6);le.prototype.visitStruct=ge(pW);le.prototype.visitUnion=ge(gW);le.prototype.visitDenseUnion=ge(f6);le.prototype.visitSparseUnion=ge(h6);le.prototype.visitDictionary=ge(yW);le.prototype.visitInterval=ge(bW);le.prototype.visitIntervalDayTime=ge(d6);le.prototype.visitIntervalYearMonth=ge(m6);le.prototype.visitIntervalMonthDayNano=ge(p6);le.prototype.visitDuration=ge(wW);le.prototype.visitDurationSecond=ge(g6);le.prototype.visitDurationMillisecond=ge(y6);le.prototype.visitDurationMicrosecond=ge(b6);le.prototype.visitDurationNanosecond=ge(w6);le.prototype.visitFixedSizeList=ge(xW);le.prototype.visitMap=ge(mW);tr=new le});var fa,pu,mu,hb,gi,db,mb,hh=p(()=>{jr();nh();gc();ei();fa=Symbol.for("keys"),pu=Symbol.for("vals"),mu=Symbol.for("kKeysAsStrings"),hb=Symbol.for("_kKeysAsStrings"),gi=class{constructor(t){return this[fa]=new $([t.children[0]]).memoize(),this[pu]=t.children[1],new Proxy(this,new mb)}get[mu](){return this[hb]||(this[hb]=Array.from(this[fa].toArray(),String))}[Symbol.iterator](){return new db(this[fa],this[pu])}get size(){return this[fa].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[fa],r=this[pu],n={};for(let i=-1,o=t.length;++i<o;)n[t.get(i)]=tr.visit(r,i);return n}toString(){return`{${[...this].map(([t,r])=>`${Ni(t)}: ${Ni(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},db=class{constructor(t,r){this.keys=t,this.vals=r,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){let t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),tr.visit(this.vals,t)]})}},mb=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[mu]}has(t,r){return t[mu].includes(r)}getOwnPropertyDescriptor(t,r){if(t[mu].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[mu].indexOf(r);if(n!==-1){let i=tr.visit(Reflect.get(t,pu),n);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[mu].indexOf(r);return i!==-1?(Rr.visit(Reflect.get(t,pu),i,n),Reflect.set(t,r,n)):Reflect.has(t,r)?Reflect.set(t,r,n):!1}};Object.defineProperties(gi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[fa]:{writable:!0,enumerable:!1,configurable:!1,value:null},[pu]:{writable:!0,enumerable:!1,configurable:!1,value:null},[hb]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var pb={};ir(pb,{clampRange:()=>dh,createElementComparator:()=>ha,wrapIndex:()=>yc});function dh(e,t,r,n){let{length:i=0}=e,o=typeof t!="number"?0:t,s=typeof r!="number"?i:r;return o<0&&(o=(o%i+i)%i),s<0&&(s=(s%i+i)%i),s<o&&(x6=o,o=s,s=x6),s>i&&(s=i),n?n(e,o,s):[o,s]}function ha(e){if(typeof e!=="object"||e===null)return _6(e)?_6:r=>r===e;if(e instanceof Date){let r=e.valueOf();return n=>n instanceof Date?n.valueOf()===r:!1}return ArrayBuffer.isView(e)?r=>r?y2(e,r):!1:e instanceof Map?SW(e):Array.isArray(e)?_W(e):e instanceof $?MW(e):vW(e,!0)}function _W(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=ha(e[r]);return B0(t)}function SW(e){let t=-1,r=[];for(let n of e.values())r[++t]=ha(n);return B0(r)}function MW(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=ha(e.get(r));return B0(t)}function vW(e,t=!1){let r=Object.keys(e);if(!t&&r.length===0)return()=>!1;let n=[];for(let i=-1,o=r.length;++i<o;)n[i]=ha(e[r[i]]);return B0(n,r)}function B0(e,t){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return EW(e,r);case Map:return S6(e,r,r.keys());case gi:case wo:case Object:case void 0:return S6(e,r,t||Object.keys(r))}return r instanceof $?AW(e,r):!1}}function EW(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++n<r;)if(!e[n](t[n]))return!1;return!0}function AW(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++n<r;)if(!e[n](t.get(n)))return!1;return!0}function S6(e,t,r){let n=r[Symbol.iterator](),i=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),s=0,a=e.length,c=o.next(),l=n.next(),u=i.next();for(;s<a&&!l.done&&!u.done&&!c.done&&!(l.value!==u.value||!e[s](c.value));++s,l=n.next(),u=i.next(),c=o.next());return s===a&&l.done&&u.done&&c.done?!0:(n.return&&n.return(),i.return&&i.return(),o.return&&o.return(),!1)}var x6,yc,_6,gu=p(()=>{jr();hh();O0();fr();yc=(e,t)=>e<0?t+e:e,_6=e=>e!==e});var gb={};ir(gb,{BitIterator:()=>xo,getBit:()=>D0,getBool:()=>yu,packBools:()=>wc,popcnt_array:()=>M6,popcnt_bit_range:()=>mh,popcnt_uint32:()=>C0,setBool:()=>TW,truncateBitmap:()=>bc});function yu(e,t,r,n){return(r&1<<n)!==0}function D0(e,t,r,n){return(r&1<<n)>>n}function TW(e,t,r){return r?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function bc(e,t,r){let n=r.byteLength+7&-8;if(e>0||r.byteLength<n){let i=new Uint8Array(n);return i.set(e%8===0?r.subarray(e>>3):wc(new xo(r,e,t,null,yu)).subarray(0,n)),i}return r}function wc(e){let t=[],r=0,n=0,i=0;for(let s of e)s&&(i|=1<<n),++n===8&&(t[r++]=i,i=n=0);(r===0||n>0)&&(t[r++]=i);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}function mh(e,t,r){if(r-t<=0)return 0;if(r-t<8){let o=0;for(let s of new xo(e,t,r-t,e,D0))o+=s;return o}let n=r>>3<<3,i=t+(t%8===0?0:8-t%8);return mh(e,t,i)+mh(e,n,r)+M6(e,i>>3,n-i>>3)}function M6(e,t,r){let n=0,i=Math.trunc(t),o=new DataView(e.buffer,e.byteOffset,e.byteLength),s=r===void 0?e.byteLength:i+r;for(;s-i>=4;)n+=C0(o.getUint32(i)),i+=4;for(;s-i>=2;)n+=C0(o.getUint16(i)),i+=2;for(;s-i>=1;)n+=C0(o.getUint8(i)),i+=1;return n}function C0(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var xo,xc=p(()=>{xo=class{constructor(t,r,n,i,o){this.bytes=t,this.length=n,this.context=i,this.get=o,this.bit=r%8,this.byteIndex=r>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function te(e){return PW.visit(e)}var IW,v6,ce,yb,PW,yi=p(()=>{jr();Dt();st();xc();st();In();fr();IW=-1,v6=Symbol.for("apache-arrow/Data"),ce=class e{static isData(t){return(t==null?void 0:t[v6])===!0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:t}=this;return z.isSparseUnion(t)?this.children.some(r=>r.nullable):z.isDenseUnion(t)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:r,values:n,nullBitmap:i,typeIds:o}=this;return r&&(t+=r.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),t+=this.variadicBuffers.reduce((s,a)=>{var c;return s+((c=a==null?void 0:a.byteLength)!==null&&c!==void 0?c:0)},0),this.children.reduce((s,a)=>s+a.byteLength,t)}get nullCount(){if(z.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,r;return t<=IW&&(r=this.nullBitmap)&&(this._nullCount=t=r.length===0?0:this.length-mh(r,this.offset,this.offset+this.length)),t}constructor(t,r,n,i,o,s=[],a,c=[]){var l;this.type=t,this.children=s,this.dictionary=a,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let u;o instanceof e?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets,this.variadicBuffers=o.variadicBuffers):(this.stride=Qn(t),o&&((u=o[0])&&(this.valueOffsets=u),(u=o[1])&&(this.values=u),(u=o[2])&&(this.nullBitmap=u),(u=o[3])&&(this.typeIds=u)),this.variadicBuffers=c),(l=this.variadicBuffers)!==null&&l!==void 0||(this.variadicBuffers=[])}getValid(t){let{type:r}=this;if(z.isUnion(r)){let n=r,i=this.typeIds[t],o=n.typeIdToChildIndex[i],s=this.children[o],a=this.valueOffsets,c=n.mode===Ze.Dense&&a?Number(a[t]):t;return s.getValid(c)}if(this.nullable&&this.nullCount>0){let n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(t,r){let n,{type:i}=this;if(z.isUnion(i)){let o=i,s=this.typeIds[t],a=o.typeIdToChildIndex[s],c=this.children[a],l=this.valueOffsets,u=o.mode===Ze.Dense&&l?Number(l[t]):t;n=c.getValid(u),c.setValid(u,r)}else{let{nullBitmap:o}=this,{offset:s,length:a}=this,c=s+t,l=1<<c%8,u=c>>3;(!o||o.byteLength<=u)&&(o=new Uint8Array((s+a+63&-64)>>3).fill(255),this.nullCount>0?(o.set(bc(s,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:o})):Object.assign(this,{nullBitmap:o,_nullCount:0}));let h=o[u];n=(h&l)!==0,o[u]=r?h|l:h&~l}return n!==!!r&&(this._nullCount=this.nullCount+(r?-1:1)),r}clone(t=this.type,r=this.offset,n=this.length,i=this._nullCount,o=this,s=this.children,a=this.variadicBuffers){return new e(t,r,n,i,o,s,this.dictionary,a)}slice(t,r){let{stride:n,typeId:i,children:o}=this,s=+(this._nullCount===0)-1,a=i===16?n:1,c=this._sliceBuffers(t,r,n,i);return this.clone(this.type,this.offset+t,r,s,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*t,a*r),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===x.Null)return this.clone(this.type,0,t,0,this.buffers,this.children,this.variadicBuffers);let{length:r,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,r>>3);i[r>>3]=(1<<r-(r&-8))-1,n>0&&i.set(bc(this.offset,r,this.nullBitmap),0);let o=this.buffers;return o[Ne.VALIDITY]=i,this.clone(this.type,0,t,n+(t-r),o,this.children,this.variadicBuffers)}_sliceBuffers(t,r,n,i){let o,{buffers:s}=this;if((o=s[Ne.TYPE])&&(s[Ne.TYPE]=o.subarray(t,t+r)),z.isBinaryView(this.type)||z.isUtf8View(this.type)){let a=Ee.ELEMENT_WIDTH;(o=s[Ne.DATA])&&(s[Ne.DATA]=o.subarray(t*a,(t+r)*a))}else(o=s[Ne.OFFSET])&&(s[Ne.OFFSET]=o.subarray(t,t+r+1))||(o=s[Ne.DATA])&&(s[Ne.DATA]=i===6?o:o.subarray(n*t,n*(t+r)));return s}_sliceChildren(t,r,n){return t.map(i=>i.slice(r,n))}};ce.prototype.children=Object.freeze([]);ce.prototype[v6]=!0;Object.defineProperty(ce,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ce&&ce.isData(t)}});yb=class e extends ie{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:r,["offset"]:n=0,["length"]:i=0}=t;return new ce(r,n,i,i)}visitBool(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitInt(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitFloat(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitUtf8(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=dc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,i,o])}visitUtf8View(t){var r;let{["type"]:n,["offset"]:i=0}=t,o=Re(n.ArrayType,t.views),s=se(t.nullBitmap),a=(t.variadicBuffers||[]).map(u=>se(u)),c=(r=t.length)!==null&&r!==void 0?r:Math.trunc(o.length/nn.ELEMENT_WIDTH),l=t.nullBitmap?-1:0;return new ce(n,i,c,l,[void 0,o,s],[],void 0,a)}visitLargeUtf8(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=qf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,i,o])}visitBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=dc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,i,o])}visitBinaryView(t){var r;let{["type"]:n,["offset"]:i=0}=t,o=Re(n.ArrayType,t.views),s=se(t.nullBitmap),a=(t.variadicBuffers||[]).map(u=>se(u)),c=(r=t.length)!==null&&r!==void 0?r:Math.trunc(o.length/Ee.ELEMENT_WIDTH),l=t.nullBitmap?-1:0;return new ce(n,i,c,l,[void 0,o,s],[],void 0,a)}visitLargeBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=qf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,i,o])}visitFixedSizeBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/Qn(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitDate(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/Qn(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitTimestamp(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/Qn(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitTime(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/Qn(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitDecimal(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/Qn(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitList(t){let{["type"]:r,["offset"]:n=0,["child"]:i}=t,o=se(t.nullBitmap),s=dc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,void 0,o],[i])}visitLargeList(t){let{["type"]:r,["offset"]:n=0,["child"]:i}=t,o=se(t.nullBitmap),s=qf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,void 0,o],[i])}visitStruct(t){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=t,o=se(t.nullBitmap),{length:s=i.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,void 0,o],i)}visitUnion(t){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=t,o=Re(r.ArrayType,t.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=t;if(z.isSparseUnion(r))return new ce(r,n,s,a,[void 0,void 0,void 0,o],i);let c=dc(t.valueOffsets);return new ce(r,n,s,a,[c,void 0,void 0,o],i)}visitDictionary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.indices.ArrayType,t.data),{["dictionary"]:s=new $([new e().visit({type:r.dictionary})])}=t,{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[void 0,o,i],[],s)}visitInterval(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/Qn(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitDuration(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitFixedSizeList(t){let{["type"]:r,["offset"]:n=0,["child"]:i=new e().visit({type:r.valueType})}=t,o=se(t.nullBitmap),{["length"]:s=i.length/Qn(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,void 0,o],[i])}visitMap(t){let{["type"]:r,["offset"]:n=0,["child"]:i=new e().visit({type:r.childType})}=t,o=se(t.nullBitmap),s=dc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,void 0,o],[i])}},PW=new yb});function E6(e){return e.some(t=>t.nullable)}function N0(e){return e.reduce((t,r)=>t+r.nullCount,0)}function F0(e){return e.reduce((t,r,n)=>(t[n+1]=t[n]+r.length,t),new Uint32Array(e.length+1))}function G0(e,t,r,n){let i=[];for(let o=-1,s=e.length;++o<s;){let a=e[o],c=t[o],{length:l}=a;if(c>=n)break;if(r>=c+l)continue;if(c>=r&&c+l<=n){i.push(a);continue}let u=Math.max(0,r-c),h=Math.min(n-c,l);i.push(a.slice(u,h-u))}return i.length===0&&i.push(e[0].slice(0,0)),i}function bb(e,t,r,n){let i=0,o=0,s=t.length-1;do{if(i>=s-1)return r<t[s]?n(e,i,r-t[i]):null;o=i+Math.trunc((s-i)*.5),r<t[o]?s=o:i=o}while(i<s)}function gh(e,t){return e.getValid(t)}function bu(e){function t(r,n,i){return e(r[n],i)}return function(r){let n=this.data;return bb(n,this._offsets,r,t)}}function k0(e){let t;function r(n,i,o){return e(n[i],o,t)}return function(n,i){let o=this.data;t=i;let s=bb(o,this._offsets,n,r);return t=void 0,s}}function U0(e){let t;function r(n,i,o){let s=o,a=0,c=0;for(let l=i-1,u=n.length;++l<u;){let h=n[l];if(~(a=e(h,t,s)))return c+a;s=0,c+=h.length}return-1}return function(n,i){t=n;let o=this.data,s=typeof i!="number"?r(o,0,0):bb(o,this._offsets,i,r);return t=void 0,s}}var ph,j0=p(()=>{ph=class{constructor(t=0,r){this.numChunks=t,this.getChunkIterator=r,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function RW(e,t){return t===null&&e.length>0?0:-1}function LW(e,t){let{nullBitmap:r}=e;if(!r||e.nullCount<=0)return-1;let n=0;for(let i of new xo(r,e.offset+(t||0),e.length,r,yu)){if(!i)return n;++n}return-1}function xe(e,t,r){if(t===void 0)return-1;if(t===null)switch(e.typeId){case x.Union:break;case x.Dictionary:break;default:return LW(e,r)}let n=tr.getVisitFn(e),i=ha(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}function A6(e,t,r){let n=tr.getVisitFn(e),i=ha(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}var ue,_c,z0=p(()=>{Dt();In();gc();xc();gu();ue=class extends ie{};ue.prototype.visitNull=RW;ue.prototype.visitBool=xe;ue.prototype.visitInt=xe;ue.prototype.visitInt8=xe;ue.prototype.visitInt16=xe;ue.prototype.visitInt32=xe;ue.prototype.visitInt64=xe;ue.prototype.visitUint8=xe;ue.prototype.visitUint16=xe;ue.prototype.visitUint32=xe;ue.prototype.visitUint64=xe;ue.prototype.visitFloat=xe;ue.prototype.visitFloat16=xe;ue.prototype.visitFloat32=xe;ue.prototype.visitFloat64=xe;ue.prototype.visitUtf8=xe;ue.prototype.visitLargeUtf8=xe;ue.prototype.visitUtf8View=xe;ue.prototype.visitBinary=xe;ue.prototype.visitLargeBinary=xe;ue.prototype.visitBinaryView=xe;ue.prototype.visitFixedSizeBinary=xe;ue.prototype.visitDate=xe;ue.prototype.visitDateDay=xe;ue.prototype.visitDateMillisecond=xe;ue.prototype.visitTimestamp=xe;ue.prototype.visitTimestampSecond=xe;ue.prototype.visitTimestampMillisecond=xe;ue.prototype.visitTimestampMicrosecond=xe;ue.prototype.visitTimestampNanosecond=xe;ue.prototype.visitTime=xe;ue.prototype.visitTimeSecond=xe;ue.prototype.visitTimeMillisecond=xe;ue.prototype.visitTimeMicrosecond=xe;ue.prototype.visitTimeNanosecond=xe;ue.prototype.visitDecimal=xe;ue.prototype.visitList=xe;ue.prototype.visitLargeList=xe;ue.prototype.visitStruct=xe;ue.prototype.visitUnion=xe;ue.prototype.visitDenseUnion=A6;ue.prototype.visitSparseUnion=A6;ue.prototype.visitDictionary=xe;ue.prototype.visitInterval=xe;ue.prototype.visitIntervalDayTime=xe;ue.prototype.visitIntervalYearMonth=xe;ue.prototype.visitIntervalMonthDayNano=xe;ue.prototype.visitDuration=xe;ue.prototype.visitDurationSecond=xe;ue.prototype.visitDurationMillisecond=xe;ue.prototype.visitDurationMicrosecond=xe;ue.prototype.visitDurationNanosecond=xe;ue.prototype.visitFixedSizeList=xe;ue.prototype.visitMap=xe;_c=new ue});function ye(e){let{type:t}=e;if(e.nullCount===0&&e.stride===1&&(z.isInt(t)&&t.bitWidth!==64||z.isTime(t)&&t.bitWidth!==64||z.isFloat(t)&&t.precision!==He.HALF))return new ph(e.data.length,n=>{let i=e.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let r=0;return new ph(e.data.length,n=>{let o=e.data[n].length,s=e.slice(r,r+o);return r+=o,new wb(s)})}var fe,wb,wu,q0=p(()=>{In();Dt();st();j0();fe=class extends ie{};wb=class{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};fe.prototype.visitNull=ye;fe.prototype.visitBool=ye;fe.prototype.visitInt=ye;fe.prototype.visitInt8=ye;fe.prototype.visitInt16=ye;fe.prototype.visitInt32=ye;fe.prototype.visitInt64=ye;fe.prototype.visitUint8=ye;fe.prototype.visitUint16=ye;fe.prototype.visitUint32=ye;fe.prototype.visitUint64=ye;fe.prototype.visitFloat=ye;fe.prototype.visitFloat16=ye;fe.prototype.visitFloat32=ye;fe.prototype.visitFloat64=ye;fe.prototype.visitUtf8=ye;fe.prototype.visitLargeUtf8=ye;fe.prototype.visitUtf8View=ye;fe.prototype.visitBinary=ye;fe.prototype.visitLargeBinary=ye;fe.prototype.visitBinaryView=ye;fe.prototype.visitFixedSizeBinary=ye;fe.prototype.visitDate=ye;fe.prototype.visitDateDay=ye;fe.prototype.visitDateMillisecond=ye;fe.prototype.visitTimestamp=ye;fe.prototype.visitTimestampSecond=ye;fe.prototype.visitTimestampMillisecond=ye;fe.prototype.visitTimestampMicrosecond=ye;fe.prototype.visitTimestampNanosecond=ye;fe.prototype.visitTime=ye;fe.prototype.visitTimeSecond=ye;fe.prototype.visitTimeMillisecond=ye;fe.prototype.visitTimeMicrosecond=ye;fe.prototype.visitTimeNanosecond=ye;fe.prototype.visitDecimal=ye;fe.prototype.visitList=ye;fe.prototype.visitLargeList=ye;fe.prototype.visitStruct=ye;fe.prototype.visitUnion=ye;fe.prototype.visitDenseUnion=ye;fe.prototype.visitSparseUnion=ye;fe.prototype.visitDictionary=ye;fe.prototype.visitInterval=ye;fe.prototype.visitIntervalDayTime=ye;fe.prototype.visitIntervalYearMonth=ye;fe.prototype.visitIntervalMonthDayNano=ye;fe.prototype.visitDuration=ye;fe.prototype.visitDurationSecond=ye;fe.prototype.visitDurationMillisecond=ye;fe.prototype.visitDurationMicrosecond=ye;fe.prototype.visitDurationNanosecond=ye;fe.prototype.visitFixedSizeList=ye;fe.prototype.visitMap=ye;wu=new fe});function _o(e){if(e){if(e instanceof ce)return new $([e]);if(e instanceof $)return new $(e.data);if(e.type instanceof z)return new $([te(e)]);if(Array.isArray(e))return new $(e.flatMap(t=>OW(t)));if(ArrayBuffer.isView(e)){e instanceof DataView&&(e=new Uint8Array(e.buffer));let t={offset:0,length:e.length,nullCount:-1,data:e};if(e instanceof Int8Array)return new $([te(Object.assign(Object.assign({},t),{type:new Hn}))]);if(e instanceof Int16Array)return new $([te(Object.assign(Object.assign({},t),{type:new $n}))]);if(e instanceof Int32Array)return new $([te(Object.assign(Object.assign({},t),{type:new Xt}))]);if(e instanceof BigInt64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Kn}))]);if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)return new $([te(Object.assign(Object.assign({},t),{type:new Xn}))]);if(e instanceof Uint16Array)return new $([te(Object.assign(Object.assign({},t),{type:new Yn}))]);if(e instanceof Uint32Array)return new $([te(Object.assign(Object.assign({},t),{type:new tn}))]);if(e instanceof BigUint64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Gi}))]);if(e instanceof Float32Array)return new $([te(Object.assign(Object.assign({},t),{type:new rn}))]);if(e instanceof Float64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Zn}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function OW(e){return e instanceof ce?[e]:e instanceof $?e.data:_o(e).data}var T6,I6,P6,R6,$,V0,jr=p(()=>{Dt();gu();st();yi();j0();gc();ei();z0();q0();st();I6=Symbol.for("apache-arrow/Vector"),P6={},R6={},$=class e{static isVector(t){return(t==null?void 0:t[I6])===!0}constructor(t){var r,n,i;let o=t[0]instanceof e?t.flatMap(a=>a.data):t;if(o.length===0||o.some(a=>!(a instanceof ce)))throw new TypeError("Vector constructor expects an Array of Data instances.");let s=(r=o[0])===null||r===void 0?void 0:r.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:l}=P6[s.typeId],u=o[0];this.isValid=h=>gh(u,h),this.get=h=>a(u,h),this.set=(h,d)=>c(u,h,d),this.indexOf=h=>l(u,h),this._offsets=[0,u.length];break}default:Object.setPrototypeOf(this,R6[s.typeId]),this._offsets=F0(o);break}this.data=o,this.type=s,this.stride=Qn(s),this.numChildren=(i=(n=s.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,r)=>t+r.byteLength,0)}get nullable(){return E6(this.data)}get nullCount(){return N0(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${x[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(yc(t,this.length))}set(t,r){}indexOf(t,r){return-1}includes(t,r){return this.indexOf(t,r)>-1}[Symbol.iterator](){return wu.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(t,r){return new e(dh(this,t,r,({data:n,_offsets:i},o,s)=>G0(n,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:t,data:r,length:n,stride:i,ArrayType:o}=this;switch(t.typeId){case x.Int:case x.Float:case x.Decimal:case x.Time:case x.Timestamp:switch(r.length){case 0:return new o;case 1:return r[0].values.subarray(0,n*i);default:return r.reduce((s,{values:a,length:c})=>(s.array.set(a.subarray(0,c*i),s.offset),s.offset+=c*i,s),{array:new o(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new e(this.data.map(({children:r})=>r[t])):null}get isMemoized(){return z.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(z.isDictionary(this.type)){let t=new V0(this.data[0].dictionary),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return new V0(this)}unmemoize(){if(z.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return this}};T6=Symbol.toStringTag;$[T6]=(e=>{e.type=z.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0,e[I6]=!0;let t=Object.keys(x).map(r=>x[r]).filter(r=>typeof r=="number"&&r!==x.NONE);for(let r of t){let n=tr.getVisitFnByTypeId(r),i=Rr.getVisitFnByTypeId(r),o=_c.getVisitFnByTypeId(r);P6[r]={get:n,set:i,indexOf:o},R6[r]=Object.create(e,{isValid:{value:bu(gh)},get:{value:bu(tr.getVisitFnByTypeId(r))},set:{value:k0(Rr.getVisitFnByTypeId(r))},indexOf:{value:U0(_c.getVisitFnByTypeId(r))}})}return"Vector"})($.prototype);Object.defineProperty($,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===$&&$.isVector(t)}});V0=class e extends ${constructor(t){super(t.data);let r=this.get,n=this.set,i=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(s){let a=o[s];if(a!==void 0)return a;let c=r.call(this,s);return o[s]=c,c}}),Object.defineProperty(this,"set",{value(s,a){n.call(this,s,a),o[s]=a}}),Object.defineProperty(this,"slice",{value:(s,a)=>new e(i.call(this,s,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new $(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function L6(e){if(!e||e.length<=0)return function(i){return!0};let t="",r=e.filter(n=>n===n);return r.length>0&&(t=`
1
+ "use strict";var MD=Object.create;var B1=Object.defineProperty;var vD=Object.getOwnPropertyDescriptor;var ED=Object.getOwnPropertyNames;var TD=Object.getPrototypeOf,AD=Object.prototype.hasOwnProperty;var p=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var ae=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Jt=(e,t)=>{for(var r in t)B1(e,r,{get:t[r],enumerable:!0})},ID=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ED(t))!AD.call(e,i)&&i!==r&&B1(e,i,{get:()=>t[i],enumerable:!(n=vD(t,i))||n.enumerable});return e};var me=(e,t,r)=>(r=e!=null?MD(TD(e)):{},ID(t||!e||!e.__esModule?B1(r,"default",{value:e,enumerable:!0}):r,e));var K_,eN,tN,rN,nN,iN,oN,sN,aN,cN,lN,uN,fN,hN,dN,f,Ji=p(()=>{K_=e=>typeof e<"u"&&e!==null,eN=e=>typeof e=="object",tN=e=>Object.prototype.toString.call(e)==="[object Object]",rN=e=>typeof e=="function",nN=e=>typeof e=="boolean",iN=e=>e instanceof Buffer,oN=e=>{if(K_(e))switch(e.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},sN=e=>e instanceof ArrayBuffer,aN=e=>typeof e=="string"&&e.length>0,cN=e=>typeof e=="number"&&Number.isFinite(e),lN=e=>Number.isInteger(e),uN=(e,t,r)=>e>=t&&e<=r,fN=(e,t)=>t.includes(e),hN=(e,t,r)=>{let n;try{n=String(r).slice(0,100)}catch{}return new Error(`Expected ${t} for ${e} but received ${n} of type ${typeof r}`)},dN=(e,t)=>(t.message=e.message,t),f={defined:K_,object:eN,plainObject:tN,fn:rN,bool:nN,buffer:iN,typedArray:oN,arrayBuffer:sN,string:aN,number:cN,integer:lN,inRange:uN,inArray:fN,invalidParameterError:hN,nativeError:dN}});var Z_=ae((mY,Y_)=>{"use strict";var X_=()=>process.platform==="linux",hd=null,mN=()=>{if(!hd)if(X_()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,hd=process.report.getReport(),process.report.excludeNetwork=e}else hd={};return hd};Y_.exports={isLinux:X_,getReport:mN}});var Q_=ae((pY,J_)=>{"use strict";var yl=require("fs"),pN="/usr/bin/ldd",gN="/proc/self/exe",dd=2048,yN=e=>{let t=yl.openSync(e,"r"),r=Buffer.alloc(dd),n=yl.readSync(t,r,0,dd,0);return yl.close(t,()=>{}),r.subarray(0,n)},bN=e=>new Promise((t,r)=>{yl.open(e,"r",(n,i)=>{if(n)r(n);else{let o=Buffer.alloc(dd);yl.read(i,o,0,dd,0,(s,a)=>{t(o.subarray(0,a)),yl.close(i,()=>{})})}})});J_.exports={LDD_PATH:pN,SELF_PATH:gN,readFileSync:yN,readFile:bN}});var tS=ae((gY,eS)=>{"use strict";var wN=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),r=e.readUInt16LE(54),n=e.readUInt16LE(56);for(let i=0;i<n;i++){let o=t+i*r;if(e.readUInt32LE(o)===3){let a=e.readUInt32LE(o+8),c=e.readUInt32LE(o+32);return e.subarray(a,a+c).toString().replace(/\0.*$/g,"")}}return null};eS.exports={interpreterPath:wN}});var pd=ae((yY,wS)=>{"use strict";var nS=require("child_process"),{isLinux:bl,getReport:iS}=Z_(),{LDD_PATH:md,SELF_PATH:oS,readFile:U1,readFileSync:j1}=Q_(),{interpreterPath:sS}=tS(),Qi,eo,to,aS="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",vs="",cS=()=>vs||new Promise(e=>{nS.exec(aS,(t,r)=>{vs=t?" ":r,e(vs)})}),lS=()=>{if(!vs)try{vs=nS.execSync(aS,{encoding:"utf8"})}catch{vs=" "}return vs},Bo="glibc",uS=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Za="musl",xN=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),fS=()=>{let e=iS();return e.header&&e.header.glibcVersionRuntime?Bo:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(xN)?Za:null},hS=e=>{let[t,r]=e.split(/[\r\n]+/);return t&&t.includes(Bo)?Bo:r&&r.includes(Za)?Za:null},dS=e=>{if(e){if(e.includes("/ld-musl-"))return Za;if(e.includes("/ld-linux-"))return Bo}return null},mS=e=>(e=e.toString(),e.includes("musl")?Za:e.includes("GNU C Library")?Bo:null),_N=async()=>{if(eo!==void 0)return eo;eo=null;try{let e=await U1(md);eo=mS(e)}catch{}return eo},SN=()=>{if(eo!==void 0)return eo;eo=null;try{let e=j1(md);eo=mS(e)}catch{}return eo},MN=async()=>{if(Qi!==void 0)return Qi;Qi=null;try{let e=await U1(oS),t=sS(e);Qi=dS(t)}catch{}return Qi},vN=()=>{if(Qi!==void 0)return Qi;Qi=null;try{let e=j1(oS),t=sS(e);Qi=dS(t)}catch{}return Qi},pS=async()=>{let e=null;if(bl()&&(e=await MN(),!e&&(e=await _N(),e||(e=fS()),!e))){let t=await cS();e=hS(t)}return e},gS=()=>{let e=null;if(bl()&&(e=vN(),!e&&(e=SN(),e||(e=fS()),!e))){let t=lS();e=hS(t)}return e},EN=async()=>bl()&&await pS()!==Bo,TN=()=>bl()&&gS()!==Bo,AN=async()=>{if(to!==void 0)return to;to=null;try{let t=(await U1(md)).match(uS);t&&(to=t[1])}catch{}return to},IN=()=>{if(to!==void 0)return to;to=null;try{let t=j1(md).match(uS);t&&(to=t[1])}catch{}return to},yS=()=>{let e=iS();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},rS=e=>e.trim().split(/\s+/)[1],bS=e=>{let[t,r,n]=e.split(/[\r\n]+/);return t&&t.includes(Bo)?rS(t):r&&n&&r.includes(Za)?rS(n):null},PN=async()=>{let e=null;if(bl()&&(e=await AN(),e||(e=yS()),!e)){let t=await cS();e=bS(t)}return e},RN=()=>{let e=null;if(bl()&&(e=IN(),e||(e=yS()),!e)){let t=lS();e=bS(t)}return e};wS.exports={GLIBC:Bo,MUSL:Za,family:pS,familySync:gS,isNonGlibcLinux:EN,isNonGlibcLinuxSync:TN,version:PN,versionSync:RN}});var wl=ae((bY,xS)=>{"use strict";var LN="2.0.0",ON=Number.MAX_SAFE_INTEGER||9007199254740991,BN=16,CN=250,DN=["major","premajor","minor","preminor","patch","prepatch","prerelease"];xS.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:BN,MAX_SAFE_BUILD_LENGTH:CN,MAX_SAFE_INTEGER:ON,RELEASE_TYPES:DN,SEMVER_SPEC_VERSION:LN,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var uf=ae((wY,_S)=>{"use strict";var NN=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};_S.exports=NN});var xl=ae((ro,SS)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:z1,MAX_SAFE_BUILD_LENGTH:FN,MAX_LENGTH:GN}=wl(),kN=uf();ro=SS.exports={};var UN=ro.re=[],jN=ro.safeRe=[],Y=ro.src=[],zN=ro.safeSrc=[],Z=ro.t={},qN=0,q1="[a-zA-Z0-9-]",VN=[["\\s",1],["\\d",GN],[q1,FN]],WN=e=>{for(let[t,r]of VN)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},Pe=(e,t,r)=>{let n=WN(t),i=qN++;kN(e,i,t),Z[e]=i,Y[i]=t,zN[i]=n,UN[i]=new RegExp(t,r?"g":void 0),jN[i]=new RegExp(n,r?"g":void 0)};Pe("NUMERICIDENTIFIER","0|[1-9]\\d*");Pe("NUMERICIDENTIFIERLOOSE","\\d+");Pe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${q1}*`);Pe("MAINVERSION",`(${Y[Z.NUMERICIDENTIFIER]})\\.(${Y[Z.NUMERICIDENTIFIER]})\\.(${Y[Z.NUMERICIDENTIFIER]})`);Pe("MAINVERSIONLOOSE",`(${Y[Z.NUMERICIDENTIFIERLOOSE]})\\.(${Y[Z.NUMERICIDENTIFIERLOOSE]})\\.(${Y[Z.NUMERICIDENTIFIERLOOSE]})`);Pe("PRERELEASEIDENTIFIER",`(?:${Y[Z.NONNUMERICIDENTIFIER]}|${Y[Z.NUMERICIDENTIFIER]})`);Pe("PRERELEASEIDENTIFIERLOOSE",`(?:${Y[Z.NONNUMERICIDENTIFIER]}|${Y[Z.NUMERICIDENTIFIERLOOSE]})`);Pe("PRERELEASE",`(?:-(${Y[Z.PRERELEASEIDENTIFIER]}(?:\\.${Y[Z.PRERELEASEIDENTIFIER]})*))`);Pe("PRERELEASELOOSE",`(?:-?(${Y[Z.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[Z.PRERELEASEIDENTIFIERLOOSE]})*))`);Pe("BUILDIDENTIFIER",`${q1}+`);Pe("BUILD",`(?:\\+(${Y[Z.BUILDIDENTIFIER]}(?:\\.${Y[Z.BUILDIDENTIFIER]})*))`);Pe("FULLPLAIN",`v?${Y[Z.MAINVERSION]}${Y[Z.PRERELEASE]}?${Y[Z.BUILD]}?`);Pe("FULL",`^${Y[Z.FULLPLAIN]}$`);Pe("LOOSEPLAIN",`[v=\\s]*${Y[Z.MAINVERSIONLOOSE]}${Y[Z.PRERELEASELOOSE]}?${Y[Z.BUILD]}?`);Pe("LOOSE",`^${Y[Z.LOOSEPLAIN]}$`);Pe("GTLT","((?:<|>)?=?)");Pe("XRANGEIDENTIFIERLOOSE",`${Y[Z.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Pe("XRANGEIDENTIFIER",`${Y[Z.NUMERICIDENTIFIER]}|x|X|\\*`);Pe("XRANGEPLAIN",`[v=\\s]*(${Y[Z.XRANGEIDENTIFIER]})(?:\\.(${Y[Z.XRANGEIDENTIFIER]})(?:\\.(${Y[Z.XRANGEIDENTIFIER]})(?:${Y[Z.PRERELEASE]})?${Y[Z.BUILD]}?)?)?`);Pe("XRANGEPLAINLOOSE",`[v=\\s]*(${Y[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[Z.XRANGEIDENTIFIERLOOSE]})(?:${Y[Z.PRERELEASELOOSE]})?${Y[Z.BUILD]}?)?)?`);Pe("XRANGE",`^${Y[Z.GTLT]}\\s*${Y[Z.XRANGEPLAIN]}$`);Pe("XRANGELOOSE",`^${Y[Z.GTLT]}\\s*${Y[Z.XRANGEPLAINLOOSE]}$`);Pe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${z1}})(?:\\.(\\d{1,${z1}}))?(?:\\.(\\d{1,${z1}}))?`);Pe("COERCE",`${Y[Z.COERCEPLAIN]}(?:$|[^\\d])`);Pe("COERCEFULL",Y[Z.COERCEPLAIN]+`(?:${Y[Z.PRERELEASE]})?(?:${Y[Z.BUILD]})?(?:$|[^\\d])`);Pe("COERCERTL",Y[Z.COERCE],!0);Pe("COERCERTLFULL",Y[Z.COERCEFULL],!0);Pe("LONETILDE","(?:~>?)");Pe("TILDETRIM",`(\\s*)${Y[Z.LONETILDE]}\\s+`,!0);ro.tildeTrimReplace="$1~";Pe("TILDE",`^${Y[Z.LONETILDE]}${Y[Z.XRANGEPLAIN]}$`);Pe("TILDELOOSE",`^${Y[Z.LONETILDE]}${Y[Z.XRANGEPLAINLOOSE]}$`);Pe("LONECARET","(?:\\^)");Pe("CARETTRIM",`(\\s*)${Y[Z.LONECARET]}\\s+`,!0);ro.caretTrimReplace="$1^";Pe("CARET",`^${Y[Z.LONECARET]}${Y[Z.XRANGEPLAIN]}$`);Pe("CARETLOOSE",`^${Y[Z.LONECARET]}${Y[Z.XRANGEPLAINLOOSE]}$`);Pe("COMPARATORLOOSE",`^${Y[Z.GTLT]}\\s*(${Y[Z.LOOSEPLAIN]})$|^$`);Pe("COMPARATOR",`^${Y[Z.GTLT]}\\s*(${Y[Z.FULLPLAIN]})$|^$`);Pe("COMPARATORTRIM",`(\\s*)${Y[Z.GTLT]}\\s*(${Y[Z.LOOSEPLAIN]}|${Y[Z.XRANGEPLAIN]})`,!0);ro.comparatorTrimReplace="$1$2$3";Pe("HYPHENRANGE",`^\\s*(${Y[Z.XRANGEPLAIN]})\\s+-\\s+(${Y[Z.XRANGEPLAIN]})\\s*$`);Pe("HYPHENRANGELOOSE",`^\\s*(${Y[Z.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[Z.XRANGEPLAINLOOSE]})\\s*$`);Pe("STAR","(<|>)?=?\\s*\\*");Pe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Pe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var gd=ae((xY,MS)=>{"use strict";var HN=Object.freeze({loose:!0}),$N=Object.freeze({}),KN=e=>e?typeof e!="object"?HN:e:$N;MS.exports=KN});var V1=ae((_Y,TS)=>{"use strict";var vS=/^[0-9]+$/,ES=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=vS.test(e),n=vS.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},XN=(e,t)=>ES(t,e);TS.exports={compareIdentifiers:ES,rcompareIdentifiers:XN}});var Mr=ae((SY,IS)=>{"use strict";var yd=uf(),{MAX_LENGTH:AS,MAX_SAFE_INTEGER:bd}=wl(),{safeRe:wd,t:xd}=xl(),YN=gd(),{compareIdentifiers:W1}=V1(),ZN=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(W1(e[n],r[n])!==0)return!1;return!0},H1=class e{constructor(t,r){if(r=YN(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>AS)throw new TypeError(`version is longer than ${AS} characters`);yd("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?wd[xd.LOOSE]:wd[xd.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>bd||this.major<0)throw new TypeError("Invalid major version");if(this.minor>bd||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>bd||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<bd)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(yd("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(yd("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return W1(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(yd("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return W1(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?wd[xd.PRERELEASELOOSE]:wd[xd.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];if(n===!1&&(o=[r]),ZN(this.prerelease,r)){let s=this.prerelease[r.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};IS.exports=H1});var Es=ae((MY,RS)=>{"use strict";var PS=Mr(),JN=(e,t,r=!1)=>{if(e instanceof PS)return e;try{return new PS(e,t)}catch(n){if(!r)return null;throw n}};RS.exports=JN});var OS=ae((vY,LS)=>{"use strict";var QN=Es(),eF=(e,t)=>{let r=QN(e,t);return r?r.version:null};LS.exports=eF});var CS=ae((EY,BS)=>{"use strict";var tF=Es(),rF=(e,t)=>{let r=tF(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};BS.exports=rF});var FS=ae((TY,NS)=>{"use strict";var DS=Mr(),nF=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new DS(e instanceof DS?e.version:e,r).inc(t,n,i).version}catch{return null}};NS.exports=nF});var US=ae((AY,kS)=>{"use strict";var GS=Es(),iF=(e,t)=>{let r=GS(e,null,!0),n=GS(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};kS.exports=iF});var zS=ae((IY,jS)=>{"use strict";var oF=Mr(),sF=(e,t)=>new oF(e,t).major;jS.exports=sF});var VS=ae((PY,qS)=>{"use strict";var aF=Mr(),cF=(e,t)=>new aF(e,t).minor;qS.exports=cF});var HS=ae((RY,WS)=>{"use strict";var lF=Mr(),uF=(e,t)=>new lF(e,t).patch;WS.exports=uF});var KS=ae((LY,$S)=>{"use strict";var fF=Es(),hF=(e,t)=>{let r=fF(e,t);return r&&r.prerelease.length?r.prerelease:null};$S.exports=hF});var fi=ae((OY,YS)=>{"use strict";var XS=Mr(),dF=(e,t,r)=>new XS(e,r).compare(new XS(t,r));YS.exports=dF});var JS=ae((BY,ZS)=>{"use strict";var mF=fi(),pF=(e,t,r)=>mF(t,e,r);ZS.exports=pF});var eM=ae((CY,QS)=>{"use strict";var gF=fi(),yF=(e,t)=>gF(e,t,!0);QS.exports=yF});var _d=ae((DY,rM)=>{"use strict";var tM=Mr(),bF=(e,t,r)=>{let n=new tM(e,r),i=new tM(t,r);return n.compare(i)||n.compareBuild(i)};rM.exports=bF});var iM=ae((NY,nM)=>{"use strict";var wF=_d(),xF=(e,t)=>e.sort((r,n)=>wF(r,n,t));nM.exports=xF});var sM=ae((FY,oM)=>{"use strict";var _F=_d(),SF=(e,t)=>e.sort((r,n)=>_F(n,r,t));oM.exports=SF});var ff=ae((GY,aM)=>{"use strict";var MF=fi(),vF=(e,t,r)=>MF(e,t,r)>0;aM.exports=vF});var Sd=ae((kY,cM)=>{"use strict";var EF=fi(),TF=(e,t,r)=>EF(e,t,r)<0;cM.exports=TF});var $1=ae((UY,lM)=>{"use strict";var AF=fi(),IF=(e,t,r)=>AF(e,t,r)===0;lM.exports=IF});var K1=ae((jY,uM)=>{"use strict";var PF=fi(),RF=(e,t,r)=>PF(e,t,r)!==0;uM.exports=RF});var Md=ae((zY,fM)=>{"use strict";var LF=fi(),OF=(e,t,r)=>LF(e,t,r)>=0;fM.exports=OF});var vd=ae((qY,hM)=>{"use strict";var BF=fi(),CF=(e,t,r)=>BF(e,t,r)<=0;hM.exports=CF});var X1=ae((VY,dM)=>{"use strict";var DF=$1(),NF=K1(),FF=ff(),GF=Md(),kF=Sd(),UF=vd(),jF=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return DF(e,r,n);case"!=":return NF(e,r,n);case">":return FF(e,r,n);case">=":return GF(e,r,n);case"<":return kF(e,r,n);case"<=":return UF(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};dM.exports=jF});var pM=ae((WY,mM)=>{"use strict";var zF=Mr(),qF=Es(),{safeRe:Ed,t:Td}=xl(),VF=(e,t)=>{if(e instanceof zF)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Ed[Td.COERCEFULL]:Ed[Td.COERCE]);else{let c=t.includePrerelease?Ed[Td.COERCERTLFULL]:Ed[Td.COERCERTL],l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return qF(`${n}.${i}.${o}${s}${a}`,t)};mM.exports=VF});var yM=ae((HY,gM)=>{"use strict";var WF=Es(),HF=wl(),$F=Mr(),KF=(e,t,r)=>{if(!HF.RELEASE_TYPES.includes(t))return null;let n=XF(e,r);return n&&YF(n,t)},XF=(e,t)=>{let r=e instanceof $F?e.version:e;return WF(r,t)},YF=(e,t)=>{if(ZF(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},ZF=e=>e.startsWith("pre");gM.exports=KF});var wM=ae(($Y,bM)=>{"use strict";var Y1=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}};bM.exports=Y1});var hi=ae((KY,MM)=>{"use strict";var JF=/\s+/g,Z1=class e{constructor(t,r){if(r=e7(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof J1)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(JF," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!_M(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&l7(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(c7,"");let n=((this.options.includePrerelease&&s7)|(this.options.loose&&a7))+":"+t,i=xM.get(n);if(i)return i;let o=this.options.loose,s=o?Jr[vr.HYPHENRANGELOOSE]:Jr[vr.HYPHENRANGE];t=t.replace(s,x7(this.options.includePrerelease)),Et("hyphen replace",t),t=t.replace(Jr[vr.COMPARATORTRIM],n7),Et("comparator trim",t),t=t.replace(Jr[vr.TILDETRIM],i7),Et("tilde trim",t),t=t.replace(Jr[vr.CARETTRIM],o7),Et("caret trim",t);let a=t.split(" ").map(h=>u7(h,this.options)).join(" ").split(/\s+/).map(h=>w7(h,this.options));o&&(a=a.filter(h=>(Et("loose invalid filter",h,this.options),!!h.match(Jr[vr.COMPARATORLOOSE])))),Et("range list",a);let c=new Map,l=a.map(h=>new J1(h,this.options));for(let h of l){if(_M(h))return[h];c.set(h.value,h)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return xM.set(n,u),u}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>SM(n,r)&&t.set.some(i=>SM(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new t7(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(_7(this.set[r],t,this.options))return!0;return!1}};MM.exports=Z1;var QF=wM(),xM=new QF,e7=gd(),J1=hf(),Et=uf(),t7=Mr(),{safeRe:Jr,src:r7,t:vr,comparatorTrimReplace:n7,tildeTrimReplace:i7,caretTrimReplace:o7}=xl(),{FLAG_INCLUDE_PRERELEASE:s7,FLAG_LOOSE:a7}=wl(),c7=new RegExp(r7[vr.BUILD],"g"),_M=e=>e.value==="<0.0.0-0",l7=e=>e.value==="",SM=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,t)),i=n.pop();return r},u7=(e,t)=>(e=e.replace(Jr[vr.BUILD],""),Et("comp",e,t),e=m7(e,t),Et("caret",e),e=h7(e,t),Et("tildes",e),e=g7(e,t),Et("xrange",e),e=b7(e,t),Et("stars",e),e),ar=e=>!e||e.toLowerCase()==="x"||e==="*",f7=(e,t,r)=>ar(e)&&!ar(t)||ar(t)&&r&&!ar(r),h7=(e,t)=>e.trim().split(/\s+/).map(r=>d7(r,t)).join(" "),d7=(e,t)=>{let r=t.loose?Jr[vr.TILDELOOSE]:Jr[vr.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{Et("tilde",e,i,o,s,a,c);let l;return ar(o)?l="":ar(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:ar(a)?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c?(Et("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,Et("tilde return",l),l})},m7=(e,t)=>e.trim().split(/\s+/).map(r=>p7(r,t)).join(" "),p7=(e,t)=>{Et("caret",e,t);let r=t.loose?Jr[vr.CARETLOOSE]:Jr[vr.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{Et("caret",e,i,o,s,a,c);let l;return ar(o)?l="":ar(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:ar(a)?o==="0"?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:c?(Et("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(Et("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Et("caret return",l),l})},g7=(e,t)=>(Et("replaceXRanges",e,t),e.split(/\s+/).map(r=>y7(r,t)).join(" ")),y7=(e,t)=>{e=e.trim();let r=t.loose?Jr[vr.XRANGELOOSE]:Jr[vr.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{if(Et("xRange",e,n,i,o,s,a,c),f7(o,s,a))return e;let l=ar(o),u=l||ar(s),h=u||ar(a),d=h;return i==="="&&d&&(i=""),c=t.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&d?(u&&(s=0),a=0,i===">"?(i=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",u?o=+o+1:s=+s+1),i==="<"&&(c="-0"),n=`${i+o}.${s}.${a}${c}`):u?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:h&&(n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),Et("xRange return",n),n})},b7=(e,t)=>(Et("replaceStars",e,t),e.trim().replace(Jr[vr.STAR],"")),w7=(e,t)=>(Et("replaceGTE0",e,t),e.trim().replace(Jr[t.includePrerelease?vr.GTE0PRE:vr.GTE0],"")),x7=e=>(t,r,n,i,o,s,a,c,l,u,h,d)=>(ar(n)?r="":ar(i)?r=`>=${n}.0.0${e?"-0":""}`:ar(o)?r=`>=${n}.${i}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,ar(l)?c="":ar(u)?c=`<${+l+1}.0.0-0`:ar(h)?c=`<${l}.${+u+1}.0-0`:d?c=`<=${l}.${u}.${h}-${d}`:e?c=`<${l}.${u}.${+h+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),_7=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Et(e[n].semver),e[n].semver!==J1.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var hf=ae((XY,PM)=>{"use strict";var df=Symbol("SemVer ANY"),tg=class e{static get ANY(){return df}constructor(t,r){if(r=vM(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),eg("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===df?this.value="":this.value=this.operator+this.semver.version,eg("comp",this)}parse(t){let r=this.options.loose?EM[TM.COMPARATORLOOSE]:EM[TM.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new AM(n[2],this.options.loose):this.semver=df}toString(){return this.value}test(t){if(eg("Comparator.test",t,this.options.loose),this.semver===df||t===df)return!0;if(typeof t=="string")try{t=new AM(t,this.options)}catch{return!1}return Q1(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new IM(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new IM(this.value,r).test(t.semver):(r=vM(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||Q1(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||Q1(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};PM.exports=tg;var vM=gd(),{safeRe:EM,t:TM}=xl(),Q1=X1(),eg=uf(),AM=Mr(),IM=hi()});var mf=ae((YY,RM)=>{"use strict";var S7=hi(),M7=(e,t,r)=>{try{t=new S7(t,r)}catch{return!1}return t.test(e)};RM.exports=M7});var OM=ae((ZY,LM)=>{"use strict";var v7=hi(),E7=(e,t)=>new v7(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));LM.exports=E7});var CM=ae((JY,BM)=>{"use strict";var T7=Mr(),A7=hi(),I7=(e,t,r)=>{let n=null,i=null,o=null;try{o=new A7(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new T7(n,r))}),n};BM.exports=I7});var NM=ae((QY,DM)=>{"use strict";var P7=Mr(),R7=hi(),L7=(e,t,r)=>{let n=null,i=null,o=null;try{o=new R7(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new P7(n,r))}),n};DM.exports=L7});var kM=ae((eZ,GM)=>{"use strict";var rg=Mr(),O7=hi(),FM=ff(),B7=(e,t)=>{e=new O7(e,t);let r=new rg("0.0.0");if(e.test(r)||(r=new rg("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;i.forEach(s=>{let a=new rg(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||FM(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||FM(r,o))&&(r=o)}return r&&e.test(r)?r:null};GM.exports=B7});var jM=ae((tZ,UM)=>{"use strict";var C7=hi(),D7=(e,t)=>{try{return new C7(e,t).range||"*"}catch{return null}};UM.exports=D7});var Ad=ae((rZ,WM)=>{"use strict";var N7=Mr(),VM=hf(),{ANY:F7}=VM,G7=hi(),k7=mf(),zM=ff(),qM=Sd(),U7=vd(),j7=Md(),z7=(e,t,r,n)=>{e=new N7(e,n),t=new G7(t,n);let i,o,s,a,c;switch(r){case">":i=zM,o=U7,s=qM,a=">",c=">=";break;case"<":i=qM,o=j7,s=zM,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(k7(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],h=null,d=null;if(u.forEach(m=>{m.semver===F7&&(m=new VM(">=0.0.0")),h=h||m,d=d||m,i(m.semver,h.semver,n)?h=m:s(m.semver,d.semver,n)&&(d=m)}),h.operator===a||h.operator===c||(!d.operator||d.operator===a)&&o(e,d.semver))return!1;if(d.operator===c&&s(e,d.semver))return!1}return!0};WM.exports=z7});var $M=ae((nZ,HM)=>{"use strict";var q7=Ad(),V7=(e,t,r)=>q7(e,t,">",r);HM.exports=V7});var XM=ae((iZ,KM)=>{"use strict";var W7=Ad(),H7=(e,t,r)=>W7(e,t,"<",r);KM.exports=H7});var JM=ae((oZ,ZM)=>{"use strict";var YM=hi(),$7=(e,t,r)=>(e=new YM(e,r),t=new YM(t,r),e.intersects(t,r));ZM.exports=$7});var e3=ae((sZ,QM)=>{"use strict";var K7=mf(),X7=fi();QM.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((u,h)=>X7(u,h,r));for(let u of s)K7(u,t,r)?(o=u,i||(i=u)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[u,h]of n)u===h?a.push(u):!h&&u===s[0]?a.push("*"):h?u===s[0]?a.push(`<=${h}`):a.push(`${u} - ${h}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t}});var s3=ae((aZ,o3)=>{"use strict";var t3=hi(),og=hf(),{ANY:ng}=og,ig=mf(),sg=fi(),Y7=(e,t,r={})=>{if(e===t)return!0;e=new t3(e,r),t=new t3(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=J7(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Z7=[new og(">=0.0.0-0")],r3=[new og(">=0.0.0")],J7=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===ng){if(t.length===1&&t[0].semver===ng)return!0;r.includePrerelease?e=Z7:e=r3}if(t.length===1&&t[0].semver===ng){if(r.includePrerelease)return!0;t=r3}let n=new Set,i,o;for(let m of e)m.operator===">"||m.operator===">="?i=n3(i,m,r):m.operator==="<"||m.operator==="<="?o=i3(o,m,r):n.add(m.semver);if(n.size>1)return null;let s;if(i&&o){if(s=sg(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let m of n){if(i&&!ig(m,String(i),r)||o&&!ig(m,String(o),r))return null;for(let g of t)if(!ig(m,String(g),r))return!1;return!0}let a,c,l,u,h=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&o.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let m of t){if(u=u||m.operator===">"||m.operator===">=",l=l||m.operator==="<"||m.operator==="<=",i){if(d&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===d.major&&m.semver.minor===d.minor&&m.semver.patch===d.patch&&(d=!1),m.operator===">"||m.operator===">="){if(a=n3(i,m,r),a===m&&a!==i)return!1}else if(i.operator===">="&&!m.test(i.semver))return!1}if(o){if(h&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===h.major&&m.semver.minor===h.minor&&m.semver.patch===h.patch&&(h=!1),m.operator==="<"||m.operator==="<="){if(c=i3(o,m,r),c===m&&c!==o)return!1}else if(o.operator==="<="&&!m.test(o.semver))return!1}if(!m.operator&&(o||i)&&s!==0)return!1}return!(i&&l&&!o&&s!==0||o&&u&&!i&&s!==0||d||h)},n3=(e,t,r)=>{if(!e)return t;let n=sg(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},i3=(e,t,r)=>{if(!e)return t;let n=sg(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};o3.exports=Y7});var u3=ae((cZ,l3)=>{"use strict";var ag=xl(),a3=wl(),Q7=Mr(),c3=V1(),e9=Es(),t9=OS(),r9=CS(),n9=FS(),i9=US(),o9=zS(),s9=VS(),a9=HS(),c9=KS(),l9=fi(),u9=JS(),f9=eM(),h9=_d(),d9=iM(),m9=sM(),p9=ff(),g9=Sd(),y9=$1(),b9=K1(),w9=Md(),x9=vd(),_9=X1(),S9=pM(),M9=yM(),v9=hf(),E9=hi(),T9=mf(),A9=OM(),I9=CM(),P9=NM(),R9=kM(),L9=jM(),O9=Ad(),B9=$M(),C9=XM(),D9=JM(),N9=e3(),F9=s3();l3.exports={parse:e9,valid:t9,clean:r9,inc:n9,diff:i9,major:o9,minor:s9,patch:a9,prerelease:c9,compare:l9,rcompare:u9,compareLoose:f9,compareBuild:h9,sort:d9,rsort:m9,gt:p9,lt:g9,eq:y9,neq:b9,gte:w9,lte:x9,cmp:_9,coerce:S9,truncate:M9,Comparator:v9,Range:E9,satisfies:T9,toComparators:A9,maxSatisfying:I9,minSatisfying:P9,minVersion:R9,validRange:L9,outside:O9,gtr:B9,ltr:C9,intersects:D9,simplifyRange:N9,subset:F9,SemVer:Q7,re:ag.re,src:ag.src,tokens:ag.t,SEMVER_SPEC_VERSION:a3.SEMVER_SPEC_VERSION,RELEASE_TYPES:a3.RELEASE_TYPES,compareIdentifiers:c3.compareIdentifiers,rcompareIdentifiers:c3.rcompareIdentifiers}});var Co,Id=p(()=>{Co={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.5",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unneb\xE4ck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix B\xFCnemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","J\xE9r\xE9my Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kot\u011B\u0161ovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouci\xF1o <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugu\xE9 <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.5","@img/sharp-darwin-x64":"0.35.5","@img/sharp-freebsd-wasm32":"0.35.5","@img/sharp-libvips-darwin-arm64":"1.3.4","@img/sharp-libvips-darwin-x64":"1.3.4","@img/sharp-libvips-linux-arm":"1.3.4","@img/sharp-libvips-linux-arm64":"1.3.4","@img/sharp-libvips-linux-ppc64":"1.3.4","@img/sharp-libvips-linux-riscv64":"1.3.4","@img/sharp-libvips-linux-s390x":"1.3.4","@img/sharp-libvips-linux-x64":"1.3.4","@img/sharp-libvips-linuxmusl-arm64":"1.3.4","@img/sharp-libvips-linuxmusl-x64":"1.3.4","@img/sharp-linux-arm":"0.35.5","@img/sharp-linux-arm64":"0.35.5","@img/sharp-linux-ppc64":"0.35.5","@img/sharp-linux-riscv64":"0.35.5","@img/sharp-linux-s390x":"0.35.5","@img/sharp-linux-x64":"0.35.5","@img/sharp-linuxmusl-arm64":"0.35.5","@img/sharp-linuxmusl-x64":"0.35.5","@img/sharp-webcontainers-wasm32":"0.35.5","@img/sharp-win32-arm64":"0.35.5","@img/sharp-win32-ia32":"0.35.5","@img/sharp-win32-x64":"0.35.5"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.14","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.3","@img/sharp-libvips-dev":"1.3.4","@img/sharp-libvips-dev-wasm32":"1.3.4","@img/sharp-libvips-win32-arm64":"1.3.4","@img/sharp-libvips-win32-ia32":"1.3.4","@img/sharp-libvips-win32-x64":"1.3.4","@types/node":"*",emnapi:"^1.11.3","exif-reader":"^2.0.3",icc:"^4.0.0","node-addon-api":"^8.9.2","node-gyp":"^12.4.0",publint:"^0.3.24","tar-fs":"^3.1.3",tsd:"^0.33.0",yauzl:"^3.4.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.7"},funding:{url:"https://opencollective.com/libvips"}}});var Sl,h3,pf,lg,k9,d3,U9,ug,j9,m3,z9,_l,q9,V9,W9,H9,p3,$9,f3,K9,X9,g3,Y9,Z9,y3,cg,J9,Pd,fg=p(()=>{Sl=require("node:child_process"),h3=require("node:crypto"),pf=me(u3(),1),lg=me(pd(),1);Id();k9=process.env.npm_package_config_libvips||Co.config.libvips,d3=pf.default.coerce(k9).version,U9=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],ug={encoding:"utf8",shell:!0},j9=e=>{e instanceof Error?console.error(`sharp: Installation error: ${e.message}`):console.log(`sharp: ${e}`)},m3=()=>lg.default.isNonGlibcLinuxSync()?lg.default.familySync():"",z9=()=>`${process.platform}${m3()}-${process.arch}`,_l=()=>{if(p3())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=process.env,n=typeof r=="string"?r:m3();return`${t||process.platform}${n}-${e||process.arch}`},q9=()=>{try{return require(`@img/sharp-libvips-dev-${_l()}/include`)}catch{try{return require("@img/sharp-libvips-dev/include")}catch{}}return""},V9=()=>{try{return require("@img/sharp-libvips-dev/cplusplus")}catch{}return""},W9=()=>{try{return require(`@img/sharp-libvips-dev-${_l()}/lib`)}catch{try{return require(`@img/sharp-libvips-${_l()}/lib`)}catch{}}return""},H9=()=>{var e;if(((e=process.release)==null?void 0:e.name)==="node"&&process.versions&&!pf.default.satisfies(process.versions.node,Co.engines.node))return{found:process.versions.node,expected:Co.engines.node}},p3=()=>{let{CC:e}=process.env;return!!(e!=null&&e.endsWith("/emcc"))},$9=()=>process.platform==="darwin"&&process.arch==="x64"?((0,Sl.spawnSync)("sysctl sysctl.proc_translated",ug).stdout||"").trim()==="sysctl.proc_translated: 1":!1,f3=e=>(0,h3.createHash)("sha512").update(e).digest("hex"),K9=()=>{try{let e=f3(`imgsharp-libvips-${_l()}`),t=pf.default.coerce(Co.optionalDependencies[`@img/sharp-libvips-${_l()}`],{includePrerelease:!0}).version;return f3(`${e}npm:${t}`).slice(0,10)}catch{}return""},X9=()=>(0,Sl.spawnSync)(`node-gyp rebuild --directory=src ${p3()?"--nodedir=emscripten":""}`,{...ug,stdio:"inherit"}).status,g3=()=>process.platform!=="win32"?((0,Sl.spawnSync)("pkg-config --modversion vips-cpp",{...ug,env:{...process.env,PKG_CONFIG_PATH:y3()}}).stdout||"").trim():"",Y9=()=>{try{let e=((0,Sl.spawnSync)("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(e)return`${e}/lib/pkgconfig`}catch{}},Z9=()=>{try{let e=((0,Sl.spawnSync)("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(e)return e}catch{}},y3=()=>process.platform!=="win32"?[Y9(),Z9(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":"):"",cg=(e,t,r)=>(r&&r(`Detected ${t}, skipping search for globally-installed libvips`),e),J9=e=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return cg(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return cg(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if($9())return cg(!1,"Rosetta",e);let t=g3();return!!t&&pf.default.gte(t,d3)},Pd={minimumLibvipsVersion:d3,prebuiltPlatforms:U9,buildPlatformArch:_l,buildSharpLibvipsIncludeDir:q9,buildSharpLibvipsCPlusPlusDir:V9,buildSharpLibvipsLibDir:W9,isUnsupportedNodeRuntime:H9,runtimePlatformArch:z9,log:j9,yarnLocator:K9,spawnRebuild:X9,globalLibvipsVersion:g3,pkgConfigPath:y3,useGlobalLibvips:J9}});var w3,Rd,rG,cr,x3,Q9,b3,eG,tG,Do,yt,Ts,nt,gf=p(()=>{w3=require("node:module"),Rd=me(pd(),1);fg();Id();rG={};cr=(0,w3.createRequire)(rG.url),{version:x3}=Co,{runtimePlatformArch:Q9,isUnsupportedNodeRuntime:b3,prebuiltPlatforms:eG,minimumLibvipsVersion:tG}=Pd,Do=Q9(),Ts=[];try{yt=cr(`../src/build/Release/sharp-${Do}-${x3}.node`)}catch(e){Ts.push(e)}if(!yt)try{yt=cr(`../src/build/Release/sharp-wasm32-${x3}.node`)}catch(e){Ts.push(e)}if(!yt)try{switch(Do){case"darwin-arm64":yt=cr("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":yt=cr("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":yt=cr("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":yt=cr("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":yt=cr("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":yt=cr("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":yt=cr("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":yt=cr("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":yt=cr("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":yt=cr("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":yt=cr("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":yt=cr("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":yt=cr("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":yt=cr("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":yt=cr("@img/sharp-webcontainers-wasm32/sharp.node");break}if(yt&&["linux-x64","linuxmusl-x64"].includes(Do)&&!yt._isUsingX64V2()){let e=new Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");e.code="Unsupported CPU",Ts.push(e),yt=null}yt&&process.versions.electron&&Do.startsWith("linux")&&process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(e){Ts.push(e)}if(!yt)try{yt=cr("@img/sharp-wasm32/sharp.node")}catch(e){Ts.push(e)}if(!yt){let[e,t,r]=["linux","darwin","win32"].map(o=>Do.startsWith(o)),n=[`Could not load the "sharp" module using the ${Do} runtime`];Ts.forEach(o=>{var s;(s=o.code)!=null&&s.endsWith("MODULE_NOT_FOUND")||n.push(o.code?`${o.code}: ${o.message}`:o.message)});let i=Ts.map(o=>o.message).join(" ");if(n.push("Possible solutions:"),b3()){let{found:o,expected:s}=b3();n.push("- Please upgrade Node.js:",` Found ${o}`,` Requires ${s}`)}else if(eG.includes(Do)&&!/libstdc\+\+\.so/.test(i)){let[o,s]=Do.split("-"),a=o.endsWith("musl")?" --libc=musl":"";n.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${o.replace("musl","")}${a} --cpu=${s} sharp`)}else n.push(`- Manually install libvips >= ${tG}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(i))try{let{config:o}=cr(`@img/sharp-libvips-${Do}/package`),s=`${(0,Rd.familySync)()} ${(0,Rd.versionSync)()}`,a=`${o.musl?"musl":"glibc"} ${o.musl||o.glibc}`;n.push("- Update your OS:",` Found ${s}`,` Requires ${a}`)}catch{}throw e&&/\/snap\/core[0-9]{2}/.test(i)&&n.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(i)&&n.push("- Update Homebrew:"," brew update && brew upgrade vips"),Ts.some(o=>o.code==="ERR_DLOPEN_DISABLED")&&n.push("- Run Node.js without using the --no-addons flag"),r&&/The specified procedure could not be found/.test(i)&&n.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),n.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(n.join(`
2
+ `))}nt=yt});function oG(){let e=this.constructor.call(),{debuglog:t,queueListener:r,...n}=this.options;return e.options=structuredClone(n),e.options.debuglog=t,e.options.queueListener=r,this._isStreamInput()&&this._whenStreamInFinished(()=>{this._flattenBufferIn(),e.options.input.buffer=this.options.input.buffer,e.emit("finish")}),e}var _3,Ld,nG,iG,Ja,no,S3=p(()=>{_3=me(require("node:util"),1),Ld=me(require("node:stream"),1);Ji();gf();nG=_3.default.debuglog("sharp"),iG=e=>{Ja.queue.emit("change",e)},Ja=function(e,t){if(arguments.length===1&&!f.defined(e))throw new Error("Invalid input");return this instanceof Ja?(Ld.default.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:r=>{this.emit("warning",r),nG(r)},queueListener:iG},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this):new Ja(e,t)};Object.setPrototypeOf(Ja.prototype,Ld.default.Duplex.prototype);Object.setPrototypeOf(Ja,Ld.default.Duplex);Object.assign(Ja.prototype,{clone:oG});no=Ja});function M3(e){let t=aG.filter(r=>f.defined(e[r])).map(r=>[r,e[r]]);return t.length?Object.fromEntries(t):void 0}function cG(e,t,r){let n={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(f.string(e))n.file=e;else if(f.buffer(e)){if(e.length===0)throw Error("Input Buffer is empty");n.buffer=e}else if(f.arrayBuffer(e)){if(e.byteLength===0)throw Error("Input bit Array is empty");n.buffer=Buffer.from(e,0,e.byteLength)}else if(f.typedArray(e)){if(e.length===0)throw Error("Input Bit Array is empty");n.buffer=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(f.plainObject(e)&&!f.defined(t))t=e,M3(t)&&(n.buffer=[]);else if(!f.defined(e)&&!f.defined(t)&&f.object(r)&&r.allowStream)n.buffer=[];else if(Array.isArray(e))if(e.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=e.map(i=>this._createInputDescriptor(i));else throw new Error("Recursive join is unsupported");else throw new Error("Expected at least two images to join");else throw new Error(`Unsupported input '${e}' of type ${typeof e}${f.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(f.object(t)){if(f.defined(t.failOn))if(f.string(t.failOn)&&f.inArray(t.failOn,["none","truncated","error","warning"]))n.failOn=t.failOn;else throw f.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(f.defined(t.autoOrient))if(f.bool(t.autoOrient))n.autoOrient=t.autoOrient;else throw f.invalidParameterError("autoOrient","boolean",t.autoOrient);if(f.defined(t.density))if(f.number(t.density)&&f.inRange(t.density,1,1e5))n.density=t.density;else throw f.invalidParameterError("density","number between 1 and 100000",t.density);if(f.defined(t.ignoreIcc))if(f.bool(t.ignoreIcc))n.ignoreIcc=t.ignoreIcc;else throw f.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(f.defined(t.limitInputPixels))if(f.bool(t.limitInputPixels))n.limitInputPixels=t.limitInputPixels?16383**2:0;else if(f.integer(t.limitInputPixels)&&f.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))n.limitInputPixels=t.limitInputPixels;else throw f.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(f.defined(t.limitInputChannels))if(f.bool(t.limitInputChannels))n.limitInputChannels=t.limitInputChannels?5:0;else if(f.integer(t.limitInputChannels)&&f.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))n.limitInputChannels=t.limitInputChannels;else throw f.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(f.defined(t.unlimited))if(f.bool(t.unlimited))n.unlimited=t.unlimited;else throw f.invalidParameterError("unlimited","boolean",t.unlimited);if(f.defined(t.sequentialRead))if(f.bool(t.sequentialRead))n.sequentialRead=t.sequentialRead;else throw f.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(f.defined(t.raw)){if(f.object(t.raw)&&f.integer(t.raw.width)&&f.inRange(t.raw.width,1,1e8)&&f.integer(t.raw.height)&&f.inRange(t.raw.height,1,1e8)&&f.integer(t.raw.channels)&&f.inRange(t.raw.channels,1,4))switch(n.rawWidth=t.raw.width,n.rawHeight=t.raw.height,n.rawChannels=t.raw.channels,e.constructor){case Uint8Array:case Uint8ClampedArray:n.rawDepth="uchar";break;case Int8Array:n.rawDepth="char";break;case Uint16Array:n.rawDepth="ushort";break;case Int16Array:n.rawDepth="short";break;case Uint32Array:n.rawDepth="uint";break;case Int32Array:n.rawDepth="int";break;case Float32Array:n.rawDepth="float";break;case Float64Array:n.rawDepth="double";break;default:n.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(n.rawPremultiplied=!1,f.defined(t.raw.premultiplied))if(f.bool(t.raw.premultiplied))n.rawPremultiplied=t.raw.premultiplied;else throw f.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(n.rawPageHeight=0,f.defined(t.raw.pageHeight))if(f.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw new Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);n.rawPageHeight=t.raw.pageHeight}else throw f.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(f.defined(t.animated))if(f.bool(t.animated))n.pages=t.animated?-1:1;else throw f.invalidParameterError("animated","boolean",t.animated);if(f.defined(t.pages))if(f.integer(t.pages)&&f.inRange(t.pages,-1,1e5))n.pages=t.pages;else throw f.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(f.defined(t.page))if(f.integer(t.page)&&f.inRange(t.page,0,1e5))n.page=t.page;else throw f.invalidParameterError("page","integer between 0 and 100000",t.page);if(f.object(t.openSlide)&&f.defined(t.openSlide.level))if(f.integer(t.openSlide.level)&&f.inRange(t.openSlide.level,0,256))n.openSlideLevel=t.openSlide.level;else throw f.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(f.defined(t.level))if(f.integer(t.level)&&f.inRange(t.level,0,256))n.openSlideLevel=t.level;else throw f.invalidParameterError("level","integer between 0 and 256",t.level);if(f.object(t.tiff)&&f.defined(t.tiff.subifd))if(f.integer(t.tiff.subifd)&&f.inRange(t.tiff.subifd,-1,1e5))n.tiffSubifd=t.tiff.subifd;else throw f.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(f.defined(t.subifd))if(f.integer(t.subifd)&&f.inRange(t.subifd,-1,1e5))n.tiffSubifd=t.subifd;else throw f.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(f.object(t.svg)){if(f.defined(t.svg.stylesheet))if(f.string(t.svg.stylesheet))n.svgStylesheet=t.svg.stylesheet;else throw f.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(f.defined(t.svg.highBitdepth))if(f.bool(t.svg.highBitdepth))n.svgHighBitdepth=t.svg.highBitdepth;else throw f.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(f.object(t.pdf)&&f.defined(t.pdf.background)?n.pdfBackground=this._getBackgroundColourOption(t.pdf.background):f.defined(t.pdfBackground)&&(n.pdfBackground=this._getBackgroundColourOption(t.pdfBackground)),f.object(t.jp2)&&f.defined(t.jp2.oneshot))if(f.bool(t.jp2.oneshot))n.jp2Oneshot=t.jp2.oneshot;else throw f.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(f.defined(t.create))if(f.object(t.create)&&f.integer(t.create.width)&&f.inRange(t.create.width,1,1e8)&&f.integer(t.create.height)&&f.inRange(t.create.height,1,1e8)&&f.integer(t.create.channels)){if(n.createWidth=t.create.width,n.createHeight=t.create.height,n.createChannels=t.create.channels,n.createPageHeight=0,f.defined(t.create.pageHeight))if(f.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw new Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);n.createPageHeight=t.create.pageHeight}else throw f.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(f.defined(t.create.noise)){if(!f.object(t.create.noise))throw new Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(n.createNoiseType=t.create.noise.type,!f.inRange(t.create.channels,1,4))throw f.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(n.createNoiseMean=128,f.defined(t.create.noise.mean))if(f.number(t.create.noise.mean)&&f.inRange(t.create.noise.mean,0,1e4))n.createNoiseMean=t.create.noise.mean;else throw f.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(n.createNoiseSigma=30,f.defined(t.create.noise.sigma))if(f.number(t.create.noise.sigma)&&f.inRange(t.create.noise.sigma,0,1e4))n.createNoiseSigma=t.create.noise.sigma;else throw f.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(f.defined(t.create.background)){if(!f.inRange(t.create.channels,3,4))throw f.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);n.createBackground=this._getBackgroundColourOption(t.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete n.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(f.defined(t.text))if(f.object(t.text)&&f.string(t.text.text)){if(n.textValue=t.text.text,f.defined(t.text.height)&&f.defined(t.text.dpi))throw new Error("Expected only one of dpi or height");if(f.defined(t.text.font))if(f.string(t.text.font))n.textFont=t.text.font;else throw f.invalidParameterError("text.font","string",t.text.font);if(f.defined(t.text.fontfile))if(f.string(t.text.fontfile))n.textFontfile=t.text.fontfile;else throw f.invalidParameterError("text.fontfile","string",t.text.fontfile);if(f.defined(t.text.width))if(f.integer(t.text.width)&&f.inRange(t.text.width,1,1e6))n.textWidth=t.text.width;else throw f.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(f.defined(t.text.height))if(f.integer(t.text.height)&&f.inRange(t.text.height,1,1e6))n.textHeight=t.text.height;else throw f.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(f.defined(t.text.align))if(f.string(t.text.align)&&f.string(this.constructor.align[t.text.align]))n.textAlign=this.constructor.align[t.text.align];else throw f.invalidParameterError("text.align","valid alignment",t.text.align);if(f.defined(t.text.justify))if(f.bool(t.text.justify))n.textJustify=t.text.justify;else throw f.invalidParameterError("text.justify","boolean",t.text.justify);if(f.defined(t.text.dpi))if(f.integer(t.text.dpi)&&f.inRange(t.text.dpi,1,1e6))n.textDpi=t.text.dpi;else throw f.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(f.defined(t.text.rgba))if(f.bool(t.text.rgba))n.textRgba=t.text.rgba;else throw f.invalidParameterError("text.rgba","bool",t.text.rgba);if(f.defined(t.text.spacing))if(f.integer(t.text.spacing)&&f.inRange(t.text.spacing,-1e6,1e6))n.textSpacing=t.text.spacing;else throw f.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(f.defined(t.text.wrap))if(f.string(t.text.wrap)&&f.inArray(t.text.wrap,["word","char","word-char","none"]))n.textWrap=t.text.wrap;else throw f.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete n.buffer}else throw new Error("Expected a valid string to create an image with text.");if(f.defined(t.join))if(f.defined(this.options.join)){if(f.defined(t.join.animated))if(f.bool(t.join.animated))n.joinAnimated=t.join.animated;else throw f.invalidParameterError("join.animated","boolean",t.join.animated);if(f.defined(t.join.across))if(f.integer(t.join.across)&&f.inRange(t.join.across,1,1e6))n.joinAcross=t.join.across;else throw f.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(f.defined(t.join.shim))if(f.integer(t.join.shim)&&f.inRange(t.join.shim,0,1e6))n.joinShim=t.join.shim;else throw f.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(f.defined(t.join.background)&&(n.joinBackground=this._getBackgroundColourOption(t.join.background)),f.defined(t.join.halign))if(f.string(t.join.halign)&&f.string(this.constructor.align[t.join.halign]))n.joinHalign=this.constructor.align[t.join.halign];else throw f.invalidParameterError("join.halign","valid alignment",t.join.halign);if(f.defined(t.join.valign))if(f.string(t.join.valign)&&f.string(this.constructor.align[t.join.valign]))n.joinValign=this.constructor.align[t.join.valign];else throw f.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(f.defined(t))throw new Error(`Invalid input options ${t}`);return n}function lG(e,t,r){Array.isArray(this.options.input.buffer)?f.buffer(e)?(this.options.input.buffer.push(e),r()):r(new Error("Non-Buffer data on Writable Stream")):r(new Error("Unexpected data on Writable Stream"))}function uG(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function fG(){return Array.isArray(this.options.input.buffer)}function hG(e){this.writableFinished?e():this.once("finish",e)}function dG(e){let t=Error();return f.fn(e)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.metadata(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)})}):nt.metadata(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}):new Promise((r,n)=>{nt.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}function mG(e){let t=Error();return f.fn(e)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.stats(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)})}):nt.stats(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.stats(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}):new Promise((r,n)=>{nt.stats(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}var sG,aG,v3,E3=p(()=>{Ji();gf();sG={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},aG=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"];v3=e=>{Object.assign(e.prototype,{_inputOptionsFromObject:M3,_createInputDescriptor:cG,_write:lG,_flattenBufferIn:uG,_isStreamInput:fG,_whenStreamInFinished:hG,metadata:dG,stats:mG}),e.align=sG}});function dg(e){return e.angle%360!==0||e.rotationAngle!==0}function Od(e){return e.width!==-1||e.height!==-1}function yG(e,t,r){if(Od(this.options)&&this.options.debuglog("ignoring previous resize options"),this.options.widthPost!==-1&&this.options.debuglog("operation order will be: extract, resize, extract"),f.defined(e))if(f.object(e)&&!f.defined(r))r=e;else if(f.integer(e)&&f.inRange(e,1,1e8))this.options.width=e;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",e);else this.options.width=-1;if(f.defined(t))if(f.integer(t)&&f.inRange(t,1,1e8))this.options.height=t;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",t);else this.options.height=-1;if(f.object(r)){if(f.defined(r.width))if(f.integer(r.width)&&f.inRange(r.width,1,1e8))this.options.width=r.width;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",r.width);if(f.defined(r.height))if(f.integer(r.height)&&f.inRange(r.height,1,1e8))this.options.height=r.height;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",r.height);if(f.defined(r.fit)){let n=gG[r.fit];if(f.string(n))this.options.canvas=n;else throw f.invalidParameterError("fit","valid fit",r.fit)}if(f.defined(r.position)){let n=f.integer(r.position)?r.position:P3[r.position]||I3[r.position]||A3[r.position];if(f.integer(n)&&(f.inRange(n,0,8)||f.inRange(n,16,17)))this.options.position=n;else throw f.invalidParameterError("position","valid position/gravity/strategy",r.position)}if(this._setBackgroundColourOption("resizeBackground",r.background),f.defined(r.kernel))if(f.string(hg[r.kernel]))this.options.kernel=hg[r.kernel];else throw f.invalidParameterError("kernel","valid kernel name",r.kernel);f.defined(r.withoutEnlargement)&&this._setBooleanOption("withoutEnlargement",r.withoutEnlargement),f.defined(r.withoutReduction)&&this._setBooleanOption("withoutReduction",r.withoutReduction),f.defined(r.fastShrinkOnLoad)&&this._setBooleanOption("fastShrinkOnLoad",r.fastShrinkOnLoad)}return dg(this.options)&&Od(this.options)&&(this.options.rotateBefore=!0),this}function bG(e){if(f.integer(e))if(f.inRange(e,1,1e8))this.options.extendTop=e,this.options.extendBottom=e,this.options.extendLeft=e,this.options.extendRight=e;else throw f.invalidParameterError("extend","integer between 1 and 100000000",e);else if(f.object(e)){if(f.defined(e.top))if(f.integer(e.top)&&f.inRange(e.top,0,1e8))this.options.extendTop=e.top;else throw f.invalidParameterError("top","integer between 0 and 100000000",e.top);if(f.defined(e.bottom))if(f.integer(e.bottom)&&f.inRange(e.bottom,0,1e8))this.options.extendBottom=e.bottom;else throw f.invalidParameterError("bottom","integer between 0 and 100000000",e.bottom);if(f.defined(e.left))if(f.integer(e.left)&&f.inRange(e.left,0,1e8))this.options.extendLeft=e.left;else throw f.invalidParameterError("left","integer between 0 and 100000000",e.left);if(f.defined(e.right))if(f.integer(e.right)&&f.inRange(e.right,0,1e8))this.options.extendRight=e.right;else throw f.invalidParameterError("right","integer between 0 and 100000000",e.right);if(this._setBackgroundColourOption("extendBackground",e.background),f.defined(e.extendWith))if(f.string(T3[e.extendWith]))this.options.extendWith=T3[e.extendWith];else throw f.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",e.extendWith)}else throw f.invalidParameterError("extend","integer or object",e);return this}function wG(e){let t=Od(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${t}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(r){let n=e[r];if(f.integer(n)&&f.inRange(n,0,1e8))this.options[r+(r==="left"||r==="top"?"Offset":"")+t]=n;else throw f.invalidParameterError(r,"integer between 0 and 100000000",n)},this),dg(this.options)&&!Od(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function xG(e){if(this.options.trimThreshold=10,f.defined(e))if(f.object(e)){if(f.defined(e.background)&&this._setBackgroundColourOption("trimBackground",e.background),f.defined(e.threshold))if(f.number(e.threshold)&&e.threshold>=0)this.options.trimThreshold=e.threshold;else throw f.invalidParameterError("threshold","positive number",e.threshold);if(f.defined(e.lineArt)&&this._setBooleanOption("trimLineArt",e.lineArt),f.defined(e.margin))if(f.integer(e.margin)&&f.inRange(e.margin,0,1e7))this.options.trimMargin=e.margin;else throw f.invalidParameterError("margin","integer between 0 and 10000000",e.margin)}else throw f.invalidParameterError("trim","object",e);return dg(this.options)&&(this.options.rotateBefore=!0),this}var A3,I3,T3,P3,hg,pG,gG,R3,L3=p(()=>{Ji();A3={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},I3={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},T3={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},P3={entropy:16,attention:17},hg={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},pG={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},gG={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};R3=e=>{Object.assign(e.prototype,{resize:yG,extend:bG,extract:wG,trim:xG}),e.gravity=A3,e.strategy=P3,e.kernel=hg,e.fit=pG,e.position=I3}});function _G(e){if(!Array.isArray(e))throw f.invalidParameterError("images to composite","array",e);return this.options.composite=e.map(t=>{if(!f.object(t))throw f.invalidParameterError("image to composite","object",t);let r=this._inputOptionsFromObject(t),n={input:this._createInputDescriptor(t.input,r,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(f.defined(t.blend))if(f.string(mg[t.blend]))n.blend=mg[t.blend];else throw f.invalidParameterError("blend","valid blend name",t.blend);if(f.defined(t.tile))if(f.bool(t.tile))n.tile=t.tile;else throw f.invalidParameterError("tile","boolean",t.tile);if(f.defined(t.left))if(f.integer(t.left)&&f.inRange(t.left,-1e8,1e8))n.left=t.left;else throw f.invalidParameterError("left","integer between -100000000 and 100000000",t.left);if(f.defined(t.top))if(f.integer(t.top)&&f.inRange(t.top,-1e8,1e8))n.top=t.top;else throw f.invalidParameterError("top","integer between -100000000 and 100000000",t.top);if(f.defined(t.top)!==f.defined(t.left))throw new Error("Expected both left and top to be set");if(n.hasOffset=f.integer(t.top)&&f.integer(t.left),f.defined(t.gravity))if(f.integer(t.gravity)&&f.inRange(t.gravity,0,8))n.gravity=t.gravity;else if(f.string(t.gravity)&&f.integer(this.constructor.gravity[t.gravity]))n.gravity=this.constructor.gravity[t.gravity];else throw f.invalidParameterError("gravity","valid gravity",t.gravity);if(f.defined(t.premultiplied))if(f.bool(t.premultiplied))n.premultiplied=t.premultiplied;else throw f.invalidParameterError("premultiplied","boolean",t.premultiplied);return n}),this}var mg,O3,B3=p(()=>{Ji();mg={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};O3=e=>{e.prototype.composite=_G,e.blend=mg}});function SG(e,t){if(!f.defined(e))return this.autoOrient();if((this.options.angle||this.options.rotationAngle)&&(this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0),f.integer(e)&&!(e%90))this.options.angle=e;else if(f.number(e))this.options.rotationAngle=e,f.object(t)&&t.background&&this._setBackgroundColourOption("rotationBackground",t.background);else throw f.invalidParameterError("angle","numeric",e);return this}function MG(){return this.options.input.autoOrient=!0,this}function vG(e){return this.options.flip=f.bool(e)?e:!0,this}function EG(e){return this.options.flop=f.bool(e)?e:!0,this}function TG(e,t){let n=Array.isArray(e)&&(e.length===4&&e.every(f.number)||e.length===2&&e.every(i=>Array.isArray(i)&&i.length===2))?e.flat():[];if(n.length===4&&n.every(f.number))this.options.affineMatrix=n;else throw f.invalidParameterError("matrix","1x4 or 2x2 array",e);if(f.defined(t))if(f.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),f.defined(t.idx))if(f.number(t.idx))this.options.affineIdx=t.idx;else throw f.invalidParameterError("options.idx","number",t.idx);if(f.defined(t.idy))if(f.number(t.idy))this.options.affineIdy=t.idy;else throw f.invalidParameterError("options.idy","number",t.idy);if(f.defined(t.odx))if(f.number(t.odx))this.options.affineOdx=t.odx;else throw f.invalidParameterError("options.odx","number",t.odx);if(f.defined(t.ody))if(f.number(t.ody))this.options.affineOdy=t.ody;else throw f.invalidParameterError("options.ody","number",t.ody);if(f.defined(t.interpolator))if(f.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw f.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw f.invalidParameterError("options","object",t);return this}function AG(e){if(f.plainObject(e)){if(f.number(e.sigma)&&f.inRange(e.sigma,1e-6,10))this.options.sharpenSigma=e.sigma;else throw f.invalidParameterError("options.sigma","number between 0.000001 and 10",e.sigma);if(f.defined(e.m1))if(f.number(e.m1)&&f.inRange(e.m1,0,1e6))this.options.sharpenM1=e.m1;else throw f.invalidParameterError("options.m1","number between 0 and 1000000",e.m1);if(f.defined(e.m2))if(f.number(e.m2)&&f.inRange(e.m2,0,1e6))this.options.sharpenM2=e.m2;else throw f.invalidParameterError("options.m2","number between 0 and 1000000",e.m2);if(f.defined(e.x1))if(f.number(e.x1)&&f.inRange(e.x1,0,1e6))this.options.sharpenX1=e.x1;else throw f.invalidParameterError("options.x1","number between 0 and 1000000",e.x1);if(f.defined(e.y2))if(f.number(e.y2)&&f.inRange(e.y2,0,1e6))this.options.sharpenY2=e.y2;else throw f.invalidParameterError("options.y2","number between 0 and 1000000",e.y2);if(f.defined(e.y3))if(f.number(e.y3)&&f.inRange(e.y3,0,1e6))this.options.sharpenY3=e.y3;else throw f.invalidParameterError("options.y3","number between 0 and 1000000",e.y3)}else this.options.sharpenSigma=-1;return this}function IG(e){if(!f.defined(e))this.options.medianSize=3;else if(f.integer(e)&&f.inRange(e,1,1e3))this.options.medianSize=e;else throw f.invalidParameterError("size","integer between 1 and 1000",e);return this}function PG(e){let t;if(f.number(e))t=e;else if(f.plainObject(e)){if(!f.number(e.sigma))throw f.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=e.sigma,"precision"in e)if(f.string(C3[e.precision]))this.options.precision=C3[e.precision];else throw f.invalidParameterError("precision","one of: integer, float, approximate",e.precision);if("minAmplitude"in e)if(f.number(e.minAmplitude)&&f.inRange(e.minAmplitude,.001,1))this.options.minAmpl=e.minAmplitude;else throw f.invalidParameterError("minAmplitude","number between 0.001 and 1",e.minAmplitude)}if(!f.defined(e))this.options.blurSigma=-1;else if(f.bool(e))this.options.blurSigma=e?-1:0;else if(f.number(t)&&f.inRange(t,.3,1e3))this.options.blurSigma=t;else throw f.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function RG(e){if(!f.defined(e))this.options.dilateWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.dilateWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function LG(e){if(!f.defined(e))this.options.erodeWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.erodeWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function OG(e){return this.options.flatten=f.bool(e)?e:!0,f.object(e)&&this._setBackgroundColourOption("flattenBackground",e.background),this}function BG(){return this.options.unflatten=!0,this}function CG(e,t){if(!f.defined(e))this.options.gamma=2.2;else if(f.number(e)&&f.inRange(e,1,3))this.options.gamma=e;else throw f.invalidParameterError("gamma","number between 1.0 and 3.0",e);if(!f.defined(t))this.options.gammaOut=this.options.gamma;else if(f.number(t)&&f.inRange(t,1,3))this.options.gammaOut=t;else throw f.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function DG(e){if(this.options.negate=f.bool(e)?e:!0,f.plainObject(e)&&"alpha"in e)if(f.bool(e.alpha))this.options.negateAlpha=e.alpha;else throw f.invalidParameterError("alpha","should be boolean value",e.alpha);return this}function NG(e){if(f.plainObject(e)){if(f.defined(e.lower))if(f.number(e.lower)&&f.inRange(e.lower,0,99))this.options.normaliseLower=e.lower;else throw f.invalidParameterError("lower","number between 0 and 99",e.lower);if(f.defined(e.upper))if(f.number(e.upper)&&f.inRange(e.upper,1,100))this.options.normaliseUpper=e.upper;else throw f.invalidParameterError("upper","number between 1 and 100",e.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw f.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function FG(e){return this.normalise(e)}function GG(e){if(f.plainObject(e)){if(f.integer(e.width)&&f.inRange(e.width,1,65536))this.options.claheWidth=e.width;else throw f.invalidParameterError("width","integer between 1 and 65536",e.width);if(f.integer(e.height)&&f.inRange(e.height,1,65536))this.options.claheHeight=e.height;else throw f.invalidParameterError("height","integer between 1 and 65536",e.height);if(f.defined(e.maxSlope))if(f.integer(e.maxSlope)&&f.inRange(e.maxSlope,0,100))this.options.claheMaxSlope=e.maxSlope;else throw f.invalidParameterError("maxSlope","integer between 0 and 100",e.maxSlope)}else throw f.invalidParameterError("options","plain object",e);return this}function kG(e){if(!f.object(e)||!Array.isArray(e.kernel)||!f.integer(e.width)||!f.integer(e.height)||!f.inRange(e.width,3,1001)||!f.inRange(e.height,3,1001)||e.height*e.width!==e.kernel.length||!e.kernel.every(f.number))throw new Error("Invalid convolution kernel");return f.integer(e.scale)||(e.scale=e.kernel.reduce((t,r)=>t+r,0)),e.scale<1&&(e.scale=1),f.integer(e.offset)||(e.offset=0),this.options.convKernel=e,this}function UG(e,t){if(!f.defined(e))this.options.threshold=128;else if(f.bool(e))this.options.threshold=e?128:0;else if(f.integer(e)&&f.inRange(e,0,255))this.options.threshold=e;else throw f.invalidParameterError("threshold","integer between 0 and 255",e);return!f.object(t)||t.greyscale===!0||t.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function jG(e,t,r){if(this.options.boolean=this._createInputDescriptor(e,r),f.string(t)&&f.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw f.invalidParameterError("operator","one of: and, or, eor",t);return this}function zG(e,t){if(!f.defined(e)&&f.number(t)?e=1:f.number(e)&&!f.defined(t)&&(t=0),!f.defined(e))this.options.linearA=[];else if(f.number(e))this.options.linearA=[e];else if(Array.isArray(e)&&f.inRange(e.length,1,1e6)&&e.every(f.number))this.options.linearA=e;else throw f.invalidParameterError("a","number or array of numbers",e);if(!f.defined(t))this.options.linearB=[];else if(f.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&f.inRange(t.length,1,1e6)&&t.every(f.number))this.options.linearB=t;else throw f.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw new Error("Expected a and b to be arrays of the same length");return this}function qG(e){if(!Array.isArray(e))throw f.invalidParameterError("inputMatrix","array",e);let t=e.length;if(t!==3&&t!==4)throw f.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!e.every(n=>Array.isArray(n)&&n.length===t))throw f.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,e);let r=e.flat();if(!r.every(f.number))throw f.invalidParameterError("inputMatrix","array of numbers",r);return this.options.recombMatrix=r,this}function VG(e){if(!f.plainObject(e))throw f.invalidParameterError("options","plain object",e);if("brightness"in e)if(f.number(e.brightness)&&e.brightness>=0)this.options.brightness=e.brightness;else throw f.invalidParameterError("brightness","number above zero",e.brightness);if("saturation"in e)if(f.number(e.saturation)&&e.saturation>=0)this.options.saturation=e.saturation;else throw f.invalidParameterError("saturation","number above zero",e.saturation);if("hue"in e)if(f.integer(e.hue))this.options.hue=e.hue%360;else throw f.invalidParameterError("hue","number",e.hue);if("lightness"in e)if(f.number(e.lightness))this.options.lightness=e.lightness;else throw f.invalidParameterError("lightness","number",e.lightness);return this}var C3,D3,N3=p(()=>{Ji();C3={integer:"integer",float:"float",approximate:"approximate"};D3=e=>{Object.assign(e.prototype,{autoOrient:MG,rotate:SG,flip:vG,flop:EG,affine:TG,sharpen:AG,erode:LG,dilate:RG,median:IG,blur:PG,flatten:OG,unflatten:BG,gamma:CG,negate:DG,normalise:NG,normalize:FG,clahe:GG,convolve:kG,threshold:UG,boolean:jG,linear:zG,recomb:qG,modulate:VG})}});var z3=ae((AZ,j3)=>{var wg=Object.defineProperty,WG=Object.getOwnPropertyDescriptor,HG=Object.getOwnPropertyNames,$G=Object.prototype.hasOwnProperty,KG=(e,t)=>{for(var r in t)wg(e,r,{get:t[r],enumerable:!0})},XG=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of HG(t))!$G.call(e,i)&&i!==r&&wg(e,i,{get:()=>t[i],enumerable:!(n=WG(t,i))||n.enumerable});return e},YG=e=>XG(wg({},"__esModule",{value:!0}),e),F3={};KG(F3,{default:()=>uk});j3.exports=YG(F3);var pg={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in pg)Object.freeze(pg[e]);var io=Object.freeze(pg),G3=Object.create(null);for(let e in io)Object.hasOwn(io,e)&&(G3[io[e]]=e);var gn={to:{},get:{}};gn.get=function(e){let t=e.slice(0,3).toLowerCase(),r,n;switch(t){case"hsl":{r=gn.get.hsl(e),n="hsl";break}case"hwb":{r=gn.get.hwb(e),n="hwb";break}default:{r=gn.get.rgb(e),n="rgb";break}}return r?{model:n,value:r}:null};gn.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,r=/^#([a-f\d]{6})([a-f\d]{2})?$/i,n=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,i=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,o=/^(\w+)$/,s=[0,0,0,1],a,c,l;if(a=e.match(r)){for(l=a[2],a=a[1],c=0;c<3;c++){let u=c*2;s[c]=Number.parseInt(a.slice(u,u+2),16)}l&&(s[3]=Number.parseInt(l,16)/255)}else if(a=e.match(t)){for(a=a[1],l=a[3],c=0;c<3;c++)s[c]=Number.parseInt(a[c]+a[c],16);l&&(s[3]=Number.parseInt(l+l,16)/255)}else if(a=e.match(n)){for(c=0;c<3;c++)s[c]=Number.parseFloat(a[c+1]);a[4]&&(s[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else if(a=e.match(i)){for(c=0;c<3;c++)s[c]=Math.round(Number.parseFloat(a[c+1])*2.55);a[4]&&(s[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else return(a=e.toLowerCase().match(o))?a[1]==="transparent"?[0,0,0,0]:Object.hasOwn(io,a[1])?(s=io[a[1]].slice(),s[3]=1,s):null:null;for(c=0;c<3;c++)s[c]=As(s[c],0,255);return s[3]=As(s[3],0,1),s};gn.get.hsl=function(e){if(!e)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,o=As(Number.parseFloat(r[2]),0,100),s=As(Number.parseFloat(r[3]),0,100),a=As(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};gn.get.hwb=function(e){if(!e)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,o=As(Number.parseFloat(r[2]),0,100),s=As(Number.parseFloat(r[3]),0,100),a=As(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};gn.to.hex=function(...e){return"#"+Bd(e[0])+Bd(e[1])+Bd(e[2])+(e[3]<1?Bd(Math.round(e[3]*255)):"")};gn.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};gn.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"};gn.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};gn.to.hwb=function(...e){let t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};gn.to.keyword=function(...e){return G3[e.slice(0,3)]};function As(e,t,r){return Math.min(Math.max(t,e),r)}function Bd(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var Ml=gn,k3={};for(let e of Object.keys(io))k3[io[e]]=e;var X={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Qa=X,No=(6/29)**3;function El(e){let t=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,t),1)}function Tl(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(X)){if(!("channels"in X[e]))throw new Error("missing channels property: "+e);if(!("labels"in X[e]))throw new Error("missing channel labels property: "+e);if(X[e].labels.length!==X[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=X[e];delete X[e].channels,delete X[e].labels,Object.defineProperty(X[e],"channels",{value:t}),Object.defineProperty(X[e],"labels",{value:r})}X.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=o-i,a,c;switch(o){case i:{a=0;break}case t:{a=(r-n)/s;break}case r:{a=2+(n-t)/s;break}case n:{a=4+(t-r)/s;break}}a=Math.min(a*60,360),a<0&&(a+=360);let l=(i+o)/2;return o===i?c=0:l<=.5?c=s/(o+i):c=s/(2-o-i),[a,c*100,l*100]};X.rgb.hsv=function(e){let t,r,n,i,o,s=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(s,a,c),u=l-Math.min(s,a,c),h=function(d){return(l-d)/6/u+1/2};if(u===0)i=0,o=0;else{switch(o=u/l,t=h(s),r=h(a),n=h(c),l){case s:{i=n-r;break}case a:{i=1/3+t-n;break}case c:{i=2/3+r-t;break}}i<0?i+=1:i>1&&(i-=1)}return[i*360,o*100,l*100]};X.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],i=X.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[i,o*100,n*100]};X.rgb.oklab=function(e){let t=Tl(e[0]/255),r=Tl(e[1]/255),n=Tl(e[2]/255),i=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*n),o=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*n),s=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*n),a=.2104542553*i+.793617785*o-.0040720468*s,c=1.9779984951*i-2.428592205*o+.4505937099*s,l=.0259040371*i+.7827717662*o-.808675766*s;return[a*100,c*100,l*100]};X.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(1-t,1-r,1-n),o=(1-t-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function ZG(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}X.rgb.keyword=function(e){let t=k3[e];if(t)return t;let r=Number.POSITIVE_INFINITY,n;for(let i of Object.keys(io)){let o=io[i],s=ZG(e,o);s<r&&(r=s,n=i)}return n};X.keyword.rgb=function(e){return[...io[e]]};X.rgb.xyz=function(e){let t=Tl(e[0]/255),r=Tl(e[1]/255),n=Tl(e[2]/255),i=t*.4124564+r*.3575761+n*.1804375,o=t*.2126729+r*.7151522+n*.072175,s=t*.0193339+r*.119192+n*.9503041;return[i*100,o*100,s*100]};X.rgb.lab=function(e){let t=X.rgb.xyz(e),r=t[0],n=t[1],i=t[2];r/=95.047,n/=100,i/=108.883,r=r>No?r**(1/3):7.787*r+16/116,n=n>No?n**(1/3):7.787*n+16/116,i=i>No?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};X.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i,o;if(r===0)return o=n*255,[o,o,o];let s=n<.5?n*(1+r):n+r-n*r,a=2*n-s,c=[0,0,0];for(let l=0;l<3;l++)i=t+1/3*-(l-1),i<0&&i++,i>1&&i--,6*i<1?o=a+(s-a)*6*i:2*i<1?o=s:3*i<2?o=a+(s-a)*(2/3-i)*6:o=a,c[l]=o*255;return c};X.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[t,a*100,s*100]};X.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,i=Math.floor(t)%6,o=t-Math.floor(t),s=255*n*(1-r),a=255*n*(1-r*o),c=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,c,s];case 1:return[a,n,s];case 2:return[s,n,c];case 3:return[s,a,n];case 4:return[c,s,n];case 5:return[n,s,a]}};X.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[t,o*100,s*100]};X.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*t),a=1-n;o=6*t-s,(s&1)!==0&&(o=1-o);let c=r+o*(a-r),l,u,h;switch(s){default:case 6:case 0:{l=a,u=c,h=r;break}case 1:{l=c,u=a,h=r;break}case 2:{l=r,u=a,h=c;break}case 3:{l=r,u=c,h=a;break}case 4:{l=c,u=r,h=a;break}case 5:{l=a,u=r,h=c;break}}return[l*255,u*255,h*255]};X.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100,o=1-Math.min(1,t*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};X.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i,o,s;return i=t*3.2404542+r*-1.5371385+n*-.4985314,o=t*-.969266+r*1.8760108+n*.041556,s=t*.0556434+r*-.2040259+n*1.0572252,i=El(i),o=El(o),s=El(s),[i*255,o*255,s*255]};X.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>No?t**(1/3):7.787*t+16/116,r=r>No?r**(1/3):7.787*r+16/116,n=n>No?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(t-r),s=200*(r-n);return[i,o,s]};X.xyz.oklab=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=Math.cbrt(.8189330101*t+.3618667424*r-.1288597137*n),o=Math.cbrt(.0329845436*t+.9293118715*r+.0361456387*n),s=Math.cbrt(.0482003018*t+.2643662691*r+.633851707*n),a=.2104542553*i+.793617785*o-.0040720468*s,c=1.9779984951*i-2.428592205*o+.4505937099*s,l=.0259040371*i+.7827717662*o-.808675766*s;return[a*100,c*100,l*100]};X.oklab.oklch=function(e){return X.lab.lch(e)};X.oklab.xyz=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(.999999998*t+.396337792*r+.215803758*n)**3,o=(1.000000008*t-.105561342*r-.063854175*n)**3,s=(1.000000055*t-.089484182*r-1.291485538*n)**3,a=1.227013851*i-.55779998*o+.281256149*s,c=-.040580178*i+1.11225687*o-.071676679*s,l=-.076381285*i-.421481978*o+1.58616322*s;return[a*100,c*100,l*100]};X.oklab.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(t+.3963377774*r+.2158037573*n)**3,o=(t-.1055613458*r-.0638541728*n)**3,s=(t-.0894841775*r-1.291485548*n)**3,a=El(4.0767416621*i-3.3077115913*o+.2309699292*s),c=El(-1.2684380046*i+2.6097574011*o-.3413193965*s),l=El(-.0041960863*i-.7034186147*o+1.707614701*s);return[a*255,c*255,l*255]};X.oklch.oklab=function(e){return X.lch.lab(e)};X.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],i,o,s;o=(t+16)/116,i=r/500+o,s=o-n/200;let a=o**3,c=i**3,l=s**3;return o=a>No?a:(o-16/116)/7.787,i=c>No?c:(i-16/116)/7.787,s=l>No?l:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};X.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[t,s,i]};X.lch.lab=function(e){let t=e[0],r=e[1],i=e[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[t,o,s]};X.rgb.ansi16=function(e,t=null){let[r,n,i]=e,o=t===null?X.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};X.hsv.ansi16=function(e){return X.rgb.ansi16(X.hsv.rgb(e),e[2])};X.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];return t>>4===r>>4&&r>>4===n>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};X.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(Math.trunc(e>50)+1)*.5,n=(t&1)*r*255,i=(t>>1&1)*r*255,o=(t>>2&1)*r*255;return[n,i,o]};X.ansi256.rgb=function(e){if(e=e[0],e>=232){let o=(e-232)*10+8;return[o,o,o]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[r,n,i]};X.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r};X.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=[...r].map(a=>a+a).join(""));let n=Number.parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};X.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(Math.max(t,r),n),o=Math.min(Math.min(t,r),n),s=i-o,a,c=s<1?o/(1-s):0;return s<=0?a=0:i===t?a=(r-n)/s%6:i===r?a=2+(n-t)/s:a=4+(t-r)/s,a/=6,a%=1,[a*360,s*100,c*100]};X.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[e[0],n*100,i*100]};X.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],n*100,i*100]};X.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=t%1*6,s=o%1,a=1-s,c=0;switch(Math.floor(o)){case 0:{i[0]=1,i[1]=s,i[2]=0;break}case 1:{i[0]=a,i[1]=1,i[2]=0;break}case 2:{i[0]=0,i[1]=1,i[2]=s;break}case 3:{i[0]=0,i[1]=a,i[2]=1;break}case 4:{i[0]=s,i[1]=0,i[2]=1;break}default:i[0]=1,i[1]=0,i[2]=a}return c=(1-r)*n,[(r*i[0]+c)*255,(r*i[1]+c)*255,(r*i[2]+c)*255]};X.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),i=0;return n>0&&(i=t/n),[e[0],i*100,n*100]};X.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,i=0;return n>0&&n<.5?i=t/(2*n):n>=.5&&n<1&&(i=t/(2*(1-n))),[e[0],i*100,n*100]};X.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};X.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,i=n-t,o=0;return i<1&&(o=(n-i)/(1-i)),[e[0],i*100,o*100]};X.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};X.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};X.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};X.gray.hsl=function(e){return[0,0,e[0]]};X.gray.hsv=X.gray.hsl;X.gray.hwb=function(e){return[0,100,e[0]]};X.gray.cmyk=function(e){return[0,0,0,e[0]]};X.gray.lab=function(e){return[e[0],0,0]};X.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(n.length)+n};X.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function JG(){let e={},t=Object.keys(Qa);for(let{length:r}=t,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function QG(e){let t=JG(),r=[e];for(t[e].distance=0;r.length>0;){let n=r.pop(),i=Object.keys(Qa[n]);for(let{length:o}=i,s=0;s<o;s++){let a=i[s],c=t[a];c.distance===-1&&(c.distance=t[n].distance+1,c.parent=n,r.unshift(a))}}return t}function ek(e,t){return function(r){return t(e(r))}}function tk(e,t){let r=[t[e].parent,e],n=Qa[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)r.unshift(t[i].parent),n=ek(Qa[t[i].parent][i],n),i=t[i].parent;return n.conversion=r,n}function rk(e){let t=QG(e),r={},n=Object.keys(t);for(let{length:i}=n,o=0;o<i;o++){let s=n[o];t[s].parent!==null&&(r[s]=tk(s,t))}return r}var nk=rk,vl={},ik=Object.keys(Qa);function ok(e){let t=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function sk(e){let t=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=e(r);if(typeof i=="object")for(let{length:o}=i,s=0;s<o;s++)i[s]=Math.round(i[s]);return i};return"conversion"in e&&(t.conversion=e.conversion),t}for(let e of ik){vl[e]={},Object.defineProperty(vl[e],"channels",{value:Qa[e].channels}),Object.defineProperty(vl[e],"labels",{value:Qa[e].labels});let t=nk(e),r=Object.keys(t);for(let n of r){let i=t[n];vl[e][n]=sk(i),vl[e][n].raw=ok(i)}}var Dn=vl,U3=["keyword","gray","hex"],gg={};for(let e of Object.keys(Dn))gg[[...Dn[e].labels].sort().join("")]=e;var yg={};function br(e,t){if(!(this instanceof br))return new br(e,t);if(t&&t in U3&&(t=null),t&&!(t in Dn))throw new Error("Unknown model: "+t);let r,n;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof br)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){let i=Ml.get(e);if(i===null)throw new Error("Unable to parse color from string: "+e);this.model=i.model,n=Dn[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=Dn[this.model].channels;let i=Array.prototype.slice.call(e,0,n);this.color=bg(i,n),this.valpha=typeof e[n]=="number"?e[n]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let i=Object.keys(e);"alpha"in e&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);let o=i.sort().join("");if(!(o in gg))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=gg[o];let{labels:s}=Dn[this.model],a=[];for(r=0;r<s.length;r++)a.push(e[s[r]]);this.color=bg(a)}if(yg[this.model])for(n=Dn[this.model].channels,r=0;r<n;r++){let i=yg[this.model][r];i&&(this.color[r]=i(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}br.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in Ml.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return Ml.to[t.model](...r)},percentString(e){let t=this.rgb().round(typeof e=="number"?e:1),r=t.valpha===1?t.color:[...t.color,this.valpha];return Ml.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=Dn[this.model],{labels:r}=Dn[this.model];for(let n=0;n<t;n++)e[r[n]]=this.color[n];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new br([...this.color.map(ck(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new br([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:qt("rgb",0,lr(255)),green:qt("rgb",1,lr(255)),blue:qt("rgb",2,lr(255)),hue:qt(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:qt("hsl",1,lr(100)),lightness:qt("hsl",2,lr(100)),saturationv:qt("hsv",1,lr(100)),value:qt("hsv",2,lr(100)),chroma:qt("hcg",1,lr(100)),gray:qt("hcg",2,lr(100)),white:qt("hwb",1,lr(100)),wblack:qt("hwb",2,lr(100)),cyan:qt("cmyk",0,lr(100)),magenta:qt("cmyk",1,lr(100)),yellow:qt("cmyk",2,lr(100)),black:qt("cmyk",3,lr(100)),x:qt("xyz",0,lr(95.047)),y:qt("xyz",1,lr(100)),z:qt("xyz",2,lr(108.833)),l:qt("lab",0,lr(100)),a:qt("lab",1),b:qt("lab",2),keyword(e){return e!==void 0?new br(e):Dn[this.model].keyword(this.color)},hex(e){return e!==void 0?new br(e):Ml.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new br(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r="0"+r),Ml.to.hex(...t)+r},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[r,n]of e.entries()){let i=n/255;t[r]=i<=.04045?i/12.92:((i+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return br.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let r=e.rgb(),n=this.rgb(),i=t===void 0?.5:t,o=2*i-1,s=r.alpha()-n.alpha(),a=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,c=1-a;return br.rgb(a*r.red()+c*n.red(),a*r.green()+c*n.green(),a*r.blue()+c*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};for(let e of Object.keys(Dn)){if(U3.includes(e))continue;let{channels:t}=Dn[e];br.prototype[e]=function(...r){return this.model===e?new br(this):r.length>0?new br(r,e):new br([...lk(Dn[this.model][e].raw(this.color)),this.valpha],e)},br[e]=function(...r){let n=r[0];return typeof n=="number"&&(n=bg(r,t)),new br(n,e)}}function ak(e,t){return Number(e.toFixed(t))}function ck(e){return function(t){return ak(t,e)}}function qt(e,t,r){e=Array.isArray(e)?e:[e];for(let n of e)(yg[n]||=[])[t]=r;return e=e[0],function(n){let i;return n!==void 0?(r&&(n=r(n)),i=this[e](),i.color[t]=n,i):(i=this[e]().color[t],r&&(i=r(i)),i)}}function lr(e){return function(t){return Math.max(0,Math.min(e,t))}}function lk(e){return Array.isArray(e)?e:[e]}function bg(e,t){for(let r=0;r<t;r++)typeof e[r]!="number"&&(e[r]=0);return e}var uk=br});var V3=ae((IZ,q3)=>{q3.exports=z3().default});function fk(e){return this._setBackgroundColourOption("tint",e),this}function hk(e){return this.options.greyscale=f.bool(e)?e:!0,this}function dk(e){return this.greyscale(e)}function mk(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function pk(e){return this.pipelineColourspace(e)}function gk(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function yk(e){return this.toColourspace(e)}function $3(e){if(f.object(e)||f.string(e)&&e.length>=3&&e.length<=200){let t=(0,H3.default)(e),r=t.red(),n=t.green(),i=t.blue(),o=Math.round(t.alpha()*255);for(let[s,a]of[["red",r],["green",n],["blue",i],["alpha",o]])if(!f.number(a))throw f.invalidParameterError(`background.${s}`,"number",a);return[r,n,i,o]}else throw f.invalidParameterError("background","object or string",e)}function bk(e,t){f.defined(t)&&(this.options[e]=$3(t))}var H3,W3,K3,X3=p(()=>{H3=me(V3(),1);Ji();W3={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};K3=e=>{Object.assign(e.prototype,{tint:fk,greyscale:hk,grayscale:dk,pipelineColourspace:mk,pipelineColorspace:pk,toColourspace:gk,toColorspace:yk,_getBackgroundColourOption:$3,_setBackgroundColourOption:bk}),e.colourspace=W3,e.colorspace=W3}});function xk(){return this.options.removeAlpha=!0,this}function _k(e){if(f.defined(e))if(f.number(e)&&f.inRange(e,0,1))this.options.ensureAlpha=e;else throw f.invalidParameterError("alpha","number between 0 and 1",e);else this.options.ensureAlpha=1;return this}function Sk(e){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(e)&&(e=t[e]),f.integer(e)&&f.inRange(e,0,4))this.options.extractChannel=e;else throw f.invalidParameterError("channel","integer or one of: red, green, blue, alpha",e);return this}function Mk(e,t){return Array.isArray(e)?e.forEach(function(r){this.options.joinChannelIn.push(this._createInputDescriptor(r,t))},this):this.options.joinChannelIn.push(this._createInputDescriptor(e,t)),this}function vk(e){if(f.string(e)&&f.inArray(e,["and","or","eor"]))this.options.bandBoolOp=e;else throw f.invalidParameterError("boolOp","one of: and, or, eor",e);return this}var wk,Y3,Z3=p(()=>{Ji();wk={and:"and",or:"or",eor:"eor"};Y3=e=>{Object.assign(e.prototype,{removeAlpha:xk,ensureAlpha:_k,extractChannel:Sk,joinChannel:Mk,bandbool:vk}),e.bool=wk}});function Tk(e,t){let r;if(f.string(e)?f.string(this.options.input.file)&&Cd.default.resolve(this.options.input.file)===Cd.default.resolve(e)?r=new Error("Cannot use same file for input and output"):Ek.test(Cd.default.extname(e))&&!this.constructor.format.jp2.output.file&&(r=Q3()):r=new Error("Missing output file path"),r)if(f.fn(t))t(r);else return Promise.reject(r);else{this.options.fileOut=e;let n=Error();return this._pipeline(t,n)}return this}function Ak(e,t){f.object(e)?this._setBooleanOption("resolveWithObject",e.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let r=Error();return this._pipeline(f.fn(e)?e:t,r)}function Ik(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let e=Error();return this._pipeline(null,e)}function Pk(e){if(f.number(e)&&e>0)this.options.withMetadataDensity=e;else throw f.invalidParameterError("density","positive number",e);return this.keepExif()}function Rk(){return this.options.keepMetadata|=1,this}function Lk(e){if(f.object(e))for(let[t,r]of Object.entries(e))if(f.object(r))for(let[n,i]of Object.entries(r))if(f.string(i))this.options.withExif[`exif-${t.toLowerCase()}-${n}`]=i;else throw f.invalidParameterError(`${t}.${n}`,"string",i);else throw f.invalidParameterError(t,"object",r);else throw f.invalidParameterError("exif","object",e);return this.options.withExifMerge=!1,this.keepExif()}function Ok(e){return this.withExif(e),this.options.withExifMerge=!0,this}function Bk(){return this.options.keepMetadata|=8,this}function Ck(e,t){if(f.string(e))this.options.withIccProfile=e;else throw f.invalidParameterError("icc","string",e);if(this.keepIccProfile(),f.object(t)&&f.defined(t.attach))if(f.bool(t.attach))t.attach||(this.options.keepMetadata&=-9);else throw f.invalidParameterError("attach","boolean",t.attach);return this}function Dk(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function Nk(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function Fk(){return this.options.keepMetadata|=2,this}function Gk(e){if(f.string(e)&&e.length>0)this.options.withXmp=e,this.options.keepMetadata|=2;else throw f.invalidParameterError("xmp","non-empty string",e);return this}function kk(){return this.options.keepMetadata|=31,this}function Uk(e){if(this.keepMetadata(),this.withIccProfile("srgb"),f.object(e)){if(f.defined(e.orientation))if(f.integer(e.orientation)&&f.inRange(e.orientation,1,8))this.options.withMetadataOrientation=e.orientation;else throw f.invalidParameterError("orientation","integer between 1 and 8",e.orientation);if(f.defined(e.density))if(f.number(e.density)&&e.density>0)this.options.withMetadataDensity=e.density;else throw f.invalidParameterError("density","positive number",e.density);f.defined(e.icc)&&this.withIccProfile(e.icc),f.defined(e.exif)&&this.withExifMerge(e.exif)}return this}function jk(e,t){let r=J3.get((f.object(e)&&f.string(e.id)?e.id:e).toLowerCase());if(!r)throw f.invalidParameterError("format",`one of: ${[...J3.keys()].join(", ")}`,e);return this[r](t)}function zk(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jpegQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.progressive)&&this._setBooleanOption("jpegProgressive",e.progressive),f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);let t=f.bool(e.optimizeCoding)?e.optimizeCoding:e.optimiseCoding;if(f.defined(t)&&this._setBooleanOption("jpegOptimiseCoding",t),f.defined(e.mozjpeg))if(f.bool(e.mozjpeg))e.mozjpeg&&(this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3);else throw f.invalidParameterError("mozjpeg","boolean",e.mozjpeg);let r=f.bool(e.trellisQuantization)?e.trellisQuantization:e.trellisQuantisation;f.defined(r)&&this._setBooleanOption("jpegTrellisQuantisation",r),f.defined(e.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",e.overshootDeringing);let n=f.bool(e.optimizeScans)?e.optimizeScans:e.optimiseScans;f.defined(n)&&(this._setBooleanOption("jpegOptimiseScans",n),n&&(this.options.jpegProgressive=!0));let i=f.number(e.quantizationTable)?e.quantizationTable:e.quantisationTable;if(f.defined(i))if(f.integer(i)&&f.inRange(i,0,8))this.options.jpegQuantisationTable=i;else throw f.invalidParameterError("quantisationTable","integer between 0 and 8",i)}return this._updateFormatOut("jpeg",e)}function qk(e){if(f.object(e)){if(f.defined(e.progressive)&&this._setBooleanOption("pngProgressive",e.progressive),f.defined(e.compressionLevel))if(f.integer(e.compressionLevel)&&f.inRange(e.compressionLevel,0,9))this.options.pngCompressionLevel=e.compressionLevel;else throw f.invalidParameterError("compressionLevel","integer between 0 and 9",e.compressionLevel);f.defined(e.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",e.adaptiveFiltering);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.pngBitdepth=ev(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.palette)?this._setBooleanOption("pngPalette",e.palette):[e.quality,e.effort,e.colours,e.colors,e.dither].some(f.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,0,100))this.options.pngQuality=e.quality;else throw f.invalidParameterError("quality","integer between 0 and 100",e.quality);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.pngEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.pngDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither)}}return this._updateFormatOut("png",e)}function Vk(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.webpQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.alphaQuality))if(f.integer(e.alphaQuality)&&f.inRange(e.alphaQuality,0,100))this.options.webpAlphaQuality=e.alphaQuality;else throw f.invalidParameterError("alphaQuality","integer between 0 and 100",e.alphaQuality);if(f.defined(e.lossless)&&this._setBooleanOption("webpLossless",e.lossless),f.defined(e.nearLossless)&&this._setBooleanOption("webpNearLossless",e.nearLossless),f.defined(e.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",e.smartSubsample),f.defined(e.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",e.smartDeblock),f.defined(e.preset))if(f.string(e.preset)&&f.inArray(e.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=e.preset;else throw f.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",e.preset);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,6))this.options.webpEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 6",e.effort);f.defined(e.minSize)&&this._setBooleanOption("webpMinSize",e.minSize),f.defined(e.mixed)&&this._setBooleanOption("webpMixed",e.mixed),f.defined(e.exact)&&this._setBooleanOption("webpExact",e.exact)}return xg(e,this.options),this._updateFormatOut("webp",e)}function Wk(e){if(f.object(e)){f.defined(e.reuse)&&this._setBooleanOption("gifReuse",e.reuse),f.defined(e.progressive)&&this._setBooleanOption("gifProgressive",e.progressive);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.gifBitdepth=ev(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.gifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.gifDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither);if(f.defined(e.interFrameMaxError))if(f.number(e.interFrameMaxError)&&f.inRange(e.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=e.interFrameMaxError;else throw f.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",e.interFrameMaxError);if(f.defined(e.interPaletteMaxError))if(f.number(e.interPaletteMaxError)&&f.inRange(e.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=e.interPaletteMaxError;else throw f.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",e.interPaletteMaxError);if(f.defined(e.keepDuplicateFrames))if(f.bool(e.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",e.keepDuplicateFrames);else throw f.invalidParameterError("keepDuplicateFrames","boolean",e.keepDuplicateFrames)}return xg(e,this.options),this._updateFormatOut("gif",e)}function Hk(e){if(!this.constructor.format.jp2.output.buffer)throw Q3();if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jp2Quality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jp2Lossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.jp2TileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.jp2TileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling)}return this._updateFormatOut("jp2",e)}function xg(e,t){if(f.object(e)&&f.defined(e.loop))if(f.integer(e.loop)&&f.inRange(e.loop,0,65535))t.loop=e.loop;else throw f.invalidParameterError("loop","integer between 0 and 65535",e.loop);if(f.object(e)&&f.defined(e.delay))if(f.integer(e.delay)&&f.inRange(e.delay,0,65535))t.delay=[e.delay];else if(Array.isArray(e.delay)&&f.inRange(e.delay.length,1,1e6)&&e.delay.every(f.integer)&&e.delay.every(r=>f.inRange(r,0,65535)))t.delay=e.delay;else throw f.invalidParameterError("delay","integer or an array of integers between 0 and 65535",e.delay)}function $k(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.tiffQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[1,2,4]))this.options.tiffBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","1, 2 or 4",e.bitdepth);if(f.defined(e.tile)&&this._setBooleanOption("tiffTile",e.tile),f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.tiffTileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.tiffTileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.miniswhite)&&this._setBooleanOption("tiffMiniswhite",e.miniswhite),f.defined(e.pyramid)&&this._setBooleanOption("tiffPyramid",e.pyramid),f.defined(e.xres))if(f.number(e.xres)&&f.inRange(e.xres,.001,1e6))this.options.tiffXres=e.xres;else throw f.invalidParameterError("xres","number between 0.001 and 1000000",e.xres);if(f.defined(e.yres))if(f.number(e.yres)&&f.inRange(e.yres,.001,1e6))this.options.tiffYres=e.yres;else throw f.invalidParameterError("yres","number between 0.001 and 1000000",e.yres);if(f.defined(e.compression))if(f.string(e.compression)&&f.inArray(e.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=e.compression;else throw f.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",e.compression);if(f.defined(e.bigtiff)&&this._setBooleanOption("tiffBigtiff",e.bigtiff),f.defined(e.predictor))if(f.string(e.predictor)&&f.inArray(e.predictor,["none","horizontal","float"]))this.options.tiffPredictor=e.predictor;else throw f.invalidParameterError("predictor","one of: none, horizontal, float",e.predictor);if(f.defined(e.resolutionUnit))if(f.string(e.resolutionUnit)&&f.inArray(e.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=e.resolutionUnit;else throw f.invalidParameterError("resolutionUnit","one of: inch, cm",e.resolutionUnit)}return this._updateFormatOut("tiff",e)}function Kk(e){return this.heif({...e,compression:"av1"})}function Xk(e){if(f.object(e)){if(f.string(e.compression)&&f.inArray(e.compression,["av1","hevc"]))this.options.heifCompression=e.compression;else throw f.invalidParameterError("compression","one of: av1, hevc",e.compression);if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.heifQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.heifLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,9))this.options.heifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 9",e.effort);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[8,10,12]))this.options.heifBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","8, 10 or 12",e.bitdepth);if(f.defined(e.tune))if(f.string(e.tune)&&f.inArray(e.tune,["auto","iq","psnr","ssim"]))this.options.heifLossless&&e.tune==="iq"?this.options.heifTune="ssim":this.options.heifTune=e.tune;else throw f.invalidParameterError("tune","one of: auto, iq, psnr, ssim",e.tune)}else throw f.invalidParameterError("options","Object",e);return this._updateFormatOut("heif",e)}function Yk(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jxlDistance=e.quality>=30?.1+(100-e.quality)*.09:53/3e3*e.quality*e.quality-23/20*e.quality+25;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);else if(f.defined(e.distance))if(f.number(e.distance)&&f.inRange(e.distance,0,15))this.options.jxlDistance=e.distance;else throw f.invalidParameterError("distance","number between 0.0 and 15.0",e.distance);if(f.defined(e.decodingTier))if(f.integer(e.decodingTier)&&f.inRange(e.decodingTier,0,4))this.options.jxlDecodingTier=e.decodingTier;else throw f.invalidParameterError("decodingTier","integer between 0 and 4",e.decodingTier);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jxlLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,9))this.options.jxlEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 9",e.effort)}return xg(e,this.options),this._updateFormatOut("jxl",e)}function Zk(e){if(f.object(e)&&f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=e.depth;else throw f.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",e.depth);return this._updateFormatOut("raw")}function Jk(e){if(f.object(e)){if(f.defined(e.size))if(f.integer(e.size)&&f.inRange(e.size,1,8192))this.options.tileSize=e.size;else throw f.invalidParameterError("size","integer between 1 and 8192",e.size);if(f.defined(e.overlap))if(f.integer(e.overlap)&&f.inRange(e.overlap,0,8192)){if(e.overlap>this.options.tileSize)throw f.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,e.overlap);this.options.tileOverlap=e.overlap}else throw f.invalidParameterError("overlap","integer between 0 and 8192",e.overlap);if(f.defined(e.container))if(f.string(e.container)&&f.inArray(e.container,["fs","zip"]))this.options.tileContainer=e.container;else throw f.invalidParameterError("container","one of: fs, zip",e.container);if(f.defined(e.layout))if(f.string(e.layout)&&f.inArray(e.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=e.layout;else throw f.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",e.layout);if(f.defined(e.angle))if(f.integer(e.angle)&&!(e.angle%90))this.options.tileAngle=e.angle;else throw f.invalidParameterError("angle","positive/negative multiple of 90",e.angle);if(this._setBackgroundColourOption("tileBackground",e.background),f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["onepixel","onetile","one"]))this.options.tileDepth=e.depth;else throw f.invalidParameterError("depth","one of: onepixel, onetile, one",e.depth);if(f.defined(e.skipBlanks))if(f.integer(e.skipBlanks)&&f.inRange(e.skipBlanks,-1,65535))this.options.tileSkipBlanks=e.skipBlanks;else throw f.invalidParameterError("skipBlanks","integer between -1 and 255/65535",e.skipBlanks);else f.defined(e.layout)&&e.layout==="google"&&(this.options.tileSkipBlanks=5);let t=f.bool(e.center)?e.center:e.centre;if(f.defined(t)&&this._setBooleanOption("tileCentre",t),f.defined(e.id))if(f.string(e.id))this.options.tileId=e.id;else throw f.invalidParameterError("id","string",e.id);if(f.defined(e.basename))if(f.string(e.basename))this.options.tileBasename=e.basename;else throw f.invalidParameterError("basename","string",e.basename)}if(f.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw f.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function Qk(e){if(!f.plainObject(e))throw f.invalidParameterError("options","object",e);if(f.integer(e.seconds)&&f.inRange(e.seconds,0,3600))this.options.timeoutSeconds=e.seconds;else throw f.invalidParameterError("seconds","integer between 0 and 3600",e.seconds);return this}function eU(e,t){return f.object(t)&&t.force===!1||(this.options.formatOut=e),this}function tU(e,t){if(f.bool(t))this.options[e]=t;else throw f.invalidParameterError(e,"boolean",t)}function rU(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function nU(e,t){return typeof e=="function"?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.pipeline(this.options,(r,n,i)=>{r?e(f.nativeError(r,t)):e(null,n,i)})}):nt.pipeline(this.options,(r,n,i)=>{r?e(f.nativeError(r,t)):e(null,n,i)}),this):this.options.streamOut?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.pipeline(this.options,(r,n,i)=>{r?this.emit("error",f.nativeError(r,t)):(this.emit("info",i),this.push(n)),this.push(null),this.on("end",()=>this.emit("close"))})}):nt.pipeline(this.options,(r,n,i)=>{r?this.emit("error",f.nativeError(r,t)):(this.emit("info",i),this.push(n)),this.push(null),this.on("end",()=>this.emit("close"))}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,t)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}):new Promise((r,n)=>{nt.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,t)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}var Cd,J3,Ek,Q3,ev,tv,rv=p(()=>{Cd=me(require("node:path"),1);Ji();gf();J3=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),Ek=/\.(jp[2x]|j2[kc])$/i,Q3=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),ev=e=>1<<32-Math.clz32(Math.ceil(Math.log2(e))-1);tv=e=>{Object.assign(e.prototype,{toFile:Tk,toBuffer:Ak,toUint8Array:Ik,withDensity:Pk,keepExif:Rk,withExif:Lk,withExifMerge:Ok,keepIccProfile:Bk,withIccProfile:Ck,keepGainMap:Dk,withGainMap:Nk,keepXmp:Fk,withXmp:Gk,keepMetadata:kk,withMetadata:Uk,toFormat:jk,jpeg:zk,jp2:Hk,png:qk,webp:Vk,tiff:$k,avif:Kk,heif:Xk,jxl:Yk,gif:Wk,raw:Zk,tile:Jk,timeout:Qk,_updateFormatOut:eU,_setBooleanOption:tU,_read:rU,_pipeline:nU})}});function av(e){if(f.bool(e))return e?nt.cache(50,20,100):nt.cache(0,0,0);if(f.object(e)){for(let t of["memory","files","items"]){let r=e[t];if(f.defined(r)&&!(f.integer(r)&&r>=0))throw f.invalidParameterError(t,"a positive integer",r)}return nt.cache(e.memory,e.files,e.items)}else return nt.cache()}function oU(e){return nt.concurrency(f.integer(e)?e:null)}function aU(){return nt.counters()}function cU(e){return nt.simd(f.bool(e)?e:null)}function lU(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))nt.block(e.operation,!0);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}function uU(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))nt.block(e.operation,!1);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}var iv,ov,sv,yf,fU,_g,nv,Sg,Is,iU,Al,sU,cv,lv=p(()=>{iv=me(require("node:events"),1),ov=require("node:module"),sv=require("node:os"),yf=me(pd(),1);Ji();fg();gf();Id();fU={};_g=(0,ov.createRequire)(fU.url),nv=Pd.runtimePlatformArch(),Sg=nt.libvipsVersion(),Is=nt.format();Is.heif.output.alias=["avif","heic"];Is.jpeg.output.alias=["jpe","jpg"];Is.tiff.output.alias=["tif"];Is.jp2.output.alias=["j2c","j2k","jp2","jpx"];iU={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},Al={vips:Sg.semver};if(!Sg.isGlobal)if(Sg.isWasm)try{Al=_g("@img/sharp-wasm32/versions")}catch{}else try{Al=_g(`@img/sharp-${nv}/versions`)}catch{try{Al=_g(`@img/sharp-libvips-${nv}/versions`)}catch{}}Al.sharp=Co.version;Al.heif&&Is.heif&&(Is.heif.input.fileSuffix=[".avif"],Is.heif.output.alias=["avif"]);av(!0);!process.env.MALLOC_ARENA_MAX&&yf.default.familySync()===yf.default.GLIBC&&!nt._isUsingJemalloc()?nt.concurrency(1):yf.default.familySync()===yf.default.MUSL&&nt.concurrency()===1024&&nt.concurrency((0,sv.availableParallelism)());sU=new iv.default.EventEmitter;cv=e=>{e.cache=av,e.concurrency=oU,e.counters=aU,e.simd=cU,e.format=Is,e.interpolators=iU,e.versions=Al,e.queue=sU,e.block=lU,e.unblock=uU}});var uv={};Jt(uv,{default:()=>hU});var hU,fv=p(()=>{S3();E3();L3();B3();N3();X3();Z3();rv();lv();v3(no);R3(no);O3(no);D3(no);K3(no);Y3(no);tv(no);cv(no);hU=no});async function Pl(e,t,r,n){return n._parse(e,t,r,n)}var vv=p(()=>{"use strict"});function Rl(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Ev=p(()=>{"use strict"});var oo,xU,_U,SU,MU,Xd,Tv,vU,Av=p(()=>{"use strict";oo={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},xU=oo.self||oo.window||oo.global||{},_U=oo.window||oo.self||oo.global||{},SU=oo.global||oo.self||oo.window||{},MU=oo.document||{},Xd=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),Tv=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),vU=Tv&&parseFloat(Tv[1])||0});function Ll(e,t){return new Promise((r,n)=>{let i=!1;function o(a){i||(i=!0,n(a))}function s(a){if(!i){i=!0;try{r(t(a))}catch(c){n(c)}}}try{let a=e(s,o);a==null||a.then(s,o)}catch(a){o(a)}})}var Iv=p(()=>{"use strict"});function Og(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Bg(e){var r,n;return((n=(r=globalThis.loaders)==null?void 0:r.modules)==null?void 0:n[e])||null}var Cg=p(()=>{"use strict"});function EU(){let e="5.0.0-beta.4";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=e,e}var Pv,Rv=p(()=>{"use strict";Pv=EU()});function Lv(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Ov=p(()=>{"use strict"});var so,YJ,ZJ,JJ,QJ,Pi,tc,eQ,Bv,tQ,Dg=p(()=>{"use strict";so={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},YJ=so.self||so.window||so.global||{},ZJ=so.window||so.self||so.global||{},JJ=so.global||so.self||so.window||{},QJ=so.document||{},Pi=typeof process!="object"||String(process)!=="[object process]"||process.browser,tc=typeof importScripts=="function",eQ=typeof window<"u"&&typeof window.orientation<"u",Bv=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),tQ=Bv&&parseFloat(Bv[1])||0});var Ng,Cv,Dv=p(()=>{Ng=require("worker_threads"),Cv=Ng.parentPort});function Fg(e,t=!0,r){let n=r||new Set,i=new Set;function o(s){if(!(!s||typeof s!="object"||i.has(s))){if(i.add(s),Nv(s))n.add(s);else if(ArrayBuffer.isView(s))Nv(s.buffer)&&n.add(s.buffer);else if(t&&typeof MessageChannel<"u"&&s instanceof MessageChannel)o(s.port1),o(s.port2);else if(t&&s instanceof Map)for(let[a,c]of s)o(a),o(c);else if(t&&s instanceof Set)for(let a of s)o(a);else if(t)for(let a of Object.keys(s))o(s[a])}}return o(e),r===void 0?Array.from(n):[]}function Nv(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 Fv=p(()=>{});async function Ol(){return Cv}function TU(e){if(!e||typeof e!="object")return null;let t="data"in e&&e.type==="message"?e.data:e;return t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")?t:null}var Yd,Qt,Gg=p(()=>{Fv();Dv();Yd=new Map,Qt=class{static async inWorkerThread(){let t=globalThis.WorkerGlobalScope;return typeof t=="function"&&globalThis instanceof t||!!await Ol()}static set onmessage(t){async function r(n){let i=await Ol(),{type:o,payload:s}=i?n:n.data;t(o,s)}Ol().then(n=>{n?(n.on("message",i=>{r(i)}),n.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=r})}static async addEventListener(t){let r=Yd.get(t);r||(r=i=>{let o=TU(i);o&&t(o.type,o.payload)},Yd.set(t,r));let n=await Ol();n?n.on("message",r):globalThis.addEventListener("message",r)}static async removeEventListener(t){let r=Yd.get(t);if(Yd.delete(t),!r)return;let n=await Ol();n?n.off("message",r):globalThis.removeEventListener("message",r)}static async postMessage(t,r,n=!1){let i={source:"loaders.gl",type:t,payload:r},o=n?[]:Fg(r),s=await Ol();s?s.postMessage(i,o):globalThis.postMessage(i,o)}}});var Bl,Gv=p(()=>{Bl=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(t){return this.enqueue(t)}enqueue(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let r=this._settlers.shift();t instanceof Error?r.reject(t):r.resolve({value:t})}else this._values.push(t)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let t=this._values.shift();return t instanceof Error?Promise.reject(t):Promise.resolve({done:!1,value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((t,r)=>{this._settlers.push({resolve:t,reject:r})})}}});var Zd,kv=p(()=>{Zd=class{constructor(t){if(typeof SharedArrayBuffer>"u"||!(t instanceof SharedArrayBuffer)||t.byteLength!==16)throw new Error("Expected a 16-byte shared worker control buffer");this.buffer=t,this.values=new Int32Array(t)}get snapshot(){return{cancelled:Atomics.load(this.values,0)!==0,completed:Atomics.load(this.values,1),total:Atomics.load(this.values,2),revision:Atomics.load(this.values,3)}}cancel(){Atomics.store(this.values,0,1),Atomics.add(this.values,3,1),Atomics.notify(this.values,0)}throwIfCancelled(){if(Atomics.load(this.values,0)!==0){let t=new Error("Shared worker task was cancelled");throw t.name="AbortError",t}}setProgress(t,r=-1){if(!Number.isInteger(t)||t<0||t>2147483647||!Number.isInteger(r)||r<-1||r>2147483647)throw new RangeError("Shared progress requires nonnegative int32 counts (or total -1)");Atomics.store(this.values,1,t),Atomics.store(this.values,2,r),Atomics.add(this.values,3,1)}}});function kg(e){if(e!==void 0&&e!=="copy"&&e!=="transfer")throw new Error("Invalid worker output ownership")}var Uv=p(()=>{});async function Ug(e,t,r){if(!await Qt.inWorkerThread())return;let n={process:PU};Qt.onmessage=async(i,o)=>{var d,m,g,y,b;if(i==="cancel"){ko==null||ko.abort(),Go==null||Go.close(),rc==null||rc.close();return}let s=i==="process"||i==="process-in-batches"?new AbortController:void 0;s&&(ko=s);let a=performance.now(),c=i==="process"||i==="process-in-batches"?RU():void 0,l,u=()=>{s==null||s.signal.throwIfAborted(),l==null||l.throwIfCancelled()},h={...n,signal:s==null?void 0:s.signal,sharedState:l,throwIfAborted:u,reportProgress:w=>{!(s!=null&&s.signal.aborted)&&!(l!=null&&l.snapshot.cancelled)&&(c==null||c.report(w))}};try{switch(s&&((d=o.options)!=null&&d.sharedState)&&(l=new Zd(o.options.sharedState),h.sharedState=l),i){case"preload":await(r==null?void 0:r()),Qt.postMessage("done",{});break;case"process":if(u(),kg((m=o.options)==null?void 0:m.outputOwnership),!e)throw new Error("Worker does not support atomic processing");let w=await e(o.input,o.options||{},h,o.context||{});u(),c==null||c.finish(),await Qt.postMessage("done",{result:w,executionMs:performance.now()-a},((g=o.options)==null?void 0:g.outputOwnership)==="copy");break;case"process-in-batches":if(u(),kg((y=o.options)==null?void 0:y.outputOwnership),!t)throw new Error("Worker does not support batched processing");let _=new Bl,S=new Bl;Go=_,rc=S;try{let v=t(IU(_),o.options||{},h,o.context||{});for await(let T of v)u(),await Qt.postMessage("output-batch",{result:T},((b=o.options)==null?void 0:b.outputOwnership)==="copy"),await S.next();u(),c==null||c.finish(),await Qt.postMessage("done",{executionMs:performance.now()-a})}finally{Go=null,rc=null}break;case"input-batch":if(!Go)throw new Error("Worker has no active batched processing session");Go.push(o.input);break;case"input-done":if(!Go)throw new Error("Worker has no active batched processing session");Go.close();break;case"output-ack":if(!rc)throw new Error("Worker has no active batched processing session");rc.push(void 0);break;default:}}catch(w){c==null||c.finish((s==null?void 0:s.signal.aborted)||(l==null?void 0:l.snapshot.cancelled));let _=w instanceof Error?w.message:"";await Qt.postMessage("error",{error:_,errorName:w instanceof Error?w.name:"Error"})}finally{s&&ko===s&&(ko=null)}},await Qt.postMessage("ready",{})}async function*IU(e){for(;;){await Qt.postMessage("input-request",{});let t=await e.next();if(t.done)return;yield t.value}}function PU(e,t={},r={}){let n=ko==null?void 0:ko.signal;return n==null||n.throwIfAborted(),new Promise((i,o)=>{let s=AU++,a=()=>{n==null||n.removeEventListener("abort",c),Qt.removeEventListener(l)},c=()=>{a(),o(n==null?void 0:n.reason)},l=(u,h)=>{h.id===s&&(u==="done"?(a(),i(h.result)):u==="error"&&(a(),o(h.error)))};Qt.addEventListener(l).then(async()=>{if(n!=null&&n.aborted){c();return}n==null||n.addEventListener("abort",c,{once:!0}),await Qt.postMessage("process",{id:s,input:e,options:t,context:r})}).catch(u=>{a(),o(u)})})}function RU(){let e,t=!1,r=!1,n=()=>{r=!1,e&&(Qt.postMessage("progress",{progress:e}),e=void 0)};return{report(i){t||(e&&e.phase!==i.phase&&n(),e={...i},r||(r=!0,setTimeout(n,0)))},finish(i=!1){i&&(e=void 0),n(),t=!0}}}var AU,ko,Go,rc,jv=p(()=>{kv();Gv();Gg();Uv();AU=0,ko=null,Go=null,rc=null});var LU,jg,gQ,zv=p(()=>{Gg();jv();LU={},jg=typeof __filename=="string"?__filename.replace(/\\/g,"/"):"",gQ=jg?`file://${jg.startsWith("/")?"":"/"}${encodeURI(jg).replace(/#/g,"%23").replace(/\?/g,"%3F")}`:LU.url});function qg(e,t){if(!e.preload)return Promise.resolve();let r=zg.get(e);return r||(r=Promise.resolve().then(()=>e.preload()).then(()=>{OU.add(e)}),zg.set(e,r),r.catch(()=>zg.delete(e))),BU(r,t)}function BU(e,t){return t?new Promise((r,n)=>{let i=()=>{t.removeEventListener("abort",i),n(t.reason)};t.addEventListener("abort",i,{once:!0}),t.aborted&&i(),e.then(o=>{t.removeEventListener("abort",i),r(o)},o=>{t.removeEventListener("abort",i),n(o)})}):e}var zg,OU,qv=p(()=>{zg=new WeakMap,OU=new WeakSet});function wf(e){if(!e||typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype)throw new TypeError("Task payloads must be plain objects with named fields")}function Vg(e,t={}){let r=t.signal??new AbortController().signal;return{state:e,signal:r,throwIfAborted:()=>{var n;r.throwIfAborted(),(n=t.throwIfAborted)==null||n.call(t)},reportProgress:n=>{var i;return(i=t.reportProgress)==null?void 0:i.call(t,{...n,phase:n.phase??"process",unit:n.unit??"items"})}}}async function Hg(e){if(!await Qt.inWorkerThread())throw new Error("initializeTaskWorker must run inside a worker");if(Vv)throw new Error("A task is already installed in this worker");Vv=!0;let t=new Wg(e),r={};return Ug(async(n,i,o)=>{switch(n.operation){case"initialize":return t.initialize(n.input,o);case"destroy":return t.destroy();case"stream-options":return r=n.options,{};case"process":return t.process(n.input,n.options,o);default:throw new Error("Unknown task operation")}},async function*(n,i,o){async function*s(){for await(let a of n)wf(a),yield a}try{yield*t.stream(s(),r,o)}finally{r={}}},()=>qg(e))}var Wg,Vv,Wv=p(()=>{zv();qv();Wg=class{constructor(t){this.task=t,this.initialized=!1}async initialize(t,r={}){var n,i,o;if(this.initialized)throw new Error("Task is already initialized");return wf(t),await qg(this.task,r.signal),(n=r.signal)==null||n.throwIfAborted(),this.state=await((o=(i=this.task).initialize)==null?void 0:o.call(i,t,Vg(void 0,r))),this.initialized=!0,{}}async destroy(){var t,r;if(this.initialized){this.initialized=!1;let n=this.state;this.state=void 0,this.task.initialize&&await((r=(t=this.task).destroy)==null?void 0:r.call(t,n))}return{}}async process(t,r,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.process)throw new Error("Task has no atomic processor");wf(t);let i=await this.task.process(t,r,Vg(this.state,n));return wf(i),i}async*stream(t,r,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.processInBatches)throw new Error("Task has no streaming processor");for await(let i of this.task.processInBatches(t,r,Vg(this.state,n)))wf(i),yield i}};Vv=!1});var Hv=p(()=>{Wv()});var $v={};Jt($v,{BroadcastChannel:()=>Je.BroadcastChannel,MessageChannel:()=>Je.MessageChannel,MessagePort:()=>Je.MessagePort,NodeWorker:()=>DU,SHARE_ENV:()=>Je.SHARE_ENV,Worker:()=>Je.Worker,getEnvironmentData:()=>Je.getEnvironmentData,isInternalThread:()=>NU,isMainThread:()=>Je.isMainThread,isMarkedAsUntransferable:()=>Je.isMarkedAsUntransferable,locks:()=>GU,markAsUncloneable:()=>Je.markAsUncloneable,markAsUntransferable:()=>Je.markAsUntransferable,moveMessagePortToContext:()=>Je.moveMessagePortToContext,parentPort:()=>CU,postMessageToThread:()=>Je.postMessageToThread,receiveMessageOnPort:()=>Je.receiveMessageOnPort,resourceLimits:()=>Je.resourceLimits,setEnvironmentData:()=>Je.setEnvironmentData,structuredClone:()=>kU,threadId:()=>Je.threadId,threadName:()=>FU,workerData:()=>Je.workerData});var Nn,Je,CU,DU,NU,FU,GU,kU,Kv=p(()=>{"use strict";Nn=me(require("worker_threads"),1),Je=require("worker_threads"),CU=Nn==null?void 0:Nn.parentPort,DU=Nn.Worker,NU=Nn.isInternalThread,FU=Nn.threadName,GU=Nn.locks,kU=Nn.structuredClone});function Xv(e){return{...e,phase:e.phase??"process",unit:e.unit??"items"}}async function Yv(){var e;if(typeof self<"u"&&typeof document>"u"&&typeof self.postMessage=="function")return!0;if(typeof process<"u"&&((e=process.versions)!=null&&e.node)){let{isMainThread:t}=await Promise.resolve().then(()=>(Kv(),$v));return!t}return!1}var Zv,Jv=p(()=>{"use strict";Hv();Zv=Hg});function $g(e,t=!0,r){let n=r||new Set;if(e){if(Qv(e))n.add(e);else if(Qv(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let i in e)$g(e[i],t,n)}}return r===void 0?Array.from(n):[]}function Qv(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 eE=p(()=>{"use strict"});async function Kg(e,t){await Yv()&&await Zv(UU(e,t))}function UU(e,t){return{id:"loaders.gl",initialize:r=>r,destroy:r=>{var n;return(n=r.port)==null?void 0:n.close()},process:async({value:r},n,i)=>{if(!e)throw new Error("Worker does not support atomic processing");return{value:await e(r,n,tE(i),i.state.context)}},...t?{processInBatches:async function*(r,n,i){async function*o(){for await(let s of r)yield s.value}for await(let s of t(o(),n,tE(i),i.state.context))yield{value:s}}}:{}}}function tE(e){let t=0,r=e.state.port;return{signal:e.signal,throwIfAborted:()=>e.throwIfAborted(),reportProgress:n=>e.reportProgress(Xv(n)),process:r?(n,i={},o={})=>{e.throwIfAborted();let s=++t;return new Promise((a,c)=>{let l=d=>{if(d.data.identifier===s)if(h(),d.data.error){let m=new Error(d.data.error.message);m.name=d.data.error.name,c(m)}else a(d.data.value)},u=()=>{h(),c(e.signal.reason)},h=()=>{r.removeEventListener("message",l),e.signal.removeEventListener("abort",u)};r.addEventListener("message",l),e.signal.addEventListener("abort",u,{once:!0}),r.start();try{let d={identifier:s,input:n,options:i,context:o};r.postMessage(d,$g(d))}catch(d){h(),c(d)}})}:void 0}}var rE=p(()=>{"use strict";Jv();eE()});function nc(e={}){var i,o;let t=e.useLocalLibraries??((i=e.core)==null?void 0:i.useLocalLibraries),r=jU(e.CDN,(o=e.core)==null?void 0:o.CDN),n=e.modules;return{...t!==void 0?{useLocalLibraries:t}:{},...r!==void 0?{CDN:r}:{},...n!==void 0?{modules:n}:{}}}function jU(e,t){if(typeof e=="string"||e===null)return e;if(typeof t=="string"||t===null)return t}async function Cl(e,t=null,r={},n=null,i=null){var a,c;let o=e;if(t){let l=n||e,u=(a=r.modules)==null?void 0:a[l];if(u!==void 0&&typeof u!="string")return u;e=Yg(e,t,r,n),o=i&&(!(typeof u=="string")||typeof((c=r.modules)==null?void 0:c[i])=="string")?Yg(i,t,r,i):e}let s=zU(e,o,tc);return Xg[s]=Xg[s]||qU(e,o),await Xg[s]}function zU(e,t,r){return r?JSON.stringify([e,t]):e}function Yg(e,t,r={},n=null){if(r!=null&&r.core)throw new Error("loadLibrary: options.core must be pre-normalized");n=n||e;let i=r.modules||{};if(typeof i[n]=="string")return i[n];if(!r.useLocalLibraries&&e.startsWith("http"))return e;if(!Pi)return`modules/${t}/dist/libs/${n}`;if(r.CDN){if(typeof r.CDN!="string")throw new Error("loadLibrary: options.CDN must be a string or null");return Lv(r.CDN.startsWith("http")),`${r.CDN}/${t}@${Pv}/dist/libs/${n}`}return tc?n.endsWith(".mjs")?`./libs/${n}`:`../src/libs/${n}`:`modules/${t}/src/libs/${n}`}async function qU(e,t){if(e.endsWith("wasm"))return await HU(e);if(!Pi){let{requireFromFile:n}=globalThis.loaders||{};try{let i=await(n==null?void 0:n(e));return i||!e.includes("/dist/libs/")?i:await(n==null?void 0:n(e.replace("/dist/libs/","/src/libs/")))}catch(i){if(e.includes("/dist/libs/"))try{return await(n==null?void 0:n(e.replace("/dist/libs/","/src/libs/")))}catch{}return console.error(i),null}}if(tc)return VU(e,t);let r=await $U(e);return WU(r,e)}async function VU(e,t=e){try{importScripts()}catch{let n=await import(new URL(t,globalThis.location.href).href);return n.default??n}return importScripts(e)}function WU(e,t){let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function HU(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};if(Pi||!t||e.startsWith("http"))return await(await fetch(e)).arrayBuffer();try{return await t(e)}catch{if(e.includes("/dist/libs/"))return await t(e.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load ArrayBuffer from ${e}`)}}async function $U(e){let{readFileAsText:t}=globalThis.loaders||{};if(Pi||!t||e.startsWith("http"))return await(await fetch(e)).text();try{return await t(e)}catch{if(e.includes("/dist/libs/"))return await t(e.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load text from ${e}`)}}var Xg,nE=p(()=>{"use strict";Dg();Ov();Rv();Xg={}});var ic=p(()=>{"use strict";Dg();rE();nE()});async function Jg(e,t=()=>e){await Kg((r,n,i,o)=>KU(t(n||{}),r,n,i,o),(r,n,i,o)=>iE(t(n||{}),r,n,i,o))}async function KU(e,t,r={},n,i={}){let o=await YU({loader:e,arrayBuffer:t,options:r,context:{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:oE(),_parse:sE(n==null?void 0:n.process)}});return e.serializeWorkerResult?e.serializeWorkerResult(o,r,i):o}async function*iE(e,t,r={},n,i={}){if(!e.parseInBatches)throw new Error(`${e.id} loader does not support batched parsing`);let o=cE(e,r),s=e.parseInBatches(t,o,{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:oE(),_parse:sE(n==null?void 0:n.process)});for await(let a of s)yield e.serializeWorkerBatch?e.serializeWorkerBatch(a,r,i):a}function oE(){let e=t=>()=>{throw new Error(`context.coreApi.${t} is unavailable inside worker loaders.`)};return{fetchFile:async(t,r)=>await fetch(t,r),parseSync:e("parseSync"),parse:e("parse"),parseFile:e("parseFile"),parseInBatches:e("parseInBatches"),load:e("load"),loadInBatches:e("loadInBatches")}}function sE(e){return(t,r,n,i)=>{if(!e)throw new Error("Worker not set up to parse on main thread");let o=XU(r,n,i);return e(t,o.options,{...o.context,...Array.isArray(r)||r&&aE(r)?{_loaderIsArray:Array.isArray(r),_loaderIds:(Array.isArray(r)?r:[r]).map(s=>s.id)}:{}})}}function XU(e,t,r){return t?{options:t,context:Zg(r)}:Array.isArray(e)||e&&aE(e)?{options:void 0,context:Zg(r)}:e&&!Array.isArray(e)?{options:e}:{options:void 0,context:Zg(r)}}function aE(e){return"id"in e&&"extensions"in e}function Zg(e){if(!e)return;let{fetch:t,loaders:r,coreApi:n,signal:i,reportProgress:o,_parse:s,_parseSync:a,_parseInBatches:c,...l}=e;return JSON.parse(JSON.stringify(l))}async function YU({loader:e,arrayBuffer:t,options:r,context:n}){let i,o;if(e.parse||e.parseSync)i=t,o=e.parse||e.parseSync;else if(e.parseTextSync)i=new TextDecoder().decode(t),o=e.parseTextSync;else throw new Error(`Could not load data with ${e.name} loader`);return r=cE(e,r),await o(i,{...r},n,e)}function cE(e,t){var r;return{...t,modules:{...(r=e.options)==null?void 0:r.modules,...t.modules},core:{...t.core,worker:!1}}}var lE=p(()=>{"use strict";ic()});function Jd(e={}){if(e.coordinateEpoch!==void 0&&!Number.isFinite(e.coordinateEpoch))throw new Error("Spatial reference coordinate epoch must be a finite decimal year");return Object.freeze({crs:uE(e.crs||{state:"absent",provenance:"unknown"}),vertical:e.vertical?uE(e.vertical):void 0,coordinateEpoch:e.coordinateEpoch,coordinateFrame:e.coordinateFrame||"unknown",coordinateOrder:Object.freeze([...e.coordinateOrder||[]]),units:e.units?Object.freeze([...e.units]):void 0})}function wr(e){if(typeof e=="object")return"projjson";let t=e.trim();return/^[A-Z][A-Z0-9_]*\s*[\[(]/i.test(t)?"wkt":/(?:^|\s)\+?proj=/i.test(t)?"proj-string":/^[A-Z][A-Z0-9._-]*(?::[A-Z0-9._-]+)+$/i.test(t)||/^urn:ogc:def:crs:/i.test(t)||/^https?:\/\//i.test(t)||/^[A-Z][A-Z0-9._-]*$/i.test(t)?"identifier":"opaque"}function uE(e){return e.state==="explicit"||e.state==="default"?Object.freeze({...e,definition:fE(e.definition),alternatives:e.alternatives?Object.freeze(e.alternatives.map(t=>Object.freeze({...t,definition:fE(t.definition)}))):void 0}):Object.freeze({...e})}function fE(e){return typeof e=="string"?e:Qg(e)}function Qg(e){return Array.isArray(e)?Object.freeze(e.map(t=>Qg(t))):e&&typeof e=="object"?Object.freeze(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Qg(r)]))):e}var Dl=p(()=>{});function _f(e,t){let n={type:"wkt-crs",root:new ey(e).parse()};if(t!=null&&t.strict){let i=pE(n,{profile:t.profile,allowExtensions:!1});if(i.length>0)throw new em(i)}return n}function pE(e,t){var a;if(!e||e.type!=="wkt-crs"||((a=e.root)==null?void 0:a.type)!=="node")throw new TypeError("validateWKTCRS expects a WKTCRSAst");let r=aj(e.root.keyword,(t==null?void 0:t.profile)||"auto"),n=oj[r],i=sj[r],o=[],s=e.root.keyword.toUpperCase();return n.has(s)||o.push({code:"invalid-root",message:`${e.root.keyword} is not a ${r} root keyword`,path:[],keyword:e.root.keyword}),gE(e.root,[],c=>{let l=c.node.keyword.toUpperCase();!(t!=null&&t.allowExtensions)&&!i.has(l)&&o.push({code:"unknown-keyword",message:`${c.node.keyword} is not defined by the ${r} profile`,path:c.path,keyword:c.node.keyword}),c.node.values.length===0&&o.push({code:"empty-node",message:`${c.node.keyword} must contain at least one value`,path:c.path,keyword:c.node.keyword});let u=cj(c.node);u&&o.push({code:"invalid-value",message:u,path:c.path,keyword:c.node.keyword})}),o}function aj(e,t){return t!=="auto"?t:xf.has(e.toUpperCase())?"wkt1":"wkt2:2019"}function cj(e){let t=e.keyword.toUpperCase(),r=e.values,n=(o,...s)=>!!(r[o]&&s.includes(r[o].type)),i=(o,...s)=>r.length===o&&s.every((a,c)=>n(c,a));if(["ANGLEUNIT","LENGTHUNIT","PARAMETRICUNIT","SCALEUNIT","TIMEUNIT","TEMPORALQUANTITY","UNIT"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"number")))return`${e.keyword} must start with a quoted name and numeric conversion factor`;if(t==="CS"&&!i(2,"enumeration","number"))return`${e.keyword} must contain a coordinate-system type and dimension`;if(t==="BBOX"&&!i(4,"number","number","number","number"))return`${e.keyword} must contain four numeric bounds`;if(["ENSEMBLEACCURACY","EPOCH","COORDEPOCH","FRAMEEPOCH","OPERATIONACCURACY","ORDER"].includes(t)&&!i(1,"number"))return`${e.keyword} must contain one number`;if(["ANCHOR","AREA","CALENDAR","CITATION","REMARK","SCOPE","URI","VERSION"].includes(t)&&!i(1,"string"))return`${e.keyword} must contain one quoted string`;if(["ELLIPSOID","SPHEROID","TRIAXIAL"].includes(t)&&!(r.length>=3&&n(0,"string")&&n(1,"number")&&n(2,"number")))return`${e.keyword} must start with a quoted name and numeric ellipsoid axes`;if(["PARAMETER"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"number")))return`${e.keyword} must start with a quoted name and numeric value`;if(t==="PARAMETERFILE"&&!i(2,"string","string"))return`${e.keyword} must contain a quoted name and file name`;if(["AUTHORITY","ID"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"string","number")))return`${e.keyword} must start with a quoted authority and identifier`;if(["AXIS"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"enumeration")))return`${e.keyword} must start with a quoted name and axis direction`;if(["METHOD","PROJECTION"].includes(t)&&!(r.length>=1&&n(0,"string")))return`${e.keyword} must start with a quoted name`;if(t==="TIMEEXTENT"){let o=s=>n(s,"enumeration","string");if(r.length!==2||!o(0)||!o(1))return`${e.keyword} must contain two date-time or quoted values`}if(t==="VERTICALEXTENT"&&(r.length<2||r.length>3||!n(0,"number")||!n(1,"number")||r.length===3&&!n(2,"node")))return`${e.keyword} must contain two numeric bounds and an optional unit`;if(t==="COORDINATEMETADATA"&&(r.length<1||r.length>2||!n(0,"node")||r.length===2&&(!n(1,"node")||!["EPOCH","COORDEPOCH"].includes(r[1].keyword.toUpperCase()))))return`${e.keyword} must contain a CRS and an optional coordinate epoch`;if(t==="BOUNDCRS"){let o=r.slice(0,3).map(s=>s.type==="node"?s.keyword.toUpperCase():"");if(o[0]!=="SOURCECRS"||o[1]!=="TARGETCRS"||o[2]!=="ABRIDGEDTRANSFORMATION")return`${e.keyword} must start with SOURCECRS, TARGETCRS, and ABRIDGEDTRANSFORMATION`}return["COMPOUNDCRS","CONCATENATEDOPERATION","COORDINATEOPERATION","DERIVEDPROJCRS","ENGCRS","ENGINEERINGCRS","GEODCRS","GEODETICCRS","GEOGCRS","GEOGRAPHICCRS","PARAMETRICCRS","POINTMOTIONOPERATION","PROJCRS","PROJECTEDCRS","TIMECRS","VERTCRS","VERTICALCRS"].includes(t)&&!n(0,"string")?`${e.keyword} must start with a quoted name`:null}function gE(e,t,r){r({node:e,path:t});for(let n=0;n<e.values.length;n++){let i=e.values[n];i.type==="node"&&gE(i,[...t,n],r)}}function lj(e,t){let r=1,n=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
3
+ `?(r++,n=1):n++;return{line:r,column:n}}var Qd,em,ZU,JU,xf,ty,QU,ej,tj,rj,hE,dE,mE,nj,ij,oj,sj,ey,ry=p(()=>{Qd=class extends SyntaxError{constructor(t,r,n){let i=lj(r,n);super(`${t} at ${i.line}:${i.column}`),this.name="WKTCRSSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}},em=class extends Error{constructor(t){var r;super(((r=t[0])==null?void 0:r.message)||"WKT validation failed"),this.name="WKTCRSValidationError",this.issues=t}},ZU=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?$/,JU=/^[A-Za-z][A-Za-z0-9_]*/,xf=new Set(["COMPD_CS","CONCAT_MT","FITTED_CS","GEOCCS","GEOGCS","INVERSE_MT","LOCAL_CS","PARAM_MT","PASSTHROUGH_MT","PROJCS","VERT_CS"]),ty=new Set([...xf,"AUTHORITY","AXIS","CONCAT_MT","DATUM","INVERSE_MT","LOCAL_DATUM","PARAMETER","PARAM_MT","PASSTHROUGH_MT","PRIMEM","PROJECTION","SPHEROID","TOWGS84","UNIT","VERT_DATUM"]),QU=new Set(xf),ej=new Set([...ty,"EXTENSION"]),tj=new Set([...xf,"COMPDCS","LOCALCS","VERTCS"]),rj=new Set([...ty,"COMPDCS","LOCALCS","VDATUM","VERTCS"]),hE=new Set(["BOUNDCRS","COMPOUNDCRS","COORDINATEOPERATION","ENGCRS","ENGINEERINGCRS","GEODCRS","GEODETICCRS","PARAMETRICCRS","PROJCRS","PROJECTEDCRS","TIMECRS","VERTCRS","VERTICALCRS"]),dE=new Set([...hE,"CONCATENATEDOPERATION","COORDINATEMETADATA","DERIVEDPROJCRS","GEOGCRS","GEOGRAPHICCRS","POINTMOTIONOPERATION"]),mE=new Set([...dE,"ABRIDGEDTRANSFORMATION","ANCHOR","ANGLEUNIT","AREA","AXIS","BASEENGCRS","BASEGEODCRS","BASEGEOGCRS","BASEPARAMCRS","BASEPROJCRS","BASETIMECRS","BASEVERTCRS","BBOX","BEARING","CALENDAR","CITATION","CONVERSION","COORDEPOCH","CS","DATUM","DERIVINGCONVERSION","DYNAMIC","EDATUM","ELLIPSOID","ENGINEERINGDATUM","ENSEMBLE","ENSEMBLEACCURACY","EPOCH","FRAMEEPOCH","GEODETICDATUM","GEOIDMODEL","ID","INTERPOLATIONCRS","LENGTHUNIT","MEMBER","MERIDIAN","METHOD","MODEL","OPERATIONACCURACY","ORDER","PARAMETER","PARAMETERFILE","PARAMETRICDATUM","PARAMETRICUNIT","PDATUM","PRIMEM","PRIMEMERIDIAN","REMARK","SCALEUNIT","SCOPE","SOURCECRS","STEP","TARGETCRS","TDATUM","TEMPORALQUANTITY","TIMEEXTENT","TIMEORIGIN","TIMEUNIT","TIMEDATUM","TRIAXIAL","TRF","URI","USAGE","VDATUM","VERSION","VERTICALDATUM","VERTICALEXTENT","VELOCITYGRID","VRF"]),nj=new Set(["BASEGEOGCRS","CALENDAR","CONCATENATEDOPERATION","COORDEPOCH","COORDINATEMETADATA","DERIVEDPROJCRS","DYNAMIC","ENSEMBLE","ENSEMBLEACCURACY","EPOCH","FRAMEEPOCH","GEOGCRS","GEOGRAPHICCRS","GEOIDMODEL","MEMBER","MODEL","POINTMOTIONOPERATION","STEP","TEMPORALQUANTITY","TRF","TRIAXIAL","VELOCITYGRID","VRF"]),ij=new Set([...mE].filter(e=>!nj.has(e))),oj={wkt1:xf,gdal:QU,esri:tj,"wkt2:2015":hE,"wkt2:2019":dE},sj={wkt1:ty,gdal:ej,esri:rj,"wkt2:2015":ij,"wkt2:2019":mE};ey=class{constructor(t){this.offset=0,this.source=t}parse(){this.skipWhitespace();let t=this.parseNode();return this.skipWhitespace(),this.offset!==this.source.length&&this.fail("Unexpected content after WKT root"),t}parseNode(){let t=this.parseKeyword();return this.parseNodeAfterKeyword(t)}parseNodeAfterKeyword(t){this.skipWhitespace();let r=this.source[this.offset];r!=="["&&r!=="("&&this.fail(`Expected '[' or '(' after ${t}`),this.offset++;let n=r==="["?"bracket":"parenthesis",i=r==="["?"]":")",o=[];if(this.skipWhitespace(),this.source[this.offset]===i)return this.offset++,{type:"node",keyword:t,delimiter:n,values:o};for(;this.offset<this.source.length;){o.push(this.parseValue()),this.skipWhitespace();let s=this.source[this.offset];if(s===","){this.offset++,this.skipWhitespace(),this.source[this.offset]===i&&this.fail("Expected a WKT value after comma");continue}if(s===i)return this.offset++,{type:"node",keyword:t,delimiter:n,values:o};(s==="]"||s===")")&&this.fail(`Expected '${i}' to close ${t}`),this.fail(`Expected ',' or '${i}' in ${t}`)}this.fail(`Unterminated ${t} node`)}parseValue(){if(this.skipWhitespace(),this.source[this.offset]==='"')return this.parseString();let r=this.offset;for(;this.offset<this.source.length&&!/[\s,\[\]()"]/.test(this.source[this.offset]);)this.offset++;r===this.offset&&this.fail("Expected a WKT value");let n=this.source.slice(r,this.offset);return this.source[this.offset]==='"'&&this.fail("Unexpected quote in unquoted WKT value"),this.skipWhitespace(),this.source[this.offset]==="["||this.source[this.offset]==="("?(/^[A-Za-z][A-Za-z0-9_]*$/.test(n)||this.fail(`Invalid WKT keyword '${n}'`),this.parseNodeAfterKeyword(n)):ZU.test(n)?{type:"number",value:Number(n),raw:n}:{type:"enumeration",value:n}}parseKeyword(){let t=this.source.slice(this.offset).match(JU);return t||this.fail("Expected a WKT keyword"),this.offset+=t[0].length,t[0]}parseString(){this.offset++;let t="";for(;this.offset<this.source.length;){let r=this.source[this.offset++];if(r==='"'){if(this.source[this.offset]==='"'){t+='"',this.offset++;continue}return{type:"string",value:t}}t+=r}this.fail("Unterminated WKT string")}skipWhitespace(){for(;this.offset<this.source.length&&/\s/.test(this.source[this.offset]);)this.offset++}fail(t){throw new Qd(t,this.source,this.offset)}}});function Sf(e){let t=hj(e);if(t.length===0)throw new Uo("PROJ string is empty",e,0);return{type:"proj-string",parameters:t.map(n=>fj(n.raw,n.offset,e))}}function fj(e,t,r){let n=e.startsWith("+")?e.slice(1):e;if(!n)throw new Uo("Expected a parameter after '+'",r,t);let i=n.indexOf("="),o=i<0?n:n.slice(0,i);if(!o||/[\s+=]/.test(o))throw new Uo(`Invalid PROJ parameter name '${o}'`,r,t);if(i<0)return{type:"parameter",name:o};let s=n.slice(i+1),a=dj(s,r,t+i+1);return{type:"parameter",name:o,value:a,rawValue:s}}function hj(e){let t=[],r=0;for(;r<e.length;){for(;r<e.length&&/\s/.test(e[r]);)r++;if(r>=e.length)break;let n=r,i=null,o=!1;for(;r<e.length;){let s=e[r];if(o){o=!1,r++;continue}if(s==="\\"&&i){o=!0,r++;continue}if(i){s===i&&(i=null),r++;continue}if((s==='"'||s==="'")&&e[r-1]==="="){i=s,r++;continue}if(/\s/.test(s))break;r++}if(i)throw new Uo("Unterminated quoted PROJ value",e,n);t.push({raw:e.slice(n,r),offset:n})}return t}function dj(e,t,r){if(!e)return"";let n=e[0];if(n!=='"'&&n!=="'"){if((e.includes('"')||e.includes("'"))&&!uj.test(e))throw new Uo("Quote must begin a PROJ parameter value",t,r);return e}if(e[e.length-1]!==n)throw new Uo("Unterminated quoted PROJ value",t,r);let i="";for(let o=1;o<e.length-1;o++){let s=e[o];s==="\\"&&o+1<e.length-1?i+=e[++o]:i+=s}return i}function mj(e,t){let r=1,n=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
4
+ `?(r++,n=1):n++;return{line:r,column:n}}var Uo,uj,ny=p(()=>{Uo=class extends SyntaxError{constructor(t,r,n){let i=mj(r,n);super(`${t} at ${i.line}:${i.column}`),this.name="PROJStringSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}};uj=/^[+-]?\d+(?:\.\d*)?d(?:\d+(?:\.\d*)?'(?:\d+(?:\.\d*)?")?)?[NSEW]?$/i});var Mf,yE=p(()=>{Mf={m:{name:"meters",metersPerUnit:1},mm:{name:"millimeters",metersPerUnit:.001},cm:{name:"centimeters",metersPerUnit:.01},ft:{name:"feet",metersPerUnit:.3048},"us-ft":{name:"us-survey-feet",metersPerUnit:.3048006096012192},fath:{name:"fathoms",metersPerUnit:1.8288},kmi:{name:"nautical-miles",metersPerUnit:1852},"us-ch":{name:"us-survey-chains",metersPerUnit:20.1168402336805},"us-mi":{name:"us-survey-miles",metersPerUnit:1609.34721869444},km:{name:"kilometers",metersPerUnit:1e3},"ind-ft":{name:"indian-feet",metersPerUnit:.30479841},"ind-yd":{name:"indian-yards",metersPerUnit:.91439523},mi:{name:"miles",metersPerUnit:1609.344},yd:{name:"yards",metersPerUnit:.9144},ch:{name:"chains",metersPerUnit:20.1168},link:{name:"links",metersPerUnit:.201168},dm:{name:"decimeters",metersPerUnit:.1},in:{name:"inches",metersPerUnit:.0254},"ind-ch":{name:"indian-chains",metersPerUnit:20.11669506},"us-in":{name:"us-survey-inches",metersPerUnit:.025400050800101},"us-yd":{name:"us-survey-yards",metersPerUnit:.914401828803658}}});function bE(e){return JSON.stringify([e.coordinateFrame,e.projection,Object.keys(e.parameters).sort().map(t=>[t,e.parameters[t]]),[e.ellipsoid.semiMajorAxis,e.ellipsoid.semiMinorAxis],e.axis,[e.xUnit.name,e.xUnit.metersPerUnit,e.xUnit.degreesPerUnit],[e.yUnit.name,e.yUnit.metersPerUnit,e.yUnit.degreesPerUnit],[e.zUnit.name,e.zUnit.metersPerUnit,e.zUnit.degreesPerUnit],e.lossy,e.areaOfUse])}var iy=p(()=>{yE()});var oy=p(()=>{Dl();ry();ny()});var tm={};Jt(tm,{EPSILON1:()=>pj,EPSILON10:()=>vj,EPSILON11:()=>Ej,EPSILON12:()=>Tj,EPSILON13:()=>Aj,EPSILON14:()=>Ij,EPSILON15:()=>Pj,EPSILON16:()=>Rj,EPSILON17:()=>Lj,EPSILON18:()=>Oj,EPSILON19:()=>Bj,EPSILON2:()=>gj,EPSILON20:()=>Cj,EPSILON3:()=>yj,EPSILON4:()=>bj,EPSILON5:()=>wj,EPSILON6:()=>xj,EPSILON7:()=>_j,EPSILON8:()=>Sj,EPSILON9:()=>Mj,PI:()=>Gj,PI_OVER_FOUR:()=>Nj,PI_OVER_SIX:()=>Fj,PI_OVER_TWO:()=>Dj,TWO_PI:()=>kj});var pj,gj,yj,bj,wj,xj,_j,Sj,Mj,vj,Ej,Tj,Aj,Ij,Pj,Rj,Lj,Oj,Bj,Cj,Dj,Nj,Fj,Gj,kj,wE=p(()=>{pj=.1,gj=.01,yj=.001,bj=1e-4,wj=1e-5,xj=1e-6,_j=1e-7,Sj=1e-8,Mj=1e-9,vj=1e-10,Ej=1e-11,Tj=1e-12,Aj=1e-13,Ij=1e-14,Pj=1e-15,Rj=1e-16,Lj=1e-17,Oj=1e-18,Bj=1e-19,Cj=1e-20,Dj=Math.PI/2,Nj=Math.PI/4,Fj=Math.PI/6,Gj=Math.PI,kj=Math.PI*2});function sy(e,{precision:t=xt.precision}={}){return e=qj(e),`${parseFloat(e.toPrecision(t))}`}function ao(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ay(e){return xE(e)}function cy(e){return _E(e)}function xE(e,t){return SE(e,r=>r*jj,t)}function _E(e,t){return SE(e,r=>r*Uj,t)}function rm(e,t,r){let n=xt.EPSILON;r&&(xt.EPSILON=r);try{if(e===t)return!0;if(ao(e)&&ao(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!rm(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=xt.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{xt.EPSILON=n}}function qj(e){return Math.round(e/xt.EPSILON)*xt.EPSILON}function Vj(e){return e.clone?e.clone():new Array(e.length)}function SE(e,t,r){if(ao(e)){let n=e;r=r||Vj(n);for(let i=0;i<r.length&&i<n.length;++i){let o=typeof e=="number"?e:e[i];r[i]=t(o,i,r)}return r}return t(e)}var Uj,jj,zj,xt,Nl=p(()=>{Uj=1/Math.PI*180,jj=1/180*Math.PI,zj={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...zj}};xt=globalThis.mathgl.config});var Ps,nm=p(()=>{Nl();Ps=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:ao(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toString(){return this.formatString(xt)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+sy(this[n],t);return`${t.printTypes?this.constructor.name:""}[${r}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!rm(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let i=0;i<this.ELEMENTS;++i){let o=t[i],s=typeof r=="number"?r:r[i];this[i]=o+n*(s-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(xt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}}});function Wj(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Kt(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function Fl(e,t,r=""){if(xt.debug&&!Wj(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}var oc=p(()=>{Nl()});var Gl,ly=p(()=>{nm();oc();Nl();Gl=class extends Ps{toString(){let t="[";if(xt.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+r]}`}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=` ${this[r]}`}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=Kt(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(t,r){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}}});function Ri(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var uy=p(()=>{});var im,ME=p(()=>{nm();oc();uy();im=class extends Ps{get x(){return this[0]}set x(t){this[0]=Kt(t)}get y(){return this[1]}set y(t){this[1]=Kt(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-t[n];r+=i*i}return Kt(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Kt(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return Ri(t>=0&&t<this.ELEMENTS,"index is out of range"),Kt(this[t])}setComponent(t,r){return Ri(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]+=t[n]*r;return this.check()}}});var om,mee,vE=p(()=>{om=typeof Float32Array<"u"?Float32Array:Array,mee=Math.PI/180});function EE(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function TE(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var sm=p(()=>{});function AE(e,t,r){let n=t[0],i=t[1],o=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/o,e[1]=(r[1]*n+r[5]*i)/o,e}function am(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[3]*n+r[7]*i+r[11]*o||1;return e[0]=(r[0]*n+r[4]*i+r[8]*o)/s,e[1]=(r[1]*n+r[5]*i+r[9]*o)/s,e[2]=(r[2]*n+r[6]*i+r[10]*o)/s,e}function IE(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function PE(e,t,r){let n=t[0],i=t[1],o=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*o,e[1]=r[1]*n+r[4]*i+r[7]*o,e[2]=r[2]*n+r[5]*i+r[8]*o,e[3]=t[3],e}var cm=p(()=>{});function RE(){let e=new om(3);return om!==Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function $j(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function fy(e,t,r){let n=new om(3);return n[0]=e,n[1]=t,n[2]=r,n}function LE(e,t){let r=t[0],n=t[1],i=t[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function hy(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function kl(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[0],a=r[1],c=r[2];return e[0]=i*c-o*a,e[1]=o*s-n*c,e[2]=n*a-i*s,e}function lm(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return s=s||1,e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/s,e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,e}function um(e,t,r){let n=t[0],i=t[1],o=t[2];return e[0]=n*r[0]+i*r[3]+o*r[6],e[1]=n*r[1]+i*r[4]+o*r[7],e[2]=n*r[2]+i*r[5]+o*r[8],e}function OE(e,t,r){let n=r[0],i=r[1],o=r[2],s=r[3],a=t[0],c=t[1],l=t[2],u=i*l-o*c,h=o*a-n*l,d=n*c-i*a,m=i*d-o*h,g=o*u-n*d,y=n*h-i*u,b=s*2;return u*=b,h*=b,d*=b,m*=2,g*=2,y*=2,e[0]=a+u+m,e[1]=c+h+g,e[2]=l+d+y,e}function BE(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function CE(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function DE(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function NE(e,t){let r=e[0],n=e[1],i=e[2],o=t[0],s=t[1],a=t[2],c=Math.sqrt((r*r+n*n+i*i)*(o*o+s*s+a*a)),l=c&&hy(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}var FE,Ul=p(()=>{vE();FE=$j});var dy,fm,J,GE=p(()=>{ME();Nl();oc();Ul();cm();dy=[0,0,0],J=class e extends im{static get ZERO(){return fm||(fm=new e(0,0,0),Object.freeze(fm)),fm}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&ao(t)?this.copy(t):(xt.debug&&(Kt(t),Kt(r),Kt(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return xt.debug&&(Kt(t.x),Kt(t.y),Kt(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Kt(t)}angle(t){return NE(this,t)}cross(t){return kl(this,this,t),this.check()}rotateX({radians:t,origin:r=dy}){return BE(this,this,r,t),this.check()}rotateY({radians:t,origin:r=dy}){return CE(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=dy}){return DE(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return lm(this,this,t),this.check()}transformAsVector(t){return am(this,this,t),this.check()}transformByMatrix3(t){return um(this,this,t),this.check()}transformByMatrix2(t){return IE(this,this,t),this.check()}transformByQuaternion(t){return OE(this,this,t),this.check()}}});function kE(e,t){if(e===t){let r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function UE(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],c=t[6],l=t[7],u=t[8],h=u*s-a*l,d=-u*o+a*c,m=l*o-s*c,g=r*h+n*d+i*m;return g?(g=1/g,e[0]=h*g,e[1]=(-u*n+i*l)*g,e[2]=(a*n-i*s)*g,e[3]=d*g,e[4]=(u*r-i*c)*g,e[5]=(-a*r+i*o)*g,e[6]=m*g,e[7]=(-l*r+n*c)*g,e[8]=(s*r-n*o)*g,e):null}function jE(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],c=e[7],l=e[8];return t*(l*o-s*c)+r*(-l*i+s*a)+n*(c*i-o*a)}function my(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=r[0],m=r[1],g=r[2],y=r[3],b=r[4],w=r[5],_=r[6],S=r[7],v=r[8];return e[0]=d*n+m*s+g*l,e[1]=d*i+m*a+g*u,e[2]=d*o+m*c+g*h,e[3]=y*n+b*s+w*l,e[4]=y*i+b*a+w*u,e[5]=y*o+b*c+w*h,e[6]=_*n+S*s+v*l,e[7]=_*i+S*a+v*u,e[8]=_*o+S*c+v*h,e}function zE(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=r[0],m=r[1];return e[0]=n,e[1]=i,e[2]=o,e[3]=s,e[4]=a,e[5]=c,e[6]=d*n+m*s+l,e[7]=d*i+m*a+u,e[8]=d*o+m*c+h,e}function qE(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=Math.sin(r),m=Math.cos(r);return e[0]=m*n+d*s,e[1]=m*i+d*a,e[2]=m*o+d*c,e[3]=m*s-d*n,e[4]=m*a-d*i,e[5]=m*c-d*o,e[6]=l,e[7]=u,e[8]=h,e}function py(e,t,r){let n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function VE(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,a=n+n,c=i+i,l=r*s,u=n*s,h=n*a,d=i*s,m=i*a,g=i*c,y=o*s,b=o*a,w=o*c;return e[0]=1-h-g,e[3]=u-w,e[6]=d+b,e[1]=u+w,e[4]=1-l-g,e[7]=m-y,e[2]=d-b,e[5]=m+y,e[8]=1-l-h,e}var gy=p(()=>{});function Yj(){return hm||(hm=new sc([0,0,0,0,0,0,0,0,0]),Object.freeze(hm)),hm}function Zj(){return dm||(dm=new sc,Object.freeze(dm)),dm}var yy,Xj,sc,hm,dm,WE=p(()=>{ly();oc();cm();gy();sm();Ul();(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(yy||(yy={}));Xj=Object.freeze([1,0,0,0,1,0,0,0,1]),sc=class extends Gl{static get IDENTITY(){return Zj()}static get ZERO(){return Yj()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return yy}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(Xj)}fromObject(t){return this.check()}fromQuaternion(t){return VE(this,t),this.check()}fromMatrix4(t){return this.set(t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10])}set(t,r,n,i,o,s,a,c,l){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=l,this.check()}setRowMajor(t,r,n,i,o,s,a,c,l){return this[0]=t,this[1]=i,this[2]=a,this[3]=r,this[4]=o,this[5]=c,this[6]=n,this[7]=s,this[8]=l,this.check()}determinant(){return jE(this)}transpose(){return kE(this,this),this.check()}invert(){return UE(this,this),this.check()}multiplyLeft(t){return my(this,t,this),this.check()}multiplyRight(t){return my(this,this,t),this.check()}rotate(t){return qE(this,this,t),this.check()}scale(t){return Array.isArray(t)?py(this,this,t):py(this,this,[t,t]),this.check()}translate(t){return zE(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=EE(r||[-0,-0],t,this);break;case 3:n=um(r||[-0,-0,-0],t,this);break;case 4:n=PE(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Fl(n,t.length),n}},dm=null});function Jj(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 HE(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=i,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function $E(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],c=t[6],l=t[7],u=t[8],h=t[9],d=t[10],m=t[11],g=t[12],y=t[13],b=t[14],w=t[15],_=r*a-n*s,S=r*c-i*s,v=r*l-o*s,T=n*c-i*a,O=n*l-o*a,P=i*l-o*c,M=u*y-h*g,U=u*b-d*g,C=u*w-m*g,L=h*b-d*y,A=h*w-m*y,W=d*w-m*b,G=_*W-S*A+v*L+T*C-O*U+P*M;return G?(G=1/G,e[0]=(a*W-c*A+l*L)*G,e[1]=(i*A-n*W-o*L)*G,e[2]=(y*P-b*O+w*T)*G,e[3]=(d*O-h*P-m*T)*G,e[4]=(c*C-s*W-l*U)*G,e[5]=(r*W-i*C+o*U)*G,e[6]=(b*v-g*P-w*S)*G,e[7]=(u*P-d*v+m*S)*G,e[8]=(s*A-a*C+l*M)*G,e[9]=(n*C-r*A-o*M)*G,e[10]=(g*O-y*v+w*_)*G,e[11]=(h*v-u*O-m*_)*G,e[12]=(a*U-s*L-c*M)*G,e[13]=(r*L-n*U+i*M)*G,e[14]=(y*S-g*T-b*_)*G,e[15]=(u*T-h*S+d*_)*G,e):null}function KE(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],c=e[7],l=e[8],u=e[9],h=e[10],d=e[11],m=e[12],g=e[13],y=e[14],b=e[15],w=t*s-r*o,_=t*a-n*o,S=r*a-n*s,v=l*g-u*m,T=l*y-h*m,O=u*y-h*g,P=t*O-r*T+n*v,M=o*O-s*T+a*v,U=l*S-u*_+h*w,C=m*S-g*_+y*w;return c*P-i*M+b*U-d*C}function by(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=t[9],m=t[10],g=t[11],y=t[12],b=t[13],w=t[14],_=t[15],S=r[0],v=r[1],T=r[2],O=r[3];return e[0]=S*n+v*a+T*h+O*y,e[1]=S*i+v*c+T*d+O*b,e[2]=S*o+v*l+T*m+O*w,e[3]=S*s+v*u+T*g+O*_,S=r[4],v=r[5],T=r[6],O=r[7],e[4]=S*n+v*a+T*h+O*y,e[5]=S*i+v*c+T*d+O*b,e[6]=S*o+v*l+T*m+O*w,e[7]=S*s+v*u+T*g+O*_,S=r[8],v=r[9],T=r[10],O=r[11],e[8]=S*n+v*a+T*h+O*y,e[9]=S*i+v*c+T*d+O*b,e[10]=S*o+v*l+T*m+O*w,e[11]=S*s+v*u+T*g+O*_,S=r[12],v=r[13],T=r[14],O=r[15],e[12]=S*n+v*a+T*h+O*y,e[13]=S*i+v*c+T*d+O*b,e[14]=S*o+v*l+T*m+O*w,e[15]=S*s+v*u+T*g+O*_,e}function XE(e,t,r){let n=r[0],i=r[1],o=r[2],s,a,c,l,u,h,d,m,g,y,b,w;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*o+t[12],e[13]=t[1]*n+t[5]*i+t[9]*o+t[13],e[14]=t[2]*n+t[6]*i+t[10]*o+t[14],e[15]=t[3]*n+t[7]*i+t[11]*o+t[15]):(s=t[0],a=t[1],c=t[2],l=t[3],u=t[4],h=t[5],d=t[6],m=t[7],g=t[8],y=t[9],b=t[10],w=t[11],e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=u,e[5]=h,e[6]=d,e[7]=m,e[8]=g,e[9]=y,e[10]=b,e[11]=w,e[12]=s*n+u*i+g*o+t[12],e[13]=a*n+h*i+y*o+t[13],e[14]=c*n+d*i+b*o+t[14],e[15]=l*n+m*i+w*o+t[15]),e}function YE(e,t,r){let n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ZE(e,t,r,n){let i=n[0],o=n[1],s=n[2],a=Math.sqrt(i*i+o*o+s*s),c,l,u,h,d,m,g,y,b,w,_,S,v,T,O,P,M,U,C,L,A,W,G,E;return a<1e-6?null:(a=1/a,i*=a,o*=a,s*=a,l=Math.sin(r),c=Math.cos(r),u=1-c,h=t[0],d=t[1],m=t[2],g=t[3],y=t[4],b=t[5],w=t[6],_=t[7],S=t[8],v=t[9],T=t[10],O=t[11],P=i*i*u+c,M=o*i*u+s*l,U=s*i*u-o*l,C=i*o*u-s*l,L=o*o*u+c,A=s*o*u+i*l,W=i*s*u+o*l,G=o*s*u-i*l,E=s*s*u+c,e[0]=h*P+y*M+S*U,e[1]=d*P+b*M+v*U,e[2]=m*P+w*M+T*U,e[3]=g*P+_*M+O*U,e[4]=h*C+y*L+S*A,e[5]=d*C+b*L+v*A,e[6]=m*C+w*L+T*A,e[7]=g*C+_*L+O*A,e[8]=h*W+y*G+S*E,e[9]=d*W+b*G+v*E,e[10]=m*W+w*G+T*E,e[11]=g*W+_*G+O*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function JE(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[4],s=t[5],a=t[6],c=t[7],l=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+l*n,e[5]=s*i+u*n,e[6]=a*i+h*n,e[7]=c*i+d*n,e[8]=l*i-o*n,e[9]=u*i-s*n,e[10]=h*i-a*n,e[11]=d*i-c*n,e}function QE(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],a=t[2],c=t[3],l=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-l*n,e[1]=s*i-u*n,e[2]=a*i-h*n,e[3]=c*i-d*n,e[8]=o*n+l*i,e[9]=s*n+u*i,e[10]=a*n+h*i,e[11]=c*n+d*i,e}function e4(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],a=t[2],c=t[3],l=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+l*n,e[1]=s*i+u*n,e[2]=a*i+h*n,e[3]=c*i+d*n,e[4]=l*i-o*n,e[5]=u*i-s*n,e[6]=h*i-a*n,e[7]=d*i-c*n,e}function t4(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,a=n+n,c=i+i,l=r*s,u=n*s,h=n*a,d=i*s,m=i*a,g=i*c,y=o*s,b=o*a,w=o*c;return e[0]=1-h-g,e[1]=u+w,e[2]=d-b,e[3]=0,e[4]=u-w,e[5]=1-l-g,e[6]=m+y,e[7]=0,e[8]=d+b,e[9]=m-y,e[10]=1-l-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function r4(e,t,r,n,i,o,s){let a=1/(r-t),c=1/(i-n),l=1/(o-s);return e[0]=o*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*c,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(i+n)*c,e[10]=(s+o)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*o*2*l,e[15]=0,e}function Qj(e,t,r,n,i){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let s=1/(n-i);e[10]=(i+n)*s,e[14]=2*i*n*s}else e[10]=-1,e[14]=-2*n;return e}function ez(e,t,r,n,i,o,s){let a=1/(t-r),c=1/(n-i),l=1/(o-s);return e[0]=-2*a,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*l,e[11]=0,e[12]=(t+r)*a,e[13]=(i+n)*c,e[14]=(s+o)*l,e[15]=1,e}function o4(e,t,r,n){let i,o,s,a,c,l,u,h,d,m,g=t[0],y=t[1],b=t[2],w=n[0],_=n[1],S=n[2],v=r[0],T=r[1],O=r[2];return Math.abs(g-v)<1e-6&&Math.abs(y-T)<1e-6&&Math.abs(b-O)<1e-6?Jj(e):(h=g-v,d=y-T,m=b-O,i=1/Math.sqrt(h*h+d*d+m*m),h*=i,d*=i,m*=i,o=_*m-S*d,s=S*h-w*m,a=w*d-_*h,i=Math.sqrt(o*o+s*s+a*a),i?(i=1/i,o*=i,s*=i,a*=i):(o=0,s=0,a=0),c=d*a-m*s,l=m*o-h*a,u=h*s-d*o,i=Math.sqrt(c*c+l*l+u*u),i?(i=1/i,c*=i,l*=i,u*=i):(c=0,l=0,u=0),e[0]=o,e[1]=c,e[2]=h,e[3]=0,e[4]=s,e[5]=l,e[6]=d,e[7]=0,e[8]=a,e[9]=u,e[10]=m,e[11]=0,e[12]=-(o*g+s*y+a*b),e[13]=-(c*g+l*y+u*b),e[14]=-(h*g+d*y+m*b),e[15]=1,e)}var n4,i4,wy=p(()=>{n4=Qj;i4=ez});function s4(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function a4(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function c4(e){let t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}function l4(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function u4(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=r*s,e[1]=n*s,e[2]=i*s,e[3]=o*s,e}function f4(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function h4(e,t,r,n){let i=t[0],o=t[1],s=t[2],a=t[3];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=s+n*(r[2]-s),e[3]=a+n*(r[3]-a),e}function d4(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,e}var mm=p(()=>{});function oz(){return pm||(pm=new yn([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(pm)),pm}function sz(){return gm||(gm=new yn,Object.freeze(gm)),gm}function m4(e){if(e>Math.PI*2)throw Error("expected radians")}function az(e,t,r,n,i,o){let s=2*o/(r-t),a=2*o/(i-n),c=(r+t)/(r-t),l=(i+n)/(i-n),u=-1,h=-1,d=-2*o;return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=c,e[9]=l,e[10]=u,e[11]=h,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}var Sy,rz,nz,xy,_y,iz,yn,pm,gm,p4=p(()=>{ly();oc();cm();wy();sm();Ul();mm();(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"})(Sy||(Sy={}));rz=45*Math.PI/180,nz=1,xy=.1,_y=500,iz=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),yn=class extends Gl{static get IDENTITY(){return sz()}static get ZERO(){return oz()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Sy}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,o,s,a,c,l,u,h,d,m,g,y,b){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=l,this[9]=u,this[10]=h,this[11]=d,this[12]=m,this[13]=g,this[14]=y,this[15]=b,this.check()}setRowMajor(t,r,n,i,o,s,a,c,l,u,h,d,m,g,y,b){return this[0]=t,this[1]=o,this[2]=l,this[3]=m,this[4]=r,this[5]=s,this[6]=u,this[7]=g,this[8]=n,this[9]=a,this[10]=h,this[11]=y,this[12]=i,this[13]=c,this[14]=d,this[15]=b,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(iz)}fromObject(t){return this.check()}fromQuaternion(t){return t4(this,t),this.check()}fromMatrix3(t){return this.set(t[0],t[1],t[2],0,t[3],t[4],t[5],0,t[6],t[7],t[8],0,0,0,0,1)}frustum(t){let{left:r,right:n,bottom:i,top:o,near:s=xy,far:a=_y}=t;return a===1/0?az(this,r,n,i,o,s):r4(this,r,n,i,o,s,a),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return o4(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:s=xy,far:a=_y}=t;return i4(this,r,n,i,o,s,a),this.check()}orthographic(t){let{fovy:r=rz,aspect:n=nz,focalDistance:i=1,near:o=xy,far:s=_y}=t;m4(r);let a=r/2,c=i*Math.tan(a),l=c*n;return this.ortho({left:-l,right:l,bottom:-c,top:c,near:o,far:s})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=t;return m4(r),n4(this,r,n,i,o),this.check()}determinant(){return KE(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*s,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*o,t[6]=this[6]*s,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*o,t[10]=this[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*s,t[3]=this[4]*i,t[4]=this[5]*o,t[5]=this[6]*s,t[6]=this[8]*i,t[7]=this[9]*o,t[8]=this[10]*s,t}transpose(){return HE(this,this),this.check()}invert(){return $E(this,this),this.check()}multiplyLeft(t){return by(this,t,this),this.check()}multiplyRight(t){return by(this,this,t),this.check()}rotateX(t){return JE(this,this,t),this.check()}rotateY(t){return QE(this,this,t),this.check()}rotateZ(t){return e4(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return ZE(this,this,t,r),this.check()}scale(t){return YE(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return XE(this,this,t),this.check()}transform(t,r){return t.length===4?(r=d4(r||[-0,-0,-0,-0],t,this),Fl(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=TE(r||[-0,-0],t,this);break;case 3:i=lm(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Fl(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=AE(r||[-0,-0],t,this);break;case 3:n=am(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Fl(n,t.length),n}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}}});function g4(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function My(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function vy(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=r[0],c=r[1],l=r[2],u=r[3];return e[0]=n*u+s*a+i*l-o*c,e[1]=i*u+s*c+o*a-n*l,e[2]=o*u+s*l+n*c-i*a,e[3]=s*u-n*a-i*c-o*l,e}function y4(e,t,r){r*=.5;let n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+s*a,e[1]=i*c+o*a,e[2]=o*c-i*a,e[3]=s*c-n*a,e}function b4(e,t,r){r*=.5;let n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c-o*a,e[1]=i*c+s*a,e[2]=o*c+n*a,e[3]=s*c-i*a,e}function w4(e,t,r){r*=.5;let n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+i*a,e[1]=i*c-n*a,e[2]=o*c+s*a,e[3]=s*c-o*a,e}function x4(e,t){let r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e}function _4(e,t,r,n){let i=t[0],o=t[1],s=t[2],a=t[3],c=r[0],l=r[1],u=r[2],h=r[3],d,m,g,y,b;return d=i*c+o*l+s*u+a*h,d<0&&(d=-d,c=-c,l=-l,u=-u,h=-h),1-d>1e-6?(m=Math.acos(d),b=Math.sin(m),g=Math.sin((1-n)*m)/b,y=Math.sin(n*m)/b):(g=1-n,y=n),e[0]=g*i+y*c,e[1]=g*o+y*l,e[2]=g*s+y*u,e[3]=g*a+y*h,e}function S4(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-i*a,e[3]=o*a,e}function M4(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function v4(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);let o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[o*3+o]-t[s*3+s]+1),e[i]=.5*n,n=.5/n,e[3]=(t[o*3+s]-t[s*3+o])*n,e[o]=(t[o*3+i]+t[i*3+o])*n,e[s]=(t[s*3+i]+t[i*3+s])*n}return e}var E4,T4,A4,I4,P4,R4,cz,L4,Ey=p(()=>{Ul();mm();E4=s4,T4=a4,A4=f4,I4=h4,P4=c4,R4=l4,cz=u4,L4=(function(){let e=RE(),t=fy(1,0,0),r=fy(0,1,0);return function(n,i,o){let s=hy(i,o);return s<-.999999?(kl(e,t,i),FE(e)<1e-6&&kl(e,r,i),LE(e,e),My(n,e,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(kl(e,i,o),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+s,cz(n,n))}})()});var Ef,O4=p(()=>{nm();oc();Ey();Ef=class extends Ps{constructor(t=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return v4(this,t),this.check()}fromEuler(t){switch(this.identity(),t.order){case"xyz":return this.rotateX(t.x).rotateY(t.y).rotateZ(t.z);case"yxz":return this.rotateY(t.y).rotateX(t.x).rotateZ(t.z);case"zxy":return this.rotateZ(t.z).rotateX(t.x).rotateY(t.y);case"zyx":return this.rotateZ(t.z).rotateY(t.y).rotateX(t.x);case"yzx":return this.rotateY(t.y).rotateZ(t.z).rotateX(t.x);case"xzy":return this.rotateX(t.x).rotateZ(t.z).rotateY(t.y);default:throw new Error("Unknown Euler angle order")}}fromAxisRotation(t,r){return My(this,t,r),this.check()}identity(){return g4(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Kt(t)}get y(){return this[1]}set y(t){this[1]=Kt(t)}get z(){return this[2]}set z(t){this[2]=Kt(t)}get w(){return this[3]}set w(t){this[3]=Kt(t)}len(){return P4(this)}lengthSquared(){return R4(this)}dot(t){return A4(this,t)}rotationTo(t,r){return L4(this,t,r),this.check()}add(t){return E4(this,this,t),this.check()}calculateW(){return x4(this,this),this.check()}conjugate(){return M4(this,this),this.check()}invert(){return S4(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(I4(this,t,r,n),this.check())}multiplyRight(t){return vy(this,this,t),this.check()}multiplyLeft(t){return vy(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return y4(this,this,t),this.check()}rotateY(t){return b4(this,this,t),this.check()}rotateZ(t){return w4(this,this,t),this.check()}scale(t){return T4(this,this,t),this.check()}slerp(t,r,n){let i,o,s;return arguments.length===2?(i=this,o=t,s=r):(i=t,o=r,s=n),_4(this,i,o,s),this.check()}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}}});function Ay(){return{eastX:0,eastY:1,northZ:1,upX:1,upY:0,upZ:0}}function Iy(e,t,r){let n=e.x,i=e.y,o=e.z,s=t.x,a=t.y,c=t.z;return o!==0?!1:lz(r,n,i,s*i-a*n,s,a,c)}function Py(e,t,r,n,i,o){let s=Ty(r),a=Ty(n),c=Ty(i),l=Math.abs(s),u=Math.abs(a),h=Math.abs(c);if(!l||!u||!h||l===u||l===h||u===h||(l%3+1===u?1:-1)*Math.sign(s*a*c)!==1||!Array.isArray(o)&&o.length<16)return!1;let m=e.eastX,g=e.eastY,y=e.northZ,b=e.upX,w=e.upY,_=e.upZ,S=-_*g,v=_*m,T=t.x,O=t.y,P=t.z,M=(l===1?m:l===2?S:b)*Math.sign(s),U=(l===1?g:l===2?v:w)*Math.sign(s),C=(l===1?0:l===2?y:_)*Math.sign(s),L=(u===1?m:u===2?S:b)*Math.sign(a),A=(u===1?g:u===2?v:w)*Math.sign(a),W=(u===1?0:u===2?y:_)*Math.sign(a),G=(h===1?m:h===2?S:b)*Math.sign(c),E=(h===1?g:h===2?v:w)*Math.sign(c),B=(h===1?0:h===2?y:_)*Math.sign(c);return!Number.isFinite(M)||!Number.isFinite(U)||!Number.isFinite(C)||!Number.isFinite(L)||!Number.isFinite(A)||!Number.isFinite(W)||!Number.isFinite(G)||!Number.isFinite(E)||!Number.isFinite(B)||!Number.isFinite(T)||!Number.isFinite(O)||!Number.isFinite(P)||o instanceof Float32Array&&(!Number.isFinite(Math.fround(M))||!Number.isFinite(Math.fround(U))||!Number.isFinite(Math.fround(C))||!Number.isFinite(Math.fround(L))||!Number.isFinite(Math.fround(A))||!Number.isFinite(Math.fround(W))||!Number.isFinite(Math.fround(G))||!Number.isFinite(Math.fround(E))||!Number.isFinite(Math.fround(B))||!Number.isFinite(Math.fround(T))||!Number.isFinite(Math.fround(O))||!Number.isFinite(Math.fround(P)))?!1:(o[0]=M,o[1]=U,o[2]=C,o[3]=0,o[4]=L,o[5]=A,o[6]=W,o[7]=0,o[8]=G,o[9]=E,o[10]=B,o[11]=0,o[12]=T,o[13]=O,o[14]=P,o[15]=1,!0)}function Ty(e){switch(e){case"east":return 1;case"west":return-1;case"north":return 2;case"south":return-2;case"up":return 3;case"down":return-3;default:return 0}}function lz(e,t,r,n,i,o,s){return!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)?!1:(e.eastX=t,e.eastY=r,e.northZ=n,e.upX=i,e.upY=o,e.upZ=s,!0)}var B4=p(()=>{});function Tf(e,t,r=e){let n=e.x,i=e.y,o=e.z,{semiMajorAxis:s,semiMinorAxis:a,eccentricitySquared:c}=t,l=Math.sin(i),u=Math.abs(i)===Math.PI/2?0:Math.cos(i),h=a/s,d=c<.9?s/Math.sqrt(1-c*l*l):s/Math.hypot(u,h*l),m=(d+o)*u*Math.cos(n),g=(d+o)*u*Math.sin(n),y=(d*(c<.9?1-c:h*h)+o)*l;return jl(r,m,g,y)}function Af(e,t,r=e){let n=e.x,i=e.y,o=e.z,{semiMajorAxis:s,semiMinorAxis:a,eccentricitySquared:c}=t,l=Math.atan2(i,n),u=Math.hypot(n,i),h=Math.hypot(n,i,o);if(!(h>0)||!Number.isFinite(h))return!1;if(c===0)return jl(r,u===0?0:l,Math.atan2(o,u),h-s);if(u===0)return jl(r,0,Math.sign(o)*Math.PI/2,Math.abs(o)-a);let d=u/s,m=o/a;if(d*d+m*m<1-16*bm||c>=.9)return Ry(n,i,o,u,s,a,r);let g=o/h,y=u/h,b=1/Math.sqrt(1-c*(2-c)*y*y),w=y*(1-c)*b,_=g*b;for(let S=0;S<30;S++){let v=s/Math.sqrt(1-c*_*_),T=u*w+o*_-v*(1-c*_*_),O=c*v/(v+T);b=1/Math.sqrt(1-O*(2-O)*y*y);let P=y*(1-O)*b,M=g*b;if(Math.abs(M*w-P*_)<=1e-12){if(!Number.isFinite(T))break;return jl(r,l,Math.atan2(M,Math.abs(P)),T)}w=P,_=M}return Ry(n,i,o,u,s,a,r)}function Ry(e,t,r,n,i,o,s){let a=Math.atan2(t,e),c=o/i,l=c*c,u=n/i,h=r/i,d=1-l;if(!(l>0)||c>1)return!1;let m=i*i,g=o*o,y=Number.isFinite(m)&&m>0?(g-l*m+Rs(o,o,g)-l*Rs(i,i,m)-Rs(l,m,l*m))/m:0,b=n*n,w=e*e,_=t*t,S=w+_,v=Number.isFinite(b)&&b>0?(S-b+ym(w,_,S)+Rs(e,e,w)+Rs(t,t,_)-Rs(n,n,b))/(2*n):0,T=i*l,O=n-i,P=O+T,M=v+ym(n,-i,O)+ym(O,T,P)+Rs(i,l,T)+i*y;if(r===0)return P+M<0?!1:jl(s,a,0,O);let U=Math.abs(h)*c,C=0,L=l+Math.hypot(u,h*c);if(!Number.isFinite(L))return!1;let A=Math.max(U,u-d);A>C&&A<L||(A=L/2);let W=-(P+M)/i,G=Math.sqrt(W*(u+d))/d,E=W>0&&Math.abs(r)/G/i*c<=bm*W?Math.atan2(Math.sign(r)*G/c,u/d):void 0;for(let B=0;B<1024&&E===void 0;B++){let N=d+A,D=u/N,R=r/A/i,I=R*c,j=i*A,we=P-j,ne=(we+(ym(P,-j,we)+M-Rs(i,A,j)))/(i*N)*(D+1),Oe=ne+I*I;if(!Number.isFinite(Oe))return!1;Oe>0?C=A:L=A;let oe=-2*(D*D/N+I*I/A),Se=A-Oe/oe,Be=Se>C&&Se<L?Se:C+(L-C)/2;if(Math.abs(Oe)<=4*bm*(Math.abs(ne)+I*I)||L-C<=4*bm*A){E=Math.atan2(R,D);break}A=Be}return E!==void 0&&uz(s,a,E,n,r,i,c)}function ym(e,t,r){let n=r-e;return e-(r-n)+(t-n)}function Rs(e,t,r){let n=134217729*e,i=134217729*t;if(!Number.isFinite(n)||!Number.isFinite(i))return 0;let o=n-(n-e),s=i-(i-t),a=e-o,c=t-s;return o*s-r+o*c+a*s+a*c}function uz(e,t,r,n,i,o,s){let a=Math.sin(r),c=Math.cos(r);return jl(e,t,r,n*c+i*a-o*Math.hypot(c,s*a))}function jl(e,t,r,n){return!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)?!1:(e.x=t,e.y=r,e.z=n,!0)}var bm,C4=p(()=>{bm=Number.EPSILON});function wm(){return zl??Uint16Array}var zl,D4=p(()=>{zl=globalThis.Float16Array});var N4=p(()=>{D4()});var F4=p(()=>{N4()});var G4=p(()=>{gy()});var k4=p(()=>{wy()});var U4=p(()=>{Ey()});var j4=p(()=>{sm()});var z4=p(()=>{Ul()});var q4=p(()=>{mm()});var Fn=p(()=>{GE();WE();p4();O4();wE();uy();Nl();B4();C4();F4();G4();k4();U4();j4();z4();q4()});var jo,Bte,V4=p(()=>{jo=6356752314245179e-9,Bte={radii:[6378137,6378137,jo],radiiSquared:[6378137*6378137,6378137*6378137,jo*jo],oneOverRadii:[1/6378137,1/6378137,1/jo],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(jo*jo)],maximumRadius:Math.max(6378137,6378137,jo),centerToleranceSquared:.1}});function Ly(e){return e}function zo(e,t=[],r=Ly){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function W4(e,t=[]){return zo(e,t,xt._cartographicRadians?Ly:ay)}function Oy(e,t,r,n){let i=xt._cartographicRadians?Ly:cy,o=i(e),s=i(t);return"longitude"in n?(n.longitude=o,n.latitude=s,n.height=r):"x"in n?(n.x=o,n.y=s,n.z=r):(n[0]=o,n[1]=s,n[2]=r),n}var Nte,H4=p(()=>{Fn();Nte=new J});function co(e,t,r,n,i,o,s){let c=[n,i,o,Math.abs(e),Math.abs(t),Math.abs(r)].map(P=>{let M=P.toString(2),U=M.indexOf(".");return{integer:BigInt("0b"+M.replace(".","")),exponent:U<0?0:U+1-M.length}}),l=Math.min(...c.filter(P=>P.integer!==0n).map(P=>P.exponent)),u=c.map(P=>P.integer<<BigInt(P.exponent-l)),h=u.slice(0,3).map(P=>P*P),d=h.reduce((P,M)=>P<M?P:M),m=h.map(P=>P-d),g=h.map((P,M)=>u[M]*u[M+3]),y=64;if(!g.some((P,M)=>m[M]===0n&&P!==0n)){let P=-1n,M=1n;for(let L=0;L<3;L++){if(m[L]===0n)continue;let A=m[L]*m[L];P=P*A+g[L]*g[L]*M,M*=A}if(P<0n)return!1;if(P===0n)return O(0n,1n);let C=m.filter(L=>L>0n).reduce((L,A)=>L<A?L:A);y=Math.max(64,(2n*(M+P)).toString(2).length-(P*C).toString(2).length+128)}let b=1n<<BigInt(y),w=m.map(P=>P*b),_=g.map(P=>P*b),S=_.map(P=>P*P),v=0n,T=_.reduce((P,M)=>P+M,0n);if(T===0n)return!1;for(let P=0;P<4096;P++){let M=v+T>>1n;if(M===v)return!1;let U=w[0]+M,C=w[1]+M,L=w[2]+M,A=U*U,W=C*C,G=L*L,E=S[0]*W*G+S[1]*A*G+S[2]*A*W-A*W*G;if(E===0n)return O(M,b);if(E>0n?v=M:T=M,v>0n&&T-v<=v>>60n)return O(v+T>>1n,b)}return!1;function O(P,M){let U=h.map((W,G)=>{let E=m[G]*M+P;return E===0n?0:wz(W*u[G+3]*M,E,l)});if(!U.every(Number.isFinite))return!1;let C=Math.sign(e)*U[0],L=Math.sign(t)*U[1],A=Math.sign(r)*U[2];return s.x=C,s.y=L,s.z=A,!0}}function wz(e,t,r){if(e===0n)return 0;let n=52-(e.toString(2).length-t.toString(2).length),i=n>=0?e<<BigInt(n):e,o=n>=0?t:t<<BigInt(-n),s=i/o,a=i%o;(2n*a>o||2n*a===o&&s&1n)&&s++;let c=r-n,l=Math.max(-1022,Math.min(1023,c));return Number(s)*2**l*2**(c-l)}var $4=p(()=>{});function K4(e,t,r,n,i,o,s){let a=Math.min(n,i,o),c=a*a,l=n*n,u=i*i,h=o*o;if(!(a>0)||!(c>0)||!Number.isFinite(Math.max(l,u,h)))return!1;let d=ac(a,a,c),m=l-c,g=u-c,y=h-c,b=qo(l,-c,m)+ac(n,n,l)-d,w=qo(u,-c,g)+ac(i,i,u)-d,_=qo(h,-c,y)+ac(o,o,h)-d,S=n*Math.abs(e),v=i*Math.abs(t),T=o*Math.abs(r);if(c<2**-1022||e!==0&&S<2**-1022||t!==0&&v<2**-1022||r!==0&&T<2**-1022)return co(e,t,r,n,i,o,s);let O=ac(n,Math.abs(e),S),P=ac(i,Math.abs(t),v),M=ac(o,Math.abs(r),T);if(Math.hypot(m===0?S===0?0:1/0:S/(m+b),g===0?v===0?0:1/0:v/(g+w),y===0?T===0?0:1/0:T/(y+_))<=1+64*Number.EPSILON)return co(e,t,r,n,i,o,s);if((e!==0?1:0)+(t!==0?1:0)+(r!==0?1:0)==1)return s.x=e===0?e:Math.sign(e)*n,s.y=t===0?t:Math.sign(t)*i,s.z=r===0?r:Math.sign(r)*o,!0;let C=Math.hypot(m===0?S:0,g===0?v:0,y===0?T:0),L=Math.hypot(S,v,T);if(!(L>0)||!Number.isFinite(L))return co(e,t,r,n,i,o,s);let A=C>0?C:L;for(let W=0;W<512;W++){let G=m+A,E=g+A,B=y+A,N=qo(m,A,G)+b,D=qo(g,A,E)+w,R=qo(y,A,B)+_,I=S/G,j=v/E,we=T/B,_e,ne;I>=j&&I>=we?(_e=By(S,O,m,b,A,G)*(I+1),ne=(j*(1-D/E))**2+(we*(1-R/B))**2):j>=we?(_e=By(v,P,g,w,A,E)*(j+1),ne=(I*(1-N/G))**2+(we*(1-R/B))**2):(_e=By(T,M,y,_,A,B)*(we+1),ne=(I*(1-N/G))**2+(j*(1-D/E))**2);let Oe=-2*(I*I/G+j*j/E+we*we/B),oe=4*Number.EPSILON*(Math.abs(_e)+ne),Se=_e+ne;if(!Number.isFinite(Se))return co(e,t,r,n,i,o,s);if(Math.abs(Se)<=4*Number.EPSILON*(Math.abs(_e)+ne)||L-C<=4*Number.EPSILON*A){let je=oe/Math.abs(Oe);if(!Number.isFinite(Oe)||!(Math.abs(Oe)>0)||je>2e-13*A)return co(e,t,r,n,i,o,s);let Ke=Math.sign(e)*n*(I*(1-N/G)),ft=Math.sign(t)*i*(j*(1-D/E)),ht=Math.sign(r)*o*(we*(1-R/B)),pt=2*je*Math.max(Math.abs(Ke/G),Math.abs(ft/E),Math.abs(ht/B));return!Number.isFinite(pt)||pt>2e-13*Math.max(n,i,o)?co(e,t,r,n,i,o,s):!Number.isFinite(Ke)||!Number.isFinite(ft)||!Number.isFinite(ht)?co(e,t,r,n,i,o,s):(s.x=Ke,s.y=ft,s.z=ht,!0)}Se>0?C=A:L=A;let Be=A-Se/Oe,V=Be>C&&Be<L?Be:C+(L-C)/2;if(V===A)return co(e,t,r,n,i,o,s);A=V}return co(e,t,r,n,i,o,s)}function By(e,t,r,n,i,o){let s=e-r,a=qo(e,-r,s)+t-n,c=s+a,l=qo(s,a,c),u=c-i;return(u+(qo(c,-i,u)+l))/o}function qo(e,t,r){let n=r-e;return e-(r-n)+(t-n)}function ac(e,t,r){let n=134217729*e,i=134217729*t;if(!Number.isFinite(n)||!Number.isFinite(i))return 0;let o=n-(n-e),s=i-(i-t),a=e-o,c=t-s;return o*s-r+o*c+a*s+a*c}var X4=p(()=>{$4()});function Y4(e,t,r=[]){let n=e,i="x"in e?n.x:e[0],o="x"in e?n.y:e[1],s="x"in e?n.z:e[2];if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(i*i+o*o+s*s))return;let{radii:a}=t;if(K4(i,o,s,a.x,a.y,a.z,xm))return lo(r,xm.x,xm.y,xm.z)}function lo(e,t,r,n){if(ao(e))e[0]=t,e[1]=r,e[2]=n;else{let i=e;i.x=t,i.y=r,i.z=n}return e}var xm,Z4=p(()=>{Fn();X4();xm={x:0,y:0,z:0}});function J4(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0||t>e)throw new Error("Spheroid requires finite positive axes with semiMinorAxis <= semiMajorAxis")}function Mm(e,t,r,n){let i=Math.max(Math.abs(e),Math.abs(t),Math.abs(r));if(!(i>0)||!Number.isFinite(i))return;let o=e/i,s=t/i,a=r/i,c=Math.hypot(o,s,a);return lo(n,o/c,s/c,a/c)}var bn,_m,Sz,di,Sm,Tt,Q4=p(()=>{Fn();Fn();V4();H4();Z4();bn={x:0,y:0,z:0},_m=new J,Sz=new J,di=new J,Sm=new J,Tt=class e{static fromSpheroid(t){let{semiMajorAxis:r,semiMinorAxis:n}=t;return J4(r,n),new e(r,r,n)}constructor(t=0,r=0,n=0){this.centerToleranceSquared=tm.EPSILON1,Ri(Number.isFinite(t)&&t>=0),Ri(Number.isFinite(r)&&r>=0),Ri(Number.isFinite(n)&&n>=0),this.radii=new J(t,r,n),this.radiiSquared=new J(t*t,r*r,n*n),this.radiiToTheFourth=new J(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new J(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new J(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),n!==0&&(this.squaredXOverSquaredZ=(t/n)**2),t===r&&n>0&&n<=t&&Number.isFinite(this.radiiSquared.x)&&this.radiiSquared.z>0&&(this.spheroidGeometry=Object.freeze({semiMajorAxis:t,semiMinorAxis:n,eccentricitySquared:1-(n/t)**2})),Object.freeze(this.radii),Object.freeze(this.radiiSquared),Object.freeze(this.radiiToTheFourth),Object.freeze(this.oneOverRadii),Object.freeze(this.oneOverRadiiSquared),Object.freeze(this)}toSpheroid(){let{x:t,y:r,z:n}=this.radii;if(t!==r)throw new Error("Spheroid requires equal X/Y radii");return J4(t,n),Object.freeze({semiMajorAxis:t,semiMinorAxis:n})}equals(t){return this===t||!!(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=W4(t,Sm),i=n[0],o=n[1],s=n[2];if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)||!(this.minimumRadius>0)||!Number.isFinite(this.maximumRadius*this.maximumRadius))return;if(this.spheroidGeometry&&(xt._cartographicRadians||Math.abs(o)<=Math.PI/4))return bn.x=i,bn.y=o,bn.z=s,Tf(bn,this.spheroidGeometry)?lo(r,bn.x,bn.y,bn.z):void 0;let a=Sz;this.geodeticSurfaceNormalCartographic(t,a);let c=a.x,l=a.y,u=a.z,h=this.radii.x,d=this.radii.y,m=this.radii.z,g=Math.hypot(h*c,d*l,m*u),y=h*(h*c/g)+s*c,b=d*(d*l/g)+s*l,w=m*(m*u/g)+s*u;if(!(!Number.isFinite(y)||!Number.isFinite(b)||!Number.isFinite(w)))return lo(r,y,b,w)}cartesianToCartographic(t,r=[0,0,0]){let n=t,i="x"in t?n.x:t[0],o="x"in t?n.y:t[1],s="x"in t?n.z:t[2];if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s))return;if(this.spheroidGeometry&&Number.isFinite(i*i+o*o+s*s)&&Number.isFinite(this.oneOverRadiiSquared.x)&&Number.isFinite(this.oneOverRadiiSquared.z)){bn.x=i,bn.y=o,bn.z=s;let _=this.spheroidGeometry;if(!(s===0&&_.semiMinorAxis<_.semiMajorAxis&&Math.abs(Math.hypot(i,o)-_.semiMajorAxis*_.eccentricitySquared)<=64*Number.EPSILON*_.semiMajorAxis)&&Af(bn,_)){let v=i===0&&o===0?Math.atan2(o,i):bn.x;return Oy(v,bn.y,bn.z,r)}}if(!(this.minimumRadius>0)||!Number.isFinite(this.maximumRadius*this.maximumRadius)||!Number.isFinite(1/(this.minimumRadius*this.minimumRadius)))return;Sm.set(i,o,s);let a=this.scaleToGeodeticSurface(Sm,di);if(!a)return;let c=a[0]*this.oneOverRadiiSquared.x,l=a[1]*this.oneOverRadiiSquared.y,u=a[2]*this.oneOverRadiiSquared.z,h=Math.hypot(c,l,u);if(!(h>0)||!Number.isFinite(h))return;let d=c/h,m=l/h,g=u/h,y=Math.atan2(m,d),b=Math.atan2(g,Math.hypot(d,m)),w=(i-a[0])*d+(o-a[1])*m+(s-a[2])*g;return Oy(y,b,w,r)}geocentricSurfaceNormal(t,r=[0,0,0]){zo(t,_m);let n=_m;return Mm(n.x,n.y,n.z,r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=zo(t,Sm),i=xt._cartographicRadians?n[0]:n[0]*Math.PI/180,o=xt._cartographicRadians?n[1]:n[1]*Math.PI/180,s=!xt._cartographicRadians&&Math.abs(n[1])>45,a=(90-Math.abs(n[1]))*Math.PI/180,c=s?Math.sin(a):Math.abs(o)===Math.PI/2?0:Math.cos(o),l=s?Math.sign(n[1])*Math.cos(a):Math.sin(o);return Mm(c*Math.cos(i),c*Math.sin(i),l,r)}geodeticSurfaceNormal(t,r=[0,0,0]){if(!(this.minimumRadius>0))return;zo(t,_m);let n=_m,i=Math.max(Math.abs(n.x),Math.abs(n.y),Math.abs(n.z));if(!(i>0)||!Number.isFinite(i))return;let o=n.x/i*(this.minimumRadius/this.radii.x)**2,s=n.y/i*(this.minimumRadius/this.radii.y)**2,a=n.z/i*(this.minimumRadius/this.radii.z)**2;if((n.x===0||Math.abs(o)>=2**-1022)&&(n.y===0||Math.abs(s)>=2**-1022)&&(n.z===0||Math.abs(a)>=2**-1022))return Mm(o,s,a,r);let c=n.x===0?0:Math.min(1023,Math.floor(Math.log2(Math.abs(n.x)))),l=n.y===0?0:Math.min(1023,Math.floor(Math.log2(Math.abs(n.y)))),u=n.z===0?0:Math.min(1023,Math.floor(Math.log2(Math.abs(n.z)))),h=Math.min(1023,Math.floor(Math.log2(this.radii.x))),d=Math.min(1023,Math.floor(Math.log2(this.radii.y))),m=Math.min(1023,Math.floor(Math.log2(this.radii.z))),g=Math.max(n.x===0?-1/0:c-2*h,n.y===0?-1/0:l-2*d,n.z===0?-1/0:u-2*m);return Mm(n.x===0?n.x:n.x/2**c/(this.radii.x/2**h)**2*2**(c-2*h-g),n.y===0?n.y:n.y/2**l/(this.radii.y/2**d)**2*2**(l-2*d-g),n.z===0?n.z:n.z/2**u/(this.radii.z/2**m)**2*2**(u-2*m-g),r)}scaleToGeodeticSurface(t,r){return Y4(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){zo(t,di);let n=di,i=Math.max(Math.abs(n.x),Math.abs(n.y),Math.abs(n.z));if(!(this.minimumRadius>0)||!(i>0)||!Number.isFinite(i))return;let o=n.x*n.x*this.oneOverRadiiSquared.x+n.y*n.y*this.oneOverRadiiSquared.y+n.z*n.z*this.oneOverRadiiSquared.z;if(o>=2**-1022&&Number.isFinite(o)&&i*i>=2**-1022&&Number.isFinite(i*i)){let u=1/Math.sqrt(o);return lo(r,n.x*u,n.y*u,n.z*u)}let s=n.x/i,a=n.y/i,c=n.z/i,l=Math.hypot(s/this.radii.x,a/this.radii.y,c/this.radii.z);if(!(!(l>0)||!Number.isFinite(l)))return lo(r,s/l,a/l,c/l)}transformPositionToScaledSpace(t,r=[0,0,0]){zo(t,di);let n=di.scale(this.oneOverRadii);return lo(r,n.x,n.y,n.z)}transformPositionFromScaledSpace(t,r=[0,0,0]){zo(t,di);let n=di.scale(this.radii);return lo(r,n.x,n.y,n.z)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){if(Ri(this.radii.x===this.radii.y&&this.minimumRadius>0),zo(t,di),!Number.isFinite(di.x)||!Number.isFinite(di.y)||!Number.isFinite(di.z)||!Number.isFinite(r))return;let i=di.z*(1-this.squaredXOverSquaredZ);if(Number.isFinite(i)&&!(Math.abs(i)>=this.radii.z-r))return lo(n,0,0,i)}};Tt.WGS84=new Tt(6378137,6378137,jo)});var er,eT=p(()=>{er={};er.Constants={};er.Math={};er.Accumulator={};(function(e){"use strict";e.WGS84={a:6378137,f:1/298.257223563},e.version={major:2,minor:2,patch:0},e.version_string="2.2.0"})(er.Constants);(function(e){"use strict";e.digits=53,e.epsilon=Math.pow(.5,e.digits-1),e.degree=Math.PI/180,e.sq=function(t){return t*t},e.hypot=function(t,r){return Math.sqrt(t*t+r*r)},e.cbrt=Math.cbrt||function(t){var r=Math.pow(Math.abs(t),.3333333333333333);return t>0?r:t<0?-r:t},e.log1p=Math.log1p||function(t){var r=1+t,n=r-1;return n===0?t:t*Math.log(r)/n},e.atanh=Math.atanh||function(t){var r=Math.abs(t);return r=e.log1p(2*r/(1-r))/2,t>0?r:t<0?-r:t},e.copysign=function(t,r){return Math.abs(t)*(r<0||r===0&&1/r<0?-1:1)},e.sum=function(t,r){var n=t+r,i=n-r,o=n-i,s;return i-=t,o-=r,s=n&&0-(i+o),{s:n,t:s}},e.polyval=function(t,r,n,i){for(var o=t<0?0:r[n++];--t>=0;)o=o*i+r[n++];return o},e.AngRound=function(t){var r=.0625,n=Math.abs(t);return n=n<r?r-(r-n):n,e.copysign(n,t)},e.remainder=function(t,r){return t%=r,t<-r/2?t+r:t<r/2?t:t-r},e.AngNormalize=function(t){var r=e.remainder(t,360);return Math.abs(r)===180?e.copysign(180,t):r},e.LatFix=function(t){return Math.abs(t)>90?NaN:t},e.AngDiff=function(t,r){var n=e.sum(e.remainder(-t,360),e.remainder(r,360)),i,o;return n=e.sum(e.remainder(n.s,360),n.t),i=n.s,o=n.t,(i===0||Math.abs(i)===180)&&(i=e.copysign(i,o===0?r-t:-o)),{d:i,e:o}},e.sincosd=function(t){var r,n,i,o,s,a,c;switch(r=t%360,i=Math.round(r/90),r-=90*i,n=r*this.degree,o=Math.sin(n),s=Math.cos(n),Math.abs(r)===45?(s=Math.sqrt(.5),o=e.copysign(s,n)):Math.abs(r)===30&&(s=Math.sqrt(.75),o=e.copysign(.5,n)),i&3){case 0:a=o,c=s;break;case 1:a=s,c=-o;break;case 2:a=-o,c=-s;break;default:a=-s,c=o;break}return c+=0,a===0&&(a=e.copysign(a,t)),{s:a,c}},e.sincosde=function(t,r){var n,i,o,s,a,c,l;switch(n=t%360,o=Math.round(n/90),n=e.AngRound(n-90*o+r),i=n*this.degree,s=Math.sin(i),a=Math.cos(i),Math.abs(n)===45?(a=Math.sqrt(.5),s=e.copysign(a,i)):Math.abs(n)===30&&(a=Math.sqrt(.75),s=e.copysign(.5,i)),o&3){case 0:c=s,l=a;break;case 1:c=a,l=-s;break;case 2:c=-s,l=-a;break;default:c=-a,l=s;break}return l+=0,c===0&&(c=e.copysign(c,t+r)),{s:c,c:l}},e.atan2d=function(t,r){var n=0,i;switch(Math.abs(t)>Math.abs(r)&&([t,r]=[r,t],n=2),e.copysign(1,r)<0&&(r=-r,++n),i=Math.atan2(t,r)/this.degree,n){case 1:i=e.copysign(180,t)-i;break;case 2:i=90-i;break;case 3:i=-90+i;break;default:break}return i}})(er.Math);(function(e,t){"use strict";e.Accumulator=function(r){this.Set(r)},e.Accumulator.prototype.Set=function(r){r||(r=0),r.constructor===e.Accumulator?(this._s=r._s,this._t=r._t):(this._s=r,this._t=0)},e.Accumulator.prototype.Add=function(r){var n=t.sum(r,this._t),i=t.sum(n.s,this._s);n=n.t,this._s=i.s,this._t=i.t,this._s===0?this._s=n:this._t+=n},e.Accumulator.prototype.Sum=function(r){var n;return r?(n=new e.Accumulator(this),n.Add(r),n._s):this._s},e.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1},e.Accumulator.prototype.Remainder=function(r){this._s=t.remainder(this._s,r),this.Add(0)}})(er.Accumulator,er.Math);er.Geodesic={};er.GeodesicLine={};er.PolygonArea={};(function(e,t,r,n,i){"use strict";var o=6,s=o,a=o,c=o,l=c,u,h,d=20,m=d+n.digits+10,g=n.epsilon,y=200*g,b=Math.sqrt(g),w=g,_=1e3*b,S=0,v=31,T=32640,O,P,M,U,C,L,A,W,G;e.tiny_=Math.sqrt(Number.MIN_VALUE/Number.EPSILON),e.nC1_=o,e.nC1p_=o,e.nC2_=o,e.nC3_=o,e.nC4_=o,u=e.nC3_*(e.nC3_-1)/2,h=e.nC4_*(e.nC4_+1)/2,e.CAP_C1=1,e.CAP_C1p=2,e.CAP_C2=4,e.CAP_C3=8,e.CAP_C4=16,e.NONE=0,e.ARC=64,e.LATITUDE=128|S,e.LONGITUDE=256|e.CAP_C3,e.AZIMUTH=512|S,e.DISTANCE=1024|e.CAP_C1,e.STANDARD=e.LATITUDE|e.LONGITUDE|e.AZIMUTH|e.DISTANCE,e.DISTANCE_IN=2048|e.CAP_C1|e.CAP_C1p,e.REDUCEDLENGTH=4096|e.CAP_C1|e.CAP_C2,e.GEODESICSCALE=8192|e.CAP_C1|e.CAP_C2,e.AREA=16384|e.CAP_C4,e.ALL=T|v,e.LONG_UNROLL=32768,e.OUT_MASK=T|e.LONG_UNROLL,e.SinCosSeries=function(E,B,N,D,R){if(R!==void 0){var I=R/2,j=Math.sin(I),we=Math.cos(I);return-2*e.SinCosSeries(!1,N*we-B*j,B*we+N*j,D.map(function(Be,V){return(V%2?-Be:Be)*Math.sin((2*V+1)*I)}))}var _e=D.length,ne=_e-(E?1:0),Oe=2*(N-B)*(N+B),oe=ne&1?D[--_e]:0,Se=0;for(ne=Math.floor(ne/2);ne--;)Se=Oe*oe-Se+D[--_e],oe=Oe*Se-oe+D[--_e];return E?2*B*N*oe:N*(oe-Se)},O=function(E,B){var N,D=n.sq(E),R=n.sq(B),I=(D+R-1)/6,j,we,_e,ne,Oe,oe,Se,Be,V,je,Ke;return R===0&&I<=0?N=0:(j=D*R/4,we=n.sq(I),_e=I*we,ne=j*(j+2*_e),Oe=I,ne>=0?(oe=j+_e,oe+=oe<0?-Math.sqrt(ne):Math.sqrt(ne),Se=n.cbrt(oe),Oe+=Se+(Se!==0?we/Se:0)):(Be=Math.atan2(Math.sqrt(-ne),-(j+_e)),Oe+=2*I*Math.cos(Be/3)),V=Math.sqrt(n.sq(Oe)+R),je=Oe<0?R/(V-Oe):Oe+V,Ke=(je-R)/(2*V),N=je/(Math.sqrt(je+n.sq(Ke))+Ke)),N},P=[1,4,64,0,256],e.A1m1f=function(E){var B=Math.floor(s/2),N=n.polyval(B,P,0,n.sq(E))/P[B+1];return(N+E)/(1-E)},M=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],e.C1f=function(E,B){var N=n.sq(E),D=E,R=0,I,j;for(I=1;I<=e.nC1_;++I)j=Math.floor((e.nC1_-I)/2),B[I]=D*n.polyval(j,M,R,N)/M[R+j+1],R+=j+2,D*=E},U=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],e.C1pf=function(E,B){var N=n.sq(E),D=E,R=0,I,j;for(I=1;I<=e.nC1p_;++I)j=Math.floor((e.nC1p_-I)/2),B[I]=D*n.polyval(j,U,R,N)/U[R+j+1],R+=j+2,D*=E},C=[-11,-28,-192,0,256],e.A2m1f=function(E){var B=Math.floor(a/2),N=n.polyval(B,C,0,n.sq(E))/C[B+1];return(N-E)/(1+E)},L=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],e.C2f=function(E,B){var N=n.sq(E),D=E,R=0,I,j;for(I=1;I<=e.nC2_;++I)j=Math.floor((e.nC2_-I)/2),B[I]=D*n.polyval(j,L,R,N)/L[R+j+1],R+=j+2,D*=E},e.Geodesic=function(E,B){if(this.a=E,this.f=B,this._f1=1-this.f,this._e2=this.f*(2-this.f),this._ep2=this._e2/n.sq(this._f1),this._n=this.f/(2-this.f),this._b=this.a*this._f1,this._c2=(n.sq(this.a)+n.sq(this._b)*(this._e2===0?1:(this._e2>0?n.atanh(Math.sqrt(this._e2)):Math.atan(Math.sqrt(-this._e2)))/Math.sqrt(Math.abs(this._e2))))/2,this._etol2=.1*b/Math.sqrt(Math.max(.001,Math.abs(this.f))*Math.min(1,1-this.f/2)/2),!(isFinite(this.a)&&this.a>0))throw new Error("Equatorial radius is not positive");if(!(isFinite(this._b)&&this._b>0))throw new Error("Polar semi-axis is not positive");this._A3x=new Array(l),this._C3x=new Array(u),this._C4x=new Array(h),this.A3coeff(),this.C3coeff(),this.C4coeff()},A=[-3,128,-2,-3,64,-1,-3,-1,16,3,-1,-2,8,1,-1,2,1,1],e.Geodesic.prototype.A3coeff=function(){var E=0,B=0,N,D;for(N=c-1;N>=0;--N)D=Math.min(c-N-1,N),this._A3x[B++]=n.polyval(D,A,E,this._n)/A[E+D+1],E+=D+2},W=[3,128,2,5,128,-1,3,3,64,-1,0,1,8,-1,1,4,5,256,1,3,128,-3,-2,3,64,1,-3,2,32,7,512,-10,9,384,5,-9,5,192,7,512,-14,7,512,21,2560],e.Geodesic.prototype.C3coeff=function(){var E=0,B=0,N,D,R;for(N=1;N<e.nC3_;++N)for(D=e.nC3_-1;D>=N;--D)R=Math.min(e.nC3_-D-1,D),this._C3x[B++]=n.polyval(R,W,E,this._n)/W[E+R+1],E+=R+2},G=[97,15015,1088,156,45045,-224,-4784,1573,45045,-10656,14144,-4576,-858,45045,64,624,-4576,6864,-3003,15015,100,208,572,3432,-12012,30030,45045,1,9009,-2944,468,135135,5792,1040,-1287,135135,5952,-11648,9152,-2574,135135,-64,-624,4576,-6864,3003,135135,8,10725,1856,-936,225225,-8448,4992,-1144,225225,-1440,4160,-4576,1716,225225,-136,63063,1024,-208,105105,3584,-3328,1144,315315,-128,135135,-2560,832,405405,128,99099],e.Geodesic.prototype.C4coeff=function(){var E=0,B=0,N,D,R;for(N=0;N<e.nC4_;++N)for(D=e.nC4_-1;D>=N;--D)R=e.nC4_-D-1,this._C4x[B++]=n.polyval(R,G,E,this._n)/G[E+R+1],E+=R+2},e.Geodesic.prototype.A3f=function(E){return n.polyval(l-1,this._A3x,0,E)},e.Geodesic.prototype.C3f=function(E,B){var N=1,D=0,R,I;for(R=1;R<e.nC3_;++R)I=e.nC3_-R-1,N*=E,B[R]=N*n.polyval(I,this._C3x,D,E),D+=I+1},e.Geodesic.prototype.C4f=function(E,B){var N=1,D=0,R,I;for(R=0;R<e.nC4_;++R)I=e.nC4_-R-1,B[R]=N*n.polyval(I,this._C4x,D,E),D+=I+1,N*=E},e.Geodesic.prototype.Lengths=function(E,B,N,D,R,I,j,we,_e,ne,Oe,oe,Se){Oe&=e.OUT_MASK;var Be={},V=0,je=0,Ke=0,ft=0,ht,pt,Lt,Zt,gr;if(Oe&(e.DISTANCE|e.REDUCEDLENGTH|e.GEODESICSCALE)&&(Ke=e.A1m1f(E),e.C1f(E,oe),Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(ft=e.A2m1f(E),e.C2f(E,Se),V=Ke-ft,ft=1+ft),Ke=1+Ke),Oe&e.DISTANCE)ht=e.SinCosSeries(!0,I,j,oe)-e.SinCosSeries(!0,N,D,oe),Be.s12b=Ke*(B+ht),Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(pt=e.SinCosSeries(!0,I,j,Se)-e.SinCosSeries(!0,N,D,Se),je=V*B+(Ke*ht-ft*pt));else if(Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)){for(Lt=1;Lt<=e.nC2_;++Lt)Se[Lt]=Ke*oe[Lt]-ft*Se[Lt];je=V*B+(e.SinCosSeries(!0,I,j,Se)-e.SinCosSeries(!0,N,D,Se))}return Oe&e.REDUCEDLENGTH?(Be.m0=V,Be.m12b=we*(D*I)-R*(N*j)-D*j*je):Be.m12b=NaN,Oe&e.GEODESICSCALE&&(Zt=D*j+N*I,gr=this._ep2*(_e-ne)*(_e+ne)/(R+we),Be.M12=Zt+(gr*I-j*je)*N/R,Be.M21=Zt-(gr*N-D*je)*I/we),Be},e.Geodesic.prototype.InverseStart=function(E,B,N,D,R,I,j,we,_e,ne,Oe){var oe={},Se=D*B-R*E,Be=R*B+D*E,V,je,Ke,ft,ht,pt,Lt,Zt,gr,Ve,qe,We,zt,yr,Ss,Ms,Qu,Zi,rt,Yr,Sr,dn,Cn;return oe.sig12=-1,V=D*B,V+=R*E,je=Be>=0&&Se<.5&&R*j<.5,je?(ft=n.sq(E+D),ft/=ft+n.sq(B+R),oe.dnm=Math.sqrt(1+this._ep2*ft),Ke=j/(this._f1*oe.dnm),ht=Math.sin(Ke),pt=Math.cos(Ke)):(ht=we,pt=_e),oe.salp1=R*ht,oe.calp1=pt>=0?Se+R*E*n.sq(ht)/(1+pt):V-R*E*n.sq(ht)/(1-pt),Zt=n.hypot(oe.salp1,oe.calp1),gr=E*D+B*R*pt,je&&Zt<this._etol2?(oe.salp2=B*ht,oe.calp2=Se-B*D*(pt>=0?n.sq(ht)/(1+pt):1-pt),Lt=n.hypot(oe.salp2,oe.calp2),oe.salp2/=Lt,oe.calp2/=Lt,oe.sig12=Math.atan2(Zt,gr)):Math.abs(this._n)>.1||gr>=0||Zt>=6*Math.abs(this._n)*Math.PI*n.sq(B)||(Cn=Math.atan2(-we,-_e),this.f>=0?(yr=n.sq(E)*this._ep2,Ss=yr/(2*(1+Math.sqrt(1+yr))+yr),We=this.f*B*this.A3f(Ss)*Math.PI,zt=We*B,Ve=Cn/We,qe=V/zt):(Ms=R*B-D*E,Qu=Math.atan2(V,Ms),Yr=this.Lengths(this._n,Math.PI+Qu,E,-B,N,D,R,I,B,R,e.REDUCEDLENGTH,ne,Oe),Zi=Yr.m12b,rt=Yr.m0,Ve=-1+Zi/(B*R*rt*Math.PI),zt=Ve<-.01?V/Ve:-this.f*n.sq(B)*Math.PI,We=zt/B,qe=j/We),qe>-y&&Ve>-1-_?this.f>=0?(oe.salp1=Math.min(1,-Ve),oe.calp1=-Math.sqrt(1-n.sq(oe.salp1))):(oe.calp1=Math.max(Ve>-y?0:-1,Ve),oe.salp1=Math.sqrt(1-n.sq(oe.calp1))):(Sr=O(Ve,qe),dn=We*(this.f>=0?-Ve*Sr/(1+Sr):-qe*(1+Sr)/Sr),ht=Math.sin(dn),pt=-Math.cos(dn),oe.salp1=R*ht,oe.calp1=V-R*E*n.sq(ht)/(1-pt))),oe.salp1<=0?(oe.salp1=1,oe.calp1=0):(Lt=n.hypot(oe.salp1,oe.calp1),oe.salp1/=Lt,oe.calp1/=Lt),oe},e.Geodesic.prototype.Lambda12=function(E,B,N,D,R,I,j,we,_e,ne,Oe,oe,Se,Be){var V={},je,Ke,ft,ht,pt,Lt,Zt,gr,Ve,qe,We,zt,yr;return E===0&&we===0&&(we=-e.tiny_),Ke=j*B,ft=n.hypot(we,j*E),V.ssig1=E,ht=Ke*E,V.csig1=pt=we*B,je=n.hypot(V.ssig1,V.csig1),V.ssig1/=je,V.csig1/=je,V.salp2=R!==B?Ke/R:j,V.calp2=R!==B||Math.abs(D)!==-E?Math.sqrt(n.sq(we*B)+(B<-E?(R-B)*(B+R):(E-D)*(E+D)))/R:Math.abs(we),V.ssig2=D,Lt=Ke*D,V.csig2=Zt=V.calp2*R,je=n.hypot(V.ssig2,V.csig2),V.ssig2/=je,V.csig2/=je,V.sig12=Math.atan2(Math.max(0,V.csig1*V.ssig2-V.ssig1*V.csig2),V.csig1*V.csig2+V.ssig1*V.ssig2),gr=Math.max(0,pt*Lt-ht*Zt),Ve=pt*Zt+ht*Lt,We=Math.atan2(gr*ne-Ve*_e,Ve*ne+gr*_e),zt=n.sq(ft)*this._ep2,V.eps=zt/(2*(1+Math.sqrt(1+zt))+zt),this.C3f(V.eps,Be),qe=e.SinCosSeries(!0,V.ssig2,V.csig2,Be)-e.SinCosSeries(!0,V.ssig1,V.csig1,Be),V.domg12=-this.f*this.A3f(V.eps)*Ke*(V.sig12+qe),V.lam12=We+V.domg12,Oe&&(V.calp2===0?V.dlam12=-2*this._f1*N/E:(yr=this.Lengths(V.eps,V.sig12,V.ssig1,V.csig1,N,V.ssig2,V.csig2,I,B,R,e.REDUCEDLENGTH,oe,Se),V.dlam12=yr.m12b,V.dlam12*=this._f1/(V.calp2*R))),V},e.Geodesic.prototype.Inverse=function(E,B,N,D,R){var I,j;return R||(R=e.STANDARD),R===e.LONG_UNROLL&&(R|=e.STANDARD),R&=e.OUT_MASK,I=this.InverseInt(E,B,N,D,R),j=I.vals,R&e.AZIMUTH&&(j.azi1=n.atan2d(I.salp1,I.calp1),j.azi2=n.atan2d(I.salp2,I.calp2)),j},e.Geodesic.prototype.InverseInt=function(E,B,N,D,R){var I={},j,we,_e,ne,Oe,oe,Se,Be,V,je,Ke,ft,ht,pt,Lt,Zt,gr,Ve,qe,We,zt,yr,Ss,Ms,Qu,Zi,rt,Yr,Sr,dn,Cn,td,rd,dl,Xa,ef,tf,rf,nf,nd,S1,ml,M1,id,v1,E1,T1,N_,A1,od,I1,sd,F_,of,G_,k_,sf,ad,af,P1,R1,cd,ld,L1,O1;if(I.lat1=E=n.LatFix(E),I.lat2=N=n.LatFix(N),E=n.AngRound(E),N=n.AngRound(N),j=n.AngDiff(B,D),we=j.e,j=j.d,R&e.LONG_UNROLL?(I.lon1=B,I.lon2=B+j+we):(I.lon1=n.AngNormalize(B),I.lon2=n.AngNormalize(D)),_e=n.copysign(1,j),j*=_e,we*=_e,Lt=j*n.degree,ne=n.sincosde(j,we),Zt=ne.s,gr=ne.c,we=180-j-we,Oe=Math.abs(E)<Math.abs(N)||isNaN(N)?-1:1,Oe<0&&(_e*=-1,[N,E]=[E,N]),oe=n.copysign(1,-E),E*=oe,N*=oe,ne=n.sincosd(E),Se=this._f1*ne.s,Be=ne.c,ne=n.hypot(Se,Be),Se/=ne,Be/=ne,Be=Math.max(e.tiny_,Be),ne=n.sincosd(N),V=this._f1*ne.s,je=ne.c,ne=n.hypot(V,je),V/=ne,je/=ne,je=Math.max(e.tiny_,je),Be<-Se?je===Be&&(V=n.copysign(Se,V)):Math.abs(V)===-Se&&(je=Be),ht=Math.sqrt(1+this._ep2*n.sq(Se)),pt=Math.sqrt(1+this._ep2*n.sq(V)),Ss=new Array(e.nC1_+1),Ms=new Array(e.nC2_+1),Qu=new Array(e.nC3_),Zi=E===-90||Zt===0,Zi&&(qe=gr,We=Zt,zt=1,yr=0,Yr=Se,Sr=qe*Be,dn=V,Cn=zt*je,Ve=Math.atan2(Math.max(0,Sr*dn-Yr*Cn),Sr*Cn+Yr*dn),rt=this.Lengths(this._n,Ve,Yr,Sr,ht,dn,Cn,pt,Be,je,R|e.DISTANCE|e.REDUCEDLENGTH,Ss,Ms),Ke=rt.s12b,ft=rt.m12b,R&e.GEODESICSCALE&&(I.M12=rt.M12,I.M21=rt.M21),Ve<b||ft>=0?((Ve<3*e.tiny_||Ve<g&&(Ke<0||ft<0))&&(Ve=ft=Ke=0),ft*=this._b,Ke*=this._b,I.a12=Ve/n.degree):Zi=!1),sf=2,!Zi&&Se===0&&(this.f<=0||we>=this.f*180))qe=zt=0,We=yr=1,Ke=this.a*Lt,Ve=rd=Lt/this._f1,ft=this._b*Math.sin(Ve),R&e.GEODESICSCALE&&(I.M12=I.M21=Math.cos(Ve)),I.a12=j/this._f1;else if(!Zi)if(rt=this.InverseStart(Se,Be,ht,V,je,pt,Lt,Zt,gr,Ss,Ms),Ve=rt.sig12,We=rt.salp1,qe=rt.calp1,Ve>=0)yr=rt.salp2,zt=rt.calp2,dl=rt.dnm,Ke=Ve*this._b*dl,ft=n.sq(dl)*this._b*Math.sin(Ve/dl),R&e.GEODESICSCALE&&(I.M12=I.M21=Math.cos(Ve/dl)),I.a12=Ve/n.degree,rd=Lt/(this._f1*dl);else{for(Xa=0,ef=e.tiny_,tf=1,rf=e.tiny_,nf=-1,nd=!1,S1=!1;rt=this.Lambda12(Se,Be,ht,V,je,pt,We,qe,Zt,gr,Xa<d,Ss,Ms,Qu),ml=rt.lam12,yr=rt.salp2,zt=rt.calp2,Ve=rt.sig12,Yr=rt.ssig1,Sr=rt.csig1,dn=rt.ssig2,Cn=rt.csig2,td=rt.eps,af=rt.domg12,M1=rt.dlam12,!(S1||!(Math.abs(ml)>=(nd?8:1)*g)||Xa==m);++Xa){if(ml>0&&(Xa<d||qe/We>nf/rf)?(rf=We,nf=qe):ml<0&&(Xa<d||qe/We<tf/ef)&&(ef=We,tf=qe),Xa<d&&M1>0&&(id=-ml/M1,Math.abs(id)<Math.PI&&(v1=Math.sin(id),E1=Math.cos(id),T1=We*E1+qe*v1,T1>0))){qe=qe*E1-We*v1,We=T1,ne=n.hypot(We,qe),We/=ne,qe/=ne,nd=Math.abs(ml)<=16*g;continue}We=(ef+rf)/2,qe=(tf+nf)/2,ne=n.hypot(We,qe),We/=ne,qe/=ne,nd=!1,S1=Math.abs(ef-We)+(tf-qe)<w||Math.abs(We-rf)+(qe-nf)<w}N_=R|(R&(e.REDUCEDLENGTH|e.GEODESICSCALE)?e.DISTANCE:e.NONE),rt=this.Lengths(td,Ve,Yr,Sr,ht,dn,Cn,pt,Be,je,N_,Ss,Ms),Ke=rt.s12b,ft=rt.m12b,R&e.GEODESICSCALE&&(I.M12=rt.M12,I.M21=rt.M21),ft*=this._b,Ke*=this._b,I.a12=Ve/n.degree,R&e.AREA&&(L1=Math.sin(af),O1=Math.cos(af),sf=Zt*O1-gr*L1,ad=gr*O1+Zt*L1)}return R&e.DISTANCE&&(I.s12=0+Ke),R&e.REDUCEDLENGTH&&(I.m12=0+ft),R&e.AREA&&(A1=We*Be,od=n.hypot(qe,We*Se),od!==0&&A1!==0?(Yr=Se,Sr=qe*Be,dn=V,Cn=zt*je,sd=n.sq(od)*this._ep2,td=sd/(2*(1+Math.sqrt(1+sd))+sd),F_=n.sq(this.a)*od*A1*this._e2,ne=n.hypot(Yr,Sr),Yr/=ne,Sr/=ne,ne=n.hypot(dn,Cn),dn/=ne,Cn/=ne,of=new Array(e.nC4_),this.C4f(td,of),G_=e.SinCosSeries(!1,Yr,Sr,of),k_=e.SinCosSeries(!1,dn,Cn,of),I.S12=F_*(Ve<.01?e.SinCosSeries(!1,Yr,Sr,of,Ve):k_-G_)):I.S12=0,!Zi&&sf==2&&(sf=Math.sin(rd),ad=Math.cos(rd)),!Zi&&ad>-.7071&&V-Se<1.75?(af=1+ad,P1=1+Be,R1=1+je,I1=2*Math.atan2(sf*(Se*R1+V*P1),af*(Se*V+P1*R1))):(cd=yr*qe-zt*We,ld=zt*qe+yr*We,cd===0&&ld<0&&(cd=e.tiny_*qe,ld=-1),I1=Math.atan2(cd,ld)),I.S12+=this._c2*I1,I.S12*=Oe*_e*oe,I.S12+=0),Oe<0&&([yr,We]=[We,yr],[zt,qe]=[qe,zt],R&e.GEODESICSCALE&&([I.M21,I.M12]=[I.M12,I.M21])),We*=Oe*_e,qe*=Oe*oe,yr*=Oe*_e,zt*=Oe*oe,{vals:I,salp1:We,calp1:qe,salp2:yr,calp2:zt}},e.Geodesic.prototype.GenDirect=function(E,B,N,D,R,I){var j;return I?I===e.LONG_UNROLL&&(I|=e.STANDARD):I=e.STANDARD,D||(I|=e.DISTANCE_IN),j=new t.GeodesicLine(this,E,B,N,I),j.GenPosition(D,R,I)},e.Geodesic.prototype.Direct=function(E,B,N,D,R){return this.GenDirect(E,B,N,!1,D,R)},e.Geodesic.prototype.ArcDirect=function(E,B,N,D,R){return this.GenDirect(E,B,N,!0,D,R)},e.Geodesic.prototype.Line=function(E,B,N,D){return new t.GeodesicLine(this,E,B,N,D)},e.Geodesic.prototype.DirectLine=function(E,B,N,D,R){return this.GenDirectLine(E,B,N,!1,D,R)},e.Geodesic.prototype.ArcDirectLine=function(E,B,N,D,R){return this.GenDirectLine(E,B,N,!0,D,R)},e.Geodesic.prototype.GenDirectLine=function(E,B,N,D,R,I){var j;return I||(I=e.STANDARD|e.DISTANCE_IN),D||(I|=e.DISTANCE_IN),j=new t.GeodesicLine(this,E,B,N,I),j.GenSetDistance(D,R),j},e.Geodesic.prototype.InverseLine=function(E,B,N,D,R){var I,j,we;return R||(R=e.STANDARD|e.DISTANCE_IN),I=this.InverseInt(E,B,N,D,e.ARC),we=n.atan2d(I.salp1,I.calp1),R&(e.OUT_MASK&e.DISTANCE_IN)&&(R|=e.DISTANCE),j=new t.GeodesicLine(this,E,B,we,R,I.salp1,I.calp1),j.SetArc(I.vals.a12),j},e.Geodesic.prototype.Polygon=function(E){return new r.PolygonArea(this,E)},e.WGS84=new e.Geodesic(i.WGS84.a,i.WGS84.f)})(er.Geodesic,er.GeodesicLine,er.PolygonArea,er.Math,er.Constants);(function(e,t,r){"use strict";t.GeodesicLine=function(n,i,o,s,a,c,l){var u,h,d,m,g,y;a||(a=e.STANDARD|e.DISTANCE_IN),this.a=n.a,this.f=n.f,this._b=n._b,this._c2=n._c2,this._f1=n._f1,this.caps=a|e.LATITUDE|e.AZIMUTH|e.LONG_UNROLL,this.lat1=r.LatFix(i),this.lon1=o,typeof c>"u"||typeof l>"u"?(this.azi1=r.AngNormalize(s),u=r.sincosd(r.AngRound(this.azi1)),this.salp1=u.s,this.calp1=u.c):(this.azi1=s,this.salp1=c,this.calp1=l),u=r.sincosd(r.AngRound(this.lat1)),d=this._f1*u.s,h=u.c,u=r.hypot(d,h),d/=u,h/=u,h=Math.max(e.tiny_,h),this._dn1=Math.sqrt(1+n._ep2*r.sq(d)),this._salp0=this.salp1*h,this._calp0=r.hypot(this.calp1,this.salp1*d),this._ssig1=d,this._somg1=this._salp0*d,this._csig1=this._comg1=d!==0||this.calp1!==0?h*this.calp1:1,u=r.hypot(this._ssig1,this._csig1),this._ssig1/=u,this._csig1/=u,this._k2=r.sq(this._calp0)*n._ep2,m=this._k2/(2*(1+Math.sqrt(1+this._k2))+this._k2),this.caps&e.CAP_C1&&(this._A1m1=e.A1m1f(m),this._C1a=new Array(e.nC1_+1),e.C1f(m,this._C1a),this._B11=e.SinCosSeries(!0,this._ssig1,this._csig1,this._C1a),g=Math.sin(this._B11),y=Math.cos(this._B11),this._stau1=this._ssig1*y+this._csig1*g,this._ctau1=this._csig1*y-this._ssig1*g),this.caps&e.CAP_C1p&&(this._C1pa=new Array(e.nC1p_+1),e.C1pf(m,this._C1pa)),this.caps&e.CAP_C2&&(this._A2m1=e.A2m1f(m),this._C2a=new Array(e.nC2_+1),e.C2f(m,this._C2a),this._B21=e.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&e.CAP_C3&&(this._C3a=new Array(e.nC3_),n.C3f(m,this._C3a),this._A3c=-this.f*this._salp0*n.A3f(m),this._B31=e.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&e.CAP_C4&&(this._C4a=new Array(e.nC4_),n.C4f(m,this._C4a),this._A4=r.sq(this.a)*this._calp0*this._salp0*n._e2,this._B41=e.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=NaN},t.GeodesicLine.prototype.GenPosition=function(n,i,o,s={}){var a,c,l,u,h,d,m,g,y,b,w,_,S,v,T,O,P,M,U,C,L,A,W,G,E,B,N,D,R;return o?o===e.LONG_UNROLL&&(o|=e.STANDARD):o=e.STANDARD,o&=this.caps&e.OUT_MASK,s.lat1=this.lat1,s.azi1=this.azi1,s.lon1=o&e.LONG_UNROLL?this.lon1:r.AngNormalize(this.lon1),n?s.a12=i:s.s12=i,n||this.caps&e.DISTANCE_IN&e.OUT_MASK?(u=0,h=0,n?(a=i*r.degree,B=r.sincosd(i),c=B.s,l=B.c):(g=i/(this._b*(1+this._A1m1)),y=Math.sin(g),b=Math.cos(g),u=-e.SinCosSeries(!0,this._stau1*b+this._ctau1*y,this._ctau1*b-this._stau1*y,this._C1pa),a=g-(u-this._B11),c=Math.sin(a),l=Math.cos(a),Math.abs(this.f)>.01&&(d=this._ssig1*l+this._csig1*c,m=this._csig1*l-this._ssig1*c,u=e.SinCosSeries(!0,d,m,this._C1a),w=(1+this._A1m1)*(a+(u-this._B11))-i/this._b,a=a-w/Math.sqrt(1+this._k2*r.sq(d)),c=Math.sin(a),l=Math.cos(a))),d=this._ssig1*l+this._csig1*c,m=this._csig1*l-this._ssig1*c,A=Math.sqrt(1+this._k2*r.sq(d)),o&(e.DISTANCE|e.REDUCEDLENGTH|e.GEODESICSCALE)&&((n||Math.abs(this.f)>.01)&&(u=e.SinCosSeries(!0,d,m,this._C1a)),h=(1+this._A1m1)*(u-this._B11)),O=this._calp0*d,P=r.hypot(this._salp0,this._calp0*m),P===0&&(P=m=e.tiny_),C=this._salp0,L=this._calp0*m,n&&o&e.DISTANCE&&(s.s12=this._b*((1+this._A1m1)*a+h)),o&e.LONGITUDE&&(M=this._salp0*d,U=m,T=r.copysign(1,this._salp0),_=o&e.LONG_UNROLL?T*(a-(Math.atan2(d,m)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(T*M,U)-Math.atan2(T*this._somg1,this._comg1))):Math.atan2(M*this._comg1-U*this._somg1,U*this._comg1+M*this._somg1),S=_+this._A3c*(a+(e.SinCosSeries(!0,d,m,this._C3a)-this._B31)),v=S/r.degree,s.lon2=o&e.LONG_UNROLL?this.lon1+v:r.AngNormalize(r.AngNormalize(this.lon1)+r.AngNormalize(v))),o&e.LATITUDE&&(s.lat2=r.atan2d(O,this._f1*P)),o&e.AZIMUTH&&(s.azi2=r.atan2d(C,L)),o&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(W=e.SinCosSeries(!0,d,m,this._C2a),G=(1+this._A2m1)*(W-this._B21),E=(this._A1m1-this._A2m1)*a+(h-G),o&e.REDUCEDLENGTH&&(s.m12=this._b*(A*(this._csig1*d)-this._dn1*(this._ssig1*m)-this._csig1*m*E)),o&e.GEODESICSCALE&&(B=this._k2*(d-this._ssig1)*(d+this._ssig1)/(this._dn1+A),s.M12=l+(B*d-m*E)*this._ssig1/this._dn1,s.M21=l-(B*this._ssig1-this._csig1*E)*d/A)),o&e.AREA&&(N=e.SinCosSeries(!1,d,m,this._C4a),this._calp0===0||this._salp0===0?(D=C*this.calp1-L*this.salp1,R=L*this.calp1+C*this.salp1):(D=this._calp0*this._salp0*(l<=0?this._csig1*(1-l)+c*this._ssig1:c*(this._csig1*c/(1+l)+this._ssig1)),R=r.sq(this._salp0)+r.sq(this._calp0)*this._csig1*m),s.S12=this._c2*Math.atan2(D,R)+this._A4*(Math.abs(a)<.01?e.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a,a):N-this._B41)),n||(s.a12=a/r.degree),s):(s.a12=NaN,s)},t.GeodesicLine.prototype.Position=function(n,i){return this.GenPosition(!1,n,i)},t.GeodesicLine.prototype.ArcPosition=function(n,i){return this.GenPosition(!0,n,i)},t.GeodesicLine.prototype.GenSetDistance=function(n,i){n?this.SetArc(i):this.SetDistance(i)},t.GeodesicLine.prototype.SetDistance=function(n){var i;this.s13=n,i=this.GenPosition(!1,this.s13,e.ARC),this.a13=0+i.a12},t.GeodesicLine.prototype.SetArc=function(n){var i;this.a13=n,i=this.GenPosition(!0,this.a13,e.DISTANCE),this.s13=0+i.s12}})(er.Geodesic,er.GeodesicLine,er.Math)});function tT(e){if(!Number.isFinite(e))throw new Error("Nonfinite axis, azimuth, distance or arc")}function rT({semiMajorAxis:e,semiMinorAxis:t}){return tT(e),tT(t),new Cy.Geodesic(e,(e-t)/e)}var Cy,If,nT=p(()=>{eT();Cy=er.Geodesic;If=Cy.ALL&~Cy.AREA});function sT(e,t,r,n,i,o){let s=oT[t]&&oT[t][r];Ri(s&&(!n||n===s));let a,c,l,u=vz.copy(i);if(!Number.isFinite(u.x)||!Number.isFinite(u.y)||!Number.isFinite(u.z)||!Array.isArray(o)&&o.length<16)throw new Error("Unsupported local frame");let h=Mz*Math.min(1,e.maximumRadius),d=Math.abs(u.x)<=h&&Math.abs(u.y)<=h,m=e.radii;if(m.x===m.y&&m.x>0&&m.z>0&&m.z<=m.x&&(!d||u.z!==0)){let{east:C,up:L}=ql;if(d)C.set(0,1,0),L.set(0,0,Math.sign(u.z));else{let A=Math.max(Math.abs(u.x),Math.abs(u.y));C.set(-u.y/A,u.x/A,0).normalize(),e.geodeticSurfaceNormal(u,L)}if(!Iy(C,L,iT)||!Py(iT,u,t,r,n,o))throw new Error("Unsupported local frame");return o}if(d){let C=Math.sign(u.z);a=Ez.fromArray(Dy[t]),t!=="east"&&t!=="west"&&a.scale(C),c=Tz.fromArray(Dy[r]),r!=="east"&&r!=="west"&&c.scale(C),l=Az.fromArray(Dy[n]),n!=="east"&&n!=="west"&&l.scale(C)}else{let{up:C,east:L,north:A}=ql,W=Math.max(Math.abs(u.x),Math.abs(u.y));L.set(-u.y/W,u.x/W,0).normalize(),e.geodeticSurfaceNormal(u,C),A.copy(C).cross(L);let{down:G,west:E,south:B}=ql;G.copy(C).scale(-1),E.copy(L).scale(-1),B.copy(A).scale(-1),a=ql[t],c=ql[r],l=ql[n]}let g=a.x,y=a.y,b=a.z,w=c.x,_=c.y,S=c.z,v=l.x,T=l.y,O=l.z,P=u.x,M=u.y,U=u.z;return o[0]=g,o[1]=y,o[2]=b,o[3]=0,o[4]=w,o[5]=_,o[6]=S,o[7]=0,o[8]=v,o[9]=T,o[10]=O,o[11]=0,o[12]=P,o[13]=M,o[14]=U,o[15]=1,o}var Mz,vz,iT,oT,Dy,ql,Ez,Tz,Az,aT=p(()=>{Fn();Fn();Mz=1e-14,vz=new J,iT=Ay(),oT={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"}},Dy={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},ql={east:new J,north:new J,up:new J,west:new J,south:new J,down:new J},Ez=new J,Tz=new J,Az=new J});function Ny(e,t,r=new yn){return sT(e,"east","north","up",t,r)}var cT=p(()=>{Fn();aT()});var lT=p(()=>{Q4();cT()});var Fy,Gy,Ls,uT=p(()=>{Fy={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Gy={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635},Ls={...Fy,...Gy}});var fT=p(()=>{uT()});var hT=p(()=>{fT()});var dT=p(()=>{});var mT=p(()=>{});function re(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))return r;let n=e[t];if(typeof n!="string"||!/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i.test(n))throw new Error(`Invalid numeric PROJ parameter: +${t}`);let i=Number(n);if(!Number.isFinite(i))throw new Error(`Invalid numeric PROJ parameter: +${t}`);return i}function Pf(e,t){let r=re(e,t,0);if(Math.abs(r)>=90)throw new Error(`+${t} must be between -90 and 90 degrees`);return r*At}function Xt(e,t=!1){if(t||Math.abs(e)<=Math.PI)return e;let r=2*Math.PI;return((e+Math.PI)%r+r)%r-Math.PI}var At,Vt=p(()=>{At=Math.PI/180});function Ot(e,t){let r=[e[0]*t[0],e[0]*t[1],e[1]*t[0],e[1]*t[1]];return[Math.min(...r),Math.max(...r)]}function Rf([e,t]){let r=[Math.sin(e),Math.sin(t)];for(let[n,i]of[[Math.PI/2,1],[-Math.PI/2,-1]])Math.ceil((e-n)/(2*Math.PI))<=Math.floor((t-n)/(2*Math.PI))&&r.push(i);return[Math.min(...r),Math.max(...r)]}function lt(e,t){let r=n=>Math.max(1,Os(n))*1e-12;if(![...e,...t].every(Number.isFinite))throw new Error("Projection rendering bounds are not finite");return[[e[0]-r(e),t[0]-r(t),0],[e[1]+r(e),t[1]+r(t),0]]}function Br(e,t,r=!1){let n=e[0][0]-t,i=e[1][0]-t;if(r)return[n,i];let o=i-n;if(o>=2*Math.PI-1e-12)return[-Math.PI,Math.PI];let s=Xt(n);o>0&&Math.abs(s-Math.PI)<1e-12&&(s=-Math.PI);let a=s+o;return a>Math.PI+1e-12?[-Math.PI,Math.PI]:[s,Math.min(a,Math.PI)]}function Cr(e,t,r,n=!1){let i=Br(t,r,n),o=[t[0][1],t[1][1],Math.max(t[0][1],Math.min(t[1][1],0))],s=i.flatMap(a=>o.map(c=>e(r+a,c)));return lt([Math.min(...s.map(a=>a[0])),Math.max(...s.map(a=>a[0]))],[Math.min(...s.map(a=>a[1])),Math.max(...s.map(a=>a[1]))])}function Vl(e,t,r,n=!1,i=0){let o=Br(t,r,n);if(Os(o)>Math.PI/6+1e-12)throw new Error("Unsupported transverse rendering coverage");let s=[o[0],o[1],Math.max(o[0],Math.min(o[1],0))],a=[t[0][1],t[1][1],Math.max(t[0][1],Math.min(t[1][1],i))],c=s.flatMap(l=>a.map(u=>e(r+l,u)));return lt([Math.min(...c.map(l=>l[0])),Math.max(...c.map(l=>l[0]))],[Math.min(...c.map(l=>l[1])),Math.max(...c.map(l=>l[1]))])}function pT(e,t,r,n=!1){let i=Br(t,r,n),o=[i[0],i[1],Math.max(i[0],Math.min(i[1],0))],s=[t[0][1],t[1][1],Math.max(t[0][1],Math.min(t[1][1],0))],a=o.flatMap(c=>s.map(l=>e(r+c,l)));return lt([Math.min(...a.map(c=>c[0])),Math.max(...a.map(c=>c[0]))],[Math.min(...a.map(c=>c[1])),Math.max(...a.map(c=>c[1]))])}function Wl(e,t,r,n,i,o,s=!1){let a=Fe(Br(t,r,s),n),c=mi(o-e(r,t[0][1])[1],o-e(r,t[1][1])[1]);return lt(Ce([i,i],Ot(c,Rf(a))),Ce([o,o],Fe(Ot(c,vm(a)),-1)))}var mi,Ce,Fe,vm,Os,Bt=p(()=>{Vt();mi=(e,t)=>[Math.min(e,t),Math.max(e,t)],Ce=(e,t)=>[e[0]+t[0],e[1]+t[1]],Fe=(e,t)=>mi(e[0]*t,e[1]*t);vm=e=>Rf([e[0]+Math.PI/2,e[1]+Math.PI/2]),Os=e=>Math.max(Math.abs(e[0]),Math.abs(e[1]))});function Q(e,t,r,n){return[[e,t],[r,n]]}function Li(e){return e>=-180&&e<180?e:((e+180)%360+360)%360-180}function Pz(e,t,r,n){if(![e,t,r,n].every(Number.isFinite)||t<-90||n>90||t>n||r-e<-360||r-e>360+1e-10)throw new Error("Invalid geographic coverage");if(r-e>=360-1e-10)return[-180,t,180,n];let i=Li(r);return[Li(e),t,i===-180&&r>e?180:i,n]}function ky(e){let t=e[2]-e[0];return t<0?t+360:t}function gT(e){let[t,r,n,i]=e;return t<=n?[e]:[[t,r,180,i],[-180,r,n,i]]}function Rz(e,t){let[r,n,i,o]=e,s=Li(t[0]);return t[1]>=n&&t[1]<=o&&(r<=i?s>=r&&s<=i||s===-180&&i===180:s>=r||s<=i)}function Em(e,t){let r=Math.max(e[1],t[1]),n=Math.min(e[3],t[3]);if(r>n)return[];let i=[];for(let s of gT(e))for(let a of gT(t)){let c=Math.max(s[0],a[0]),l=Math.min(s[2],a[2]);c<=l?i.push([c,l]):(s[2]===180&&a[0]===-180||a[2]===180&&s[0]===-180)&&i.push([-180,-180])}i.sort((s,a)=>s[0]-a[0]);let o=[];for(let s of i){let a=o[o.length-1];a&&s[0]<=a[1]?a[1]=Math.max(a[1],s[1]):o.push([...s])}if(o.length>1&&o[0][0]===-180&&o[o.length-1][1]===180){let s=o.shift();return[[o.pop()[0],r,s[1],n],...o.map(([c,l])=>[c,r,l,n])]}return o.map(([s,a])=>[s,r,a,n])}function yT(e,t){let r=Li(t[0]),n=Math.max(e[1],Math.min(e[3],t[1]));if(!Rz(e,[r,n])){let i=Math.abs(Li(r-e[0])),o=Math.abs(Li(r-e[2]));r=i<=o?e[0]:e[2]}return[r,n]}function Bs(e,t=0,r=0){let n=ky(e),i=e[0]*Vo-t,o=i+n*Vo/2,s=Math.round((r-o)/(2*Math.PI))*2*Math.PI;return Q(n===360?r-Math.PI:i+s,e[1]*Vo,n===360?r+Math.PI:i+s+n*Vo,e[3]*Vo)}function Gn(e,t=0){return Pz((e[0][0]+t)/Vo,e[0][1]/Vo,(e[1][0]+t)/Vo,e[1][1]/Vo)}function bT(e){if(!e.length)throw new Error("CRS coverage does not intersect the rendering target");return[[0,1,2].map(t=>Math.min(...e.map(r=>r[0][t]))),[0,1,2].map(t=>Math.max(...e.map(r=>r[1][t])))]}var Vo,Qe=p(()=>{Vo=Math.PI/180});function wT(e,t){if(t)try{let n=e(t);return Uy(n)}catch{}let r=e();return Uy(r)}function Uy(e){var r;let t=e.bounds;if(t.some(n=>n.some(i=>!Number.isFinite(i))))throw new Error("Projection rendering bounds must be finite");return{bounds:t,normalize:(r=e.normalize)==null?void 0:r.bind(e)}}function Cs(e,t=0){return r=>{let n=r.x*Math.PI/180-t,i=r.y*Math.PI/180,o={x:n,y:i,z:r.z};e(o),o.x!==n&&(r.x=(o.x+t)*180/Math.PI),o.y!==i&&(r.y=o.y*180/Math.PI)}}function Tm(e,t){let r=[];for(let n of e){let i=t(n);i!==null&&r.push(Uy(i))}return r.length?r.length===1?r[0]:{bounds:bT(r.map(n=>n.bounds)),normalize(n){var a;let i=n.x,o=n.y,s=1/0;for(let c of r){let l={x:n.x,y:n.y,z:n.z};(a=c.normalize)==null||a.call(c,l);let u=Math.sin((l.y-n.y)*Math.PI/360)**2+Math.cos(n.y*Math.PI/180)*Math.cos(l.y*Math.PI/180)*Math.sin((l.x-n.x)*Math.PI/360)**2;u<s&&(s=u,i=l.x,o=l.y)}n.x=i,n.y=o}}:null}var cc=p(()=>{Qe()});function Am(e,t,r=0,n=!1){let i=ky(t),o=i===360?r-180:t[0]+Math.round((r-t[0]-i/2)/360)*360,s=o+i;if(n){e.x=Math.max(o,Math.min(s,e.x)),e.y=Math.max(t[1],Math.min(t[3],e.y));return}let a=yT(t,[e.x,e.y]),c=a[0];a[0]===Li(e.x)&&e.x>=o&&e.x<=s?c=e.x:(c<o||c>s)&&(c+=Math.round(((o+s)/2-c)/360)*360);let l=c-r;e.x=Math.abs(l)<=180?c:r+Li(l),e.y=a[1]}function ur(e,t,r=0,n=0,i=!1){let o=(r+n)*180/Math.PI;return{get bounds(){return e(Bs(t,n,r))},normalize(s){Am(s,t,o,i)}}}function Lz(e,t,r,n,i){let o=Tm(t,s=>ur(e,s,r,n,i));if(!o)throw new Error("CRS coverage does not intersect the rendering target");return o}function De(e,t,r,n=0,i=!1){let o=(t[0][0]+t[1][0])/2,s=Gn(t,n),a=(o+n)*180/Math.PI;return{...e,longitudeOrigin:o,getRenderingProfile(c){if(!c)return{bounds:r(t),normalize(l){Am(l,s,a,i)}};try{let l=ur(r,c,o,n,i);return{bounds:l.bounds,normalize:l.normalize}}catch{return Lz(r,Em(c,s),o,n,i)}}}}var ut=p(()=>{Qe();cc()});function xT(){return{x:0,y:0,z:0}}var Ds,Im=p(()=>{Ds=class{constructor(){this.point=xT(),this.points=[this.point],this.active=0}get depth(){return this.active}acquire(){var t;let r=this.active++;return(t=this.points)[r]||(t[r]=xT()),this.points[r]}release(t){this.active>0&&this.points[this.active-1]===t&&this.active--}}});function pi(e,t){let r=new Ds,n=(i,o,s)=>{let a=r.acquire();try{return a.x=i,a.y=o,a.z=0,s(a),[a.x,a.y]}finally{r.release(a)}};return{forward(i,o){return n(i,o,e)},inverse(i,o){return n(i,o,t)},forwardInPlace:e,inverseInPlace:t}}function Wo(e,t,r=!1){let n=t?e.inverseInPlace:e.forwardInPlace;if(n)return n.bind(e);if(r){let o=t?e.inverse3D:e.forward3D;return s=>{let a=o.call(e,[s.x,s.y,s.z]);s.x=a[0],s.y=a[1],s.z=a[2]}}let i=t?e.inverse:e.forward;return o=>{let s=i.call(e,o.x,o.y);o.x=s[0],o.y=s[1]}}var lc=p(()=>{Im()});function Ns(e,t,r=0){let n=re(e,t,r);if(t!=="lon_0"&&Math.abs(n)>90)throw new Error("Latitude parameter must be between -90 and 90 degrees: +"+t);return n*At}function Oi(e,t){let r=Object.prototype.hasOwnProperty.call(e,t);if(r&&e[t]!==void 0)throw new Error("Expected a flag without a value: +"+t);return r}function xr({semiMajorAxis:e,eccentricitySquared:t,parameters:r,primeMeridian:n=0}){let i=re(r,"k_0",re(r,"k",1));if(i<=0)throw new Error("Projection scale must be positive");return{primeMeridian:n,a:e,b:e*Math.sqrt(1-t),es:t,e:Math.sqrt(t),ep2:t/(1-t),sphere:t===0,over:Oi(r,"over"),long0:Ns(r,"lon_0"),lat0:Ns(r,"lat_0"),lat1:Ns(r,"lat_1"),lat2:Ns(r,"lat_2",re(r,"lat_1",0)),lat_ts:Ns(r,"lat_ts",NaN),x0:re(r,"x_0",0),y0:re(r,"y_0",0),k0:i}}function Hl(e,t){if(!Object.prototype.hasOwnProperty.call(t,"lat_1"))throw new Error("Conic projections require +lat_1");if(Math.abs(e.lat1+e.lat2)<1e-10||Math.abs(e.lat1)>=Math.PI/2||Math.abs(e.lat2)>=Math.PI/2)throw new Error("Conic standard parallels must not be opposite or at a pole")}function fr(e,t,r,n,i=pi){let o=(s,a)=>{let c=s(t,a);if(!c||typeof c!="object"||!Number.isFinite(c.x)||!Number.isFinite(c.y))throw new Error(e+": coordinate outside projection domain or inverse did not converge");a.x=c.x,a.y=c.y};return i(s=>o(r,s),s=>o(n,s))}function Fs(e,t){let r=Wo(t,!1);return pi(n=>{let i=n.x,o=n.y,s=Math.atan2(Math.sin(i-e.long0),Math.cos(i-e.long0)),a=Math.abs(Math.abs(e.lat0)-Math.PI/2)<1e-10;if(Math.abs(o+e.lat0)<1e-10&&(a||Math.abs(Math.abs(s)-Math.PI)<1e-10))throw new Error("Azimuthal projection is undefined at the antipode");r(n)},Wo(t,!0))}var Er,Ho,kn=p(()=>{lc();Vt();Er=["lon_0","lat_0","x_0","y_0"],Ho=["k","k_0"]});function Bi(e,t){return{...pi(e,t),createForwardFlat(r){return this.forwardInPlace===e?_T(e,!1,r):void 0},createInverseFlat(r){return this.inverseInPlace===t?_T(t,!0,r):void 0}}}function _T(e,t,{inputScale:r,outputScale:n}){let i=new Ds;return(o,s)=>{let a=i.acquire();try{let c=o instanceof Float32Array;for(let l=0;l<o.length;l+=s){if(a.x=o[l],a.y=o[l+1],a.z=s>=3?o[l+2]:0,!Number.isFinite(a.x)||!Number.isFinite(a.y)||!Number.isFinite(a.z))throw new Error("Coordinates must contain finite x, y and optional z values");if(r!==1&&(a.x*=r,a.y*=r),t&&e(a),Math.abs(a.y)>Math.PI/2||!Number.isFinite(a.x)||!Number.isFinite(a.y))throw new Error("Coordinate is outside the geographic domain");if(a.x+=0,a.x-=0,t||e(a),n!==1&&(a.x/=n,a.y/=n),!Number.isFinite(a.x)||!Number.isFinite(a.y))throw new Error("Projection produced non-finite coordinates");if(c&&(Math.abs(a.x)>34028234663852886e22||Math.abs(a.y)>34028234663852886e22))throw new Error("Projected coordinate exceeds Float32 range");o[l]=a.x,o[l+1]=a.y}}finally{i.release(a)}}}var $l=p(()=>{lc();Im()});function uc(e){var t=Math.exp(e);return t=(t-1/t)/2,t}var Pm=p(()=>{});function tr(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),n=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}var fc=p(()=>{});function ST(e){var t=1+e,r=t-1;return r===0?e:e*Math.log(t)/r}var MT=p(()=>{});function vT(e){var t=Math.abs(e);return t=ST(t*(1+t/(tr(1,t)+1))),e<0?-t:t}var ET=p(()=>{fc();MT()});function Rm(e,t){for(var r=2*Math.cos(2*t),n=e.length-1,i=e[n],o=0,s;--n>=0;)s=-o+r*i+e[n],o=i,i=s;return t+s*Math.sin(2*t)}var TT=p(()=>{});function AT(e,t){for(var r=2*Math.cos(t),n=e.length-1,i=e[n],o=0,s;--n>=0;)s=-o+r*i+e[n],o=i,i=s;return Math.sin(t)*s}var IT=p(()=>{});function Lf(e){var t=Math.exp(e);return t=(t+1/t)/2,t}var jy=p(()=>{});function zy(e,t,r,n){for(var i=Math.sin(t),o=Math.cos(t),s=uc(r),a=Lf(r),c=2*o*a,l=-2*i*s,u=e.length-1,h=e[u],d=0,m=0,g=0,y,b;--u>=0;)y=m,b=d,m=h,d=g,h=-y+c*m-l*d+e[u],g=-b+l*m+c*d;c=i*a,l=o*s,n.x=c*h-l*g,n.y=c*g+l*h}var PT=p(()=>{Pm();jy()});var F,et,Gs,RT,qy,Vy,Of,Ct=p(()=>{F=Math.PI/2,et=Math.PI/4,Gs=Math.PI*2,RT=3.14159265359,qy=Math.PI/180,Vy=180/Math.PI,Of=Math.PI/(180*3600)});function ks(e){return e<0?-1:1}var Bf=p(()=>{});function k(e,t){return t||Math.abs(e)<=RT?e:e-ks(e)*Gs}var _t=p(()=>{Ct();Bf()});function Oz(e){e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.long0=e.long0!==void 0?e.long0:0,e.lat0=e.lat0!==void 0?e.lat0:0,e.k0=e.k0!==void 0?e.k0:1,e.cgb=[],e.cbg=[],e.utg=[],e.gtu=[];var t=e.es/(1+Math.sqrt(1-e.es)),r=t/(2-t),n=r;e.cgb[0]=r*(2+r*(-2/3+r*(-2+r*(116/45+r*(26/45+r*(-2854/675)))))),e.cbg[0]=r*(-2+r*(2/3+r*(4/3+r*(-82/45+r*(32/45+r*(4642/4725)))))),n=n*r,e.cgb[1]=n*(7/3+r*(-8/5+r*(-227/45+r*(2704/315+r*(2323/945))))),e.cbg[1]=n*(5/3+r*(-16/15+r*(-13/9+r*(904/315+r*(-1522/945))))),n=n*r,e.cgb[2]=n*(56/15+r*(-136/35+r*(-1262/105+r*(73814/2835)))),e.cbg[2]=n*(-26/15+r*(34/21+r*(8/5+r*(-12686/2835)))),n=n*r,e.cgb[3]=n*(4279/630+r*(-332/35+r*(-399572/14175))),e.cbg[3]=n*(1237/630+r*(-12/5+r*(-24832/14175))),n=n*r,e.cgb[4]=n*(4174/315+r*(-144838/6237)),e.cbg[4]=n*(-734/315+r*(109598/31185)),n=n*r,e.cgb[5]=n*(601676/22275),e.cbg[5]=n*(444337/155925),n=Math.pow(r,2),e.Qn=e.k0/(1+r)*(1+n*(1/4+n*(1/64+n/256))),e.utg[0]=r*(-.5+r*(2/3+r*(-37/96+r*(1/360+r*(81/512+r*(-96199/604800)))))),e.gtu[0]=r*(.5+r*(-2/3+r*(5/16+r*(41/180+r*(-127/288+r*(7891/37800)))))),e.utg[1]=n*(-1/48+r*(-1/15+r*(437/1440+r*(-46/105+r*(1118711/3870720))))),e.gtu[1]=n*(13/48+r*(-3/5+r*(557/1440+r*(281/630+r*(-1983433/1935360))))),n=n*r,e.utg[2]=n*(-17/480+r*(37/840+r*(209/4480+r*(-5569/90720)))),e.gtu[2]=n*(61/240+r*(-103/140+r*(15061/26880+r*(167603/181440)))),n=n*r,e.utg[3]=n*(-4397/161280+r*(11/504+r*(830251/7257600))),e.gtu[3]=n*(49561/161280+r*(-179/168+r*(6601661/7257600))),n=n*r,e.utg[4]=n*(-4583/161280+r*(108847/3991680)),e.gtu[4]=n*(34729/80640+r*(-3418889/1995840)),n=n*r,e.utg[5]=n*(-20648693/638668800),e.gtu[5]=n*(212378941/319334400);var i=Rm(e.cbg,e.lat0);e.Zb=-e.Qn*(i+AT(e.gtu,2*i))}function LT(e,t){var r=k(t.x-e.long0,e.over),n=t.y;n=Rm(e.cbg,n);var i=Math.sin(n),o=Math.cos(n),s=Math.sin(r),a=Math.cos(r);n=Math.atan2(i,a*o),r=Math.atan2(s*o,tr(i,o*a)),r=vT(Math.tan(r)),zy(e.gtu,2*n,2*r,t),n=n+t.x,r=r+t.y;var c,l;return Math.abs(r)<=2.623395162778?(c=e.a*(e.Qn*r)+e.x0,l=e.a*(e.Qn*n+e.Zb)+e.y0):(c=1/0,l=1/0),t.x=c,t.y=l,t}function OT(e,t){var r=(t.x-e.x0)*(1/e.a),n=(t.y-e.y0)*(1/e.a);n=(n-e.Zb)/e.Qn,r=r/e.Qn;var i,o;if(Math.abs(r)<=2.623395162778){zy(e.utg,2*n,2*r,t),n=n+t.x,r=r+t.y,r=Math.atan(uc(r));var s=Math.sin(n),a=Math.cos(n),c=Math.sin(r),l=Math.cos(r);n=Math.atan2(s*l,tr(c,l*a)),r=Math.atan2(c,l*a),i=k(r+e.long0,e.over),o=Rm(e.cgb,n)}else i=1/0,o=1/0;return t.x=i,t.y=o,t}function BT(e){let t={...e,cgb:[],cbg:[],utg:[],gtu:[],Qn:0,Zb:0};return Oz(t),t}var CT=p(()=>{Pm();fc();ET();TT();IT();PT();_t()});function uo(e){var t=[];t[0]=Bz-e*(Cz+e*(DT+e*(NT+e*FT))),t[1]=e*(Dz-e*(DT+e*(NT+e*FT)));var r=e*e;return t[2]=r*(Nz-e*(Fz+e*Gz)),r*=e,t[3]=r*(kz-e*Uz),t[4]=r*e*jz,t}var Bz,Cz,DT,NT,FT,Dz,Nz,Fz,Gz,kz,Uz,jz,Kl=p(()=>{Bz=1,Cz=.25,DT=.046875,NT=.01953125,FT=.01068115234375,Dz=.75,Nz=.46875,Fz=.013020833333333334,Gz=.007120768229166667,kz=.3645833333333333,Uz=.005696614583333333,jz=.3076171875});function _r(e,t,r,n){return r*=t,t*=t,n[0]*e-r*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var hc=p(()=>{});function fo(e,t,r){for(var n=1/(1-t),i=e,o=zz;o;--o){var s=Math.sin(i),a=1-t*s*s;if(a=(_r(i,s,Math.cos(i),r)-e)*(a*Math.sqrt(a))*n,i-=a,Math.abs(a)<1e-10)return i}return i}var zz,Xl=p(()=>{hc();zz=20});function qz(e){e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.long0=e.long0!==void 0?e.long0:0,e.lat0=e.lat0!==void 0?e.lat0:0,e.es&&(e.en=uo(e.es),e.ml0=_r(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en))}function GT(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over),o,s,a,c=Math.sin(n),l=Math.cos(n);if(e.es){var h=l*i,d=Math.pow(h,2),m=e.ep2*Math.pow(l,2),g=Math.pow(m,2),y=Math.abs(l)>1e-10?Math.tan(n):0,b=Math.pow(y,2),w=Math.pow(b,2);o=1-e.es*Math.pow(c,2),h=h/Math.sqrt(o);var _=_r(n,c,l,e.en);s=e.a*(e.k0*h*(1+d/6*(1-b+m+d/20*(5-18*b+w+14*m-58*b*m+d/42*(61+179*w-w*b-479*b)))))+e.x0,a=e.a*(e.k0*(_-e.ml0+c*i*h/2*(1+d/12*(5-b+9*m+4*g+d/30*(61+w-58*b+270*m-330*b*m+d/56*(1385+543*w-w*b-3111*b))))))+e.y0}else{var u=l*Math.sin(i);if(Math.abs(Math.abs(u)-1)<1e-10)return 93;if(s=.5*e.a*e.k0*Math.log((1+u)/(1-u))+e.x0,a=l*Math.cos(i)/Math.sqrt(1-Math.pow(u,2)),u=Math.abs(a),u>=1){if(u-1>1e-10)return 93;a=0}else a=Math.acos(a);n<0&&(a=-a),a=e.a*e.k0*(a-e.lat0)+e.y0}return t.x=s,t.y=a,t}function kT(e,t){var r,n,i,o,s=(t.x-e.x0)*(1/e.a),a=(t.y-e.y0)*(1/e.a);if(e.es)if(r=e.ml0+a/e.k0,n=fo(r,e.es,e.en),Math.abs(n)<F){var d=Math.sin(n),m=Math.cos(n),g=Math.abs(m)>1e-10?Math.tan(n):0,y=e.ep2*Math.pow(m,2),b=Math.pow(y,2),w=Math.pow(g,2),_=Math.pow(w,2);r=1-e.es*Math.pow(d,2);var S=s*Math.sqrt(r)/e.k0,v=Math.pow(S,2);r=r*g,i=n-r*v/(1-e.es)*.5*(1-v/12*(5+3*w-9*y*w+y-4*b-v/30*(61+90*w-252*y*w+45*_+46*y-v/56*(1385+3633*w+4095*_+1574*_*w)))),o=k(e.long0+S*(1-v/6*(1+2*w+y-v/20*(5+28*w+24*_+8*y*w+6*y-v/42*(61+662*w+1320*_+720*_*w))))/m,e.over)}else i=F*ks(a),o=0;else{var c=Math.exp(s/e.k0),l=.5*(c-1/c),u=e.lat0+a/e.k0,h=Math.cos(u);r=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(l,2))),i=Math.asin(r),Math.sin(u)<0&&(i=-i),l===0&&h===0?o=0:o=k(Math.atan2(l,h)+e.long0,e.over)}return t.x=o,t.y=i,t}function UT(e){let t={...e,en:[],ml0:0};return qz(t),t}var jT=p(()=>{Kl();hc();Xl();_t();Ct();Bf()});function Lm(e){let t=xr(e),r=n=>De(n,Q(t.long0-Math.PI/6,-Math.PI/2,t.long0+Math.PI/6,Math.PI/2),i=>Vl(n.forward,i,t.long0,t.over),t.primeMeridian,t.over);if(Oi(e.parameters,"approx"))return r({...fr("tmerc +approx",UT(t),GT,kT,Bi)});if(t.sphere)throw new Error("Spherical transverse Mercator requires +approx");return r({...fr("etmerc",BT(t),LT,OT,Bi)})}var Wy,Hy,$y=p(()=>{$l();Bt();Qe();ut();kn();CT();jT();Wy={name:"tmerc",aliases:["Fast_Transverse_Mercator","Fast Transverse Mercator","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger"],parameters:[...Er,...Ho,"approx"],flags:["approx"],create:Lm},Hy={name:"etmerc",aliases:["Extended_Transverse_Mercator","Extended Transverse Mercator"],parameters:[...Er,...Ho,"approx"],flags:["approx"],create:Lm}});var Ky,zT=p(()=>{Bt();Qe();ut();Vt();kn();$y();Ky={name:"utm",aliases:["Universal Transverse Mercator System"],parameters:["zone","south","approx"],flags:["south","approx"],create(e){let t=re(e.parameters,"zone",NaN);if(!Number.isInteger(t)||t<1||t>60)throw new Error("UTM requires an integer +zone from 1 to 60");let r=Oi(e.parameters,"south"),n=Lm({...e,parameters:{...e.parameters,lat_0:"0",lon_0:String(6*t-183),x_0:"500000",y_0:r?"10000000":"0",k_0:"0.9996"}}),i=(6*t-183)*Math.PI/180;return De(n,Q(i-Math.PI/60,r?-80*Math.PI/180:0,i+Math.PI/60,r?0:84*Math.PI/180),o=>Vl(n.forward,o,i),e.primeMeridian??0,Object.prototype.hasOwnProperty.call(e.parameters,"over"))}}});function Yy(e,t){return[Math.cos(t)*Math.cos(e),Math.cos(t)*Math.sin(e),Math.sin(t)]}function Om(e,t,r,n,i){let o=Math.hypot(e,t);if(!o||Math.abs(r)>o+1e-14)return[];let s=Math.atan2(t,e),a=Math.acos(Math.max(-1,Math.min(1,r/o))),c=[];for(let l of[s-a,s+a])for(let u=Math.ceil((n-l)/(2*Math.PI));u<=Math.floor((i-l)/(2*Math.PI));u++)c.push(l+u*2*Math.PI);return c}function Us(e,t,r,n=!0){let[[i,o],[s,a]]=t,c=(i+s)/2,l=r?[Math.cos(r.latitude),0,Math.sin(r.latitude)]:[1,0,0],u=r?Math.cos(r.distance):-1,h=n?-1/0:1/0,d=[NaN,NaN],m=(y,b)=>{if(y=c+Xt(y-c),y<i-1e-12||y>s+1e-12||b<o-1e-12||b>a+1e-12)return;let w=Yy(y,b);if(r&&Xy(l,w)<u-1e-13)return;let _=Xy(e,w);(n?_>h:_<h)&&(h=_,d=[y,b])},g=[i,s,...Om(-e[1],e[0],0,i,s)];for(let y of g){let b=e[0]*Math.cos(y)+e[1]*Math.sin(y);for(let w of[o,a,...Om(e[2],-b,0,o,a)])m(y,w)}if(r){let[y,,b]=l;for(let v of[o,a])for(let T of Om(y*Math.cos(v),0,u-b*Math.sin(v),i,s))m(T,v);for(let v of[i,s])for(let T of Om(y*Math.cos(v),b,u,o,a))m(v,T);let w=Xy(e,l),_=e.map((v,T)=>v-w*l[T]),S=Math.hypot(..._);if(S<=1e-14&&(_=[-l[2],0,l[0]],S=1),S>1e-14)for(let v of[-1,1]){let T=l.map((O,P)=>O*u+v*_[P]*Math.sin(r.distance)/S);m(Math.atan2(T[1],T[0]),Math.atan2(T[2],Math.hypot(T[0],T[1])))}}if(!Number.isFinite(h))throw new Error("CRS coverage does not intersect the rendering domain");return{value:h,point:d}}function dt(e,t,r){return[Us(e,t,r,!1).value,Us(e,t,r).value]}function js(e,t,r,n,i){let o=dt(e,n,i),s=dt(t,n,i).map(c=>c+r);if(s[0]<=0)throw new Error("Projection rendering denominator is not positive");let a=o.flatMap(c=>s.map(l=>c/l));return[!1,!0].map(c=>{let l=Math.min(...a),u=Math.max(...a);for(let h=0;h<60;h++){let d=(l+u)/2,m=e.map((y,b)=>y-d*t[b]);Us(m,n,i,c).value-d*r>0?l=d:u=d}return c?u:l})}var Xy,dc=p(()=>{Vt();Xy=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]});function Vz(e,t,r,n=Math.PI){let i=[-180,-90,180,90],o=(s,a)=>{let c=Bs(s,e.primeMeridian,e.long0),l=Q(c[0][0]-e.long0,c[0][1],c[1][0]-e.long0,c[1][1]),u=[Math.cos(e.lat0),0,Math.sin(e.lat0)],h=a?Us(u,l,void 0,!1).value:-1,m=!a||h<=Math.cos(n)+1e-13?{latitude:e.lat0,distance:t}:void 0,g=ur(()=>r(l,m),s,e.long0,e.primeMeridian),y=Math.abs(Math.cos(e.lat0))<1e-12,b=(Math.PI/2-t)*180/Math.PI,w=m&&!y&&Cs(_=>{let S=Yy(_.x-e.long0,_.y);if(S[0]*Math.cos(e.lat0)+S[2]*Math.sin(e.lat0)>=Math.cos(m.distance)-1e-14)return;if(Math.hypot(S[0]+u[0],S[1],S[2]+u[2])<1e-12){let T=e.lat0+m.distance,O=(l[0][0]+l[1][0])/2,P=O+Xt((Math.cos(T)<0?Math.PI:0)-O),M=Math.atan2(Math.sin(T),Math.abs(Math.cos(T)));if(P>=l[0][0]&&P<=l[1][0]&&M>=l[0][1]&&M<=l[1][1]){_.x=P+e.long0,_.y=M;return}}let v=Us(S,l,m);[_.x,_.y]=[v.point[0]+e.long0,v.point[1]]},e.primeMeridian);return{get bounds(){return r(l,m)},normalize(_){g.normalize(_),m&&y?_.y=e.lat0>0?Math.max(b,_.y):Math.min(-b,_.y):w==null||w(_);let S=(e.long0+e.primeMeridian)*180/Math.PI,v=_.x-S;Math.abs(v)>180&&(_.x=S+Li(v))}}};return s=>o(s??i,!!s)}function wn(e,t,r,n,i=Math.PI){return{...e,longitudeOrigin:t.long0,getRenderingProfile:Vz(t,r,n,i)}}var zs=p(()=>{Qe();ut();dc();Vt();cc()});function Bm(e,t,r,n){let i=[-Math.sin(e.lat0),0,Math.cos(e.lat0)],o=[Math.cos(e.lat0),0,Math.sin(e.lat0)],s=[0,1,0],a=n==="stere"?1:0,c=u=>n==="ortho"?dt(u,t,r):js(u,o,a,t,r),l=e.a*(n==="stere"?2*e.k0:1);return lt(Ce([e.x0,e.x0],Fe(c(s),l)),Ce([e.y0,e.y0],Fe(c(i),l)))}function qT(e,t,r){let n=Math.sin(e.lat0),i=Math.cos(e.lat0),o=dt([0,0,1],t,r);if(Math.abs(n)<1e-15&&(!r||Math.abs(r.distance-Math.PI/2)<1e-15)){let h=m=>{let g=Us([0,1,0],t,r,m);return g.value/Math.sqrt(1-e.es*Math.sin(g.point[1])**2)},d=m=>(1-e.es)*m/Math.sqrt(1-e.es*m*m);return lt(Ce([e.x0,e.x0],Fe([h(!1),h(!0)],e.a*e.k0)),Ce([e.y0,e.y0],Fe([d(o[0]),d(o[1])],e.a*e.k0)))}let s=o[0]<=0&&o[1]>=0?0:Math.min(o[0]**2,o[1]**2),a=Math.max(o[0]**2,o[1]**2),c=mi(1/Math.sqrt(1-e.es*s),1/Math.sqrt(1-e.es*a)),l=e.a*e.k0,u=e.es*n*i/Math.sqrt(1-e.es*n*n);return lt(Ce([e.x0,e.x0],Fe(Ot(dt([0,1,0],t,r),c),l)),Ce([e.y0+l*u,e.y0+l*u],Fe(Ot(dt([-n,0,(1-e.es)*i],t,r),c),l)))}function VT(e,t,r){let n=dt([Math.cos(e.lat0),0,Math.sin(e.lat0)],t,r)[0],i=e.a/Math.sqrt(1-e.es)*Math.acos(Math.max(-1,Math.min(1,n)));return lt([e.x0-i,e.x0+i],[e.y0-i,e.y0+i])}function WT(e,t,r,n,i,o,s){let a=i&&dt([0,0,1],n,i),c=Q(n[0][0],s(a?Math.asin(Math.max(-1,a[0])):n[0][1]),n[1][0],s(a?Math.asin(Math.min(1,a[1])):n[1][1])),l=i&&{latitude:o,distance:Math.PI-(1-e.es)**2*(Math.PI-i.distance)},u=[Math.cos(o),0,Math.sin(o)],h=[-Math.sin(o),0,Math.cos(o)],d=dt(u,c,l),m=[Math.sqrt(2/(1+Math.min(1,d[1]))),d[0]>-1+1e-14?Math.sqrt(2/(1+d[0])):1/0],g=(y,b)=>{let w=dt(y,c,l),_=w[0]===0?0:w[0]*(w[0]<0?m[1]:m[0]),S=w[1]===0?0:w[1]*(w[1]>0?m[1]:m[0]);return Fe([Math.max(-2,_),Math.min(2,S)],e.a*b)};return lt(Ce([e.x0,e.x0],g([0,1,0],t)),Ce([e.y0,e.y0],g(h,r)))}function Cm(e,t,r,n,i,o,s=1,a=e.e*Math.atanh(e.e)){let c=Q(i[0][0]*s,t(i[0][1]),i[1][0]*s,t(i[1][1])),l=2*a+Math.PI*Math.abs(s-1),u=o&&s===1?Math.min(o.distance+l,Math.PI-(1-e.es)*(Math.PI-o.distance)):o&&o.distance+l,h=u&&u<Math.PI?{latitude:r,distance:u}:void 0,d=[Math.cos(r),0,Math.sin(r)],m=[-Math.sin(r),0,Math.cos(r)],y=c[1][0]-c[0][0]>=2*Math.PI?Q(-Math.PI,c[0][1],Math.PI,c[1][1]):c,b=js([0,1,0],d,1,y,h),w=js(m,d,1,y,h);return lt(Ce([e.x0,e.x0],Fe(b,n)),Ce([e.y0,e.y0],Fe(w,n)))}function HT(e,t,r,n,i,o){let s=[Math.cos(e.lat0),0,Math.sin(e.lat0)],a=[-Math.sin(e.lat0),0,Math.cos(e.lat0)],c=[0,1,0],l=Math.cos(n),u=Math.sin(n),h=Math.cos(r),d=Math.sin(r),m=a.map((_,S)=>l*_+u*c[S]),g=c.map((_,S)=>l*_-u*a[S]),y=s.map((_,S)=>-h*_+d*m[S]),b=js(g,y,h*t,i,o),w=js(m,y,h*t,i,o);return lt(Ce([e.x0,e.x0],Fe(b,e.a*(t-1)*h)),Ce([e.y0,e.y0],Fe(w,e.a*(t-1))))}function $T(e,t,r){let n=dt([Math.cos(e.lat0),0,Math.sin(e.lat0)],t,r)[0],i=Math.acos(Math.max(-1,Math.min(1,n))),o=1-e.es,s=e.a*i/Math.sqrt(o),a=Math.cos(i/o);if(!(a>0))throw new Error("Gnomonic rendering coverage approaches its ellipsoidal horizon");let c=s/a;return lt([e.x0-c,e.x0+c],[e.y0-c,e.y0+c])}var qs=p(()=>{Qe();dc();Bt()});function Ci(e,t,r,n,i,o,s){let a=i*r/s,c=n*t-o*r*e/s,l=n*e+o*r*t/s;return Math.atan2(l,Math.hypot(a,c))}var Cf=p(()=>{});function xn(e,t,r){var n=e*t;return r/Math.sqrt(1-n*n)}var Yl=p(()=>{});function Qr(e,t,r){let n=Math.cos(t);return Math.exp(e*Math.atanh(e*r))*(r>0?n/(1+r):(1-r)/n)}var Df=p(()=>{});function mc(e,t){for(var r=.5*e,n,i,o=F-2*Math.atan(t),s=0;s<=15;s++)if(n=e*Math.sin(o),i=F-2*Math.atan(t*Math.pow((1-n)/(1+n),r))-o,o+=i,Math.abs(i)<=1e-10)return o;return-9999}var Dm=p(()=>{Ct()});function KT(e,t,r){return t*=r,Math.tan(.5*(F+e))*Math.pow((1-t)/(1+t),.5*r)}function Wz(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0,e.coslat0=Math.cos(e.lat0),e.sinlat0=Math.sin(e.lat0),e.sphere?!Number.isNaN(e.lat_ts)&&Math.abs(e.coslat0)<=1e-10&&(e.k0=.5*(1+ks(e.lat0)*Math.sin(e.lat_ts))):(Math.abs(e.coslat0)<=1e-10&&(e.lat0>0?e.con=1:e.con=-1),e.cons=Math.sqrt(Math.pow(1+e.e,1+e.e)*Math.pow(1-e.e,1-e.e)),!Number.isNaN(e.lat_ts)&&Math.abs(e.coslat0)<=1e-10&&Math.abs(Math.cos(e.lat_ts))>1e-10&&(e.k0=.5*e.cons*xn(e.e,Math.sin(e.lat_ts),Math.cos(e.lat_ts))/Qr(e.e,e.con*e.lat_ts,e.con*Math.sin(e.lat_ts))),e.ms1=xn(e.e,e.sinlat0,e.coslat0),e.X0=2*Math.atan(KT(e.lat0,e.sinlat0,e.e))-F,e.cosX0=Math.cos(e.X0),e.sinX0=Math.sin(e.X0))}function XT(e,t){var r=t.x,n=t.y,i=Math.sin(n),o=Math.cos(n),s,a,c,l,u,h,d=k(r-e.long0,e.over);if(Math.abs(Math.abs(r-e.long0)-Math.PI)<=1e-10&&Math.abs(n+e.lat0)<=1e-10)return t.x=NaN,t.y=NaN,t;if(e.sphere&&Math.abs(e.coslat0)<=1e-10){let m=e.lat0>0?1:-1,g=2*e.a*e.k0*Math.tan(Math.PI/4-m*n/2);return t.x=e.x0+g*Math.sin(d),t.y=e.y0-m*g*Math.cos(d),t}return e.sphere?(s=2*e.k0/(1+e.sinlat0*i+e.coslat0*o*Math.cos(d)),t.x=e.a*s*o*Math.sin(d)+e.x0,t.y=e.a*s*(e.coslat0*i-e.sinlat0*o*Math.cos(d))+e.y0,t):(a=2*Math.atan(KT(n,i,e.e))-F,l=Math.cos(a),c=Math.sin(a),Math.abs(e.coslat0)<=1e-10?(u=Qr(e.e,n*e.con,e.con*i),h=2*e.a*e.k0*u/e.cons,t.x=e.x0+h*Math.sin(r-e.long0),t.y=e.y0-e.con*h*Math.cos(r-e.long0),t):(Math.abs(e.sinlat0)<1e-10?(s=2*e.a*e.k0/(1+l*Math.cos(d)),t.y=s*c+e.y0):(s=2*e.a*e.k0*e.ms1/(e.cosX0*(1+e.sinX0*c+e.cosX0*l*Math.cos(d))),t.y=s*(e.cosX0*c-e.sinX0*l*Math.cos(d))+e.y0),t.x=s*l*Math.sin(d)+e.x0,t))}function YT(e,t){t.x-=e.x0,t.y-=e.y0;var r,n,i,o,s,a=Math.sqrt(t.x*t.x+t.y*t.y);if(e.sphere){var c=2*Math.atan(a/(2*e.a*e.k0));return r=e.long0,n=e.lat0,a<=1e-10?(t.x=r,t.y=n,t):(n=Ci(e.sinlat0,e.coslat0,Math.sin(c),Math.cos(c),t.x,t.y,a),Math.abs(e.coslat0)<1e-10?e.lat0>0?r=k(e.long0+Math.atan2(t.x,-1*t.y),e.over):r=k(e.long0+Math.atan2(t.x,t.y),e.over):r=k(e.long0+Math.atan2(t.x*Math.sin(c),a*e.coslat0*Math.cos(c)-t.y*e.sinlat0*Math.sin(c)),e.over),t.x=r,t.y=n,t)}else if(Math.abs(e.coslat0)<=1e-10){if(a<=1e-10)return n=e.lat0,r=e.long0,t.x=r,t.y=n,t;t.x*=e.con,t.y*=e.con,i=a*e.cons/(2*e.a*e.k0),n=e.con*mc(e.e,i),r=e.con*k(e.con*e.long0+Math.atan2(t.x,-1*t.y),e.over)}else o=2*Math.atan(a*e.cosX0/(2*e.a*e.k0*e.ms1)),r=e.long0,a<=1e-10?s=e.X0:(s=Ci(e.sinX0,e.cosX0,Math.sin(o),Math.cos(o),t.x,t.y,a),r=k(e.long0+Math.atan2(t.x*Math.sin(o),a*e.cosX0*Math.cos(o)-t.y*e.sinX0*Math.sin(o)),e.over)),n=-1*mc(e.e,Math.tan(.5*(F+s)));return t.x=r,t.y=n,t}function ZT(e){let t={...e,coslat0:0,sinlat0:0,con:0,cons:0,ms1:0,X0:0,cosX0:0,sinX0:0};return Wz(t),t}var JT=p(()=>{Cf();Ct();Bf();Yl();Df();Dm();_t()});var Zy,QT=p(()=>{zs();qs();kn();JT();Zy={name:"stere",aliases:["Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],parameters:[...Er,...Ho,"lat_ts"],create(e){let t=xr(e),r=ZT(t),n=Fs(t,fr("stere",r,XT,YT));return wn(n,t,150*Math.PI/180,(i,o)=>r.sphere?Bm(r,i,o,"stere"):Cm(r,s=>2*Math.atan(Math.tan(Math.PI/4+s/2)*Math.pow((1-r.e*Math.sin(s))/(1+r.e*Math.sin(s)),r.e/2))-Math.PI/2,r.X0,2*r.a*r.k0*(Math.abs(r.coslat0)<1e-10?1/r.cons:r.ms1/r.cosX0),i,o))}}});var Nf=p(()=>{lT();dT();mT()});var Vs=p(()=>{"use strict";vv();Ev();Av();Iv();Cg();Cg();lE()});function e8(e){return!Xz(e,"ftyp",4)||(e[8]&96)===0?null:Hz(e)}function Hz(e){switch($z(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function $z(e,t,r){return String.fromCharCode(...e.slice(t,r))}function Kz(e){return[...e].map(t=>t.charCodeAt(0))}function Xz(e,t,r=0){let n=Kz(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var t8=p(()=>{"use strict"});function Nm(e){let t=Gf(e);return Zz(t)||eq(t)||Jz(t)||Qz(t)||Yz(t)}function Yz(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=e8(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function Zz(e){let t=Gf(e);return t.byteLength>=33&&t.getUint32(0,Un)===2303741511&&t.getUint32(4,Un)===218765834&&t.getUint32(8,Un)===13&&t.getUint32(12,Un)===1229472850?{mimeType:"image/png",width:t.getUint32(16,Un),height:t.getUint32(20,Un)}:null}function Jz(e){let t=Gf(e);return t.byteLength>=10&&t.getUint32(0,Un)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,Ff),height:t.getUint16(8,Ff)}:null}function Qz(e){let t=Gf(e);return t.byteLength>=14&&t.getUint16(0,Un)===16973&&t.getUint32(2,Ff)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,Ff),height:t.getUint32(22,Ff)}:null}function eq(e){let t=Gf(e);if(!(t.byteLength>=3&&t.getUint16(0,Un)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=tq(),o=2;for(;o+9<t.byteLength;){let s=t.getUint16(o,Un);if(i.has(s))return{mimeType:"image/jpeg",height:t.getUint16(o+5,Un),width:t.getUint16(o+7,Un)};if(!n.has(s))return null;o+=2,o+=t.getUint16(o,Un)}return null}function tq(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Gf(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")}var Un,Ff,Jy=p(()=>{"use strict";t8();Un=!1,Ff=!0});var rq,nq,iq,r8,n8=p(()=>{"use strict";Jy();rq=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],nq=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],iq={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:nq,extensions:rq,tests:[e=>!!Nm(new DataView(e))]},r8={...iq,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var Zl,Fm=p(()=>{"use strict";Zl="5.0.0-beta.4"});function Jl(e){if(!e)return!1;if(oq.test(e))return!0;for(let t=e.indexOf(".svg");t>=0;t=e.indexOf(".svg",t+4)){let r=e[t+4];if(r===void 0||r==="?"||r==="#")return!0}return!1}function i8(e,t){if(Jl(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Qy(e,t)}function Qy(e,t){if(Jl(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}var oq,Gm=p(()=>{"use strict";oq=/^data:image\/svg\+xml/});async function o8(e,t,r){let n=i8(e,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await sq(o||n,t)}finally{o&&i.revokeObjectURL(o)}}async function sq(e,t){var n;let r=new Image;return r.src=e,(n=t==null?void 0:t.image)!=null&&n.decode&&r.decode?(await r.decode(),r):await new Promise((i,o)=>{try{r.onload=()=>i(r),r.onerror=s=>{let a=s instanceof Error?s.message:"error";o(new Error(a))}}catch(s){o(s)}})}var s8=p(()=>{"use strict";Gm()});async function c8(e,t,r){let n;Jl(r)?n=await o8(e,t,r):n=Qy(e,r);let i=t&&t.imagebitmap;return await u8(n,i)}async function l8(e,t){let r=t&&t.imagebitmap;return await u8(e,r)}async function u8(e,t=null){if((aq(t)||!a8)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),a8=!1}return await createImageBitmap(e)}function aq(e){if(!e)return!0;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}var a8,f8=p(()=>{"use strict";Gm();s8();a8=!0});async function h8(e,t){var s,a;let{mimeType:r}=Nm(e)||{},n=(s=globalThis.loaders)==null?void 0:s.parseImageNode;Rl(n);let i=(a=globalThis.loaders)==null?void 0:a.createImageBitmapNode;if(!i)throw new Error("Install '@loaders.gl/core/polyfills' to parse images under Node.js");let o=await n(e,r);return i(o)}var d8=p(()=>{"use strict";Vs();Jy()});async function e2(e,t,r){var i;t=t||{},g8(t);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!Xd||n)return await h8(e,t);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(m8);return await c8(e,t,r==null?void 0:r.url)}async function p8(e,t,r){var i;t=t||{},g8(t);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!Xd||n||Jl(r==null?void 0:r.url)||e.type.startsWith("image/svg+xml"))return await e2(await e.arrayBuffer(),t,r);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(m8);return await l8(e,t)}function g8(e){var r;let t=(r=e.image)==null?void 0:r.type;if(t&&t!=="imagebitmap")throw new Error(cq)}var cq,m8,y8=p(()=>{"use strict";Vs();f8();Gm();d8();cq="@loaders.gl/images: ImageLoader only accepts options.image.type='imagebitmap'. Remove legacy image/data/auto values and call getImageData(image) if you need raw pixels.",m8="@loaders.gl/images: ImageLoader requires browser ImageBitmap support. Use a browser with createImageBitmap support or load images under Node.js with @loaders.gl/core/polyfills."});var b8={};Jt(b8,{ImageLoaderWithParser:()=>uq});var xoe,lq,uq,w8=p(()=>{"use strict";y8();t2();({preload:xoe,...lq}=$o),uq={...lq,parse:e2,parseBlob:p8}});async function hq(){let{ImageLoaderWithParser:e}=await Promise.resolve().then(()=>(w8(),b8));return e}var fq,$o,t2=p(()=>{"use strict";Fm();n8();fq={image:{}};$o={dataType:null,batchType:null,...r8,version:Zl,options:fq,preload:hq}});function _8(e){let t=gq(e);if(!t)throw new Error("Not an image");return t}function km(e){switch(_8(e)){case"data":return e;case"imagebitmap":return dq(e)?mq(e):x8(e);case"image":return x8(e);default:throw new Error("getImageData")}}function dq(e){var r;let t=(r=globalThis.loaders)==null?void 0:r.isImageBitmapNode;return!!(t!=null&&t(e))}function mq(e){var r;let t=(r=globalThis.loaders)==null?void 0:r.getImageBitmapDataNode;if(!t)throw new Error("getImageData");return t(e)}function x8(e){let t=pq(e.width,e.height),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height)}function pq(e,t){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(e,t);if(typeof document<"u"){let r=document.createElement("canvas");return r.width=e,r.height=t,r}throw new Error("getImageData")}function gq(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 S8=p(()=>{"use strict"});var M8,v8,r2=p(()=>{"use strict";M8={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]},v8={name:"Texture Containers",id:"compressed-texture",module:"images",encoding:"image",format:"compressed-texture",extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0}});function T8(e){if(!Um){e=e||bq()||void 0,Um=new Set;for(let t of yq)for(let r in E8)if(e&&e.getExtension(`${t}${r}`))for(let n of E8[r])Um.add(n)}return Um}function bq(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var yq,E8,Um,A8=p(()=>{"use strict";yq=["","WEBKIT_","MOZ_"],E8={WEBGL_compressed_texture_s3tc:["bc1-rgb-unorm-webgl","bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"],WEBGL_compressed_texture_s3tc_srgb:["bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"],EXT_texture_compression_rgtc:["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"],EXT_texture_compression_bptc:["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"],WEBGL_compressed_texture_etc1:["etc1-rgb-unorm-webgl"],WEBGL_compressed_texture_etc:["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"],WEBGL_compressed_texture_pvrtc:["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"],WEBGL_compressed_texture_atc:["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"],WEBGL_compressed_texture_astc:["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]},Um=null});function P8(e=T8(),t,r={}){let n=new Set(e);if(!t)return xq(n);if(t.isHDR){let i=I8(t);return r.astcHDR&&(i==="astc-4x4"||i==="astc-6x6")&&jm(n,i.slice(5))?i==="astc-4x4"?"astc-hdr-4x4":"astc-hdr-6x6":n.has("bc6h-rgb-ufloat")?"bc6h":"rgba16f"}if(t.codec==="xubc7")return i2(n)?"bc7":"rgba32";if(t.codec.startsWith("xuastc-ldr-")||t.codec.startsWith("astc-ldr-")){let i=I8(t);return i&&jm(n,i.slice(5))?i:n2(n,t,["bc7","bc","etc2","atc"])}return t.codec==="uastc-ldr-4x4"?jm(n,"4x4")?"astc-4x4":n2(n,t,["bc7","bc","etc2","etc1","pvrtc","atc"]):n2(n,t,["etc2","etc1","bc7","bc","pvrtc","atc"])}function xq(e){return jm(e,"4x4")?"astc-4x4":i2(e)?"bc7":R8(e)?{alpha:"bc3",noAlpha:"bc1"}:L8(e)?"etc2":e.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:O8(e)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:B8(e)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function n2(e,t,r){for(let n of r)switch(n){case"bc7":if(i2(e))return"bc7";break;case"bc":if(R8(e))return t.hasAlpha?"bc3":"bc1";break;case"etc2":if(L8(e))return"etc2";break;case"etc1":if(!t.hasAlpha&&e.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(O8(e))return t.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(B8(e))return t.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return t.hasAlpha?"rgba32":"rgb565"}function I8(e){let t=`${e.blockWidth}x${e.blockHeight}`;return wq.includes(t)?`astc-${t}`:null}function jm(e,t){return Ql(e,[`astc-${t}-unorm`,`astc-${t}-unorm-srgb`])}function i2(e){return Ql(e,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function R8(e){return Ql(e,["bc1-rgb-unorm-webgl","bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb"])}function L8(e){return Ql(e,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function O8(e){return Ql(e,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function B8(e){return Ql(e,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function Ql(e,t){return t.some(r=>e.has(r))}var wq,C8=p(()=>{"use strict";A8();wq=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function F8(e){Og(e.modules);let t=Bg("basis");return t||(N8||=_q(e),await N8)}async function _q(e){let t=null,r=null;return[t,r]=await Promise.all([await Cl(D8.TRANSCODER,"images",e,null,"basis_transcoder.mjs"),await Cl(D8.TRANSCODER_WASM,"images",e)]),t=t||globalThis.BASIS,await Sq(t,r)}function Sq(e,t){let r={};return t&&(r.wasmBinary=t),Ll(()=>e(r),n=>{let{BasisFile:i,KTX2File:o,getBasisTexFormatBlockHeight:s,getBasisTexFormatBlockWidth:a,initializeBasis:c,isFormatSupported:l}=n;return c(),{BasisFile:i,KTX2File:o,getBasisTexFormatBlockHeight:s,getBasisTexFormatBlockWidth:a,isFormatSupported:l}})}var D8,N8,G8=p(()=>{"use strict";Vs();ic();D8={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function Vm(e){if(e!==void 0)return uA[e]}function fA(e){if(e!==void 0)return Uq[e]}var uA,Uq,y2=p(()=>{"use strict";uA={34836:"rgba32float",33776:"bc1-rgb-unorm-webgl",35916:"bc1-rgb-unorm-srgb-webgl",33777:"bc1-rgba-unorm",35917:"bc1-rgba-unorm-srgb",33778:"bc2-rgba-unorm",35918:"bc2-rgba-unorm-srgb",33779:"bc3-rgba-unorm",35919:"bc3-rgba-unorm-srgb",36283:"bc4-r-unorm",36284:"bc4-r-snorm",36285:"bc5-rg-unorm",36286:"bc5-rg-snorm",37492:"etc2-rgb8unorm",37494:"etc2-rgb8unorm-srgb",37496:"etc2-rgb8a1unorm",37497:"etc2-rgb8a1unorm-srgb",37493:"etc2-rgba8unorm",37495:"etc2-rgba8unorm-srgb",37488:"eac-r11unorm",37489:"eac-r11snorm",37490:"eac-rg11unorm",37491:"eac-rg11snorm",37808:"astc-4x4-unorm",37840:"astc-4x4-unorm-srgb",37809:"astc-5x4-unorm",37841:"astc-5x4-unorm-srgb",37810:"astc-5x5-unorm",37842:"astc-5x5-unorm-srgb",37811:"astc-6x5-unorm",37843:"astc-6x5-unorm-srgb",37812:"astc-6x6-unorm",37844:"astc-6x6-unorm-srgb",37813:"astc-8x5-unorm",37845:"astc-8x5-unorm-srgb",37814:"astc-8x6-unorm",37846:"astc-8x6-unorm-srgb",37815:"astc-8x8-unorm",37847:"astc-8x8-unorm-srgb",37816:"astc-10x5-unorm",37848:"astc-10x5-unorm-srgb",37817:"astc-10x6-unorm",37849:"astc-10x6-unorm-srgb",37818:"astc-10x8-unorm",37850:"astc-10x8-unorm-srgb",37819:"astc-10x10-unorm",37851:"astc-10x10-unorm-srgb",37820:"astc-12x10-unorm",37852:"astc-12x10-unorm-srgb",37821:"astc-12x12-unorm",37853:"astc-12x12-unorm-srgb",35840:"pvrtc-rgb4unorm-webgl",35842:"pvrtc-rgba4unorm-webgl",35841:"pvrtc-rgb2unorm-webgl",35843:"pvrtc-rgba2unorm-webgl",36196:"etc1-rgb-unorm-webgl",35986:"atc-rgb-unorm-webgl",35987:"atc-rgba-unorm-webgl",34798:"atc-rgbai-unorm-webgl"},Uq=Object.fromEntries(Object.entries(uA).map(([e,t])=>[t,Number(e)]))});function eu(e,t){let r=new Array(t.mipMapLevels),n=t.textureFormat||Vm(t.internalFormat),i=t.internalFormat||fA(t.textureFormat),o=t.width,s=t.height,a=0;for(let c=0;c<t.mipMapLevels;++c){let l=zq(t,o,s,e,c),h={shape:"texture-level",compressed:!0,data:jq(e,c,a,l),width:o,height:s,levelSize:l};i!==void 0&&(h.format=i),n&&(h.textureFormat=n),r[c]=h,o=Math.max(1,o>>1),s=Math.max(1,s>>1),a+=l}return r}function jq(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function zq(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var Wm=p(()=>{"use strict";y2()});function Vq(e){return qq[e]}function hA(e){return Vm(Vq(e))}var qq,dA=p(()=>{"use strict";y2();qq={131:33776,132:35916,133:33777,134:35917,135:33778,136:35918,137:33779,138:35919,139:36283,140:36284,141:36285,142:36286,147:37492,148:37494,149:37496,150:37497,151:37493,152:37495,153:37488,154:37489,155:37490,156:37491,157:37808,158:37840,159:37809,160:37841,161:37810,162:37842,163:37811,164:37843,165:37812,166:37844,167:37813,168:37845,169:37814,170:37846,171:37815,172:37847,173:37816,174:37848,175:37817,176:37849,177:37818,178:37850,179:37819,180:37851,181:37820,182:37852,183:37821,184:37853,1000054e3:35843,1000054001:35842,1000066e3:37808,1000066001:37809,1000066002:37810,1000066003:37811,1000066004:37812,1000066005:37813,1000066006:37814,1000066007:37815,1000066008:37816,1000066009:37817,1000066010:37818,1000066011:37819,1000066012:37820,1000066013:37821}});function Ws(e){if(e.byteLength<b2.byteLength)return!1;let t=new Uint8Array(e,0,b2.byteLength);return b2.every((r,n)=>t[n]===r)}function pA(e){let t=S2(e);if(t.pixelDepth>0)throw new Error("CompressedTextureLoader does not support 3D KTX2 textures");if(t.supercompressionScheme!==Wq)throw new Error(`KTX2 supercompression scheme ${t.supercompressionScheme} requires BasisLoader`);if(t.vkFormat===0)throw new Error("KTX2 vkFormat is undefined; decode this texture with BasisLoader");let r=hA(t.vkFormat);if(!r)throw new Error(`Unsupported KTX2 Vulkan format ${t.vkFormat}`);return eu(t.levels,{mipMapLevels:t.levelCount,width:t.pixelWidth,height:Math.max(1,t.pixelHeight),sizeFunction:n=>n.uncompressedByteLength,textureFormat:r})}function S2(e){if(!Ws(e))throw new Error("Invalid KTX2 identifier");if(e.byteLength<w2)throw new Error("Truncated KTX2 header");let t=new DataView(e),r=Math.max(1,t.getUint32(40,!0)),n=Hq(r,mA,"KTX2 level index");_2(w2,n,e.byteLength,"KTX2 level index");let i={vkFormat:t.getUint32(12,!0),pixelWidth:t.getUint32(20,!0),pixelHeight:t.getUint32(24,!0),pixelDepth:t.getUint32(28,!0),layerCount:t.getUint32(32,!0),faceCount:t.getUint32(36,!0),levelCount:r,supercompressionScheme:t.getUint32(44,!0),levels:[]};if(i.pixelWidth===0)throw new Error("KTX2 texture width must be non-zero");if(i.faceCount!==1&&i.faceCount!==6)throw new Error(`Invalid KTX2 face count ${i.faceCount}`);x2(t.getUint32(48,!0),t.getUint32(52,!0),e.byteLength,"KTX2 data format descriptor"),x2(t.getUint32(56,!0),t.getUint32(60,!0),e.byteLength,"KTX2 key/value data"),x2(kf(t,64,"KTX2 supercompression global data offset"),kf(t,72,"KTX2 supercompression global data length"),e.byteLength,"KTX2 supercompression global data");for(let o=0;o<r;o++){let s=w2+o*mA,a=kf(t,s,`KTX2 level ${o} offset`),c=kf(t,s+8,`KTX2 level ${o} length`),l=kf(t,s+16,`KTX2 level ${o} uncompressed length`);_2(a,c,e.byteLength,`KTX2 level ${o}`),i.levels.push({levelData:new Uint8Array(e,a,c),uncompressedByteLength:l})}return i}function kf(e,t,r){let n=e.getUint32(t,!0),o=e.getUint32(t+4,!0)*4294967296+n;if(!Number.isSafeInteger(o))throw new Error(`${r} exceeds JavaScript's safe integer range`);return o}function Hq(e,t,r){let n=e*t;if(!Number.isSafeInteger(n))throw new Error(`${r} size exceeds JavaScript's safe integer range`);return n}function x2(e,t,r,n){t>0&&_2(e,t,r,n)}function _2(e,t,r,n){if(!Number.isSafeInteger(e)||!Number.isSafeInteger(t)||e<0||t<0)throw new Error(`${n} has an invalid byte range`);let i=e+t;if(!Number.isSafeInteger(i)||i>r)throw new Error(`${n} is outside the KTX2 container`)}var b2,w2,mA,Wq,Hm=p(()=>{"use strict";Wm();dA();b2=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10]),w2=80,mA=24,Wq=0});async function Kq(e){let t=gA,r;gA=new Promise(n=>{r=n}),await t;try{return await e()}finally{r()}}async function $m(e,t={}){return await Kq(async()=>{var o;let r=await F8(nc(t)),n=((o=t.basis)==null?void 0:o.containerFormat)||"auto";if(n==="ktx2"||n==="auto"&&Ws(e)){if(!r.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return Yq(r,e,t)}return Xq(r,e,t)})}function Xq(e,t,r){let n=new e.BasisFile(new Uint8Array(t));try{let i=wA(n,!1);if(!n.startTranscoding())throw new Error("Failed to start Basis transcoding");let o=[];for(let s=0;s<n.getNumImages();s++){let a=[];for(let c=0;c<n.getNumLevels(s);c++){let l=n.getImageWidth(s,c),u=n.getImageHeight(s,c);a.push(bA(n,i,l,u,r,h=>n.getImageTranscodedSizeInBytes(s,c,h),(h,d)=>n.transcodeImage(h,s,c,d,0,0)))}o.push(a)}return o}finally{n.close(),n.delete()}}function Yq(e,t,r){let n=new e.KTX2File(new Uint8Array(t));try{if(!n.isValid())throw new Error("Invalid KTX2 texture");if(n.getHeader().pixelDepth>0)throw new Error("BasisLoader does not support 3D KTX2 textures");let o=wA(n,!0);if(!n.startTranscoding())throw new Error("Failed to start KTX2 transcoding");let s=Math.max(1,n.getLayers()),a=Math.max(1,n.getFaces()),c=[];for(let l=0;l<s;l++)for(let u=0;u<a;u++){let h=[];for(let d=0;d<n.getLevels();d++){let m=n.getImageLevelInfo(d,l,u);h.push(bA(n,{...o,hasAlpha:!!m.alphaFlag},m.width,m.height,r,g=>n.getImageTranscodedSizeInBytes(d,l,u,g),(g,y)=>n.transcodeImage(g,d,l,u,y,0,-1,-1)))}c.push(h)}return c}finally{n.close(),n.delete()}}function bA(e,t,r,n,i,o,s){let a=Jq(i,t);Zq(t,M2(i,t));let c=o(a.basisFormat),l=eV(c,a.dataType);if(!s(l,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${M2(i,t)}`);let u=t.isSRGB&&a.srgbTextureFormat;return{shape:"texture-level",width:r,height:n,data:l,compressed:a.compressed,format:u&&a.srgbFormat||a.format,textureFormat:u?a.srgbTextureFormat:a.textureFormat,levelSize:c,hasAlpha:t.hasAlpha}}function Zq(e,t){let r=t==="bc6h"||t==="rgba16f"||t==="rgb9e5"||t.startsWith("astc-hdr-");if(e.isHDR!==r)throw new Error(`Basis source codec ${e.codec} cannot be transcoded to ${t}`);if(e.codec==="xubc7"&&t!=="bc7"&&t!=="rgba32")throw new Error(`Basis source codec ${e.codec} cannot be transcoded to ${t}`)}function Jq(e,t){let r=M2(e,t),n=yA[r];if(!n)throw new Error(`Unknown Basis format ${r}`);return n}function M2(e,t){var n,i,o;let r=((n=e.basis)==null?void 0:n.format)||"auto";return r==="auto"&&(r=P8((i=e.basis)==null?void 0:i.supportedTextureFormats,t,(o=e.basis)==null?void 0:o.supportedTextureFeatures)),typeof r=="object"&&(r=t.hasAlpha?r.alpha:r.noAlpha),r.toLowerCase()}function wA(e,t){let r=e.getBasisTexFormat(),n=Qq[r];if(!n)throw new Error(`Unsupported Basis source texture format ${r}`);return{codec:n,isHDR:!!e.isHDR(),isSRGB:t?!!e.isSRGB():!1,hasAlpha:!!e.getHasAlpha(),blockWidth:e.getBlockWidth(),blockHeight:e.getBlockHeight()}}function eV(e,t){return t==="uint16"?new Uint16Array(e/Uint16Array.BYTES_PER_ELEMENT):t==="uint32"?new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function Tr(e,t,r){return{basisFormat:e,compressed:!0,format:t,textureFormat:r}}function tu(e,t,r,n,i){return{basisFormat:e,compressed:!1,format:t,textureFormat:r,srgbFormat:n,srgbTextureFormat:i}}function Sn(e,t,r,n){return{...Tr(e,t,`astc-${n}-unorm`),srgbFormat:r,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var _n,yA,rse,gA,Qq,v2=p(()=>{"use strict";ic();C8();G8();Hm();_n={"4x4":Sn(10,37808,37840,"4x4"),"5x4":Sn(28,37809,37841,"5x4"),"5x5":Sn(29,37810,37842,"5x5"),"6x5":Sn(30,37811,37843,"6x5"),"6x6":Sn(31,37812,37844,"6x6"),"8x5":Sn(32,37813,37845,"8x5"),"8x6":Sn(33,37814,37846,"8x6"),"8x8":Sn(36,37815,37847,"8x8"),"10x5":Sn(34,37816,37848,"10x5"),"10x6":Sn(35,37817,37849,"10x6"),"10x8":Sn(37,37818,37850,"10x8"),"10x10":Sn(38,37819,37851,"10x10"),"12x10":Sn(39,37820,37852,"12x10"),"12x12":Sn(40,37821,37853,"12x12")},yA={etc1:Tr(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...Tr(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...Tr(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...Tr(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:Tr(4,36283,"bc4-r-unorm"),bc5:Tr(5,36285,"bc5-rg-unorm"),bc7:{...Tr(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":Tr(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":Tr(9,35842,"pvrtc-rgba4unorm-webgl"),"astc-4x4":_n["4x4"],"astc-5x4":_n["5x4"],"astc-5x5":_n["5x5"],"astc-6x5":_n["6x5"],"astc-6x6":_n["6x6"],"astc-8x5":_n["8x5"],"astc-8x6":_n["8x6"],"astc-8x8":_n["8x8"],"astc-10x5":_n["10x5"],"astc-10x6":_n["10x6"],"astc-10x8":_n["10x8"],"astc-10x10":_n["10x10"],"astc-12x10":_n["12x10"],"astc-12x12":_n["12x12"],"atc-rgb":Tr(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":Tr(12,34798,"atc-rgbai-unorm-webgl"),rgba32:tu(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:tu(14,36194,"rgb565unorm-webgl"),bgr565:tu(15,36194,"rgb565unorm-webgl"),rgba4444:tu(16,32854,"rgba4unorm-webgl"),"eac-r11":Tr(20,37488,"eac-r11unorm"),"eac-rg11":Tr(21,37490,"eac-rg11unorm"),bc6h:Tr(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":Tr(23,37808,"astc-4x4-unorm"),rgba16f:{...tu(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...tu(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":Tr(27,37812,"astc-6x6-unorm")},rse=Object.freeze(Object.keys(yA)),gA=Promise.resolve();Qq={0:"etc1s",1:"uastc-ldr-4x4",2:"uastc-hdr-4x4",3:"astc-hdr-6x6",4:"uastc-hdr-6x6",5:"xuastc-ldr-4x4",6:"xuastc-ldr-5x4",7:"xuastc-ldr-5x5",8:"xuastc-ldr-6x5",9:"xuastc-ldr-6x6",10:"xuastc-ldr-8x5",11:"xuastc-ldr-8x6",12:"xuastc-ldr-10x5",13:"xuastc-ldr-10x6",14:"xuastc-ldr-8x8",15:"xuastc-ldr-10x8",16:"xuastc-ldr-10x10",17:"xuastc-ldr-12x10",18:"xuastc-ldr-12x12",19:"astc-ldr-4x4",20:"astc-ldr-5x4",21:"astc-ldr-5x5",22:"astc-ldr-6x5",23:"astc-ldr-6x6",24:"astc-ldr-8x5",25:"astc-ldr-8x6",26:"astc-ldr-10x5",27:"astc-ldr-10x6",28:"astc-ldr-8x8",29:"astc-ldr-10x8",30:"astc-ldr-10x10",31:"astc-ldr-12x10",32:"astc-ldr-12x12",33:"xubc7"}});var xA={};Jt(xA,{BasisLoaderWithParser:()=>iV,BasisWorkerLoaderWithParser:()=>nV});var ase,tV,cse,rV,nV,iV,_A=p(()=>{"use strict";v2();Km();Km();({preload:ase,...tV}=ho),{preload:cse,...rV}=ho,nV={...tV},iV={...rV,parse:$m}});async function oV(){let{BasisLoaderWithParser:e}=await Promise.resolve().then(()=>(_A(),xA));return e}var ho,Km=p(()=>{"use strict";r2();Fm();ho={...M8,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:Zl,worker:!0,workerNode:"basis-worker-node.cjs",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",containerFormat:"auto"}},preload:oV}});function SA(e){return new Uint32Array(e,0,jn.HEADER_LENGTH)[jn.MAGIC_NUMBER_INDEX]===jn.MAGIC_NUMBER}function MA(e){let t=new Int32Array(e,0,jn.HEADER_LENGTH),r=t[jn.HEADER_PF_FOURCC_INDEX];Rl(!!(t[jn.HEADER_PF_FLAGS_INDEX]&jn.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=fV(r),i=sV[n],o=uV[n];Rl(i&&o,`DDS: Unknown pixel format ${r}`);let s=1;t[jn.HEADER_FLAGS_INDEX]&jn.DDSD_MIPMAPCOUNT&&(s=Math.max(1,t[jn.MIPMAPCOUNT_INDEX]));let a=t[jn.HEADER_WIDTH_INDEX],c=t[jn.HEADER_HEIGHT_INDEX],l=t[jn.HEADER_SIZE_INDEX]+4,u=new Uint8Array(e,l);return eu(u,{mipMapLevels:s,width:a,height:c,sizeFunction:o,textureFormat:i})}function vA(e,t){return(e+3>>2)*(t+3>>2)*8}function Xm(e,t){return(e+3>>2)*(t+3>>2)*16}function fV(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var jn,sV,aV,cV,lV,uV,EA=p(()=>{"use strict";Vs();Wm();jn={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},sV={DXT1:"bc1-rgb-unorm-webgl",DXT3:"bc2-rgba-unorm",DXT5:"bc3-rgba-unorm","ATC ":"atc-rgb-unorm-webgl",ATCA:"atc-rgba-unorm-webgl",ATCI:"atc-rgbai-unorm-webgl"},aV=vA,cV=Xm,lV=Xm,uV={DXT1:vA,DXT3:Xm,DXT5:Xm,"ATC ":aV,ATCA:cV,ATCI:lV}});function IA(e){let r=new Uint32Array(e,0,gi.HEADER_LENGTH)[gi.MAGIC_NUMBER_INDEX];return r===gi.MAGIC_NUMBER||r===gi.MAGIC_NUMBER_EXTRA}function PA(e){let t=new Uint32Array(e,0,gi.HEADER_LENGTH),r=t[gi.PIXEL_FORMAT_INDEX],n=t[gi.COLOUR_SPACE_INDEX],i=hV[r]||[],o=i.length>1&&n?i[1]:i[0],s=dV[r],a=t[gi.MIPMAPCOUNT_INDEX],c=t[gi.WIDTH_INDEX],l=t[gi.HEIGHT_INDEX],u=gi.HEADER_SIZE+t[gi.METADATA_SIZE_INDEX],h=new Uint8Array(e,u);return eu(h,{mipMapLevels:a,width:c,height:l,sizeFunction:s,textureFormat:o})}function TA(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function AA(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function Uf(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function jf(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function mV(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function pV(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function gV(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function yV(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function bV(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function wV(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function xV(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function _V(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function SV(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function MV(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function vV(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function EV(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function TV(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}var gi,hV,dV,RA=p(()=>{"use strict";Wm();gi={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},hV={0:["pvrtc-rgb2unorm-webgl"],1:["pvrtc-rgba2unorm-webgl"],2:["pvrtc-rgb4unorm-webgl"],3:["pvrtc-rgba4unorm-webgl"],6:["etc1-rgb-unorm-webgl"],7:["bc1-rgb-unorm-webgl"],9:["bc2-rgba-unorm"],11:["bc3-rgba-unorm"],22:["etc2-rgb8unorm"],23:["etc2-rgba8unorm"],24:["etc2-rgb8a1unorm"],25:["eac-r11unorm"],26:["eac-rg11unorm"],27:["astc-4x4-unorm","astc-4x4-unorm-srgb"],28:["astc-5x4-unorm","astc-5x4-unorm-srgb"],29:["astc-5x5-unorm","astc-5x5-unorm-srgb"],30:["astc-6x5-unorm","astc-6x5-unorm-srgb"],31:["astc-6x6-unorm","astc-6x6-unorm-srgb"],32:["astc-8x5-unorm","astc-8x5-unorm-srgb"],33:["astc-8x6-unorm","astc-8x6-unorm-srgb"],34:["astc-8x8-unorm","astc-8x8-unorm-srgb"],35:["astc-10x5-unorm","astc-10x5-unorm-srgb"],36:["astc-10x6-unorm","astc-10x6-unorm-srgb"],37:["astc-10x8-unorm","astc-10x8-unorm-srgb"],38:["astc-10x10-unorm","astc-10x10-unorm-srgb"],39:["astc-12x10-unorm","astc-12x10-unorm-srgb"],40:["astc-12x12-unorm","astc-12x12-unorm-srgb"]},dV={0:TA,1:TA,2:AA,3:AA,6:Uf,7:Uf,9:jf,11:jf,22:Uf,23:jf,24:Uf,25:Uf,26:jf,27:jf,28:mV,29:pV,30:gV,31:yV,32:bV,33:wV,34:xV,35:_V,36:SV,37:MV,38:vV,39:EV,40:TV}});function E2(e){if(Ws(e))return pA(e);if(SA(e))return MA(e);if(IA(e))return PA(e);throw new Error("Texture container format not recognized")}var LA=p(()=>{"use strict";Hm();EA();RA()});var OA={};Jt(OA,{CompressedTextureLoaderWithParser:()=>RV,CompressedTextureWorkerLoaderWithParser:()=>PV});var Tse,AV,Ase,IV,PV,RV,BA=p(()=>{"use strict";LA();v2();Hm();Ym();Ym();({preload:Tse,...AV}=Ko),{preload:Ase,...IV}=Ko,PV={...AV},RV={...IV,parse:async(e,t)=>{var r,n;if(t={...t},(r=t==null?void 0:t["compressed-texture"])!=null&&r.useBasis||Ws(e)){let i=Ws(e)?S2(e):null;return!((n=t==null?void 0:t["compressed-texture"])!=null&&n.useBasis||(i==null?void 0:i.supercompressionScheme)!==0||(i==null?void 0:i.vkFormat)===0)?E2(e):(t.basis={...t.basis,containerFormat:"ktx2"},(await $m(e,t))[0])}return E2(e)}}});async function LV(){let{CompressedTextureLoaderWithParser:e}=await Promise.resolve().then(()=>(BA(),OA));return e}var Ko,Ym=p(()=>{"use strict";r2();Fm();Ko={...v8,dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"images",version:Zl,worker:!0,encoding:"image",format:"compressed-texture",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":{useBasis:!1},basis:{format:"auto",containerFormat:"auto"}},preload:LV}});var zf=p(()=>{"use strict";t2();S8();Km();Ym()});var CA=p(()=>{"use strict"});function NA(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function H(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(h){s(h)}}function c(u){try{l(n.throw(u))}catch(h){s(h)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})}function DA(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Me(e){return this instanceof Me?(this.v=e,this):new Me(e)}function en(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(m){return function(g){return Promise.resolve(g).then(m,h)}}function a(m,g){n[m]&&(i[m]=function(y){return new Promise(function(b,w){o.push([m,y,b,w])>1||c(m,y)})},g&&(i[m]=g(i[m])))}function c(m,g){try{l(n[m](g))}catch(y){d(o[0][3],y)}}function l(m){m.value instanceof Me?Promise.resolve(m.value.v).then(u,h):d(o[0][2],m)}function u(m){c("next",m)}function h(m){c("throw",m)}function d(m,g){m(g),o.shift(),o.length&&c(o[0][0],o[0][1])}}function ru(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(s){return(r=!r)?{value:Me(e[i](s)),done:!1}:o?o(s):s}:o}}function zn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof DA=="function"?DA(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),i(a,c,s.done,s.value)})}}function i(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}var Ar=p(()=>{});var FA,nu,OV,qn,Xo=p(()=>{FA=new TextDecoder("utf-8"),nu=FA.decode.bind(FA),OV=new TextEncoder,qn=e=>OV.encode(e)});var BV,GA,hr,tn,Vn,Wn,Mn,Zm,Jm,Qm,ep,tp,kA,qf,UA,rp,jA,Yo=p(()=>{BV=e=>typeof e=="number",GA=e=>typeof e=="boolean",hr=e=>typeof e=="function",tn=e=>e!=null&&Object(e)===e,Vn=e=>tn(e)&&hr(e.then),Wn=e=>tn(e)&&hr(e[Symbol.iterator]),Mn=e=>tn(e)&&hr(e[Symbol.asyncIterator]),Zm=e=>tn(e)&&tn(e.schema),Jm=e=>tn(e)&&"done"in e&&"value"in e,Qm=e=>tn(e)&&hr(e.stat)&&BV(e.fd),ep=e=>tn(e)&&qf(e.body),tp=e=>"_getDOMStream"in e&&"_getNodeStream"in e,kA=e=>tn(e)&&hr(e.abort)&&hr(e.getWriter)&&!tp(e),qf=e=>tn(e)&&hr(e.cancel)&&hr(e.getReader)&&!tp(e),UA=e=>tn(e)&&hr(e.end)&&hr(e.write)&&GA(e.writable)&&!tp(e),rp=e=>tn(e)&&hr(e.read)&&hr(e.pipe)&&GA(e.readable)&&!tp(e),jA=e=>tn(e)&&hr(e.clear)&&hr(e.bytes)&&hr(e.position)&&hr(e.setPosition)&&hr(e.capacity)&&hr(e.getBufferIdentifier)&&hr(e.createLong)});var L2={};Jt(L2,{compareArrayLike:()=>R2,joinUint8Arrays:()=>Hn,memcpy:()=>Vf,rebaseValueOffsets:()=>np,toArrayBufferView:()=>Re,toArrayBufferViewAsyncIterator:()=>Di,toArrayBufferViewIterator:()=>mo,toBigInt64Array:()=>Wf,toBigUint64Array:()=>kV,toFloat32Array:()=>UV,toFloat32ArrayAsyncIterator:()=>rW,toFloat32ArrayIterator:()=>KV,toFloat64Array:()=>jV,toFloat64ArrayAsyncIterator:()=>nW,toFloat64ArrayIterator:()=>XV,toInt16Array:()=>NV,toInt16ArrayAsyncIterator:()=>JV,toInt16ArrayIterator:()=>VV,toInt32Array:()=>pc,toInt32ArrayAsyncIterator:()=>QV,toInt32ArrayIterator:()=>WV,toInt8Array:()=>DV,toInt8ArrayAsyncIterator:()=>ZV,toInt8ArrayIterator:()=>qV,toUint16Array:()=>FV,toUint16ArrayAsyncIterator:()=>eW,toUint16ArrayIterator:()=>HV,toUint32Array:()=>GV,toUint32ArrayAsyncIterator:()=>tW,toUint32ArrayIterator:()=>$V,toUint8Array:()=>se,toUint8ArrayAsyncIterator:()=>P2,toUint8ArrayIterator:()=>I2,toUint8ClampedArray:()=>zV,toUint8ClampedArrayAsyncIterator:()=>iW,toUint8ClampedArrayIterator:()=>YV});function CV(e){let t=e[0]?[e[0]]:[],r,n,i,o;for(let s,a,c=0,l=0,u=e.length;++c<u;){if(s=t[l],a=e[c],!s||!a||s.buffer!==a.buffer||a.byteOffset<s.byteOffset){a&&(t[++l]=a);continue}if({byteOffset:r,byteLength:i}=s,{byteOffset:n,byteLength:o}=a,r+i<n||n+o<r){a&&(t[++l]=a);continue}t[l]=new Uint8Array(s.buffer,r,n-r+o)}return t}function Vf(e,t,r=0,n=t.byteLength){let i=e.byteLength,o=new Uint8Array(e.buffer,e.byteOffset,i),s=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,i));return o.set(s,r),e}function Hn(e,t){let r=CV(e),n=r.reduce((u,h)=>u+h.byteLength,0),i,o,s,a=0,c=-1,l=Math.min(t||Number.POSITIVE_INFINITY,n);for(let u=r.length;++c<u;){if(i=r[c],o=i.subarray(0,Math.min(i.length,l-a)),l<=a+o.length){o.length<i.length?r[c]=i.subarray(o.length):o.length===i.length&&c++,s?Vf(s,o,a):s=o;break}Vf(s||(s=new Uint8Array(l)),o,a),a+=o.length}return[s||new Uint8Array(0),r.slice(c),n-(s?s.byteLength:0)]}function Re(e,t){let r=Jm(t)?t.value:t;return r instanceof e?e===Uint8Array?new e(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=qn(r)),r instanceof ArrayBuffer?new e(r):r instanceof A2?new e(r):jA(r)?Re(e,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new e(0):new e(r.buffer,r.byteOffset,r.byteLength/e.BYTES_PER_ELEMENT):e.from(r)):new e(0)}function*mo(e,t){let r=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof A2?r(t):Wn(t)?t:r(t);return yield*T2((function*(i){let o=null;do o=i.next(yield Re(e,o));while(!o.done)})(n[Symbol.iterator]())),new e}function Di(e,t){return en(this,arguments,function*(){if(Vn(t))return yield Me(yield Me(yield*ru(zn(Di(e,yield Me(t))))));let n=function(s){return en(this,arguments,function*(){yield yield Me(yield Me(s))})},i=function(s){return en(this,arguments,function*(){yield Me(yield*ru(zn(T2((function*(a){let c=null;do c=a.next(yield c==null?void 0:c.value);while(!c.done)})(s[Symbol.iterator]())))))})},o=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof A2?n(t):Wn(t)?i(t):Mn(t)?t:n(t);return yield Me(yield*ru(zn(T2((function(s){return en(this,arguments,function*(){let a=null;do a=yield Me(s.next(yield yield Me(Re(e,a))));while(!a.done)})})(o[Symbol.asyncIterator]()))))),yield Me(new e)})}function np(e,t,r){if(e!==0){r=r.slice(0,t);let n=typeof r[0]=="bigint"?BigInt(e):e;for(let i=-1,o=r.length;++i<o;)r[i]+=n}return r.subarray(0,t)}function R2(e,t){let r=0,n=e.length;if(n!==t.length)return!1;if(n>0)do if(e[r]!==t[r])return!1;while(++r<n);return!0}var A2,DV,NV,pc,Wf,se,FV,GV,kV,UV,jV,zV,T2,qV,VV,WV,I2,HV,$V,KV,XV,YV,ZV,JV,QV,P2,eW,tW,rW,nW,iW,dr=p(()=>{Ar();Xo();Yo();A2=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;DV=e=>Re(Int8Array,e),NV=e=>Re(Int16Array,e),pc=e=>Re(Int32Array,e),Wf=e=>Re(BigInt64Array,e),se=e=>Re(Uint8Array,e),FV=e=>Re(Uint16Array,e),GV=e=>Re(Uint32Array,e),kV=e=>Re(BigUint64Array,e),UV=e=>Re(Float32Array,e),jV=e=>Re(Float64Array,e),zV=e=>Re(Uint8ClampedArray,e),T2=e=>(e.next(),e);qV=e=>mo(Int8Array,e),VV=e=>mo(Int16Array,e),WV=e=>mo(Int32Array,e),I2=e=>mo(Uint8Array,e),HV=e=>mo(Uint16Array,e),$V=e=>mo(Uint32Array,e),KV=e=>mo(Float32Array,e),XV=e=>mo(Float64Array,e),YV=e=>mo(Uint8ClampedArray,e);ZV=e=>Di(Int8Array,e),JV=e=>Di(Int16Array,e),QV=e=>Di(Int32Array,e),P2=e=>Di(Uint8Array,e),eW=e=>Di(Uint16Array,e),tW=e=>Di(Uint32Array,e),rW=e=>Di(Float32Array,e),nW=e=>Di(Float64Array,e),iW=e=>Di(Uint8ClampedArray,e)});function*oW(e){let t,r=!1,n=[],i,o,s,a=0;function c(){return o==="peek"?Hn(n,s)[0]:([i,n,a]=Hn(n,s),i)}({cmd:o,size:s}=(yield null)||{cmd:"read",size:0});let l=I2(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(s-a)?l.next():l.next(s-a),!t&&i.byteLength>0&&(n.push(i),a+=i.byteLength),t||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!t)}catch(u){r=!0,typeof l.throw=="function"&&l.throw(u)}finally{r===!1&&typeof l.return=="function"&&l.return(null)}return null}function sW(e){return en(this,arguments,function*(){let r,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Hn(i,a)[0]:([o,i,c]=Hn(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=P2(e)[Symbol.asyncIterator]();try{do if({done:r,value:o}=Number.isNaN(a-c)?yield Me(u.next()):yield Me(u.next(a-c)),!r&&o.byteLength>0&&(i.push(o),c+=o.byteLength),r||a<=c)do({cmd:s,size:a}=yield yield Me(l()));while(a<c);while(!r)}catch(h){n=!0,typeof u.throw=="function"&&(yield Me(u.throw(h)))}finally{n===!1&&typeof u.return=="function"&&(yield Me(u.return(new Uint8Array(0))))}return yield Me(null)})}function aW(e){return en(this,arguments,function*(){let r=!1,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Hn(i,a)[0]:([o,i,c]=Hn(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=new B2(e);try{do if({done:r,value:o}=Number.isNaN(a-c)?yield Me(u.read()):yield Me(u.read(a-c)),!r&&o.byteLength>0&&(i.push(se(o)),c+=o.byteLength),r||a<=c)do({cmd:s,size:a}=yield yield Me(l()));while(a<c);while(!r)}catch(h){n=!0,yield Me(u.cancel(h))}finally{n===!1?yield Me(u.cancel()):e.locked&&u.releaseLock()}return yield Me(null)})}function cW(e){return en(this,arguments,function*(){let r=[],n="error",i=!1,o=null,s,a,c=0,l=[],u;function h(){return s==="peek"?Hn(l,a)[0]:([u,l,c]=Hn(l,a),u)}if({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0},e.isTTY)return yield yield Me(new Uint8Array(0)),yield Me(null);try{r[0]=O2(e,"end"),r[1]=O2(e,"error");do{if(r[2]=O2(e,"readable"),[n,o]=yield Me(Promise.race(r.map(m=>m[2]))),n==="error")break;if((i=n==="end")||(Number.isFinite(a-c)?(u=se(e.read(a-c)),u.byteLength<a-c&&(u=se(e.read()))):u=se(e.read()),u.byteLength>0&&(l.push(u),c+=u.byteLength)),i||a<=c)do({cmd:s,size:a}=yield yield Me(h()));while(a<c)}while(!i)}finally{yield Me(d(r,n==="error"?o:null))}return yield Me(null);function d(m,g){return u=l=null,new Promise((y,b)=>{for(let[w,_]of m)e.off(w,_);try{let w=e.destroy;w&&w.call(e,g),g=void 0}catch(w){g=w||g}finally{g!=null?b(g):y()}})}})}var mr,ip,B2,O2,iu=p(()=>{Ar();dr();mr={fromIterable(e){return ip(oW(e))},fromAsyncIterable(e){return ip(sW(e))},fromDOMStream(e){return ip(aW(e))},fromNodeStream(e){return ip(cW(e))},toDOMStream(e,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(e,t){throw new Error('"toNodeStream" not available in this environment')}},ip=e=>(e.next(),e);B2=class{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return H(this,void 0,void 0,function*(){let{reader:r,source:n}=this;r&&(yield r.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return H(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=yield this.reader.read();return!r.done&&(r.value=se(r)),r})}},O2=(e,t)=>{let r=i=>n([t,i]),n;return[t,r,new Promise(i=>(n=i)&&e.once(t,r))]}});var it,op=p(()=>{(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(it||(it={}))});var Ze,C2=p(()=>{(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(Ze||(Ze={}))});var He,D2=p(()=>{(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(He||(He={}))});var st,N2=p(()=>{(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(st||(st={}))});var q,Hf=p(()=>{(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(q||(q={}))});var ke,F2=p(()=>{(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(ke||(ke={}))});var sp=ae(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.SIZE_PREFIX_LENGTH=po.FILE_IDENTIFIER_LENGTH=po.SIZEOF_INT=po.SIZEOF_SHORT=void 0;po.SIZEOF_SHORT=2;po.SIZEOF_INT=4;po.FILE_IDENTIFIER_LENGTH=4;po.SIZE_PREFIX_LENGTH=4});var G2=ae(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.isLittleEndian=yi.float64=yi.float32=yi.int32=void 0;yi.int32=new Int32Array(2);yi.float32=new Float32Array(yi.int32.buffer);yi.float64=new Float64Array(yi.int32.buffer);yi.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var k2=ae(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});ap.Encoding=void 0;var zA;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(zA||(ap.Encoding=zA={}))});var j2=ae(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.ByteBuffer=void 0;var go=sp(),lW=k2(),vn=G2(),U2=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return vn.int32[0]=this.readInt32(t),vn.float32[0]}readFloat64(t){return vn.int32[vn.isLittleEndian?0:1]=this.readInt32(t),vn.int32[vn.isLittleEndian?1:0]=this.readInt32(t+4),vn.float64[0]}writeInt8(t,r){this.bytes_[t]=r}writeUint8(t,r){this.bytes_[t]=r}writeInt16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeUint16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeInt32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeUint32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeInt64(t,r){this.writeInt32(t,Number(BigInt.asIntN(32,r))),this.writeInt32(t+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(t,r){this.writeUint32(t,Number(BigInt.asUintN(32,r))),this.writeUint32(t+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(t,r){vn.float32[0]=r,this.writeInt32(t,vn.int32[0])}writeFloat64(t,r){vn.float64[0]=r,this.writeInt32(t,vn.int32[vn.isLittleEndian?0:1]),this.writeInt32(t+4,vn.int32[vn.isLittleEndian?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+go.SIZEOF_INT+go.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let r=0;r<go.FILE_IDENTIFIER_LENGTH;r++)t+=String.fromCharCode(this.readInt8(this.position_+go.SIZEOF_INT+r));return t}__offset(t,r){let n=t-this.readInt32(t);return r<this.readInt16(n)?this.readInt16(n+r):0}__union(t,r){return t.bb_pos=r+this.readInt32(r),t.bb=this,t}__string(t,r){t+=this.readInt32(t);let n=this.readInt32(t);t+=go.SIZEOF_INT;let i=this.bytes_.subarray(t,t+n);return r===lW.Encoding.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(t,r){return typeof t=="string"?this.__string(r):this.__union(t,r)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+go.SIZEOF_INT}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=go.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+go.FILE_IDENTIFIER_LENGTH);for(let r=0;r<go.FILE_IDENTIFIER_LENGTH;r++)if(t.charCodeAt(r)!=this.readInt8(this.position()+go.SIZEOF_INT+r))return!1;return!0}createScalarList(t,r){let n=[];for(let i=0;i<r;++i){let o=t(i);o!==null&&n.push(o)}return n}createObjList(t,r){let n=[];for(let i=0;i<r;++i){let o=t(i);o!==null&&n.push(o.unpack())}return n}};cp.ByteBuffer=U2});var VA=ae(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.Builder=void 0;var qA=j2(),$n=sp(),z2=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let r;t?r=t:r=1024,this.bb=qA.ByteBuffer.allocate(r),this.space=r}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,r){t>this.minalign&&(this.minalign=t);let n=~(this.bb.capacity()-this.space+r)+1&t-1;for(;this.space<n+t+r;){let i=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)}pad(t){for(let r=0;r<t;r++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,r,n){(this.force_defaults||r!=n)&&(this.addInt8(r),this.slot(t))}addFieldInt16(t,r,n){(this.force_defaults||r!=n)&&(this.addInt16(r),this.slot(t))}addFieldInt32(t,r,n){(this.force_defaults||r!=n)&&(this.addInt32(r),this.slot(t))}addFieldInt64(t,r,n){(this.force_defaults||r!==n)&&(this.addInt64(r),this.slot(t))}addFieldFloat32(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat32(r),this.slot(t))}addFieldFloat64(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat64(r),this.slot(t))}addFieldOffset(t,r,n){(this.force_defaults||r!=n)&&(this.addOffset(r),this.slot(t))}addFieldStruct(t,r,n){r!=n&&(this.nested(r),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let r=t.capacity();if(r&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=r<<1,i=qA.ByteBuffer.allocate(n);return i.setPosition(n-r),i.bytes().set(t.bytes(),n-r),i}addOffset(t){this.prep($n.SIZEOF_INT,0),this.writeInt32(this.offset()-t+$n.SIZEOF_INT)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let r=0;r<t;r++)this.vtable[r]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let t=this.offset(),r=this.vtable_in_use-1;for(;r>=0&&this.vtable[r]==0;r--);let n=r+1;for(;r>=0;r--)this.addInt16(this.vtable[r]!=0?t-this.vtable[r]:0);let i=2;this.addInt16(t-this.object_start);let o=(n+i)*$n.SIZEOF_SHORT;this.addInt16(o);let s=0,a=this.space;e:for(r=0;r<this.vtables.length;r++){let c=this.bb.capacity()-this.vtables[r];if(o==this.bb.readInt16(c)){for(let l=$n.SIZEOF_SHORT;l<o;l+=$n.SIZEOF_SHORT)if(this.bb.readInt16(a+l)!=this.bb.readInt16(c+l))continue e;s=this.vtables[r];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,r,n){let i=n?$n.SIZE_PREFIX_LENGTH:0;if(r){let o=r;if(this.prep(this.minalign,$n.SIZEOF_INT+$n.FILE_IDENTIFIER_LENGTH+i),o.length!=$n.FILE_IDENTIFIER_LENGTH)throw new TypeError("FlatBuffers: file identifier must be length "+$n.FILE_IDENTIFIER_LENGTH);for(let s=$n.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,$n.SIZEOF_INT+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,r){this.finish(t,r,!0)}requiredField(t,r){let n=this.bb.capacity()-t,i=n-this.bb.readInt32(n);if(!(r<this.bb.readInt16(i)&&this.bb.readInt16(i+r)!=0))throw new TypeError("FlatBuffers: field "+r+" must be set")}startVector(t,r,n){this.notNested(),this.vector_num_elems=r,this.prep($n.SIZEOF_INT,t*r),this.prep(n,t*r)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let r=this.createString(t);return this.string_maps.set(t,r),r}createString(t){if(t==null)return 0;let r;return t instanceof Uint8Array?r=t:r=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,r.length,1),this.bb.setPosition(this.space-=r.length),this.bb.bytes().set(r,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let r=[];for(let n=0;n<t.length;++n){let i=t[n];if(i!==null)r.push(this.createObjectOffset(i));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return r}createStructOffsetList(t,r){return r(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};lp.Builder=z2});var ze=ae(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.Encoding=It.ByteBuffer=It.Builder=It.isLittleEndian=It.int32=It.float64=It.float32=It.SIZE_PREFIX_LENGTH=It.SIZEOF_SHORT=It.SIZEOF_INT=It.FILE_IDENTIFIER_LENGTH=void 0;var up=sp();Object.defineProperty(It,"FILE_IDENTIFIER_LENGTH",{enumerable:!0,get:function(){return up.FILE_IDENTIFIER_LENGTH}});Object.defineProperty(It,"SIZEOF_INT",{enumerable:!0,get:function(){return up.SIZEOF_INT}});Object.defineProperty(It,"SIZEOF_SHORT",{enumerable:!0,get:function(){return up.SIZEOF_SHORT}});Object.defineProperty(It,"SIZE_PREFIX_LENGTH",{enumerable:!0,get:function(){return up.SIZE_PREFIX_LENGTH}});var fp=G2();Object.defineProperty(It,"float32",{enumerable:!0,get:function(){return fp.float32}});Object.defineProperty(It,"float64",{enumerable:!0,get:function(){return fp.float64}});Object.defineProperty(It,"int32",{enumerable:!0,get:function(){return fp.int32}});Object.defineProperty(It,"isLittleEndian",{enumerable:!0,get:function(){return fp.isLittleEndian}});var uW=VA();Object.defineProperty(It,"Builder",{enumerable:!0,get:function(){return uW.Builder}});var fW=j2();Object.defineProperty(It,"ByteBuffer",{enumerable:!0,get:function(){return fW.ByteBuffer}});var hW=k2();Object.defineProperty(It,"Encoding",{enumerable:!0,get:function(){return hW.Encoding}})});var gc,q2=p(()=>{(function(e){e[e.BUFFER=0]="BUFFER"})(gc||(gc={}))});var Ir,ou=p(()=>{(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(Ir||(Ir={}))});var WA,Zo,V2=p(()=>{WA=me(ze(),1);q2();ou();Zo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBodyCompression(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,r){return t.setPosition(t.position()+WA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):Ir.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):gc.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,r){t.addFieldInt8(0,r,Ir.LZ4_FRAME)}static addMethod(t,r){t.addFieldInt8(1,r,gc.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,r,n){return e.startBodyCompression(t),e.addCodec(t,r),e.addMethod(t,n),e.endBodyCompression(t)}}});var su,W2=p(()=>{su=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,r,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(r??0)),t.offset()}}});var au,H2=p(()=>{au=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,r,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(r??0)),t.offset()}}});var HA,Dr,$2=p(()=>{HA=me(ze(),1);V2();W2();H2();Dr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsRecordBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,r){return t.setPosition(t.position()+HA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new au).__init(this.bb.__vector(this.bb_pos+n)+t*16,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new su).__init(this.bb.__vector(this.bb_pos+n)+t*16,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let r=this.bb.__offset(this.bb_pos,10);return r?(t||new Zo).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}variadicBufferCounts(t){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+t*8):BigInt(0)}variadicBufferCountsLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startRecordBatch(t){t.startObject(5)}static addLength(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addNodes(t,r){t.addFieldOffset(1,r,0)}static startNodesVector(t,r){t.startVector(16,r,8)}static addBuffers(t,r){t.addFieldOffset(2,r,0)}static startBuffersVector(t,r){t.startVector(16,r,8)}static addCompression(t,r){t.addFieldOffset(3,r,0)}static addVariadicBufferCounts(t,r){t.addFieldOffset(4,r,0)}static createVariadicBufferCountsVector(t,r){t.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)t.addInt64(r[n]);return t.endVector()}static startVariadicBufferCountsVector(t,r){t.startVector(8,r,8)}static endRecordBatch(t){return t.endObject()}}});var $A,Jo,KA=p(()=>{$A=me(ze(),1);$2();Jo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,r){return t.setPosition(t.position()+$A.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Dr).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addData(t,r){t.addFieldOffset(1,r,0)}static addIsDelta(t,r){t.addFieldInt8(2,+r,0)}static endDictionaryBatch(t){return t.endObject()}}});var Hs,K2=p(()=>{(function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"})(Hs||(Hs={}))});var $f,XA=p(()=>{(function(e){e[e.DenseArray=0]="DenseArray"})($f||($f={}))});var YA,Ni,hp=p(()=>{YA=me(ze(),1),Ni=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInt(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,r){return t.setPosition(t.position()+YA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,r){t.addFieldInt32(0,r,0)}static addIsSigned(t,r){t.addFieldInt8(1,+r,0)}static endInt(t){return t.endObject()}static createInt(t,r,n){return e.startInt(t),e.addBitWidth(t,r),e.addIsSigned(t,n),e.endInt(t)}}});var ZA,yo,X2=p(()=>{ZA=me(ze(),1);XA();hp();yo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryEncoding(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,r){return t.setPosition(t.position()+ZA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}indexType(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Ni).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):$f.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addIndexType(t,r){t.addFieldOffset(1,r,0)}static addIsOrdered(t,r){t.addFieldInt8(2,+r,0)}static addDictionaryKind(t,r){t.addFieldInt16(3,r,$f.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}});var JA,Dt,cu=p(()=>{JA=me(ze(),1),Dt=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsKeyValue(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,r){return t.setPosition(t.position()+JA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}key(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}value(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,r){t.addFieldOffset(0,r,0)}static addValue(t,r){t.addFieldOffset(1,r,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,r,n){return e.startKeyValue(t),e.addKey(t,r),e.addValue(t,n),e.endKeyValue(t)}}});var QA,Kf,eI=p(()=>{QA=me(ze(),1),Kf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,r){return t.setPosition(t.position()+QA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return e.startBinary(t),e.endBinary(t)}}});var tI,Xf,rI=p(()=>{tI=me(ze(),1),Xf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBinaryView(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinaryView(t,r){return t.setPosition(t.position()+tI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinaryView(t){t.startObject(0)}static endBinaryView(t){return t.endObject()}static createBinaryView(t){return e.startBinaryView(t),e.endBinaryView(t)}}});var nI,Yf,iI=p(()=>{nI=me(ze(),1),Yf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBool(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,r){return t.setPosition(t.position()+nI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return e.startBool(t),e.endBool(t)}}});var oI,$s,Y2=p(()=>{oI=me(ze(),1);N2();$s=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDate(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,r){return t.setPosition(t.position()+oI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):st.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,st.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,r){return e.startDate(t),e.addUnit(t,r),e.endDate(t)}}});var sI,bo,Z2=p(()=>{sI=me(ze(),1),bo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDecimal(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,r){return t.setPosition(t.position()+sI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,r){t.addFieldInt32(0,r,0)}static addScale(t,r){t.addFieldInt32(1,r,0)}static addBitWidth(t,r){t.addFieldInt32(2,r,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,r,n,i){return e.startDecimal(t),e.addPrecision(t,r),e.addScale(t,n),e.addBitWidth(t,i),e.endDecimal(t)}}});var aI,Ks,J2=p(()=>{aI=me(ze(),1);Hf();Ks=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDuration(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,r){return t.setPosition(t.position()+aI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,q.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,r){return e.startDuration(t),e.addUnit(t,r),e.endDuration(t)}}});var cI,Xs,Q2=p(()=>{cI=me(ze(),1),Xs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,r){return t.setPosition(t.position()+cI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,r){t.addFieldInt32(0,r,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,r){return e.startFixedSizeBinary(t),e.addByteWidth(t,r),e.endFixedSizeBinary(t)}}});var lI,Ys,eb=p(()=>{lI=me(ze(),1),Ys=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,r){return t.setPosition(t.position()+lI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,r){t.addFieldInt32(0,r,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,r){return e.startFixedSizeList(t),e.addListSize(t,r),e.endFixedSizeList(t)}}});var uI,Zs,tb=p(()=>{uI=me(ze(),1);D2();Zs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFloatingPoint(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,r){return t.setPosition(t.position()+uI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):He.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,r){t.addFieldInt16(0,r,He.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,r){return e.startFloatingPoint(t),e.addPrecision(t,r),e.endFloatingPoint(t)}}});var fI,Js,rb=p(()=>{fI=me(ze(),1);F2();Js=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInterval(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,r){return t.setPosition(t.position()+fI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ke.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,ke.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,r){return e.startInterval(t),e.addUnit(t,r),e.endInterval(t)}}});var hI,Zf,dI=p(()=>{hI=me(ze(),1),Zf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,r){return t.setPosition(t.position()+hI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return e.startLargeBinary(t),e.endLargeBinary(t)}}});var mI,Jf,pI=p(()=>{mI=me(ze(),1),Jf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeList(t,r){return t.setPosition(t.position()+mI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeList(t){t.startObject(0)}static endLargeList(t){return t.endObject()}static createLargeList(t){return e.startLargeList(t),e.endLargeList(t)}}});var gI,Qf,yI=p(()=>{gI=me(ze(),1),Qf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,r){return t.setPosition(t.position()+gI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return e.startLargeUtf8(t),e.endLargeUtf8(t)}}});var bI,eh,wI=p(()=>{bI=me(ze(),1),eh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,r){return t.setPosition(t.position()+bI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return e.startList(t),e.endList(t)}}});var xI,Qs,nb=p(()=>{xI=me(ze(),1),Qs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMap(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,r){return t.setPosition(t.position()+xI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,r){t.addFieldInt8(0,+r,0)}static endMap(t){return t.endObject()}static createMap(t,r){return e.startMap(t),e.addKeysSorted(t,r),e.endMap(t)}}});var _I,th,SI=p(()=>{_I=me(ze(),1),th=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsNull(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,r){return t.setPosition(t.position()+_I.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return e.startNull(t),e.endNull(t)}}});var MI,rh,vI=p(()=>{MI=me(ze(),1),rh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsStruct_(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,r){return t.setPosition(t.position()+MI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return e.startStruct_(t),e.endStruct_(t)}}});var EI,Qo,ib=p(()=>{EI=me(ze(),1);Hf();Qo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTime(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,r){return t.setPosition(t.position()+EI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,r){t.addFieldInt16(0,r,q.MILLISECOND)}static addBitWidth(t,r){t.addFieldInt32(1,r,32)}static endTime(t){return t.endObject()}static createTime(t,r,n){return e.startTime(t),e.addUnit(t,r),e.addBitWidth(t,n),e.endTime(t)}}});var TI,es,ob=p(()=>{TI=me(ze(),1);Hf();es=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTimestamp(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,r){return t.setPosition(t.position()+TI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.SECOND}timezone(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,r){t.addFieldInt16(0,r,q.SECOND)}static addTimezone(t,r){t.addFieldOffset(1,r,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,r,n){return e.startTimestamp(t),e.addUnit(t,r),e.addTimezone(t,n),e.endTimestamp(t)}}});var AI,Fi,sb=p(()=>{AI=me(ze(),1);C2();Fi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUnion(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,r){return t.setPosition(t.position()+AI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}mode(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ze.Sparse}typeIds(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readInt32(this.bb.__vector(this.bb_pos+r)+t*4):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,r){t.addFieldInt16(0,r,Ze.Sparse)}static addTypeIds(t,r){t.addFieldOffset(1,r,0)}static createTypeIdsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addInt32(r[n]);return t.endVector()}static startTypeIdsVector(t,r){t.startVector(4,r,4)}static endUnion(t){return t.endObject()}static createUnion(t,r,n){return e.startUnion(t),e.addMode(t,r),e.addTypeIds(t,n),e.endUnion(t)}}});var II,nh,PI=p(()=>{II=me(ze(),1),nh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,r){return t.setPosition(t.position()+II.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}}});var RI,ih,LI=p(()=>{RI=me(ze(),1),ih=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUtf8View(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8View(t,r){return t.setPosition(t.position()+RI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8View(t){t.startObject(0)}static endUtf8View(t){return t.endObject()}static createUtf8View(t){return e.startUtf8View(t),e.endUtf8View(t)}}});var pe,dp=p(()=>{(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.RunEndEncoded=22]="RunEndEncoded",e[e.BinaryView=23]="BinaryView",e[e.Utf8View=24]="Utf8View",e[e.ListView=25]="ListView",e[e.LargeListView=26]="LargeListView"})(pe||(pe={}))});var OI,Nr,ab=p(()=>{OI=me(ze(),1);X2();cu();dp();Nr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsField(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,r){return t.setPosition(t.position()+OI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}name(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):pe.NONE}type(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(t,this.bb_pos+r):null}dictionary(t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new yo).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(t,r){let n=this.bb.__offset(this.bb_pos,14);return n?(r||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,16);return n?(r||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,r){t.addFieldOffset(0,r,0)}static addNullable(t,r){t.addFieldInt8(1,+r,0)}static addTypeType(t,r){t.addFieldInt8(2,r,pe.NONE)}static addType(t,r){t.addFieldOffset(3,r,0)}static addDictionary(t,r){t.addFieldOffset(4,r,0)}static addChildren(t,r){t.addFieldOffset(5,r,0)}static createChildrenVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startChildrenVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(6,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endField(t){return t.endObject()}}});var BI,En,cb=p(()=>{BI=me(ze(),1);K2();ab();cu();En=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsSchema(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,r){return t.setPosition(t.position()+BI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Hs.Little}fields(t,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new Nr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,r){t.addFieldInt16(0,r,Hs.Little)}static addFields(t,r){t.addFieldOffset(1,r,0)}static createFieldsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startFieldsVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(2,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static addFeatures(t,r){t.addFieldOffset(3,r,0)}static createFeaturesVector(t,r){t.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)t.addInt64(r[n]);return t.endVector()}static startFeaturesVector(t,r){t.startVector(8,r,8)}static endSchema(t){return t.endObject()}static createSchema(t,r,n,i,o){return e.startSchema(t),e.addEndianness(t,r),e.addFields(t,n),e.addCustomMetadata(t,i),e.addFeatures(t,o),e.endSchema(t)}}});var Ge,mp=p(()=>{(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(Ge||(Ge={}))});var x,Ne,Nt=p(()=>{op();C2();D2();N2();Hf();F2();mp();(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.BinaryView=23]="BinaryView",e[e.Utf8View=24]="Utf8View",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e[e.DurationSecond=-27]="DurationSecond",e[e.DurationMillisecond=-28]="DurationMillisecond",e[e.DurationMicrosecond=-29]="DurationMicrosecond",e[e.DurationNanosecond=-30]="DurationNanosecond",e[e.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(x||(x={}));(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(Ne||(Ne={}))});var lb={};Jt(lb,{valueToString:()=>Gi});function Gi(e){if(e===null)return"null";if(e===void 0)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(t=>Gi(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,r)=>typeof r=="bigint"?`${r}`:r)}var oh=p(()=>{});function Le(e){if(typeof e=="bigint"&&(e<Number.MIN_SAFE_INTEGER||e>Number.MAX_SAFE_INTEGER))throw new TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function ub(e,t){return Le(e/t)+Le(e%t)/Le(t)}var wo=p(()=>{});var db={};Jt(db,{BN:()=>yc,bigNumToBigInt:()=>DI,bigNumToNumber:()=>hb,bigNumToString:()=>fu,isArrowBigNumSymbol:()=>CI});function ki(e,...t){return t.length===0?Object.setPrototypeOf(Re(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}function lu(...e){return ki.apply(this,e)}function uu(...e){return ki.apply(this,e)}function sh(...e){return ki.apply(this,e)}function hb(e,t){let{buffer:r,byteOffset:n,byteLength:i,signed:o}=e,s=new BigUint64Array(r,n,i/8),a=o&&s.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),l=0;if(a){for(let u of s)c|=(u^mW)*(BigInt(1)<<BigInt(64*l++));c*=BigInt(-1),c-=BigInt(1)}else for(let u of s)c|=u*(BigInt(1)<<BigInt(64*l++));if(typeof t=="number"&&t>0){let u=BigInt("1".padEnd(t+1,"0")),h=c/u,d=a?-(c%u):c%u,m=Le(h),g=`${d}`.padStart(t,"0");return+`${a&&m===0?"-":""}${m}.${g}`}return Le(c)}function fu(e){if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return fb(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return fb(e);t=t.slice();let n=1;for(let o=0;o<t.length;o++){let s=t[o],a=~s+n;t[o]=a,n&=s===0?1:0}return`-${fb(t)}`}function DI(e){return e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:fu(e)}function fb(e){let t="",r=new Uint32Array(2),n=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),o=-1,s=n.length-1;do{for(r[0]=n[o=0];o<s;)n[o++]=r[1]=r[0]/10,r[0]=(r[0]-r[1]*10<<16)+n[o];n[o]=r[1]=r[0]/10,r[0]=r[0]-r[1]*10,t=`${r[0]}${t}`}while(i[0]||i[1]||i[2]||i[3]);return t??"0"}var CI,dW,mW,yc,pp=p(()=>{dr();wo();CI=Symbol.for("isArrowBigNum");ki.prototype[CI]=!0;ki.prototype.toJSON=function(){return`"${fu(this)}"`};ki.prototype.valueOf=function(e){return hb(this,e)};ki.prototype.toString=function(){return fu(this)};ki.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return hb(this);case"string":return fu(this);case"default":return DI(this)}return fu(this)};Object.setPrototypeOf(lu.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(uu.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(sh.prototype,Object.create(Uint32Array.prototype));Object.assign(lu.prototype,ki.prototype,{constructor:lu,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(uu.prototype,ki.prototype,{constructor:uu,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(sh.prototype,ki.prototype,{constructor:sh,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});dW=BigInt(4294967296)*BigInt(4294967296),mW=dW-BigInt(1);yc=class e{static new(t,r){switch(r){case!0:return new lu(t);case!1:return new uu(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new lu(t)}return t.byteLength===16?new sh(t):new uu(t)}static signed(t){return new lu(t)}static unsigned(t){return new uu(t)}static decimal(t){return new sh(t)}constructor(t,r){return e.new(t,r)}}});function ti(e){let t=e;switch(e.typeId){case x.Decimal:return e.bitWidth/32;case x.Interval:return t.unit===ke.MONTH_DAY_NANO?4:1+t.unit;case x.BinaryView:case x.Utf8View:return 16;case x.FixedSizeList:return t.listSize;case x.FixedSizeBinary:return t.byteWidth;default:return 1}}var NI,FI,GI,kI,UI,jI,zI,qI,VI,WI,HI,$I,KI,XI,YI,ZI,JI,QI,e6,t6,r6,n6,i6,o6,s6,a6,z,Wt,Pt,Kn,Xn,Yt,Yn,Zn,Jn,rn,Ui,Fr,ji,nn,Qn,Tn,Ee,zi,Gr,on,qi,kr,An,sn,ea,ta,Pr,ra,na,ia,oa,Rr,sa,xo,aa,ca,Ur,la,ua,ah,an,ch,lh,uh,fh,rr,ei,tt,cn,ts,fa,In,Ht,jr,pW,nr,at=p(()=>{wo();Nt();a6=Symbol.for("apache-arrow/DataType"),z=class e{static isDataType(t){return(t==null?void 0:t[a6])===!0}static isNull(t){return(t==null?void 0:t.typeId)===x.Null}static isInt(t){return(t==null?void 0:t.typeId)===x.Int}static isFloat(t){return(t==null?void 0:t.typeId)===x.Float}static isBinary(t){return(t==null?void 0:t.typeId)===x.Binary}static isBinaryView(t){return(t==null?void 0:t.typeId)===x.BinaryView}static isLargeBinary(t){return(t==null?void 0:t.typeId)===x.LargeBinary}static isUtf8(t){return(t==null?void 0:t.typeId)===x.Utf8}static isUtf8View(t){return(t==null?void 0:t.typeId)===x.Utf8View}static isLargeUtf8(t){return(t==null?void 0:t.typeId)===x.LargeUtf8}static isBool(t){return(t==null?void 0:t.typeId)===x.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===x.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===x.Date}static isTime(t){return(t==null?void 0:t.typeId)===x.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===x.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===x.Interval}static isDuration(t){return(t==null?void 0:t.typeId)===x.Duration}static isList(t){return(t==null?void 0:t.typeId)===x.List}static isLargeList(t){return(t==null?void 0:t.typeId)===x.LargeList}static isStruct(t){return(t==null?void 0:t.typeId)===x.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===x.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===x.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===x.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===x.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===x.Dictionary}static isDenseUnion(t){return e.isUnion(t)&&t.mode===Ze.Dense}static isSparseUnion(t){return e.isUnion(t)&&t.mode===Ze.Sparse}constructor(t){this.typeId=t}};NI=Symbol.toStringTag;z[NI]=(e=>(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[a6]=!0,e[Symbol.toStringTag]="DataType"))(z.prototype);Wt=class extends z{constructor(){super(x.Null)}toString(){return"Null"}};FI=Symbol.toStringTag;Wt[FI]=(e=>e[Symbol.toStringTag]="Null")(Wt.prototype);Pt=class extends z{constructor(t,r){super(x.Int),this.isSigned=t,this.bitWidth=r}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};GI=Symbol.toStringTag;Pt[GI]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(Pt.prototype);Kn=class extends Pt{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Xn=class extends Pt{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Yt=class extends Pt{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Yn=class extends Pt{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Zn=class extends Pt{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Jn=class extends Pt{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},rn=class extends Pt{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Ui=class extends Pt{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Kn.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Xn.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Yt.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Yn.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Zn.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Jn.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(rn.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Ui.prototype,"ArrayType",{value:BigUint64Array});Fr=class extends z{constructor(t){super(x.Float),this.precision=t}get ArrayType(){switch(this.precision){case He.HALF:return Uint16Array;case He.SINGLE:return Float32Array;case He.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};kI=Symbol.toStringTag;Fr[kI]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(Fr.prototype);ji=class extends Fr{constructor(){super(He.HALF)}},nn=class extends Fr{constructor(){super(He.SINGLE)}},Qn=class extends Fr{constructor(){super(He.DOUBLE)}};Object.defineProperty(ji.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(nn.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Qn.prototype,"ArrayType",{value:Float64Array});Tn=class extends z{constructor(){super(x.Binary)}toString(){return"Binary"}};UI=Symbol.toStringTag;Tn[UI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(Tn.prototype);Ee=class extends z{constructor(){super(x.BinaryView)}toString(){return"BinaryView"}};jI=Symbol.toStringTag;Ee.ELEMENT_WIDTH=16;Ee.INLINE_CAPACITY=12;Ee.LENGTH_OFFSET=0;Ee.INLINE_OFFSET=4;Ee.BUFFER_INDEX_OFFSET=8;Ee.BUFFER_OFFSET_OFFSET=12;Ee[jI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="BinaryView"))(Ee.prototype);zi=class extends z{constructor(){super(x.LargeBinary)}toString(){return"LargeBinary"}};zI=Symbol.toStringTag;zi[zI]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeBinary"))(zi.prototype);Gr=class extends z{constructor(){super(x.Utf8)}toString(){return"Utf8"}};qI=Symbol.toStringTag;Gr[qI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(Gr.prototype);on=class extends z{constructor(){super(x.Utf8View)}toString(){return"Utf8View"}};VI=Symbol.toStringTag;on.ELEMENT_WIDTH=Ee.ELEMENT_WIDTH;on.INLINE_CAPACITY=Ee.INLINE_CAPACITY;on[VI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8View"))(on.prototype);qi=class extends z{constructor(){super(x.LargeUtf8)}toString(){return"LargeUtf8"}};WI=Symbol.toStringTag;qi[WI]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeUtf8"))(qi.prototype);kr=class extends z{constructor(){super(x.Bool)}toString(){return"Bool"}};HI=Symbol.toStringTag;kr[HI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(kr.prototype);An=class extends z{constructor(t,r,n=128){super(x.Decimal),this.scale=t,this.precision=r,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};$I=Symbol.toStringTag;An[$I]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(An.prototype);sn=class extends z{constructor(t){super(x.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${st[this.unit]}>`}get ArrayType(){return this.unit===st.DAY?Int32Array:BigInt64Array}};KI=Symbol.toStringTag;sn[KI]=(e=>(e.unit=null,e[Symbol.toStringTag]="Date"))(sn.prototype);ea=class extends sn{constructor(){super(st.DAY)}},ta=class extends sn{constructor(){super(st.MILLISECOND)}},Pr=class extends z{constructor(t,r){super(x.Time),this.unit=t,this.bitWidth=r}toString(){return`Time${this.bitWidth}<${q[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};XI=Symbol.toStringTag;Pr[XI]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(Pr.prototype);ra=class extends Pr{constructor(){super(q.SECOND,32)}},na=class extends Pr{constructor(){super(q.MILLISECOND,32)}},ia=class extends Pr{constructor(){super(q.MICROSECOND,64)}},oa=class extends Pr{constructor(){super(q.NANOSECOND,64)}},Rr=class extends z{constructor(t,r){super(x.Timestamp),this.unit=t,this.timezone=r}toString(){return`Timestamp<${q[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};YI=Symbol.toStringTag;Rr[YI]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Timestamp"))(Rr.prototype);sa=class extends Rr{constructor(t){super(q.SECOND,t)}},xo=class extends Rr{constructor(t){super(q.MILLISECOND,t)}},aa=class extends Rr{constructor(t){super(q.MICROSECOND,t)}},ca=class extends Rr{constructor(t){super(q.NANOSECOND,t)}},Ur=class extends z{constructor(t){super(x.Interval),this.unit=t}toString(){return`Interval<${ke[this.unit]}>`}};ZI=Symbol.toStringTag;Ur[ZI]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(Ur.prototype);la=class extends Ur{constructor(){super(ke.DAY_TIME)}},ua=class extends Ur{constructor(){super(ke.YEAR_MONTH)}},ah=class extends Ur{constructor(){super(ke.MONTH_DAY_NANO)}},an=class extends z{constructor(t){super(x.Duration),this.unit=t}toString(){return`Duration<${q[this.unit]}>`}};JI=Symbol.toStringTag;an[JI]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(an.prototype);ch=class extends an{constructor(){super(q.SECOND)}},lh=class extends an{constructor(){super(q.MILLISECOND)}},uh=class extends an{constructor(){super(q.MICROSECOND)}},fh=class extends an{constructor(){super(q.NANOSECOND)}},rr=class extends z{constructor(t){super(x.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};QI=Symbol.toStringTag;rr[QI]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(rr.prototype);ei=class extends z{constructor(t){super(x.LargeList),this.children=[t]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};e6=Symbol.toStringTag;ei[e6]=(e=>(e.children=null,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeList"))(ei.prototype);tt=class extends z{constructor(t){super(x.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};t6=Symbol.toStringTag;tt[t6]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(tt.prototype);cn=class extends z{constructor(t,r,n){super(x.Union),this.mode=t,this.children=n,this.typeIds=r=Int32Array.from(r),this.typeIdToChildIndex=r.reduce((i,o,s)=>(i[o]=s)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};r6=Symbol.toStringTag;cn[r6]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(cn.prototype);ts=class extends cn{constructor(t,r){super(Ze.Dense,t,r)}},fa=class extends cn{constructor(t,r){super(Ze.Sparse,t,r)}},In=class extends z{constructor(t){super(x.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};n6=Symbol.toStringTag;In[n6]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(In.prototype);Ht=class extends z{constructor(t,r){super(x.FixedSizeList),this.listSize=t,this.children=[r]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};i6=Symbol.toStringTag;Ht[i6]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(Ht.prototype);jr=class extends z{constructor(t,r=!1){var n,i,o;if(super(x.Map),this.children=[t],this.keysSorted=r,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){let s=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];s&&(s.name="key");let a=(o=t==null?void 0:t.type)===null||o===void 0?void 0:o.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};o6=Symbol.toStringTag;jr[o6]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(jr.prototype);pW=(e=>()=>++e)(-1),nr=class extends z{constructor(t,r,n,i){super(x.Dictionary),this.indices=r,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?pW():Le(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};s6=Symbol.toStringTag;nr[s6]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(nr.prototype)});function gW(e,t,r=!0){return typeof t=="number"?hu(e,t,r):typeof t=="string"&&t in x?hu(e,x[t],r):t&&t instanceof z?hu(e,l6(t),r):t!=null&&t.type&&t.type instanceof z?hu(e,l6(t.type),r):hu(e,x.NONE,r)}function hu(e,t,r=!0){let n=null;switch(t){case x.Null:n=e.visitNull;break;case x.Bool:n=e.visitBool;break;case x.Int:n=e.visitInt;break;case x.Int8:n=e.visitInt8||e.visitInt;break;case x.Int16:n=e.visitInt16||e.visitInt;break;case x.Int32:n=e.visitInt32||e.visitInt;break;case x.Int64:n=e.visitInt64||e.visitInt;break;case x.Uint8:n=e.visitUint8||e.visitInt;break;case x.Uint16:n=e.visitUint16||e.visitInt;break;case x.Uint32:n=e.visitUint32||e.visitInt;break;case x.Uint64:n=e.visitUint64||e.visitInt;break;case x.Float:n=e.visitFloat;break;case x.Float16:n=e.visitFloat16||e.visitFloat;break;case x.Float32:n=e.visitFloat32||e.visitFloat;break;case x.Float64:n=e.visitFloat64||e.visitFloat;break;case x.Utf8:n=e.visitUtf8;break;case x.LargeUtf8:n=e.visitLargeUtf8;break;case x.Utf8View:n=e.visitUtf8View||e.visitUtf8;break;case x.Binary:n=e.visitBinary;break;case x.LargeBinary:n=e.visitLargeBinary;break;case x.BinaryView:n=e.visitBinaryView||e.visitBinary;break;case x.FixedSizeBinary:n=e.visitFixedSizeBinary;break;case x.Date:n=e.visitDate;break;case x.DateDay:n=e.visitDateDay||e.visitDate;break;case x.DateMillisecond:n=e.visitDateMillisecond||e.visitDate;break;case x.Timestamp:n=e.visitTimestamp;break;case x.TimestampSecond:n=e.visitTimestampSecond||e.visitTimestamp;break;case x.TimestampMillisecond:n=e.visitTimestampMillisecond||e.visitTimestamp;break;case x.TimestampMicrosecond:n=e.visitTimestampMicrosecond||e.visitTimestamp;break;case x.TimestampNanosecond:n=e.visitTimestampNanosecond||e.visitTimestamp;break;case x.Time:n=e.visitTime;break;case x.TimeSecond:n=e.visitTimeSecond||e.visitTime;break;case x.TimeMillisecond:n=e.visitTimeMillisecond||e.visitTime;break;case x.TimeMicrosecond:n=e.visitTimeMicrosecond||e.visitTime;break;case x.TimeNanosecond:n=e.visitTimeNanosecond||e.visitTime;break;case x.Decimal:n=e.visitDecimal;break;case x.List:n=e.visitList;break;case x.LargeList:n=e.visitLargeList;break;case x.Struct:n=e.visitStruct;break;case x.Union:n=e.visitUnion;break;case x.DenseUnion:n=e.visitDenseUnion||e.visitUnion;break;case x.SparseUnion:n=e.visitSparseUnion||e.visitUnion;break;case x.Dictionary:n=e.visitDictionary;break;case x.Interval:n=e.visitInterval;break;case x.IntervalDayTime:n=e.visitIntervalDayTime||e.visitInterval;break;case x.IntervalYearMonth:n=e.visitIntervalYearMonth||e.visitInterval;break;case x.IntervalMonthDayNano:n=e.visitIntervalMonthDayNano||e.visitInterval;break;case x.Duration:n=e.visitDuration;break;case x.DurationSecond:n=e.visitDurationSecond||e.visitDuration;break;case x.DurationMillisecond:n=e.visitDurationMillisecond||e.visitDuration;break;case x.DurationMicrosecond:n=e.visitDurationMicrosecond||e.visitDuration;break;case x.DurationNanosecond:n=e.visitDurationNanosecond||e.visitDuration;break;case x.FixedSizeList:n=e.visitFixedSizeList;break;case x.Map:n=e.visitMap;break}if(typeof n=="function")return n;if(!r)return()=>null;throw new Error(`Unrecognized type '${x[t]}'`)}function l6(e){switch(e.typeId){case x.Null:return x.Null;case x.Int:{let{bitWidth:t,isSigned:r}=e;switch(t){case 8:return r?x.Int8:x.Uint8;case 16:return r?x.Int16:x.Uint16;case 32:return r?x.Int32:x.Uint32;case 64:return r?x.Int64:x.Uint64}return x.Int}case x.Float:switch(e.precision){case He.HALF:return x.Float16;case He.SINGLE:return x.Float32;case He.DOUBLE:return x.Float64}return x.Float;case x.Binary:return x.Binary;case x.LargeBinary:return x.LargeBinary;case x.BinaryView:return x.BinaryView;case x.Utf8:return x.Utf8;case x.LargeUtf8:return x.LargeUtf8;case x.Utf8View:return x.Utf8View;case x.Bool:return x.Bool;case x.Decimal:return x.Decimal;case x.Time:switch(e.unit){case q.SECOND:return x.TimeSecond;case q.MILLISECOND:return x.TimeMillisecond;case q.MICROSECOND:return x.TimeMicrosecond;case q.NANOSECOND:return x.TimeNanosecond}return x.Time;case x.Timestamp:switch(e.unit){case q.SECOND:return x.TimestampSecond;case q.MILLISECOND:return x.TimestampMillisecond;case q.MICROSECOND:return x.TimestampMicrosecond;case q.NANOSECOND:return x.TimestampNanosecond}return x.Timestamp;case x.Date:switch(e.unit){case st.DAY:return x.DateDay;case st.MILLISECOND:return x.DateMillisecond}return x.Date;case x.Interval:switch(e.unit){case ke.DAY_TIME:return x.IntervalDayTime;case ke.YEAR_MONTH:return x.IntervalYearMonth;case ke.MONTH_DAY_NANO:return x.IntervalMonthDayNano}return x.Interval;case x.Duration:switch(e.unit){case q.SECOND:return x.DurationSecond;case q.MILLISECOND:return x.DurationMillisecond;case q.MICROSECOND:return x.DurationMicrosecond;case q.NANOSECOND:return x.DurationNanosecond}return x.Duration;case x.Map:return x.Map;case x.List:return x.List;case x.LargeList:return x.LargeList;case x.Struct:return x.Struct;case x.Union:switch(e.mode){case Ze.Dense:return x.DenseUnion;case Ze.Sparse:return x.SparseUnion}return x.Union;case x.FixedSizeBinary:return x.FixedSizeBinary;case x.FixedSizeList:return x.FixedSizeList;case x.Dictionary:return x.Dictionary}throw new Error(`Unrecognized type '${x[e.typeId]}'`)}var ie,Pn=p(()=>{Nt();at();ie=class{visitMany(t,...r){return t.map((n,i)=>this.visit(n,...r.map(o=>o[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,r=!0){return gW(this,t,r)}getVisitFnByTypeId(t,r=!0){return hu(this,t,r)}visitNull(t,...r){return null}visitBool(t,...r){return null}visitInt(t,...r){return null}visitFloat(t,...r){return null}visitUtf8(t,...r){return null}visitLargeUtf8(t,...r){return null}visitUtf8View(t,...r){return null}visitBinary(t,...r){return null}visitLargeBinary(t,...r){return null}visitBinaryView(t,...r){return null}visitFixedSizeBinary(t,...r){return null}visitDate(t,...r){return null}visitTimestamp(t,...r){return null}visitTime(t,...r){return null}visitDecimal(t,...r){return null}visitList(t,...r){return null}visitLargeList(t,...r){return null}visitStruct(t,...r){return null}visitUnion(t,...r){return null}visitDictionary(t,...r){return null}visitInterval(t,...r){return null}visitDuration(t,...r){return null}visitFixedSizeList(t,...r){return null}visitMap(t,...r){return null}};ie.prototype.visitInt8=null;ie.prototype.visitInt16=null;ie.prototype.visitInt32=null;ie.prototype.visitInt64=null;ie.prototype.visitUint8=null;ie.prototype.visitUint16=null;ie.prototype.visitUint32=null;ie.prototype.visitUint64=null;ie.prototype.visitFloat16=null;ie.prototype.visitFloat32=null;ie.prototype.visitFloat64=null;ie.prototype.visitDateDay=null;ie.prototype.visitDateMillisecond=null;ie.prototype.visitTimestampSecond=null;ie.prototype.visitTimestampMillisecond=null;ie.prototype.visitTimestampMicrosecond=null;ie.prototype.visitTimestampNanosecond=null;ie.prototype.visitTimeSecond=null;ie.prototype.visitTimeMillisecond=null;ie.prototype.visitTimeMicrosecond=null;ie.prototype.visitTimeNanosecond=null;ie.prototype.visitDenseUnion=null;ie.prototype.visitSparseUnion=null;ie.prototype.visitIntervalDayTime=null;ie.prototype.visitIntervalYearMonth=null;ie.prototype.visitIntervalMonthDayNano=null;ie.prototype.visitDuration=null;ie.prototype.visitDurationSecond=null;ie.prototype.visitDurationMillisecond=null;ie.prototype.visitDurationMicrosecond=null;ie.prototype.visitDurationNanosecond=null});var mb={};Jt(mb,{float64ToUint16:()=>hh,uint16ToFloat64:()=>gp});function gp(e){let t=(e&31744)>>10,r=(e&1023)/1024,n=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return n*(r?Number.NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*Math.pow(2,t-15)*(1+r)}function hh(e){if(e!==e)return 32256;u6[0]=e;let t=(du[1]&2147483648)>>16&65535,r=du[1]&2146435072,n=0;return r>=1089470464?du[0]>0?r=31744:(r=(r&2080374784)>>16,n=(du[1]&1048575)>>10):r<=1056964608?(n=1048576+(du[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(du[1]&1048575)+512>>10),t|r|n&65535}var u6,du,dh=p(()=>{u6=new Float64Array(1),du=new Uint32Array(u6.buffer)});function be(e){return(t,r,n)=>{if(t.setValid(r,n!=null))return e(t,r,n)}}var de,yW,f6,bW,rs,pb,h6,wW,yp,bp,gb,d6,xW,m6,_W,p6,SW,yb,wp,xp,_p,Sp,bb,Mp,vp,Ep,Tp,wb,xb,g6,MW,vW,EW,TW,AW,IW,PW,y6,b6,RW,_b,Ap,Ip,Pp,Rp,Lp,Op,Bp,Sb,LW,Lr,ri=p(()=>{zr();Pn();wo();Xo();dh();Nt();at();de=class extends ie{};yW=(e,t,r)=>{e[t]=Math.floor(r/864e5)},f6=(e,t,r,n)=>{if(r+1<t.length){let i=Le(t[r]),o=Le(t[r+1]);e.set(n.subarray(0,o-i),i)}},bW=({offset:e,values:t},r,n)=>{let i=e+r;n?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},rs=({values:e},t,r)=>{e[t]=r},pb=({values:e},t,r)=>{e[t]=r},h6=({values:e},t,r)=>{e[t]=hh(r)},wW=(e,t,r)=>{switch(e.type.precision){case He.HALF:return h6(e,t,r);case He.SINGLE:case He.DOUBLE:return pb(e,t,r)}},yp=({values:e},t,r)=>{yW(e,t,r.valueOf())},bp=({values:e},t,r)=>{e[t]=BigInt(r)},gb=({stride:e,values:t},r,n)=>{t.set(n.subarray(0,e),e*r)},d6=({values:e,valueOffsets:t},r,n)=>f6(e,t,r,n),xW=e=>{let t=e.variadicBuffers;return(!Array.isArray(t)||Object.isFrozen(t))&&(t=Array.from(t),e.variadicBuffers=t),t},m6=(e,t,r)=>{var n,i,o,s;let a=e.values;if(!a)throw new Error("BinaryView data is missing view buffer");let c=Ee.ELEMENT_WIDTH,l=t*c,u=l+c;if(l<0||u>a.length)throw new RangeError(`BinaryView index ${t} out of bounds`);a.fill(0,l,u);let h=new DataView(a.buffer,a.byteOffset+l,c),d=r.length;if(h.setInt32(Ee.LENGTH_OFFSET,d,!0),d<=Ee.INLINE_CAPACITY){a.set(r,l+Ee.INLINE_OFFSET);return}let m=((n=r[0])!==null&&n!==void 0?n:0)|((i=r[1])!==null&&i!==void 0?i:0)<<8|((o=r[2])!==null&&o!==void 0?o:0)<<16|((s=r[3])!==null&&s!==void 0?s:0)<<24;h.setUint32(Ee.INLINE_OFFSET,m>>>0,!0);let g=xW(e),y=r.slice(),b=g.push(y)-1;h.setInt32(Ee.BUFFER_INDEX_OFFSET,b,!0),h.setInt32(Ee.BUFFER_OFFSET_OFFSET,0,!0)},_W=(e,t,r)=>{let n=r instanceof Uint8Array?r:new Uint8Array(r);m6(e,t,n)},p6=({values:e,valueOffsets:t},r,n)=>f6(e,t,r,qn(n)),SW=(e,t,r)=>{let n=qn(r);m6(e,t,n)},yb=(e,t,r)=>{e.type.unit===st.DAY?yp(e,t,r):bp(e,t,r)},wp=({values:e},t,r)=>{e[t]=BigInt(r/1e3)},xp=({values:e},t,r)=>{e[t]=BigInt(r)},_p=({values:e},t,r)=>{e[t]=BigInt(r*1e3)},Sp=({values:e},t,r)=>{e[t]=BigInt(r*1e6)},bb=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return wp(e,t,r);case q.MILLISECOND:return xp(e,t,r);case q.MICROSECOND:return _p(e,t,r);case q.NANOSECOND:return Sp(e,t,r)}},Mp=({values:e},t,r)=>{e[t]=r},vp=({values:e},t,r)=>{e[t]=r},Ep=({values:e},t,r)=>{e[t]=r},Tp=({values:e},t,r)=>{e[t]=r},wb=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return Mp(e,t,r);case q.MILLISECOND:return vp(e,t,r);case q.MICROSECOND:return Ep(e,t,r);case q.NANOSECOND:return Tp(e,t,r)}},xb=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},g6=(e,t,r)=>{let n=e.children[0],i=e.valueOffsets,o=Lr.getVisitFn(n),s=Le(i[t]),a=Le(i[t+1]);if(Array.isArray(r))for(let c=-1,l=s;l<a;)o(n,l++,r[++c]);else for(let c=-1,l=s;l<a;)o(n,l++,r.get(++c))},MW=(e,t,r)=>{let n=e.children[0],{valueOffsets:i}=e,o=Lr.getVisitFn(n),{[t]:s,[t+1]:a}=i,c=r instanceof Map?r.entries():Object.entries(r);for(let l of c)if(o(n,s,l),++s>=a)break},vW=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[o]),EW=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(o)),TW=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(i.name)),AW=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[i.name]),IW=(e,t,r)=>{let n=e.type.children.map(o=>Lr.getVisitFn(o.type)),i=r instanceof Map?TW(t,r):r instanceof $?EW(t,r):Array.isArray(r)?vW(t,r):AW(t,r);e.type.children.forEach((o,s)=>i(n[s],e.children[s],o,s))},PW=(e,t,r)=>{e.type.mode===Ze.Dense?y6(e,t,r):b6(e,t,r)},y6=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];Lr.visit(i,e.valueOffsets[t],r)},b6=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];Lr.visit(i,t,r)},RW=(e,t,r)=>{var n;(n=e.dictionary)===null||n===void 0||n.set(e.values[t],r)},_b=(e,t,r)=>{switch(e.type.unit){case ke.YEAR_MONTH:return Ip(e,t,r);case ke.DAY_TIME:return Ap(e,t,r);case ke.MONTH_DAY_NANO:return Pp(e,t,r)}},Ap=({values:e},t,r)=>{e.set(r.subarray(0,2),2*t)},Ip=({values:e},t,r)=>{e[t]=r[0]*12+r[1]%12},Pp=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},Rp=({values:e},t,r)=>{e[t]=r},Lp=({values:e},t,r)=>{e[t]=r},Op=({values:e},t,r)=>{e[t]=r},Bp=({values:e},t,r)=>{e[t]=r},Sb=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return Rp(e,t,r);case q.MILLISECOND:return Lp(e,t,r);case q.MICROSECOND:return Op(e,t,r);case q.NANOSECOND:return Bp(e,t,r)}},LW=(e,t,r)=>{let{stride:n}=e,i=e.children[0],o=Lr.getVisitFn(i);if(Array.isArray(r))for(let s=-1,a=t*n;++s<n;)o(i,a+s,r[s]);else for(let s=-1,a=t*n;++s<n;)o(i,a+s,r.get(s))};de.prototype.visitBool=be(bW);de.prototype.visitInt=be(rs);de.prototype.visitInt8=be(rs);de.prototype.visitInt16=be(rs);de.prototype.visitInt32=be(rs);de.prototype.visitInt64=be(rs);de.prototype.visitUint8=be(rs);de.prototype.visitUint16=be(rs);de.prototype.visitUint32=be(rs);de.prototype.visitUint64=be(rs);de.prototype.visitFloat=be(wW);de.prototype.visitFloat16=be(h6);de.prototype.visitFloat32=be(pb);de.prototype.visitFloat64=be(pb);de.prototype.visitUtf8=be(p6);de.prototype.visitLargeUtf8=be(p6);de.prototype.visitUtf8View=be(SW);de.prototype.visitBinary=be(d6);de.prototype.visitLargeBinary=be(d6);de.prototype.visitBinaryView=be(_W);de.prototype.visitFixedSizeBinary=be(gb);de.prototype.visitDate=be(yb);de.prototype.visitDateDay=be(yp);de.prototype.visitDateMillisecond=be(bp);de.prototype.visitTimestamp=be(bb);de.prototype.visitTimestampSecond=be(wp);de.prototype.visitTimestampMillisecond=be(xp);de.prototype.visitTimestampMicrosecond=be(_p);de.prototype.visitTimestampNanosecond=be(Sp);de.prototype.visitTime=be(wb);de.prototype.visitTimeSecond=be(Mp);de.prototype.visitTimeMillisecond=be(vp);de.prototype.visitTimeMicrosecond=be(Ep);de.prototype.visitTimeNanosecond=be(Tp);de.prototype.visitDecimal=be(xb);de.prototype.visitList=be(g6);de.prototype.visitLargeList=be(g6);de.prototype.visitStruct=be(IW);de.prototype.visitUnion=be(PW);de.prototype.visitDenseUnion=be(y6);de.prototype.visitSparseUnion=be(b6);de.prototype.visitDictionary=be(RW);de.prototype.visitInterval=be(_b);de.prototype.visitIntervalDayTime=be(Ap);de.prototype.visitIntervalYearMonth=be(Ip);de.prototype.visitIntervalMonthDayNano=be(Pp);de.prototype.visitDuration=be(Sb);de.prototype.visitDurationSecond=be(Rp);de.prototype.visitDurationMillisecond=be(Lp);de.prototype.visitDurationMicrosecond=be(Op);de.prototype.visitDurationNanosecond=be(Bp);de.prototype.visitFixedSizeList=be(LW);de.prototype.visitMap=be(MW);Lr=new de});var Vi,mu,_o,Mb,vb,OW,Cp=p(()=>{oh();bc();ri();Vi=Symbol.for("parent"),mu=Symbol.for("rowIndex"),_o=class{constructor(t,r){return this[Vi]=t,this[mu]=r,new Proxy(this,OW)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[mu],r=this[Vi],n=r.type.children,i={};for(let o=-1,s=n.length;++o<s;)i[n[o].name]=ir.visit(r.children[o],t);return i}toString(){return`{${[...this].map(([t,r])=>`${Gi(t)}: ${Gi(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Mb(this[Vi],this[mu])}},Mb=class{constructor(t,r){this.childIndex=0,this.children=t.children,this.rowIndex=r,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,ir.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(_o.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Vi]:{writable:!0,enumerable:!1,configurable:!1,value:null},[mu]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});vb=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Vi].type.children.map(r=>r.name)}has(t,r){return t[Vi].type.children.some(n=>n.name===r)}getOwnPropertyDescriptor(t,r){if(t[Vi].type.children.some(n=>n.name===r))return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[Vi].type.children.findIndex(i=>i.name===r);if(n!==-1){let i=ir.visit(t[Vi].children[n],t[mu]);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[Vi].type.children.findIndex(o=>o.name===r);return i!==-1?(Lr.visit(t[Vi].children[i],t[mu],n),Reflect.set(t,r,n)):Reflect.has(t,r)||typeof r=="symbol"?Reflect.set(t,r,n):!1}},OW=new vb});function ge(e){return(t,r)=>t.getValid(r)?e(t,r):null}var le,BW,pu,CW,DW,w6,NW,x6,_6,ha,FW,S6,GW,M6,v6,kW,E6,UW,jW,zW,qW,T6,A6,I6,P6,VW,R6,L6,O6,B6,WW,HW,C6,$W,KW,XW,D6,N6,YW,ZW,F6,G6,k6,U6,j6,z6,q6,JW,QW,ir,bc=p(()=>{pp();zr();Pn();mh();Cp();wo();Xo();dh();Nt();le=class extends ie{};BW=(e,t)=>864e5*e[t],pu=16,CW=12,DW=(e,t)=>null,w6=(e,t,r)=>{if(r+1>=t.length)return null;let n=Le(t[r]),i=Le(t[r+1]);return e.subarray(n,i)},NW=({offset:e,values:t},r)=>{let n=e+r;return(t[n>>3]&1<<n%8)!==0},x6=({values:e},t)=>BW(e,t),_6=({values:e},t)=>Le(e[t]),ha=({stride:e,values:t},r)=>t[e*r],FW=({stride:e,values:t},r)=>gp(t[e*r]),S6=({values:e},t)=>e[t],GW=({stride:e,values:t},r)=>t.subarray(e*r,e*(r+1)),M6=({values:e,valueOffsets:t},r)=>w6(e,t,r),v6=(e,t)=>{var r;let n=e.values;if(!n)throw new Error("BinaryView data is missing view buffer");let i=t*pu,o=i+pu;if(i<0||o>n.length)throw new Error(`BinaryView data buffer is too short: expected ${pu} bytes, got ${Math.max(0,n.length-i)}`);let s=n.subarray(i,o);if(s.length<pu)throw new Error(`BinaryView data buffer is too short: expected ${pu} bytes, got ${s.length}`);let a=new DataView(n.buffer,s.byteOffset,pu),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=CW)return s.subarray(4,4+c);let l=a.getInt32(8,!0),u=a.getInt32(12,!0),h=(r=e.variadicBuffers)===null||r===void 0?void 0:r[l];if(!h)throw new Error(`BinaryView variadic buffer ${l} is missing`);return h.subarray(u,u+c)},kW=(e,t)=>v6(e,t),E6=({values:e,valueOffsets:t},r)=>{let n=w6(e,t,r);return n!==null?nu(n):null},UW=(e,t)=>{let r=v6(e,t);return nu(r)},jW=({values:e},t)=>e[t],zW=({type:e,values:t},r)=>e.precision!==He.HALF?t[r]:gp(t[r]),qW=(e,t)=>e.type.unit===st.DAY?x6(e,t):_6(e,t),T6=({values:e},t)=>1e3*Le(e[t]),A6=({values:e},t)=>Le(e[t]),I6=({values:e},t)=>ub(e[t],BigInt(1e3)),P6=({values:e},t)=>ub(e[t],BigInt(1e6)),VW=(e,t)=>{switch(e.type.unit){case q.SECOND:return T6(e,t);case q.MILLISECOND:return A6(e,t);case q.MICROSECOND:return I6(e,t);case q.NANOSECOND:return P6(e,t)}},R6=({values:e},t)=>e[t],L6=({values:e},t)=>e[t],O6=({values:e},t)=>e[t],B6=({values:e},t)=>e[t],WW=(e,t)=>{switch(e.type.unit){case q.SECOND:return R6(e,t);case q.MILLISECOND:return L6(e,t);case q.MICROSECOND:return O6(e,t);case q.NANOSECOND:return B6(e,t)}},HW=({values:e,stride:t},r)=>yc.decimal(e.subarray(t*r,t*(r+1))),C6=(e,t)=>{let{valueOffsets:r,stride:n,children:i}=e,o=Le(r[t*n]),s=Le(r[t*n+1]),c=i[0].slice(o,s-o);return new $([c])},$W=(e,t)=>{let{valueOffsets:r,children:n}=e,{[t]:i,[t+1]:o}=r,s=n[0];return new bi(s.slice(i,o-i))},KW=(e,t)=>new _o(e,t),XW=(e,t)=>e.type.mode===Ze.Dense?D6(e,t):N6(e,t),D6=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return ir.visit(n,e.valueOffsets[t])},N6=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return ir.visit(n,t)},YW=(e,t)=>{var r;return(r=e.dictionary)===null||r===void 0?void 0:r.get(e.values[t])},ZW=(e,t)=>e.type.unit===ke.MONTH_DAY_NANO?k6(e,t):e.type.unit===ke.DAY_TIME?F6(e,t):G6(e,t),F6=({values:e},t)=>e.subarray(2*t,2*(t+1)),G6=({values:e},t)=>{let r=e[t],n=new Int32Array(2);return n[0]=Math.trunc(r/12),n[1]=Math.trunc(r%12),n},k6=({values:e},t)=>e.subarray(4*t,4*(t+1)),U6=({values:e},t)=>e[t],j6=({values:e},t)=>e[t],z6=({values:e},t)=>e[t],q6=({values:e},t)=>e[t],JW=(e,t)=>{switch(e.type.unit){case q.SECOND:return U6(e,t);case q.MILLISECOND:return j6(e,t);case q.MICROSECOND:return z6(e,t);case q.NANOSECOND:return q6(e,t)}},QW=(e,t)=>{let{stride:r,children:n}=e,o=n[0].slice(t*r,r);return new $([o])};le.prototype.visitNull=ge(DW);le.prototype.visitBool=ge(NW);le.prototype.visitInt=ge(jW);le.prototype.visitInt8=ge(ha);le.prototype.visitInt16=ge(ha);le.prototype.visitInt32=ge(ha);le.prototype.visitInt64=ge(S6);le.prototype.visitUint8=ge(ha);le.prototype.visitUint16=ge(ha);le.prototype.visitUint32=ge(ha);le.prototype.visitUint64=ge(S6);le.prototype.visitFloat=ge(zW);le.prototype.visitFloat16=ge(FW);le.prototype.visitFloat32=ge(ha);le.prototype.visitFloat64=ge(ha);le.prototype.visitUtf8=ge(E6);le.prototype.visitLargeUtf8=ge(E6);le.prototype.visitUtf8View=ge(UW);le.prototype.visitBinary=ge(M6);le.prototype.visitLargeBinary=ge(M6);le.prototype.visitBinaryView=ge(kW);le.prototype.visitFixedSizeBinary=ge(GW);le.prototype.visitDate=ge(qW);le.prototype.visitDateDay=ge(x6);le.prototype.visitDateMillisecond=ge(_6);le.prototype.visitTimestamp=ge(VW);le.prototype.visitTimestampSecond=ge(T6);le.prototype.visitTimestampMillisecond=ge(A6);le.prototype.visitTimestampMicrosecond=ge(I6);le.prototype.visitTimestampNanosecond=ge(P6);le.prototype.visitTime=ge(WW);le.prototype.visitTimeSecond=ge(R6);le.prototype.visitTimeMillisecond=ge(L6);le.prototype.visitTimeMicrosecond=ge(O6);le.prototype.visitTimeNanosecond=ge(B6);le.prototype.visitDecimal=ge(HW);le.prototype.visitList=ge(C6);le.prototype.visitLargeList=ge(C6);le.prototype.visitStruct=ge(KW);le.prototype.visitUnion=ge(XW);le.prototype.visitDenseUnion=ge(D6);le.prototype.visitSparseUnion=ge(N6);le.prototype.visitDictionary=ge(YW);le.prototype.visitInterval=ge(ZW);le.prototype.visitIntervalDayTime=ge(F6);le.prototype.visitIntervalYearMonth=ge(G6);le.prototype.visitIntervalMonthDayNano=ge(k6);le.prototype.visitDuration=ge(JW);le.prototype.visitDurationSecond=ge(U6);le.prototype.visitDurationMillisecond=ge(j6);le.prototype.visitDurationMicrosecond=ge(z6);le.prototype.visitDurationNanosecond=ge(q6);le.prototype.visitFixedSizeList=ge(QW);le.prototype.visitMap=ge($W);ir=new le});var da,yu,gu,Eb,bi,Tb,Ab,mh=p(()=>{zr();oh();bc();ri();da=Symbol.for("keys"),yu=Symbol.for("vals"),gu=Symbol.for("kKeysAsStrings"),Eb=Symbol.for("_kKeysAsStrings"),bi=class{constructor(t){return this[da]=new $([t.children[0]]).memoize(),this[yu]=t.children[1],new Proxy(this,new Ab)}get[gu](){return this[Eb]||(this[Eb]=Array.from(this[da].toArray(),String))}[Symbol.iterator](){return new Tb(this[da],this[yu])}get size(){return this[da].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[da],r=this[yu],n={};for(let i=-1,o=t.length;++i<o;)n[t.get(i)]=ir.visit(r,i);return n}toString(){return`{${[...this].map(([t,r])=>`${Gi(t)}: ${Gi(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Tb=class{constructor(t,r){this.keys=t,this.vals=r,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){let t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),ir.visit(this.vals,t)]})}},Ab=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[gu]}has(t,r){return t[gu].includes(r)}getOwnPropertyDescriptor(t,r){if(t[gu].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[gu].indexOf(r);if(n!==-1){let i=ir.visit(Reflect.get(t,yu),n);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[gu].indexOf(r);return i!==-1?(Lr.visit(Reflect.get(t,yu),i,n),Reflect.set(t,r,n)):Reflect.has(t,r)?Reflect.set(t,r,n):!1}};Object.defineProperties(bi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[da]:{writable:!0,enumerable:!1,configurable:!1,value:null},[yu]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Eb]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var Ib={};Jt(Ib,{clampRange:()=>ph,createElementComparator:()=>ma,wrapIndex:()=>wc});function ph(e,t,r,n){let{length:i=0}=e,o=typeof t!="number"?0:t,s=typeof r!="number"?i:r;return o<0&&(o=(o%i+i)%i),s<0&&(s=(s%i+i)%i),s<o&&(V6=o,o=s,s=V6),s>i&&(s=i),n?n(e,o,s):[o,s]}function ma(e){if(typeof e!=="object"||e===null)return W6(e)?W6:r=>r===e;if(e instanceof Date){let r=e.valueOf();return n=>n instanceof Date?n.valueOf()===r:!1}return ArrayBuffer.isView(e)?r=>r?R2(e,r):!1:e instanceof Map?tH(e):Array.isArray(e)?eH(e):e instanceof $?rH(e):nH(e,!0)}function eH(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=ma(e[r]);return Dp(t)}function tH(e){let t=-1,r=[];for(let n of e.values())r[++t]=ma(n);return Dp(r)}function rH(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=ma(e.get(r));return Dp(t)}function nH(e,t=!1){let r=Object.keys(e);if(!t&&r.length===0)return()=>!1;let n=[];for(let i=-1,o=r.length;++i<o;)n[i]=ma(e[r[i]]);return Dp(n,r)}function Dp(e,t){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return iH(e,r);case Map:return H6(e,r,r.keys());case bi:case _o:case Object:case void 0:return H6(e,r,t||Object.keys(r))}return r instanceof $?oH(e,r):!1}}function iH(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++n<r;)if(!e[n](t[n]))return!1;return!0}function oH(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++n<r;)if(!e[n](t.get(n)))return!1;return!0}function H6(e,t,r){let n=r[Symbol.iterator](),i=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),s=0,a=e.length,c=o.next(),l=n.next(),u=i.next();for(;s<a&&!l.done&&!u.done&&!c.done&&!(l.value!==u.value||!e[s](c.value));++s,l=n.next(),u=i.next(),c=o.next());return s===a&&l.done&&u.done&&c.done?!0:(n.return&&n.return(),i.return&&i.return(),o.return&&o.return(),!1)}var V6,wc,W6,bu=p(()=>{zr();mh();Cp();dr();wc=(e,t)=>e<0?t+e:e,W6=e=>e!==e});var Pb={};Jt(Pb,{BitIterator:()=>So,getBit:()=>Fp,getBool:()=>wu,packBools:()=>_c,popcnt_array:()=>$6,popcnt_bit_range:()=>gh,popcnt_uint32:()=>Np,setBool:()=>sH,truncateBitmap:()=>xc});function wu(e,t,r,n){return(r&1<<n)!==0}function Fp(e,t,r,n){return(r&1<<n)>>n}function sH(e,t,r){return r?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function xc(e,t,r){let n=r.byteLength+7&-8;if(e>0||r.byteLength<n){let i=new Uint8Array(n);return i.set(e%8===0?r.subarray(e>>3):_c(new So(r,e,t,null,wu)).subarray(0,n)),i}return r}function _c(e){let t=[],r=0,n=0,i=0;for(let s of e)s&&(i|=1<<n),++n===8&&(t[r++]=i,i=n=0);(r===0||n>0)&&(t[r++]=i);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}function gh(e,t,r){if(r-t<=0)return 0;if(r-t<8){let o=0;for(let s of new So(e,t,r-t,e,Fp))o+=s;return o}let n=r>>3<<3,i=t+(t%8===0?0:8-t%8);return gh(e,t,i)+gh(e,n,r)+$6(e,i>>3,n-i>>3)}function $6(e,t,r){let n=0,i=Math.trunc(t),o=new DataView(e.buffer,e.byteOffset,e.byteLength),s=r===void 0?e.byteLength:i+r;for(;s-i>=4;)n+=Np(o.getUint32(i)),i+=4;for(;s-i>=2;)n+=Np(o.getUint16(i)),i+=2;for(;s-i>=1;)n+=Np(o.getUint8(i)),i+=1;return n}function Np(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var So,Sc=p(()=>{So=class{constructor(t,r,n,i,o){this.bytes=t,this.length=n,this.context=i,this.get=o,this.bit=r%8,this.byteIndex=r>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function te(e){return cH.visit(e)}var aH,K6,ce,Rb,cH,wi=p(()=>{zr();Nt();at();Sc();at();Pn();dr();aH=-1,K6=Symbol.for("apache-arrow/Data"),ce=class e{static isData(t){return(t==null?void 0:t[K6])===!0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:t}=this;return z.isSparseUnion(t)?this.children.some(r=>r.nullable):z.isDenseUnion(t)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:r,values:n,nullBitmap:i,typeIds:o}=this;return r&&(t+=r.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),t+=this.variadicBuffers.reduce((s,a)=>{var c;return s+((c=a==null?void 0:a.byteLength)!==null&&c!==void 0?c:0)},0),this.children.reduce((s,a)=>s+a.byteLength,t)}get nullCount(){if(z.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,r;return t<=aH&&(r=this.nullBitmap)&&(this._nullCount=t=r.length===0?0:this.length-gh(r,this.offset,this.offset+this.length)),t}constructor(t,r,n,i,o,s=[],a,c=[]){var l;this.type=t,this.children=s,this.dictionary=a,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let u;o instanceof e?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets,this.variadicBuffers=o.variadicBuffers):(this.stride=ti(t),o&&((u=o[0])&&(this.valueOffsets=u),(u=o[1])&&(this.values=u),(u=o[2])&&(this.nullBitmap=u),(u=o[3])&&(this.typeIds=u)),this.variadicBuffers=c),(l=this.variadicBuffers)!==null&&l!==void 0||(this.variadicBuffers=[])}getValid(t){let{type:r}=this;if(z.isUnion(r)){let n=r,i=this.typeIds[t],o=n.typeIdToChildIndex[i],s=this.children[o],a=this.valueOffsets,c=n.mode===Ze.Dense&&a?Number(a[t]):t;return s.getValid(c)}if(this.nullable&&this.nullCount>0){let n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(t,r){let n,{type:i}=this;if(z.isUnion(i)){let o=i,s=this.typeIds[t],a=o.typeIdToChildIndex[s],c=this.children[a],l=this.valueOffsets,u=o.mode===Ze.Dense&&l?Number(l[t]):t;n=c.getValid(u),c.setValid(u,r)}else{let{nullBitmap:o}=this,{offset:s,length:a}=this,c=s+t,l=1<<c%8,u=c>>3;(!o||o.byteLength<=u)&&(o=new Uint8Array((s+a+63&-64)>>3).fill(255),this.nullCount>0?(o.set(xc(s,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:o})):Object.assign(this,{nullBitmap:o,_nullCount:0}));let h=o[u];n=(h&l)!==0,o[u]=r?h|l:h&~l}return n!==!!r&&(this._nullCount=this.nullCount+(r?-1:1)),r}clone(t=this.type,r=this.offset,n=this.length,i=this._nullCount,o=this,s=this.children,a=this.variadicBuffers){return new e(t,r,n,i,o,s,this.dictionary,a)}slice(t,r){let{stride:n,typeId:i,children:o}=this,s=+(this._nullCount===0)-1,a=i===16?n:1,c=this._sliceBuffers(t,r,n,i);return this.clone(this.type,this.offset+t,r,s,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*t,a*r),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===x.Null)return this.clone(this.type,0,t,0,this.buffers,this.children,this.variadicBuffers);let{length:r,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,r>>3);i[r>>3]=(1<<r-(r&-8))-1,n>0&&i.set(xc(this.offset,r,this.nullBitmap),0);let o=this.buffers;return o[Ne.VALIDITY]=i,this.clone(this.type,0,t,n+(t-r),o,this.children,this.variadicBuffers)}_sliceBuffers(t,r,n,i){let o,{buffers:s}=this;if((o=s[Ne.TYPE])&&(s[Ne.TYPE]=o.subarray(t,t+r)),z.isBinaryView(this.type)||z.isUtf8View(this.type)){let a=Ee.ELEMENT_WIDTH;(o=s[Ne.DATA])&&(s[Ne.DATA]=o.subarray(t*a,(t+r)*a))}else(o=s[Ne.OFFSET])&&(s[Ne.OFFSET]=o.subarray(t,t+r+1))||(o=s[Ne.DATA])&&(s[Ne.DATA]=i===6?o:o.subarray(n*t,n*(t+r)));return s}_sliceChildren(t,r,n){return t.map(i=>i.slice(r,n))}};ce.prototype.children=Object.freeze([]);ce.prototype[K6]=!0;Object.defineProperty(ce,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ce&&ce.isData(t)}});Rb=class e extends ie{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:r,["offset"]:n=0,["length"]:i=0}=t;return new ce(r,n,i,i)}visitBool(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitInt(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitFloat(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitUtf8(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=pc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,i,o])}visitUtf8View(t){var r;let{["type"]:n,["offset"]:i=0}=t,o=Re(n.ArrayType,t.views),s=se(t.nullBitmap),a=(t.variadicBuffers||[]).map(u=>se(u)),c=(r=t.length)!==null&&r!==void 0?r:Math.trunc(o.length/on.ELEMENT_WIDTH),l=t.nullBitmap?-1:0;return new ce(n,i,c,l,[void 0,o,s],[],void 0,a)}visitLargeUtf8(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=Wf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,i,o])}visitBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=pc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,i,o])}visitBinaryView(t){var r;let{["type"]:n,["offset"]:i=0}=t,o=Re(n.ArrayType,t.views),s=se(t.nullBitmap),a=(t.variadicBuffers||[]).map(u=>se(u)),c=(r=t.length)!==null&&r!==void 0?r:Math.trunc(o.length/Ee.ELEMENT_WIDTH),l=t.nullBitmap?-1:0;return new ce(n,i,c,l,[void 0,o,s],[],void 0,a)}visitLargeBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=Wf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,i,o])}visitFixedSizeBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitDate(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitTimestamp(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitTime(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitDecimal(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitList(t){let{["type"]:r,["offset"]:n=0,["child"]:i}=t,o=se(t.nullBitmap),s=pc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,void 0,o],[i])}visitLargeList(t){let{["type"]:r,["offset"]:n=0,["child"]:i}=t,o=se(t.nullBitmap),s=Wf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,void 0,o],[i])}visitStruct(t){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=t,o=se(t.nullBitmap),{length:s=i.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,void 0,o],i)}visitUnion(t){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=t,o=Re(r.ArrayType,t.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=t;if(z.isSparseUnion(r))return new ce(r,n,s,a,[void 0,void 0,void 0,o],i);let c=pc(t.valueOffsets);return new ce(r,n,s,a,[c,void 0,void 0,o],i)}visitDictionary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.indices.ArrayType,t.data),{["dictionary"]:s=new $([new e().visit({type:r.dictionary})])}=t,{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[void 0,o,i],[],s)}visitInterval(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitDuration(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitFixedSizeList(t){let{["type"]:r,["offset"]:n=0,["child"]:i=new e().visit({type:r.valueType})}=t,o=se(t.nullBitmap),{["length"]:s=i.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,void 0,o],[i])}visitMap(t){let{["type"]:r,["offset"]:n=0,["child"]:i=new e().visit({type:r.childType})}=t,o=se(t.nullBitmap),s=pc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,void 0,o],[i])}},cH=new Rb});function X6(e){return e.some(t=>t.nullable)}function Gp(e){return e.reduce((t,r)=>t+r.nullCount,0)}function kp(e){return e.reduce((t,r,n)=>(t[n+1]=t[n]+r.length,t),new Uint32Array(e.length+1))}function Up(e,t,r,n){let i=[];for(let o=-1,s=e.length;++o<s;){let a=e[o],c=t[o],{length:l}=a;if(c>=n)break;if(r>=c+l)continue;if(c>=r&&c+l<=n){i.push(a);continue}let u=Math.max(0,r-c),h=Math.min(n-c,l);i.push(a.slice(u,h-u))}return i.length===0&&i.push(e[0].slice(0,0)),i}function Lb(e,t,r,n){let i=0,o=0,s=t.length-1;do{if(i>=s-1)return r<t[s]?n(e,i,r-t[i]):null;o=i+Math.trunc((s-i)*.5),r<t[o]?s=o:i=o}while(i<s)}function bh(e,t){return e.getValid(t)}function xu(e){function t(r,n,i){return e(r[n],i)}return function(r){let n=this.data;return Lb(n,this._offsets,r,t)}}function jp(e){let t;function r(n,i,o){return e(n[i],o,t)}return function(n,i){let o=this.data;t=i;let s=Lb(o,this._offsets,n,r);return t=void 0,s}}function zp(e){let t;function r(n,i,o){let s=o,a=0,c=0;for(let l=i-1,u=n.length;++l<u;){let h=n[l];if(~(a=e(h,t,s)))return c+a;s=0,c+=h.length}return-1}return function(n,i){t=n;let o=this.data,s=typeof i!="number"?r(o,0,0):Lb(o,this._offsets,i,r);return t=void 0,s}}var yh,qp=p(()=>{yh=class{constructor(t=0,r){this.numChunks=t,this.getChunkIterator=r,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function lH(e,t){return t===null&&e.length>0?0:-1}function uH(e,t){let{nullBitmap:r}=e;if(!r||e.nullCount<=0)return-1;let n=0;for(let i of new So(r,e.offset+(t||0),e.length,r,wu)){if(!i)return n;++n}return-1}function xe(e,t,r){if(t===void 0)return-1;if(t===null)switch(e.typeId){case x.Union:break;case x.Dictionary:break;default:return uH(e,r)}let n=ir.getVisitFn(e),i=ma(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}function Y6(e,t,r){let n=ir.getVisitFn(e),i=ma(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}var ue,Mc,Vp=p(()=>{Nt();Pn();bc();Sc();bu();ue=class extends ie{};ue.prototype.visitNull=lH;ue.prototype.visitBool=xe;ue.prototype.visitInt=xe;ue.prototype.visitInt8=xe;ue.prototype.visitInt16=xe;ue.prototype.visitInt32=xe;ue.prototype.visitInt64=xe;ue.prototype.visitUint8=xe;ue.prototype.visitUint16=xe;ue.prototype.visitUint32=xe;ue.prototype.visitUint64=xe;ue.prototype.visitFloat=xe;ue.prototype.visitFloat16=xe;ue.prototype.visitFloat32=xe;ue.prototype.visitFloat64=xe;ue.prototype.visitUtf8=xe;ue.prototype.visitLargeUtf8=xe;ue.prototype.visitUtf8View=xe;ue.prototype.visitBinary=xe;ue.prototype.visitLargeBinary=xe;ue.prototype.visitBinaryView=xe;ue.prototype.visitFixedSizeBinary=xe;ue.prototype.visitDate=xe;ue.prototype.visitDateDay=xe;ue.prototype.visitDateMillisecond=xe;ue.prototype.visitTimestamp=xe;ue.prototype.visitTimestampSecond=xe;ue.prototype.visitTimestampMillisecond=xe;ue.prototype.visitTimestampMicrosecond=xe;ue.prototype.visitTimestampNanosecond=xe;ue.prototype.visitTime=xe;ue.prototype.visitTimeSecond=xe;ue.prototype.visitTimeMillisecond=xe;ue.prototype.visitTimeMicrosecond=xe;ue.prototype.visitTimeNanosecond=xe;ue.prototype.visitDecimal=xe;ue.prototype.visitList=xe;ue.prototype.visitLargeList=xe;ue.prototype.visitStruct=xe;ue.prototype.visitUnion=xe;ue.prototype.visitDenseUnion=Y6;ue.prototype.visitSparseUnion=Y6;ue.prototype.visitDictionary=xe;ue.prototype.visitInterval=xe;ue.prototype.visitIntervalDayTime=xe;ue.prototype.visitIntervalYearMonth=xe;ue.prototype.visitIntervalMonthDayNano=xe;ue.prototype.visitDuration=xe;ue.prototype.visitDurationSecond=xe;ue.prototype.visitDurationMillisecond=xe;ue.prototype.visitDurationMicrosecond=xe;ue.prototype.visitDurationNanosecond=xe;ue.prototype.visitFixedSizeList=xe;ue.prototype.visitMap=xe;Mc=new ue});function ye(e){let{type:t}=e;if(e.nullCount===0&&e.stride===1&&(z.isInt(t)&&t.bitWidth!==64||z.isTime(t)&&t.bitWidth!==64||z.isFloat(t)&&t.precision!==He.HALF))return new yh(e.data.length,n=>{let i=e.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let r=0;return new yh(e.data.length,n=>{let o=e.data[n].length,s=e.slice(r,r+o);return r+=o,new Ob(s)})}var fe,Ob,_u,Wp=p(()=>{Pn();Nt();at();qp();fe=class extends ie{};Ob=class{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};fe.prototype.visitNull=ye;fe.prototype.visitBool=ye;fe.prototype.visitInt=ye;fe.prototype.visitInt8=ye;fe.prototype.visitInt16=ye;fe.prototype.visitInt32=ye;fe.prototype.visitInt64=ye;fe.prototype.visitUint8=ye;fe.prototype.visitUint16=ye;fe.prototype.visitUint32=ye;fe.prototype.visitUint64=ye;fe.prototype.visitFloat=ye;fe.prototype.visitFloat16=ye;fe.prototype.visitFloat32=ye;fe.prototype.visitFloat64=ye;fe.prototype.visitUtf8=ye;fe.prototype.visitLargeUtf8=ye;fe.prototype.visitUtf8View=ye;fe.prototype.visitBinary=ye;fe.prototype.visitLargeBinary=ye;fe.prototype.visitBinaryView=ye;fe.prototype.visitFixedSizeBinary=ye;fe.prototype.visitDate=ye;fe.prototype.visitDateDay=ye;fe.prototype.visitDateMillisecond=ye;fe.prototype.visitTimestamp=ye;fe.prototype.visitTimestampSecond=ye;fe.prototype.visitTimestampMillisecond=ye;fe.prototype.visitTimestampMicrosecond=ye;fe.prototype.visitTimestampNanosecond=ye;fe.prototype.visitTime=ye;fe.prototype.visitTimeSecond=ye;fe.prototype.visitTimeMillisecond=ye;fe.prototype.visitTimeMicrosecond=ye;fe.prototype.visitTimeNanosecond=ye;fe.prototype.visitDecimal=ye;fe.prototype.visitList=ye;fe.prototype.visitLargeList=ye;fe.prototype.visitStruct=ye;fe.prototype.visitUnion=ye;fe.prototype.visitDenseUnion=ye;fe.prototype.visitSparseUnion=ye;fe.prototype.visitDictionary=ye;fe.prototype.visitInterval=ye;fe.prototype.visitIntervalDayTime=ye;fe.prototype.visitIntervalYearMonth=ye;fe.prototype.visitIntervalMonthDayNano=ye;fe.prototype.visitDuration=ye;fe.prototype.visitDurationSecond=ye;fe.prototype.visitDurationMillisecond=ye;fe.prototype.visitDurationMicrosecond=ye;fe.prototype.visitDurationNanosecond=ye;fe.prototype.visitFixedSizeList=ye;fe.prototype.visitMap=ye;_u=new fe});function Mo(e){if(e){if(e instanceof ce)return new $([e]);if(e instanceof $)return new $(e.data);if(e.type instanceof z)return new $([te(e)]);if(Array.isArray(e))return new $(e.flatMap(t=>fH(t)));if(ArrayBuffer.isView(e)){e instanceof DataView&&(e=new Uint8Array(e.buffer));let t={offset:0,length:e.length,nullCount:-1,data:e};if(e instanceof Int8Array)return new $([te(Object.assign(Object.assign({},t),{type:new Kn}))]);if(e instanceof Int16Array)return new $([te(Object.assign(Object.assign({},t),{type:new Xn}))]);if(e instanceof Int32Array)return new $([te(Object.assign(Object.assign({},t),{type:new Yt}))]);if(e instanceof BigInt64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Yn}))]);if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)return new $([te(Object.assign(Object.assign({},t),{type:new Zn}))]);if(e instanceof Uint16Array)return new $([te(Object.assign(Object.assign({},t),{type:new Jn}))]);if(e instanceof Uint32Array)return new $([te(Object.assign(Object.assign({},t),{type:new rn}))]);if(e instanceof BigUint64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Ui}))]);if(e instanceof Float32Array)return new $([te(Object.assign(Object.assign({},t),{type:new nn}))]);if(e instanceof Float64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Qn}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function fH(e){return e instanceof ce?[e]:e instanceof $?e.data:Mo(e).data}var Z6,J6,Q6,e5,$,Hp,zr=p(()=>{Nt();bu();at();wi();qp();bc();ri();Vp();Wp();at();J6=Symbol.for("apache-arrow/Vector"),Q6={},e5={},$=class e{static isVector(t){return(t==null?void 0:t[J6])===!0}constructor(t){var r,n,i;let o=t[0]instanceof e?t.flatMap(a=>a.data):t;if(o.length===0||o.some(a=>!(a instanceof ce)))throw new TypeError("Vector constructor expects an Array of Data instances.");let s=(r=o[0])===null||r===void 0?void 0:r.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:l}=Q6[s.typeId],u=o[0];this.isValid=h=>bh(u,h),this.get=h=>a(u,h),this.set=(h,d)=>c(u,h,d),this.indexOf=h=>l(u,h),this._offsets=[0,u.length];break}default:Object.setPrototypeOf(this,e5[s.typeId]),this._offsets=kp(o);break}this.data=o,this.type=s,this.stride=ti(s),this.numChildren=(i=(n=s.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,r)=>t+r.byteLength,0)}get nullable(){return X6(this.data)}get nullCount(){return Gp(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${x[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(wc(t,this.length))}set(t,r){}indexOf(t,r){return-1}includes(t,r){return this.indexOf(t,r)>-1}[Symbol.iterator](){return _u.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(t,r){return new e(ph(this,t,r,({data:n,_offsets:i},o,s)=>Up(n,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:t,data:r,length:n,stride:i,ArrayType:o}=this;switch(t.typeId){case x.Int:case x.Float:case x.Decimal:case x.Time:case x.Timestamp:switch(r.length){case 0:return new o;case 1:return r[0].values.subarray(0,n*i);default:return r.reduce((s,{values:a,length:c})=>(s.array.set(a.subarray(0,c*i),s.offset),s.offset+=c*i,s),{array:new o(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new e(this.data.map(({children:r})=>r[t])):null}get isMemoized(){return z.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(z.isDictionary(this.type)){let t=new Hp(this.data[0].dictionary),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return new Hp(this)}unmemoize(){if(z.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return this}};Z6=Symbol.toStringTag;$[Z6]=(e=>{e.type=z.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0,e[J6]=!0;let t=Object.keys(x).map(r=>x[r]).filter(r=>typeof r=="number"&&r!==x.NONE);for(let r of t){let n=ir.getVisitFnByTypeId(r),i=Lr.getVisitFnByTypeId(r),o=Mc.getVisitFnByTypeId(r);Q6[r]={get:n,set:i,indexOf:o},e5[r]=Object.create(e,{isValid:{value:xu(bh)},get:{value:xu(ir.getVisitFnByTypeId(r))},set:{value:jp(Lr.getVisitFnByTypeId(r))},indexOf:{value:zp(Mc.getVisitFnByTypeId(r))}})}return"Vector"})($.prototype);Object.defineProperty($,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===$&&$.isVector(t)}});Hp=class e extends ${constructor(t){super(t.data);let r=this.get,n=this.set,i=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(s){let a=o[s];if(a!==void 0)return a;let c=r.call(this,s);return o[s]=c,c}}),Object.defineProperty(this,"set",{value(s,a){n.call(this,s,a),o[s]=a}}),Object.defineProperty(this,"slice",{value:(s,a)=>new e(i.call(this,s,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new $(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function t5(e){if(!e||e.length<=0)return function(i){return!0};let t="",r=e.filter(n=>n===n);return r.length>0&&(t=`
5
5
  switch (x) {${r.map(n=>`
6
- case ${BW(n)}:`).join("")}
6
+ case ${hH(n)}:`).join("")}
7
7
  return false;
8
8
  }`),e.length!==r.length&&(t=`if (x !== x) return false;
9
9
  ${t}`),new Function("x",`${t}
10
- return true;`)}function BW(e){return typeof e!="bigint"?Ni(e):`${Ni(e)}n`}var O6=p(()=>{nh()});function xb(e,t){let r=Math.ceil(e)*t-1;return(r-r%64+64||64)/t}function B6(e,t=0){return e.length>=t?e.subarray(0,t):zf(new e.constructor(t),e,0)}var Pn,ts,xu,da,qi=p(()=>{fr();Pn=class{constructor(t,r=0,n=1){this.length=Math.ceil(r/n),this.buffer=new t(this.length),this.stride=n,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,r){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let r=this.stride,n=this.length*r,i=this.buffer.length;n>=i&&this._resize(i===0?xb(n*1,this.BYTES_PER_ELEMENT):xb(n*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=xb(t*this.stride,this.BYTES_PER_ELEMENT);let r=B6(this.buffer,t);return this.clear(),r}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=B6(this.buffer,t)}},ts=class extends Pn{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,r){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=r,this}},xu=class extends ts{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,r){let{buffer:n}=this.reserve(t-this.length+1),i=t>>3,o=t%8,s=n[i]>>o&1;return r?s===0&&(n[i]|=1<<o,++this.numValid):s===1&&(n[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},da=class extends ts{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,r){let n=this.length-1,i=this.reserve(t-n+1).buffer;return n<t++&&n>=0&&i.fill(i[n],n,t),i[t]=i[t-1]+r,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(t+1)}}});var at,rr,zr,yt=p(()=>{jr();yi();hh();st();O6();qi();at=class{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}constructor({type:t,nullValues:r}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=r,this.stride=Qn(t),this._nulls=new xu,r&&r.length>0&&(this._isValid=L6(r))}toVector(){return new $([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0,{_offsets:r,_values:n,_nulls:i,_typeIds:o,children:s}=this;return r&&(t+=r.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),s.reduce((a,c)=>a+c.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((r,n)=>r+n.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,r){return this.setValid(t,this.isValid(r))&&this.setValue(t,r),this}setValue(t,r){this._setValue(this,t,r)}setValid(t,r){return this.length=this._nulls.set(t,+r).length,r}addChild(t,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,r,n,i,{type:o,length:s,nullCount:a,_typeIds:c,_offsets:l,_values:u,_nulls:h}=this;(r=c==null?void 0:c.flush(s))?i=l==null?void 0:l.flush(s):(i=l==null?void 0:l.flush(s))?t=u==null?void 0:u.flush(l.last()):t=u==null?void 0:u.flush(s),a>0&&(n=h==null?void 0:h.flush(s));let d=this.children.map(m=>m.flush());return this.clear(),te({type:o,length:s,nullCount:a,children:d,child:d[0],data:t,typeIds:r,nullBitmap:n,valueOffsets:i})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,r,n,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(r=this._values)===null||r===void 0||r.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(let o of this.children)o.clear();return this}};at.prototype.length=1;at.prototype.stride=1;at.prototype.children=null;at.prototype.finished=!1;at.prototype.nullValues=null;at.prototype._isValid=()=>!0;rr=class extends at{constructor(t){super(t),this._values=new ts(this.ArrayType,0,this.stride)}setValue(t,r){let n=this._values;return n.reserve(t-n.length+1),super.setValue(t,r)}},zr=class extends at{constructor(t){super(t),this._pendingLength=0,this._offsets=new da(t.type)}setValue(t,r){let n=this._pending||(this._pending=new Map),i=n.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=r instanceof gi?r[fa].length:r.length,n.set(t,r)}setValid(t,r){return super.setValid(t,r)?!0:((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let t=this._pending,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,r),this}}});var Sc,_b=p(()=>{Sc=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,r,n,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(r??0)),t.offset()}}});var C6,ti,D6=p(()=>{C6=pe(ze(),1);_b();su();n0();X2();ti=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFooter(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,r){return t.setPosition(t.position()+C6.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):nt.V1}schema(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new vn).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}dictionaries(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Sc).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,r){let n=this.bb.__offset(this.bb_pos,10);return n?(r||new Sc).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,r){t.addFieldInt16(0,r,nt.V1)}static addSchema(t,r){t.addFieldOffset(1,r,0)}static addDictionaries(t,r){t.addFieldOffset(2,r,0)}static startDictionariesVector(t,r){t.startVector(24,r,8)}static addRecordBatches(t,r){t.addFieldOffset(3,r,0)}static startRecordBatchesVector(t,r){t.startVector(24,r,8)}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,r){t.finish(r)}static finishSizePrefixedFooterBuffer(t,r){t.finish(r,void 0,!0)}}});function W0(e,t){return new Map([...e||new Map,...t||new Map])}function Sb(e,t=new Map){for(let r=-1,n=e.length;++r<n;){let o=e[r].type;if(z.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&Sb(o.children,t)}return t}var N6,F6,ve,ee,qr=p(()=>{Dt();st();N6=Symbol.for("apache-arrow/Schema"),F6=Symbol.for("apache-arrow/Field"),ve=class e{static isSchema(t){return(t==null?void 0:t[N6])===!0}constructor(t=[],r,n,i=nt.V5){this.fields=t||[],this.metadata=r||new Map,n||(n=Sb(this.fields)),this.dictionaries=n,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,r)=>`${r}: ${t}`).join(", ")} }>`}select(t){let r=new Set(t),n=this.fields.filter(i=>r.has(i.name));return new e(n,this.metadata)}selectAt(t){let r=t.map(n=>this.fields[n]).filter(Boolean);return new e(r,this.metadata)}assign(...t){let r=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),n=[...this.fields],i=W0(W0(new Map,this.metadata),r.metadata),o=r.fields.filter(a=>{let c=n.findIndex(l=>l.name===a.name);return~c?(n[c]=a.clone({metadata:W0(W0(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),s=Sb(o,new Map);return new e([...n,...o],i,new Map([...this.dictionaries,...s]))}};ve.prototype.fields=null;ve.prototype.metadata=null;ve.prototype.dictionaries=null;ve.prototype[N6]=!0;Object.defineProperty(ve,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ve&&ve.isSchema(t)}});ee=class e{static isField(t){return(t==null?void 0:t[F6])===!0}static new(...t){let[r,n,i,o]=t;return t[0]&&typeof t[0]=="object"&&({name:r}=t[0],n===void 0&&(n=t[0].type),i===void 0&&(i=t[0].nullable),o===void 0&&(o=t[0].metadata)),new e(`${r}`,n,i,o)}constructor(t,r,n=!1,i){this.name=t,this.type=r,this.nullable=n,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[r,n,i,o]=t;return!t[0]||typeof t[0]!="object"?[r=this.name,n=this.type,i=this.nullable,o=this.metadata]=t:{name:r=this.name,type:n=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=t[0],e.new(r,n,i,o)}};ee.prototype.type=null;ee.prototype.name=null;ee.prototype.nullable=null;ee.prototype.metadata=null;ee.prototype[F6]=!0;Object.defineProperty(ee,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ee&&ee.isField(t)}})});var H0,CW,DW,rs,Mb,Vi,vb=p(()=>{_b();D6();H0=pe(ze(),1);qr();Dt();fr();yo();CW=H0.Builder,DW=H0.ByteBuffer,rs=class{static decode(t){t=new DW(se(t));let r=ti.getRootAsFooter(t),n=ve.decode(r.schema(),new Map,r.version());return new Mb(n,r)}static encode(t){let r=new CW,n=ve.encode(r,t.schema);ti.startRecordBatchesVector(r,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())Vi.encode(r,s);let i=r.endVector();ti.startDictionariesVector(r,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())Vi.encode(r,s);let o=r.endVector();return ti.startFooter(r),ti.addSchema(r,n),ti.addVersion(r,nt.V5),ti.addRecordBatches(r,i),ti.addDictionaries(r,o),ti.finishFooterBuffer(r,ti.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,r=nt.V5,n,i){this.schema=t,this.version=r,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,r=-1,n=this.numRecordBatches;++r<n;)(t=this.getRecordBatch(r))&&(yield t)}*dictionaryBatches(){for(let t,r=-1,n=this.numDictionaries;++r<n;)(t=this.getDictionaryBatch(r))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}},Mb=class extends rs{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,r){super(t,r.version()),this._footer=r}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let r=this._footer.recordBatches(t);if(r)return Vi.decode(r)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let r=this._footer.dictionaries(t);if(r)return Vi.decode(r)}return null}},Vi=class e{static decode(t){return new e(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,r){let{metaDataLength:n}=r,i=BigInt(r.offset),o=BigInt(r.bodyLength);return Sc.createBlock(t,i,n,o)}constructor(t,r,n){this.metaDataLength=t,this.offset=Le(n),this.bodyLength=Le(r)}}});var G6,ri,k6=p(()=>{G6=pe(ze(),1);su();h0();n0();ri=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMessage(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,r){return t.setPosition(t.position()+G6.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):nt.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):Ge.NONE}header(t){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__union(t,this.bb_pos+r):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Ct).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,r){t.addFieldInt16(0,r,nt.V1)}static addHeaderType(t,r){t.addFieldInt8(1,r,Ge.NONE)}static addHeader(t,r){t.addFieldOffset(2,r,0)}static addBodyLength(t,r){t.addFieldInt64(3,r,BigInt("0"))}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,r){t.finish(r)}static finishSizePrefixedMessageBuffer(t,r){t.finish(r,void 0,!0)}static createMessage(t,r,n,i,o,s){return e.startMessage(t),e.addVersion(t,r),e.addHeaderType(t,n),e.addHeader(t,i),e.addBodyLength(t,o),e.addCustomMetadata(t,s),e.endMessage(t)}}});var Eb,$0,U6=p(()=>{In();JT();u0();z2();RT();OT();qT();CT();oI();aI();$T();G2();F2();W2();H2();q2();k2();XT();WT();eI();$2();N2();U2();j2();V2();Eb=class extends ie{visit(t,r){return t==null||r==null?void 0:super.visit(t,r)}visitNull(t,r){return Qf.startNull(r),Qf.endNull(r)}visitInt(t,r){return Ci.startInt(r),Ci.addBitWidth(r,t.bitWidth),Ci.addIsSigned(r,t.isSigned),Ci.endInt(r)}visitFloat(t,r){return Xs.startFloatingPoint(r),Xs.addPrecision(r,t.precision),Xs.endFloatingPoint(r)}visitBinary(t,r){return Hf.startBinary(r),Hf.endBinary(r)}visitBinaryView(t,r){return $f.startBinaryView(r),$f.endBinaryView(r)}visitLargeBinary(t,r){return Xf.startLargeBinary(r),Xf.endLargeBinary(r)}visitBool(t,r){return Kf.startBool(r),Kf.endBool(r)}visitUtf8(t,r){return th.startUtf8(r),th.endUtf8(r)}visitUtf8View(t,r){return rh.startUtf8View(r),rh.endUtf8View(r)}visitLargeUtf8(t,r){return Zf.startLargeUtf8(r),Zf.endLargeUtf8(r)}visitDecimal(t,r){return go.startDecimal(r),go.addScale(r,t.scale),go.addPrecision(r,t.precision),go.addBitWidth(r,t.bitWidth),go.endDecimal(r)}visitDate(t,r){return Ws.startDate(r),Ws.addUnit(r,t.unit),Ws.endDate(r)}visitTime(t,r){return Zo.startTime(r),Zo.addUnit(r,t.unit),Zo.addBitWidth(r,t.bitWidth),Zo.endTime(r)}visitTimestamp(t,r){let n=t.timezone&&r.createString(t.timezone)||void 0;return Jo.startTimestamp(r),Jo.addUnit(r,t.unit),n!==void 0&&Jo.addTimezone(r,n),Jo.endTimestamp(r)}visitInterval(t,r){return Ys.startInterval(r),Ys.addUnit(r,t.unit),Ys.endInterval(r)}visitDuration(t,r){return Hs.startDuration(r),Hs.addUnit(r,t.unit),Hs.endDuration(r)}visitList(t,r){return Jf.startList(r),Jf.endList(r)}visitLargeList(t,r){return Yf.startLargeList(r),Yf.endLargeList(r)}visitStruct(t,r){return eh.startStruct_(r),eh.endStruct_(r)}visitUnion(t,r){Di.startTypeIdsVector(r,t.typeIds.length);let n=Di.createTypeIdsVector(r,t.typeIds);return Di.startUnion(r),Di.addMode(r,t.mode),Di.addTypeIds(r,n),Di.endUnion(r)}visitDictionary(t,r){let n=this.visit(t.indices,r);return po.startDictionaryEncoding(r),po.addId(r,BigInt(t.id)),po.addIsOrdered(r,t.isOrdered),n!==void 0&&po.addIndexType(r,n),po.endDictionaryEncoding(r)}visitFixedSizeBinary(t,r){return $s.startFixedSizeBinary(r),$s.addByteWidth(r,t.byteWidth),$s.endFixedSizeBinary(r)}visitFixedSizeList(t,r){return Ks.startFixedSizeList(r),Ks.addListSize(r,t.listSize),Ks.endFixedSizeList(r)}visitMap(t,r){return Zs.startMap(r),Zs.addKeysSorted(r,t.keysSorted),Zs.endMap(r)}},$0=new Eb});function V6(e,t=new Map){return new ve(NW(e,t),K0(e.metadata),t)}function Ab(e){return new nr(e.count,H6(e.columns),$6(e.columns),null,K6(e.columns))}function W6(e){return new Vr(Ab(e.data),e.id,e.isDelta)}function NW(e,t){return(e.fields||[]).filter(Boolean).map(r=>ee.fromJSON(r,t))}function j6(e,t){return(e.children||[]).filter(Boolean).map(r=>ee.fromJSON(r,t))}function H6(e){return(e||[]).reduce((t,r)=>[...t,new bi(r.count,FW(r.VALIDITY)),...H6(r.children)],[])}function $6(e,t=[]){for(let r=-1,n=(e||[]).length;++r<n;){let i=e[r];if(i.VALIDITY&&t.push(new Ht(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new Ht(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new Ht(t.length,i.OFFSET.length)),i.DATA&&t.push(new Ht(t.length,i.DATA.length)),i.VIEWS&&t.push(new Ht(t.length,i.VIEWS.length)),i.VARIADIC_DATA_BUFFERS)for(let o of i.VARIADIC_DATA_BUFFERS)t.push(new Ht(t.length,o.length));t=$6(i.children,t)}return t}function FW(e){return(e||[]).reduce((t,r)=>t+ +(r===0),0)}function K6(e){return(e||[]).reduce((t,r)=>[...t,...r.VARIADIC_DATA_BUFFERS?[r.VARIADIC_DATA_BUFFERS.length]:[],...K6(r.children)],[])}function X6(e,t){let r,n,i,o,s,a;return!t||!(o=e.dictionary)?(s=q6(e,j6(e,t)),i=new ee(e.name,s,e.nullable,K0(e.metadata))):t.has(r=o.id)?(n=(n=o.indexType)?z6(n):new Xt,a=new er(t.get(r),n,r,o.isOrdered),i=new ee(e.name,a,e.nullable,K0(e.metadata))):(n=(n=o.indexType)?z6(n):new Xt,t.set(r,s=q6(e,j6(e,t))),a=new er(s,n,r,o.isOrdered),i=new ee(e.name,a,e.nullable,K0(e.metadata))),i||null}function K0(e=[]){return new Map(e.map(({key:t,value:r})=>[t,r]))}function z6(e){return new It(e.isSigned,e.bitWidth)}function q6(e,t){let r=e.type.name;switch(r){case"NONE":return new Vt;case"null":return new Vt;case"binary":return new En;case"largebinary":return new Ui;case"binaryview":return new Ee;case"utf8":return new Fr;case"largeutf8":return new ji;case"utf8view":return new nn;case"bool":return new Gr;case"list":return new Qt((t||[])[0]);case"largelist":return new Jn((t||[])[0]);case"struct":return new et(t||[]);case"struct_":return new et(t||[])}switch(r){case"int":{let n=e.type;return new It(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=e.type;return new Nr(He[n.precision])}case"decimal":{let n=e.type;return new An(n.scale,n.precision,n.bitWidth)}case"date":{let n=e.type;return new on(ot[n.unit])}case"time":{let n=e.type;return new Ir(q[n.unit],n.bitWidth)}case"timestamp":{let n=e.type;return new Pr(q[n.unit],n.timezone)}case"interval":{let n=e.type;return new kr(ke[n.unit])}case"duration":{let n=e.type;return new sn(q[n.unit])}case"union":{let n=e.type,[i,...o]=(n.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new an(Ze[s],n.typeIds||[],t||[])}case"fixedsizebinary":{let n=e.type;return new Tn(n.byteWidth)}case"fixedsizelist":{let n=e.type;return new Wt(n.listSize,(t||[])[0])}case"map":{let n=e.type;return new Ur((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}var Y6=p(()=>{qr();st();ma();Dt()});function UW(e,t){return(()=>{switch(t){case Ge.Schema:return ve.fromJSON(e);case Ge.RecordBatch:return nr.fromJSON(e);case Ge.DictionaryBatch:return Vr.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${Ge[t]}, type: ${t} }`)})}function jW(e,t){return(()=>{switch(t){case Ge.Schema:return ve.decode(e.header(new vn),new Map,e.version());case Ge.RecordBatch:return nr.decode(e.header(new Cr),e.version());case Ge.DictionaryBatch:return Vr.decode(e.header(new Yo),e.version())}throw new Error(`Unrecognized Message type: { name: ${Ge[t]}, type: ${t} }`)})}function zW(e,t=new Map,r=nt.V5){let n=YW(e,t);return new ve(n,X0(e),t,r)}function qW(e,t=nt.V5){return new nr(e.length(),$W(e),KW(e,t),e5(e.compression()),XW(e))}function VW(e,t=nt.V5){return new Vr(nr.decode(e.data(),t),e.id(),e.isDelta())}function WW(e){return new Ht(e.offset(),e.length())}function HW(e){return new bi(e.length(),e.nullCount())}function $W(e){let t=[];for(let r,n=-1,i=-1,o=e.nodesLength();++n<o;)(r=e.nodes(n))&&(t[++i]=bi.decode(r));return t}function KW(e,t){let r=[];for(let n,i=-1,o=-1,s=e.buffersLength();++i<s;)(n=e.buffers(i))&&(t<nt.V4&&(n.bb_pos+=8*(i+1)),r[++o]=Ht.decode(n));return r}function XW(e){let t=[],r=Math.trunc(e.variadicBufferCountsLength());for(let n=0;n<r;++n)t.push(Le(e.variadicBufferCounts(n)));return t}function YW(e,t){let r=[];for(let n,i=-1,o=-1,s=e.fieldsLength();++i<s;)(n=e.fields(i))&&(r[++o]=ee.decode(n,t));return r}function Z6(e,t){let r=[];for(let n,i=-1,o=-1,s=e.childrenLength();++i<s;)(n=e.children(i))&&(r[++o]=ee.decode(n,t));return r}function ZW(e,t){let r,n,i,o,s,a;return!t||!(a=e.dictionary())?(i=Q6(e,Z6(e,t)),n=new ee(e.name(),i,e.nullable(),X0(e))):t.has(r=Le(a.id()))?(o=(o=a.indexType())?J6(o):new Xt,s=new er(t.get(r),o,r,a.isOrdered()),n=new ee(e.name(),s,e.nullable(),X0(e))):(o=(o=a.indexType())?J6(o):new Xt,t.set(r,i=Q6(e,Z6(e,t))),s=new er(i,o,r,a.isOrdered()),n=new ee(e.name(),s,e.nullable(),X0(e))),n||null}function X0(e){let t=new Map;if(e)for(let r,n,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(r=e.customMetadata(i))&&(n=r.key())!=null&&t.set(n,r.value());return t}function JW(e){let t=new Map;for(let r,n,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(r=e.customMetadata(i))&&(n=r.key())!=null&&t.set(n,r.value());return t}function J6(e){return new It(e.isSigned(),e.bitWidth())}function Q6(e,t){let r=e.typeType();switch(r){case me.NONE:return new Vt;case me.Null:return new Vt;case me.Binary:return new En;case me.LargeBinary:return new Ui;case me.BinaryView:return new Ee;case me.Utf8:return new Fr;case me.LargeUtf8:return new ji;case me.Utf8View:return new nn;case me.Bool:return new Gr;case me.List:return new Qt((t||[])[0]);case me.LargeList:return new Jn((t||[])[0]);case me.Struct_:return new et(t||[])}switch(r){case me.Int:{let n=e.type(new Ci);return new It(n.isSigned(),n.bitWidth())}case me.FloatingPoint:{let n=e.type(new Xs);return new Nr(n.precision())}case me.Decimal:{let n=e.type(new go);return new An(n.scale(),n.precision(),n.bitWidth())}case me.Date:{let n=e.type(new Ws);return new on(n.unit())}case me.Time:{let n=e.type(new Zo);return new Ir(n.unit(),n.bitWidth())}case me.Timestamp:{let n=e.type(new Jo);return new Pr(n.unit(),n.timezone())}case me.Interval:{let n=e.type(new Ys);return new kr(n.unit())}case me.Duration:{let n=e.type(new Hs);return new sn(n.unit())}case me.Union:{let n=e.type(new Di);return new an(n.mode(),n.typeIdsArray()||[],t||[])}case me.FixedSizeBinary:{let n=e.type(new $s);return new Tn(n.byteWidth())}case me.FixedSizeList:{let n=e.type(new Ks);return new Wt(n.listSize(),(t||[])[0])}case me.Map:{let n=e.type(new Zs);return new Ur((t||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${me[r]}" (${r})`)}function e5(e){return e?new Mc(e.codec(),e.method()):null}function QW(e,t){let r=t.fields.map(o=>ee.encode(e,o));vn.startFieldsVector(e,r.length);let n=vn.createFieldsVector(e,r),i=t.metadata&&t.metadata.size>0?vn.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),c=e.createString(`${s}`);return Ct.startKeyValue(e),Ct.addKey(e,a),Ct.addValue(e,c),Ct.endKeyValue(e)})):-1;return vn.startSchema(e),vn.addFields(e,n),vn.addEndianness(e,oH?Vs.Little:Vs.Big),i!==-1&&vn.addCustomMetadata(e,i),vn.endSchema(e)}function eH(e,t){let r=-1,n=-1,i=-1,o=t.type,s=t.typeId;z.isDictionary(o)?(s=o.dictionary.typeId,i=$0.visit(o,e),n=$0.visit(o.dictionary,e)):n=$0.visit(o,e);let a=(o.children||[]).map(u=>ee.encode(e,u)),c=Dr.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?Dr.createCustomMetadataVector(e,[...t.metadata].map(([u,h])=>{let d=e.createString(`${u}`),m=e.createString(`${h}`);return Ct.startKeyValue(e),Ct.addKey(e,d),Ct.addValue(e,m),Ct.endKeyValue(e)})):-1;return t.name&&(r=e.createString(t.name)),Dr.startField(e),Dr.addType(e,n),Dr.addTypeType(e,s),Dr.addChildren(e,c),Dr.addNullable(e,!!t.nullable),r!==-1&&Dr.addName(e,r),i!==-1&&Dr.addDictionary(e,i),l!==-1&&Dr.addCustomMetadata(e,l),Dr.endField(e)}function tH(e,t){let r=t.nodes||[],n=t.buffers||[],i=t.variadicBufferCounts||[];Cr.startNodesVector(e,r.length);for(let l of r.slice().reverse())bi.encode(e,l);let o=e.endVector();Cr.startBuffersVector(e,n.length);for(let l of n.slice().reverse())Ht.encode(e,l);let s=e.endVector(),a=null;t.compression!==null&&(a=t5(e,t.compression));let c=-1;return i.length>0&&(c=Cr.createVariadicBufferCountsVector(e,i.map(BigInt))),Cr.startRecordBatch(e),Cr.addLength(e,BigInt(t.length)),Cr.addNodes(e,o),Cr.addBuffers(e,s),t.compression!==null&&a&&Cr.addCompression(e,a),c!==-1&&Cr.addVariadicBufferCounts(e,c),Cr.endRecordBatch(e)}function t5(e,t){return Xo.startBodyCompression(e),Xo.addCodec(e,t.type),Xo.addMethod(e,t.method),Xo.endBodyCompression(e)}function rH(e,t){let r=nr.encode(e,t.data);return Yo.startDictionaryBatch(e),Yo.addId(e,BigInt(t.id)),Yo.addIsDelta(e,t.isDelta),Yo.addData(e,r),Yo.endDictionaryBatch(e)}function nH(e,t){return ou.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function iH(e,t){return iu.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var Y0,GW,kW,Wr,nr,Vr,Ht,bi,Mc,oH,ma=p(()=>{Y0=pe(ze(),1);X2();u0();C2();vT();O2();K2();B2();f0();su();D2();z2();G2();F2();W2();H2();q2();k2();$2();U2();j2();V2();k6();L2();R2();qr();fr();yo();Dt();U6();Y6();st();GW=Y0.Builder,kW=Y0.ByteBuffer,Wr=class e{static fromJSON(t,r){let n=new e(0,nt.V5,r);return n._createHeader=UW(t,r),n}static decode(t){t=new kW(se(t));let r=ri.getRootAsMessage(t),n=r.bodyLength(),i=r.version(),o=r.headerType(),s=JW(r),a=new e(n,i,o,void 0,s);return a._createHeader=jW(r,o),a}static encode(t){let r=new GW,n=-1;t.isSchema()?n=ve.encode(r,t.header()):t.isRecordBatch()?n=nr.encode(r,t.header()):t.isDictionaryBatch()&&(n=Vr.encode(r,t.header()));let i=t.metadata&&t.metadata.size>0?ri.createCustomMetadataVector(r,[...t.metadata].map(([o,s])=>{let a=r.createString(`${o}`),c=r.createString(`${s}`);return Ct.startKeyValue(r),Ct.addKey(r,a),Ct.addValue(r,c),Ct.endKeyValue(r)})):-1;return ri.startMessage(r),ri.addVersion(r,nt.V5),ri.addHeader(r,n),ri.addHeaderType(r,t.headerType),ri.addBodyLength(r,BigInt(t.bodyLength)),i!==-1&&ri.addCustomMetadata(r,i),ri.finishMessageBuffer(r,ri.endMessage(r)),r.asUint8Array()}static from(t,r=0){if(t instanceof ve)return new e(0,nt.V5,Ge.Schema,t);if(t instanceof nr)return new e(r,nt.V5,Ge.RecordBatch,t,t.metadata);if(t instanceof Vr)return new e(r,nt.V5,Ge.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get compression(){return this._compression}get bodyLength(){return this._bodyLength}get metadata(){return this._metadata}header(){return this._createHeader()}isSchema(){return this.headerType===Ge.Schema}isRecordBatch(){return this.headerType===Ge.RecordBatch}isDictionaryBatch(){return this.headerType===Ge.DictionaryBatch}constructor(t,r,n,i,o){this._version=r,this._headerType=n,this.body=new Uint8Array(0),this._compression=i==null?void 0:i.compression,i&&(this._createHeader=()=>i),this._bodyLength=Le(t),this._metadata=o||new Map}},nr=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}get compression(){return this._compression}get variadicBufferCounts(){return this._variadicBufferCounts}get metadata(){return this._metadata}constructor(t,r,n,i,o=[],s){this._nodes=r,this._buffers=n,this._length=Le(t),this._compression=i,this._variadicBufferCounts=o,this._metadata=s||new Map}},Vr=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,r,n=!1){this._data=t,this._isDelta=n,this._id=Le(r)}},Ht=class{constructor(t,r){this.offset=Le(t),this.length=Le(r)}},bi=class{constructor(t,r){this.length=Le(t),this.nullCount=Le(r)}},Mc=class{constructor(t,r=mc.BUFFER){this.type=t,this.method=r}};ee.encode=eH;ee.decode=ZW;ee.fromJSON=X6;ve.encode=QW;ve.decode=zW;ve.fromJSON=V6;nr.encode=tH;nr.decode=qW;nr.fromJSON=Ab;Vr.encode=rH;Vr.decode=VW;Vr.fromJSON=W6;bi.encode=nH;bi.decode=HW;Ht.encode=iH;Ht.decode=WW;Mc.encode=t5;Mc.decode=e5;oH=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})()});var _t,yh,vc,Z0,bh=p(()=>{Ar();ru();_t=Object.freeze({done:!0,value:void 0}),yh=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},vc=class{tee(){return this._getDOMStream().tee()}pipe(t,r){return this._getNodeStream().pipe(t,r)}pipeTo(t,r){return this._getDOMStream().pipeTo(t,r)}pipeThrough(t,r){return this._getDOMStream().pipeThrough(t,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},Z0=class extends vc{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return H(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){let{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(_t);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return hr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return hr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return H(this,void 0,void 0,function*(){return yield this.abort(t),_t})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),_t})}read(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((r,n)=>{this.resolvers.push({resolve:r,reject:n})}):Promise.resolve(_t)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}});var Rn,wi,Hr,Tb,ns,So=p(()=>{Ar();ru();$o();bh();fr();Ko();Rn=class extends Z0{write(t){if((t=se(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?tu(this.toUint8Array(!0)):this.toUint8Array(!1).then(tu)}toUint8Array(t=!1){return t?Vn(this._values)[0]:H(this,void 0,void 0,function*(){var r,n,i,o;let s=[],a=0;try{for(var c=!0,l=Un(this),u;u=yield l.next(),r=u.done,!r;c=!0){o=u.value,c=!1;let h=o;s.push(h),a+=h.byteLength}}catch(h){n={error:h}}finally{try{!c&&!r&&(i=l.return)&&(yield i.call(l))}finally{if(n)throw n.error}}return Vn(s,a)[0]})}},wi=class{constructor(t){t&&(this.source=new Tb(hr.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},Hr=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof Rn?this.source=new ns(hr.fromAsyncIterable(t)):e0(t)?this.source=new ns(hr.fromNodeStream(t)):jf(t)?this.source=new ns(hr.fromDOMStream(t)):Jm(t)?this.source=new ns(hr.fromDOMStream(t.body)):qn(t)?this.source=new ns(hr.fromIterable(t)):zn(t)?this.source=new ns(hr.fromAsyncIterable(t)):Sn(t)&&(this.source=new ns(hr.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},Tb=class{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,r="read"){return this.source.next({cmd:r,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||_t)}return(t){return Object.create(this.source.return&&this.source.return(t)||_t)}},ns=class{constructor(t){this.source=t,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}cancel(t){return H(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return H(this,arguments,void 0,function*(r,n="read"){return yield this.source.next({cmd:n,size:r})})}throw(t){return H(this,void 0,void 0,function*(){let r=this.source.throw&&(yield this.source.throw(t))||_t;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}return(t){return H(this,void 0,void 0,function*(){let r=this.source.return&&(yield this.source.return(t))||_t;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}}});var wh,pa,Ib=p(()=>{Ar();So();fr();wh=class extends wi{constructor(t,r){super(),this.position=0,this.buffer=se(t),this.size=r===void 0?this.buffer.byteLength:r}readInt32(t){let{buffer:r,byteOffset:n}=this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:r,size:n,position:i}=this;return r&&i<n?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,i+Math.min(n-i,t)),r.subarray(i,this.position)):null}readAt(t,r){let n=this.buffer,i=Math.min(this.size,t+r);return n?n.subarray(t,i):new Uint8Array(r)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}},pa=class extends Hr{constructor(t,r){super(),this.position=0,this._handle=t,typeof r=="number"?this.size=r:this._pending=H(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return H(this,void 0,void 0,function*(){let{buffer:r,byteOffset:n}=yield this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)})}seek(t){return H(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return H(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n,position:i}=this;if(r&&i<n){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=i,s=0,a=0,c=Math.min(n,o+Math.min(n-o,t)),l=new Uint8Array(Math.max(0,(this.position=c)-o));for(;(o+=a)<c&&(s+=a)<l.byteLength;)({bytesRead:a}=yield r.read(l,s,l.byteLength-s,o));return l}return null})}readAt(t,r){return H(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&t+r<i){let o=Math.min(i,t+r),s=new Uint8Array(o-t);return(yield n.read(s,0,r,t)).buffer}return new Uint8Array(r)})}close(){return H(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return H(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}}});var Rb={};ir(Rb,{BaseInt64:()=>xh,Int128:()=>_h,Int64:()=>is,Uint64:()=>Nt});function _u(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var Su,Pb,xh,Nt,is,_h,Lb=p(()=>{Su=8,Pb=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],xh=class{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let r=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),i=r[3]*n[3];this.buffer[0]=i&65535;let o=i>>>16;return i=r[2]*n[3],o+=i,i=r[3]*n[2]>>>0,o+=i,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<i?65536:0,this.buffer[1]+=o>>>16,this.buffer[1]+=r[1]*n[3]+r[2]*n[2]+r[3]*n[1],this.buffer[1]+=r[0]*n[3]+r[1]*n[2]+r[2]*n[1]+r[3]*n[0]<<16,this}_plus(t){let r=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],r<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=r}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${_u(this.buffer[1])} ${_u(this.buffer[0])}`}},Nt=class e extends xh{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let n=t.length,i=new e(r);for(let o=0;o<n;){let s=Su<n-o?Su:n-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),c=new e(new Uint32Array([Pb[s],0]));i.times(c),i.plus(a),o+=s}return i}static convertArray(t){let r=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},is=class e extends xh{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){let r=this.buffer[1]<<0,n=t.buffer[1]<<0;return r<n||r===n&&this.buffer[0]<t.buffer[0]}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let n=t.startsWith("-"),i=t.length,o=new e(r);for(let s=n?1:0;s<i;){let a=Su<i-s?Su:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),l=new e(new Uint32Array([Pb[a],0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},_h=class e{constructor(t){this.buffer=t}high(){return new is(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new is(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(t){let r=new Nt(new Uint32Array([this.buffer[3],0])),n=new Nt(new Uint32Array([this.buffer[2],0])),i=new Nt(new Uint32Array([this.buffer[1],0])),o=new Nt(new Uint32Array([this.buffer[0],0])),s=new Nt(new Uint32Array([t.buffer[3],0])),a=new Nt(new Uint32Array([t.buffer[2],0])),c=new Nt(new Uint32Array([t.buffer[1],0])),l=new Nt(new Uint32Array([t.buffer[0],0])),u=Nt.multiply(o,l);this.buffer[0]=u.low();let h=new Nt(new Uint32Array([u.high(),0]));return u=Nt.multiply(i,l),h.plus(u),u=Nt.multiply(o,c),h.plus(u),this.buffer[1]=h.low(),this.buffer[3]=h.lessThan(u)?1:0,this.buffer[2]=h.high(),new Nt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Nt.multiply(n,l)).plus(Nt.multiply(i,c)).plus(Nt.multiply(o,a)),this.buffer[3]+=Nt.multiply(r,l).plus(Nt.multiply(n,c)).plus(Nt.multiply(i,a)).plus(Nt.multiply(o,s)).low(),this}plus(t){let r=new Uint32Array(4);return r[3]=this.buffer[3]+t.buffer[3]>>>0,r[2]=this.buffer[2]+t.buffer[2]>>>0,r[1]=this.buffer[1]+t.buffer[1]>>>0,r[0]=this.buffer[0]+t.buffer[0]>>>0,r[0]<this.buffer[0]>>>0&&++r[1],r[1]<this.buffer[1]>>>0&&++r[2],r[2]<this.buffer[2]>>>0&&++r[3],this.buffer[3]=r[3],this.buffer[2]=r[2],this.buffer[1]=r[1],this.buffer[0]=r[0],this}hex(){return`${_u(this.buffer[3])} ${_u(this.buffer[2])} ${_u(this.buffer[1])} ${_u(this.buffer[0])}`}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}static from(t,r=new Uint32Array(4)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(4)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(4)){let n=t.startsWith("-"),i=t.length,o=new e(r);for(let s=n?1:0;s<i;){let a=Su<i-s?Su:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),l=new e(new Uint32Array([Pb[a],0,0,0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*4);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+16*n,4));return r}}});var Nb={};ir(Nb,{toIntervalDayTimeInt32Array:()=>Ob,toIntervalDayTimeObjects:()=>Cb,toIntervalMonthDayNanoInt32Array:()=>Bb,toIntervalMonthDayNanoObjects:()=>Db});function Ob(e){var t,r;let n=e.length,i=new Int32Array(n*2);for(let o=0,s=0;o<n;o++){let a=e[o];i[s++]=(t=a.days)!==null&&t!==void 0?t:0,i[s++]=(r=a.milliseconds)!==null&&r!==void 0?r:0}return i}function Bb(e){var t,r;let n=e.length,i=new Int32Array(n*4);for(let o=0,s=0;o<n;o++){let a=e[o];i[s++]=(t=a.months)!==null&&t!==void 0?t:0,i[s++]=(r=a.days)!==null&&r!==void 0?r:0;let c=a.nanoseconds;if(c){let l=BigInt(c);i[s++]=Number(l&BigInt(4294967295))>>>0,i[s++]=Number(l>>BigInt(32))>>>0}else s+=2}return i}function Cb(e){let t=e.length,r=new Array(t/2);for(let n=0,i=0;n<t;n+=2)r[i++]={days:e[n],milliseconds:e[n+1]};return r}function Db(e,t){let r=e.length,n=new Array(r/4);for(let i=0,o=0;i<r;i+=4){let s=BigInt(e[i+3])<<BigInt(32)|BigInt(e[i+2]>>>0);n[o++]={months:e[i],days:e[i+1],nanoseconds:t?`${s}`:s}}return n}var J0=p(()=>{});function n5(e){let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)t[r>>1]=Number.parseInt(e.slice(r,r+2),16);return t}function sH(e){return n5(e.join(""))}function i5(e,t){let r=new Uint8Array(e.length*16),n=new DataView(r.buffer);for(let[i,o]of e.entries()){let s=i*16,a=o.SIZE;if(n.setInt32(s,a,!0),o.INLINED!==void 0){let c=t(o.INLINED);for(let l=0;l<c.length&&l<12;l++)r[s+4+l]=c[l]}else{let c=o.PREFIX_HEX;for(let l=0;l<8&&l<c.length;l+=2)r[s+4+(l>>1)]=Number.parseInt(c.slice(l,l+2),16);n.setInt32(s+8,o.BUFFER_INDEX,!0),n.setInt32(s+12,o.OFFSET,!0)}}return r}function aH(e){return i5(e,t=>{let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n>>1]=Number.parseInt(t.slice(n,n+2),16);return r})}function cH(e){return i5(e,t=>new TextEncoder().encode(t))}var Mu,Q0,ep,o5=p(()=>{yi();qr();st();In();xc();$o();Lb();Dt();fr();J0();Mu=class extends ie{constructor(t,r,n,i,o=nt.V5,s=[]){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.variadicBufferIndex=-1,this.bytes=t,this.nodes=r,this.buffers=n,this.dictionaries=i,this.metadataVersion=o,this.variadicBufferCounts=s}visit(t){return super.visit(t instanceof ee?t.type:t)}visitNull(t,{length:r}=this.nextFieldNode()){return te({type:t,length:r})}visitBool(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitUtf8View(t,{length:r,nullCount:n}=this.nextFieldNode()){let i=this.readNullBitmap(t,n),o=this.readData(t),s=this.readVariadicBuffers(this.nextVariadicBufferCount());return te({type:t,length:r,nullCount:n,nullBitmap:i,views:o,variadicBuffers:s})}visitBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinaryView(t,{length:r,nullCount:n}=this.nextFieldNode()){let i=this.readNullBitmap(t,n),o=this.readData(t),s=this.readVariadicBuffers(this.nextVariadicBufferCount());return te({type:t,length:r,nullCount:n,nullBitmap:i,views:o,variadicBuffers:s})}visitFixedSizeBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitLargeList(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),children:this.visitMany(t.children)})}visitUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<nt.V5&&this.readNullBitmap(t,n),t.mode===Ze.Sparse?this.visitSparseUnion(t,{length:r,nullCount:n}):this.visitDenseUnion(t,{length:r,nullCount:n})}visitDenseUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDuration(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),child:this.visit(t.children[0])})}visitMap(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,r,n=this.nextBufferRange()){return r>0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,r){return this.readData(t,r)}readTypeIds(t,r){return this.readData(t,r)}readData(t,{length:r,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+r)}readVariadicBuffers(t){return Array.from({length:t},()=>this.readData(null))}nextVariadicBufferCount(){var t;return(t=this.variadicBufferCounts[++this.variadicBufferIndex])!==null&&t!==void 0?t:0}readDictionary(t){return this.dictionaries.get(t.id)}},Q0=class extends Mu{constructor(t,r,n,i,o,s=[]){super(new Uint8Array(0),r,n,i,o,s),this.sources=t}readNullBitmap(t,r,{offset:n}=this.nextBufferRange()){return r<=0?new Uint8Array(0):wc(this.sources[n])}readOffsets(t,{offset:r}=this.nextBufferRange()){return Re(Uint8Array,Re(t.OffsetArrayType,this.sources[r]))}readTypeIds(t,{offset:r}=this.nextBufferRange()){return Re(Uint8Array,Re(t.ArrayType,this.sources[r]))}readData(t,{offset:r}=this.nextBufferRange()){let{sources:n}=this;if(z.isTimestamp(t))return Re(Uint8Array,is.convertArray(n[r]));if((z.isInt(t)||z.isTime(t))&&t.bitWidth===64||z.isDuration(t))return Re(Uint8Array,is.convertArray(n[r]));if(z.isDate(t)&&t.unit===ot.MILLISECOND)return Re(Uint8Array,is.convertArray(n[r]));if(z.isDecimal(t))return Re(Uint8Array,_h.convertArray(n[r]));if(z.isBinary(t)||z.isLargeBinary(t)||z.isFixedSizeBinary(t))return sH(n[r]);if(z.isBinaryView(t))return aH(n[r]);if(z.isUtf8View(t))return cH(n[r]);if(z.isBool(t))return wc(n[r]);if(z.isUtf8(t)||z.isLargeUtf8(t))return jn(n[r].join(""));if(z.isInterval(t))switch(t.unit){case ke.DAY_TIME:return Ob(n[r]);case ke.MONTH_DAY_NANO:return Bb(n[r]);default:break}return Re(Uint8Array,Re(t.ArrayType,n[r].map(i=>+i)))}readVariadicBuffers(t){let r=[];for(let n=0;n<t;n++){let{offset:i}=this.nextBufferRange(),o=this.sources[i];r.push(n5(o))}return r}};ep=class extends Mu{constructor(t,r,n,i,o,s=[]){super(new Uint8Array(0),r,n,i,o,s),this.bodyChunks=t}readData(t,r=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}});var os,tp=p(()=>{qi();yt();fr();os=class extends zr{constructor(t){super(t),this._values=new Pn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,se(r))}_flushPending(t,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)n.set(s,0);else{let c=a.length;i.set(a,o),n.set(s,c),o+=c}}}});var ss,rp=p(()=>{fr();qi();yt();ss=class extends zr{constructor(t){super(t),this._values=new Pn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,se(r))}_flushPending(t,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)n.set(s,BigInt(0));else{let c=a.length;i.set(a,o),n.set(s,BigInt(c)),o+=c}}}});var Ec,Fb=p(()=>{qi();yt();Ec=class extends at{constructor(t){super(t),this._values=new xu}setValue(t,r){this._values.set(t,+r)}}});var Mo,ga,ya,Gb=p(()=>{yt();ei();Mo=class extends rr{};Mo.prototype._setValue=ib;ga=class extends Mo{};ga.prototype._setValue=p0;ya=class extends Mo{};ya.prototype._setValue=g0});var ba,kb=p(()=>{yt();ei();ba=class extends rr{};ba.prototype._setValue=ab});var Ac,Ub=p(()=>{st();yt();vu();Ac=class extends at{constructor({type:t,nullValues:r,dictionaryHashFunction:n}){super({type:new er(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=ni({type:this.type.indices,nullValues:r}),this.dictionary=ni({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,r){let n=this.indices;return r=n.setValid(t,r),this.length=n.length,r}setValue(t,r){let n=this._keysToIndices,i=this.valueToKey(r),o=n[i];return o===void 0&&(n[i]=o=this._dictionaryOffset+this.dictionary.append(r).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,r=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=r?r.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}}});var wa,jb=p(()=>{yt();ei();wa=class extends rr{};wa.prototype._setValue=nb});var Tc,zb=p(()=>{qr();yt();st();Tc=class extends at{setValue(t,r){let[n]=this.children,i=t*this.stride;for(let o=-1,s=this.stride;++o<s;)n.set(i+o,r[o])}setValid(t,r){return super.setValid(t,r)||this.children[0].setValid((t+1)*this.stride-1,!1),r}addChild(t,r="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(t);return this.type=new Wt(this.type.listSize,new ee(r,t.type,!0)),n}}});var vo,Ic,Pc,Rc,qb=p(()=>{fh();yt();vo=class extends rr{setValue(t,r){this._values.set(t,r)}},Ic=class extends vo{setValue(t,r){super.setValue(t,uh(r))}},Pc=class extends vo{},Rc=class extends vo{}});var Wi,xa,_a,Sa,Vb=p(()=>{yt();ei();Wi=class extends rr{};Wi.prototype._setValue=cb;xa=class extends Wi{};xa.prototype._setValue=E0;_a=class extends Wi{};_a.prototype._setValue=A0;Sa=class extends Wi{};Sa.prototype._setValue=T0});var xi,Ma,va,Ea,Aa,Wb=p(()=>{yt();ei();xi=class extends rr{};xi.prototype._setValue=lb;Ma=class extends xi{};Ma.prototype._setValue=I0;va=class extends xi{};va.prototype._setValue=P0;Ea=class extends xi{};Ea.prototype._setValue=R0;Aa=class extends xi{};Aa.prototype._setValue=L0});var cn,Lc,Oc,Bc,Cc,Dc,Nc,Fc,Gc,Hb=p(()=>{yt();cn=class extends rr{setValue(t,r){this._values.set(t,r)}},Lc=class extends cn{},Oc=class extends cn{},Bc=class extends cn{},Cc=class extends cn{},Dc=class extends cn{},Nc=class extends cn{},Fc=class extends cn{},Gc=class extends cn{}});var kc,$b=p(()=>{qr();st();qi();yt();kc=class extends zr{constructor(t){super(t),this._offsets=new da(t.type)}addChild(t,r="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Qt(new ee(r,t.type,!0)),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(typeof o>"u")r.set(i,0);else{let s=o,a=s.length,c=r.set(i,a).buffer[i];for(let l=-1;++l<a;)n.set(c+l,s[l])}}}});var Uc,Kb=p(()=>{qr();st();qi();yo();yt();Uc=class extends zr{constructor(t){super(t),this._offsets=new da(t.type)}addChild(t,r="0"){if(this.numChildren>0)throw new Error("LargeListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Jn(new ee(r,t.type,!0)),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(typeof o>"u")r.set(i,BigInt(0));else{let s=o,a=s.length,c=Le(r.set(i,BigInt(a)).buffer[i]);for(let l=-1;++l<a;)n.set(c+l,s[l])}}}});var jc,Xb=p(()=>{qr();st();yt();jc=class extends zr{set(t,r){return super.set(t,r)}setValue(t,r){let n=r instanceof Map?r:new Map(Object.entries(r)),i=this._pending||(this._pending=new Map),o=i.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=n.size,i.set(t,n)}addChild(t,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Ur(new ee(r,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(o===void 0)r.set(i,0);else{let{[i]:s,[i+1]:a}=r.set(i,o.size).buffer;for(let c of o.entries())if(n.set(s,c),++s>=a)break}}}});var zc,Yb=p(()=>{yt();zc=class extends at{setValue(t,r){}setValid(t,r){return this.length=Math.max(t+1,this.length),r}}});var qc,Zb=p(()=>{qr();yt();st();qc=class extends at{setValue(t,r){let{children:n,type:i}=this;switch(Array.isArray(r)||r.constructor){case!0:return i.children.forEach((o,s)=>n[s].set(t,r[s]));case Map:return i.children.forEach((o,s)=>n[s].set(t,r.get(o.name)));default:return i.children.forEach((o,s)=>n[s].set(t,r[o.name]))}}setValid(t,r){return super.setValid(t,r)||this.children.forEach(n=>n.setValid(t,r)),r}addChild(t,r=`${this.numChildren}`){let n=this.children.push(t);return this.type=new et([...this.type.children,new ee(r,t.type,!0)]),n}}});var _i,Ta,Ia,Pa,Ra,Jb=p(()=>{yt();ei();_i=class extends rr{};_i.prototype._setValue=ob;Ta=class extends _i{};Ta.prototype._setValue=y0;Ia=class extends _i{};Ia.prototype._setValue=b0;Pa=class extends _i{};Pa.prototype._setValue=w0;Ra=class extends _i{};Ra.prototype._setValue=x0});var Si,La,Oa,Ba,Ca,Qb=p(()=>{yt();ei();Si=class extends rr{};Si.prototype._setValue=sb;La=class extends Si{};La.prototype._setValue=_0;Oa=class extends Si{};Oa.prototype._setValue=S0;Ba=class extends Si{};Ba.prototype._setValue=M0;Ca=class extends Si{};Ca.prototype._setValue=v0});var as,Vc,Wc,ew=p(()=>{qr();qi();yt();st();as=class extends at{constructor(t){super(t),this._typeIds=new ts(Int8Array,0,1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,r){return this.set(this.length,t,r)}set(t,r,n){return n===void 0&&(n=this._valueToChildTypeId(this,r,t)),this.setValue(t,r,n),this}setValue(t,r,n){this._typeIds.set(t,n);let i=this.type.typeIdToChildIndex[n],o=this.children[i];o==null||o.set(t,r),this.length=Math.max(t+1,this.length)}addChild(t,r=`${this.children.length}`){let n=this.children.push(t),{type:{children:i,mode:o,typeIds:s}}=this,a=[...i,new ee(r,t.type)];return this.type=new an(o,[...s,n],a),n}_valueToChildTypeId(t,r,n){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},Vc=class extends as{},Wc=class extends as{constructor(t){super(t),this._offsets=new ts(Int32Array)}setValue(t,r,n){let i=this._typeIds.set(t,n).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[i]),s=this._offsets.set(t,o.length).buffer[t];o==null||o.set(s,r),this.length=Math.max(t+1,this.length)}}});var Da,tw=p(()=>{$o();tp();qi();yt();Da=class extends zr{constructor(t){super(t),this._values=new Pn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,jn(r))}_flushPending(t,r){}};Da.prototype._flushPending=os.prototype._flushPending});var Na,rw=p(()=>{$o();qi();yt();rp();Na=class extends zr{constructor(t){super(t),this._values=new Pn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,jn(r))}_flushPending(t,r){}};Na.prototype._flushPending=ss.prototype._flushPending});var cs,np=p(()=>{st();yt();qi();fr();yi();cs=class extends at{constructor(t){super(t),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new Pn(Uint8Array)}get byteLength(){let t=0;this._views&&(t+=this._views.byteLength),this._nulls&&(t+=this._nulls.byteLength);for(let r of this._variadicBuffers)t+=r.byteLength;return this._currentBuffer&&(t+=this._currentBuffer.byteLength),t}setValue(t,r){return this.writeBinaryValue(t,this.encodeValue(r))}writeBinaryValue(t,r){let n=r.length,i=(t+1)*Ee.ELEMENT_WIDTH,o=this._views.length;i>o&&this._views.reserve(i-o);let s=this._views.buffer,a=t*Ee.ELEMENT_WIDTH,c=new DataView(s.buffer,s.byteOffset+a,Ee.ELEMENT_WIDTH);if(c.setInt32(Ee.LENGTH_OFFSET,n,!0),n<=Ee.INLINE_CAPACITY){s.set(r,a+Ee.INLINE_OFFSET);for(let l=n;l<Ee.INLINE_CAPACITY;l++)s[a+Ee.INLINE_OFFSET+l]=0}else{let l=new DataView(r.buffer,r.byteOffset,Math.min(4,n));c.setUint32(Ee.INLINE_OFFSET,l.getUint32(0,!0),!0),(!this._currentBuffer||this._currentBufferOffset+n>this._bufferSize)&&(this._currentBuffer&&this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=new Pn(Uint8Array),this._currentBufferIndex=this._variadicBuffers.length,this._currentBufferOffset=0),this._currentBuffer.reserve(n).buffer.set(r,this._currentBufferOffset),c.setInt32(Ee.BUFFER_INDEX_OFFSET,this._currentBufferIndex,!0),c.setInt32(Ee.BUFFER_OFFSET_OFFSET,this._currentBufferOffset,!0),this._currentBufferOffset+=n}return this}encodeValue(t){return se(t)}setValid(t,r){let n=(t+1)*Ee.ELEMENT_WIDTH,i=this._views.length;n>i&&this._views.reserve(n-i);let o=super.setValid(t,r);if(!o){let s=this._views.buffer,a=t*Ee.ELEMENT_WIDTH;for(let c=0;c<Ee.ELEMENT_WIDTH;c++)s[a+c]=0}return o}clear(){return this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._views.clear(),super.clear()}flush(){let{type:t,length:r,nullCount:n,_views:i,_nulls:o}=this;this._currentBuffer&&this._currentBufferOffset>0&&(this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=null,this._currentBufferOffset=0);let s=i.flush(r*Ee.ELEMENT_WIDTH),a=n>0?o.flush(r):void 0,c=this._variadicBuffers.slice();return this._variadicBuffers=[],this._currentBufferIndex=0,this.clear(),te({type:t,length:r,nullCount:n,nullBitmap:a,views:s,variadicBuffers:c})}finish(){return this.finished=!0,this}}});var Hc,nw=p(()=>{np();$o();Hc=class extends cs{constructor(t){super(t)}setValue(t,r){return this.writeBinaryValue(t,jn(r))}}});var iw,s5,a5=p(()=>{In();tp();rp();Fb();Gb();kb();Ub();jb();zb();qb();Vb();Wb();Hb();$b();Kb();Xb();Yb();Zb();Jb();Qb();ew();tw();rw();np();nw();iw=class extends ie{visitNull(){return zc}visitBool(){return Ec}visitInt(){return cn}visitInt8(){return Lc}visitInt16(){return Oc}visitInt32(){return Bc}visitInt64(){return Cc}visitUint8(){return Dc}visitUint16(){return Nc}visitUint32(){return Fc}visitUint64(){return Gc}visitFloat(){return vo}visitFloat16(){return Ic}visitFloat32(){return Pc}visitFloat64(){return Rc}visitUtf8(){return Da}visitLargeUtf8(){return Na}visitBinary(){return os}visitLargeBinary(){return ss}visitFixedSizeBinary(){return wa}visitDate(){return Mo}visitDateDay(){return ga}visitDateMillisecond(){return ya}visitTimestamp(){return _i}visitTimestampSecond(){return Ta}visitTimestampMillisecond(){return Ia}visitTimestampMicrosecond(){return Pa}visitTimestampNanosecond(){return Ra}visitTime(){return Si}visitTimeSecond(){return La}visitTimeMillisecond(){return Oa}visitTimeMicrosecond(){return Ba}visitTimeNanosecond(){return Ca}visitDecimal(){return ba}visitList(){return kc}visitLargeList(){return Uc}visitStruct(){return qc}visitUnion(){return as}visitDenseUnion(){return Wc}visitSparseUnion(){return Vc}visitDictionary(){return Ac}visitInterval(){return Wi}visitIntervalDayTime(){return xa}visitIntervalYearMonth(){return _a}visitIntervalMonthDayNano(){return Sa}visitDuration(){return xi}visitDurationSecond(){return Ma}visitDurationMillisecond(){return va}visitDurationMicrosecond(){return Ea}visitDurationNanosecond(){return Aa}visitFixedSizeList(){return Tc}visitMap(){return jc}visitBinaryView(){return cs}visitUtf8View(){return Hc}},s5=new iw});function ln(e,t){return t instanceof e.constructor}function ls(e,t){return e===t||ln(e,t)}function us(e,t){return e===t||ln(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function ip(e,t){return e===t||ln(e,t)&&e.precision===t.precision}function lH(e,t){return e===t||ln(e,t)&&e.byteWidth===t.byteWidth}function ow(e,t){return e===t||ln(e,t)&&e.unit===t.unit}function Sh(e,t){return e===t||ln(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Mh(e,t){return e===t||ln(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function c5(e,t){return e===t||ln(e,t)&&e.children.length===t.children.length&&Eo.compareManyFields(e.children,t.children)}function uH(e,t){return e===t||ln(e,t)&&e.children.length===t.children.length&&Eo.compareManyFields(e.children,t.children)}function sw(e,t){return e===t||ln(e,t)&&e.mode===t.mode&&e.typeIds.every((r,n)=>r===t.typeIds[n])&&Eo.compareManyFields(e.children,t.children)}function fH(e,t){return e===t||ln(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Eo.visit(e.indices,t.indices)&&Eo.visit(e.dictionary,t.dictionary)}function op(e,t){return e===t||ln(e,t)&&e.unit===t.unit}function vh(e,t){return e===t||ln(e,t)&&e.unit===t.unit}function hH(e,t){return e===t||ln(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Eo.compareManyFields(e.children,t.children)}function dH(e,t){return e===t||ln(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Eo.compareManyFields(e.children,t.children)}function $c(e,t){return Eo.compareSchemas(e,t)}function l5(e,t){return Eo.compareFields(e,t)}function sp(e,t){return Eo.visit(e,t)}var he,Eo,Eh=p(()=>{In();he=class extends ie{compareSchemas(t,r){return t===r||r instanceof t.constructor&&this.compareManyFields(t.fields,r.fields)}compareManyFields(t,r){return t===r||Array.isArray(t)&&Array.isArray(r)&&t.length===r.length&&t.every((n,i)=>this.compareFields(n,r[i]))}compareFields(t,r){return t===r||r instanceof t.constructor&&t.name===r.name&&t.nullable===r.nullable&&this.visit(t.type,r.type)}};he.prototype.visitNull=ls;he.prototype.visitBool=ls;he.prototype.visitInt=us;he.prototype.visitInt8=us;he.prototype.visitInt16=us;he.prototype.visitInt32=us;he.prototype.visitInt64=us;he.prototype.visitUint8=us;he.prototype.visitUint16=us;he.prototype.visitUint32=us;he.prototype.visitUint64=us;he.prototype.visitFloat=ip;he.prototype.visitFloat16=ip;he.prototype.visitFloat32=ip;he.prototype.visitFloat64=ip;he.prototype.visitUtf8=ls;he.prototype.visitLargeUtf8=ls;he.prototype.visitUtf8View=ls;he.prototype.visitBinary=ls;he.prototype.visitLargeBinary=ls;he.prototype.visitBinaryView=ls;he.prototype.visitFixedSizeBinary=lH;he.prototype.visitDate=ow;he.prototype.visitDateDay=ow;he.prototype.visitDateMillisecond=ow;he.prototype.visitTimestamp=Sh;he.prototype.visitTimestampSecond=Sh;he.prototype.visitTimestampMillisecond=Sh;he.prototype.visitTimestampMicrosecond=Sh;he.prototype.visitTimestampNanosecond=Sh;he.prototype.visitTime=Mh;he.prototype.visitTimeSecond=Mh;he.prototype.visitTimeMillisecond=Mh;he.prototype.visitTimeMicrosecond=Mh;he.prototype.visitTimeNanosecond=Mh;he.prototype.visitDecimal=ls;he.prototype.visitList=c5;he.prototype.visitLargeList=c5;he.prototype.visitStruct=uH;he.prototype.visitUnion=sw;he.prototype.visitDenseUnion=sw;he.prototype.visitSparseUnion=sw;he.prototype.visitDictionary=fH;he.prototype.visitInterval=op;he.prototype.visitIntervalDayTime=op;he.prototype.visitIntervalYearMonth=op;he.prototype.visitIntervalMonthDayNano=op;he.prototype.visitDuration=vh;he.prototype.visitDurationSecond=vh;he.prototype.visitDurationMillisecond=vh;he.prototype.visitDurationMicrosecond=vh;he.prototype.visitDurationNanosecond=vh;he.prototype.visitFixedSizeList=hH;he.prototype.visitMap=dH;Eo=new he});function ni(e){let t=e.type,r=new(s5.getVisitFn(t)())(e);if(t.children&&t.children.length>0){let n=e.children||[],i={nullValues:e.nullValues},o=Array.isArray(n)?((s,a)=>n[a]||i):(({name:s})=>n[s]||i);for(let[s,a]of t.children.entries()){let{type:c}=a,l=o(a,s);r.children.push(ni(Object.assign(Object.assign({},l),{type:c})))}}return r}function Eu(e,t){if(e instanceof ce||e instanceof $||e.type instanceof z||ArrayBuffer.isView(e))return _o(e);let r={type:t??ap(e),nullValues:[null]},n=[...cp(r)(e)],i=n.length===1?n[0]:n.reduce((o,s)=>o.concat(s));return z.isDictionary(i.type)?i.memoize():i}function aw(e){let t=Eu(e),r=new $e(new ve(t.type.children),t.data[0]);return new it(r)}function ap(e){if(e.length===0)return new Vt;let t=0,r=0,n=0,i=0,o=0,s=0,a=0,c=0;for(let l of e){if(l==null){++t;continue}switch(typeof l){case"bigint":++s;continue;case"boolean":++a;continue;case"number":++i;continue;case"string":++o;continue;case"object":Array.isArray(l)?++r:Object.prototype.toString.call(l)==="[object Date]"?++c:++n;continue}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}if(i+t===e.length)return new Zn;if(o+t===e.length)return new er(new Fr,new Xt);if(s+t===e.length)return new Kn;if(a+t===e.length)return new Gr;if(c+t===e.length)return new bo;if(r+t===e.length){let l=e,u=ap(l[l.findIndex(h=>h!=null)]);if(l.every(h=>h==null||sp(u,ap(h))))return new Qt(new ee("",u,!0))}else if(n+t===e.length){let l=new Map;for(let u of e)for(let h of Object.keys(u))!l.has(h)&&u[h]!=null&&l.set(h,new ee(h,ap([u[h]]),!0));return new et([...l.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function cp(e){let{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:r=t!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=e,n=t!=="bytes"?"length":"byteLength";return function*(i){let o=0,s=ni(e);for(let a of i)s.append(a)[n]>=r&&++o&&(yield s.toVector());(s.finish().length>0||o===0)&&(yield s.toVector())}}function cw(e){let{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:r=t!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=e,n=t!=="bytes"?"length":"byteLength";return function(i){return Qr(this,arguments,function*(){var o,s,a,c;let l=0,u=ni(e);try{for(var h=!0,d=Un(i),m;m=yield Me(d.next()),o=m.done,!o;h=!0){c=m.value,h=!1;let g=c;u.append(g)[n]>=r&&++l&&(yield yield Me(u.toVector()))}}catch(g){s={error:g}}finally{try{!h&&!o&&(a=d.return)&&(yield Me(a.call(d)))}finally{if(s)throw s.error}}(u.finish().length>0||l===0)&&(yield yield Me(u.toVector()))})}}var vu=p(()=>{Ar();qr();st();yi();jr();a5();Kc();fs();Eh()});function lp(e,t){return mH(e,t.map(r=>r.data.concat()))}function mH(e,t){let r=[...e.fields],n=[],i={numBatches:t.reduce((h,d)=>Math.max(h,d.length),0)},o=0,s=0,a=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,a=-1;++a<c;)u[a]=l=t[a].shift(),s=Math.min(s,l?l.length:s);Number.isFinite(s)&&(u=pH(r,s,u,t,i),s>0&&(n[o++]=te({type:new et(r),length:s,nullCount:0,children:u.slice()})))}return[e=e.assign(r),n.map(h=>new $e(e,h))]}function pH(e,t,r,n,i){var o;let s=(t+63&-64)>>3;for(let a=-1,c=n.length;++a<c;){let l=r[a],u=l==null?void 0:l.length;if(u>=t)u===t?r[a]=l:(r[a]=l.slice(0,t),i.numBatches=Math.max(i.numBatches,n[a].unshift(l.slice(t,u-t))));else{let h=e[a];e[a]=h.clone({nullable:!0}),r[a]=(o=l==null?void 0:l._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:te({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(s)})}}return r}var u5=p(()=>{yi();st();fs()});function lw(e){let t={},r=Object.entries(e);for(let[n,i]of r)t[n]=_o(i);return new it(t)}function uw(e){let t={},r=Object.entries(e);for(let[n,i]of r)t[n]=Eu(i);return new it(t)}var f5,h5,it,Kc=p(()=>{Dt();yi();vu();jr();qr();st();Eh();u5();j0();gc();ei();z0();q0();gu();fs();h5=Symbol.for("apache-arrow/Table"),it=class e{static isTable(t){return(t==null?void 0:t[h5])===!0}constructor(...t){var r,n;if(t.length===0)return this.batches=[],this.schema=new ve([]),this._offsets=[0],this;let i,o;t[0]instanceof ve&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop());let s=c=>{if(c){if(c instanceof $e)return[c];if(c instanceof e)return c.batches;if(c instanceof ce){if(c.type instanceof et)return[new $e(new ve(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(l=>s(l));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(l=>s(l));if(typeof c=="object"){let l=Object.keys(c),u=l.map(m=>new $([c[m]])),h=i??new ve(l.map((m,g)=>new ee(String(m),u[g].type,u[g].nullable))),[,d]=lp(h,u);return d.length===0?[new $e(c)]:d}}}return[]},a=t.flatMap(c=>s(c));if(i=(n=i??((r=a[0])===null||r===void 0?void 0:r.schema))!==null&&n!==void 0?n:new ve([]),!(i instanceof ve))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof $e))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!$c(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??F0(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,r)=>t+r.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=N0(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(yc(t,this.numRows))}set(t,r){}indexOf(t,r){return-1}[Symbol.iterator](){return this.batches.length>0?wu.visit(new $(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
10
+ return true;`)}function hH(e){return typeof e!="bigint"?Gi(e):`${Gi(e)}n`}var r5=p(()=>{oh()});function Bb(e,t){let r=Math.ceil(e)*t-1;return(r-r%64+64||64)/t}function n5(e,t=0){return e.length>=t?e.subarray(0,t):Vf(new e.constructor(t),e,0)}var Rn,ns,Su,pa,Wi=p(()=>{dr();Rn=class{constructor(t,r=0,n=1){this.length=Math.ceil(r/n),this.buffer=new t(this.length),this.stride=n,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,r){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let r=this.stride,n=this.length*r,i=this.buffer.length;n>=i&&this._resize(i===0?Bb(n*1,this.BYTES_PER_ELEMENT):Bb(n*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=Bb(t*this.stride,this.BYTES_PER_ELEMENT);let r=n5(this.buffer,t);return this.clear(),r}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=n5(this.buffer,t)}},ns=class extends Rn{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,r){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=r,this}},Su=class extends ns{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,r){let{buffer:n}=this.reserve(t-this.length+1),i=t>>3,o=t%8,s=n[i]>>o&1;return r?s===0&&(n[i]|=1<<o,++this.numValid):s===1&&(n[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},pa=class extends ns{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,r){let n=this.length-1,i=this.reserve(t-n+1).buffer;return n<t++&&n>=0&&i.fill(i[n],n,t),i[t]=i[t-1]+r,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(t+1)}}});var ct,or,qr,bt=p(()=>{zr();wi();mh();at();r5();Wi();ct=class{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}constructor({type:t,nullValues:r}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=r,this.stride=ti(t),this._nulls=new Su,r&&r.length>0&&(this._isValid=t5(r))}toVector(){return new $([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0,{_offsets:r,_values:n,_nulls:i,_typeIds:o,children:s}=this;return r&&(t+=r.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),s.reduce((a,c)=>a+c.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((r,n)=>r+n.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,r){return this.setValid(t,this.isValid(r))&&this.setValue(t,r),this}setValue(t,r){this._setValue(this,t,r)}setValid(t,r){return this.length=this._nulls.set(t,+r).length,r}addChild(t,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,r,n,i,{type:o,length:s,nullCount:a,_typeIds:c,_offsets:l,_values:u,_nulls:h}=this;(r=c==null?void 0:c.flush(s))?i=l==null?void 0:l.flush(s):(i=l==null?void 0:l.flush(s))?t=u==null?void 0:u.flush(l.last()):t=u==null?void 0:u.flush(s),a>0&&(n=h==null?void 0:h.flush(s));let d=this.children.map(m=>m.flush());return this.clear(),te({type:o,length:s,nullCount:a,children:d,child:d[0],data:t,typeIds:r,nullBitmap:n,valueOffsets:i})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,r,n,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(r=this._values)===null||r===void 0||r.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(let o of this.children)o.clear();return this}};ct.prototype.length=1;ct.prototype.stride=1;ct.prototype.children=null;ct.prototype.finished=!1;ct.prototype.nullValues=null;ct.prototype._isValid=()=>!0;or=class extends ct{constructor(t){super(t),this._values=new ns(this.ArrayType,0,this.stride)}setValue(t,r){let n=this._values;return n.reserve(t-n.length+1),super.setValue(t,r)}},qr=class extends ct{constructor(t){super(t),this._pendingLength=0,this._offsets=new pa(t.type)}setValue(t,r){let n=this._pending||(this._pending=new Map),i=n.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=r instanceof bi?r[da].length:r.length,n.set(t,r)}setValid(t,r){return super.setValid(t,r)?!0:((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let t=this._pending,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,r),this}}});var vc,Cb=p(()=>{vc=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,r,n,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(r??0)),t.offset()}}});var i5,ni,o5=p(()=>{i5=me(ze(),1);Cb();cu();op();cb();ni=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFooter(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,r){return t.setPosition(t.position()+i5.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):it.V1}schema(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new En).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}dictionaries(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new vc).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,r){let n=this.bb.__offset(this.bb_pos,10);return n?(r||new vc).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,r){t.addFieldInt16(0,r,it.V1)}static addSchema(t,r){t.addFieldOffset(1,r,0)}static addDictionaries(t,r){t.addFieldOffset(2,r,0)}static startDictionariesVector(t,r){t.startVector(24,r,8)}static addRecordBatches(t,r){t.addFieldOffset(3,r,0)}static startRecordBatchesVector(t,r){t.startVector(24,r,8)}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,r){t.finish(r)}static finishSizePrefixedFooterBuffer(t,r){t.finish(r,void 0,!0)}}});function $p(e,t){return new Map([...e||new Map,...t||new Map])}function Db(e,t=new Map){for(let r=-1,n=e.length;++r<n;){let o=e[r].type;if(z.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&Db(o.children,t)}return t}var s5,a5,ve,ee,Vr=p(()=>{Nt();at();s5=Symbol.for("apache-arrow/Schema"),a5=Symbol.for("apache-arrow/Field"),ve=class e{static isSchema(t){return(t==null?void 0:t[s5])===!0}constructor(t=[],r,n,i=it.V5){this.fields=t||[],this.metadata=r||new Map,n||(n=Db(this.fields)),this.dictionaries=n,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,r)=>`${r}: ${t}`).join(", ")} }>`}select(t){let r=new Set(t),n=this.fields.filter(i=>r.has(i.name));return new e(n,this.metadata)}selectAt(t){let r=t.map(n=>this.fields[n]).filter(Boolean);return new e(r,this.metadata)}assign(...t){let r=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),n=[...this.fields],i=$p($p(new Map,this.metadata),r.metadata),o=r.fields.filter(a=>{let c=n.findIndex(l=>l.name===a.name);return~c?(n[c]=a.clone({metadata:$p($p(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),s=Db(o,new Map);return new e([...n,...o],i,new Map([...this.dictionaries,...s]))}};ve.prototype.fields=null;ve.prototype.metadata=null;ve.prototype.dictionaries=null;ve.prototype[s5]=!0;Object.defineProperty(ve,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ve&&ve.isSchema(t)}});ee=class e{static isField(t){return(t==null?void 0:t[a5])===!0}static new(...t){let[r,n,i,o]=t;return t[0]&&typeof t[0]=="object"&&({name:r}=t[0],n===void 0&&(n=t[0].type),i===void 0&&(i=t[0].nullable),o===void 0&&(o=t[0].metadata)),new e(`${r}`,n,i,o)}constructor(t,r,n=!1,i){this.name=t,this.type=r,this.nullable=n,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[r,n,i,o]=t;return!t[0]||typeof t[0]!="object"?[r=this.name,n=this.type,i=this.nullable,o=this.metadata]=t:{name:r=this.name,type:n=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=t[0],e.new(r,n,i,o)}};ee.prototype.type=null;ee.prototype.name=null;ee.prototype.nullable=null;ee.prototype.metadata=null;ee.prototype[a5]=!0;Object.defineProperty(ee,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ee&&ee.isField(t)}})});var Kp,dH,mH,is,Nb,Hi,Fb=p(()=>{Cb();o5();Kp=me(ze(),1);Vr();Nt();dr();wo();dH=Kp.Builder,mH=Kp.ByteBuffer,is=class{static decode(t){t=new mH(se(t));let r=ni.getRootAsFooter(t),n=ve.decode(r.schema(),new Map,r.version());return new Nb(n,r)}static encode(t){let r=new dH,n=ve.encode(r,t.schema);ni.startRecordBatchesVector(r,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())Hi.encode(r,s);let i=r.endVector();ni.startDictionariesVector(r,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())Hi.encode(r,s);let o=r.endVector();return ni.startFooter(r),ni.addSchema(r,n),ni.addVersion(r,it.V5),ni.addRecordBatches(r,i),ni.addDictionaries(r,o),ni.finishFooterBuffer(r,ni.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,r=it.V5,n,i){this.schema=t,this.version=r,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,r=-1,n=this.numRecordBatches;++r<n;)(t=this.getRecordBatch(r))&&(yield t)}*dictionaryBatches(){for(let t,r=-1,n=this.numDictionaries;++r<n;)(t=this.getDictionaryBatch(r))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}},Nb=class extends is{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,r){super(t,r.version()),this._footer=r}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let r=this._footer.recordBatches(t);if(r)return Hi.decode(r)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let r=this._footer.dictionaries(t);if(r)return Hi.decode(r)}return null}},Hi=class e{static decode(t){return new e(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,r){let{metaDataLength:n}=r,i=BigInt(r.offset),o=BigInt(r.bodyLength);return vc.createBlock(t,i,n,o)}constructor(t,r,n){this.metaDataLength=t,this.offset=Le(n),this.bodyLength=Le(r)}}});var c5,ii,l5=p(()=>{c5=me(ze(),1);cu();mp();op();ii=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMessage(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,r){return t.setPosition(t.position()+c5.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):it.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):Ge.NONE}header(t){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__union(t,this.bb_pos+r):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,r){t.addFieldInt16(0,r,it.V1)}static addHeaderType(t,r){t.addFieldInt8(1,r,Ge.NONE)}static addHeader(t,r){t.addFieldOffset(2,r,0)}static addBodyLength(t,r){t.addFieldInt64(3,r,BigInt("0"))}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,r){t.finish(r)}static finishSizePrefixedMessageBuffer(t,r){t.finish(r,void 0,!0)}static createMessage(t,r,n,i,o,s){return e.startMessage(t),e.addVersion(t,r),e.addHeaderType(t,n),e.addHeader(t,i),e.addBodyLength(t,o),e.addCustomMetadata(t,s),e.endMessage(t)}}});var Gb,Xp,u5=p(()=>{Pn();SI();hp();tb();eI();rI();dI();iI();PI();LI();yI();Z2();Y2();ib();ob();rb();J2();wI();pI();vI();sb();X2();Q2();eb();nb();Gb=class extends ie{visit(t,r){return t==null||r==null?void 0:super.visit(t,r)}visitNull(t,r){return th.startNull(r),th.endNull(r)}visitInt(t,r){return Ni.startInt(r),Ni.addBitWidth(r,t.bitWidth),Ni.addIsSigned(r,t.isSigned),Ni.endInt(r)}visitFloat(t,r){return Zs.startFloatingPoint(r),Zs.addPrecision(r,t.precision),Zs.endFloatingPoint(r)}visitBinary(t,r){return Kf.startBinary(r),Kf.endBinary(r)}visitBinaryView(t,r){return Xf.startBinaryView(r),Xf.endBinaryView(r)}visitLargeBinary(t,r){return Zf.startLargeBinary(r),Zf.endLargeBinary(r)}visitBool(t,r){return Yf.startBool(r),Yf.endBool(r)}visitUtf8(t,r){return nh.startUtf8(r),nh.endUtf8(r)}visitUtf8View(t,r){return ih.startUtf8View(r),ih.endUtf8View(r)}visitLargeUtf8(t,r){return Qf.startLargeUtf8(r),Qf.endLargeUtf8(r)}visitDecimal(t,r){return bo.startDecimal(r),bo.addScale(r,t.scale),bo.addPrecision(r,t.precision),bo.addBitWidth(r,t.bitWidth),bo.endDecimal(r)}visitDate(t,r){return $s.startDate(r),$s.addUnit(r,t.unit),$s.endDate(r)}visitTime(t,r){return Qo.startTime(r),Qo.addUnit(r,t.unit),Qo.addBitWidth(r,t.bitWidth),Qo.endTime(r)}visitTimestamp(t,r){let n=t.timezone&&r.createString(t.timezone)||void 0;return es.startTimestamp(r),es.addUnit(r,t.unit),n!==void 0&&es.addTimezone(r,n),es.endTimestamp(r)}visitInterval(t,r){return Js.startInterval(r),Js.addUnit(r,t.unit),Js.endInterval(r)}visitDuration(t,r){return Ks.startDuration(r),Ks.addUnit(r,t.unit),Ks.endDuration(r)}visitList(t,r){return eh.startList(r),eh.endList(r)}visitLargeList(t,r){return Jf.startLargeList(r),Jf.endLargeList(r)}visitStruct(t,r){return rh.startStruct_(r),rh.endStruct_(r)}visitUnion(t,r){Fi.startTypeIdsVector(r,t.typeIds.length);let n=Fi.createTypeIdsVector(r,t.typeIds);return Fi.startUnion(r),Fi.addMode(r,t.mode),Fi.addTypeIds(r,n),Fi.endUnion(r)}visitDictionary(t,r){let n=this.visit(t.indices,r);return yo.startDictionaryEncoding(r),yo.addId(r,BigInt(t.id)),yo.addIsOrdered(r,t.isOrdered),n!==void 0&&yo.addIndexType(r,n),yo.endDictionaryEncoding(r)}visitFixedSizeBinary(t,r){return Xs.startFixedSizeBinary(r),Xs.addByteWidth(r,t.byteWidth),Xs.endFixedSizeBinary(r)}visitFixedSizeList(t,r){return Ys.startFixedSizeList(r),Ys.addListSize(r,t.listSize),Ys.endFixedSizeList(r)}visitMap(t,r){return Qs.startMap(r),Qs.addKeysSorted(r,t.keysSorted),Qs.endMap(r)}},Xp=new Gb});function m5(e,t=new Map){return new ve(pH(e,t),Yp(e.metadata),t)}function kb(e){return new sr(e.count,g5(e.columns),y5(e.columns),null,b5(e.columns))}function p5(e){return new Wr(kb(e.data),e.id,e.isDelta)}function pH(e,t){return(e.fields||[]).filter(Boolean).map(r=>ee.fromJSON(r,t))}function f5(e,t){return(e.children||[]).filter(Boolean).map(r=>ee.fromJSON(r,t))}function g5(e){return(e||[]).reduce((t,r)=>[...t,new xi(r.count,gH(r.VALIDITY)),...g5(r.children)],[])}function y5(e,t=[]){for(let r=-1,n=(e||[]).length;++r<n;){let i=e[r];if(i.VALIDITY&&t.push(new $t(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new $t(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new $t(t.length,i.OFFSET.length)),i.DATA&&t.push(new $t(t.length,i.DATA.length)),i.VIEWS&&t.push(new $t(t.length,i.VIEWS.length)),i.VARIADIC_DATA_BUFFERS)for(let o of i.VARIADIC_DATA_BUFFERS)t.push(new $t(t.length,o.length));t=y5(i.children,t)}return t}function gH(e){return(e||[]).reduce((t,r)=>t+ +(r===0),0)}function b5(e){return(e||[]).reduce((t,r)=>[...t,...r.VARIADIC_DATA_BUFFERS?[r.VARIADIC_DATA_BUFFERS.length]:[],...b5(r.children)],[])}function w5(e,t){let r,n,i,o,s,a;return!t||!(o=e.dictionary)?(s=d5(e,f5(e,t)),i=new ee(e.name,s,e.nullable,Yp(e.metadata))):t.has(r=o.id)?(n=(n=o.indexType)?h5(n):new Yt,a=new nr(t.get(r),n,r,o.isOrdered),i=new ee(e.name,a,e.nullable,Yp(e.metadata))):(n=(n=o.indexType)?h5(n):new Yt,t.set(r,s=d5(e,f5(e,t))),a=new nr(s,n,r,o.isOrdered),i=new ee(e.name,a,e.nullable,Yp(e.metadata))),i||null}function Yp(e=[]){return new Map(e.map(({key:t,value:r})=>[t,r]))}function h5(e){return new Pt(e.isSigned,e.bitWidth)}function d5(e,t){let r=e.type.name;switch(r){case"NONE":return new Wt;case"null":return new Wt;case"binary":return new Tn;case"largebinary":return new zi;case"binaryview":return new Ee;case"utf8":return new Gr;case"largeutf8":return new qi;case"utf8view":return new on;case"bool":return new kr;case"list":return new rr((t||[])[0]);case"largelist":return new ei((t||[])[0]);case"struct":return new tt(t||[]);case"struct_":return new tt(t||[])}switch(r){case"int":{let n=e.type;return new Pt(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=e.type;return new Fr(He[n.precision])}case"decimal":{let n=e.type;return new An(n.scale,n.precision,n.bitWidth)}case"date":{let n=e.type;return new sn(st[n.unit])}case"time":{let n=e.type;return new Pr(q[n.unit],n.bitWidth)}case"timestamp":{let n=e.type;return new Rr(q[n.unit],n.timezone)}case"interval":{let n=e.type;return new Ur(ke[n.unit])}case"duration":{let n=e.type;return new an(q[n.unit])}case"union":{let n=e.type,[i,...o]=(n.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new cn(Ze[s],n.typeIds||[],t||[])}case"fixedsizebinary":{let n=e.type;return new In(n.byteWidth)}case"fixedsizelist":{let n=e.type;return new Ht(n.listSize,(t||[])[0])}case"map":{let n=e.type;return new jr((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}var x5=p(()=>{Vr();at();ga();Nt()});function wH(e,t){return(()=>{switch(t){case Ge.Schema:return ve.fromJSON(e);case Ge.RecordBatch:return sr.fromJSON(e);case Ge.DictionaryBatch:return Wr.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${Ge[t]}, type: ${t} }`)})}function xH(e,t){return(()=>{switch(t){case Ge.Schema:return ve.decode(e.header(new En),new Map,e.version());case Ge.RecordBatch:return sr.decode(e.header(new Dr),e.version());case Ge.DictionaryBatch:return Wr.decode(e.header(new Jo),e.version())}throw new Error(`Unrecognized Message type: { name: ${Ge[t]}, type: ${t} }`)})}function _H(e,t=new Map,r=it.V5){let n=PH(e,t);return new ve(n,Zp(e),t,r)}function SH(e,t=it.V5){return new sr(e.length(),TH(e),AH(e,t),v5(e.compression()),IH(e))}function MH(e,t=it.V5){return new Wr(sr.decode(e.data(),t),e.id(),e.isDelta())}function vH(e){return new $t(e.offset(),e.length())}function EH(e){return new xi(e.length(),e.nullCount())}function TH(e){let t=[];for(let r,n=-1,i=-1,o=e.nodesLength();++n<o;)(r=e.nodes(n))&&(t[++i]=xi.decode(r));return t}function AH(e,t){let r=[];for(let n,i=-1,o=-1,s=e.buffersLength();++i<s;)(n=e.buffers(i))&&(t<it.V4&&(n.bb_pos+=8*(i+1)),r[++o]=$t.decode(n));return r}function IH(e){let t=[],r=Math.trunc(e.variadicBufferCountsLength());for(let n=0;n<r;++n)t.push(Le(e.variadicBufferCounts(n)));return t}function PH(e,t){let r=[];for(let n,i=-1,o=-1,s=e.fieldsLength();++i<s;)(n=e.fields(i))&&(r[++o]=ee.decode(n,t));return r}function _5(e,t){let r=[];for(let n,i=-1,o=-1,s=e.childrenLength();++i<s;)(n=e.children(i))&&(r[++o]=ee.decode(n,t));return r}function RH(e,t){let r,n,i,o,s,a;return!t||!(a=e.dictionary())?(i=M5(e,_5(e,t)),n=new ee(e.name(),i,e.nullable(),Zp(e))):t.has(r=Le(a.id()))?(o=(o=a.indexType())?S5(o):new Yt,s=new nr(t.get(r),o,r,a.isOrdered()),n=new ee(e.name(),s,e.nullable(),Zp(e))):(o=(o=a.indexType())?S5(o):new Yt,t.set(r,i=M5(e,_5(e,t))),s=new nr(i,o,r,a.isOrdered()),n=new ee(e.name(),s,e.nullable(),Zp(e))),n||null}function Zp(e){let t=new Map;if(e)for(let r,n,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(r=e.customMetadata(i))&&(n=r.key())!=null&&t.set(n,r.value());return t}function LH(e){let t=new Map;for(let r,n,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(r=e.customMetadata(i))&&(n=r.key())!=null&&t.set(n,r.value());return t}function S5(e){return new Pt(e.isSigned(),e.bitWidth())}function M5(e,t){let r=e.typeType();switch(r){case pe.NONE:return new Wt;case pe.Null:return new Wt;case pe.Binary:return new Tn;case pe.LargeBinary:return new zi;case pe.BinaryView:return new Ee;case pe.Utf8:return new Gr;case pe.LargeUtf8:return new qi;case pe.Utf8View:return new on;case pe.Bool:return new kr;case pe.List:return new rr((t||[])[0]);case pe.LargeList:return new ei((t||[])[0]);case pe.Struct_:return new tt(t||[])}switch(r){case pe.Int:{let n=e.type(new Ni);return new Pt(n.isSigned(),n.bitWidth())}case pe.FloatingPoint:{let n=e.type(new Zs);return new Fr(n.precision())}case pe.Decimal:{let n=e.type(new bo);return new An(n.scale(),n.precision(),n.bitWidth())}case pe.Date:{let n=e.type(new $s);return new sn(n.unit())}case pe.Time:{let n=e.type(new Qo);return new Pr(n.unit(),n.bitWidth())}case pe.Timestamp:{let n=e.type(new es);return new Rr(n.unit(),n.timezone())}case pe.Interval:{let n=e.type(new Js);return new Ur(n.unit())}case pe.Duration:{let n=e.type(new Ks);return new an(n.unit())}case pe.Union:{let n=e.type(new Fi);return new cn(n.mode(),n.typeIdsArray()||[],t||[])}case pe.FixedSizeBinary:{let n=e.type(new Xs);return new In(n.byteWidth())}case pe.FixedSizeList:{let n=e.type(new Ys);return new Ht(n.listSize(),(t||[])[0])}case pe.Map:{let n=e.type(new Qs);return new jr((t||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${pe[r]}" (${r})`)}function v5(e){return e?new Ec(e.codec(),e.method()):null}function OH(e,t){let r=t.fields.map(o=>ee.encode(e,o));En.startFieldsVector(e,r.length);let n=En.createFieldsVector(e,r),i=t.metadata&&t.metadata.size>0?En.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),c=e.createString(`${s}`);return Dt.startKeyValue(e),Dt.addKey(e,a),Dt.addValue(e,c),Dt.endKeyValue(e)})):-1;return En.startSchema(e),En.addFields(e,n),En.addEndianness(e,GH?Hs.Little:Hs.Big),i!==-1&&En.addCustomMetadata(e,i),En.endSchema(e)}function BH(e,t){let r=-1,n=-1,i=-1,o=t.type,s=t.typeId;z.isDictionary(o)?(s=o.dictionary.typeId,i=Xp.visit(o,e),n=Xp.visit(o.dictionary,e)):n=Xp.visit(o,e);let a=(o.children||[]).map(u=>ee.encode(e,u)),c=Nr.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?Nr.createCustomMetadataVector(e,[...t.metadata].map(([u,h])=>{let d=e.createString(`${u}`),m=e.createString(`${h}`);return Dt.startKeyValue(e),Dt.addKey(e,d),Dt.addValue(e,m),Dt.endKeyValue(e)})):-1;return t.name&&(r=e.createString(t.name)),Nr.startField(e),Nr.addType(e,n),Nr.addTypeType(e,s),Nr.addChildren(e,c),Nr.addNullable(e,!!t.nullable),r!==-1&&Nr.addName(e,r),i!==-1&&Nr.addDictionary(e,i),l!==-1&&Nr.addCustomMetadata(e,l),Nr.endField(e)}function CH(e,t){let r=t.nodes||[],n=t.buffers||[],i=t.variadicBufferCounts||[];Dr.startNodesVector(e,r.length);for(let l of r.slice().reverse())xi.encode(e,l);let o=e.endVector();Dr.startBuffersVector(e,n.length);for(let l of n.slice().reverse())$t.encode(e,l);let s=e.endVector(),a=null;t.compression!==null&&(a=E5(e,t.compression));let c=-1;return i.length>0&&(c=Dr.createVariadicBufferCountsVector(e,i.map(BigInt))),Dr.startRecordBatch(e),Dr.addLength(e,BigInt(t.length)),Dr.addNodes(e,o),Dr.addBuffers(e,s),t.compression!==null&&a&&Dr.addCompression(e,a),c!==-1&&Dr.addVariadicBufferCounts(e,c),Dr.endRecordBatch(e)}function E5(e,t){return Zo.startBodyCompression(e),Zo.addCodec(e,t.type),Zo.addMethod(e,t.method),Zo.endBodyCompression(e)}function DH(e,t){let r=sr.encode(e,t.data);return Jo.startDictionaryBatch(e),Jo.addId(e,BigInt(t.id)),Jo.addIsDelta(e,t.isDelta),Jo.addData(e,r),Jo.endDictionaryBatch(e)}function NH(e,t){return au.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function FH(e,t){return su.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var Jp,yH,bH,Hr,sr,Wr,$t,xi,Ec,GH,ga=p(()=>{Jp=me(ze(),1);cb();hp();$2();KA();W2();ab();H2();dp();cu();K2();tb();Z2();Y2();ib();ob();rb();J2();sb();Q2();eb();nb();l5();V2();q2();Vr();dr();wo();Nt();u5();x5();at();yH=Jp.Builder,bH=Jp.ByteBuffer,Hr=class e{static fromJSON(t,r){let n=new e(0,it.V5,r);return n._createHeader=wH(t,r),n}static decode(t){t=new bH(se(t));let r=ii.getRootAsMessage(t),n=r.bodyLength(),i=r.version(),o=r.headerType(),s=LH(r),a=new e(n,i,o,void 0,s);return a._createHeader=xH(r,o),a}static encode(t){let r=new yH,n=-1;t.isSchema()?n=ve.encode(r,t.header()):t.isRecordBatch()?n=sr.encode(r,t.header()):t.isDictionaryBatch()&&(n=Wr.encode(r,t.header()));let i=t.metadata&&t.metadata.size>0?ii.createCustomMetadataVector(r,[...t.metadata].map(([o,s])=>{let a=r.createString(`${o}`),c=r.createString(`${s}`);return Dt.startKeyValue(r),Dt.addKey(r,a),Dt.addValue(r,c),Dt.endKeyValue(r)})):-1;return ii.startMessage(r),ii.addVersion(r,it.V5),ii.addHeader(r,n),ii.addHeaderType(r,t.headerType),ii.addBodyLength(r,BigInt(t.bodyLength)),i!==-1&&ii.addCustomMetadata(r,i),ii.finishMessageBuffer(r,ii.endMessage(r)),r.asUint8Array()}static from(t,r=0){if(t instanceof ve)return new e(0,it.V5,Ge.Schema,t);if(t instanceof sr)return new e(r,it.V5,Ge.RecordBatch,t,t.metadata);if(t instanceof Wr)return new e(r,it.V5,Ge.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get compression(){return this._compression}get bodyLength(){return this._bodyLength}get metadata(){return this._metadata}header(){return this._createHeader()}isSchema(){return this.headerType===Ge.Schema}isRecordBatch(){return this.headerType===Ge.RecordBatch}isDictionaryBatch(){return this.headerType===Ge.DictionaryBatch}constructor(t,r,n,i,o){this._version=r,this._headerType=n,this.body=new Uint8Array(0),this._compression=i==null?void 0:i.compression,i&&(this._createHeader=()=>i),this._bodyLength=Le(t),this._metadata=o||new Map}},sr=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}get compression(){return this._compression}get variadicBufferCounts(){return this._variadicBufferCounts}get metadata(){return this._metadata}constructor(t,r,n,i,o=[],s){this._nodes=r,this._buffers=n,this._length=Le(t),this._compression=i,this._variadicBufferCounts=o,this._metadata=s||new Map}},Wr=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,r,n=!1){this._data=t,this._isDelta=n,this._id=Le(r)}},$t=class{constructor(t,r){this.offset=Le(t),this.length=Le(r)}},xi=class{constructor(t,r){this.length=Le(t),this.nullCount=Le(r)}},Ec=class{constructor(t,r=gc.BUFFER){this.type=t,this.method=r}};ee.encode=BH;ee.decode=RH;ee.fromJSON=w5;ve.encode=OH;ve.decode=_H;ve.fromJSON=m5;sr.encode=CH;sr.decode=SH;sr.fromJSON=kb;Wr.encode=DH;Wr.decode=MH;Wr.fromJSON=p5;xi.encode=NH;xi.decode=EH;$t.encode=FH;$t.decode=vH;Ec.encode=E5;Ec.decode=v5;GH=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})()});var St,wh,Tc,Qp,xh=p(()=>{Ar();iu();St=Object.freeze({done:!0,value:void 0}),wh=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Tc=class{tee(){return this._getDOMStream().tee()}pipe(t,r){return this._getNodeStream().pipe(t,r)}pipeTo(t,r){return this._getDOMStream().pipeTo(t,r)}pipeThrough(t,r){return this._getDOMStream().pipeThrough(t,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},Qp=class extends Tc{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return H(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){let{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(St);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return mr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return mr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return H(this,void 0,void 0,function*(){return yield this.abort(t),St})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),St})}read(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((r,n)=>{this.resolvers.push({resolve:r,reject:n})}):Promise.resolve(St)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}});var Ln,_i,$r,Ub,os,vo=p(()=>{Ar();iu();Xo();xh();dr();Yo();Ln=class extends Qp{write(t){if((t=se(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?nu(this.toUint8Array(!0)):this.toUint8Array(!1).then(nu)}toUint8Array(t=!1){return t?Hn(this._values)[0]:H(this,void 0,void 0,function*(){var r,n,i,o;let s=[],a=0;try{for(var c=!0,l=zn(this),u;u=yield l.next(),r=u.done,!r;c=!0){o=u.value,c=!1;let h=o;s.push(h),a+=h.byteLength}}catch(h){n={error:h}}finally{try{!c&&!r&&(i=l.return)&&(yield i.call(l))}finally{if(n)throw n.error}}return Hn(s,a)[0]})}},_i=class{constructor(t){t&&(this.source=new Ub(mr.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},$r=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof Ln?this.source=new os(mr.fromAsyncIterable(t)):rp(t)?this.source=new os(mr.fromNodeStream(t)):qf(t)?this.source=new os(mr.fromDOMStream(t)):ep(t)?this.source=new os(mr.fromDOMStream(t.body)):Wn(t)?this.source=new os(mr.fromIterable(t)):Vn(t)?this.source=new os(mr.fromAsyncIterable(t)):Mn(t)&&(this.source=new os(mr.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},Ub=class{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,r="read"){return this.source.next({cmd:r,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||St)}return(t){return Object.create(this.source.return&&this.source.return(t)||St)}},os=class{constructor(t){this.source=t,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}cancel(t){return H(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return H(this,arguments,void 0,function*(r,n="read"){return yield this.source.next({cmd:n,size:r})})}throw(t){return H(this,void 0,void 0,function*(){let r=this.source.throw&&(yield this.source.throw(t))||St;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}return(t){return H(this,void 0,void 0,function*(){let r=this.source.return&&(yield this.source.return(t))||St;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}}});var _h,ya,jb=p(()=>{Ar();vo();dr();_h=class extends _i{constructor(t,r){super(),this.position=0,this.buffer=se(t),this.size=r===void 0?this.buffer.byteLength:r}readInt32(t){let{buffer:r,byteOffset:n}=this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:r,size:n,position:i}=this;return r&&i<n?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,i+Math.min(n-i,t)),r.subarray(i,this.position)):null}readAt(t,r){let n=this.buffer,i=Math.min(this.size,t+r);return n?n.subarray(t,i):new Uint8Array(r)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}},ya=class extends $r{constructor(t,r){super(),this.position=0,this._handle=t,typeof r=="number"?this.size=r:this._pending=H(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return H(this,void 0,void 0,function*(){let{buffer:r,byteOffset:n}=yield this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)})}seek(t){return H(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return H(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n,position:i}=this;if(r&&i<n){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=i,s=0,a=0,c=Math.min(n,o+Math.min(n-o,t)),l=new Uint8Array(Math.max(0,(this.position=c)-o));for(;(o+=a)<c&&(s+=a)<l.byteLength;)({bytesRead:a}=yield r.read(l,s,l.byteLength-s,o));return l}return null})}readAt(t,r){return H(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&t+r<i){let o=Math.min(i,t+r),s=new Uint8Array(o-t);return(yield n.read(s,0,r,t)).buffer}return new Uint8Array(r)})}close(){return H(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return H(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}}});var qb={};Jt(qb,{BaseInt64:()=>Sh,Int128:()=>Mh,Int64:()=>ss,Uint64:()=>Ft});function Mu(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var vu,zb,Sh,Ft,ss,Mh,Vb=p(()=>{vu=8,zb=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Sh=class{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let r=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),i=r[3]*n[3];this.buffer[0]=i&65535;let o=i>>>16;return i=r[2]*n[3],o+=i,i=r[3]*n[2]>>>0,o+=i,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<i?65536:0,this.buffer[1]+=o>>>16,this.buffer[1]+=r[1]*n[3]+r[2]*n[2]+r[3]*n[1],this.buffer[1]+=r[0]*n[3]+r[1]*n[2]+r[2]*n[1]+r[3]*n[0]<<16,this}_plus(t){let r=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],r<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=r}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${Mu(this.buffer[1])} ${Mu(this.buffer[0])}`}},Ft=class e extends Sh{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let n=t.length,i=new e(r);for(let o=0;o<n;){let s=vu<n-o?vu:n-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),c=new e(new Uint32Array([zb[s],0]));i.times(c),i.plus(a),o+=s}return i}static convertArray(t){let r=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},ss=class e extends Sh{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){let r=this.buffer[1]<<0,n=t.buffer[1]<<0;return r<n||r===n&&this.buffer[0]<t.buffer[0]}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let n=t.startsWith("-"),i=t.length,o=new e(r);for(let s=n?1:0;s<i;){let a=vu<i-s?vu:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),l=new e(new Uint32Array([zb[a],0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},Mh=class e{constructor(t){this.buffer=t}high(){return new ss(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new ss(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(t){let r=new Ft(new Uint32Array([this.buffer[3],0])),n=new Ft(new Uint32Array([this.buffer[2],0])),i=new Ft(new Uint32Array([this.buffer[1],0])),o=new Ft(new Uint32Array([this.buffer[0],0])),s=new Ft(new Uint32Array([t.buffer[3],0])),a=new Ft(new Uint32Array([t.buffer[2],0])),c=new Ft(new Uint32Array([t.buffer[1],0])),l=new Ft(new Uint32Array([t.buffer[0],0])),u=Ft.multiply(o,l);this.buffer[0]=u.low();let h=new Ft(new Uint32Array([u.high(),0]));return u=Ft.multiply(i,l),h.plus(u),u=Ft.multiply(o,c),h.plus(u),this.buffer[1]=h.low(),this.buffer[3]=h.lessThan(u)?1:0,this.buffer[2]=h.high(),new Ft(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Ft.multiply(n,l)).plus(Ft.multiply(i,c)).plus(Ft.multiply(o,a)),this.buffer[3]+=Ft.multiply(r,l).plus(Ft.multiply(n,c)).plus(Ft.multiply(i,a)).plus(Ft.multiply(o,s)).low(),this}plus(t){let r=new Uint32Array(4);return r[3]=this.buffer[3]+t.buffer[3]>>>0,r[2]=this.buffer[2]+t.buffer[2]>>>0,r[1]=this.buffer[1]+t.buffer[1]>>>0,r[0]=this.buffer[0]+t.buffer[0]>>>0,r[0]<this.buffer[0]>>>0&&++r[1],r[1]<this.buffer[1]>>>0&&++r[2],r[2]<this.buffer[2]>>>0&&++r[3],this.buffer[3]=r[3],this.buffer[2]=r[2],this.buffer[1]=r[1],this.buffer[0]=r[0],this}hex(){return`${Mu(this.buffer[3])} ${Mu(this.buffer[2])} ${Mu(this.buffer[1])} ${Mu(this.buffer[0])}`}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}static from(t,r=new Uint32Array(4)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(4)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(4)){let n=t.startsWith("-"),i=t.length,o=new e(r);for(let s=n?1:0;s<i;){let a=vu<i-s?vu:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),l=new e(new Uint32Array([zb[a],0,0,0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*4);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+16*n,4));return r}}});var Xb={};Jt(Xb,{toIntervalDayTimeInt32Array:()=>Wb,toIntervalDayTimeObjects:()=>$b,toIntervalMonthDayNanoInt32Array:()=>Hb,toIntervalMonthDayNanoObjects:()=>Kb});function Wb(e){var t,r;let n=e.length,i=new Int32Array(n*2);for(let o=0,s=0;o<n;o++){let a=e[o];i[s++]=(t=a.days)!==null&&t!==void 0?t:0,i[s++]=(r=a.milliseconds)!==null&&r!==void 0?r:0}return i}function Hb(e){var t,r;let n=e.length,i=new Int32Array(n*4);for(let o=0,s=0;o<n;o++){let a=e[o];i[s++]=(t=a.months)!==null&&t!==void 0?t:0,i[s++]=(r=a.days)!==null&&r!==void 0?r:0;let c=a.nanoseconds;if(c){let l=BigInt(c);i[s++]=Number(l&BigInt(4294967295))>>>0,i[s++]=Number(l>>BigInt(32))>>>0}else s+=2}return i}function $b(e){let t=e.length,r=new Array(t/2);for(let n=0,i=0;n<t;n+=2)r[i++]={days:e[n],milliseconds:e[n+1]};return r}function Kb(e,t){let r=e.length,n=new Array(r/4);for(let i=0,o=0;i<r;i+=4){let s=BigInt(e[i+3])<<BigInt(32)|BigInt(e[i+2]>>>0);n[o++]={months:e[i],days:e[i+1],nanoseconds:t?`${s}`:s}}return n}var e0=p(()=>{});function A5(e){let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)t[r>>1]=Number.parseInt(e.slice(r,r+2),16);return t}function kH(e){return A5(e.join(""))}function I5(e,t){let r=new Uint8Array(e.length*16),n=new DataView(r.buffer);for(let[i,o]of e.entries()){let s=i*16,a=o.SIZE;if(n.setInt32(s,a,!0),o.INLINED!==void 0){let c=t(o.INLINED);for(let l=0;l<c.length&&l<12;l++)r[s+4+l]=c[l]}else{let c=o.PREFIX_HEX;for(let l=0;l<8&&l<c.length;l+=2)r[s+4+(l>>1)]=Number.parseInt(c.slice(l,l+2),16);n.setInt32(s+8,o.BUFFER_INDEX,!0),n.setInt32(s+12,o.OFFSET,!0)}}return r}function UH(e){return I5(e,t=>{let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n>>1]=Number.parseInt(t.slice(n,n+2),16);return r})}function jH(e){return I5(e,t=>new TextEncoder().encode(t))}var Eu,t0,r0,P5=p(()=>{wi();Vr();at();Pn();Sc();Xo();Vb();Nt();dr();e0();Eu=class extends ie{constructor(t,r,n,i,o=it.V5,s=[]){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.variadicBufferIndex=-1,this.bytes=t,this.nodes=r,this.buffers=n,this.dictionaries=i,this.metadataVersion=o,this.variadicBufferCounts=s}visit(t){return super.visit(t instanceof ee?t.type:t)}visitNull(t,{length:r}=this.nextFieldNode()){return te({type:t,length:r})}visitBool(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitUtf8View(t,{length:r,nullCount:n}=this.nextFieldNode()){let i=this.readNullBitmap(t,n),o=this.readData(t),s=this.readVariadicBuffers(this.nextVariadicBufferCount());return te({type:t,length:r,nullCount:n,nullBitmap:i,views:o,variadicBuffers:s})}visitBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinaryView(t,{length:r,nullCount:n}=this.nextFieldNode()){let i=this.readNullBitmap(t,n),o=this.readData(t),s=this.readVariadicBuffers(this.nextVariadicBufferCount());return te({type:t,length:r,nullCount:n,nullBitmap:i,views:o,variadicBuffers:s})}visitFixedSizeBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitLargeList(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),children:this.visitMany(t.children)})}visitUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<it.V5&&this.readNullBitmap(t,n),t.mode===Ze.Sparse?this.visitSparseUnion(t,{length:r,nullCount:n}):this.visitDenseUnion(t,{length:r,nullCount:n})}visitDenseUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDuration(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),child:this.visit(t.children[0])})}visitMap(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,r,n=this.nextBufferRange()){return r>0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,r){return this.readData(t,r)}readTypeIds(t,r){return this.readData(t,r)}readData(t,{length:r,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+r)}readVariadicBuffers(t){return Array.from({length:t},()=>this.readData(null))}nextVariadicBufferCount(){var t;return(t=this.variadicBufferCounts[++this.variadicBufferIndex])!==null&&t!==void 0?t:0}readDictionary(t){return this.dictionaries.get(t.id)}},t0=class extends Eu{constructor(t,r,n,i,o,s=[]){super(new Uint8Array(0),r,n,i,o,s),this.sources=t}readNullBitmap(t,r,{offset:n}=this.nextBufferRange()){return r<=0?new Uint8Array(0):_c(this.sources[n])}readOffsets(t,{offset:r}=this.nextBufferRange()){return Re(Uint8Array,Re(t.OffsetArrayType,this.sources[r]))}readTypeIds(t,{offset:r}=this.nextBufferRange()){return Re(Uint8Array,Re(t.ArrayType,this.sources[r]))}readData(t,{offset:r}=this.nextBufferRange()){let{sources:n}=this;if(z.isTimestamp(t))return Re(Uint8Array,ss.convertArray(n[r]));if((z.isInt(t)||z.isTime(t))&&t.bitWidth===64||z.isDuration(t))return Re(Uint8Array,ss.convertArray(n[r]));if(z.isDate(t)&&t.unit===st.MILLISECOND)return Re(Uint8Array,ss.convertArray(n[r]));if(z.isDecimal(t))return Re(Uint8Array,Mh.convertArray(n[r]));if(z.isBinary(t)||z.isLargeBinary(t)||z.isFixedSizeBinary(t))return kH(n[r]);if(z.isBinaryView(t))return UH(n[r]);if(z.isUtf8View(t))return jH(n[r]);if(z.isBool(t))return _c(n[r]);if(z.isUtf8(t)||z.isLargeUtf8(t))return qn(n[r].join(""));if(z.isInterval(t))switch(t.unit){case ke.DAY_TIME:return Wb(n[r]);case ke.MONTH_DAY_NANO:return Hb(n[r]);default:break}return Re(Uint8Array,Re(t.ArrayType,n[r].map(i=>+i)))}readVariadicBuffers(t){let r=[];for(let n=0;n<t;n++){let{offset:i}=this.nextBufferRange(),o=this.sources[i];r.push(A5(o))}return r}};r0=class extends Eu{constructor(t,r,n,i,o,s=[]){super(new Uint8Array(0),r,n,i,o,s),this.bodyChunks=t}readData(t,r=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}});var as,n0=p(()=>{Wi();bt();dr();as=class extends qr{constructor(t){super(t),this._values=new Rn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,se(r))}_flushPending(t,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)n.set(s,0);else{let c=a.length;i.set(a,o),n.set(s,c),o+=c}}}});var cs,i0=p(()=>{dr();Wi();bt();cs=class extends qr{constructor(t){super(t),this._values=new Rn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,se(r))}_flushPending(t,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)n.set(s,BigInt(0));else{let c=a.length;i.set(a,o),n.set(s,BigInt(c)),o+=c}}}});var Ac,Yb=p(()=>{Wi();bt();Ac=class extends ct{constructor(t){super(t),this._values=new Su}setValue(t,r){this._values.set(t,+r)}}});var Eo,ba,wa,Zb=p(()=>{bt();ri();Eo=class extends or{};Eo.prototype._setValue=yb;ba=class extends Eo{};ba.prototype._setValue=yp;wa=class extends Eo{};wa.prototype._setValue=bp});var xa,Jb=p(()=>{bt();ri();xa=class extends or{};xa.prototype._setValue=xb});var Ic,Qb=p(()=>{at();bt();Tu();Ic=class extends ct{constructor({type:t,nullValues:r,dictionaryHashFunction:n}){super({type:new nr(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=oi({type:this.type.indices,nullValues:r}),this.dictionary=oi({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,r){let n=this.indices;return r=n.setValid(t,r),this.length=n.length,r}setValue(t,r){let n=this._keysToIndices,i=this.valueToKey(r),o=n[i];return o===void 0&&(n[i]=o=this._dictionaryOffset+this.dictionary.append(r).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,r=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=r?r.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}}});var _a,ew=p(()=>{bt();ri();_a=class extends or{};_a.prototype._setValue=gb});var Pc,tw=p(()=>{Vr();bt();at();Pc=class extends ct{setValue(t,r){let[n]=this.children,i=t*this.stride;for(let o=-1,s=this.stride;++o<s;)n.set(i+o,r[o])}setValid(t,r){return super.setValid(t,r)||this.children[0].setValid((t+1)*this.stride-1,!1),r}addChild(t,r="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(t);return this.type=new Ht(this.type.listSize,new ee(r,t.type,!0)),n}}});var To,Rc,Lc,Oc,rw=p(()=>{dh();bt();To=class extends or{setValue(t,r){this._values.set(t,r)}},Rc=class extends To{setValue(t,r){super.setValue(t,hh(r))}},Lc=class extends To{},Oc=class extends To{}});var $i,Sa,Ma,va,nw=p(()=>{bt();ri();$i=class extends or{};$i.prototype._setValue=_b;Sa=class extends $i{};Sa.prototype._setValue=Ap;Ma=class extends $i{};Ma.prototype._setValue=Ip;va=class extends $i{};va.prototype._setValue=Pp});var Si,Ea,Ta,Aa,Ia,iw=p(()=>{bt();ri();Si=class extends or{};Si.prototype._setValue=Sb;Ea=class extends Si{};Ea.prototype._setValue=Rp;Ta=class extends Si{};Ta.prototype._setValue=Lp;Aa=class extends Si{};Aa.prototype._setValue=Op;Ia=class extends Si{};Ia.prototype._setValue=Bp});var ln,Bc,Cc,Dc,Nc,Fc,Gc,kc,Uc,ow=p(()=>{bt();ln=class extends or{setValue(t,r){this._values.set(t,r)}},Bc=class extends ln{},Cc=class extends ln{},Dc=class extends ln{},Nc=class extends ln{},Fc=class extends ln{},Gc=class extends ln{},kc=class extends ln{},Uc=class extends ln{}});var jc,sw=p(()=>{Vr();at();Wi();bt();jc=class extends qr{constructor(t){super(t),this._offsets=new pa(t.type)}addChild(t,r="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new rr(new ee(r,t.type,!0)),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(typeof o>"u")r.set(i,0);else{let s=o,a=s.length,c=r.set(i,a).buffer[i];for(let l=-1;++l<a;)n.set(c+l,s[l])}}}});var zc,aw=p(()=>{Vr();at();Wi();wo();bt();zc=class extends qr{constructor(t){super(t),this._offsets=new pa(t.type)}addChild(t,r="0"){if(this.numChildren>0)throw new Error("LargeListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new ei(new ee(r,t.type,!0)),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(typeof o>"u")r.set(i,BigInt(0));else{let s=o,a=s.length,c=Le(r.set(i,BigInt(a)).buffer[i]);for(let l=-1;++l<a;)n.set(c+l,s[l])}}}});var qc,cw=p(()=>{Vr();at();bt();qc=class extends qr{set(t,r){return super.set(t,r)}setValue(t,r){let n=r instanceof Map?r:new Map(Object.entries(r)),i=this._pending||(this._pending=new Map),o=i.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=n.size,i.set(t,n)}addChild(t,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new jr(new ee(r,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(o===void 0)r.set(i,0);else{let{[i]:s,[i+1]:a}=r.set(i,o.size).buffer;for(let c of o.entries())if(n.set(s,c),++s>=a)break}}}});var Vc,lw=p(()=>{bt();Vc=class extends ct{setValue(t,r){}setValid(t,r){return this.length=Math.max(t+1,this.length),r}}});var Wc,uw=p(()=>{Vr();bt();at();Wc=class extends ct{setValue(t,r){let{children:n,type:i}=this;switch(Array.isArray(r)||r.constructor){case!0:return i.children.forEach((o,s)=>n[s].set(t,r[s]));case Map:return i.children.forEach((o,s)=>n[s].set(t,r.get(o.name)));default:return i.children.forEach((o,s)=>n[s].set(t,r[o.name]))}}setValid(t,r){return super.setValid(t,r)||this.children.forEach(n=>n.setValid(t,r)),r}addChild(t,r=`${this.numChildren}`){let n=this.children.push(t);return this.type=new tt([...this.type.children,new ee(r,t.type,!0)]),n}}});var Mi,Pa,Ra,La,Oa,fw=p(()=>{bt();ri();Mi=class extends or{};Mi.prototype._setValue=bb;Pa=class extends Mi{};Pa.prototype._setValue=wp;Ra=class extends Mi{};Ra.prototype._setValue=xp;La=class extends Mi{};La.prototype._setValue=_p;Oa=class extends Mi{};Oa.prototype._setValue=Sp});var vi,Ba,Ca,Da,Na,hw=p(()=>{bt();ri();vi=class extends or{};vi.prototype._setValue=wb;Ba=class extends vi{};Ba.prototype._setValue=Mp;Ca=class extends vi{};Ca.prototype._setValue=vp;Da=class extends vi{};Da.prototype._setValue=Ep;Na=class extends vi{};Na.prototype._setValue=Tp});var ls,Hc,$c,dw=p(()=>{Vr();Wi();bt();at();ls=class extends ct{constructor(t){super(t),this._typeIds=new ns(Int8Array,0,1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,r){return this.set(this.length,t,r)}set(t,r,n){return n===void 0&&(n=this._valueToChildTypeId(this,r,t)),this.setValue(t,r,n),this}setValue(t,r,n){this._typeIds.set(t,n);let i=this.type.typeIdToChildIndex[n],o=this.children[i];o==null||o.set(t,r),this.length=Math.max(t+1,this.length)}addChild(t,r=`${this.children.length}`){let n=this.children.push(t),{type:{children:i,mode:o,typeIds:s}}=this,a=[...i,new ee(r,t.type)];return this.type=new cn(o,[...s,n],a),n}_valueToChildTypeId(t,r,n){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},Hc=class extends ls{},$c=class extends ls{constructor(t){super(t),this._offsets=new ns(Int32Array)}setValue(t,r,n){let i=this._typeIds.set(t,n).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[i]),s=this._offsets.set(t,o.length).buffer[t];o==null||o.set(s,r),this.length=Math.max(t+1,this.length)}}});var Fa,mw=p(()=>{Xo();n0();Wi();bt();Fa=class extends qr{constructor(t){super(t),this._values=new Rn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,qn(r))}_flushPending(t,r){}};Fa.prototype._flushPending=as.prototype._flushPending});var Ga,pw=p(()=>{Xo();Wi();bt();i0();Ga=class extends qr{constructor(t){super(t),this._values=new Rn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,qn(r))}_flushPending(t,r){}};Ga.prototype._flushPending=cs.prototype._flushPending});var us,o0=p(()=>{at();bt();Wi();dr();wi();us=class extends ct{constructor(t){super(t),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new Rn(Uint8Array)}get byteLength(){let t=0;this._views&&(t+=this._views.byteLength),this._nulls&&(t+=this._nulls.byteLength);for(let r of this._variadicBuffers)t+=r.byteLength;return this._currentBuffer&&(t+=this._currentBuffer.byteLength),t}setValue(t,r){return this.writeBinaryValue(t,this.encodeValue(r))}writeBinaryValue(t,r){let n=r.length,i=(t+1)*Ee.ELEMENT_WIDTH,o=this._views.length;i>o&&this._views.reserve(i-o);let s=this._views.buffer,a=t*Ee.ELEMENT_WIDTH,c=new DataView(s.buffer,s.byteOffset+a,Ee.ELEMENT_WIDTH);if(c.setInt32(Ee.LENGTH_OFFSET,n,!0),n<=Ee.INLINE_CAPACITY){s.set(r,a+Ee.INLINE_OFFSET);for(let l=n;l<Ee.INLINE_CAPACITY;l++)s[a+Ee.INLINE_OFFSET+l]=0}else{let l=new DataView(r.buffer,r.byteOffset,Math.min(4,n));c.setUint32(Ee.INLINE_OFFSET,l.getUint32(0,!0),!0),(!this._currentBuffer||this._currentBufferOffset+n>this._bufferSize)&&(this._currentBuffer&&this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=new Rn(Uint8Array),this._currentBufferIndex=this._variadicBuffers.length,this._currentBufferOffset=0),this._currentBuffer.reserve(n).buffer.set(r,this._currentBufferOffset),c.setInt32(Ee.BUFFER_INDEX_OFFSET,this._currentBufferIndex,!0),c.setInt32(Ee.BUFFER_OFFSET_OFFSET,this._currentBufferOffset,!0),this._currentBufferOffset+=n}return this}encodeValue(t){return se(t)}setValid(t,r){let n=(t+1)*Ee.ELEMENT_WIDTH,i=this._views.length;n>i&&this._views.reserve(n-i);let o=super.setValid(t,r);if(!o){let s=this._views.buffer,a=t*Ee.ELEMENT_WIDTH;for(let c=0;c<Ee.ELEMENT_WIDTH;c++)s[a+c]=0}return o}clear(){return this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._views.clear(),super.clear()}flush(){let{type:t,length:r,nullCount:n,_views:i,_nulls:o}=this;this._currentBuffer&&this._currentBufferOffset>0&&(this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=null,this._currentBufferOffset=0);let s=i.flush(r*Ee.ELEMENT_WIDTH),a=n>0?o.flush(r):void 0,c=this._variadicBuffers.slice();return this._variadicBuffers=[],this._currentBufferIndex=0,this.clear(),te({type:t,length:r,nullCount:n,nullBitmap:a,views:s,variadicBuffers:c})}finish(){return this.finished=!0,this}}});var Kc,gw=p(()=>{o0();Xo();Kc=class extends us{constructor(t){super(t)}setValue(t,r){return this.writeBinaryValue(t,qn(r))}}});var yw,R5,L5=p(()=>{Pn();n0();i0();Yb();Zb();Jb();Qb();ew();tw();rw();nw();iw();ow();sw();aw();cw();lw();uw();fw();hw();dw();mw();pw();o0();gw();yw=class extends ie{visitNull(){return Vc}visitBool(){return Ac}visitInt(){return ln}visitInt8(){return Bc}visitInt16(){return Cc}visitInt32(){return Dc}visitInt64(){return Nc}visitUint8(){return Fc}visitUint16(){return Gc}visitUint32(){return kc}visitUint64(){return Uc}visitFloat(){return To}visitFloat16(){return Rc}visitFloat32(){return Lc}visitFloat64(){return Oc}visitUtf8(){return Fa}visitLargeUtf8(){return Ga}visitBinary(){return as}visitLargeBinary(){return cs}visitFixedSizeBinary(){return _a}visitDate(){return Eo}visitDateDay(){return ba}visitDateMillisecond(){return wa}visitTimestamp(){return Mi}visitTimestampSecond(){return Pa}visitTimestampMillisecond(){return Ra}visitTimestampMicrosecond(){return La}visitTimestampNanosecond(){return Oa}visitTime(){return vi}visitTimeSecond(){return Ba}visitTimeMillisecond(){return Ca}visitTimeMicrosecond(){return Da}visitTimeNanosecond(){return Na}visitDecimal(){return xa}visitList(){return jc}visitLargeList(){return zc}visitStruct(){return Wc}visitUnion(){return ls}visitDenseUnion(){return $c}visitSparseUnion(){return Hc}visitDictionary(){return Ic}visitInterval(){return $i}visitIntervalDayTime(){return Sa}visitIntervalYearMonth(){return Ma}visitIntervalMonthDayNano(){return va}visitDuration(){return Si}visitDurationSecond(){return Ea}visitDurationMillisecond(){return Ta}visitDurationMicrosecond(){return Aa}visitDurationNanosecond(){return Ia}visitFixedSizeList(){return Pc}visitMap(){return qc}visitBinaryView(){return us}visitUtf8View(){return Kc}},R5=new yw});function un(e,t){return t instanceof e.constructor}function fs(e,t){return e===t||un(e,t)}function hs(e,t){return e===t||un(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function s0(e,t){return e===t||un(e,t)&&e.precision===t.precision}function zH(e,t){return e===t||un(e,t)&&e.byteWidth===t.byteWidth}function bw(e,t){return e===t||un(e,t)&&e.unit===t.unit}function vh(e,t){return e===t||un(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Eh(e,t){return e===t||un(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function O5(e,t){return e===t||un(e,t)&&e.children.length===t.children.length&&Ao.compareManyFields(e.children,t.children)}function qH(e,t){return e===t||un(e,t)&&e.children.length===t.children.length&&Ao.compareManyFields(e.children,t.children)}function ww(e,t){return e===t||un(e,t)&&e.mode===t.mode&&e.typeIds.every((r,n)=>r===t.typeIds[n])&&Ao.compareManyFields(e.children,t.children)}function VH(e,t){return e===t||un(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Ao.visit(e.indices,t.indices)&&Ao.visit(e.dictionary,t.dictionary)}function a0(e,t){return e===t||un(e,t)&&e.unit===t.unit}function Th(e,t){return e===t||un(e,t)&&e.unit===t.unit}function WH(e,t){return e===t||un(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Ao.compareManyFields(e.children,t.children)}function HH(e,t){return e===t||un(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Ao.compareManyFields(e.children,t.children)}function Xc(e,t){return Ao.compareSchemas(e,t)}function B5(e,t){return Ao.compareFields(e,t)}function c0(e,t){return Ao.visit(e,t)}var he,Ao,Ah=p(()=>{Pn();he=class extends ie{compareSchemas(t,r){return t===r||r instanceof t.constructor&&this.compareManyFields(t.fields,r.fields)}compareManyFields(t,r){return t===r||Array.isArray(t)&&Array.isArray(r)&&t.length===r.length&&t.every((n,i)=>this.compareFields(n,r[i]))}compareFields(t,r){return t===r||r instanceof t.constructor&&t.name===r.name&&t.nullable===r.nullable&&this.visit(t.type,r.type)}};he.prototype.visitNull=fs;he.prototype.visitBool=fs;he.prototype.visitInt=hs;he.prototype.visitInt8=hs;he.prototype.visitInt16=hs;he.prototype.visitInt32=hs;he.prototype.visitInt64=hs;he.prototype.visitUint8=hs;he.prototype.visitUint16=hs;he.prototype.visitUint32=hs;he.prototype.visitUint64=hs;he.prototype.visitFloat=s0;he.prototype.visitFloat16=s0;he.prototype.visitFloat32=s0;he.prototype.visitFloat64=s0;he.prototype.visitUtf8=fs;he.prototype.visitLargeUtf8=fs;he.prototype.visitUtf8View=fs;he.prototype.visitBinary=fs;he.prototype.visitLargeBinary=fs;he.prototype.visitBinaryView=fs;he.prototype.visitFixedSizeBinary=zH;he.prototype.visitDate=bw;he.prototype.visitDateDay=bw;he.prototype.visitDateMillisecond=bw;he.prototype.visitTimestamp=vh;he.prototype.visitTimestampSecond=vh;he.prototype.visitTimestampMillisecond=vh;he.prototype.visitTimestampMicrosecond=vh;he.prototype.visitTimestampNanosecond=vh;he.prototype.visitTime=Eh;he.prototype.visitTimeSecond=Eh;he.prototype.visitTimeMillisecond=Eh;he.prototype.visitTimeMicrosecond=Eh;he.prototype.visitTimeNanosecond=Eh;he.prototype.visitDecimal=fs;he.prototype.visitList=O5;he.prototype.visitLargeList=O5;he.prototype.visitStruct=qH;he.prototype.visitUnion=ww;he.prototype.visitDenseUnion=ww;he.prototype.visitSparseUnion=ww;he.prototype.visitDictionary=VH;he.prototype.visitInterval=a0;he.prototype.visitIntervalDayTime=a0;he.prototype.visitIntervalYearMonth=a0;he.prototype.visitIntervalMonthDayNano=a0;he.prototype.visitDuration=Th;he.prototype.visitDurationSecond=Th;he.prototype.visitDurationMillisecond=Th;he.prototype.visitDurationMicrosecond=Th;he.prototype.visitDurationNanosecond=Th;he.prototype.visitFixedSizeList=WH;he.prototype.visitMap=HH;Ao=new he});function oi(e){let t=e.type,r=new(R5.getVisitFn(t)())(e);if(t.children&&t.children.length>0){let n=e.children||[],i={nullValues:e.nullValues},o=Array.isArray(n)?((s,a)=>n[a]||i):(({name:s})=>n[s]||i);for(let[s,a]of t.children.entries()){let{type:c}=a,l=o(a,s);r.children.push(oi(Object.assign(Object.assign({},l),{type:c})))}}return r}function Au(e,t){if(e instanceof ce||e instanceof $||e.type instanceof z||ArrayBuffer.isView(e))return Mo(e);let r={type:t??l0(e),nullValues:[null]},n=[...u0(r)(e)],i=n.length===1?n[0]:n.reduce((o,s)=>o.concat(s));return z.isDictionary(i.type)?i.memoize():i}function xw(e){let t=Au(e),r=new $e(new ve(t.type.children),t.data[0]);return new ot(r)}function l0(e){if(e.length===0)return new Wt;let t=0,r=0,n=0,i=0,o=0,s=0,a=0,c=0;for(let l of e){if(l==null){++t;continue}switch(typeof l){case"bigint":++s;continue;case"boolean":++a;continue;case"number":++i;continue;case"string":++o;continue;case"object":Array.isArray(l)?++r:Object.prototype.toString.call(l)==="[object Date]"?++c:++n;continue}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}if(i+t===e.length)return new Qn;if(o+t===e.length)return new nr(new Gr,new Yt);if(s+t===e.length)return new Yn;if(a+t===e.length)return new kr;if(c+t===e.length)return new xo;if(r+t===e.length){let l=e,u=l0(l[l.findIndex(h=>h!=null)]);if(l.every(h=>h==null||c0(u,l0(h))))return new rr(new ee("",u,!0))}else if(n+t===e.length){let l=new Map;for(let u of e)for(let h of Object.keys(u))!l.has(h)&&u[h]!=null&&l.set(h,new ee(h,l0([u[h]]),!0));return new tt([...l.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function u0(e){let{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:r=t!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=e,n=t!=="bytes"?"length":"byteLength";return function*(i){let o=0,s=oi(e);for(let a of i)s.append(a)[n]>=r&&++o&&(yield s.toVector());(s.finish().length>0||o===0)&&(yield s.toVector())}}function _w(e){let{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:r=t!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=e,n=t!=="bytes"?"length":"byteLength";return function(i){return en(this,arguments,function*(){var o,s,a,c;let l=0,u=oi(e);try{for(var h=!0,d=zn(i),m;m=yield Me(d.next()),o=m.done,!o;h=!0){c=m.value,h=!1;let g=c;u.append(g)[n]>=r&&++l&&(yield yield Me(u.toVector()))}}catch(g){s={error:g}}finally{try{!h&&!o&&(a=d.return)&&(yield Me(a.call(d)))}finally{if(s)throw s.error}}(u.finish().length>0||l===0)&&(yield yield Me(u.toVector()))})}}var Tu=p(()=>{Ar();Vr();at();wi();zr();L5();Yc();ds();Ah()});function f0(e,t){return $H(e,t.map(r=>r.data.concat()))}function $H(e,t){let r=[...e.fields],n=[],i={numBatches:t.reduce((h,d)=>Math.max(h,d.length),0)},o=0,s=0,a=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,a=-1;++a<c;)u[a]=l=t[a].shift(),s=Math.min(s,l?l.length:s);Number.isFinite(s)&&(u=KH(r,s,u,t,i),s>0&&(n[o++]=te({type:new tt(r),length:s,nullCount:0,children:u.slice()})))}return[e=e.assign(r),n.map(h=>new $e(e,h))]}function KH(e,t,r,n,i){var o;let s=(t+63&-64)>>3;for(let a=-1,c=n.length;++a<c;){let l=r[a],u=l==null?void 0:l.length;if(u>=t)u===t?r[a]=l:(r[a]=l.slice(0,t),i.numBatches=Math.max(i.numBatches,n[a].unshift(l.slice(t,u-t))));else{let h=e[a];e[a]=h.clone({nullable:!0}),r[a]=(o=l==null?void 0:l._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:te({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(s)})}}return r}var C5=p(()=>{wi();at();ds()});function Sw(e){let t={},r=Object.entries(e);for(let[n,i]of r)t[n]=Mo(i);return new ot(t)}function Mw(e){let t={},r=Object.entries(e);for(let[n,i]of r)t[n]=Au(i);return new ot(t)}var D5,N5,ot,Yc=p(()=>{Nt();wi();Tu();zr();Vr();at();Ah();C5();qp();bc();ri();Vp();Wp();bu();ds();N5=Symbol.for("apache-arrow/Table"),ot=class e{static isTable(t){return(t==null?void 0:t[N5])===!0}constructor(...t){var r,n;if(t.length===0)return this.batches=[],this.schema=new ve([]),this._offsets=[0],this;let i,o;t[0]instanceof ve&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop());let s=c=>{if(c){if(c instanceof $e)return[c];if(c instanceof e)return c.batches;if(c instanceof ce){if(c.type instanceof tt)return[new $e(new ve(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(l=>s(l));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(l=>s(l));if(typeof c=="object"){let l=Object.keys(c),u=l.map(m=>new $([c[m]])),h=i??new ve(l.map((m,g)=>new ee(String(m),u[g].type,u[g].nullable))),[,d]=f0(h,u);return d.length===0?[new $e(c)]:d}}}return[]},a=t.flatMap(c=>s(c));if(i=(n=i??((r=a[0])===null||r===void 0?void 0:r.schema))!==null&&n!==void 0?n:new ve([]),!(i instanceof ve))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof $e))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Xc(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??kp(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,r)=>t+r.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=Gp(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(wc(t,this.numRows))}set(t,r){}indexOf(t,r){return-1}[Symbol.iterator](){return this.batches.length>0?_u.visit(new $(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
11
11
  ${this.toArray().join(`,
12
12
  `)}
13
- ]`}concat(...t){let r=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new e(r,n.map(i=>new $e(r,i)))}slice(t,r){let n=this.schema;[t,r]=dh({length:this.numRows},t,r);let i=G0(this.data,this._offsets,t,r);return new e(n,i.map(o=>new $e(n,o)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){let r=this.data.map(n=>n.children[t]);if(r.length===0){let{type:n}=this.schema.fields[t],i=te({type:n,length:0,nullCount:0});r.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new $(r)}return null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),r)}setChildAt(t,r){let n=this.schema,i=[...this.batches];if(t>-1&&t<this.numCols){r||(r=new $([te({type:new Vt,length:this.numRows})]));let o=n.fields.slice(),s=o[t].clone({type:r.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[o[t],a[t]]=[s,r],[n,i]=lp(n,a)}return new e(n,i)}select(t){let r=this.schema.fields.reduce((n,i,o)=>n.set(i.name,o),new Map);return this.selectAt(t.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(t){let r=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new e(r,n)}assign(t){let r=this.schema.fields,[n,i]=t.schema.fields.reduce((a,c,l)=>{let[u,h]=a,d=r.findIndex(m=>m.name===c.name);return~d?h[d]=l:u.push(l),a},[[],[]]),o=this.schema.assign(t.schema),s=[...r.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new e(...lp(o,s))}};f5=Symbol.toStringTag;it[f5]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e[h5]=!0,e.isValid=bu(gh),e.get=bu(tr.getVisitFn(x.Struct)),e.set=k0(Rr.getVisitFn(x.Struct)),e.indexOf=U0(_c.getVisitFn(x.Struct)),"Table"))(it.prototype);Object.defineProperty(it,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===it&&it.isTable(t)}})});function d5(e,t,r=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;let i=[...e.fields],o=[...t],s=(r+63&-64)>>3;for(let[a,c]of e.fields.entries()){let l=t[a];(!l||l.length!==r)&&(i[a]=c.clone({nullable:!0}),o[a]=(n=l==null?void 0:l._changeLengthAndBackfillNullBitmap(r))!==null&&n!==void 0?n:te({type:c.type,length:r,nullCount:r,nullBitmap:new Uint8Array(s)}))}return[e.assign(i),te({type:new et(i),length:r,children:o})]}function g5(e,t,r=new Map){var n,i;if(((n=e==null?void 0:e.length)!==null&&n!==void 0?n:0)>0&&(e==null?void 0:e.length)===(t==null?void 0:t.length))for(let o=-1,s=e.length;++o<s;){let{type:a}=e[o],c=t[o];for(let l of[c,...((i=c==null?void 0:c.dictionary)===null||i===void 0?void 0:i.data)||[]])g5(a.children,l==null?void 0:l.children,r);if(z.isDictionary(a)){let{id:l}=a;if(!r.has(l))c!=null&&c.dictionary&&r.set(l,c.dictionary);else if(r.get(l)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return r}var m5,p5,$e,Xc,fs=p(()=>{yi();Kc();jr();qr();st();gu();gc();ei();z0();q0();p5=Symbol.for("apache-arrow/RecordBatch"),$e=class e{static isRecordBatch(t){return(t==null?void 0:t[p5])===!0}constructor(...t){switch(t.length){case 3:case 2:{if([this.schema]=t,!(this.schema instanceof ve))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=te({nullCount:0,type:new et(this.schema.fields),children:this.schema.fields.map(r=>te({type:r.type,nullCount:0}))}),this._metadata=new Map]=t,!(this.data instanceof ce))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=d5(this.schema,this.data.children,this.data.length);break}case 1:{let[r]=t,{fields:n,children:i,length:o}=Object.keys(r).reduce((c,l,u)=>(c.children[u]=r[l],c.length=Math.max(c.length,r[l].length),c.fields[u]=ee.new({name:l,type:r[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),s=new ve(n),a=te({type:new et(n),length:o,children:i,nullCount:0});[this.schema,this.data]=d5(s,a.children,o),this._metadata=new Map;break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get metadata(){return this._metadata}get dictionaries(){return this._dictionaries||(this._dictionaries=g5(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return tr.visit(this.data,t)}at(t){return this.get(yc(t,this.numRows))}set(t,r){return Rr.visit(this.data,t,r)}indexOf(t,r){return _c.visit(this.data,t,r)}[Symbol.iterator](){return wu.visit(new $([this.data]))}toArray(){return[...this]}concat(...t){return new it(this.schema,[this,...t])}slice(t,r){let[n]=new $([this.data]).slice(t,r).data;return new e(this.schema,n,this._metadata)}getChild(t){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new $([this.data.children[t]]):null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),r)}setChildAt(t,r){let n=this.schema,i=this.data;if(t>-1&&t<this.numCols){r||(r=new $([te({type:new Vt,length:this.numRows})]));let o=n.fields.slice(),s=i.children.slice(),a=o[t].clone({type:r.type});[o[t],s[t]]=[a,r.data[0]],n=new ve(o,new Map(this.schema.metadata)),i=te({type:new et(o),length:i.length,children:s})}return new e(n,i,this._metadata)}select(t){let r=this.schema.select(t),n=new et(r.fields),i=[];for(let o of t){let s=this.schema.fields.findIndex(a=>a.name===o);~s&&(i[s]=this.data.children[s])}return new e(r,te({type:n,length:this.numRows,children:i}),this._metadata)}selectAt(t){let r=this.schema.selectAt(t),n=t.map(o=>this.data.children[o]).filter(Boolean),i=te({type:new et(r.fields),length:this.numRows,children:n});return new e(r,i,this._metadata)}};m5=Symbol.toStringTag;$e[m5]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e[p5]=!0,"RecordBatch"))($e.prototype);Object.defineProperty($e,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===$e&&$e.isRecordBatch(t)}});Xc=class extends $e{constructor(t,r){let n=t.fields.map(o=>te({type:o.type})),i=te({type:new et(t.fields),length:0,nullCount:0,children:n});super(t,i,r||new Map)}}});function fp(e,t=0){for(let r=-1,n=Au.length;++r<n;)if(Au[r]!==e[t+r])return!1;return!0}var hw,dw,mw,y5,b5,Fa,Yc,Zc,up,fw,Au,Tu,pw,w5,hp=p(()=>{Ar();Dt();hw=pe(ze(),1);ma();Ko();Ib();fr();So();bh();dw=e=>`Expected ${Ge[e]} Message in stream, but was null or length 0.`,mw=e=>`Header pointer of flatbuffer-encoded ${Ge[e]} Message is null or length 0.`,y5=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,b5=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,Fa=class{constructor(t){this.source=t instanceof wi?t:new wi(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?_t:t.value===-1&&(t=this.readMetadataLength()).done?_t:(t=this.readMetadata(t.value)).done?_t:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(dw(t));return r.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let r=se(this.source.read(t));if(r.byteLength<t)throw new Error(b5(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(t=!1){let r=Ge.Schema,n=this.readMessage(r),i=n==null?void 0:n.header();if(t&&!i)throw new Error(mw(r));return i}readMetadataLength(){let t=this.source.read(up),r=t&&new hw.ByteBuffer(t),n=(r==null?void 0:r.readInt32(0))||0;return{done:n===0,value:n}}readMetadata(t){let r=this.source.read(t);if(!r)return _t;if(r.byteLength<t)throw new Error(y5(t,r.byteLength));return{done:!1,value:Wr.decode(r)}}},Yc=class{constructor(t,r){this.source=t instanceof Hr?t:Zm(t)?new pa(t,r):new Hr(t)}[Symbol.asyncIterator](){return this}next(){return H(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?_t:t.value===-1&&(t=yield this.readMetadataLength()).done?_t:(t=yield this.readMetadata(t.value)).done?_t:t})}throw(t){return H(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return H(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return H(this,void 0,void 0,function*(){let r;if((r=yield this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(dw(t));return r.value})}readMessageBody(t){return H(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let r=se(yield this.source.read(t));if(r.byteLength<t)throw new Error(b5(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()})}readSchema(){return H(this,arguments,void 0,function*(t=!1){let r=Ge.Schema,n=yield this.readMessage(r),i=n==null?void 0:n.header();if(t&&!i)throw new Error(mw(r));return i})}readMetadataLength(){return H(this,void 0,void 0,function*(){let t=yield this.source.read(up),r=t&&new hw.ByteBuffer(t),n=(r==null?void 0:r.readInt32(0))||0;return{done:n===0,value:n}})}readMetadata(t){return H(this,void 0,void 0,function*(){let r=yield this.source.read(t);if(!r)return _t;if(r.byteLength<t)throw new Error(y5(t,r.byteLength));return{done:!1,value:Wr.decode(r)}})}},Zc=class extends Fa{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof yh?t:new yh(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Wr.fromJSON(t.schema,Ge.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let r=t.dictionaries[this._dictionaryIndex++];return this._body=r.data.columns,{done:!1,value:Wr.fromJSON(r,Ge.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let r=t.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:Wr.fromJSON(r,Ge.RecordBatch)}}return this._body=[],_t}readMessageBody(t){return r(this._body);function r(n){return(n||[]).reduce((i,o)=>[...i,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE_ID&&[o.TYPE_ID]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...o.VIEWS&&[o.VIEWS]||[],...o.VARIADIC_DATA_BUFFERS||[],...r(o.children)],[])}}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(dw(t));return r.value}readSchema(){let t=Ge.Schema,r=this.readMessage(t),n=r==null?void 0:r.header();if(!r||!n)throw new Error(mw(t));return n}},up=4,fw="ARROW1",Au=new Uint8Array(fw.length);for(let e=0;e<fw.length;e+=1)Au[e]=fw.codePointAt(e);Tu=Au.length,pw=Tu+up,w5=Tu*2+up});var gw,yw,x5,_5=p(()=>{nu();gw=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(t){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=t.encode(r);return this._isValidCompressed(n)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)&&this._hasValidVersion(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.LZ4_FRAME_MAGIC.every((r,n)=>t[n]===r)}_hasValidVersion(t){return(t[4]&192)>>6===1}},yw=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(t){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=t.encode(r);return this._isValidCompressed(n)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.ZSTD_MAGIC.every((r,n)=>t[n]===r)}},x5={[Tr.LZ4_FRAME]:new gw,[Tr.ZSTD]:new yw}});var bw,Ga,dp=p(()=>{nu();_5();bw=class{constructor(){this.registry={}}set(t,r){if(r!=null&&r.encode&&typeof r.encode=="function"&&!x5[t].isValidCodecEncode(r))throw new Error(`Encoder for ${Tr[t]} is not valid.`);this.registry[t]=r}get(t){var r;return((r=this.registry)===null||r===void 0?void 0:r[t])||null}},Ga=new bw});function A5(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*S5(e){let t=dr.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function M5(e){return Qr(this,arguments,function*(){let r=yield Me(dr.from(e));try{if(!(yield Me(r.open({autoDestroy:!1}))).closed)do yield yield Me(r);while(!(yield Me(r.reset().open())).closed)}finally{yield Me(r.cancel())}})}function yH(e){return new Hi(new xw(e))}function bH(e){let t=e.peek(Tu+7&-8);return t&&t.byteLength>=4?fp(t)?new ds(new pp(e.read())):new Hi(new Pu(e)):new Hi(new Pu((function*(){})()))}function wH(e){return H(this,void 0,void 0,function*(){let t=yield e.peek(Tu+7&-8);return t&&t.byteLength>=4?fp(t)?new ds(new pp(yield e.read())):new hs(new Ru(e)):new hs(new Ru((function(){return Qr(this,arguments,function*(){})})()))})}function xH(e){return H(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),r=new pa(e,t);return t>=w5&&fp(yield r.readAt(0,Tu+7&-8))?new Iu(new ww(r)):new hs(new Ru(r))})}var E5,dr,Hi,hs,ds,Iu,mp,Pu,Ru,pp,ww,xw,Jc=p(()=>{Ar();yi();jr();st();Dt();vb();ru();ma();So();Ib();o5();fs();bh();hp();Ko();dp();yo();E5=pe(ze(),1),dr=class e extends vc{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){let r=this._impl.open(t);return zn(r)?r.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return hr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return hr.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof e?t:Xm(t)?yH(t):Zm(t)?xH(t):zn(t)?H(this,void 0,void 0,function*(){return yield e.from(yield t)}):Jm(t)||jf(t)||e0(t)||Sn(t)?wH(new Hr(t)):bH(new wi(t))}static readAll(t){return t instanceof e?t.isSync()?S5(t):M5(t):Xm(t)||ArrayBuffer.isView(t)||qn(t)||Ym(t)?S5(t):M5(t)}},Hi=class extends dr{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Qr(this,arguments,function*(){yield Me(yield*eu(Un(this[Symbol.iterator]())))})}},hs=class extends dr{constructor(t){super(t),this._impl=t}readAll(){return H(this,void 0,void 0,function*(){var t,r,n,i;let o=new Array;try{for(var s=!0,a=Un(this),c;c=yield a.next(),t=c.done,!t;s=!0){i=c.value,s=!1;let l=i;o.push(l)}}catch(l){r={error:l}}finally{try{!s&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(r)throw r.error}}return o})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},ds=class extends Hi{constructor(t){super(t),this._impl=t}},Iu=class extends hs{constructor(t){super(t),this._impl=t}},mp=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,r,n){let i;if(t.compression!=null){let s=Ga.get(t.compression.type);if(s!=null&&s.decode&&typeof s.decode=="function"){let{decommpressedBody:a,buffers:c}=this._decompressBuffers(t,r,s);i=this._loadCompressedVectors(t,a,this.schema.fields),t=new nr(t.length,t.nodes,c,null)}else throw new Error("Record batch is compressed but codec not found")}else i=this._loadVectors(t,r,this.schema.fields);let o=te({type:new et(this.schema.fields),length:t.length,children:i});return new $e(this.schema,o,n)}_loadDictionaryBatch(t,r){let{id:n,isDelta:i}=t,{dictionaries:o,schema:s}=this,a=o.get(n),c=s.dictionaries.get(n),l;if(t.data.compression!=null){let u=Ga.get(t.data.compression.type);if(u!=null&&u.decode&&typeof u.decode=="function"){let{decommpressedBody:h,buffers:d}=this._decompressBuffers(t.data,r,u);l=this._loadCompressedVectors(t.data,h,[c]),t=new Vr(new nr(t.data.length,t.data.nodes,d,null,t.data.variadicBufferCounts),n,i)}else throw new Error("Dictionary batch is compressed but codec not found")}else l=this._loadVectors(t.data,r,[c]);return(a&&i?a.concat(new $(l)):new $(l)).memoize()}_loadVectors(t,r,n){return new Mu(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}_loadCompressedVectors(t,r,n){return new ep(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}_decompressBuffers(t,r,n){let i=[],o=[],s=0;for(let{offset:a,length:c}of t.buffers){if(c===0){i.push(new Uint8Array(0)),o.push(new Ht(s,0));continue}let l=new E5.ByteBuffer(r.subarray(a,a+c)),u=Le(l.readInt64(0)),h=l.bytes().subarray(8),d=u===-1?h:n.decode(h);i.push(d);let m=(s+7&-8)-s;s+=m,o.push(new Ht(s,d.length)),s+=d.length}return{decommpressedBody:i,buffers:o}}},Pu=class extends mp{constructor(t,r){super(r),this._reader=Xm(t)?new Zc(this._handle=t):new Fa(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=A5(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):_t}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):_t}next(){if(this.closed)return _t;let t,{_reader:r}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i,t.metadata)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Xc(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},Ru=class extends mp{constructor(t,r){super(r),this._reader=new Yc(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return H(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return H(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=A5(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):_t})}return(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):_t})}next(){return H(this,void 0,void 0,function*(){if(this.closed)return _t;let t,{_reader:r}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=yield r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i,t.metadata)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=yield r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Xc(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},pp=class extends Pu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,r){super(t instanceof wh?t:new wh(t),r)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var r;if(this.closed)return null;this._footer||this.open();let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(Ge.RecordBatch);if(i!=null&&i.isRecordBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s,i.metadata)}}return null}_readDictionaryBatch(t){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(Ge.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}}_readFooter(){let{_handle:t}=this,r=t.size-pw,n=t.readInt32(r),i=t.readAt(r-n,n);return rs.decode(i)}_readNextMessageAndValidate(t){var r;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}},ww=class extends Ru{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...r){let n=typeof r[0]!="number"?r.shift():void 0,i=r[0]instanceof Map?r.shift():void 0;super(t instanceof pa?t:new pa(t,n),i)}isFile(){return!0}isAsync(){return!0}open(t){let r=Object.create(null,{open:{get:()=>super.open}});return H(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield r.open.call(this,t)})}readRecordBatch(t){return H(this,void 0,void 0,function*(){var r;if(this.closed)return null;this._footer||(yield this.open());let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(Ge.RecordBatch);if(i!=null&&i.isRecordBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s,i.metadata)}}return null})}_readDictionaryBatch(t){return H(this,void 0,void 0,function*(){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(Ge.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}})}_readFooter(){return H(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let r=t.size-pw,n=yield t.readInt32(r),i=yield t.readAt(r-n,n);return rs.decode(i)})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=this._footer.getRecordBatch(this._recordBatchIndex);if(r&&(yield this._handle.seek(r.offset)))return yield this._reader.readMessage(t)}return null})}},xw=class extends Pu{constructor(t,r){super(t,r)}_loadVectors(t,r,n){return new Q0(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}}});function ii(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new Ht(this._byteLength,t)),this._byteLength+=t,this}function _H(e){var t;let{type:r,length:n,typeIds:i,valueOffsets:o}=e;if(ii.call(this,i),r.mode===Ze.Sparse)return _w.call(this,e);if(r.mode===Ze.Dense){if(e.offset<=0)return ii.call(this,o),_w.call(this,e);{let s=new Int32Array(n),a=Object.create(null),c=Object.create(null);for(let l,u,h=-1;++h<n;)(l=i[h])!==void 0&&((u=a[l])===void 0&&(u=a[l]=o[h]),s[h]=o[h]-u,c[l]=((t=c[l])!==null&&t!==void 0?t:0)+1);ii.call(this,s),this.visitMany(e.children.map((l,u)=>{let h=r.typeIds[u],d=a[h],m=c[h];return l.slice(d,Math.min(n,m))}))}}return this}function SH(e){let t;return e.nullCount>=e.length?ii.call(this,new Uint8Array(e.length+7>>3)):(t=e.values)instanceof Uint8Array?ii.call(this,bc(e.offset,e.length,t)):ii.call(this,wc(e.values))}function ms(e){return ii.call(this,e.values.subarray(0,e.length*e.stride))}function gp(e){let{length:t,values:r,valueOffsets:n}=e,i=Le(n[0]),o=Le(n[t]),s=Math.min(o-i,r.byteLength-i);return ii.call(this,t0(-i,t+1,n)),ii.call(this,r.subarray(i,i+s)),this}function T5(e){let{offset:t,length:r,stride:n,values:i,variadicBuffers:o=[]}=e;if(!i)throw new Error("BinaryView data is missing view buffer");let s=t*n,a=s+r*n;ii.call(this,i.subarray(s,a));for(let c of o)ii.call(this,c);return this._variadicBufferCounts.push(o.length),this}function yp(e){let{length:t,valueOffsets:r}=e;if(r){let n=Le(r[0]),i=Le(r[t]);return ii.call(this,t0(-n,t+1,r)),this.visit(e.children[0].slice(n,i-n))}return this.visit(e.children[0])}function _w(e){return this.visitMany(e.type.children.map((t,r)=>e.children[r]).filter(Boolean))[0]}var St,I5=p(()=>{jr();In();Dt();fs();fr();xc();ma();st();yo();St=class e extends ie{static assemble(...t){let r=i=>i.flatMap(o=>Array.isArray(o)?r(o):o instanceof $e?o.data.children:o.data),n=new e;return n.visitMany(r(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[],this._variadicBufferCounts=[]}visit(t){if(t instanceof $)return this.visitMany(t.data),this;let{type:r}=t;if(!z.isDictionary(r)){let{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(z.isUnion(r))this.nodes.push(new bi(n,0));else{let{nullCount:i}=t;z.isNull(r)||ii.call(this,i<=0?new Uint8Array(0):bc(t.offset,n,t.nullBitmap)),this.nodes.push(new bi(n,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}get variadicBufferCounts(){return this._variadicBufferCounts}};St.prototype.visitBool=SH;St.prototype.visitInt=ms;St.prototype.visitFloat=ms;St.prototype.visitUtf8=gp;St.prototype.visitLargeUtf8=gp;St.prototype.visitUtf8View=T5;St.prototype.visitBinary=gp;St.prototype.visitLargeBinary=gp;St.prototype.visitBinaryView=T5;St.prototype.visitFixedSizeBinary=ms;St.prototype.visitDate=ms;St.prototype.visitTimestamp=ms;St.prototype.visitTime=ms;St.prototype.visitDecimal=ms;St.prototype.visitList=yp;St.prototype.visitLargeList=yp;St.prototype.visitStruct=_w;St.prototype.visitUnion=_H;St.prototype.visitInterval=ms;St.prototype.visitDuration=ms;St.prototype.visitFixedSizeList=yp;St.prototype.visitMap=yp});var bp,P5=p(()=>{In();f0();Dt();bp=class extends ie{visit(t){return t==null?void 0:super.visit(t)}visitNull({typeId:t}){return{name:me[t].toLowerCase()}}visitInt({typeId:t,bitWidth:r,isSigned:n}){return{name:me[t].toLowerCase(),bitWidth:r,isSigned:n}}visitFloat({typeId:t,precision:r}){return{name:me[t].toLowerCase(),precision:He[r]}}visitBinary({typeId:t}){return{name:me[t].toLowerCase()}}visitLargeBinary({typeId:t}){return{name:me[t].toLowerCase()}}visitBinaryView({typeId:t}){return{name:me[t].toLowerCase()}}visitBool({typeId:t}){return{name:me[t].toLowerCase()}}visitUtf8({typeId:t}){return{name:me[t].toLowerCase()}}visitLargeUtf8({typeId:t}){return{name:me[t].toLowerCase()}}visitUtf8View({typeId:t}){return{name:me[t].toLowerCase()}}visitDecimal({typeId:t,scale:r,precision:n,bitWidth:i}){return{name:me[t].toLowerCase(),scale:r,precision:n,bitWidth:i}}visitDate({typeId:t,unit:r}){return{name:me[t].toLowerCase(),unit:ot[r]}}visitTime({typeId:t,unit:r,bitWidth:n}){return{name:me[t].toLowerCase(),unit:q[r],bitWidth:n}}visitTimestamp({typeId:t,timezone:r,unit:n}){return{name:me[t].toLowerCase(),unit:q[n],timezone:r}}visitInterval({typeId:t,unit:r}){return{name:me[t].toLowerCase(),unit:ke[r]}}visitDuration({typeId:t,unit:r}){return{name:me[t].toLocaleLowerCase(),unit:q[r]}}visitList({typeId:t}){return{name:me[t].toLowerCase()}}visitLargeList({typeId:t}){return{name:me[t].toLowerCase()}}visitStruct({typeId:t}){return{name:me[t].toLowerCase()}}visitUnion({typeId:t,mode:r,typeIds:n}){return{name:me[t].toLowerCase(),mode:Ze[r].toUpperCase(),typeIds:[...n]}}visitDictionary(t){return this.visit(t.dictionary)}visitFixedSizeBinary({typeId:t,byteWidth:r}){return{name:me[t].toLowerCase(),byteWidth:r}}visitFixedSizeList({typeId:t,listSize:r}){return{name:me[t].toLowerCase(),listSize:r}}visitMap({typeId:t,keysSorted:r}){return{name:me[t].toLowerCase(),keysSorted:r}}}});function*Sw(e){for(let t of e)yield t.reduce((r,n)=>`${r}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*ps(e,t){let r=new Uint32Array(e.buffer,e.byteOffset,e.byteLength/Uint32Array.BYTES_PER_ELEMENT);for(let n=-1,i=r.length/t;++n<i;)yield`${pc.new(r.subarray((n+0)*t,(n+1)*t),!1)}`}function R5(e,t){let n=e.values,i=new DataView(n.buffer,n.byteOffset,n.byteLength),o=n.byteLength/16,s=d=>Array.from(d).map(m=>("0"+(m&255).toString(16)).slice(-2)).join("").toUpperCase(),a=Array.from({length:o},(d,m)=>{let g=m*16,y=i.getInt32(g,!0);return[g,y]}).map(([d,m])=>m>12?{SIZE:m,PREFIX_HEX:s(n.subarray(d+4,d+8)),BUFFER_INDEX:i.getInt32(d+8,!0),OFFSET:i.getInt32(d+12,!0)}:{SIZE:m,INLINED:t(n.subarray(d+4,d+4+m))}),c=[...new Set(a.map(d=>d.BUFFER_INDEX).filter(d=>d!==void 0))],l=c.map(d=>s(e.variadicBuffers[d])),u=new Map(c.map((d,m)=>[d,m]));return{VIEWS:a.map(d=>d.BUFFER_INDEX!==void 0?Object.assign(Object.assign({},d),{BUFFER_INDEX:u.get(d.BUFFER_INDEX)}):d),VARIADIC_DATA_BUFFERS:l}}var Ah,L5=p(()=>{d0();jr();In();Dt();Dt();xc();J0();st();Ah=class e extends ie{static assemble(...t){let r=new e;return t.map(({schema:n,data:i})=>r.visitMany(n.fields,i.children))}visit({name:t},r){let{length:n}=r,{offset:i,nullCount:o,nullBitmap:s}=r,a=z.isDictionary(r.type)?r.type.indices:r.type,c=Object.assign([],r.buffers,{[Ne.VALIDITY]:void 0});return Object.assign({name:t,count:n,VALIDITY:z.isNull(a)||z.isUnion(a)?void 0:o<=0?Array.from({length:n},()=>1):[...new xo(s,i,n,null,D0)]},super.visit(r.clone(a,i,n,0,c)))}visitNull(){return{}}visitBool({values:t,offset:r,length:n}){return{DATA:[...new xo(t,r,n,null,yu)]}}visitInt(t){return{DATA:t.type.bitWidth<64?[...t.values]:[...ps(t.values,2)]}}visitFloat(t){return{DATA:[...t.values]}}visitUtf8(t){return{DATA:[...new $([t])],OFFSET:[...t.valueOffsets]}}visitLargeUtf8(t){return{DATA:[...new $([t])],OFFSET:[...ps(t.valueOffsets,2)]}}visitBinary(t){return{DATA:[...Sw(new $([t]))],OFFSET:[...t.valueOffsets]}}visitLargeBinary(t){return{DATA:[...Sw(new $([t]))],OFFSET:[...ps(t.valueOffsets,2)]}}visitBinaryView(t){return R5(t,r=>Array.from(r).map(n=>("0"+(n&255).toString(16)).slice(-2)).join("").toUpperCase())}visitUtf8View(t){return R5(t,r=>Array.from(r).map(n=>String.fromCodePoint(n)).join(""))}visitFixedSizeBinary(t){return{DATA:[...Sw(new $([t]))]}}visitDate(t){return{DATA:t.type.unit===ot.DAY?[...t.values]:[...ps(t.values,2)]}}visitTimestamp(t){return{DATA:[...ps(t.values,2)]}}visitTime(t){return{DATA:t.type.unit<q.MICROSECOND?[...t.values]:[...ps(t.values,2)]}}visitDecimal(t){return{DATA:[...ps(t.values,4)]}}visitList(t){return{OFFSET:[...t.valueOffsets],children:this.visitMany(t.type.children,t.children)}}visitLargeList(t){return{OFFSET:[...ps(t.valueOffsets,2)],children:this.visitMany(t.type.children,t.children)}}visitStruct(t){return{children:this.visitMany(t.type.children,t.children)}}visitUnion(t){return{TYPE_ID:[...t.typeIds],OFFSET:t.type.mode===Ze.Dense?[...t.valueOffsets]:void 0,children:this.visitMany(t.type.children,t.children)}}visitInterval(t){switch(t.type.unit){case ke.YEAR_MONTH:return{DATA:[...t.values]};case ke.DAY_TIME:return{DATA:Cb(t.values)};case ke.MONTH_DAY_NANO:return{DATA:Db(t.values,!0)}}}visitDuration(t){return{DATA:[...ps(t.values,2)]}}visitFixedSizeList(t){return{children:this.visitMany(t.type.children,t.children)}}visitMap(t){return{OFFSET:[...t.valueOffsets],children:this.visitMany(t.type.children,t.children)}}}});function Mw(e,t){let r=t;t instanceof it&&(r=t.batches,e.reset(void 0,t.schema));for(let n of r)e.write(n);return e.finish()}function vw(e,t){return H(this,void 0,void 0,function*(){var r,n,i,o,s,a,c;try{for(r=!0,n=Un(t);i=yield n.next(),o=i.done,!o;r=!0){c=i.value,r=!1;let l=c;e.write(l)}}catch(l){s={error:l}}finally{try{!r&&!o&&(a=n.return)&&(yield a.call(n))}finally{if(s)throw s.error}}return e.finish()})}function B5({name:e,type:t,nullable:r}){let n=new bp;return{name:e,nullable:r,type:n.visit(t),children:(t.children||[]).map(i=>B5(i)),dictionary:z.isDictionary(t)?{id:t.id,isOrdered:t.isOrdered,indexType:n.visit(t.indices)}:void 0}}function MH(e,t,r=!1){let[n]=Ah.assemble(new $e({[t]:e}));return JSON.stringify({id:t,isDelta:r,data:{count:e.length,columns:n}},null,2)}function vH(e){let[t]=Ah.assemble(e);return JSON.stringify({count:e.numRows,columns:t},null,2)}var O5,Mi,gs,ys,Th,Ih=p(()=>{Ar();Kc();hp();jr();st();ma();ma();vb();Dt();Eh();So();I5();P5();L5();fr();fs();bh();Ko();nu();dp();O5=pe(ze(),1),Mi=class extends vc{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}constructor(t){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new Rn,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,en(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1,t.compressionType!=null){if(this._writeLegacyIpcFormat)throw new Error("Legacy IPC format does not support columnar compression. Use modern IPC format (writeLegacyIpcFormat=false).");if(Object.values(Tr).includes(t.compressionType))this._compression=new Mc(t.compressionType);else{let r=Object.values(Tr).filter(n=>typeof n=="string");throw new Error(`Unsupported compressionType: ${t.compressionType} Available types: ${r.join(", ")}`)}}else this._compression=null}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return zn(t)?t.then(r=>this.writeAll(r)):Sn(t)?vw(this,t):Mw(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,r=null){return t===this._sink||t instanceof Rn?this._sink=t:(this._sink=new Rn,t&&pT(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&gT(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!r||!$c(r,this._schema))&&(r==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(t){let r=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof it&&!(r=t.schema))return this.finish()&&void 0;if(t instanceof $e&&!(r=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!$c(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}t instanceof $e?t instanceof Xc||this._writeRecordBatch(t):t instanceof it?this.writeAll(t.batches):qn(t)&&this.writeAll(t)}_writeMessage(t,r=8){let n=r-1,i=Wr.encode(t),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+n&~n,c=a-o-s;return t.headerType===Ge.RecordBatch?this._recordBatchBlocks.push(new Vi(a,t.bodyLength,this._position)):t.headerType===Ge.DictionaryBatch&&this._dictionaryBlocks.push(new Vi(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-s)),o>0&&this._write(i),this._writePadding(c)}_write(t){if(this._started){let r=se(t);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(t){return this._writeMessage(Wr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Au)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=this._assembleRecordBatch(t),a=new nr(t.numRows,n,i,this._compression,s,t.metadata),c=Wr.from(a,r);return this._writeDictionaries(t)._writeMessage(c)._writeBodyBuffers(o)}_assembleRecordBatch(t){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=St.assemble(t);return this._compression!=null&&({byteLength:r,bufferRegions:i,buffers:o}=this._compressBodyBuffers(o)),{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}}_compressBodyBuffers(t){let r=Ga.get(this._compression.type);if(!(r!=null&&r.encode)||typeof r.encode!="function")throw new Error(`Codec for compression type "${Tr[this._compression.type]}" has invalid encode method`);let n=0,i=[],o=[];for(let a of t){let c=se(a);if(c.length===0){i.push(new Uint8Array(0),new Uint8Array(0)),o.push(new Ht(n,0));continue}let l=r.encode(c),u=l.length<c.length,h=u?l:c,d=u?h.length:-1,m=new O5.ByteBuffer(new Uint8Array(8));m.writeInt64(0,BigInt(d)),i.push(m.bytes(),new Uint8Array(h));let g=(n+7&-8)-n;n+=g;let y=8+h.length;o.push(new Ht(n,y)),n+=y}let s=(n+7&-8)-n;return n+=s,{byteLength:n,bufferRegions:o,buffers:i}}_writeDictionaryBatch(t,r,n=!1){let{byteLength:i,nodes:o,bufferRegions:s,buffers:a,variadicBufferCounts:c}=this._assembleRecordBatch(new $([t])),l=new nr(t.length,o,s,this._compression,c),u=new Vr(l,r,n),h=Wr.from(u,i);return this._writeMessage(h)._writeBodyBuffers(a)}_writeBodyBuffers(t){let r=this._compression!=null?2:1,n=new Array(r);for(let i=0;i<t.length;i+=r){let o=0;for(let a=-1;++a<r;)n[a]=t[i+a],o+=n[a].byteLength;if(o===0)continue;for(let a of n)this._write(a);let s=(o+7&-8)-o;s>0&&this._writePadding(s)}return this}_writeDictionaries(t){var r,n;for(let[i,o]of t.dictionaries){let s=(r=o==null?void 0:o.data)!==null&&r!==void 0?r:[],a=this._seenDictionaries.get(i),c=(n=this._dictionaryDeltaOffsets.get(i))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==s[0])for(let[l,u]of s.entries())this._writeDictionaryBatch(u,i,l>0);else if(c<s.length)for(let l of s.slice(c))this._writeDictionaryBatch(l,i,!0);this._seenDictionaries.set(i,o),this._dictionaryDeltaOffsets.set(i,s.length)}return this}},gs=class e extends Mi{static writeAll(t,r){let n=new e(r);return zn(t)?t.then(i=>n.writeAll(i)):Sn(t)?vw(n,t):Mw(n,t)}},ys=class e extends Mi{static writeAll(t,r){let n=new e(r);return zn(t)?t.then(i=>n.writeAll(i)):Sn(t)?vw(n,t):Mw(n,t)}constructor(t){super(t),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,r,n=!1){if(!n&&this._seenDictionaries.has(r))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,r,n)}_writeFooter(t){let r=rs.encode(new rs(t,nt.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}},Th=class e extends Mi{static writeAll(t){return new e().writeAll(t)}constructor(){super(),this._autoDestroy=!0,this._recordBatches=[],this._recordBatchesWithDictionaries=[]}_writeMessage(){return this}_writeFooter(t){return this}_writeSchema(t){return this._write(`{
14
- "schema": ${JSON.stringify({fields:t.fields.map(r=>B5(r))},null,2)}`)}_writeDictionaries(t){return t.dictionaries.size>0&&this._recordBatchesWithDictionaries.push(t),this}_writeDictionaryBatch(t,r,n=!1){return this._write(this._dictionaryBlocks.length===0?" ":`,
15
- `),this._write(MH(t,r,n)),this._dictionaryBlocks.push(new Vi(0,0,0)),this}_writeRecordBatch(t){return this._writeDictionaries(t),this._recordBatches.push(t),this}close(){if(this._recordBatchesWithDictionaries.length>0){this._write(`,
13
+ ]`}concat(...t){let r=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new e(r,n.map(i=>new $e(r,i)))}slice(t,r){let n=this.schema;[t,r]=ph({length:this.numRows},t,r);let i=Up(this.data,this._offsets,t,r);return new e(n,i.map(o=>new $e(n,o)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){let r=this.data.map(n=>n.children[t]);if(r.length===0){let{type:n}=this.schema.fields[t],i=te({type:n,length:0,nullCount:0});r.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new $(r)}return null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),r)}setChildAt(t,r){let n=this.schema,i=[...this.batches];if(t>-1&&t<this.numCols){r||(r=new $([te({type:new Wt,length:this.numRows})]));let o=n.fields.slice(),s=o[t].clone({type:r.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[o[t],a[t]]=[s,r],[n,i]=f0(n,a)}return new e(n,i)}select(t){let r=this.schema.fields.reduce((n,i,o)=>n.set(i.name,o),new Map);return this.selectAt(t.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(t){let r=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new e(r,n)}assign(t){let r=this.schema.fields,[n,i]=t.schema.fields.reduce((a,c,l)=>{let[u,h]=a,d=r.findIndex(m=>m.name===c.name);return~d?h[d]=l:u.push(l),a},[[],[]]),o=this.schema.assign(t.schema),s=[...r.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new e(...f0(o,s))}};D5=Symbol.toStringTag;ot[D5]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e[N5]=!0,e.isValid=xu(bh),e.get=xu(ir.getVisitFn(x.Struct)),e.set=jp(Lr.getVisitFn(x.Struct)),e.indexOf=zp(Mc.getVisitFn(x.Struct)),"Table"))(ot.prototype);Object.defineProperty(ot,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ot&&ot.isTable(t)}})});function F5(e,t,r=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;let i=[...e.fields],o=[...t],s=(r+63&-64)>>3;for(let[a,c]of e.fields.entries()){let l=t[a];(!l||l.length!==r)&&(i[a]=c.clone({nullable:!0}),o[a]=(n=l==null?void 0:l._changeLengthAndBackfillNullBitmap(r))!==null&&n!==void 0?n:te({type:c.type,length:r,nullCount:r,nullBitmap:new Uint8Array(s)}))}return[e.assign(i),te({type:new tt(i),length:r,children:o})]}function U5(e,t,r=new Map){var n,i;if(((n=e==null?void 0:e.length)!==null&&n!==void 0?n:0)>0&&(e==null?void 0:e.length)===(t==null?void 0:t.length))for(let o=-1,s=e.length;++o<s;){let{type:a}=e[o],c=t[o];for(let l of[c,...((i=c==null?void 0:c.dictionary)===null||i===void 0?void 0:i.data)||[]])U5(a.children,l==null?void 0:l.children,r);if(z.isDictionary(a)){let{id:l}=a;if(!r.has(l))c!=null&&c.dictionary&&r.set(l,c.dictionary);else if(r.get(l)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return r}var G5,k5,$e,Zc,ds=p(()=>{wi();Yc();zr();Vr();at();bu();bc();ri();Vp();Wp();k5=Symbol.for("apache-arrow/RecordBatch"),$e=class e{static isRecordBatch(t){return(t==null?void 0:t[k5])===!0}constructor(...t){switch(t.length){case 3:case 2:{if([this.schema]=t,!(this.schema instanceof ve))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=te({nullCount:0,type:new tt(this.schema.fields),children:this.schema.fields.map(r=>te({type:r.type,nullCount:0}))}),this._metadata=new Map]=t,!(this.data instanceof ce))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=F5(this.schema,this.data.children,this.data.length);break}case 1:{let[r]=t,{fields:n,children:i,length:o}=Object.keys(r).reduce((c,l,u)=>(c.children[u]=r[l],c.length=Math.max(c.length,r[l].length),c.fields[u]=ee.new({name:l,type:r[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),s=new ve(n),a=te({type:new tt(n),length:o,children:i,nullCount:0});[this.schema,this.data]=F5(s,a.children,o),this._metadata=new Map;break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get metadata(){return this._metadata}get dictionaries(){return this._dictionaries||(this._dictionaries=U5(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return ir.visit(this.data,t)}at(t){return this.get(wc(t,this.numRows))}set(t,r){return Lr.visit(this.data,t,r)}indexOf(t,r){return Mc.visit(this.data,t,r)}[Symbol.iterator](){return _u.visit(new $([this.data]))}toArray(){return[...this]}concat(...t){return new ot(this.schema,[this,...t])}slice(t,r){let[n]=new $([this.data]).slice(t,r).data;return new e(this.schema,n,this._metadata)}getChild(t){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new $([this.data.children[t]]):null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),r)}setChildAt(t,r){let n=this.schema,i=this.data;if(t>-1&&t<this.numCols){r||(r=new $([te({type:new Wt,length:this.numRows})]));let o=n.fields.slice(),s=i.children.slice(),a=o[t].clone({type:r.type});[o[t],s[t]]=[a,r.data[0]],n=new ve(o,new Map(this.schema.metadata)),i=te({type:new tt(o),length:i.length,children:s})}return new e(n,i,this._metadata)}select(t){let r=this.schema.select(t),n=new tt(r.fields),i=[];for(let o of t){let s=this.schema.fields.findIndex(a=>a.name===o);~s&&(i[s]=this.data.children[s])}return new e(r,te({type:n,length:this.numRows,children:i}),this._metadata)}selectAt(t){let r=this.schema.selectAt(t),n=t.map(o=>this.data.children[o]).filter(Boolean),i=te({type:new tt(r.fields),length:this.numRows,children:n});return new e(r,i,this._metadata)}};G5=Symbol.toStringTag;$e[G5]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e[k5]=!0,"RecordBatch"))($e.prototype);Object.defineProperty($e,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===$e&&$e.isRecordBatch(t)}});Zc=class extends $e{constructor(t,r){let n=t.fields.map(o=>te({type:o.type})),i=te({type:new tt(t.fields),length:0,nullCount:0,children:n});super(t,i,r||new Map)}}});function d0(e,t=0){for(let r=-1,n=Iu.length;++r<n;)if(Iu[r]!==e[t+r])return!1;return!0}var Ew,Tw,Aw,j5,z5,ka,Jc,Qc,h0,vw,Iu,Pu,Iw,q5,m0=p(()=>{Ar();Nt();Ew=me(ze(),1);ga();Yo();jb();dr();vo();xh();Tw=e=>`Expected ${Ge[e]} Message in stream, but was null or length 0.`,Aw=e=>`Header pointer of flatbuffer-encoded ${Ge[e]} Message is null or length 0.`,j5=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,z5=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,ka=class{constructor(t){this.source=t instanceof _i?t:new _i(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?St:t.value===-1&&(t=this.readMetadataLength()).done?St:(t=this.readMetadata(t.value)).done?St:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Tw(t));return r.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let r=se(this.source.read(t));if(r.byteLength<t)throw new Error(z5(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(t=!1){let r=Ge.Schema,n=this.readMessage(r),i=n==null?void 0:n.header();if(t&&!i)throw new Error(Aw(r));return i}readMetadataLength(){let t=this.source.read(h0),r=t&&new Ew.ByteBuffer(t),n=(r==null?void 0:r.readInt32(0))||0;return{done:n===0,value:n}}readMetadata(t){let r=this.source.read(t);if(!r)return St;if(r.byteLength<t)throw new Error(j5(t,r.byteLength));return{done:!1,value:Hr.decode(r)}}},Jc=class{constructor(t,r){this.source=t instanceof $r?t:Qm(t)?new ya(t,r):new $r(t)}[Symbol.asyncIterator](){return this}next(){return H(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?St:t.value===-1&&(t=yield this.readMetadataLength()).done?St:(t=yield this.readMetadata(t.value)).done?St:t})}throw(t){return H(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return H(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return H(this,void 0,void 0,function*(){let r;if((r=yield this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Tw(t));return r.value})}readMessageBody(t){return H(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let r=se(yield this.source.read(t));if(r.byteLength<t)throw new Error(z5(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()})}readSchema(){return H(this,arguments,void 0,function*(t=!1){let r=Ge.Schema,n=yield this.readMessage(r),i=n==null?void 0:n.header();if(t&&!i)throw new Error(Aw(r));return i})}readMetadataLength(){return H(this,void 0,void 0,function*(){let t=yield this.source.read(h0),r=t&&new Ew.ByteBuffer(t),n=(r==null?void 0:r.readInt32(0))||0;return{done:n===0,value:n}})}readMetadata(t){return H(this,void 0,void 0,function*(){let r=yield this.source.read(t);if(!r)return St;if(r.byteLength<t)throw new Error(j5(t,r.byteLength));return{done:!1,value:Hr.decode(r)}})}},Qc=class extends ka{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof wh?t:new wh(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Hr.fromJSON(t.schema,Ge.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let r=t.dictionaries[this._dictionaryIndex++];return this._body=r.data.columns,{done:!1,value:Hr.fromJSON(r,Ge.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let r=t.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:Hr.fromJSON(r,Ge.RecordBatch)}}return this._body=[],St}readMessageBody(t){return r(this._body);function r(n){return(n||[]).reduce((i,o)=>[...i,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE_ID&&[o.TYPE_ID]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...o.VIEWS&&[o.VIEWS]||[],...o.VARIADIC_DATA_BUFFERS||[],...r(o.children)],[])}}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Tw(t));return r.value}readSchema(){let t=Ge.Schema,r=this.readMessage(t),n=r==null?void 0:r.header();if(!r||!n)throw new Error(Aw(t));return n}},h0=4,vw="ARROW1",Iu=new Uint8Array(vw.length);for(let e=0;e<vw.length;e+=1)Iu[e]=vw.codePointAt(e);Pu=Iu.length,Iw=Pu+h0,q5=Pu*2+h0});var Pw,Rw,V5,W5=p(()=>{ou();Pw=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(t){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=t.encode(r);return this._isValidCompressed(n)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)&&this._hasValidVersion(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.LZ4_FRAME_MAGIC.every((r,n)=>t[n]===r)}_hasValidVersion(t){return(t[4]&192)>>6===1}},Rw=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(t){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=t.encode(r);return this._isValidCompressed(n)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.ZSTD_MAGIC.every((r,n)=>t[n]===r)}},V5={[Ir.LZ4_FRAME]:new Pw,[Ir.ZSTD]:new Rw}});var Lw,Ua,p0=p(()=>{ou();W5();Lw=class{constructor(){this.registry={}}set(t,r){if(r!=null&&r.encode&&typeof r.encode=="function"&&!V5[t].isValidCodecEncode(r))throw new Error(`Encoder for ${Ir[t]} is not valid.`);this.registry[t]=r}get(t){var r;return((r=this.registry)===null||r===void 0?void 0:r[t])||null}},Ua=new Lw});function Y5(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*H5(e){let t=pr.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function $5(e){return en(this,arguments,function*(){let r=yield Me(pr.from(e));try{if(!(yield Me(r.open({autoDestroy:!1}))).closed)do yield yield Me(r);while(!(yield Me(r.reset().open())).closed)}finally{yield Me(r.cancel())}})}function YH(e){return new Ki(new Bw(e))}function ZH(e){let t=e.peek(Pu+7&-8);return t&&t.byteLength>=4?d0(t)?new ps(new y0(e.read())):new Ki(new Lu(e)):new Ki(new Lu((function*(){})()))}function JH(e){return H(this,void 0,void 0,function*(){let t=yield e.peek(Pu+7&-8);return t&&t.byteLength>=4?d0(t)?new ps(new y0(yield e.read())):new ms(new Ou(e)):new ms(new Ou((function(){return en(this,arguments,function*(){})})()))})}function QH(e){return H(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),r=new ya(e,t);return t>=q5&&d0(yield r.readAt(0,Pu+7&-8))?new Ru(new Ow(r)):new ms(new Ou(r))})}var X5,pr,Ki,ms,ps,Ru,g0,Lu,Ou,y0,Ow,Bw,el=p(()=>{Ar();wi();zr();at();Nt();Fb();iu();ga();vo();jb();P5();ds();xh();m0();Yo();p0();wo();X5=me(ze(),1),pr=class e extends Tc{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){let r=this._impl.open(t);return Vn(r)?r.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return mr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return mr.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof e?t:Zm(t)?YH(t):Qm(t)?QH(t):Vn(t)?H(this,void 0,void 0,function*(){return yield e.from(yield t)}):ep(t)||qf(t)||rp(t)||Mn(t)?JH(new $r(t)):ZH(new _i(t))}static readAll(t){return t instanceof e?t.isSync()?H5(t):$5(t):Zm(t)||ArrayBuffer.isView(t)||Wn(t)||Jm(t)?H5(t):$5(t)}},Ki=class extends pr{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return en(this,arguments,function*(){yield Me(yield*ru(zn(this[Symbol.iterator]())))})}},ms=class extends pr{constructor(t){super(t),this._impl=t}readAll(){return H(this,void 0,void 0,function*(){var t,r,n,i;let o=new Array;try{for(var s=!0,a=zn(this),c;c=yield a.next(),t=c.done,!t;s=!0){i=c.value,s=!1;let l=i;o.push(l)}}catch(l){r={error:l}}finally{try{!s&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(r)throw r.error}}return o})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},ps=class extends Ki{constructor(t){super(t),this._impl=t}},Ru=class extends ms{constructor(t){super(t),this._impl=t}},g0=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,r,n){let i;if(t.compression!=null){let s=Ua.get(t.compression.type);if(s!=null&&s.decode&&typeof s.decode=="function"){let{decommpressedBody:a,buffers:c}=this._decompressBuffers(t,r,s);i=this._loadCompressedVectors(t,a,this.schema.fields),t=new sr(t.length,t.nodes,c,null)}else throw new Error("Record batch is compressed but codec not found")}else i=this._loadVectors(t,r,this.schema.fields);let o=te({type:new tt(this.schema.fields),length:t.length,children:i});return new $e(this.schema,o,n)}_loadDictionaryBatch(t,r){let{id:n,isDelta:i}=t,{dictionaries:o,schema:s}=this,a=o.get(n),c=s.dictionaries.get(n),l;if(t.data.compression!=null){let u=Ua.get(t.data.compression.type);if(u!=null&&u.decode&&typeof u.decode=="function"){let{decommpressedBody:h,buffers:d}=this._decompressBuffers(t.data,r,u);l=this._loadCompressedVectors(t.data,h,[c]),t=new Wr(new sr(t.data.length,t.data.nodes,d,null,t.data.variadicBufferCounts),n,i)}else throw new Error("Dictionary batch is compressed but codec not found")}else l=this._loadVectors(t.data,r,[c]);return(a&&i?a.concat(new $(l)):new $(l)).memoize()}_loadVectors(t,r,n){return new Eu(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}_loadCompressedVectors(t,r,n){return new r0(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}_decompressBuffers(t,r,n){let i=[],o=[],s=0;for(let{offset:a,length:c}of t.buffers){if(c===0){i.push(new Uint8Array(0)),o.push(new $t(s,0));continue}let l=new X5.ByteBuffer(r.subarray(a,a+c)),u=Le(l.readInt64(0)),h=l.bytes().subarray(8),d=u===-1?h:n.decode(h);i.push(d);let m=(s+7&-8)-s;s+=m,o.push(new $t(s,d.length)),s+=d.length}return{decommpressedBody:i,buffers:o}}},Lu=class extends g0{constructor(t,r){super(r),this._reader=Zm(t)?new Qc(this._handle=t):new ka(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=Y5(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):St}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):St}next(){if(this.closed)return St;let t,{_reader:r}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i,t.metadata)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Zc(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},Ou=class extends g0{constructor(t,r){super(r),this._reader=new Jc(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return H(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return H(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Y5(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):St})}return(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):St})}next(){return H(this,void 0,void 0,function*(){if(this.closed)return St;let t,{_reader:r}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=yield r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i,t.metadata)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=yield r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Zc(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},y0=class extends Lu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,r){super(t instanceof _h?t:new _h(t),r)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var r;if(this.closed)return null;this._footer||this.open();let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(Ge.RecordBatch);if(i!=null&&i.isRecordBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s,i.metadata)}}return null}_readDictionaryBatch(t){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(Ge.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}}_readFooter(){let{_handle:t}=this,r=t.size-Iw,n=t.readInt32(r),i=t.readAt(r-n,n);return is.decode(i)}_readNextMessageAndValidate(t){var r;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}},Ow=class extends Ou{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...r){let n=typeof r[0]!="number"?r.shift():void 0,i=r[0]instanceof Map?r.shift():void 0;super(t instanceof ya?t:new ya(t,n),i)}isFile(){return!0}isAsync(){return!0}open(t){let r=Object.create(null,{open:{get:()=>super.open}});return H(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield r.open.call(this,t)})}readRecordBatch(t){return H(this,void 0,void 0,function*(){var r;if(this.closed)return null;this._footer||(yield this.open());let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(Ge.RecordBatch);if(i!=null&&i.isRecordBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s,i.metadata)}}return null})}_readDictionaryBatch(t){return H(this,void 0,void 0,function*(){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(Ge.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}})}_readFooter(){return H(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let r=t.size-Iw,n=yield t.readInt32(r),i=yield t.readAt(r-n,n);return is.decode(i)})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=this._footer.getRecordBatch(this._recordBatchIndex);if(r&&(yield this._handle.seek(r.offset)))return yield this._reader.readMessage(t)}return null})}},Bw=class extends Lu{constructor(t,r){super(t,r)}_loadVectors(t,r,n){return new t0(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}}});function si(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new $t(this._byteLength,t)),this._byteLength+=t,this}function e$(e){var t;let{type:r,length:n,typeIds:i,valueOffsets:o}=e;if(si.call(this,i),r.mode===Ze.Sparse)return Cw.call(this,e);if(r.mode===Ze.Dense){if(e.offset<=0)return si.call(this,o),Cw.call(this,e);{let s=new Int32Array(n),a=Object.create(null),c=Object.create(null);for(let l,u,h=-1;++h<n;)(l=i[h])!==void 0&&((u=a[l])===void 0&&(u=a[l]=o[h]),s[h]=o[h]-u,c[l]=((t=c[l])!==null&&t!==void 0?t:0)+1);si.call(this,s),this.visitMany(e.children.map((l,u)=>{let h=r.typeIds[u],d=a[h],m=c[h];return l.slice(d,Math.min(n,m))}))}}return this}function t$(e){let t;return e.nullCount>=e.length?si.call(this,new Uint8Array(e.length+7>>3)):(t=e.values)instanceof Uint8Array?si.call(this,xc(e.offset,e.length,t)):si.call(this,_c(e.values))}function gs(e){return si.call(this,e.values.subarray(0,e.length*e.stride))}function b0(e){let{length:t,values:r,valueOffsets:n}=e,i=Le(n[0]),o=Le(n[t]),s=Math.min(o-i,r.byteLength-i);return si.call(this,np(-i,t+1,n)),si.call(this,r.subarray(i,i+s)),this}function Z5(e){let{offset:t,length:r,stride:n,values:i,variadicBuffers:o=[]}=e;if(!i)throw new Error("BinaryView data is missing view buffer");let s=t*n,a=s+r*n;si.call(this,i.subarray(s,a));for(let c of o)si.call(this,c);return this._variadicBufferCounts.push(o.length),this}function w0(e){let{length:t,valueOffsets:r}=e;if(r){let n=Le(r[0]),i=Le(r[t]);return si.call(this,np(-n,t+1,r)),this.visit(e.children[0].slice(n,i-n))}return this.visit(e.children[0])}function Cw(e){return this.visitMany(e.type.children.map((t,r)=>e.children[r]).filter(Boolean))[0]}var Mt,J5=p(()=>{zr();Pn();Nt();ds();dr();Sc();ga();at();wo();Mt=class e extends ie{static assemble(...t){let r=i=>i.flatMap(o=>Array.isArray(o)?r(o):o instanceof $e?o.data.children:o.data),n=new e;return n.visitMany(r(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[],this._variadicBufferCounts=[]}visit(t){if(t instanceof $)return this.visitMany(t.data),this;let{type:r}=t;if(!z.isDictionary(r)){let{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(z.isUnion(r))this.nodes.push(new xi(n,0));else{let{nullCount:i}=t;z.isNull(r)||si.call(this,i<=0?new Uint8Array(0):xc(t.offset,n,t.nullBitmap)),this.nodes.push(new xi(n,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}get variadicBufferCounts(){return this._variadicBufferCounts}};Mt.prototype.visitBool=t$;Mt.prototype.visitInt=gs;Mt.prototype.visitFloat=gs;Mt.prototype.visitUtf8=b0;Mt.prototype.visitLargeUtf8=b0;Mt.prototype.visitUtf8View=Z5;Mt.prototype.visitBinary=b0;Mt.prototype.visitLargeBinary=b0;Mt.prototype.visitBinaryView=Z5;Mt.prototype.visitFixedSizeBinary=gs;Mt.prototype.visitDate=gs;Mt.prototype.visitTimestamp=gs;Mt.prototype.visitTime=gs;Mt.prototype.visitDecimal=gs;Mt.prototype.visitList=w0;Mt.prototype.visitLargeList=w0;Mt.prototype.visitStruct=Cw;Mt.prototype.visitUnion=e$;Mt.prototype.visitInterval=gs;Mt.prototype.visitDuration=gs;Mt.prototype.visitFixedSizeList=w0;Mt.prototype.visitMap=w0});var x0,Q5=p(()=>{Pn();dp();Nt();x0=class extends ie{visit(t){return t==null?void 0:super.visit(t)}visitNull({typeId:t}){return{name:pe[t].toLowerCase()}}visitInt({typeId:t,bitWidth:r,isSigned:n}){return{name:pe[t].toLowerCase(),bitWidth:r,isSigned:n}}visitFloat({typeId:t,precision:r}){return{name:pe[t].toLowerCase(),precision:He[r]}}visitBinary({typeId:t}){return{name:pe[t].toLowerCase()}}visitLargeBinary({typeId:t}){return{name:pe[t].toLowerCase()}}visitBinaryView({typeId:t}){return{name:pe[t].toLowerCase()}}visitBool({typeId:t}){return{name:pe[t].toLowerCase()}}visitUtf8({typeId:t}){return{name:pe[t].toLowerCase()}}visitLargeUtf8({typeId:t}){return{name:pe[t].toLowerCase()}}visitUtf8View({typeId:t}){return{name:pe[t].toLowerCase()}}visitDecimal({typeId:t,scale:r,precision:n,bitWidth:i}){return{name:pe[t].toLowerCase(),scale:r,precision:n,bitWidth:i}}visitDate({typeId:t,unit:r}){return{name:pe[t].toLowerCase(),unit:st[r]}}visitTime({typeId:t,unit:r,bitWidth:n}){return{name:pe[t].toLowerCase(),unit:q[r],bitWidth:n}}visitTimestamp({typeId:t,timezone:r,unit:n}){return{name:pe[t].toLowerCase(),unit:q[n],timezone:r}}visitInterval({typeId:t,unit:r}){return{name:pe[t].toLowerCase(),unit:ke[r]}}visitDuration({typeId:t,unit:r}){return{name:pe[t].toLocaleLowerCase(),unit:q[r]}}visitList({typeId:t}){return{name:pe[t].toLowerCase()}}visitLargeList({typeId:t}){return{name:pe[t].toLowerCase()}}visitStruct({typeId:t}){return{name:pe[t].toLowerCase()}}visitUnion({typeId:t,mode:r,typeIds:n}){return{name:pe[t].toLowerCase(),mode:Ze[r].toUpperCase(),typeIds:[...n]}}visitDictionary(t){return this.visit(t.dictionary)}visitFixedSizeBinary({typeId:t,byteWidth:r}){return{name:pe[t].toLowerCase(),byteWidth:r}}visitFixedSizeList({typeId:t,listSize:r}){return{name:pe[t].toLowerCase(),listSize:r}}visitMap({typeId:t,keysSorted:r}){return{name:pe[t].toLowerCase(),keysSorted:r}}}});function*Dw(e){for(let t of e)yield t.reduce((r,n)=>`${r}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*ys(e,t){let r=new Uint32Array(e.buffer,e.byteOffset,e.byteLength/Uint32Array.BYTES_PER_ELEMENT);for(let n=-1,i=r.length/t;++n<i;)yield`${yc.new(r.subarray((n+0)*t,(n+1)*t),!1)}`}function eP(e,t){let n=e.values,i=new DataView(n.buffer,n.byteOffset,n.byteLength),o=n.byteLength/16,s=d=>Array.from(d).map(m=>("0"+(m&255).toString(16)).slice(-2)).join("").toUpperCase(),a=Array.from({length:o},(d,m)=>{let g=m*16,y=i.getInt32(g,!0);return[g,y]}).map(([d,m])=>m>12?{SIZE:m,PREFIX_HEX:s(n.subarray(d+4,d+8)),BUFFER_INDEX:i.getInt32(d+8,!0),OFFSET:i.getInt32(d+12,!0)}:{SIZE:m,INLINED:t(n.subarray(d+4,d+4+m))}),c=[...new Set(a.map(d=>d.BUFFER_INDEX).filter(d=>d!==void 0))],l=c.map(d=>s(e.variadicBuffers[d])),u=new Map(c.map((d,m)=>[d,m]));return{VIEWS:a.map(d=>d.BUFFER_INDEX!==void 0?Object.assign(Object.assign({},d),{BUFFER_INDEX:u.get(d.BUFFER_INDEX)}):d),VARIADIC_DATA_BUFFERS:l}}var Ih,tP=p(()=>{pp();zr();Pn();Nt();Nt();Sc();e0();at();Ih=class e extends ie{static assemble(...t){let r=new e;return t.map(({schema:n,data:i})=>r.visitMany(n.fields,i.children))}visit({name:t},r){let{length:n}=r,{offset:i,nullCount:o,nullBitmap:s}=r,a=z.isDictionary(r.type)?r.type.indices:r.type,c=Object.assign([],r.buffers,{[Ne.VALIDITY]:void 0});return Object.assign({name:t,count:n,VALIDITY:z.isNull(a)||z.isUnion(a)?void 0:o<=0?Array.from({length:n},()=>1):[...new So(s,i,n,null,Fp)]},super.visit(r.clone(a,i,n,0,c)))}visitNull(){return{}}visitBool({values:t,offset:r,length:n}){return{DATA:[...new So(t,r,n,null,wu)]}}visitInt(t){return{DATA:t.type.bitWidth<64?[...t.values]:[...ys(t.values,2)]}}visitFloat(t){return{DATA:[...t.values]}}visitUtf8(t){return{DATA:[...new $([t])],OFFSET:[...t.valueOffsets]}}visitLargeUtf8(t){return{DATA:[...new $([t])],OFFSET:[...ys(t.valueOffsets,2)]}}visitBinary(t){return{DATA:[...Dw(new $([t]))],OFFSET:[...t.valueOffsets]}}visitLargeBinary(t){return{DATA:[...Dw(new $([t]))],OFFSET:[...ys(t.valueOffsets,2)]}}visitBinaryView(t){return eP(t,r=>Array.from(r).map(n=>("0"+(n&255).toString(16)).slice(-2)).join("").toUpperCase())}visitUtf8View(t){return eP(t,r=>Array.from(r).map(n=>String.fromCodePoint(n)).join(""))}visitFixedSizeBinary(t){return{DATA:[...Dw(new $([t]))]}}visitDate(t){return{DATA:t.type.unit===st.DAY?[...t.values]:[...ys(t.values,2)]}}visitTimestamp(t){return{DATA:[...ys(t.values,2)]}}visitTime(t){return{DATA:t.type.unit<q.MICROSECOND?[...t.values]:[...ys(t.values,2)]}}visitDecimal(t){return{DATA:[...ys(t.values,4)]}}visitList(t){return{OFFSET:[...t.valueOffsets],children:this.visitMany(t.type.children,t.children)}}visitLargeList(t){return{OFFSET:[...ys(t.valueOffsets,2)],children:this.visitMany(t.type.children,t.children)}}visitStruct(t){return{children:this.visitMany(t.type.children,t.children)}}visitUnion(t){return{TYPE_ID:[...t.typeIds],OFFSET:t.type.mode===Ze.Dense?[...t.valueOffsets]:void 0,children:this.visitMany(t.type.children,t.children)}}visitInterval(t){switch(t.type.unit){case ke.YEAR_MONTH:return{DATA:[...t.values]};case ke.DAY_TIME:return{DATA:$b(t.values)};case ke.MONTH_DAY_NANO:return{DATA:Kb(t.values,!0)}}}visitDuration(t){return{DATA:[...ys(t.values,2)]}}visitFixedSizeList(t){return{children:this.visitMany(t.type.children,t.children)}}visitMap(t){return{OFFSET:[...t.valueOffsets],children:this.visitMany(t.type.children,t.children)}}}});function Nw(e,t){let r=t;t instanceof ot&&(r=t.batches,e.reset(void 0,t.schema));for(let n of r)e.write(n);return e.finish()}function Fw(e,t){return H(this,void 0,void 0,function*(){var r,n,i,o,s,a,c;try{for(r=!0,n=zn(t);i=yield n.next(),o=i.done,!o;r=!0){c=i.value,r=!1;let l=c;e.write(l)}}catch(l){s={error:l}}finally{try{!r&&!o&&(a=n.return)&&(yield a.call(n))}finally{if(s)throw s.error}}return e.finish()})}function nP({name:e,type:t,nullable:r}){let n=new x0;return{name:e,nullable:r,type:n.visit(t),children:(t.children||[]).map(i=>nP(i)),dictionary:z.isDictionary(t)?{id:t.id,isOrdered:t.isOrdered,indexType:n.visit(t.indices)}:void 0}}function r$(e,t,r=!1){let[n]=Ih.assemble(new $e({[t]:e}));return JSON.stringify({id:t,isDelta:r,data:{count:e.length,columns:n}},null,2)}function n$(e){let[t]=Ih.assemble(e);return JSON.stringify({count:e.numRows,columns:t},null,2)}var rP,Ei,bs,ws,Ph,Rh=p(()=>{Ar();Yc();m0();zr();at();ga();ga();Fb();Nt();Ah();vo();J5();Q5();tP();dr();ds();xh();Yo();ou();p0();rP=me(ze(),1),Ei=class extends Tc{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}constructor(t){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new Ln,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,tn(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1,t.compressionType!=null){if(this._writeLegacyIpcFormat)throw new Error("Legacy IPC format does not support columnar compression. Use modern IPC format (writeLegacyIpcFormat=false).");if(Object.values(Ir).includes(t.compressionType))this._compression=new Ec(t.compressionType);else{let r=Object.values(Ir).filter(n=>typeof n=="string");throw new Error(`Unsupported compressionType: ${t.compressionType} Available types: ${r.join(", ")}`)}}else this._compression=null}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Vn(t)?t.then(r=>this.writeAll(r)):Mn(t)?Fw(this,t):Nw(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,r=null){return t===this._sink||t instanceof Ln?this._sink=t:(this._sink=new Ln,t&&kA(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&UA(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!r||!Xc(r,this._schema))&&(r==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(t){let r=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof ot&&!(r=t.schema))return this.finish()&&void 0;if(t instanceof $e&&!(r=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!Xc(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}t instanceof $e?t instanceof Zc||this._writeRecordBatch(t):t instanceof ot?this.writeAll(t.batches):Wn(t)&&this.writeAll(t)}_writeMessage(t,r=8){let n=r-1,i=Hr.encode(t),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+n&~n,c=a-o-s;return t.headerType===Ge.RecordBatch?this._recordBatchBlocks.push(new Hi(a,t.bodyLength,this._position)):t.headerType===Ge.DictionaryBatch&&this._dictionaryBlocks.push(new Hi(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-s)),o>0&&this._write(i),this._writePadding(c)}_write(t){if(this._started){let r=se(t);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(t){return this._writeMessage(Hr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Iu)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=this._assembleRecordBatch(t),a=new sr(t.numRows,n,i,this._compression,s,t.metadata),c=Hr.from(a,r);return this._writeDictionaries(t)._writeMessage(c)._writeBodyBuffers(o)}_assembleRecordBatch(t){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=Mt.assemble(t);return this._compression!=null&&({byteLength:r,bufferRegions:i,buffers:o}=this._compressBodyBuffers(o)),{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}}_compressBodyBuffers(t){let r=Ua.get(this._compression.type);if(!(r!=null&&r.encode)||typeof r.encode!="function")throw new Error(`Codec for compression type "${Ir[this._compression.type]}" has invalid encode method`);let n=0,i=[],o=[];for(let a of t){let c=se(a);if(c.length===0){i.push(new Uint8Array(0),new Uint8Array(0)),o.push(new $t(n,0));continue}let l=r.encode(c),u=l.length<c.length,h=u?l:c,d=u?h.length:-1,m=new rP.ByteBuffer(new Uint8Array(8));m.writeInt64(0,BigInt(d)),i.push(m.bytes(),new Uint8Array(h));let g=(n+7&-8)-n;n+=g;let y=8+h.length;o.push(new $t(n,y)),n+=y}let s=(n+7&-8)-n;return n+=s,{byteLength:n,bufferRegions:o,buffers:i}}_writeDictionaryBatch(t,r,n=!1){let{byteLength:i,nodes:o,bufferRegions:s,buffers:a,variadicBufferCounts:c}=this._assembleRecordBatch(new $([t])),l=new sr(t.length,o,s,this._compression,c),u=new Wr(l,r,n),h=Hr.from(u,i);return this._writeMessage(h)._writeBodyBuffers(a)}_writeBodyBuffers(t){let r=this._compression!=null?2:1,n=new Array(r);for(let i=0;i<t.length;i+=r){let o=0;for(let a=-1;++a<r;)n[a]=t[i+a],o+=n[a].byteLength;if(o===0)continue;for(let a of n)this._write(a);let s=(o+7&-8)-o;s>0&&this._writePadding(s)}return this}_writeDictionaries(t){var r,n;for(let[i,o]of t.dictionaries){let s=(r=o==null?void 0:o.data)!==null&&r!==void 0?r:[],a=this._seenDictionaries.get(i),c=(n=this._dictionaryDeltaOffsets.get(i))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==s[0])for(let[l,u]of s.entries())this._writeDictionaryBatch(u,i,l>0);else if(c<s.length)for(let l of s.slice(c))this._writeDictionaryBatch(l,i,!0);this._seenDictionaries.set(i,o),this._dictionaryDeltaOffsets.set(i,s.length)}return this}},bs=class e extends Ei{static writeAll(t,r){let n=new e(r);return Vn(t)?t.then(i=>n.writeAll(i)):Mn(t)?Fw(n,t):Nw(n,t)}},ws=class e extends Ei{static writeAll(t,r){let n=new e(r);return Vn(t)?t.then(i=>n.writeAll(i)):Mn(t)?Fw(n,t):Nw(n,t)}constructor(t){super(t),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,r,n=!1){if(!n&&this._seenDictionaries.has(r))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,r,n)}_writeFooter(t){let r=is.encode(new is(t,it.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}},Ph=class e extends Ei{static writeAll(t){return new e().writeAll(t)}constructor(){super(),this._autoDestroy=!0,this._recordBatches=[],this._recordBatchesWithDictionaries=[]}_writeMessage(){return this}_writeFooter(t){return this}_writeSchema(t){return this._write(`{
14
+ "schema": ${JSON.stringify({fields:t.fields.map(r=>nP(r))},null,2)}`)}_writeDictionaries(t){return t.dictionaries.size>0&&this._recordBatchesWithDictionaries.push(t),this}_writeDictionaryBatch(t,r,n=!1){return this._write(this._dictionaryBlocks.length===0?" ":`,
15
+ `),this._write(r$(t,r,n)),this._dictionaryBlocks.push(new Hi(0,0,0)),this}_writeRecordBatch(t){return this._writeDictionaries(t),this._recordBatches.push(t),this}close(){if(this._recordBatchesWithDictionaries.length>0){this._write(`,
16
16
  "dictionaries": [
17
17
  `);for(let t of this._recordBatchesWithDictionaries)super._writeDictionaries(t);this._write(`
18
18
  ]`)}if(this._recordBatches.length>0){for(let t=-1,r=this._recordBatches.length;++t<r;)this._write(t===0?`,
19
19
  "batches": [
20
20
  `:`,
21
- `),this._write(vH(this._recordBatches[t])),this._recordBatchBlocks.push(new Vi(0,0,0));this._write(`
21
+ `),this._write(n$(this._recordBatches[t])),this._recordBatchBlocks.push(new Hi(0,0,0));this._write(`
22
22
  ]`)}return this._schema&&this._write(`
23
- }`),this._recordBatchesWithDictionaries=[],this._recordBatches=[],super.close()}}});function C5(e,t){if(Sn(e))return new Aw(e[Symbol.asyncIterator](),t);if(qn(e))return new Ew(e[Symbol.iterator](),t);throw new Error("toNodeStream() must be called with an Iterable or AsyncIterable")}var Tw,Ew,Aw,D5=p(()=>{Ar();Tw=require("node:stream");Ko();Ew=class extends Tw.Readable{constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}_read(t){let r=this._iterator;r&&!this._pulling&&(this._pulling=!0)&&(this._pulling=this._pull(t,r))}_destroy(t,r){let n=this._iterator,i;n&&(i=t!=null&&n.throw||n.return),i==null||i.call(n,t),r&&r(null)}_pull(t,r){let n=this._bytesMode,i=null;for(;this.readable&&!(i=r.next(n?t:null)).done&&(t!=null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(i.value)||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&r.return&&r.return(),!this.readable}},Aw=class extends Tw.Readable{constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}_read(t){let r=this._iterator;r&&!this._pulling&&(this._pulling=!0)&&H(this,void 0,void 0,function*(){return this._pulling=yield this._pull(t,r)})}_destroy(t,r){let n=this._iterator,i;n&&(i=t!=null&&n.throw||n.return),i!=null&&i.call(n,t).then(()=>r&&r(null))||r&&r(null)}_pull(t,r){return H(this,void 0,void 0,function*(){let n=this._bytesMode,i=null;for(;this.readable&&!(i=yield r.next(n?t:null)).done&&(t!=null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(i.value)||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&r.return&&r.return(),!this.readable})}}});function F5(e){return new Iw(ni(e),e)}var N5,Iw,EH,AH,G5=p(()=>{N5=require("node:stream");vu();Iw=class extends N5.Duplex{constructor(t,r){let{queueingStrategy:n="count",autoDestroy:i=!0}=r,{highWaterMark:o=n!=="bytes"?1e3:Math.pow(2,14)}=r;super({autoDestroy:i,highWaterMark:1,allowHalfOpen:!0,writableObjectMode:!0,readableObjectMode:!0}),this._numChunks=0,this._finished=!1,this._builder=t,this._desiredSize=o,this._getSize=n!=="bytes"?EH:AH}_read(t){this._maybeFlush(this._builder,this._desiredSize=t)}_final(t){this._maybeFlush(this._builder.finish(),this._desiredSize),t&&t()}_write(t,r,n){let i=this._maybeFlush(this._builder.append(t),this._desiredSize);return n&&n(),i}_destroy(t,r){this._builder.clear(),r&&r(t)}_maybeFlush(t,r){return this._getSize(t)>=r&&++this._numChunks&&this.push(t.toVector()),t.finished?((t.length>0||this._numChunks===0)&&++this._numChunks&&this.push(t.toVector()),!this._finished&&(this._finished=!0)&&this.push(null),!1):this._getSize(t)<this.writableHighWaterMark}},EH=e=>e.length,AH=e=>e.byteLength});function U5(e){return new Pw(e)}var k5,Pw,j5=p(()=>{Ar();k5=require("node:stream");So();Jc();Pw=class extends k5.Duplex{constructor(t){super(Object.assign(Object.assign({allowHalfOpen:!1},t),{readableObjectMode:!0,writableObjectMode:!1})),this._pulling=!1,this._autoDestroy=!0,this._reader=null,this._pulling=!1,this._asyncQueue=new Rn,this._autoDestroy=t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:!0}_final(t){let r=this._asyncQueue;r==null||r.close(),t&&t()}_write(t,r,n){let i=this._asyncQueue;return i==null||i.write(t),n&&n(),!0}_read(t){let r=this._asyncQueue;r&&!this._pulling&&(this._pulling=!0)&&H(this,void 0,void 0,function*(){this._reader||(this._reader=yield this._open(r)),this._pulling=yield this._pull(t,this._reader)})}_destroy(t,r){let n=this._asyncQueue;n&&(t?n.abort(t):n.close()),r(this._asyncQueue=this._reader=null)}_open(t){return H(this,void 0,void 0,function*(){return yield(yield dr.from(t)).open({autoDestroy:this._autoDestroy})})}_pull(t,r){return H(this,void 0,void 0,function*(){let n=null;for(;this.readable&&!(n=yield r.next()).done&&!(!this.push(n.value)||t!=null&&--t<=0););return(!this.readable||n!=null&&n.done&&(r.autoDestroy||(yield r.reset().open()).closed))&&(this.push(null),yield r.cancel()),!this.readable})}}});function q5(e){return new Rw(new this(e))}var z5,Rw,V5=p(()=>{Ar();z5=require("node:stream");So();Rw=class extends z5.Duplex{constructor(t,r){super(Object.assign(Object.assign({allowHalfOpen:!1},r),{writableObjectMode:!0,readableObjectMode:!1})),this._pulling=!1,this._writer=t,this._reader=new Hr(t)}_final(t){let r=this._writer;r==null||r.close(),t&&t()}_write(t,r,n){let i=this._writer;return i==null||i.write(t),n&&n(),!0}_read(t){let r=this._reader;r&&!this._pulling&&(this._pulling=!0)&&H(this,void 0,void 0,function*(){return this._pulling=yield this._pull(t,r)})}_destroy(t,r){let n=this._writer;n&&(t?n.abort(t):n.close()),r(this._reader=this._writer=null)}_pull(t,r){return H(this,void 0,void 0,function*(){let n=null;for(;this.readable&&!(n=yield r.next(t||null)).done&&(t!=null&&n.value&&(t-=n.value.byteLength),!(!this.push(n.value)||t<=0)););return(n!=null&&n.done||!this.readable)&&(this.push(null),yield r.cancel()),!this.readable})}}});function W5(e,t){if(Sn(e))return IH(e,t);if(qn(e))return TH(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function TH(e,t){let r=null,n=(t==null?void 0:t.type)==="bytes"||!1,i=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){o(s,r||(r=e[Symbol.iterator]()))},pull(s){r?o(s,r):s.close()},cancel(){r!=null&&r.return&&r.return(),r=null}}),Object.assign({highWaterMark:n?i:void 0},t));function o(s,a){let c,l=null,u=s.desiredSize||null;for(;!(l=a.next(n?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=se(l.value))&&(u!=null&&n&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()}}function IH(e,t){let r=null,n=(t==null?void 0:t.type)==="bytes"||!1,i=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){return H(this,void 0,void 0,function*(){yield o(s,r||(r=e[Symbol.asyncIterator]()))})},pull(s){return H(this,void 0,void 0,function*(){r?yield o(s,r):s.close()})},cancel(){return H(this,void 0,void 0,function*(){r!=null&&r.return&&(yield r.return()),r=null})}}),Object.assign({highWaterMark:n?i:void 0},t));function o(s,a){return H(this,void 0,void 0,function*(){let c,l=null,u=s.desiredSize||null;for(;!(l=yield a.next(n?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=se(l.value))&&(u!=null&&n&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()})}}var H5=p(()=>{Ar();fr();Ko()});function X5(e){return new Lw(e)}var Lw,$5,K5,Y5=p(()=>{Ar();vu();Lw=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=t,o=hT(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=ni(o),this._getSize=i!=="bytes"?$5:K5;let{["highWaterMark"]:s=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r),{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:s,size:i!=="bytes"?$5:K5}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(t){let r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-r}_maybeFlush(t,r){r!=null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(t,r){this._bufferedSize=0,this._controller=null,r==null?t.close():t.enqueue(r)}},$5=e=>{var t;return(t=e==null?void 0:e.length)!==null&&t!==void 0?t:0},K5=e=>{var t;return(t=e==null?void 0:e.byteLength)!==null&&t!==void 0?t:0}});function wp(e,t){let r=new Rn,n=null,i=new ReadableStream({cancel(){return H(this,void 0,void 0,function*(){yield r.close()})},start(a){return H(this,void 0,void 0,function*(){yield s(a,n||(n=yield o()))})},pull(a){return H(this,void 0,void 0,function*(){n?yield s(a,n):a.close()})}});return{writable:new WritableStream(r,Object.assign({highWaterMark:Math.pow(2,14)},e)),readable:i};function o(){return H(this,void 0,void 0,function*(){return yield(yield dr.from(r)).open(t)})}function s(a,c){return H(this,void 0,void 0,function*(){let l=a.desiredSize,u=null;for(;!(u=yield c.next()).done;)if(a.enqueue(u.value),l!=null&&--l<=0)return;a.close()})}}var Z5=p(()=>{Ar();So();Jc()});function xp(e,t){let r=new this(e),n=new Hr(r),i=new ReadableStream({cancel(){return H(this,void 0,void 0,function*(){yield n.cancel()})},pull(s){return H(this,void 0,void 0,function*(){yield o(s)})},start(s){return H(this,void 0,void 0,function*(){yield o(s)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(r,e),readable:i};function o(s){return H(this,void 0,void 0,function*(){let a=null,c=s.desiredSize;for(;a=yield n.read(c||null);)if(s.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;s.close()})}}var J5=p(()=>{Ar();So()});function Ph(e){let t=dr.from(e);return zn(t)?t.then(r=>Ph(r)):t.isAsync()?t.readAll().then(r=>new it(r)):new it(t.readAll())}function _p(e,t="stream",r=null){let n={compressionType:r};return(t==="stream"?gs:ys).writeAll(e,n).toUint8Array(!0)}var Q5=p(()=>{Kc();Ko();Jc();Ih()});var Ow={};ir(Ow,{isArrowData:()=>Ep,isArrowDataType:()=>vp,isArrowField:()=>Mp,isArrowRecordBatch:()=>Tp,isArrowSchema:()=>Sp,isArrowTable:()=>Ip,isArrowVector:()=>Ap});function Sp(e){return ve.isSchema(e)}function Mp(e){return ee.isField(e)}function vp(e){return z.isDataType(e)}function Ep(e){return ce.isData(e)}function Ap(e){return $.isVector(e)}function Tp(e){return $e.isRecordBatch(e)}function Ip(e){return it.isTable(e)}var Bw=p(()=>{qr();st();yi();jr();fs();Kc()});var eP,Cw=p(()=>{h0();nu();Dt();yi();st();Kc();jr();In();qr();hh();O0();yt();vu();Fb();Yb();Gb();kb();Ub();jb();qb();Hb();Qb();Jb();Vb();Wb();tw();nw();rw();tp();np();rp();$b();Kb();zb();Xb();Zb();ew();So();Jc();Ih();Q5();dp();hp();ma();fs();Bw();d0();Lb();xc();fh();fr();gu();nh();J0();Bw();Eh();eP=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},eb),Rb),gb),tb),b2),pb),Y2),Nb),Ow),{compareSchemas:$c,compareFields:l5,compareTypes:sp})});var tP=p(()=>{ru();yt();Jc();Ih();H5();Y5();Z5();J5();Cw();Cw();hr.toDOMStream=W5;at.throughDOM=X5;dr.throughDOM=wp;ds.throughDOM=wp;Hi.throughDOM=wp;Mi.throughDOM=xp;ys.throughDOM=xp;gs.throughDOM=xp});var ka={};ir(ka,{AsyncByteQueue:()=>Rn,AsyncByteStream:()=>Hr,AsyncMessageReader:()=>Yc,AsyncRecordBatchFileReader:()=>Iu,AsyncRecordBatchStreamReader:()=>hs,Binary:()=>En,BinaryBuilder:()=>os,BinaryView:()=>Ee,BinaryViewBuilder:()=>cs,Bool:()=>Gr,BoolBuilder:()=>Ec,BufferType:()=>Ne,Builder:()=>at,ByteStream:()=>wi,CompressionType:()=>Tr,Data:()=>ce,DataType:()=>z,DateBuilder:()=>Mo,DateDay:()=>Js,DateDayBuilder:()=>ga,DateMillisecond:()=>Qs,DateMillisecondBuilder:()=>ya,DateUnit:()=>ot,Date_:()=>on,Decimal:()=>An,DecimalBuilder:()=>ba,DenseUnion:()=>Qo,DenseUnionBuilder:()=>Wc,Dictionary:()=>er,DictionaryBuilder:()=>Ac,Duration:()=>sn,DurationBuilder:()=>xi,DurationMicrosecond:()=>ch,DurationMicrosecondBuilder:()=>Ea,DurationMillisecond:()=>ah,DurationMillisecondBuilder:()=>va,DurationNanosecond:()=>lh,DurationNanosecondBuilder:()=>Aa,DurationSecond:()=>sh,DurationSecondBuilder:()=>Ma,Field:()=>ee,FixedSizeBinary:()=>Tn,FixedSizeBinaryBuilder:()=>wa,FixedSizeList:()=>Wt,FixedSizeListBuilder:()=>Tc,Float:()=>Nr,Float16:()=>ki,Float16Builder:()=>Ic,Float32:()=>rn,Float32Builder:()=>Pc,Float64:()=>Zn,Float64Builder:()=>Rc,FloatBuilder:()=>vo,Int:()=>It,Int16:()=>$n,Int16Builder:()=>Oc,Int32:()=>Xt,Int32Builder:()=>Bc,Int64:()=>Kn,Int64Builder:()=>Cc,Int8:()=>Hn,Int8Builder:()=>Lc,IntBuilder:()=>cn,Interval:()=>kr,IntervalBuilder:()=>Wi,IntervalDayTime:()=>aa,IntervalDayTimeBuilder:()=>xa,IntervalMonthDayNano:()=>oh,IntervalMonthDayNanoBuilder:()=>Sa,IntervalUnit:()=>ke,IntervalYearMonth:()=>ca,IntervalYearMonthBuilder:()=>_a,JSONMessageReader:()=>Zc,LargeBinary:()=>Ui,LargeBinaryBuilder:()=>ss,LargeList:()=>Jn,LargeListBuilder:()=>Uc,LargeUtf8:()=>ji,LargeUtf8Builder:()=>Na,List:()=>Qt,ListBuilder:()=>kc,MapBuilder:()=>jc,MapRow:()=>gi,Map_:()=>Ur,Message:()=>Wr,MessageHeader:()=>Ge,MessageReader:()=>Fa,MetadataVersion:()=>nt,Null:()=>Vt,NullBuilder:()=>zc,Precision:()=>He,RecordBatch:()=>$e,RecordBatchFileReader:()=>ds,RecordBatchFileWriter:()=>ys,RecordBatchJSONWriter:()=>Th,RecordBatchReader:()=>dr,RecordBatchStreamReader:()=>Hi,RecordBatchStreamWriter:()=>gs,RecordBatchWriter:()=>Mi,Schema:()=>ve,SparseUnion:()=>la,SparseUnionBuilder:()=>Vc,Struct:()=>et,StructBuilder:()=>qc,StructRow:()=>wo,Table:()=>it,Time:()=>Ir,TimeBuilder:()=>Si,TimeMicrosecond:()=>ra,TimeMicrosecondBuilder:()=>Ba,TimeMillisecond:()=>ta,TimeMillisecondBuilder:()=>Oa,TimeNanosecond:()=>na,TimeNanosecondBuilder:()=>Ca,TimeSecond:()=>ea,TimeSecondBuilder:()=>La,TimeUnit:()=>q,Timestamp:()=>Pr,TimestampBuilder:()=>_i,TimestampMicrosecond:()=>oa,TimestampMicrosecondBuilder:()=>Pa,TimestampMillisecond:()=>bo,TimestampMillisecondBuilder:()=>Ia,TimestampNanosecond:()=>sa,TimestampNanosecondBuilder:()=>Ra,TimestampSecond:()=>ia,TimestampSecondBuilder:()=>Ta,Type:()=>x,Uint16:()=>Yn,Uint16Builder:()=>Nc,Uint32:()=>tn,Uint32Builder:()=>Fc,Uint64:()=>Gi,Uint64Builder:()=>Gc,Uint8:()=>Xn,Uint8Builder:()=>Dc,Union:()=>an,UnionBuilder:()=>as,UnionMode:()=>Ze,Utf8:()=>Fr,Utf8Builder:()=>Da,Utf8View:()=>nn,Utf8ViewBuilder:()=>Hc,Vector:()=>$,Visitor:()=>ie,builderThroughAsyncIterable:()=>cw,builderThroughIterable:()=>cp,compressionRegistry:()=>Ga,isArrowData:()=>Ep,isArrowDataType:()=>vp,isArrowField:()=>Mp,isArrowRecordBatch:()=>Tp,isArrowSchema:()=>Sp,isArrowTable:()=>Ip,isArrowVector:()=>Ap,makeBuilder:()=>ni,makeData:()=>te,makeTable:()=>lw,makeVector:()=>_o,tableFromArrays:()=>uw,tableFromIPC:()=>Ph,tableFromJSON:()=>aw,tableToIPC:()=>_p,util:()=>eP,vectorFromArray:()=>Eu});var Qc=p(()=>{ru();yt();Jc();Ih();D5();G5();j5();V5();tP();hr.toNodeStream=C5;at.throughNode=F5;dr.throughNode=U5;Mi.throughNode=q5});function Pp(e){return{fields:e.fields.map(t=>el(t)),metadata:sP(e.metadata)}}function oP(e,t){return new ve(e.fields.map(r=>Ao(r,t)),Rp(e.metadata))}function sP(e){return Object.fromEntries(e)}function Rp(e){return e?new Map(Object.entries(e)):new Map}function el(e){return{name:e.name,type:Lp(e.type),nullable:e.nullable,metadata:sP(e.metadata)}}function Ao(e,t){return new ee(e.name,Lu(e.type,t),e.nullable,Rp(e.metadata))}function Lp(e){if(rP(e,"BinaryView"))return"binary-view";if(rP(e,"Utf8View"))return"utf8-view";if(PH(e,"LargeList"))return{type:"large-list",children:[el(e.valueField)]};switch(e.constructor){case Vt:return"null";case En:return"binary";case Tn:return{type:"fixed-size-binary",byteWidth:e.byteWidth};case Gr:return"bool";case It:let t=e;return`${t.isSigned?"":"u"}int${t.bitWidth}`;case Hn:return"int8";case $n:return"int16";case Xt:return"int32";case Kn:return"int64";case Xn:return"uint8";case Yn:return"uint16";case tn:return"uint32";case Gi:return"uint64";case Nr:switch(e.precision){case He.HALF:return"float16";case He.SINGLE:return"float32";case He.DOUBLE:return"float64";default:return"float16"}case ki:return"float16";case rn:return"float32";case Zn:return"float64";case Fr:return"utf8";case An:let n=e;return{type:"decimal",bitWidth:n.bitWidth,precision:n.precision,scale:n.scale};case on:return e.unit===ot.DAY?"date-day":"date-millisecond";case Js:return"date-day";case Qs:return"date-millisecond";case Ir:switch(e.unit){case q.SECOND:return"time-second";case q.MILLISECOND:return"time-millisecond";case q.MICROSECOND:return"time-microsecond";case q.NANOSECOND:return"time-nanosecond";default:return"time-second"}case ta:return"time-millisecond";case ea:return"time-second";case ra:return"time-microsecond";case na:return"time-nanosecond";case Pr:switch(e.unit){case q.SECOND:return"timestamp-second";case q.MILLISECOND:return"timestamp-millisecond";case q.MICROSECOND:return"timestamp-microsecond";case q.NANOSECOND:return"timestamp-nanosecond";default:return"timestamp-second"}case ia:return"timestamp-second";case bo:return"timestamp-millisecond";case oa:return"timestamp-microsecond";case sa:return"timestamp-nanosecond";case kr:switch(e.unit){case ke.DAY_TIME:return"interval-daytime";case ke.YEAR_MONTH:return"interval-yearmonth";default:return"interval-daytime"}case aa:return"interval-daytime";case ca:return"interval-yearmonth";case Ur:let c=e;return{type:"map",keysSorted:c.keysSorted,children:c.children.map(y=>el(y))};case Qt:let u=e.valueField;return{type:"list",children:[el(u)]};case Wt:let h=e;return{type:"fixed-size-list",listSize:h.listSize,children:[el(h.children[0])]};case et:return{type:"struct",children:e.children.map(y=>el(y))};case la:case Qo:let m=e;return{type:m instanceof Qo?"dense-union":"sparse-union",typeIds:m.typeIds,children:m.children.map(y=>el(y)),typeIdToChildIndex:{...m.typeIdToChildIndex}};case er:let g=e;return{type:"dictionary",id:g.id,indices:RH(g.indices),dictionary:Lp(g.dictionary),isOrdered:g.isOrdered};default:throw new Error(`arrow type not supported: ${e.constructor.name}`)}}function Lu(e,t){if(typeof e=="object")switch(e.type){case"decimal":return new An(e.scale,e.precision,e.bitWidth);case"map":{let r=e.children.map(n=>Ao(n,t));return new Ur(r[0],e.keysSorted)}case"list":{let r=Ao(e.children[0],t);return new Qt(r)}case"large-list":{let r=Ao(e.children[0],t),n=Rh("LargeList");if(!n)throw new Error("LargeList requires an Apache Arrow runtime that exports the LargeList constructor");return new n(r)}case"fixed-size-list":{let r=Ao(e.children[0],t);return new Wt(e.listSize,r)}case"fixed-size-binary":return new Tn(e.byteWidth);case"struct":{let r=e.children.map(n=>Ao(n,t));return new et(r)}case"sparse-union":case"dense-union":{let r=e.children.map(n=>Ao(n,t));return e.type==="dense-union"?new Qo(e.typeIds,r):new la(e.typeIds,r)}case"dictionary":return new er(Lu(e.dictionary,t),OH(e.indices),e.id,e.isOrdered);default:throw new Error("array type not supported")}switch(e){case"null":return new Vt;case"binary":return nP("BinaryView",new En,t);case"binary-view":return iP("BinaryView");case"bool":return new Gr;case"int8":return new Hn;case"int16":return new $n;case"int32":return new Xt;case"int64":return new Kn;case"uint8":return new Xn;case"uint16":return new Yn;case"uint32":return new tn;case"uint64":return new Gi;case"float16":return new ki;case"float32":return new rn;case"float64":return new Zn;case"utf8":return nP("Utf8View",new Fr,t);case"utf8-view":return iP("Utf8View");case"date-day":return new Js;case"date-millisecond":return new Qs;case"time-second":return new ea;case"time-millisecond":return new ta;case"time-microsecond":return new ra;case"time-nanosecond":return new na;case"timestamp-second":return new ia;case"timestamp-millisecond":return new bo;case"timestamp-microsecond":return new oa;case"timestamp-nanosecond":return new sa;case"interval-daytime":return new aa;case"interval-yearmonth":return new ca;default:throw new Error("array type not supported")}}function Rh(e){return ka[e]}function rP(e,t){let r=Rh(t);if(r&&e instanceof r)return!0;let n=z,i=t==="BinaryView"?n.isBinaryView:n.isUtf8View;return!!(i!=null&&i(e))}function PH(e,t){let r=Rh(t);return!!(r&&e instanceof r)}function nP(e,t,r){let n=(r==null?void 0:r.viewTypes)||"never";if(n==="never")return t;let i=Rh(e);if(i)return new i;if(n==="require")throw new Error(`${e} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return t}function iP(e){let t=Rh(e);if(!t)throw new Error(`${e} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return new t}function RH(e){if(e instanceof It){let r=`${e.isSigned?"int":"uint"}${e.bitWidth}`;if(LH(r))return r}switch(e.constructor){case Hn:return"int8";case $n:return"int16";case Xt:return"int32";case Xn:return"uint8";case Yn:return"uint16";case tn:return"uint32";default:throw new Error(`arrow dictionary index type not supported: ${e.constructor.name}`)}}function LH(e){return["int8","int16","int32","uint8","uint16","uint32"].includes(e)}function OH(e){switch(e){case"int8":return new Hn;case"int16":return new $n;case"int32":return new Xt;case"uint8":return new Xn;case"uint16":return new Yn;case"uint32":return new tn;default:throw new Error(`schema dictionary index type not supported: ${e}`)}}var Op=p(()=>{"use strict";Qc()});function aP(e,t={}){let r={...t,copies:new WeakMap};return BH(e)?NH(e,r):CH(e)?cP(e,r):DH(e)?lP(e,r):Cp(e,r)}function BH(e){return"batches"in e}function CH(e){return"schema"in e&&"data"in e&&!Array.isArray(e.data)}function DH(e){return"data"in e&&Array.isArray(e.data)}function NH(e,t){let r=e.batches.map(n=>cP(n,t));return new it(e.schema,r)}function cP(e,t){return new $e(e.schema,Cp(e.data,t))}function Cp(e,t){let r=e.children.map(o=>Cp(o,t)),n=e.dictionary?lP(e.dictionary,t):void 0,i={[Ne.OFFSET]:Bp(e.buffers[Ne.OFFSET],t),[Ne.DATA]:Bp(e.buffers[Ne.DATA],t),[Ne.VALIDITY]:Bp(e.buffers[Ne.VALIDITY],t),[Ne.TYPE]:Bp(e.buffers[Ne.TYPE],t)};return new ce(e.type,e.offset,e.length,e._nullCount,i,r,n)}function lP(e,t){return new $(e.data.map(r=>Cp(r,t)))}function Bp(e,t){if(!FH(e)||t.copy==="none"||t.copy!=="all"&&e.byteOffset===0&&e.byteLength===e.buffer.byteLength)return e;let r=t.copies.get(e);return r||(r=e.slice(),t.copies.set(e,r)),r}function FH(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Dw=p(()=>{"use strict";Qc()});function GH(e,t){let r=aP(e,t);return{shape:"arrow-table",transport:"arrow-js",schema:Pp(r.schema),batches:r.batches.map(n=>zH(n))}}function kH(e){let t=oP(e.schema),r=e.batches.map(n=>new $e(t,Fw(n.data)));return new it(t,r)}function uP(e,t){var i;if(!UH(e))return e;let r=t,n=((i=r==null?void 0:r.core)==null?void 0:i.workerTransferBufferCopy)??(r==null?void 0:r.workerTransferBufferCopy);return{...e,data:GH(e.data,n?{copy:n}:void 0)}}function fP(e){return jH(e)?{...e,data:kH(e.data)}:e}function UH(e){let t=e;return!!(t&&t.shape==="arrow-table"&&t.data&&typeof t.data=="object"&&"batches"in t.data)}function jH(e){let t=e;return!!(t&&t.shape==="arrow-table"&&t.data&&t.data.transport==="arrow-js"&&Array.isArray(t.data.batches))}function zH(e){return{data:Nw(e.data)}}function Nw(e){return{type:Lp(e.type),offset:e.offset,length:e.length,nullCount:e._nullCount,buffers:{[Ne.OFFSET]:e.buffers[Ne.OFFSET],[Ne.DATA]:e.buffers[Ne.DATA],[Ne.VALIDITY]:e.buffers[Ne.VALIDITY],[Ne.TYPE]:e.buffers[Ne.TYPE]},children:e.children.map(t=>Nw(t)),dictionary:e.dictionary?qH(e.dictionary):void 0}}function qH(e){return{data:e.data.map(t=>Nw(t))}}function Fw(e){let t=e.children.map(n=>Fw(n)),r=e.dictionary?VH(e.dictionary):void 0;return new ce(Lu(e.type),e.offset,e.length,e.nullCount,e.buffers,t,r)}function VH(e){return new $(e.data.map(t=>Fw(t)))}var hP=p(()=>{"use strict";Qc();Op();Dw()});var dP=p(()=>{"use strict";hP();Dw()});function WH(e,t="float32"){return e instanceof Date?"date-millisecond":typeof e=="number"?t:typeof e=="boolean"?"bool":typeof e=="string"?"utf8":"null"}function mP(e){let t=Gw(e);return t!=="null"?{type:t,nullable:!1}:e.length>0?(t=WH(e[0]),{type:t,nullable:!0}):{type:"null",nullable:!0}}function Gw(e){if(typeof Float16Array<"u"&&e instanceof Float16Array)return"float16";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 BigInt64Array:return"int64";case BigUint64Array:return"uint64";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}var kw=p(()=>{"use strict"});function Uw(e){let t=e==null?void 0:e.POSITION;if(!t||!("value"in t)||!t.value.length)return null;let r=1/0,n=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0,c=t.value,l=c.length;for(let u=0;u<l;u+=3){let h=c[u],d=c[u+1],m=c[u+2];r=h<r?h:r,n=d<n?d:n,i=m<i?m:i,o=h>o?h:o,s=d>s?d:s,a=m>a?m:a}return[[r,n,i],[o,s,a]]}var pP=p(()=>{"use strict"});function gP(e){let t=ym();return new t(e)}function tl(e){return!!(Ul&&e instanceof Ul)}function yP(e,t,r){tl(e)?e[t]=r:e[t]=bP(r)}function Lh(e){return tl(e)?new Uint16Array(e.buffer,e.byteOffset,e.length):e}function jw(e,t){let r=gP(e.length);for(let n=0;n<e.length;n++)yP(r,n,e[n]/t);return r}function bP(e){if(!Number.isFinite(e))return e===1/0?31744:e===-1/0?64512:32256;let t=e<0||Object.is(e,-0)?32768:0,r=Math.abs(e);if(r===0)return t;if(r>=65520)return t|31744;if(r>=65504)return t|31743;let n=Math.floor(Math.log2(r));if(n<-14)return t|Math.round(r/2**-24);let i=n+15,o=Math.round((r/2**n-1)*1024);return o===1024?t|i+1<<10:t|i<<10|o}var wP=p(()=>{"use strict";Dn()});var Dp,zw,xP=p(()=>{"use strict";Qc();Dp=new ve([new ee("POSITION",new Wt(3,new ee("value",new rn,!1)),!1)]),zw=new ve([...Dp.fields,new ee("indices",new Qt(new ee("item",new tn,!1)),!0)])});var Oh=p(()=>{"use strict";wP();xP()});function qw(e,t,r){let n=HH(e,t,r);return new $([n])}function HH(e,t,r){let n=$H(e,t,r),i=n.children[0].type,o=r==="float16"&&tl(e)?Lh(e):e,s={[Ne.DATA]:o},a=new ce(i,0,o.length,0,s);return new ce(n,0,o.length/t,0,void 0,[a])}function $H(e,t,r){let n=r||mP(e).type,i=Lu(n);return new Wt(t,new ee("value",i,!1))}var _P=p(()=>{"use strict";Oh();Qc();kw();Op()});function Vw(e,t){switch(t){case"columnar-table":return KH(e);case"arrow-table":return XH(e);default:throw new Error(t)}}function KH(e){let t={},r=vP(e);for(let[n,i]of Object.entries(e.attributes))t[n]=i.value;return{shape:"columnar-table",schema:e.schema,data:t,topology:e.topology,indices:r?e.indices:void 0}}function XH(e,t){var r;return MP(e.attributes,{schema:e.schema,topology:e.topology,mode:e.mode,boundingBox:(r=e.header)==null?void 0:r.boundingBox,indices:vP(e)?e.indices:void 0})}function MP(e,t={}){var c,l,u;let r=[],n={},i=ZH(e);for(let h of i){let d=e[h],{value:m,size:g=1}=d,y=YH(m,g,d.componentType);if(n[h]=y,r.push(JH(t.schema,h,y,d.componentType)),h==="POSITION"&&((l=(c=t.indices)==null?void 0:c.value)!=null&&l.length)){let b=zw.fields.find(w=>w.name==="indices");n.indices=e$(t.indices.value,y.length,b.type),r.push(b)}}let o=new ve(r,t$(t)),s=((u=n[i[0]])==null?void 0:u.length)===0?new it(o):new it(o,n);return{shape:"arrow-table",schema:Pp(s.schema),data:s,topology:t.topology||"point-list",indices:t.indices}}function YH(e,t,r){if(r==="float16"){let n=tl(e)?Lh(e):e;if(t===1){let i=new ce(new ki,0,n.length,0,{[Ne.DATA]:n});return new $([i])}return qw(e,t,r)}return t===1?_o(e):qw(e,t)}function ZH(e){let t=Object.keys(e),r=SP.filter(i=>i in e),n=t.filter(i=>!SP.includes(i));return[...r,...n]}function vP(e){var t,r;return!!((r=(t=e.indices)==null?void 0:t.value)!=null&&r.length)}function JH(e,t,r,n){if(t==="POSITION"&&QH(r)){let o=Dp.fields[0],s=e==null?void 0:e.fields.find(c=>c.name===t);if(!(s!=null&&s.metadata))return o;let a=new Map(o.metadata);for(let[c,l]of Object.entries(s.metadata))a.set(c,l);return new ee(o.name,o.type,o.nullable,a)}let i=e==null?void 0:e.fields.find(o=>o.name===t);if(n==="float16"){let o=new Map(Object.entries((i==null?void 0:i.metadata)||{}));return o.set("componentType","float16"),new ee(t,r.type,!1,o)}if(i&&i.type.toString()!==r.type.toString()){let o=Ao(i);return new ee(t,r.type,o.nullable,o.metadata)}return i?Ao(i):new ee(t,r.type,!1)}function QH(e){return e.type instanceof Wt&&e.type.listSize===3&&e.type.children[0].type instanceof rn}function e$(e,t,r){let n=r,i=e instanceof Uint32Array?e:Uint32Array.from(e),o=new Int32Array(t+1);t>0&&o.fill(i.length,1);let s=new Uint8Array(Math.ceil(t/8));t>0&&(s[0]=1);let a=new ce(n.children[0].type,0,i.length,0,{[Ne.DATA]:i}),c=new ce(n,0,t,Math.max(0,t-1),{[Ne.OFFSET]:o,[Ne.VALIDITY]:s},[a]);return new $([c])}function t$(e){var r;let t={...(r=e.schema)==null?void 0:r.metadata};return e.topology&&(t.topology||=e.topology),Number.isFinite(e.mode)&&(t.mode||=String(e.mode)),e.boundingBox&&(t.boundingBox||=JSON.stringify(e.boundingBox)),Rp(t)}var SP,EP=p(()=>{"use strict";Oh();Oh();Qc();_P();Op();SP=["POSITION"]});function Ww(e,t,r){let n=t.componentType||Gw(t.value),i=r||Np(t),o=t.size===1?n:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]};return{name:e,type:o,nullable:!1,metadata:i}}function Np(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),e.componentType&&(t.componentType=e.componentType),e.transform&&(t["loaders.gl.transform"]=JSON.stringify(e.transform)),t}var AP=p(()=>{"use strict";kw()});var Fp=p(()=>{"use strict";pP();EP();AP()});var TP,IP=p(()=>{"use strict";TP="5.0.0-beta.2"});var PP,RP=p(()=>{"use strict";PP={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var LP,OP=p(()=>{"use strict";LP={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"}});async function Bh(e,t=null,r={},n=null,i=null){var o;if(Ti&&r.useLocalLibraries&&!r.CDN&&n&&((o=r.modules)==null?void 0:o[n])===void 0){let s=Qa?"./libs":`modules/${t}/dist/libs`;r={...r,modules:{[n]:`${s}/${n}`,...i?{[i]:`${s}/${i}`}:{},...r.modules}}}return await Ol(e,t,r,n,i)}var BP=p(()=>{"use strict";rc()});var r$,n$,Ch,CP,Ft,Dh,DP=p(()=>{"use strict";r$="1.5.7",n$="8786740086a9f4d83f44aa83badfbea4dce7a1b5",Ch=`https://www.gstatic.com/draco/versioned/decoders/${r$}`,CP=`https://cdn.jsdelivr.net/gh/google/draco@${n$}/javascript`,Ft={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},Dh={[Ft.DECODER]:`${Ch}/${Ft.DECODER}`,[Ft.DECODER_WASM]:`${Ch}/${Ft.DECODER_WASM}`,[Ft.GLTF_DECODER]:`${Ch}/${Ft.GLTF_DECODER}`,[Ft.GLTF_DECODER_WASM]:`${Ch}/${Ft.GLTF_DECODER_WASM}`,[Ft.FALLBACK_DECODER]:`${Ch}/${Ft.FALLBACK_DECODER}`,[Ft.ENCODER]:`${CP}/${Ft.ENCODER}`,[Ft.ENCODER_WASM]:`${CP}/${Ft.ENCODER_WASM}`}});async function Gp(e={},t,r="full"){let n=a$(e);return n?await Hw(n):await i$(e,t==="js"?"javascript":t,r)}async function i$(e={},t,r="full"){let n=l$(`${t}:${r}`,e),i=NP.get(n);return i||(i=o$(e,t,r),NP.set(n,i)),await i}async function Hw(e){let t=c$(e),r=FP.get(t);return r||(r=Pl(()=>t.createDecoderModule({}),n=>({draco:n})),FP.set(t,r)),await r}async function o$(e,t,r){try{return await kP(e,t,r)}catch(n){if(t==="javascript")throw n;try{return await kP(e,"javascript","full")}catch(i){throw new AggregateError([n,i],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function kP(e,t,r){let n=GP.then(()=>s$(e,t,r));return GP=n.then(()=>{},()=>{}),await n}async function s$(e,t,r){if(t==="javascript"){let s;try{s=await Bh(Dh[Ft.FALLBACK_DECODER],"scene",e,Ft.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(Ti||e.useLocalLibraries)throw c;s=await Bh(Dh[Ft.FALLBACK_DECODER],"scene",{...e,useLocalLibraries:!0},Ft.FALLBACK_DECODER,"draco_decoder.mjs")}let a=zP(s,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await jP(a)}let n,i;try{[n,i]=await UP(e,r)}catch(s){if(Ti||e.useLocalLibraries)throw s;[n,i]=await UP({...e,useLocalLibraries:!0},r)}let o=zP(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await jP(o,i)}async function UP(e,t){let r=t==="gltf"?Ft.GLTF_DECODER:Ft.DECODER,n=t==="gltf"?Ft.GLTF_DECODER_WASM:Ft.DECODER_WASM;return await Promise.all([Bh(Dh[r],"scene",e,r,t==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),Bh(Dh[n],"scene",e,n)])}function jP(e,t){if(typeof e!="function")throw new Error("Draco module initializer could not be loaded");return Pl(r=>e({...t?{wasmBinary:t}:{},onModuleLoaded:r}),r=>({draco:r}))}function zP(e,t){if(typeof e=="function")return e;if(e&&typeof e=="object"){let r=e,n=r[t]||r.default;return typeof n=="function"?n:void 0}}function a$(e){var r;let t=(r=e.modules)==null?void 0:r.draco3d;if(t){if(typeof t!="object"&&typeof t!="function")throw new Error("Invalid draco3d module");return t}}function c$(e){let t=e;if(typeof(t==null?void 0:t.createDecoderModule)!="function")throw new Error("Invalid draco3d decoder module");return t}function l$(e,t){let r=Object.entries(t.modules||{}).filter(([n])=>n!=="draco3d").map(([n,i])=>`${n}:${String(i)}`).sort().join("|");return[e,t.useLocalLibraries?"local":"remote",t.CDN||"",r].join("|")}var NP,FP,GP,kp=p(()=>{"use strict";zs();BP();DP();NP=new Map,FP=new WeakMap;GP=Promise.resolve()});function VP(e,t,r){let n=WP(t.metadata),i=[],o=u$(t.attributes);for(let s in e){let a=e[s],c=qP(s,a,o[s]);i.push(c)}if(r){let s=qP("indices",r);i.push(s)}return{fields:i,metadata:n}}function u$(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function qP(e,t,r){let n={...Np(t),...r?WP(r.metadata):{}};return Ww(e,t,n)}function WP(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var HP=p(()=>{"use strict";Fp()});function m$(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function p$(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function g$(e){let t=e.size(),r=new Uint32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function y$(e,t){if(!Object.prototype.hasOwnProperty.call(t,e))return e;let r=/^(.*)_([0-9]+)$/.exec(e),n=r?r[1]:e,i=r?BigInt(r[2])+1n:1n;for(;Object.prototype.hasOwnProperty.call(t,`${n}_${i}`);)i++;return`${n}_${i}`}function b$(e){var t;if(e.quantization_transform){let{quantization_bits:r,min_values:n,range:i}=e.quantization_transform;if(r!==void 0&&n&&i!==void 0)return{type:"quantization",bits:r,origin:Array.from(n),range:i}}if(((t=e.octahedron_transform)==null?void 0:t.quantization_bits)!==void 0)return{type:"octahedron",bits:e.octahedron_transform.quantization_bits}}function w$(e){if(e.includeAttributes&&e.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function x$(e,t){for(let r of e.includeAttributes||e.excludeAttributes||[])if(!t.includes(r))throw new Error(`DracoLoader: selected attribute "${r}" does not exist`)}function _$(e){var a;let t=Uw(e);if(!t)throw new Error("Decoded mesh is missing positions");let r=e.POSITION;if(((a=r==null?void 0:r.transform)==null?void 0:a.type)!=="quantization")return t;let{bits:n,origin:i,range:o}=r.transform,s=o/(2**n-1);return t.map(c=>c.map((l,u)=>i[u]+l*s))}var $P,f$,h$,d$,Nh,KP=p(()=>{"use strict";Fp();HP();$P={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},f$={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},h$=2,d$=4,Nh=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){w$(r);let n=ArrayBuffer.isView(t)?new Int8Array(t.buffer,t.byteOffset,t.byteLength):new Int8Array(t);this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),o=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud,s=null;try{switch(i){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeArrayToMesh(n,n.byteLength,o);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeArrayToPointCloud(n,n.byteLength,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!o.ptr){let d=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(d)}let a=this._getDracoLoaderData(o,i,r),c=this._getMeshData(o,a,r),l=_$(c.attributes),u=VP(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:l},...c,schema:u}}finally{s&&this.draco.destroy(s),o&&this.draco.destroy(o)}}_getDracoLoaderData(t,r,n){let i=this._getTopLevelMetadata(t),o=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:o}}_getDracoAttributes(t,r){let n={};for(let i=0;i<t.num_attributes();i++){let o=this.decoder.GetAttribute(t,i),s=this._getAttributeMetadata(t,i);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:i,metadata:s};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(o,r);c&&(n[o.unique_id()].octahedron_transform=c)}return n}_getMeshData(t,r,n){let i=this._getMeshAttributes(r,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");return t instanceof this.draco.Mesh?n.topology==="triangle-strip"?{topology:"triangle-strip",mode:5,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}}:{topology:"triangle-list",mode:4,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}:{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,r,n){let i={},o={},a=Object.values(t.attributes).sort((c,l)=>c.attribute_index-l.attribute_index).map(c=>{let l=this._deduceAttributeName(c,n),u=y$(l,o);return o[u]=!0,c.name=u,{attributeName:u,loaderAttribute:c}});x$(n,Object.keys(o));for(let{attributeName:c,loaderAttribute:l}of a){if(!this._shouldExtractAttribute(c,l,n))continue;let u=this._getAttributeValues(r,l);if(u){let{value:h,size:d}=u;i[c]={value:h,size:d,byteOffset:l.byte_offset,byteStride:l.byte_stride,normalized:l.normalized,transform:b$(l)}}}return i}_shouldExtractAttribute(t,r,n){var i,o;if(r.attribute_type===this.draco.POSITION){if((i=n.excludeAttributes)!=null&&i.includes(t))throw new Error(`DracoLoader: position attribute "${t}" cannot be excluded`);return!0}return n.includeAttributes&&!n.includeAttributes.includes(t)?!1:!((o=n.excludeAttributes)!=null&&o.includes(t))}_getTriangleListIndices(t){let n=t.num_faces()*3,i=t.num_points()<=65536,o=n*(i?h$:d$),s=this.draco._malloc(o);try{if(i){if(!this.decoder.GetTrianglesUInt16Array(t,o,s))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint16Array(this.draco.HEAPU8.buffer,s,n).slice()}if(!this.decoder.GetTrianglesUInt32Array(t,o,s))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint32Array(this.draco.HEAPU8.buffer,s,n).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),g$(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=f$[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let i=r.num_components,s=t.num_points()*i,a=s*n.BYTES_PER_ELEMENT,c=m$(this.draco,n),l,u=this.draco._malloc(a);try{let h=this.decoder.GetAttribute(t,r.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(t,h,c,a,u))throw new Error(`DRACO: Failed to decode attribute ${r.unique_id}.`);l=new n(this.draco.HEAPU8.buffer,u,s).slice()}finally{this.draco._free(u)}return{value:l,size:i}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[s,a]of Object.entries(r.extraAttributes||{}))if(a===n)return s;let i=r.attributeNameEntry||"name";if(t.metadata[i]){let s=t.metadata[i].string;return s==="COLOR"?"COLOR_0":s==="TEX_COORD"?"TEXCOORD_0":s}let o=t.attribute_type;for(let s in $P)if(this.draco[s]===o)return $P[s];return`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){let o=this.metadataQuerier.GetEntryName(t,i);r[o]=this._getDracoMetadataField(t,o)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let i=p$(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,i=[...r,...n];for(let o of i)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,i=t.attribute_type();if(n.map(s=>this.draco[s]).includes(i)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(t))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:Float32Array.from({length:t.num_components()},(a,c)=>s.min_value(c))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(t,r){let{octahedronAttributes:n=[]}=r,i=t.attribute_type();if(n.map(s=>this.draco[s]).includes(i)){let s=new this.draco.AttributeOctahedronTransform;try{if(s.InitFromAttribute(t))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}}});async function Ou(e,t,r,n){var a,c;let i=(n==null?void 0:n.reportProgress)||(t==null?void 0:t.onProgress);i==null||i({phase:"decode",completed:0,total:1,unit:"tasks"});let{draco:o}=await r();(a=(t==null?void 0:t.signal)||(n==null?void 0:n.signal))==null||a.throwIfAborted();let s=new Nh(o);try{let l=s.parseSync(e,t==null?void 0:t.draco);return i==null||i({phase:"decode",completed:1,total:1,unit:"tasks"}),((c=t==null?void 0:t.draco)==null?void 0:c.shape)==="arrow-table"?Vw(l,"arrow-table"):l}finally{s.destroy()}}var Up=p(()=>{"use strict";Fp();KP()});var bge,S$,M$,XP=p(()=>{"use strict";rc();kp();Up();Fh();({preload:bge,...S$}=vi),M$={...S$,parse:async(e,t,r)=>await Ou(e,t,async()=>{var n;return await Gp(tc(t),"wasm",(n=t==null?void 0:t.draco)==null?void 0:n.decoderProfile)},r)}});var YP={};ir(YP,{DracoWASMLoaderWithParser:()=>M$});var ZP=p(()=>{"use strict";XP()});var Ege,v$,E$,JP=p(()=>{"use strict";rc();kp();Up();Fh();({preload:Ege,...v$}=vi),E$={...v$,parse:async(e,t,r)=>await Ou(e,t,async()=>await Gp(tc(t),"js"),r)}});var QP={};ir(QP,{DracoJavaScriptLoaderWithParser:()=>E$});var eR=p(()=>{"use strict";JP()});function I$(e){var r;let t=(r=e==null?void 0:e.modules)==null?void 0:r.draco3d;if(!t)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return t}var Lge,A$,T$,tR=p(()=>{"use strict";kp();Up();Fh();({preload:Lge,...A$}=vi),T$={...A$,parse:async(e,t,r)=>await Ou(e,t,async()=>await Hw(I$(t)),r)}});var rR={};ir(rR,{Draco3DLoaderWithParser:()=>T$});var nR=p(()=>{"use strict";tR()});async function P$(e,t){var n;let r=t;switch(R$(r)){case"wasm":{let{DracoWASMLoaderWithParser:i}=await Promise.resolve().then(()=>(ZP(),YP));return i}case"javascript":{let{DracoJavaScriptLoaderWithParser:i}=await Promise.resolve().then(()=>(eR(),QP));return i}case"draco3d":{let{Draco3DLoaderWithParser:i}=await Promise.resolve().then(()=>(nR(),rR));return i}default:throw new Error(`DracoLoader: unsupported backend "${(n=r==null?void 0:r.draco)==null?void 0:n.backend}"`)}}function R$(e){var t;return(t=e==null?void 0:e.draco)!=null&&t.backend?e.draco.backend==="js"?"javascript":e.draco.backend:vi.options.draco.backend}var vi,Fh=p(()=>{"use strict";dP();IP();RP();OP();vi={dataType:null,batchType:null,...PP,version:TP,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:uP,deserializeWorkerResult:fP,options:{draco:LP},preload:P$}});var $w=p(()=>{"use strict";uT();Fh()});function Gh(e){let t=e.trim().toUpperCase(),r=t.match(/(?:\/DEF\/CRS\/|URN:OGC:DEF:CRS:)([A-Z0-9_-]+)(?:\/|::)(?:[^/:]*[/:])?([A-Z0-9_.-]+)$/);return r?`${r[1]}:${r[2]}`:t}var Bu,jp,Kw=p(()=>{"use strict";Bu="EPSG:4326",jp="EPSG:4978"});function To(e){var r,n;if(typeof e=="string"){let i=yr(e);return i==="wkt"?O$(e):i==="proj-string"?B$(e):L$(e)||"projected"}let t=e;return t.type==="BoundCRS"&&t.source_crs?To(t.source_crs):t.type==="CompoundCRS"&&((r=t.components)!=null&&r[0])?To(t.components[0]):String(t.type).includes("Projected")?"projected":String(t.type).includes("Geographic")?"geographic":String(t.type).includes("Geodetic")?((n=t.coordinate_system)==null?void 0:n.subtype)==="Cartesian"?"geocentric":"geographic":"unknown"}function L$(e){if(typeof e!="string")return;let t=Gh(e);if(t===jp)return"geocentric";if(t===Bu||t==="OGC:CRS84")return"geographic";let r=/^EPSG:(\d+)$/.exec(t);if(!r)return;let n=Number(r[1]);if(n===7789)return"geocentric";if(n===4490||n===4979)return"geographic";if(n===3857||n>=32601&&n<=32660||n>=32701&&n<=32760)return"projected"}function O$(e){let t;try{t=wf(e).root}catch{return"unknown"}switch(t.keyword.toUpperCase()){case"GEOCCS":return"geocentric";case"GEOGCS":case"GEOGCRS":case"GEOGRAPHICCRS":case"GEOGRAPHIC2DCRS":case"GEOGRAPHIC3DCRS":return"geographic";case"PROJCS":case"PROJCRS":case"PROJECTEDCRS":return"projected";case"GEODCRS":case"GEODETICCRS":{let r=t.values.find(i=>i.type==="node"&&i.keyword.toUpperCase()==="CS"),n=r==null?void 0:r.values[0];return(n==null?void 0:n.type)!=="enumeration"&&(n==null?void 0:n.type)!=="string"?"unknown":n.value.toUpperCase()==="CARTESIAN"?"geocentric":n.value.toUpperCase()==="ELLIPSOIDAL"?"geographic":"unknown"}default:return"unknown"}}function B$(e){var t;try{let r=(t=xf(e).parameters.find(n=>n.name.toLowerCase()==="proj"))==null?void 0:t.value;switch(r==null?void 0:r.toLowerCase()){case"longlat":case"latlong":return"geographic";case"geocent":return"geocentric";default:return r?"projected":"unknown"}}catch{return"unknown"}}var Xw=p(()=>{"use strict";Hg();Kw()});function zp(e,t={}){let r=t.sourceCrs!==void 0,n=t.sourceCrs||e.sourceCrs,i=t.outputCoordinates||"auto",o=t.targetCrs||(i==="ecef"?"EPSG:4978":void 0),s=t.targetHeightReference||"native",a=e.verticalUnitScale??1,c=e.elevationUnitScale??1,l=e.elevationOffset||0,u=e.elevationMode==="onTheGround"||e.elevationMode==="relativeToGround"||e.elevationMode==="relativeToScene",h=e.elevationMode==="relativeToScene"?!!t.sceneElevationProvider:!u||!!t.terrainElevationProvider,d=a!==1||c!==1||e.elevationMode!==void 0&&(u||e.elevationMode==="absoluteHeight"&&l!==0),m=s!=="native"&&s!==e.heightReference,g=!!o||s!=="native"||i!=="auto"||d,y=i!=="target-crs"||!!o,b=!m||(e.heightReference||"unknown")!=="unknown",w=Number.isFinite(a)&&a>0&&Number.isFinite(c)&&c>0,S=!!n&&g&&y&&b&&w&&h&&i!=="local-enu",M=r?"caller-override":e.provenance||"unknown",v=r&&n?To(n):e.coordinateFrame,T=r?"explicit":e.sourceCrsState||(n?M==="format-default"?"default":"explicit":"absent"),O=Yd({crs:n?{state:T==="default"?"default":"explicit",definition:n,representation:!r&&e.sourceCrsRepresentation||yr(n),provenance:M,alternatives:r?void 0:e.sourceCrsAlternatives}:{state:T==="unknown"?"unknown":"absent",provenance:M},vertical:e.verticalCrs?{state:"explicit",definition:e.verticalCrs,representation:yr(e.verticalCrs),provenance:e.provenance||"metadata"}:void 0,coordinateEpoch:t.coordinateEpoch??e.coordinateEpoch,coordinateFrame:v,coordinateOrder:D$(e.axisOrder),units:r?void 0:e.units}),P=Yw(O.crs),_=O.vertical?Yw(O.vertical):void 0,U=o?C$(o):void 0;return Object.freeze({...O,sourceCrs:P,verticalCrs:_,verticalUnitScale:a,coordinateEpoch:t.coordinateEpoch??e.coordinateEpoch,heightReference:e.heightReference||"unknown",elevationMode:e.elevationMode,elevationOffset:e.elevationOffset,elevationUnit:e.elevationUnit,elevationUnitScale:c,coordinateFrame:v||"unknown",axisOrder:e.axisOrder||"unknown",provenance:M,targetCrs:U,targetHeightReference:s,outputCoordinates:i,status:g?S?"transformable":"unresolved":"native",warnings:Object.freeze([...e.warnings||[]])})}function Yw(e){return e.state==="explicit"||e.state==="default"?e.definition:void 0}function C$(e){let t=Yd({crs:{state:"explicit",definition:e,representation:yr(e),provenance:"caller-override"}}),r=Yw(t.crs);if(!r)throw new Error("Failed to normalize a known target CRS definition");return r}function D$(e){switch(e){case"xy":return["x","y"];case"yx":return["y","x"];case"xyz":return["x","y","z"];default:return[]}}function iR(e){if(e.status!=="transformable"&&e.status!=="transformed")throw new Error("Only a transformable spatial reference can be marked as transformed");return Object.freeze({...e,status:"transformed"})}var oR=p(()=>{"use strict";Hg();Xw()});function sR(e){if(!e)return;let t=e.trim().toLowerCase().replaceAll("_","-"),r=F$[t]||t;return N$[r]}var N$,F$,aR=p(()=>{"use strict";N$=Object.freeze({meter:1,millimeter:.001,centimeter:.01,decimeter:.1,kilometer:1e3,foot:.3048,yard:.9144,mile:1609.344,"us-foot":.3048006096012192,"us-inch":.0254000508001016,"us-yard":.9144018288036576,"us-mile":1609.3472186944373,"clarke-foot":.3047972654,"clarke-yard":.9143917962,"clarke-link":.201166195164,"sears-yard":.914398414616,"sears-foot":.304799471539,"sears-chain":20.1167651216,"sears-1922-truncated-chain":20.116756,"benoit-1895-b-chain":20.1167824944,"indian-yard":.914398530744,"indian-1937-yard":.91439523,"gold-coast-foot":.304799710181}),F$=Object.freeze({m:"meter",metre:"meter",meters:"meter",metres:"meter",mm:"millimeter",millimetre:"millimeter",millimeters:"millimeter",millimetres:"millimeter",cm:"centimeter",centimetre:"centimeter",centimeters:"centimeter",centimetres:"centimeter",dm:"decimeter",decimetre:"decimeter",decimeters:"decimeter",decimetres:"decimeter",km:"kilometer",kilometre:"kilometer",kilometers:"kilometer",kilometres:"kilometer",ft:"foot",feet:"foot","us-survey-foot":"us-foot","us-survey-feet":"us-foot",yd:"yard",yards:"yard",mi:"mile",miles:"mile"})});function cR(e){return{input:new Float64Array(e),output:new Float64Array(e)}}function kh(e){return e instanceof Float32Array||e instanceof Float64Array}function lR(e){return typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function Zw(e,t,r,n,i,o){return(e.buffer===n.buffer||lR(e.buffer)&&lR(n.buffer))&&t<o&&i<r}function qp(e,t,r,n){return e<t+n?0:Math.floor((e-t-n)/r)+1}var Vp,uR=p(()=>{Vp=class{constructor(t){var o,s;this.depth=0;let r=t.dimension??2,n=t.inputOffset??0,i=t.outputOffset??0;if(!Number.isSafeInteger(r)||r<2||!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(i)||i<0||t.inputStride!==void 0&&(!Number.isSafeInteger(t.inputStride)||t.inputStride<1)||t.outputStride!==void 0&&(!Number.isSafeInteger(t.outputStride)||t.outputStride<1)||typeof((o=t.projection)==null?void 0:o.projectToSync)!="function"||typeof((s=t.projection)==null?void 0:s.unprojectToSync)!="function")throw new Error("Invalid projection buffer transform or layout");this.dimension=r,this.projection=t.projection,this.inputOffset=n,this.outputOffset=i,this.inputStride=t.inputStride,this.outputStride=t.outputStride,this.scratch=[cR(r)]}projectFlatTo(t,r,n,i=0,o){return this.flat(t,r,n,i,!1,o)}unprojectFlatTo(t,r,n,i=0,o){return this.flat(t,r,n,i,!0,o)}projectColumnsTo(t,r,n,i=0,o){return this.columns(t,r,n,i,!1,o)}unprojectColumnsTo(t,r,n,i=0,o){return this.columns(t,r,n,i,!0,o)}range(t,r,n){let i=r??Math.max(0,t-n);if(!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(i)||i<0||!Number.isSafeInteger(n+i)||n+i>t)throw new Error("Invalid projection buffer record range");return i}epochStorage(t,r,n){if(t!==void 0){if(typeof t=="number"){if(!Number.isFinite(t))throw new Error("Coordinate epoch must be finite")}else if(!kh(t)||t.length<r+n)throw new Error("Epoch buffer requires one value per addressed record")}}aliases(t,r,n,i,o,s,a){if(!i)return;let c=t.byteOffset+(this.inputOffset+n*o)*t.BYTES_PER_ELEMENT,l=c+((i-1)*o+a)*t.BYTES_PER_ELEMENT,u=r.byteOffset+(this.outputOffset+n*s)*r.BYTES_PER_ELEMENT,h=u+((i-1)*s+a)*r.BYTES_PER_ELEMENT,d=t.buffer===r.buffer&&t.constructor===r.constructor&&c===u&&o===s;if(Zw(t,c,l,r,u,h)&&!d)throw new Error("Projection input/output ranges overlap without an exact in-place mapping")}epochAlias(t,r,n,i,o,s){if(typeof t!="object"||!t||!i)return;let a=t.byteOffset+n*t.BYTES_PER_ELEMENT,c=a+i*t.BYTES_PER_ELEMENT,l=r.byteOffset+(this.outputOffset+n*o)*r.BYTES_PER_ELEMENT,u=l+((i-1)*o+s)*r.BYTES_PER_ELEMENT;if(Zw(t,a,c,r,l,u))throw new Error("Epoch and output buffers must not overlap")}acquire(){var t;let r=this.depth++;return(t=this.scratch)[r]||(t[r]=cR(this.dimension)),this.scratch[r]}transform(t,r,n){if(n!==void 0&&!Number.isFinite(n))throw new Error("Coordinate epoch must be finite");r?this.projection.unprojectToSync(t.input,t.output,n):this.projection.projectToSync(t.input,t.output,n)}floatRange(t,r){for(let n=0;n<this.dimension;n++){let i=t[n];if(n<3&&!Number.isFinite(i)||r&&Number.isFinite(i)&&Math.abs(i)>34028234663852886e22)throw new Error("Projection output is nonfinite or exceeds Float32 range")}}flat(t,r,n,i,o,s){if(!kh(t)||!kh(r))throw new Error("Projection buffers require Float32Array or Float64Array");let a=this.inputStride??this.dimension,c=this.outputStride??this.dimension;if(a<this.dimension||c<this.dimension)throw new Error("Interleaved stride must contain every ordinate");let l=this.range(qp(t.length,this.inputOffset,a,this.dimension),n,i);if(i+l>qp(r.length,this.outputOffset,c,this.dimension))throw new Error("Projection output buffer is too short");this.epochStorage(s,i,l),this.aliases(t,r,i,l,a,c,this.dimension),this.epochAlias(s,r,i,l,c,this.dimension);let u=this.acquire();try{let h=typeof s=="number"?void 0:s,d=r instanceof Float32Array;for(let m=i;m<i+l;m++){let g=this.inputOffset+m*a,y=this.outputOffset+m*c;for(let b=0;b<this.dimension;b++)u.input[b]=t[g+b];this.transform(u,o,h?h[m]:s),this.floatRange(u.output,d);for(let b=0;b<this.dimension;b++)r[y+b]=u.output[b]}return r}finally{this.depth--}}columns(t,r,n,i,o,s){if(t.length!==this.dimension||r.length!==this.dimension)throw new Error("Projection columns must match dimension");let a=this.inputStride??1,c=this.outputStride??1,l=Number.MAX_SAFE_INTEGER;for(let d=0;d<this.dimension;d++){if(!kh(t[d])||!kh(r[d]))throw new Error("Projection columns require floating typed arrays");l=Math.min(l,qp(t[d].length,this.inputOffset,a,1))}let u=this.range(l,n,i);this.epochStorage(s,i,u);for(let d=0;d<this.dimension;d++){if(i+u>qp(r[d].length,this.outputOffset,c,1))throw new Error("Projection output column is too short");this.epochAlias(s,r[d],i,u,c,1);for(let m=0;m<this.dimension;m++)this.aliases(t[d],r[m],i,u,a,c,1);for(let m=0;m<d&&u;m++){let g=r[d].byteOffset+(this.outputOffset+i*c)*r[d].BYTES_PER_ELEMENT,y=r[m].byteOffset+(this.outputOffset+i*c)*r[m].BYTES_PER_ELEMENT;if(Zw(r[d],g,g+((u-1)*c+1)*r[d].BYTES_PER_ELEMENT,r[m],y,y+((u-1)*c+1)*r[m].BYTES_PER_ELEMENT))throw new Error("Projection output columns overlap")}}let h=this.acquire();try{let d=typeof s=="number"?void 0:s;for(let m=i;m<i+u;m++){let g=this.inputOffset+m*a,y=this.outputOffset+m*c;for(let b=0;b<this.dimension;b++)h.input[b]=t[b][g];this.transform(h,o,d?d[m]:s);for(let b=0;b<this.dimension;b++){let w=h.output[b];if(b<3&&!Number.isFinite(w)||r[b]instanceof Float32Array&&Number.isFinite(w)&&Math.abs(w)>34028234663852886e22)throw new Error("Projection output is nonfinite or exceeds Float32 range")}for(let b=0;b<this.dimension;b++)r[b][y]=h.output[b]}return r}finally{this.depth--}}}});function fR(){return{bounds:[[-1,-1,0],[1,1,0]]}}var hR=p(()=>{});function Qw(){let e=globalThis;return e[Jw]||(e[Jw]=new WeakMap),e[Jw]}function dR(e){var t;return"create"in e?e:(t=Qw().get(e))==null?void 0:t.implementation}function mR(e){if("create"in e)return Promise.resolve(e);let t=Qw().get(e);if(t||(t={load:()=>e.preload()},Qw().set(e,t)),t.implementation)return Promise.resolve(t.implementation);let r=t;return r.pending||(r.pending=Promise.resolve().then(r.load).then(n=>{let i=s=>s.toLowerCase().replace(/[\s_-]/g,""),o=new Set([n.name,...n.aliases||[]].map(i));if(typeof n.create!="function"||![e.name,...e.aliases||[]].every(s=>o.has(i(s))))throw new Error("Loaded projection does not match descriptor: "+e.name);return r.implementation=n,n}).catch(n=>{throw r.pending=void 0,n})),r.pending}var Jw,pR=p(()=>{Jw=Symbol.for("@math.gl/projection/projection-implementations")});function rl(e,t,r){if(!(Array.isArray(e)||e instanceof Float32Array||e instanceof Float64Array))throw new Error("Scalar input requires a number array, Float32Array or Float64Array");if(!(Array.isArray(t)||t instanceof Float32Array||t instanceof Float64Array)||t.length<r)throw new Error("Scalar output requires a preallocated number array, Float32Array or Float64Array with sufficient capacity");if(e===t||Array.isArray(e)||Array.isArray(t))return;let n=e,i=t,o=typeof SharedArrayBuffer<"u"&&n.buffer instanceof SharedArrayBuffer&&i.buffer instanceof SharedArrayBuffer;if((n.buffer===i.buffer||o)&&n.byteOffset<i.byteOffset+r*i.BYTES_PER_ELEMENT&&i.byteOffset<n.byteOffset+n.byteLength)throw new Error("Scalar input/output views overlap; use the same view for in-place projection")}function Uh(e,t,r,n){if(t instanceof Float32Array){if(Math.abs(r.x)>Wp||Math.abs(r.y)>Wp||n>=3&&Math.abs(r.z)>Wp)throw new Error("Projected coordinate exceeds Float32 range");for(let i=3;i<e.length;i++){let o=e[i];if(Number.isFinite(o)&&Math.abs(o)>Wp)throw new Error("Trailing ordinate exceeds Float32 range")}}for(let i=3;i<e.length;i++)t[i]=e[i];return t[0]=r.x,t[1]=r.y,n>=3&&(t[2]=r.z),t}var Wp,ex=p(()=>{Wp=34028234663852886e22});function Ue(e){throw new oi("missing-transform-stage",e)}var gR,yR,oi,Ua=p(()=>{yR=Symbol.for("@math.gl/projection/TypeScriptCRSError"),oi=class e extends Error{static[(gR=yR,Symbol.hasInstance)](t){return this!==e?Function.prototype[Symbol.hasInstance].call(this,t):t instanceof Error&&t[yR]===!0}constructor(t,r){super(r),this.reason=t,this[gR]=!0,this.name="TypeScriptCRSError"}}});function jh(e,t){if(typeof e=="string"||"type"in e)return{definition:e,lossy:!1};let r=e,n="crs"in r?r:void 0,i="crs"in r?r.crs:r;if(i.state!=="explicit"&&i.state!=="default")throw new oi("unknown-syntax","Cannot transform an "+i.state+" CRS reference");let o=!1;return(n==null?void 0:n.coordinateEpoch)!==void 0&&Ue("Coordinate epochs require a time-dependent transformation"),n!=null&&n.vertical&&n.vertical.state!=="absent"&&(t.mode!=="horizontal"&&Ue("A separately declared vertical CRS requires explicit horizontal extraction"),o=!0),{definition:i.definition,spatialReference:n,lossy:o}}function bR(e,t){var o;if(!t)return e;if(t.coordinateFrame!=="unknown"&&t.coordinateFrame!==e.kind)throw new Error("SpatialReference coordinate frame disagrees with its CRS");let r=t.coordinateOrder,n=e.kind==="geocentric"?{x:"e",y:"n",z:"u"}:{longitude:"e",lon:"e",latitude:"n",lat:"n",easting:"e",northing:"n",height:"u",altitude:"u",x:"e",y:"n",z:"u"},i;if(r.length&&(i=r.slice(0,3).map(s=>n[s.toLowerCase()]||"?").join(""),i.length===2&&(i+="u"),(i.length!==3||!i.includes("e")||!i.includes("n")||!i.includes("u"))&&Ue("Unsupported SpatialReference coordinate order"),(r.length>4||r.length>3&&!["m","measure"].includes(r[3]))&&Ue("Unsupported fourth coordinate component")),(o=t.units)!=null&&o.length){let s={m:1,meter:1,metre:1,meters:1,metres:1,km:1e3,ft:.3048,"us-ft":.3048006096012192,degree:Math.PI/180,degrees:Math.PI/180,radian:1,radians:1,grad:Math.PI/200};for(let a=0;a<Math.min(t.units.length,3);a++){let c=(i||"enu")[a]==="u",l=e.kind==="geocentric"?e.toMeter:c?e.verticalUnit:e.kind==="geographic"?e.angularUnit:e.toMeter;(Math.abs((s[t.units[a]]??NaN)-l)>1e-12||s[t.units[a]]===void 0)&&Ue("SpatialReference units disagree with its CRS")}}return Object.freeze({...e,storedAxis:i})}var tx=p(()=>{Ua()});function Cu(e){var i;if(!((i=e.datumCatalogs)!=null&&i.length))return rx;let t=_R.get(e);if((t==null?void 0:t.catalogs)===e.datumCatalogs)return t.definitions;let r=Object.assign(Object.create(null),rx),n=new Map(Object.entries(rx).map(([o,s])=>[nl(o),{definition:s,owner:-1}]));return e.datumCatalogs.forEach((o,s)=>{if(!o.name||!o.datums)throw new Error("Invalid datum catalogue plugin");for(let[a,c]of Object.entries(o.datums)){let l=nl(a);if(!l||l==="none"||!c||["ellipse","towgs84","nadgrids"].some(h=>c[h]!==void 0&&typeof c[h]!="string"))throw new Error("Invalid datum definition: "+a);let u=n.get(l);if(u&&(u.owner!==s||u.definition.ellipse!==c.ellipse||u.definition.towgs84!==c.towgs84||u.definition.nadgrids!==c.nadgrids))throw new Error("Conflicting datum registration: "+a);n.set(l,{definition:c,owner:s}),r[a]=c}}),_R.set(e,{catalogs:e.datumCatalogs,definitions:r}),r}var wR,xR,rx,_R,nl,Hp=p(()=>{wR={towgs84:"0,0,0",ellipse:"WGS84"},xR={towgs84:"0,0,0",ellipse:"GRS80"},rx={wgs84:wR,WGS84:wR,nad83:xR,North_American_Datum_1983:xR},_R=new WeakMap,nl=e=>e.toLowerCase().replace(/[\s_-]/g,"")});var G$,SR,MR=p(()=>{G$={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,b:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS72:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},SR=G$});var Ln,vR,ER=p(()=>{Ln={};Ln.greenwich=0;Ln.lisbon=-9.131906111111;Ln.paris=2.337229166667;Ln.bogota=-74.080916666667;Ln.madrid=-3.687938888889;Ln.rome=12.452333333333;Ln.bern=7.439583333333;Ln.jakarta=106.807719444444;Ln.ferro=-17.666666666667;Ln.brussels=4.367975;Ln.stockholm=18.058277777778;Ln.athens=23.7163375;Ln.oslo=10.722916666667;vR=Ln});function nx(e,t){let r=Object.keys(e).find(n=>TR(n)===TR(t));return r===void 0?void 0:e[r]}function IR(e){if(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(e)){let r=Number(e);if(Number.isFinite(r))return r}if(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?r$/i.test(e)){let r=Number(e.slice(0,-1))/At;if(Number.isFinite(r))return r}let t=/^([+-]?)(\d+(?:\.\d*)?)(?:d(?:(\d+(?:\.\d*)?)'(?:(\d+(?:\.\d*)?)")?)?)?([NSEW])?$/i.exec(e);if(t&&(/d/i.test(e)||t[5])){let r=Number(t[3]||0),n=Number(t[4]||0);if(r<60&&n<60){let i=t[1]==="-"?-1:1,o=/[SW]/i.test(t[5]||"")?-1:1,s=i*o*(Number(t[2])+r/60+n/3600);if(Number.isFinite(s))return s}}throw new Error("Invalid angular parameter: "+e)}function ix(e,t={}){let r=e,n=t.aliases||{},i=new Set;for(;typeof r=="string"&&(Io(n,r)||Io(AR,r));){if(i.has(r))throw new Error("Circular CRS alias: "+r);i.add(r),r=Io(n,r)?n[r]:AR[r]}if(typeof r=="string"){let o=/^EPSG:(326|327)(\d{2})$/.exec(r);o&&Number(o[2])>=1&&Number(o[2])<=60&&(r="+proj=utm +datum=WGS84 +zone="+Number(o[2])+(o[1]==="327"?" +south":"")),(r==="EPSG:5041"||r==="EPSG:5042")&&(r="+proj=stere +datum=WGS84 +lat_0="+(r==="EPSG:5041"?90:-90)+" +k_0=0.994 +x_0=2000000 +y_0=2000000")}return r}function bs(e,t={}){var U;let r=Cu(t),n=jh(e,t),i=ix(n.definition,t),o;if(yr(i)==="proj-string"&&typeof i=="string"){let C=Object.create(null);for(let L of xf(i).parameters){if(Io(C,L.name))throw new Error("Duplicate PROJ parameter: +"+L.name);C[L.name]=L.value}o={parameters:C}}else{let C=(U=t.parsers)==null?void 0:U.find(L=>L.canParse(i));if(!C){let L=["wkt","projjson"].includes(yr(i));throw new oi(L?"missing-parser":"unknown-syntax",yr(i)==="identifier"?"Unsupported CRS definition: "+i+"; resolve it first":"Unsupported CRS definition; register a WKT or PROJJSON parser for structured definitions")}o=C.parse(i,t)}let s={...o.parameters};for(let C of["lon_0","lat_0","lat_1","lat_2","lat_ts","lon_wrap","lon_1","lon_2","lonc","alpha","gamma","tilt","azi","o_alpha","o_lon_c","o_lat_c","o_lon_p","o_lat_p","o_lon_1","o_lat_1","o_lon_2","o_lat_2"])s[C]!==void 0&&(s[C]=String(IR(s[C])));let a=s.proj,c=a==null?void 0:a.toLowerCase(),l=c==="geocentric"?"geocent":["longlat","latlong","latlon","lonlat","identity","geocent"].includes(c)?c:a;if(!l)throw new Error("CRS requires +proj");let u=["longlat","latlong","latlon","lonlat"].includes(l)?"geographic":l==="geocent"?"geocentric":l==="identity"?"identity":"projected",h=s.datum,d=h&&h!=="none"?nx(r,h):void 0;h&&h!=="none"&&!d&&Ue("Unknown datum: "+h+"; register a datumCatalogs plugin");let m=RR(s,d==null?void 0:d.ellipse),g=s.nadgrids??(d==null?void 0:d.nadgrids),y=g===void 0?void 0:g.split(",").map(C=>{let L=C.startsWith("@"),A=L?C.slice(1):C;if(!A||/\s/.test(A))throw new Error("Invalid datum grid name");return Object.freeze({name:A,optional:L})}),b=s.towgs84??(d==null?void 0:d.towgs84),w;if(b!==void 0&&(w=b.split(",").map(C=>re({value:C},"value",NaN)),![3,7].includes(w.length)||w.some(C=>!Number.isFinite(C))||w.length===7&&w[6]<=-1e6))throw new Error("+towgs84 requires three or seven finite values and positive scale");h==="none"&&(w=void 0),y&&h!=="none"&&(w=[0,0,0]);let S=g==="@null"||g==="null"?RR({ellps:"WGS84"}):m,M=s.axis||"enu";if(M.length!==3||!/[ew]/.test(M)||!/[ns]/.test(M)||!/[ud]/.test(M))throw new Error("Invalid axis: "+M);let v=o.angularUnit??At;if(u==="geographic"&&(s.units&&s.units!=="degrees"||Io(s,"to_meter")))throw new Error("Geographic coordinates must use angular units");if(u!=="geographic"&&s.units==="degrees")throw new Error("Linear coordinates require linear units");let T=PR(s,"units","to_meter"),O=o.verticalUnit??PR(s,"vunits","vto_meter");if(!(O>0)||!Number.isFinite(O))throw new Error("Invalid vertical unit");if(!(v>0)||!Number.isFinite(v))throw new Error("Invalid angular unit");let P=s.pm,_=P===void 0?0:(nx(vR,P)??IR(P))*At;return bR(Object.freeze({kind:u,projection:l,parameters:Object.freeze(s),ellipsoid:m,datum:Object.freeze({ellipsoid:S,towgs84:w&&Object.freeze(w),grids:h==="none"||g==="@null"||g==="null"?void 0:y&&Object.freeze(y)}),areaOfUse:o.areaOfUse,angularUnit:v,toMeter:T,verticalUnit:O,primeMeridian:_,axis:M,longitudeWrap:s.lon_wrap===void 0?void 0:Number(s.lon_wrap)*At,lossy:!!(o.lossy||n.lossy)}),n.spatialReference)}function PR(e,t,r){let n=e[t],i=_f;if(t==="vunits"&&n==="degrees")throw new Error("Height requires linear units");if(n&&!["m","degrees"].includes(n)&&!Io(i,n))throw new Error("Unsupported units: "+n);let o=re(e,r,n&&i[n]?i[n].metersPerUnit:1);if(!(o>0))throw new Error("+"+r+" must be positive");return o}function RR(e,t){let r=t||e.ellps||"WGS84",n=nx(SR,r);if(!n)throw new Error("Unsupported ellipsoid: "+r);let i=re(e,"a",n.a),o=re(e,"f",NaN),s=re(e,"rf",Number.isNaN(o)?n.rf||0:o===0?0:1/o),a=re(e,"b",s?i*(1-1/s):Io(e,"f")||Io(e,"rf")||Io(e,"a")?i:n.b||i),c=re(e,"R",0);if(i<=0||a<=0||a>i||s<0||s>0&&s<=1||Io(e,"R")&&c<=0||!Number.isNaN(o)&&(o<0||o>=1))throw new Error("Invalid ellipsoid dimensions");return Object.freeze({semiMajorAxis:c||i,semiMinorAxis:c||a,eccentricitySquared:c?0:1-(a/i)**2})}var AR,$p,LR,Io,TR,Du=p(()=>{Bl();Vg();tx();qt();Hp();MR();ER();Wg();Ua();AR={WGS84:"+proj=longlat +datum=WGS84","EPSG:4326":"+proj=longlat +datum=WGS84","EPSG:4269":"+proj=longlat +datum=NAD83","EPSG:4978":"+proj=geocent +datum=WGS84","EPSG:4979":"+proj=longlat +datum=WGS84","EPSG:3857":"+proj=merc +a=6378137 +b=6378137 +nadgrids=@null +units=m","EPSG:3785":"EPSG:3857",GOOGLE:"EPSG:3857","EPSG:900913":"EPSG:3857","EPSG:102113":"EPSG:3857"},$p=["proj","datum","ellps","a","b","rf","f","R","units","to_meter","vunits","vto_meter","no_defs","type","title","towgs84","nadgrids","geoidgrids","axis","pm","over","lon_wrap"],LR=["no_defs","over"],Io=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),TR=e=>e.toLowerCase().replace(/[\s_-]/g,"")});function Yp(e,t){if(Math.abs(e.y)>Math.PI/2)throw new Error("Latitude outside geocentric domain");if(!vf(e,t))throw new Error("Geocentric coordinate must be finite")}function Zp(e,t){let r=e.x,n=e.y,i=e.z,{semiMajorAxis:o,semiMinorAxis:s,eccentricitySquared:a}=t;if(r===0&&n===0&&i===0)throw new Error("Geodetic coordinates are undefined at the Earth center");if(a!==0&&Math.abs(r)<1e-12*o&&Math.abs(n)<1e-12*o&&Math.hypot(r,n)<1e-12*o){if(!Number.isFinite(Math.hypot(r,n,i)))throw new Error("Geocentric radius must be finite");e.x=0,e.y=Math.sign(i)*Math.PI/2,e.z=Math.abs(i)-s;return}if(!Ef(e,t))throw Number.isFinite(Math.hypot(r,n,i))?new Error("Geocentric inverse did not converge"):new Error("Geocentric radius must be finite")}function OR(e,t){let r=e[0],n=e[1],i=e[2],o=(e[3]||0)*ox,s=(e[4]||0)*ox,a=(e[5]||0)*ox,c=1+(e[6]||0)/1e6;return t?l=>{let u=(l.x-r)/c,h=(l.y-n)/c,d=(l.z-i)/c;l.x=u+a*h-s*d,l.y=-a*u+h+o*d,l.z=s*u-o*h+d}:l=>{let u=l.x,h=l.y,d=l.z;l.x=c*(u-a*h+s*d)+r,l.y=c*(a*u+h-o*d)+n,l.z=c*(-s*u+o*h+d)+i}}function Xp(e){var t;return!!((t=e.towgs84)!=null&&t.some(r=>r!==0))}function ax(e,t){if(!(!e.towgs84||!t.towgs84)){if(e.grids||t.grids){if(e.grids&&t.grids&&e.ellipsoid.semiMajorAxis===t.ellipsoid.semiMajorAxis&&e.ellipsoid.eccentricitySquared===t.ellipsoid.eccentricitySquared&&e.grids.length===t.grids.length&&e.grids.every((n,i)=>n.name===t.grids[i].name&&n.optional===t.grids[i].optional&&n.grid===t.grids[i].grid))return;let r=ax(e.grids?Kp:e,t.grids?Kp:t);return n=>{e.grids&&BR(n,e,!1),r==null||r(n),t.grids&&BR(n,t,!0)}}if(Xp(e)||Xp(t)){let r=sx(e,Kp),n=sx(Kp,t);return i=>{r==null||r(i),n==null||n(i)}}return sx(e,t)}}function sx(e,t){if(!e.towgs84||!t.towgs84)return;let r=e.ellipsoid,n=t.ellipsoid,i=!0;for(let a=0;a<7;a++)(e.towgs84[a]||0)!==(t.towgs84[a]||0)&&(i=!1);if(r.semiMajorAxis===n.semiMajorAxis&&Math.abs(r.eccentricitySquared-n.eccentricitySquared)<=5e-11&&i)return;let o=Xp(e)?OR(e.towgs84,!1):void 0,s=Xp(t)?OR(t.towgs84,!0):void 0;return a=>{Yp(a,r),o==null||o(a),s==null||s(a),Zp(a,n)}}function BR(e,t,r){for(let n of t.grids){if(n.name==="null")return;if(!n.grid){if(n.optional)continue;throw new Error("Required datum grid is not registered: "+n.name)}let i=!1;if(n.grid.shiftInPlace)i=n.grid.shiftInPlace(e,r);else{let o=n.grid.shift(e.x,e.y,r);o&&(e.x=o[0],e.y=o[1],i=!0)}if(i){if(!Number.isFinite(e.x)||!Number.isFinite(e.y)||Math.abs(e.y)>Math.PI/2)throw new Error("Datum grid produced a coordinate outside the geographic domain");return}}throw new Error("No datum grid covers coordinate: "+t.grids.map(n=>n.name).join(","))}function CR(e,t){let r={x:e[0],y:e[1],z:e[2]};return Yp(r,t),[r.x,r.y,r.z]}function DR(e,t){let r={x:e[0],y:e[1],z:e[2]};return Zp(r,t),[r.x,r.y,r.z]}var ox,Kp,cx=p(()=>{Dn();ox=Math.PI/(180*3600),Kp={ellipsoid:{semiMajorAxis:6378137,semiMinorAxis:6356752314245179e-9,eccentricitySquared:.0066943799901413165},towgs84:[0,0,0]}});function ja(e,t=0){let r=re(e,"lon_wrap",0)*At;return n=>cr(i=>{let o=Or(i,r);return[[r+o[0],i[0][1],0],[r+o[1],i[1][1],0]]},n??[-180,-90,180,90],r,t)}var zh=p(()=>{qt();lt();Ot()});function NR(e,t={}){if(e===void 0)return;let r=[];for(let n of e.split(",")){let i=n.startsWith("@"),o=i?n.slice(1):n;if(!o||/\s/.test(o))throw new Error("Invalid vertical grid name");if(o==="null"){r.push(null);break}let s=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(s){if(typeof s.getOffset!="function")throw new Error("Invalid vertical grid: "+o);r.push(s.getOffset.bind(s))}else i||Ue("Required vertical grid is not registered: "+o)}return(n,i)=>{for(let o of r){if(!o)return 0;let s=o(n,i);if(s!==void 0){if(!Number.isFinite(s))throw new Error("Vertical grid returned a non-finite offset");return s}}throw new Error("No vertical grid covers this coordinate")}}var FR=p(()=>{Ua()});function GR(e){let t=zR(e.projections||[]),r=new Set;for(let n of[e.from??"WGS84",e.to??"WGS84"]){let i=bs(n,e);if(["geographic","identity"].includes(i.kind))continue;let o=t.get(Qp(i.projection));if(!o)throw new oi("missing-plugin","Projection plugin is not registered: "+i.projection);r.add(o)}return[...r]}function zR(e){let t=new Map;for(let r of e)for(let n of new Set([r.name,...r.aliases||[]].map(Qp))){if(!n||["longlat","latlong","latlon","lonlat","identity"].includes(n)||t.has(n))throw new Error("Duplicate or reserved projection plugin: "+n);t.set(n,r)}return t}function kR(e,t,r){var m;let n=bs(e,r),i=t.get(Qp(n.projection));if(!["geographic","identity"].includes(n.kind)&&!i)throw new oi("missing-plugin","Projection plugin is not registered: "+n.projection);let o=new Set([...$p,...(i==null?void 0:i.parameters)||[]]);for(let g of Object.keys(n.parameters)){if(!o.has(g))throw new oi("missing-transform-stage","Unsupported PROJ parameter: +"+g);let y=LR.includes(g)||((m=i==null?void 0:i.flags)==null?void 0:m.includes(g));if(y&&n.parameters[g]!==void 0)throw new Error("Expected a flag without a value: +"+g);if(!y&&!n.parameters[g])throw new Error("PROJ parameter requires a value: +"+g)}if(n.parameters.type&&n.parameters.type!=="crs")throw new Error("Only +type=crs is supported");let s=Qp(n.projection)==="fasttransversemercator"?Object.freeze({...n.parameters,approx:void 0}):n.parameters,a=i==null?void 0:i.create({...n.ellipsoid,parameters:s,primeMeridian:n.primeMeridian});if(n.kind==="geocentric"&&(!(a!=null&&a.forward3D)||!(a!=null&&a.inverse3D)))throw new Error("Geocentric plugin must implement 3D operations");let c=n.datum.grids,l=(c==null?void 0:c.findIndex(g=>g.name==="null"))??-1,u=c==null?void 0:c.slice(0,l<0?void 0:l+1).map(g=>{let y=Object.prototype.hasOwnProperty.call(r.datumGrids||{},g.name)?r.datumGrids[g.name]:void 0;if(y&&typeof y.shift!="function")throw new Error("Invalid prepared datum grid: "+g.name);return Object.freeze({...g,grid:y})});for(let g of u||[]){if(g.name==="null")break;!g.optional&&!g.grid&&Ue("Required datum grid is not registered: "+g.name)}let h=u?Object.freeze({...n.datum,grids:Object.freeze(u)}):n.datum,d=NR(n.parameters.geoidgrids,r.verticalGrids);return d&&(n.kind==="geocentric"||n.kind==="identity"||n.lossy)&&Ue("Vertical grids require a non-lossy geographic or projected CRS"),{...n,datum:h,implementation:a,verticalGrid:d}}function lx(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)}function UR(e,t){if(e==="enu")return;let r=[0,0,0],n=[0,0,0];for(let i=0;i<3;i++){let o=e[i],s="ew".includes(o)?0:"ns".includes(o)?1:2;r[t?i:s]=t?s:i,n[t?i:s]="wsd".includes(o)?-1:1}return i=>{let o=i.x,s=i.y,a=i.z;i.x=n[0]*(r[0]===0?o:r[0]===1?s:a),i.y=n[1]*(r[1]===0?o:r[1]===1?s:a),i.z=n[2]*(r[2]===0?o:r[2]===1?s:a)}}function jR(e,t,r){var v,T,O,P;let n=e.storedAxis||(r?e.axis:"enu"),i=t.storedAxis||(r?t.axis:"enu"),o=UR(n,!1),s=UR(i,!0),a=e.implementation&&qo(e.implementation,!0,e.kind==="geocentric"),c=t.implementation&&qo(t.implementation,!1,t.kind==="geocentric"),l=ax(e.datum,t.datum),u=e.lossy||t.lossy,h=e.kind==="geocentric",d=e.kind==="geographic"?e.angularUnit:e.toMeter,m=t.kind==="geographic"?t.angularUnit:t.toMeter,g=h?1:e.verticalUnit,y=t.kind==="geocentric"?m:t.verticalUnit,b=e.primeMeridian,w=t.primeMeridian,S=t.kind==="geographic"?t.longitudeWrap:void 0,M;if(!l&&!e.verticalGrid&&!t.verticalGrid&&!u&&!o&&!s&&!b&&!w&&e.verticalUnit===1&&t.verticalUnit===1&&S===void 0){let _=Object.freeze({inputScale:d,outputScale:m});e.kind==="geographic"&&t.kind==="projected"&&(M=(T=(v=t.implementation)==null?void 0:v.createForwardFlat)==null?void 0:T.call(v,_)),e.kind==="projected"&&t.kind==="geographic"&&(M=(P=(O=e.implementation)==null?void 0:O.createInverseFlat)==null?void 0:P.call(O,_))}return{flat:M,requiresInputZ:!!(e.verticalGrid||t.verticalGrid)||e.kind==="geocentric"||/[ud]/.test(n.slice(0,2))||/[ud]/.test(i.slice(0,2)),geocentricOutput:t.kind==="geocentric",run(_){if(!lx(_))throw new Error("Coordinates must contain finite x, y and optional z values");o==null||o(_);let U=_.z;if(u&&(_.z=0),d!==1&&(_.x*=d,_.y*=d,h&&(_.z*=d)),a==null||a(_),g!==1&&(_.z*=g),Math.abs(_.y)>Math.PI/2||!lx(_))throw new Error("Coordinate is outside the geographic domain");if(_.x+=b,e.verticalGrid&&(_.z+=e.verticalGrid(_.x,_.y)),l==null||l(_),t.verticalGrid&&(_.z-=t.verticalGrid(_.x,_.y)),_.x-=w,S!==void 0&&(_.x=S+Kt(_.x-S)),c==null||c(_),m!==1&&(_.x/=m,_.y/=m),y!==1&&(_.z/=y),u&&(_.z=U),s==null||s(_),!lx(_))throw new Error("Projection produced non-finite coordinates")}}}function Nu(e,t,r,n){if(e.length<2)throw new Error("Coordinates must contain finite x, y and optional z values");if(e.length<3&&t.requiresInputZ)throw new Error("This transform requires three ordinates");let i=Math.max(e.length,t.geocentricOutput?3:2),o=r.acquire();try{if(o.x=e[0],o.y=e[1],o.z=e.length>=3?e[2]:0,t.run(o),n)return Uh(e,n,o,i);let s=e.slice();return s[0]=o.x,s[1]=o.y,(e.length>=3||t.geocentricOutput)&&(s[2]=o.z),s}finally{r.release(o)}}function Jp(e,t,r,n){if(!(e instanceof Float32Array||e instanceof Float64Array))throw new Error("In-place projection requires a Float32Array or Float64Array");if(!Number.isSafeInteger(t)||t<2||e.length%t!==0)throw new Error("Dimension must be an integer >= 2 and divide the typed array length");if(t<3&&(r.requiresInputZ||r.geocentricOutput))throw new Error("This transform requires a dimension of at least 3");if(r.flat)return r.flat(e,t),e;let i=n.acquire();try{let o=e instanceof Float32Array;for(let s=0;s<e.length;s+=t){if(i.x=e[s],i.y=e[s+1],i.z=t>=3?e[s+2]:0,r.run(i),o&&(Math.abs(i.x)>34028234663852886e22||Math.abs(i.y)>34028234663852886e22||t>=3&&Math.abs(i.z)>34028234663852886e22))throw new Error("Projected coordinate exceeds Float32 range");e[s]=i.x,e[s+1]=i.y,t>=3&&(e[s+2]=i.z)}return e}finally{n.release(i)}}var qh,Qp,qR=p(()=>{sc();hR();pR();ac();Am();ex();Du();Ua();cx();qt();zh();FR();qh=class e{static async create(t={}){let r=await Promise.all(GR(t).map(mR));return new e({...t,projections:r})}get targetProfile(){return this.getTargetRenderingProfile(this.targetCoverage)}getTargetRenderingProfile(t){return this.targetRenderingProfile&&X4(this.targetRenderingProfile,t)}constructor(t={}){var i,o,s;this.coordinateScratch=new Bs,this.targetLongitudeOrigin=0;let r=t.projections||[],n=zR(r);if(r.some(a=>!("create"in a))){let a=bs(t.from??"WGS84",t),c=bs(t.to??"WGS84",t);this.lossy=a.lossy||c.lossy,this.deferred={options:{...t,projections:[...r]}}}else{let a=t,c=n,l=kR(a.from??"WGS84",c,a),u=kR(a.to??"WGS84",c,a);this.targetRenderingProfile=((o=(i=u.implementation)==null?void 0:i.getRenderingProfile)==null?void 0:o.bind(u.implementation))??(u.kind==="geographic"?ja(u.parameters,u.primeMeridian):u.kind==="identity"?fR:void 0),this.targetCoverage=u.areaOfUse,this.targetLongitudeOrigin=((s=u.implementation)==null?void 0:s.longitudeOrigin)??(u.kind==="geographic"?u.longitudeWrap??0:0),this.lossy=l.lossy||u.lossy,this.lossy&&(l.kind==="geocentric"||u.kind==="geocentric")&&Ue("Horizontal extraction cannot supply ellipsoidal height for geocentric coordinates"),this.lossy&&(l.verticalGrid||u.verticalGrid)&&Ue("Horizontal extraction cannot be combined with vertical grids"),this.forwardTransform=jR(l,u,!!t.enforceAxis),this.inverseTransform=jR(u,l,!!t.enforceAxis)}this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectTo=this.projectTo.bind(this),this.unprojectTo=this.unprojectTo.bind(this),this.projectToSync=this.projectToSync.bind(this),this.unprojectToSync=this.unprojectToSync.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this),this.projectSync=this.projectSync.bind(this),this.unprojectSync=this.unprojectSync.bind(this),this.projectFlatSync=this.projectFlatSync.bind(this),this.unprojectFlatSync=this.unprojectFlatSync.bind(this)}load(){let t=this.deferred;return t?t.implementation?Promise.resolve(t.implementation):(t.pending||(t.pending=e.create(t.options).then(r=>(t.implementation=r,r)).catch(r=>{throw t.pending=void 0,r})),t.pending):Promise.resolve(this)}loadSync(){let t=this.deferred;if(!t)return this;if(!t.implementation){let r=GR(t.options).map(n=>{let i=dR(n);if(!i)throw new Error("Projection is not preloaded: "+n.name+". Call preload() first.");return i});t.implementation=new e({...t.options,projections:r})}return t.implementation}projectSync(t){return this.deferred?this.loadSync().project(t):Nu(t,this.forwardTransform,this.coordinateScratch)}unprojectSync(t){return this.deferred?this.loadSync().unproject(t):Nu(t,this.inverseTransform,this.coordinateScratch)}projectFlatSync(t,r=2){return this.deferred?this.loadSync().projectFlat(t,r):Jp(t,r,this.forwardTransform,this.coordinateScratch)}unprojectFlatSync(t,r=2){return this.deferred?this.loadSync().unprojectFlat(t,r):Jp(t,r,this.inverseTransform,this.coordinateScratch)}async preload(){await this.load()}project(t){return this.deferred?this.projectLoaded(t,!1):Nu(t,this.forwardTransform,this.coordinateScratch)}unproject(t){return this.deferred?this.projectLoaded(t,!0):Nu(t,this.inverseTransform,this.coordinateScratch)}projectTo(t,r){return this.deferred?this.projectToLoaded(t,r,!1):this.projectToSync(t,r)}unprojectTo(t,r){return this.deferred?this.projectToLoaded(t,r,!0):this.unprojectToSync(t,r)}projectToSync(t,r){return this.deferred?this.loadSync().projectTo(t,r):(rl(t,r,Math.max(t.length,this.forwardTransform.geocentricOutput?3:2)),Nu(t,this.forwardTransform,this.coordinateScratch,r))}unprojectToSync(t,r){return this.deferred?this.loadSync().unprojectTo(t,r):(rl(t,r,Math.max(t.length,this.inverseTransform.geocentricOutput?3:2)),Nu(t,this.inverseTransform,this.coordinateScratch,r))}projectToLoaded(t,r,n){rl(t,r,t.length);let i=t.slice();return this.load().then(o=>n?o.unprojectTo(i,r):o.projectTo(i,r))}projectLoaded(t,r){let n=t.slice();return this.load().then(i=>r?i.unproject(n):i.project(n))}projectFlat(t,r=2){return this.deferred?this.load().then(i=>i.projectFlat(t,r)):Jp(t,r,this.forwardTransform,this.coordinateScratch)}unprojectFlat(t,r=2){return this.deferred?this.load().then(i=>i.unprojectFlat(t,r)):Jp(t,r,this.inverseTransform,this.coordinateScratch)}};Qp=e=>e.toLowerCase().replace(/[\s_-]/g,"")});var e1,VR=p(()=>{e1=class{constructor(t){this.sample=t,this.result=[0,0,0],this.samples=Array.from({length:4},()=>[0,0,0]),this.coarse=[0,0,0],this.fine=[0,0,0]}evaluate(t,r,n=1e-6){if(!this.difference(t,this.coarse)||!this.difference(t/2,this.fine))return!1;let i=n*Math.max(r,Math.abs(this.fine[0]),Math.abs(this.fine[1]),Math.abs(this.fine[2]));for(let o=0;o<3;o++)if(Math.abs(this.coarse[o]-this.fine[o])>i||(this.fine[o]+=(this.fine[o]-this.coarse[o])/15,!Number.isFinite(this.fine[o])))return!1;for(let o=0;o<3;o++)this.result[o]=this.fine[o];return!0}difference(t,r){let[n,i,o,s]=this.samples;if(!this.sample(-2*t,n)||!this.sample(-t,i)||!this.sample(t,o)||!this.sample(2*t,s))return!1;for(let a=0;a<3;a++)if(r[a]=(n[a]-s[a]+8*(o[a]-i[a]))/(12*t),!Number.isFinite(r[a]))return!1;return!0}}});function ux(e){if(e.length!==3||e.some(t=>!Number.isFinite(t)||t<=0))throw new Error("Invalid CRS rendering scale");return e}function HR(e,t,r,n){if(e.kind==="geocentric")return ux([e.toMeter,e.toMeter,e.toMeter]);if(e.kind==="identity")return ux([...r].map(g=>/[ud]/.test(g)?e.verticalUnit:e.toMeter));let i=[0,0,0],o=[0,0,0],s=[0,0,0],a=[0,0,0],c=Array.from({length:3},()=>[0,0,0]),l=0,u=0,h=0,d=!1,m=new e1((g,y)=>{for(let S=0;S<3;S++)o[S]=i[S];o[l]+=g,t.unprojectTo(o,a);let b=a[0]-s[0],w=Math.abs(b)<=180?b:((b+180)%360+360)%360-180;return Math.abs(a[1])>=90?!1:(y[0]=w*u,y[1]=(a[1]-s[1])*h,y[2]=a[2]-s[2],y.every(Number.isFinite))});return g=>{if(d||g.length<2)return null;d=!0;let y;try{if(i[0]=g[0],i[1]=g[1],i[2]=g[2]??0,!i.every(Number.isFinite))return null;t.unprojectTo(i,s);let b=s[1]*Vh,w=WR.semiMajorAxis,S=WR.eccentricitySquared,M=1-S*Math.sin(b)**2;if(u=w*Math.cos(b)/Math.sqrt(M)*Vh,h=w*(1-S)/M**1.5*Vh,!(u>w*Vh*1e-8)||!(h>0))return null;let v=((s[0]-n+180)%360+360)%360-180;if((e.kind==="geographic"?e.longitudeWrap!==void 0:!Object.prototype.hasOwnProperty.call(e.parameters,"over"))&&Math.abs(v)+2/u>=180||Math.abs(s[1])+2/h>=90)return null;for(l=0;l<3;l++){let O=r[l],P=/[ud]/.test(O)?e.verticalUnit:e.kind==="geographic"?(/[ew]/.test(O)?u:h)*e.angularUnit/Vh:e.toMeter;if(!m.evaluate(1/P,P))return null;for(let _=0;_<3;_++)c[l][_]=m.result[_]}if(y=c.map(O=>Math.hypot(...O)),e.kind==="projected"){let O=c[r.search(/[ew]/)],P=c[r.search(/[ns]/)],_=Math.abs(O[0]*P[1]-O[1]*P[0])/e.toMeter**2;y[r.search(/[ud]/)]=e.verticalUnit*Math.sqrt(_)}}catch{return null}finally{d=!1}return ux(y)}}var Vh,WR,$R=p(()=>{VR();Du();Vh=Math.PI/180,WR=bs("WGS84").ellipsoid});async function JR(e,t,r,n={},i=!1,o){let s=typeof t=="string"?t:JSON.parse(JSON.stringify(t)),a={enforceAxis:r.enforceAxis,mode:r.mode,...n,converters:n.converters&&[...n.converters]},c=o?await o(s,{...r,...a}):s,l=bs(c,{...r,...a}),u=await e.createProjectionAsync({...a,from:"WGS84",to:c}),h=l.storedAxis||(a.enforceAxis?l.axis:"enu"),d=ZR(l.kind==="geographic"?l.angularUnit:l.toMeter,l.kind==="geographic"),m=ZR(l.verticalUnit,!1),g=[...h].map(_=>l.kind!=="geocentric"&&/[ud]/.test(_)?m:d),y=u.targetProfile;if(!y)throw new Error("Projection must define a rendering profile for CRS retrieval");let b=(u.targetLongitudeOrigin+l.primeMeridian)*180/Math.PI,w=z$(y,l,h),S=j$(y.normalize),M=HR(l,u,h,b),v=[...new Set(["WGS84",...a.converters||[]])];if(v.some(_=>typeof _!="string"||!_.trim()))throw new Error("Converter source CRS must be a nonempty string");let T=await Promise.all(v.map(async _=>{if(_==="WGS84")return[_,XR(u,S)];let[U,C]=await Promise.all([e.createProjectionAsync({...a,from:_,to:c}),e.createProjectionAsync({...a,from:"WGS84",to:_})]);return[_,XR(U,U$(C,S))]})),O=Object.assign(Object.create(null),Object.fromEntries(T)),P={coordinateFrame:l.kind,projection:l.projection,parameters:l.parameters,ellipsoid:{semiMajorAxis:l.ellipsoid.semiMajorAxis,semiMinorAxis:l.ellipsoid.semiMinorAxis},axis:h,xUnit:g[0],yUnit:g[1],zUnit:g[2],areaOfUse:l.areaOfUse,lossy:l.lossy};return{...P,signature:i&&typeof c=="string"&&!a.enforceAxis&&!l.lossy?c:Kv(P),renderingBounds:w,renderingScale:M,getRenderingScale:_=>typeof M=="function"?M(_):M,converter:O}}function XR(e,t){return{from:YR(e.project.bind(e),e.projectTo.bind(e)),to:YR(e.unproject.bind(e),e.unprojectTo.bind(e)),normalize:t}}function U$(e,t){function r(n,i){i!==void 0&&rl(n,i,n.length);let o=e.unproject(Array.from(n)),[s,a,c]=o;return t(o,o),o[0]===s&&o[1]===a&&o[2]===c?i===void 0?Array.from(n):Uh(n,i,{x:n[0],y:n[1],z:n[2]??0},n.length):i===void 0?e.project(o):e.projectTo(o,i)}return r}function YR(e,t){function r(n,i){return i===void 0?e(Array.isArray(n)?n:Array.from(n)):t(n,i)}return r}function j$(e){function t(r,n){let i=n??new Array(r.length);rl(r,i,r.length);let o=r[0],s=r[1],a=r[2]??0;if(r.length<2||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(a))throw new Error("Normalization requires finite longitude, latitude and altitude");let c={x:o,y:s,z:a};return e==null||e(c),Uh(r,i,c,r.length)}return t}function z$(e,t,r){let n=t.kind==="geographic"?t.angularUnit:t.toMeter,i=[n,n,t.kind==="geocentric"?t.toMeter:t.verticalUnit],o=e.bounds,s=[...r].map(a=>{let c=/[ew]/.test(a)?0:/[ns]/.test(a)?1:2,l=o[0][c]/i[c],u=o[1][c]/i[c];return/[wsd]/.test(a)?[-u,-l]:[l,u]});return[[s[0][0],s[1][0],s[2][0]],[s[0][1],s[1][1],s[2][1]]]}function ZR(e,t){let r=t?KR:k$,n=Object.keys(r).find(i=>r[i]===e)||"custom";return t?{name:n,degreesPerUnit:e/KR.degrees}:{name:n,metersPerUnit:e}}var KR,k$,QR=p(()=>{Du();$R();ex();Wg();KR={degrees:Math.PI/180,radians:1,gradians:Math.PI/200},k$={...Object.fromEntries(Object.values(_f).map(e=>[e.name,e.metersPerUnit]))}});function eL(e){return{...e,projections:e.projections&&[...e.projections],parsers:e.parsers&&[...e.parsers],datumCatalogs:e.datumCatalogs&&[...e.datumCatalogs],aliases:e.aliases&&JSON.parse(JSON.stringify(e.aliases)),datumGrids:e.datumGrids&&{...e.datumGrids},verticalGrids:e.verticalGrids&&{...e.verticalGrids}}}function Wh(e){return!!(e.projections||e.parsers||e.datumCatalogs||e.aliases||e.datumGrids||e.verticalGrids||e.resolver)}var fx=p(()=>{});async function rL(e){let t={...e,from:tL(e.from??"WGS84"),to:tL(e.to??"WGS84")},[r,n]=await Promise.all([t1(t.from,t),t1(t.to,t)]);return{...t,from:r,to:n}}async function t1(e,t){var u;let r=jh(e,t),n=ix(r.definition,t),i=typeof e=="string"||"type"in e?void 0:"crs"in e?e.crs:e,o=n===r.definition&&i?i.representation:yr(n);if(o!=="identifier"||(u=t.parsers)!=null&&u.some(h=>h.canParse(n)))return e;let s=await t.resolver.resolve({state:"explicit",provenance:(i==null?void 0:i.provenance)??"unknown",definition:n,representation:o}),a=jh(s.input,t).definition;if(!i)return a;let c=e,l={...i,definition:a,representation:yr(a),alternatives:[{definition:i.definition,representation:i.representation},...i.alternatives??[]]};return"crs"in c?{...c,crs:l}:l}function tL(e){return typeof e=="string"?e:JSON.parse(JSON.stringify(e))}var nL=p(()=>{Bl();Du();tx()});var r1,iL=p(()=>{QR();fx();nL();qR();fx();r1=class{constructor(t={}){this.options=eL(t),this.useDefinitionSignature=!Wh(t)}getCRS(t,r={}){return JR(this,t,this.options,r,this.useDefinitionSignature,this.options.resolver?t1:void 0)}createProjection(t={}){return new qh({...this.options,...t})}async createProjectionAsync(t={}){let r={...this.options,...t};return qh.create(r.resolver?await rL(r):r)}}});var oL=p(()=>{});var hx,sL=p(()=>{Wl();qt();Je();lt();Ot();hx={name:"merc",aliases:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A"],parameters:["lon_0","lat_ts","k","k_0","x_0","y_0"],create({semiMajorAxis:e,eccentricitySquared:t,parameters:r,primeMeridian:n=0}){let i=Math.sqrt(t),o=Object.prototype.hasOwnProperty.call(r,"over"),s=re(r,"lon_0",0)*At,a=re(r,"x_0",0),c=re(r,"y_0",0),l=re(r,"k_0",re(r,"k",1));if(Object.prototype.hasOwnProperty.call(r,"lat_ts")){let g=Tf(r,"lat_ts");l=Math.cos(g)/Math.sqrt(1-t*Math.sin(g)**2)}if(l<=0)throw new Error("Mercator scale must be positive");let u=e*l,h=Math.atan(Math.sinh(Math.PI)),d=u*Math.PI,m=u*(Math.PI-i*Math.atanh(i*Math.sin(h)));return{longitudeOrigin:s,getRenderingProfile(g){if(g){let b=g[1]<=-90||g[3]>=90,w=[g[0],b?Math.max(-h*180/Math.PI,Math.min(h*180/Math.PI,g[1])):g[1],g[2],b?Math.max(-h*180/Math.PI,Math.min(h*180/Math.PI,g[3])):g[3]],S=M=>c+u*(Math.asinh(Math.tan(M))-i*Math.atanh(i*Math.sin(M)));return cr(M=>ct(Ce([a,a],Fe(Or(M,s,o),u)),[S(M[0][1]),S(M[1][1])]),w,s,n,o)}let y=[[a-d,c-m,0],[a+d,c+m,0]];return{bounds:y,normalize:cr(()=>y,Nn(Q(s-Math.PI,-h,s+Math.PI,h),n),s,n,o).normalize}},...Li(g=>{let y=g.x,b=g.y;if(Math.abs(b)>=Math.PI/2)throw new Error("Mercator is undefined at the poles");let w=Math.asinh(Math.tan(b));g.x=a+u*Kt(y-s,o),g.y=c+u*(i===0?w+0:w-i*Math.atanh(i*Math.sin(b)))},g=>{let y=g.x,w=(g.y-c)/u,S=Math.atan(Math.sinh(w));if(i===0){g.x=Kt(s+(y-a)/u,o),g.y=S+0;return}for(let M=0;M<30;M++){let v=Math.atan(Math.sinh(w+i*Math.atanh(i*Math.sin(S))));if(Math.abs(v-S)<1e-13){g.x=Kt(s+(y-a)/u,o),g.y=v;return}S=v}throw new Error("Mercator inverse did not converge")})}}}});var dx,aL=p(()=>{ac();qt();Je();lt();Ot();dx={name:"eqc",aliases:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical"],parameters:["lon_0","lat_0","lat_ts","x_0","y_0"],create({semiMajorAxis:e,parameters:t,primeMeridian:r=0}){let n=Object.prototype.hasOwnProperty.call(t,"over"),i=re(t,"lon_0",0)*At,o=Tf(t,"lat_0"),s=Math.cos(Tf(t,"lat_ts")),a=re(t,"x_0",0),c=re(t,"y_0",0),l=e*Math.abs(s)*Math.PI;return{longitudeOrigin:i,getRenderingProfile(u){if(u)return cr(d=>ct(Ce([a,a],Fe(Or(d,i,n),e*s)),[c+e*(d[0][1]-o),c+e*(d[1][1]-o)]),u,i,r,n);let h=[[a-l,c+e*(-Math.PI/2-o),0],[a+l,c+e*(Math.PI/2-o),0]];return{bounds:h,normalize:cr(()=>h,Nn(Q(i-Math.PI,-(Math.PI/2),i+Math.PI,Math.PI/2),r),i,r,n).normalize}},...di(u=>{u.x=a+e*s*Kt(u.x-i,n),u.y=c+e*(u.y-o)},u=>{u.x=Kt(i+(u.x-a)/(e*s),n),u.y=o+(u.y-c)/e})}}}});function q$(e){if(e.k0||(e.k0=1),e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,!(Math.abs(e.lat1+e.lat2)<1e-10)){var t=e.b/e.a;e.e=Math.sqrt(1-t*t);var r=Math.sin(e.lat1),n=Math.cos(e.lat1),i=wn(e.e,r,n),o=Jr(e.e,e.lat1,r),s=Math.sin(e.lat2),a=Math.cos(e.lat2),c=wn(e.e,s,a),l=Jr(e.e,e.lat2,s),u=Jr(e.e,e.lat0,Math.sin(e.lat0));Math.abs(e.lat1-e.lat2)>1e-10?e.ns=Math.log(i/c)/Math.log(o/l):e.ns=r,Number.isNaN(e.ns)&&(e.ns=r),e.f0=i/(e.ns*Math.pow(o,e.ns)),e.rh=Math.abs(Math.abs(e.lat0)-F)<1e-10?0:e.a*e.f0*Math.pow(u,e.ns)}}function cL(e,t){var r=t.x,n=t.y,i=Math.abs(Math.abs(n)-F),o,s;if(i>1e-10)o=e.sphere?1/Math.tan(Math.PI/4+n/2):Jr(e.e,n,Math.sin(n)),s=e.a*e.f0*Math.pow(o,e.ns);else{if(i=n*e.ns,i<=0)return null;s=0}var a=e.ns*k(r-e.long0,e.over);return t.x=e.k0*(s*Math.sin(a))+e.x0,t.y=e.k0*(e.rh-s*Math.cos(a))+e.y0,t}function lL(e,t){var r,n,i,o,s,a=(t.x-e.x0)/e.k0,c=e.rh-(t.y-e.y0)/e.k0;e.ns>0?(r=Math.sqrt(a*a+c*c),n=1):(r=-Math.sqrt(a*a+c*c),n=-1);var l=0;if(r!==0&&(l=Math.atan2(n*a,n*c)),r!==0||e.ns>0){if(n=1/e.ns,i=Math.pow(r/(e.a*e.f0),n),o=hc(e.e,i),o===-9999)return null}else o=-F;return s=k(l/e.ns+e.long0,e.over),t.x=s,t.y=o,t}function uL(e){let t={...e,ns:0,f0:0,rh:0};return q$(t),t}var fL=p(()=>{Kl();Bf();xt();Bm();Bt()});var mx,hL=p(()=>{Ot();Je();lt();Wl();Fn();fL();mx={name:"lcc",aliases:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"],parameters:[...vr,...Vo,"lat_1","lat_2"],create(e){let t=br(e);Vl(t,e.parameters);let r=uL(t),n=lr("lcc",r,cL,lL),i={...Li(o=>{let s=o.y;if(Math.abs(s)===Math.PI/2&&s*r.ns<0)throw new Error("Lambert conformal conic is undefined at the opposite pole");n.forwardInPlace(o)},n.inverseInPlace)};return De(i,Q(t.long0-Math.PI,r.ns>0?-Math.PI/3:-Math.PI/2,t.long0+Math.PI,r.ns>0?Math.PI/2:Math.PI/3),o=>ql(i.forward,o,t.long0,r.ns,r.x0,r.y0+r.k0*r.rh,t.over),t.primeMeridian,t.over)}}});function un(e,t){var r;return e>1e-7?(r=e*t,(1-e*e)*(t/(1-r*r)-.5/e*Math.log((1-r)/(1+r)))):2*t}var Hh=p(()=>{});function n1(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));let n=4*Number.EPSILON*r;if(Math.abs(t)>r+n)return NaN;if(Math.abs(Math.abs(t)-r)<=n)return t<0?-1*F:F;for(var i=Math.asin(.5*t),o,s,a,c,l=0;l<30;l++)if(s=Math.sin(i),a=Math.cos(i),c=e*s,o=Math.pow(1-c*c,2)/(2*a)*(t/(1-e*e)-s/(1-c*c)+.5/e*Math.log((1-c)/(1+c))),i+=o,Math.abs(o)<=1e-10)return i;return NaN}var px=p(()=>{Bt()});function V$(e){Math.abs(e.lat1+e.lat2)<1e-10||(e.temp=e.b/e.a,e.es=1-Math.pow(e.temp,2),e.e3=Math.sqrt(e.es),e.sin_po=Math.sin(e.lat1),e.cos_po=Math.cos(e.lat1),e.t1=e.sin_po,e.con=e.sin_po,e.ms1=wn(e.e3,e.sin_po,e.cos_po),e.qs1=un(e.e3,e.sin_po),e.sin_po=Math.sin(e.lat2),e.cos_po=Math.cos(e.lat2),e.t2=e.sin_po,e.ms2=wn(e.e3,e.sin_po,e.cos_po),e.qs2=un(e.e3,e.sin_po),e.sin_po=Math.sin(e.lat0),e.cos_po=Math.cos(e.lat0),e.t3=e.sin_po,e.qs0=un(e.e3,e.sin_po),Math.abs(e.lat1-e.lat2)>1e-10?e.ns0=(e.ms1*e.ms1-e.ms2*e.ms2)/(e.qs2-e.qs1):e.ns0=e.con,e.c=e.ms1*e.ms1+e.ns0*e.qs1,e.rh=e.a*Math.sqrt(e.c-e.ns0*e.qs0)/e.ns0)}function dL(e,t){var r=t.x,n=t.y;e.sin_phi=Math.sin(n),e.cos_phi=Math.cos(n);var i=un(e.e3,e.sin_phi),o=e.a*Math.sqrt(e.c-e.ns0*i)/e.ns0,s=e.ns0*k(r-e.long0,e.over),a=o*Math.sin(s)+e.x0,c=e.rh-o*Math.cos(s)+e.y0;return t.x=a,t.y=c,t}function mL(e,t){var r,n,i,o,s,a;if(t.x-=e.x0,t.y=e.rh-t.y+e.y0,e.ns0>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),o=0,r!==0&&(o=Math.atan2(i*t.x,i*t.y)),i=r*e.ns0/e.a,e.sphere){let c=(e.c-i*i)/(2*e.ns0);if(Math.abs(c)>1+8*Number.EPSILON)return null;a=Math.asin(Math.max(-1,Math.min(1,c)))}else{n=(e.c-i*i)/e.ns0;let c=un(e.e3,1);a=Math.abs(Math.abs(n)-c)<=16*Number.EPSILON*c?Math.sign(n)*Math.PI/2:n1(e.e3,n)}return s=k(o/e.ns0+e.long0,e.over),t.x=s,t.y=a,t}function pL(e){let t={...e,temp:0,e3:0,sin_po:0,cos_po:0,t1:0,con:0,ms1:0,qs1:0,t2:0,ms2:0,qs2:0,t3:0,qs0:0,ns0:0,c:0,rh:0,sin_phi:0,cos_phi:0};return V$(t),t}var gL=p(()=>{Kl();Hh();xt();px()});var gx,yL=p(()=>{Wl();Ot();Je();lt();Fn();gL();gx={name:"aea",aliases:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers"],parameters:[...vr,"lat_1","lat_2"],create(e){let t=br(e);Vl(t,e.parameters);let r=pL(t),n={...lr("aea",r,dL,mL,Li)};return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>ql(n.forward,i,t.long0,r.ns0,r.x0,r.y0+r.rh,t.over),t.primeMeridian,t.over)}}});function ws(e){return Math.abs(e)<=F?e:e-Fs(e)*Math.PI}var $h=p(()=>{Bt();Lf()});function W$(e){Math.abs(e.lat1+e.lat2)<1e-10||(e.temp=e.b/e.a,e.es=1-Math.pow(e.temp,2),e.e=Math.sqrt(e.es),e.en=co(e.es),e.sin_phi=Math.sin(e.lat1),e.cos_phi=Math.cos(e.lat1),e.ms1=wn(e.e,e.sin_phi,e.cos_phi),e.ml1=wr(e.lat1,Math.sin(e.lat1),Math.cos(e.lat1),e.en),Math.abs(e.lat1-e.lat2)<1e-10?e.ns=e.sin_phi:(e.sin_phi=Math.sin(e.lat2),e.cos_phi=Math.cos(e.lat2),e.ms2=wn(e.e,e.sin_phi,e.cos_phi),e.ml2=wr(e.lat2,Math.sin(e.lat2),Math.cos(e.lat2),e.en),e.ns=(e.ms1-e.ms2)/(e.ml2-e.ml1)),e.g=e.ml1+e.ms1/e.ns,e.ml0=wr(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en),e.rh=e.a*(e.g-e.ml0))}function bL(e,t){var r=t.x,n=t.y,i;if(e.sphere)i=e.a*(e.g-n);else{var o=wr(n,Math.sin(n),Math.cos(n),e.en);i=e.a*(e.g-o)}var s=e.ns*k(r-e.long0,e.over),a=e.x0+i*Math.sin(s),c=e.y0+e.rh-i*Math.cos(s);return t.x=a,t.y=c,t}function wL(e,t){t.x-=e.x0,t.y=e.rh-t.y+e.y0;var r,n,i,o;e.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1);var s=0;if(n!==0&&(s=Math.atan2(r*t.x,r*t.y)),e.sphere)return o=k(e.long0+s/e.ns,e.over),i=ws(e.g-n/e.a),t.x=o,t.y=i,t;var a=e.g-n/e.a;return i=lo(a,e.es,e.en),o=k(e.long0+s/e.ns,e.over),t.x=o,t.y=i,t}function xL(e){let t={...e,temp:0,en:[],sin_phi:0,cos_phi:0,ms1:0,ml1:0,ns:0,ms2:0,ml2:0,g:0,ml0:0,rh:0};return W$(t),t}var _L=p(()=>{Hl();uc();$l();Kl();xt();$h()});var yx,SL=p(()=>{Wl();Ot();Je();lt();Fn();_L();yx={name:"eqdc",aliases:["Equidistant_Conic"],parameters:[...vr,"lat_1","lat_2"],create(e){let t=br(e);Vl(t,e.parameters);let r=xL(t),n=lr("eqdc",r,bL,wL,Li);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>ql(n.forward,i,t.long0,r.ns,r.x0,r.y0+r.rh,t.over),t.primeMeridian,t.over)}}});function za(e,t){let r=Math.abs(Math.sin(t)),n=Math.cos(t),i=n*n/(1+r);if(e===0)return 2*i;let o=e*e;return i*(1+o*r)/(1-o*r*r)+(1-o)/e*Math.atanh(e*i/(1-o*r))}function bx(e,t,r){if(r===0||e===0)return r;let n=za(e,r)/t;return Math.atan2(Math.sign(r)*(1-n),Math.sqrt(n*(2-n)))}function wx(e,t,r){if(e===0||r===0||Math.abs(r)===Math.PI/2)return r;let n=Math.abs(Math.sin(r)),i=Math.cos(r),o=t*i*i/(1+n),s=Math.abs(r),a=e*e,c=0,l=Math.PI/2;for(let u=0;u<48;u++){let h=Math.sin(s),d=1-a*h*h,m=2*(1-a)*Math.cos(s)/(d*d),g=za(e,s)-o,y=g/m;if(Math.abs(y)<2e-15)return Math.sign(r)*s;g>0?c=s:l=s;let b=s+y;s=b>c&&b<l?b:(c+l)/2}throw new Error("Authalic latitude inverse did not converge")}var xx=p(()=>{});function H$(e){var t=Math.abs(e.lat0);if(Math.abs(t-F)<1e-10?e.mode=e.lat0<0?$i:Po:Math.abs(t)<1e-10?e.mode=Ei:e.mode=fn,e.es>0){var r;switch(e.qp=un(e.e,1),e.mmf=.5/(1-e.es),e.mode){case Po:e.dd=1;break;case $i:e.dd=1;break;case Ei:e.rq=Math.sqrt(.5*e.qp),e.dd=1/e.rq,e.xmf=1,e.ymf=.5*e.qp;break;case fn:e.rq=Math.sqrt(.5*e.qp),r=Math.sin(e.lat0),e.sinb1=un(e.e,r)/e.qp,e.cosb1=Math.sqrt(1-e.sinb1*e.sinb1),e.dd=Math.cos(e.lat0)/(Math.sqrt(1-e.es*r*r)*e.rq*e.cosb1),e.xmf=e.rq,e.ymf=e.xmf/e.dd,e.xmf*=e.dd;break}}else e.mode===fn&&(e.sinph0=Math.sin(e.lat0),e.cosph0=Math.cos(e.lat0))}function ML(e,t){var r,n,i,o,s,a,c,l,u,h,d=t.x,m=t.y;if(d=k(d-e.long0,e.over),e.sphere){if(s=Math.sin(m),h=Math.cos(m),i=Math.cos(d),e.mode===fn||e.mode===Ei){if(n=e.mode===Ei?1+h*i:1+e.sinph0*s+e.cosph0*h*i,n<=1e-10)return null;n=Math.sqrt(2/n),r=n*h*Math.sin(d),n*=e.mode===Ei?s:e.cosph0*s-e.sinph0*h*i}else if(e.mode===Po||e.mode===$i){if(e.mode===Po&&(i=-i),Math.abs(m+e.lat0)<1e-10)return null;n=Qe-m*.5,n=2*(e.mode===$i?Math.cos(n):Math.sin(n)),r=n*Math.sin(d),n*=i}}else{if(c=0,l=0,u=0,i=Math.cos(d),o=Math.sin(d),s=Math.sin(m),a=un(e.e,s),e.mode===fn||e.mode===Ei){c=a/e.qp;let g=za(e.e,m)/e.qp;l=Math.sqrt(g*(2-g))}switch(e.mode){case fn:u=1+e.sinb1*c+e.cosb1*l*i;break;case Ei:u=1+l*i;break;case Po:u=F+m,a=m>=0?za(e.e,m):2*e.qp-za(e.e,m);break;case $i:u=m-F,a=m<=0?za(e.e,m):2*e.qp-za(e.e,m);break}if(Math.abs(u)<1e-10)return null;switch(e.mode){case fn:case Ei:u=Math.sqrt(2/u),e.mode===fn?n=e.ymf*u*(e.cosb1*c-e.sinb1*l*i):(u=Math.sqrt(2/(1+l*i)),n=u*c*e.ymf),r=e.xmf*u*l*o;break;case Po:case $i:a>=0?(u=Math.sqrt(a),r=u*o,n=i*(e.mode===$i?u:-u)):r=n=0;break}}return t.x=e.a*r+e.x0,t.y=e.a*n+e.y0,t}function vL(e,t){t.x-=e.x0,t.y-=e.y0;var r=t.x/e.a,n=t.y/e.a,i,o,s,a,c,l,u;if(e.sphere){var h=0,d,m=0;if(d=Math.sqrt(r*r+n*n),o=d*.5,o>1+8*Number.EPSILON)return null;switch(o=2*Math.asin(Math.min(1,o)),(e.mode===fn||e.mode===Ei)&&(m=Math.sin(o),h=Math.cos(o)),e.mode){case Ei:o=Math.abs(d)<=1e-10?0:Oi(0,1,m,h,r,n,d),r*=m,n=h*d;break;case fn:o=Math.abs(d)<=1e-10?e.lat0:Oi(e.sinph0,e.cosph0,m,h,r,n,d),r*=m*e.cosph0,n=(h-Math.sin(o)*e.sinph0)*d;break;case Po:n=-n,o=F-o;break;case $i:o-=F;break}i=n===0&&(e.mode===Ei||e.mode===fn)?0:Math.atan2(r,n)}else{if(u=0,e.mode===fn||e.mode===Ei){if(r/=e.dd,n*=e.dd,l=Math.sqrt(r*r+n*n),l<1e-10)return t.x=e.long0,t.y=e.lat0,t;let g=.5*l/e.rq;if(g>1+8*Number.EPSILON)return null;a=2*Math.asin(Math.min(1,g)),s=Math.cos(a),a=Math.sin(a);let y=Oi(e.mode===fn?e.sinb1:0,e.mode===fn?e.cosb1:1,a,s,r,n,l);o=wx(e.e,e.qp,y),r*=a,e.mode===fn?(u=s*e.sinb1+n*a*e.cosb1/l,c=e.qp*u,n=l*e.cosb1*s-n*e.sinb1*a):(u=n*a/l,c=e.qp*u,n=l*s)}else if(e.mode===Po||e.mode===$i){if(e.mode===Po&&(n=-n),c=r*r+n*n,!c)return t.x=e.long0,t.y=e.lat0,t;u=1-c/e.qp,e.mode===$i&&(u=-u)}if(i=Math.atan2(r,n),Math.abs(u)>1+8*Number.EPSILON)return null;if(e.mode===Po||e.mode===$i){let g=Math.max(0,Math.min(2,c/e.qp)),y=Math.atan2(u,Math.sqrt(g*(2-g)));o=wx(e.e,e.qp,y)}}return t.x=k(e.long0+i,e.over),t.y=o,t}function EL(e){let t={...e,mode:0,qp:0,mmf:0,dd:0,rq:0,xmf:0,ymf:0,sinb1:0,cosb1:0,sinph0:0,cosph0:0};return H$(t),t}var $i,Po,Ei,fn,AL=p(()=>{Bt();Hh();xt();xx();Of();$i=1,Po=2,Ei=3,fn=4});var _x,TL=p(()=>{xx();Us();js();Fn();AL();_x={name:"laea",aliases:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area"],parameters:vr,create(e){let t=br(e),r=EL(t);return bn(Ds(t,lr("laea",r,ML,vL)),t,Math.PI*179/180,(n,i)=>_8(t,t.sphere?1:r.xmf||Math.sqrt(r.qp/2),t.sphere?1:r.ymf||Math.sqrt(r.qp/2),n,i,t.sphere?t.lat0:bx(t.e,r.qp,t.lat0),t.sphere?o=>o:o=>bx(t.e,r.qp,o)))}}});function i1(e,t){return Math.pow((1-e)/(1+e),t)}var IL=p(()=>{});function K$(e){var t=Math.sin(e.lat0),r=Math.cos(e.lat0);r*=r,e.rc=Math.sqrt(1-e.es)/(1-e.es*t*t),e.C=Math.sqrt(1+e.es*r*r/(1-e.es)),e.phic0=Math.asin(t/e.C),e.ratexp=.5*e.C*e.e,e.K=Math.tan(.5*e.phic0+Qe)/(Math.pow(Math.tan(.5*e.lat0+Qe),e.C)*i1(e.e*t,e.ratexp))}function PL(e,t){var r=t.x,n=t.y;return t.y=2*Math.atan(e.K*Math.pow(Math.tan(.5*n+Qe),e.C)*i1(e.e*Math.sin(n),e.ratexp))-F,t.x=e.C*r,t}function RL(e,t){for(var r=1e-14,n=t.x/e.C,i=t.y,o=Math.pow(Math.tan(.5*i+Qe)/e.K,1/e.C),s=$$;s>0&&(i=2*Math.atan(o*i1(e.e*Math.sin(t.y),-.5*e.e))-F,!(Math.abs(i-t.y)<r));--s)t.y=i;return s?(t.x=n,t.y=i,t):null}function LL(e){let t={...e,rc:0,C:0,phic0:0,ratexp:0,K:0};return K$(t),t}var $$,OL=p(()=>{IL();Bt();$$=20});function X$(e){e.rc&&(e.sinc0=Math.sin(e.phic0),e.cosc0=Math.cos(e.phic0),e.R2=2*e.rc)}function BL(e,t){var r,n,i,o;return t.x=k(t.x-e.long0,e.over),PL(e,t),r=Math.sin(t.y),n=Math.cos(t.y),i=Math.cos(t.x),o=e.k0*e.R2/(1+e.sinc0*r+e.cosc0*n*i),t.x=o*n*Math.sin(t.x),t.y=o*(e.cosc0*r-e.sinc0*n*i),t.x=e.a*t.x+e.x0,t.y=e.a*t.y+e.y0,t}function CL(e,t){var r,n,i,o,s;if(t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,t.x/=e.k0,t.y/=e.k0,s=Jt(t.x,t.y),s){var a=2*Math.atan2(s,e.R2);r=Math.sin(a),n=Math.cos(a),o=Oi(e.sinc0,e.cosc0,r,n,t.x,t.y,s),i=Math.atan2(t.x*r,s*e.cosc0*n-t.y*e.sinc0*r)}else o=e.phic0,i=0;if(t.x=i,t.y=o,!RL(e,t))throw new Error("Oblique stereographic inverse did not converge");return t.x=k(t.x+e.long0,e.over),t}function DL(e){let t={...LL(e),sinc0:0,cosc0:0,R2:0};return X$(t),t}var NL=p(()=>{Of();OL();xt();lc()});var Sx,FL=p(()=>{Us();js();Fn();NL();Sx={name:"sterea",aliases:["Stereographic_North_Pole","Oblique_Stereographic","Oblique Stereographic Alternative","Double_Stereographic"],parameters:[...vr,...Vo],create(e){let t=br(e);if(Math.abs(t.lat0)===Math.PI/2)throw new Error("sterea requires a non-polar origin; use stere at the poles");let r=DL(t);return bn(Ds(t,lr("sterea",r,BL,CL)),t,Math.PI*150/180,(n,i)=>Om(t,o=>2*Math.atan(r.K*Math.pow(Math.tan(Math.PI/4+o/2),r.C)*Math.pow((1-t.e*Math.sin(o))/(1+t.e*Math.sin(o)),r.ratexp))-Math.PI/2,r.phic0,t.a*t.k0*r.R2,n,i,r.C,Math.abs(Math.log(r.C))+Math.abs(Math.log(r.K))+r.C*t.e*Math.atanh(t.e)))}}});function Mx(e,t){let r=1-e*Math.sin(t)**2;return(1-e)/(r*Math.sqrt(r))}function o1(e,t,r,n){return Mx(e,t-r*n)+Mx(e,t+r*n)}function si(e,t,r,n){let i=(n-r)/8,o=0;for(let s=0;s<4;s++){let a=r+(2*s+1)*i;o+=i*(.362683783378362*o1(t,a,i,.1834346424956498)+.3137066458778873*o1(t,a,i,.525532409916329)+.2223810344533745*o1(t,a,i,.7966664774136267)+.1012285362903763*o1(t,a,i,.9602898564975363))}return e*o}function vx(e,t,r){let n=Math.PI/2,i=si(e,t,0,n);if(!Number.isFinite(r)||Math.abs(r)>i)return NaN;let o=-n,s=n,a=r/i*n;for(let c=0;c<48;c++){let l=si(e,t,0,a)-r;if(Math.abs(l)<=8*Number.EPSILON*e)return a;l>0?s=a:o=a;let u=a-l/(e*Mx(t,a));a=u>o&&u<s?u:(o+s)/2}return NaN}var Ex=p(()=>{});function GL(e,t,r,n,i,o,s){let a=n-t,c=Math.atan((1-o)*Math.tan(e)),l=Math.atan((1-o)*Math.tan(r)),u=Math.sin(c),h=Math.cos(c),d=Math.sin(l),m=Math.cos(l),g=a,y,b=100,w,S,M,v,T,O,P,_,U,C,L,A,W,G;do{if(w=Math.sin(g),S=Math.cos(g),M=Math.sqrt(m*w*(m*w)+(h*d-u*m*S)*(h*d-u*m*S)),M===0){s.x=0,s.y=0;return}v=u*d+h*m*S,T=Math.atan2(M,v),O=h*m*w/M,P=1-O*O,_=P!==0?v-2*u*d/P:0,U=o/16*P*(4+o*(4-3*P)),y=g,g=a+(1-U)*o*O*(T+U*M*(_+U*v*(-1+2*_*_)))}while(Math.abs(g-y)>1e-12&&--b>0);if(b===0){s.x=NaN,s.y=NaN;return}C=P*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),L=1+C/16384*(4096+C*(-768+C*(320-175*C))),A=C/1024*(256+C*(-128+C*(74-47*C))),W=A*M*(_+A/4*(v*(-1+2*_*_)-A/6*_*(-3+4*M*M)*(-3+4*_*_))),G=i*(1-o)*L*(T-W);let E=Math.atan2(m*w,h*d-u*m*S);s.x=E,s.y=G}function kL(e,t,r,n,i,o,s){let a=Math.atan((1-o)*Math.tan(e)),c=Math.sin(a),l=Math.cos(a),u=Math.sin(r),h=Math.cos(r),d=Math.atan2(c,l*h),m=l*u,g=1-m*m,y=g*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),b=1+y/16384*(4096+y*(-768+y*(320-175*y))),w=y/1024*(256+y*(-128+y*(74-47*y))),S=n/(i*(1-o)*b),M,v=100,T,O,P,_;do T=Math.cos(2*d+S),O=Math.sin(S),P=Math.cos(S),_=w*O*(T+w/4*(P*(-1+2*T*T)-w/6*T*(-3+4*O*O)*(-3+4*T*T))),M=S,S=n/(i*(1-o)*b)+_;while(Math.abs(S-M)>1e-12&&--v>0);if(v===0){s.x=NaN,s.y=NaN;return}let U=c*O-l*P*h,C=Math.atan2(c*P+l*O*h,(1-o)*Math.sqrt(m*m+U*U)),L=Math.atan2(O*u,l*P-c*O*h),A=o/16*g*(4+o*(4-3*g)),W=L-(1-A)*o*m*(S+A*O*(T+A*P*(-1+2*T*T))),G=t+W;s.x=G,s.y=C}var UL=p(()=>{});function Y$(e){e.sin_p12=Math.sin(e.lat0),e.cos_p12=Math.cos(e.lat0),e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,e.f=e.es/(1+Math.sqrt(1-e.es))}function jL(e,t){var r=t.x,n=t.y,i=Math.sin(t.y),o=Math.cos(t.y),s=k(r-e.long0,e.over),a,c,l,u,h;if(e.sphere)return Math.abs(e.sin_p12-1)<=1e-10?(t.x=e.x0+e.a*(F-n)*Math.sin(s),t.y=e.y0-e.a*(F-n)*Math.cos(s),t):Math.abs(e.sin_p12+1)<=1e-10?(t.x=e.x0+e.a*(F+n)*Math.sin(s),t.y=e.y0+e.a*(F+n)*Math.cos(s),t):(u=e.sin_p12*i+e.cos_p12*o*Math.cos(s),c=Math.acos(u),l=c?c/Math.sin(c):1,t.x=e.x0+e.a*l*o*Math.sin(s),t.y=e.y0+e.a*l*(e.cos_p12*i-e.sin_p12*o*Math.cos(s)),t);if(Math.abs(e.sin_p12-1)<=1e-10)return a=si(e.a,e.es,n,F),t.x=e.x0+a*Math.sin(s),t.y=e.y0-a*Math.cos(s),t;if(Math.abs(e.sin_p12+1)<=1e-10)return a=si(e.a,e.es,-F,n),t.x=e.x0+a*Math.sin(s),t.y=e.y0+a*Math.cos(s),t;{if(Math.abs(s)<1e-10&&Math.abs(n-e.lat0)<1e-10)return t.x=e.x0,t.y=e.y0,t;GL(e.lat0,e.long0,n,r,e.a,e.f,t),h=t.x;let d=t.y;return t.x=e.x0+d*Math.sin(h),t.y=e.y0+d*Math.cos(h),t}}function zL(e,t){t.x-=e.x0,t.y-=e.y0;var r,n,i,o,s,a,c,l,u,h,d;if(e.sphere){if(r=Math.sqrt(t.x*t.x+t.y*t.y),r>2*F*e.a)return null;if(n=r/e.a,i=Math.sin(n),o=Math.cos(n),s=e.long0,Math.abs(r)<=1e-10)a=e.lat0;else if(a=Oi(e.sin_p12,e.cos_p12,i,o,t.x,t.y,r),c=Math.abs(e.lat0)-F,Math.abs(c)<=1e-10)if(e.lat0>=0){if(!Number.isFinite(a))return null;s=k(e.long0+Math.atan2(t.x,-t.y),e.over)}else s=k(e.long0-Math.atan2(-t.x,t.y),e.over);else s=k(e.long0+Math.atan2(t.x*i,r*e.cos_p12*o-t.y*e.sin_p12*i),e.over);return t.x=s,t.y=a,t}else return Math.abs(e.sin_p12-1)<=1e-10?(l=si(e.a,e.es,0,F),r=Math.sqrt(t.x*t.x+t.y*t.y),u=l-r,a=vx(e.a,e.es,u),Number.isFinite(a)?(s=k(e.long0+Math.atan2(t.x,-1*t.y),e.over),t.x=s,t.y=a,t):null):Math.abs(e.sin_p12+1)<=1e-10?(l=si(e.a,e.es,0,F),r=Math.sqrt(t.x*t.x+t.y*t.y),u=r-l,a=vx(e.a,e.es,u),Number.isFinite(a)?(s=k(e.long0+Math.atan2(t.x,t.y),e.over),t.x=s,t.y=a,t):null):(h=Math.atan2(t.x,t.y),d=Math.sqrt(t.x*t.x+t.y*t.y),kL(e.lat0,e.long0,h,d,e.a,e.f,t),t)}function qL(e){let t={...e,sin_p12:0,cos_p12:0,f:0};return Y$(t),t}var VL=p(()=>{Of();xt();Bt();Ex();UL()});var Ax,WL=p(()=>{Us();js();Fn();VL();Ax={name:"aeqd",aliases:["Azimuthal_Equidistant"],parameters:vr,create(e){let t=br(e),r=qL(t);return bn(Ds(t,lr("aeqd",r,jL,zL)),t,Math.PI*179/180,(n,i)=>x8(t,n,i))}}});var Tx,HL=p(()=>{zh();cx();Tx={name:"geocent",aliases:["Geocentric","geocentric","Geocent"],parameters:[],create({semiMajorAxis:e,semiMinorAxis:t,eccentricitySquared:r,primeMeridian:n=0}){let i={semiMajorAxis:e,eccentricitySquared:r,semiMinorAxis:t??e*Math.sqrt(1-r)};return{getRenderingProfile:()=>({bounds:[[-e,-e,-i.semiMinorAxis],[e,e,i.semiMinorAxis]],normalize:ja({},n)().normalize}),forward(){throw new Error("Geocentric projection requires the 3D pipeline")},inverse(){throw new Error("Geocentric projection requires the 3D pipeline")},forwardInPlace:o=>Yp(o,i),inverseInPlace:o=>Zp(o,i),forward3D:o=>CR(o,i),inverse3D:o=>DR(o,i)}}}});function $L(e,t,r){let n=Rs(Or(r,e.long0,e.over)),i=e.a/Math.sqrt(1-e.es),o=hi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]),s=Math.max(Math.abs(e.a*(e.es?e.am1:e.cphi1)+e.y0-o[0]),Math.abs(e.a*(e.es?e.am1:e.cphi1)+e.y0-o[1])),a=Math.min(s,i*n),c=Math.min(2*s,i*n);return ct([e.x0-a,e.x0+a],[o[0]-c,o[1]+c])}function KL(e,t,r){let n=Rs(Or(r,e.long0,e.over)),i=e.a/Math.sqrt(1-e.es),o=i*n*n/4,s=hi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]);return e.sphere&&(r[0][1]-e.lat0<-Math.PI/2||r[1][1]-e.lat0>Math.PI/2)&&(s=[e.y0-e.a*Math.PI/2,e.y0+e.a*Math.PI/2]),ct([e.x0-i*n,e.x0+i*n],[s[0]-o,s[1]+o])}function XL(e,t,r){let n=Rs(Or(r,e.long0,e.over));if(e.sphere&&n>Math.PI/2)throw new Error("Unsupported Cassini rendering coverage");let i=e.a/Math.sqrt(1-e.es),o=e.es/(1-e.es),s=e.sphere?e.a*Math.asin(Math.min(1,Math.sin(Math.min(n,Math.PI/2)))):i*(n+n**3/6+(9+8*o)*n**5/120),a=e.sphere?e.a*n:i*(n*n/4+(6+6*o)*n**4/24),c=hi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]);return ct([e.x0-s,e.x0+s],[c[0]-a,c[1]+a])}function Ix(e,t){return t[0]<=0&&t[1]>=0?[-1/0,1/0]:Lt(e,hi(1/t[0],1/t[1]))}function YL(e,t){let r=l=>{let u=e.alpha*(Math.asinh(Math.tan(l))-e.e*Math.atanh(e.e*Math.sin(l)))+e.K;return Math.asin(Math.tanh(u))},n=Q((t[0][0]-e.long0)*e.alpha,r(t[0][1]),(t[1][0]-e.long0)*e.alpha,r(t[1][1])),i=ht([-Math.sin(e.b0),0,Math.cos(e.b0)],n);if(Rs(i)>=1-1e-14)throw new Error("Swiss oblique Mercator coverage reaches a rotated pole");let o=ht([0,1,0],n),s=ht([Math.cos(e.b0),0,Math.sin(e.b0)],n),a=Ix(o,s).map(Math.atan),c=i.map(l=>Math.atanh(Math.max(-1+Number.EPSILON,Math.min(1-Number.EPSILON,l))));return ct(Ce([e.x0,e.x0],Fe(a,e.R)),Ce([e.y0,e.y0],Fe(c,e.R)))}function ZL(e,t){let r=g=>Math.log(e.E)-e.B*Math.log(Jr(e.e,g,Math.sin(g))),n=hi(r(t[0][1]),r(t[1][1])),i=Fe([t[0][0]-e.lam0,t[1][0]-e.lam0],e.B),o=Q(i[0],Math.asin(Math.tanh(n[0])),i[1],Math.asin(Math.tanh(n[1]))),s=ht([0,-e.cosgam,e.singam],o),a=Fe(hi(-Math.atanh(s[0]),-Math.atanh(s[1])),e.ArB),c=Ce(Fe([Math.sinh(n[0]),Math.sinh(n[1])],e.cosgam),Fe(If(i),e.singam)),l=Sm(i),u=l[0]>0?Ix(c,l).map(Math.atan):[-Math.PI,Math.PI],h=Fe(u,e.ArB),d,m;return e.no_rot?(d=h,m=a):(h=Ce(h,[-e.u_0,-e.u_0]),d=Ce(Fe(a,e.cosrot),Fe(h,e.sinrot)),m=Ce(Fe(h,e.cosrot),Fe(a,-e.sinrot))),ct(Ce([e.x0,e.x0],Fe(d,e.a)),Ce([e.y0,e.y0],Fe(m,e.a)))}function JL(e,t){let r=m=>2*(Math.atan(e.k*Math.pow(Math.tan(m/2+e.s45),e.alfa)/Math.pow((1+e.e*Math.sin(m))/(1-e.e*Math.sin(m)),e.alfa*e.e/2))-e.s45),n=Fe(Or(t,e.long0,e.over),-e.alfa),i=Q(n[0],r(t[0][1]),n[1],r(t[1][1])),o=ht([Math.sin(e.ad),0,Math.cos(e.ad)],i),s=[Math.sqrt(Math.max(Number.EPSILON,1-Rs(o)**2)),1],a=ht([0,1,0],i),c=Ix(a,s),l=Fe(c.map(m=>Math.asin(Math.max(-1,Math.min(1,m)))),e.n),u=m=>e.ro0*Math.pow(Math.tan(e.s0/2+e.s45)/Math.tan(Math.asin(m)/2+e.s45),e.n),h=hi(u(o[0]),u(o[1])),d=e.czech?1:-1;return ct(Ce([e.x0,e.x0],Fe(Lt(h,If(l)),d)),Ce([e.y0,e.y0],Fe(Lt(h,Sm(l)),d)))}function QL(e,t){let r=Fe([t[0][1]-e.lat0,t[1][1]-e.lat0],1e-5/Rf),n=Or(t,e.long0,e.over),i=[0,0];for(let l=10;l>=1;l--)i=Ce([e.A[l],e.A[l]],Lt(i,r));i=Lt(i,r);let o=[0,0],s=[0,0];for(let l=6;l>=1;l--){let u=Ce(Lt(o,i),Fe(Lt(s,n),-1)),h=Ce(Lt(o,n),Lt(s,i));o=Ce(u,[e.B_re[l],e.B_re[l]]),s=Ce(h,[e.B_im[l],e.B_im[l]])}let a=Ce(Lt(o,i),Fe(Lt(s,n),-1)),c=Ce(Lt(o,n),Lt(s,i));return ct(Ce([e.x0,e.x0],Fe(c,e.a)),Ce([e.y0,e.y0],Fe(a,e.a)))}var qa=p(()=>{Je();fc();Ot();Bf();Bt()});function Te(e){let t=br(e);return{...t,x0:0,y0:0,lat_ts:Number.isNaN(t.lat_ts)?0:t.lat_ts}}function Gt(e,t){return{...e,x0:re(t.parameters,"x_0",0),y0:re(t.parameters,"y_0",0)}}function Ie(e,t,r,n,i,o){let s=lr(e,r,n,i),a=re(t.parameters,"x_0",0),c=re(t.parameters,"y_0",0);return di(l=>{o==null||o(l.x,l.y),s.forwardInPlace(l),l.x+=a,l.y+=c},l=>{l.x-=a,l.y-=c,s.inverseInPlace(l)})}function Va(e,t=0,r=!1){return(n,i)=>{let o=Math.sin(e.lat0)*Math.sin(i)+Math.cos(e.lat0)*Math.cos(i)*Math.cos(n-e.long0);if(r?o<t-1e-14:o<=t+1e-14)throw new Error("Coordinate is outside the visible projection horizon")}}var kt=p(()=>{ac();Fn();qt()});function Z$(e){var t;if(e.phi1=e.lat1,Math.abs(e.phi1)<Kh)throw new Error;e.es?(e.en=co(e.es),e.am1=Math.sin(e.phi1),t=Math.cos(e.phi1),e.m1=wr(e.phi1,e.am1,t,e.en),e.am1=t/(Math.sqrt(1-e.es*e.am1*e.am1)*e.am1)):Math.abs(e.phi1)+Kh>=F?e.cphi1=0:e.cphi1=1/Math.tan(e.phi1)}function J$(e,t){var r=k(t.x-(e.long0||0),e.over),n=t.y,i,o,s;return o=Math.sin(n),s=Math.cos(n),i=e.am1+e.m1-wr(n,o,s,e.en),o=s*r/(i*Math.sqrt(1-e.es*o*o)),t.x=i*Math.sin(o),t.y=e.am1-i*Math.cos(o),t.x=e.a*t.x+(e.x0||0),t.y=e.a*t.y+(e.y0||0),t}function Q$(e,t){t.x=(t.x-(e.x0||0))/e.a,t.y=(t.y-(e.y0||0))/e.a;var r,n,i,o;if(t.y=e.am1-t.y,n=Jt(t.x,t.y),e.phi1<0&&(n=-n),o=lo(e.am1+e.m1-n,e.es,e.en),r=Math.abs(o),r<F)r=Math.sin(o),i=n*Math.atan2(Math.sign(e.phi1)*t.x,Math.sign(e.phi1)*t.y)*Math.sqrt(1-e.es*r*r)/Math.cos(o);else if(Math.abs(r-F)<=Kh)i=0;else throw new Error;return t.x=k(i+(e.long0||0),e.over),t.y=ws(o),t}function eK(e,t){var r=k(t.x-(e.long0||0),e.over),n=t.y,i,o;return o=e.cphi1+e.phi1-n,Math.abs(o)>Kh?(i=r*Math.cos(n)/o,t.x=o*Math.sin(i),t.y=e.cphi1-o*Math.cos(i)):t.x=t.y=0,t.x=e.a*t.x+(e.x0||0),t.y=e.a*t.y+(e.y0||0),t}function tK(e,t){t.x=(t.x-(e.x0||0))/e.a,t.y=(t.y-(e.y0||0))/e.a;var r,n;t.y=e.cphi1-t.y;var i=Jt(t.x,t.y);if(e.phi1<0&&(i=-i),n=e.cphi1+e.phi1-i,Math.abs(n)>F)throw new Error;return Math.abs(Math.abs(n)-F)<=Kh?r=0:r=i*Math.atan2(Math.sign(e.phi1)*t.x,Math.sign(e.phi1)*t.y)/Math.cos(n),t.x=k(r+(e.long0||0),e.over),t.y=ws(n),t}function eO(e,t){return e.es?J$(e,t):eK(e,t)}function tO(e,t){return e.es?Q$(e,t):tK(e,t)}function rO(e,t={}){let r={...e,phi1:0,en:[],m1:0,am1:0,cphi1:0,...t};return Z$(r),r}var Kh,nO=p(()=>{$h();xt();lc();Hl();$l();uc();Bt();Kh=1e-10});var Px,iO=p(()=>{qa();Je();lt();kt();nO();Px={name:"bonne",aliases:["Bonne (Werner lat_1=90)"],parameters:["lon_0","x_0","y_0","lat_1"],create(e){let t=Te(e);if(!Object.prototype.hasOwnProperty.call(e.parameters,"lat_1")||Math.abs(t.lat1)<1e-10)throw new Error("Bonne requires a nonzero lat_1");let r=rO(t),n=Ie("bonne",e,r,eO,tO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>$L(Gt(r,e),n.forward,i),t.primeMeridian,t.over)}}});function Fu(e,t,r){var n=t*r;return e/Math.sqrt(1-n*n)}var Rx=p(()=>{});function rK(e){e.sphere||(e.en=co(e.es),e.ml0=e.a*wr(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en))}function Ox(e,t){var r,n,i=t.x,o=t.y;if(i=k(i-e.long0,e.over),e.sphere)r=e.a*Math.asin(Math.cos(o)*Math.sin(i)),n=e.a*(Math.atan2(Math.tan(o),Math.cos(i))-e.lat0);else{var s=Math.sin(o),a=Math.cos(o),c=Fu(e.a,e.e,s),l=Math.tan(o)*Math.tan(o),u=i*Math.cos(o),h=u*u,d=e.es*a*a/(1-e.es),m=e.a*wr(o,s,a,e.en);r=c*u*(1-h*l*(1/6+(8-l+8*d)*h/120)),n=m-e.ml0+c*s/a*h*(.5+(5-l+6*d)*h/24)}return t.x=r+e.x0,t.y=n+e.y0,t}function oO(e,t){t.x-=e.x0,t.y-=e.y0;var r=t.x/e.a,n=t.y/e.a,i,o;if(e.sphere){var s=n+e.lat0;i=Math.asin(Math.sin(s)*Math.cos(r)),o=Math.atan2(Math.tan(r),Math.cos(s))}else{var a=e.ml0/e.a+n,c=lo(a,e.es,e.en);if(Math.abs(Math.abs(c)-F)<=1e-10)return t.x=e.long0,t.y=Math.sign(c)*F,t;var l=Fu(e.a,e.e,Math.sin(c)),u=l*l*l/e.a/e.a*(1-e.es),h=Math.pow(Math.tan(c),2),d=r*e.a/l,m=d*d;i=c-l*Math.tan(c)/u*d*d*(.5-(1+3*h)*d*d/24),o=d*(1-m*(h/3-(1+3*h)*h*m/15))/Math.cos(c)}if(!e.sphere){let g=t.x+e.x0,y=t.y+e.y0,b=e.scratch,w=!1;for(let S=0;S<12;S++){Lx(e,o,i);let M=b.x-g,v=b.y-y;if(Math.max(Math.abs(M),Math.abs(v))<1e-7){w=!0;break}let T=1e-7,O=i>F-T?-T:T,P=b.x,_=b.y;Lx(e,o+T,i);let U=(b.x-P)/T,C=(b.y-_)/T;Lx(e,o,i+O);let L=(b.x-P)/O,A=(b.y-_)/O,W=U*A-L*C;if(!Number.isFinite(W)||Math.abs(W)<1e-12||(o-=(A*M-L*v)/W,i-=(U*v-C*M)/W,!Number.isFinite(o)||Math.abs(i)>F))break}if(!w)throw new Error("Cassini inverse did not converge")}return t.x=k(o+e.long0,e.over),t.y=ws(i),t}function Lx(e,t,r){e.scratch.x=t+e.long0,e.scratch.y=r,Ox(e,e.scratch)}function sO(e,t={}){let r={...e,en:[],scratch:{x:0,y:0},ml0:0,...t};return rK(r),r}var aO=p(()=>{Hl();uc();$l();Rx();xt();$h();Bt()});var Bx,cO=p(()=>{qa();Je();lt();kt();aO();Bx={name:"cass",aliases:["Cassini","Cassini_Soldner"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Te(e),r=sO(t),n=Ie("cass",e,r,Ox,oO);return De(n,Q(t.long0-Math.PI/6,-Math.PI/2+1e-8,t.long0+Math.PI/6,Math.PI/2-1e-8),i=>XL(Gt(t,e),n.forward,i),t.primeMeridian,t.over)}}});function nK(e){e.sphere||(e.k0=wn(e.e,Math.sin(e.lat_ts),Math.cos(e.lat_ts)))}function lO(e,t){var r=t.x,n=t.y,i,o,s=k(r-e.long0,e.over);if(e.sphere)i=e.x0+e.a*s*Math.cos(e.lat_ts),o=e.y0+e.a*Math.sin(n)/Math.cos(e.lat_ts);else{var a=un(e.e,Math.sin(n));i=e.x0+e.a*e.k0*s,o=e.y0+e.a*a*.5/e.k0}return t.x=i,t.y=o,t}function uO(e,t){t.x-=e.x0,t.y-=e.y0;var r,n;return e.sphere?(r=k(e.long0+t.x/e.a/Math.cos(e.lat_ts),e.over),n=Math.asin(t.y/e.a*Math.cos(e.lat_ts))):(n=n1(e.e,2*t.y*e.k0/e.a),r=k(e.long0+t.x/(e.a*e.k0),e.over)),t.x=r,t.y=n,t}function fO(e,t={}){let r={...e,...t};return nK(r),r}var hO=p(()=>{xt();Hh();Kl();px()});var Cx,dO=p(()=>{Ot();Je();lt();kt();hO();Cx={name:"cea",aliases:[],parameters:["lon_0","x_0","y_0","lat_ts"],create(e){let t=Te(e);if(Math.abs(t.lat_ts)>=Math.PI/2)throw new Error("CEA standard parallel must be away from the poles");let r=fO(t),n=Ie("cea",e,r,lO,uO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function il(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}var s1=p(()=>{});function oK(e){e.long0=e.long0||0,e.sphere?(e.n=1,e.m=0,e.es=0,e.C_y=Math.sqrt((e.m+1)/e.n),e.C_x=e.C_y/(e.m+1)):e.en=co(e.es)}function a1(e,t){var r,n,i=t.x,o=t.y;if(i=k(i-e.long0,e.over),e.sphere){if(!e.m)o=e.n!==1?Math.asin(e.n*Math.sin(o)):o;else for(var s=e.n*Math.sin(o),a=iK;a;--a){var c=(e.m*o+Math.sin(o)-s)/(e.m+Math.cos(o));if(o-=c,Math.abs(c)<1e-10)break}r=e.a*e.C_x*i*(e.m+Math.cos(o)),n=e.a*e.C_y*o}else{var l=Math.sin(o),u=Math.cos(o);n=e.a*wr(o,l,u,e.en),r=e.a*i*u/Math.sqrt(1-e.es*l*l)}return t.x=r,t.y=n,t}function c1(e,t){var r,n,i,o;if(t.x-=e.x0,i=t.x/e.a,t.y-=e.y0,r=t.y/e.a,e.sphere){if(r/=e.C_y,i=i/(e.C_x*(e.m+Math.cos(r))),e.m){let s=(e.m*r+Math.sin(r))/e.n;if(Math.abs(s)>1+8*Number.EPSILON)return null;r=il(s)}else e.n!==1&&(r=il(Math.sin(r)/e.n));i=k(i+e.long0,e.over),r=ws(r)}else r=lo(t.y/e.a,e.es,e.en),o=Math.abs(r),o<F?(o=Math.sin(r),n=e.long0+t.x*Math.sqrt(1-e.es*o*o)/(e.a*Math.cos(r)),i=k(n,e.over)):o-1e-10<F&&(i=e.long0);return t.x=i,t.y=r,t}function mO(e,t={}){let r={...e,en:[],n:0,m:0,C_y:0,C_x:0,...t};return oK(r),r}var iK,Dx=p(()=>{xt();$h();Hl();uc();$l();Bt();s1();iK=20});function sK(e){e.sphere=!0,e.b=e.a,e.m=1,e.n=2.5707963267948966,e.es=0,e.C_y=Math.sqrt((e.m+1)/e.n),e.C_x=e.C_y/(e.m+1)}function yO(e,t={}){let r={...e,m:0,n:0,C_y:0,C_x:0,en:[],...t};return sK(r),r}var pO,gO,bO=p(()=>{Dx();pO=a1,gO=c1});var Nx,wO=p(()=>{Ot();Je();lt();kt();bO();Nx={name:"eck6",aliases:["Eckert_VI"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=yO(t),n=Ie("eck6",e,r,pO,gO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function Fx(e){var t,r=[];return r[0]=e*aK,t=e*e,r[0]+=t*cK,r[1]=t*uK,t*=e,r[0]+=t*lK,r[1]+=t*fK,r[2]=t*hK,r}var aK,cK,lK,uK,fK,hK,xO=p(()=>{aK=.3333333333333333,cK=.17222222222222222,lK=.10257936507936508,uK=.06388888888888888,fK=.0664021164021164,hK=.016415012942191543});function Gx(e,t){var r=e+e;return e+t[0]*Math.sin(r)+t[1]*Math.sin(r+r)+t[2]*Math.sin(r+r+r)}var _O=p(()=>{});function dK(e){e.long0=e.long0!==void 0?e.long0:0,e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.es!==0&&(e.apa=Fx(e.es),e.qp=un(e.e,1),e.rqda=Math.sqrt(.5*e.qp))}function SO(e,t){var r=k(t.x-e.long0,e.over),n=t.y,i=Math.sin(n);e.es!==0&&(i=un(e.e,i)/e.qp);var o=Math.asin(l1*i),s=o*o,a=s*s*s;return t.x=r*Math.cos(o)/(l1*(Gu+3*ku*s+a*(7*Uu+9*ju*s))),t.y=o*(Gu+ku*s+a*(Uu+ju*s)),e.es!==0&&(t.x*=e.rqda,t.y*=e.rqda),t.x=e.a*t.x+e.x0,t.y=e.a*t.y+e.y0,t}function MO(e,t){t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,e.es!==0&&(t.x/=e.rqda,t.y/=e.rqda);let r=Math.PI/3,n=r*r,i=r*(Gu+ku*n+n**3*(Uu+ju*n));if(Math.abs(t.y)>i+8*Number.EPSILON*i)return null;var o=1e-9,s=12,a=t.y,c,l,u,h,d,m;for(m=0;m<s&&(c=a*a,l=c*c*c,u=a*(Gu+ku*c+l*(Uu+ju*c))-t.y,h=Gu+3*ku*c+l*(7*Uu+9*ju*c),a-=d=u/h,!(Math.abs(d)<o));++m);c=a*a,l=c*c*c,t.x=l1*t.x*(Gu+3*ku*c+l*(7*Uu+9*ju*c))/Math.cos(a);let g=Math.sin(a)/l1,y=8*Number.EPSILON;return Math.abs(g)>1+y?null:(t.y=Math.abs(g)>=1-y?Math.sign(g)*Math.PI/2:Math.asin(g),e.es!==0&&(t.y=Gx(t.y,e.apa)),t.x=k(t.x+e.long0,e.over),t)}function vO(e,t={}){let r={...e,apa:[],qp:0,rqda:0,...t};return dK(r),r}var Gu,ku,Uu,ju,l1,EO=p(()=>{xt();Hh();xO();_O();Gu=1.340264,ku=-.081106,Uu=893e-6,ju=.003796,l1=Math.sqrt(3)/2});var kx,AO=p(()=>{qt();kt();EO();Je();lt();Ot();kx={name:"eqearth",aliases:["Equal Earth","Equal_Earth"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=e.primeMeridian??0,n=vO(t),i=Ie("eqearth",e,n,SO,MO),o=Math.sqrt(e.eccentricitySquared),s=e.semiMajorAxis*(o?Math.sqrt((1+(1-o*o)*Math.atanh(o)/o)/2):1),a=Math.PI/3,c=a*a,l=c**3,u=s*Math.PI/(Math.sqrt(3)/2*1.340264),h=re(e.parameters,"x_0",0),d=re(e.parameters,"y_0",0),m=s*a*(1.340264-.081106*c+l*(893e-6+.003796*c));return{...i,longitudeOrigin:t.long0,getRenderingProfile(g){if(g)return cr(b=>Br(i.forward,b,t.long0,t.over),g,t.long0,r,t.over);let y=[[h-u,d-m,0],[h+u,d+m,0]];return{bounds:y,normalize:cr(()=>y,Nn(Q(t.long0-Math.PI,-(Math.PI/2),t.long0+Math.PI,Math.PI/2),r),t.long0,r,t.over).normalize}}}}}});function mK(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0}function TO(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over),o=e.x0+e.a*i*Math.cos(e.lat0),s=e.y0+e.a*n;return e.t1=o,e.t2=Math.cos(e.lat0),t.x=o,t.y=s,t}function IO(e,t){t.x-=e.x0,t.y-=e.y0;var r=t.y/e.a;Math.abs(r)>Math.PI/2&&Math.abs(r)<=Math.PI/2+8*Number.EPSILON&&(r=Math.sign(r)*Math.PI/2);var n=k(e.long0+t.x/(e.a*Math.cos(e.lat0)),e.over);return t.x=n,t.y=r,t}function PO(e,t={}){let r={...e,t2:0,t1:0,...t};return mK(r),r}var RO=p(()=>{xt()});var Ux,LO=p(()=>{Ot();Je();lt();kt();RO();Ux={name:"equi",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Te(e);if(Math.abs(t.lat0)>=Math.PI/2)throw new Error("Equirectangular standard parallel must be away from the poles");let r=PO(t),n=Ie("equi",e,r,TO,IO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function OO(e,t,r=!1){let n=1+t/e.a,i=n/(1+1e-10),o=h=>Math.acos(Math.min(1,Math.sqrt(1-e.es*Math.sin(h)**2)/(i*Math.cos(h)))),s=h=>{let d=(i*Math.cos(h))**2;return Math.asin(Math.sqrt(Math.max(0,(d-1)/(d-e.es))))},a=t*Math.asin(1/n),c=t*Math.atan(Math.sqrt((1-e.es)/(n*n-1))),l=(h,d)=>{let m=Math.max(h[0][1],Math.min(h[1][1],0)),g=o(m),y=Math.max(h[0][0]-e.long0,-g),b=Math.min(h[1][0]-e.long0,g),w=s(Math.max(y,Math.min(b,0))),S=Math.max(h[0][1],-w),M=Math.min(h[1][1],w);if(b<y||M<S)return null;let v=Q(y,S,b,M),T=Nn(Q(y+e.long0,S,b+e.long0,M),e.primeMeridian),O=(e.long0+e.primeMeridian)*180/Math.PI,P=Os(_=>{let U=Math.max(y,Math.min(b,Kt(_.x-e.long0))),C=s(U),L=Math.max(Math.max(S,-C),Math.min(Math.min(M,C),_.y));U!==_.x-e.long0&&(_.x=U+e.long0),_.y=L},e.primeMeridian);return{get bounds(){if(!d)return ct([e.x0-a,e.x0+a],[e.y0-c,e.y0+c]);let _=ht([0,0,1],v),U=[1,1/Math.sqrt(1-e.es*Math.max(_[0]**2,_[1]**2))],C=Lt(ht([1,0,0],v),U),L=Lt(ht([0,1,0],v),U),A=Lt(_,[1-e.es,(1-e.es)*U[1]]),W=[n-Math.min(1,C[1]),n-Math.max(1/n,C[0])],G=(E,B,N,D)=>{let R=B[0]<=0&&B[1]>=0?0:Math.min(Math.abs(B[0]),Math.abs(B[1])),I=D?[Math.hypot(W[0],R),Math.hypot(W[1],Math.max(Math.abs(B[0]),Math.abs(B[1])))]:W,j=E.flatMap(we=>I.map(_e=>t*Math.atan(we/_e)));return[Math.max(-N,Math.min(...j)),Math.min(N,Math.max(...j))]};return ct(Ce([e.x0,e.x0],G(L,A,a,r)),Ce([e.y0,e.y0],G(A,L,c,!r)))},normalize(_){Em(_,T,O),P(_)}}},u=Nn(Q(e.long0-o(0),-s(0),e.long0+o(0),s(0)),e.primeMeridian);return h=>{let d=h?Mm(h,u):[u],m=vm(d,g=>l(Ls(g,e.primeMeridian,e.long0),!!h));if(!m)throw new Error("CRS coverage does not intersect the satellite limb");return m}}var BO=p(()=>{Je();sc();lt();qt();fc();Ot()});function pK(e){if(e.flip_axis=e.sweep==="x"?1:0,e.h=Number(e.h),e.radius_g_1=e.h/e.a,e.radius_g_1<=0||e.radius_g_1>1e10)throw new Error;if(e.radius_g=1+e.radius_g_1,e.C=e.radius_g*e.radius_g-1,e.es!==0){var t=1-e.es,r=1/t;e.radius_p=Math.sqrt(t),e.radius_p2=t,e.radius_p_inv2=r,e.shape="ellipse"}else e.radius_p=1,e.radius_p2=1,e.radius_p_inv2=1,e.shape="sphere"}function CO(e,t){var r=t.x,n=t.y,i,o,s,a;if(r=r-e.long0,e.shape==="ellipse"){n=Math.atan(e.radius_p2*Math.tan(n));var c=e.radius_p/Jt(e.radius_p*Math.cos(n),Math.sin(n));if(o=c*Math.cos(r)*Math.cos(n),s=c*Math.sin(r)*Math.cos(n),a=c*Math.sin(n),(e.radius_g-o)*o-s*s-a*a*e.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=e.radius_g-o,e.flip_axis?(t.x=e.radius_g_1*Math.atan(s/Jt(a,i)),t.y=e.radius_g_1*Math.atan(a/i)):(t.x=e.radius_g_1*Math.atan(s/i),t.y=e.radius_g_1*Math.atan(a/Jt(s,i)))}else e.shape==="sphere"&&(i=Math.cos(n),o=Math.cos(r)*i,s=Math.sin(r)*i,a=Math.sin(n),i=e.radius_g-o,e.flip_axis?(t.x=e.radius_g_1*Math.atan(s/Jt(a,i)),t.y=e.radius_g_1*Math.atan(a/i)):(t.x=e.radius_g_1*Math.atan(s/i),t.y=e.radius_g_1*Math.atan(a/Jt(s,i))));return t.x=t.x*e.a,t.y=t.y*e.a,t}function DO(e,t){var r=-1,n=0,i=0,o,s,a,c;if(t.x=t.x/e.a,t.y=t.y/e.a,e.shape==="ellipse"){e.flip_axis?(i=Math.tan(t.y/e.radius_g_1),n=Math.tan(t.x/e.radius_g_1)*Jt(1,i)):(n=Math.tan(t.x/e.radius_g_1),i=Math.tan(t.y/e.radius_g_1)*Jt(1,n));var l=i/e.radius_p;if(o=n*n+l*l+r*r,s=2*e.radius_g*r,a=s*s-4*o*e.C,a<0)return t.x=Number.NaN,t.y=Number.NaN,t;c=(-s-Math.sqrt(a))/(2*o),r=e.radius_g+c*r,n*=c,i*=c,t.x=Math.atan2(n,r),t.y=Math.atan(i*Math.cos(t.x)/r),t.y=Math.atan(e.radius_p_inv2*Math.tan(t.y))}else if(e.shape==="sphere"){if(e.flip_axis?(i=Math.tan(t.y/e.radius_g_1),n=Math.tan(t.x/e.radius_g_1)*Math.sqrt(1+i*i)):(n=Math.tan(t.x/e.radius_g_1),i=Math.tan(t.y/e.radius_g_1)*Math.sqrt(1+n*n)),o=n*n+i*i+r*r,s=2*e.radius_g*r,a=s*s-4*o*e.C,a<0)return t.x=Number.NaN,t.y=Number.NaN,t;c=(-s-Math.sqrt(a))/(2*o),r=e.radius_g+c*r,n*=c,i*=c,t.x=Math.atan2(n,r),t.y=Math.atan(i*Math.cos(t.x)/r)}return t.x=t.x+e.long0,t}function NO(e,t={}){let r={...e,flip_axis:0,sweep:"",h:0,radius_g_1:0,radius_g:0,C:0,radius_p:0,radius_p2:0,radius_p_inv2:0,shape:"",...t};return pK(r),r}var FO=p(()=>{lc()});var jx,GO=p(()=>{BO();kt();FO();qt();jx={name:"geos",aliases:["Geostationary Satellite View","Geostationary_Satellite"],parameters:["lon_0","x_0","y_0","h","sweep"],create(e){let t=Te(e),r=re(e.parameters,"h",NaN);if(!Number.isFinite(r)||r<=0)throw new Error("Geostationary projection requires positive h");let n=e.parameters.sweep||"y";if(!["x","y"].includes(n))throw new Error("Geostationary sweep must be x or y");let i=NO(t,{h:r,sweep:n});return{...Ie("geos",e,i,CO,DO,t.sphere?Va({...t,lat0:0},1/(1+r/t.a),!0):void 0),longitudeOrigin:t.long0,getRenderingProfile:OO(Gt(t,e),r,n==="x")}}}});function kO(e){return{engine:O4({semiMajorAxis:1,semiMinorAxis:Math.sqrt(1-e.es)}),latitude:e.lat0*ol}}function UO(e,t,r){let n=t.engine.Inverse(t.latitude,0,r.y*ol,k(r.x-e.long0,e.over)*ol,Af);if(!(n.M12>0))throw new Error("Coordinate is outside the ellipsoidal gnomonic horizon");let i=e.a*n.m12/n.M12,o=n.azi1/ol;return r.x=e.x0+i*Math.sin(o),r.y=e.y0+i*Math.cos(o),r}function jO(e,t,r){let n=(r.x-e.x0)/e.a,i=(r.y-e.y0)/e.a,o=Math.hypot(n,i);if(o===0)return r.x=e.long0,r.y=e.lat0,r;let s=t.engine.Line(t.latitude,0,Math.atan2(n,i)*ol,Af),a=o<=1,c=a?o:1/o,l=Math.atan(o);for(let u=0;u<20;u++){let h=s.Position(l,Af),d=a?(h.m12-c*h.M12)*h.M12:(c*h.m12-h.M12)*h.m12;if(!Number.isFinite(d))break;if(l-=d,Math.abs(d)<1e-14){let m=s.Position(l,Af);if(!(m.M12>0))break;return r.x=k(e.long0+m.lon2/ol,e.over),r.y=m.lat2/ol,r}}throw new Error("Ellipsoidal gnomonic inverse did not converge")}var ol,zO=p(()=>{B4();xt();ol=180/Math.PI});function gK(e){e.sphere||(e.ellipsoid=kO(e)),e.sin_p14=Math.sin(e.lat0),e.cos_p14=Math.cos(e.lat0),e.infinity_dist=1e3*e.a,e.rc=1}function qO(e,t){if(e.ellipsoid)return UO(e,e.ellipsoid,t);var r,n,i,o,s,a,c,l,u=t.x,h=t.y;return i=k(u-e.long0,e.over),r=Math.sin(h),n=Math.cos(h),o=Math.cos(i),a=e.sin_p14*r+e.cos_p14*n*o,s=1,a>0||Math.abs(a)<=1e-10?(c=e.x0+e.a*s*n*Math.sin(i)/a,l=e.y0+e.a*s*(e.cos_p14*r-e.sin_p14*n*o)/a):(c=e.x0+e.infinity_dist*n*Math.sin(i),l=e.y0+e.infinity_dist*(e.cos_p14*r-e.sin_p14*n*o)),t.x=c,t.y=l,t}function VO(e,t){if(e.ellipsoid)return jO(e,e.ellipsoid,t);var r,n,i,o,s,a;return t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,t.x/=e.k0,t.y/=e.k0,r=Math.sqrt(t.x*t.x+t.y*t.y),r?(o=Math.atan2(r,e.rc),n=Math.sin(o),i=Math.cos(o),a=il(i*e.sin_p14+t.y*n*e.cos_p14/r),s=Math.atan2(t.x*n,r*e.cos_p14*i-t.y*e.sin_p14*n),s=k(e.long0+s,e.over)):(a=e.lat0,s=e.long0),t.x=s,t.y=a,t}function WO(e,t={}){let r={...e,sin_p14:0,cos_p14:0,infinity_dist:0,rc:0,phic0:0,...t};return gK(r),r}var HO=p(()=>{zO();xt();s1()});var zx,$O=p(()=>{Us();js();kt();HO();zx={name:"gnom",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Te(e),r=WO(t);return bn(Ie("gnom",e,r,qO,VO,t.sphere?Va(t):void 0),t,Math.min(Math.PI*80/180,(1-t.es)*Math.PI*.45),(n,i)=>t.sphere?Lm(Gt(t,e),n,i,"gnom"):M8(Gt(t,e),n,i),(1-t.es)*Math.PI/2)}}});function qx(e,t){return 2*Math.atan(e*Math.exp(t))-F}var KO=p(()=>{Bt()});function u1(e,t){var r=qx(1,t),n=0,i=0;let o=0;do{if(++o>50)throw new Error("Isometric latitude inverse did not converge");n=r,i=e*Math.sin(n),r=qx(Math.exp(e*Math.log((1+i)/(1-i))/2),t)}while(Math.abs(r-n)>1e-12);return r}var Vx=p(()=>{KO()});function zu(e,t,r){if(Math.abs(t)>F)return Number.NaN;if(t===F)return Number.POSITIVE_INFINITY;if(t===-1*F)return Number.NEGATIVE_INFINITY;var n=e*r;return Math.log(Math.tan((F+t)/2))+e*Math.log((1-n)/(1+n))/2}var XO=p(()=>{Bt()});function yK(e){e.k0||(e.k0=1);var t=e.b/e.a;e.e=Math.sqrt(1-t*t),e.lc=e.long0,e.rs=Math.sqrt(1+e.e*e.e*Math.pow(Math.cos(e.lat0),4)/(1-e.e*e.e));var r=Math.sin(e.lat0),n=Math.asin(r/e.rs),i=Math.sin(n);e.cp=zu(0,n,i)-e.rs*zu(e.e,e.lat0,r),e.n2=e.k0*e.a*Math.sqrt(1-e.e*e.e)/(1-e.e*e.e*r*r),e.xs=e.x0,e.ys=e.y0-e.n2*n}function YO(e,t){var r=t.x,n=t.y,i=e.rs*(r-e.lc),o=e.cp+e.rs*zu(e.e,n,Math.sin(n)),s=Math.asin(Math.sin(i)/Pf(o)),a=zu(0,s,Math.sin(s));return t.x=e.xs+e.n2*a,t.y=e.ys+e.n2*Math.atan(cc(o)/Math.cos(i)),t}function ZO(e,t){var r=t.x,n=t.y,i=Math.atan(cc((r-e.xs)/e.n2)/Math.cos((n-e.ys)/e.n2)),o=Math.asin(Math.sin((n-e.ys)/e.n2)/Pf((r-e.xs)/e.n2)),s=zu(0,o,Math.sin(o));return t.x=e.lc+i/e.rs,t.y=u1(e.e,(s-e.cp)/e.rs),t}function JO(e,t={}){let r={...e,lc:0,rs:0,cp:0,n2:0,xs:0,ys:0,...t};return yK(r),r}var QO=p(()=>{XO();Tm();Iy();Vx()});var Wx,eB=p(()=>{Ot();Vx();Je();lt();kt();QO();Wx={name:"gstmerc",aliases:["gstmerg"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Te(e),r=JO(t),n=Ie("gstmerc",e,r,YO,ZO);return De(n,Q(t.long0-Math.PI/6,-Math.PI/3,t.long0+Math.PI/6,Math.PI/3),i=>zl(n.forward,i,t.long0,t.over,u1(r.e,-r.cp/r.rs)),t.primeMeridian,t.over)}}});function bK(e){e.a=6377397155e-3,e.es=.006674372230614,e.e=Math.sqrt(e.es),e.s45=Math.PI/4,e.s90=2*e.s45,e.fi0=e.lat0,e.e2=e.es,e.e=Math.sqrt(e.e2),e.alfa=Math.sqrt(1+e.e2*Math.pow(Math.cos(e.fi0),4)/(1-e.e2)),e.uq=1.04216856380474,e.u0=Math.asin(Math.sin(e.fi0)/e.alfa),e.g=Math.pow((1+e.e*Math.sin(e.fi0))/(1-e.e*Math.sin(e.fi0)),e.alfa*e.e/2),e.k=Math.tan(e.u0/2+e.s45)/Math.pow(Math.tan(e.fi0/2+e.s45),e.alfa)*e.g,e.k1=e.k0,e.n0=e.a*Math.sqrt(1-e.e2)/(1-e.e2*Math.pow(Math.sin(e.fi0),2)),e.s0=1.37008346281555,e.n=Math.sin(e.s0),e.ro0=e.k1*e.n0/Math.tan(e.s0),e.ad=e.s90-e.uq}function tB(e,t){var r,n,i,o,s,a,c,l=t.x,u=t.y,h=k(l-e.long0,e.over);return r=Math.pow((1+e.e*Math.sin(u))/(1-e.e*Math.sin(u)),e.alfa*e.e/2),n=2*(Math.atan(e.k*Math.pow(Math.tan(u/2+e.s45),e.alfa)/r)-e.s45),i=-h*e.alfa,o=Math.asin(Math.cos(e.ad)*Math.sin(n)+Math.sin(e.ad)*Math.cos(n)*Math.cos(i)),s=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(o)),a=e.n*s,c=e.ro0*Math.pow(Math.tan(e.s0/2+e.s45),e.n)/Math.pow(Math.tan(o/2+e.s45),e.n),t.y=c*Math.cos(a)/1,t.x=c*Math.sin(a)/1,e.czech||(t.y*=-1,t.x*=-1),t}function rB(e,t){var r,n,i,o,s,a,c,l,u=t.x;t.x=t.y,t.y=u,e.czech||(t.y*=-1,t.x*=-1),a=Math.sqrt(t.x*t.x+t.y*t.y),s=Math.atan2(t.y,t.x),o=s/Math.sin(e.s0),i=2*(Math.atan(Math.pow(e.ro0/a,1/e.n)*Math.tan(e.s0/2+e.s45))-e.s45),r=Math.asin(Math.cos(e.ad)*Math.sin(i)-Math.sin(e.ad)*Math.cos(i)*Math.cos(o)),n=Math.asin(Math.cos(i)*Math.sin(o)/Math.cos(r)),t.x=e.long0-n/e.alfa,c=r,l=0;var h=0;do t.y=2*(Math.atan(Math.pow(e.k,-1/e.alfa)*Math.pow(Math.tan(r/2+e.s45),1/e.alfa)*Math.pow((1+e.e*Math.sin(c))/(1-e.e*Math.sin(c)),e.e/2))-e.s45),Math.abs(c-t.y)<1e-10&&(l=1),c=t.y,h+=1;while(l===0&&h<15);return h>=15?null:t}function nB(e,t={}){let r={...e,s45:0,s90:0,fi0:0,e2:0,alfa:0,uq:0,u0:0,g:0,k:0,k1:0,n0:0,s0:0,n:0,ro0:0,ad:0,czech:!1,...t};return bK(r),r}var iB=p(()=>{xt()});var Hx,oB=p(()=>{qa();Je();lt();kt();iB();qt();Fn();Hx={name:"krovak",aliases:["Krovak","Krovak Modified","Krovak (North Orientated)","Krovak Modified (North Orientated)"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0","czech","alpha","lat_ts"],flags:["czech"],create(e){let t=re(e.parameters,"alpha",30.28813972222222),r=re(e.parameters,"lat_ts",78.5);if(![30.28813972222222,30.28813975277778].some(s=>Math.abs(t-s)<=1e-10))throw new Error("Krovak requires its fixed cone-axis co-latitude");if(Math.abs(r-78.5)>1e-10)throw new Error("Krovak requires its fixed 78.5 degree pseudo standard parallel");let n=Te(e);n.lat0=Cs(e.parameters,"lat_0",49.5),n.long0=Cs(e.parameters,"lon_0",24.83333333333333),n.k0=re(e.parameters,"k_0",re(e.parameters,"k",.9999));let i=nB(n,{czech:Ri(e.parameters,"czech")}),o=Ie("krovak",e,i,tB,rB);return De(o,Q(n.long0-Math.PI/12,Math.max(-Math.PI/2+1e-8,n.lat0-Math.PI/36),n.long0+Math.PI/12,Math.min(Math.PI/2-1e-8,n.lat0+Math.PI/36)),s=>JL(Gt(i,e),s),n.primeMeridian,n.over)}}});function sB(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over),o=e.x0+e.a*i,s=e.y0+e.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return t.x=o,t.y=s,t}function aB(e,t){t.x-=e.x0,t.y-=e.y0;var r=k(e.long0+t.x/e.a,e.over),n=2.5*(Math.atan(Math.exp(.8*t.y/e.a))-Math.PI/4);return t.x=r,t.y=n,t}function cB(e,t={}){let r={...e,...t};return r}var lB=p(()=>{xt()});var $x,uB=p(()=>{Ot();Je();lt();kt();lB();$x={name:"mill",aliases:["Miller_Cylindrical"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=cB(t),n=Ie("mill",e,r,sB,aB);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function wK(e){e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.long0=e.long0!==void 0?e.long0:0}function fB(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over);let o=Math.sin(Math.abs(n)),s=Math.cos(n),a=Math.abs(n)===Math.PI/2?0:Math.PI*s*s/(1+o),c=Math.cbrt(6*a),l=0,u=Math.PI;c=Math.min(c,u);for(let m=0;m<32&&c>0;m++){let g=mB(c)-a,y=g/(2*Math.sin(c/2)**2);if(Math.abs(y)<=16*Number.EPSILON*c)break;g>0?u=c:l=c;let b=c-y;if(b===c||u-l<=8*Number.EPSILON*Math.max(1,c))break;if(c=b>=l&&b<=u?b:(l+u)/2,m===31)throw new Error("Mollweide forward did not converge")}var h=2*Math.SQRT2/Math.PI*e.a*i*Math.sin(c/2)+e.x0,d=Math.sign(n)*Math.SQRT2*e.a*Math.cos(c/2)+e.y0;return t.x=h,t.y=d,t}function hB(e,t){let r=t.x-e.x0,n=(t.y-e.y0)/(Math.SQRT2*e.a);if(Math.abs(n)>1+8*Number.EPSILON)return null;let i=r/(2*Math.SQRT2*e.a),o=i*i+n*n;if(!e.over&&o>1+8*Number.EPSILON)return null;let s=2*Math.acos(Math.min(1,Math.abs(n))),a=Math.sin(s/2);if(!e.over&&Math.abs(o-1)<=8*Number.EPSILON&&(a=Math.min(1,Math.abs(i)),s=2*Math.asin(a)),a===0&&Math.abs(r)>8*Number.EPSILON*e.a)return null;let c=a===0?0:Math.PI*i/a;var l=k(e.long0+c,e.over),u=Math.sign(n)*(Math.PI/2-2*Math.asin(Math.sqrt(mB(s)/(2*Math.PI))));return t.x=l,t.y=u,t}function dB(e,t={}){let r={...e,...t};return wK(r),r}function mB(e){if(e>.5)return e-Math.sin(e);let t=e*e;return e*t*(1/6+t*(-1/120+t*(1/5040+t*(-1/362880+t*(1/39916800+t*(-1/6227020800+t/1307674368e3))))))}var pB=p(()=>{xt()});var Kx,gB=p(()=>{Ot();Je();lt();kt();pB();Kx={name:"moll",aliases:["Mollweide"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=dB(t),n=Ie("moll",e,r,fB,hB);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function xK(e){e.A=[],e.A[1]=.6399175073,e.A[2]=-.1358797613,e.A[3]=.063294409,e.A[4]=-.02526853,e.A[5]=.0117879,e.A[6]=-.0055161,e.A[7]=.0026906,e.A[8]=-.001333,e.A[9]=67e-5,e.A[10]=-34e-5,e.B_re=[],e.B_im=[],e.B_re[1]=.7557853228,e.B_im[1]=0,e.B_re[2]=.249204646,e.B_im[2]=.003371507,e.B_re[3]=-.001541739,e.B_im[3]=.04105856,e.B_re[4]=-.10162907,e.B_im[4]=.01727609,e.B_re[5]=-.26623489,e.B_im[5]=-.36249218,e.B_re[6]=-.6870983,e.B_im[6]=-1.1651967,e.C_re=[],e.C_im=[],e.C_re[1]=1.3231270439,e.C_im[1]=0,e.C_re[2]=-.577245789,e.C_im[2]=-.007809598,e.C_re[3]=.508307513,e.C_im[3]=-.112208952,e.C_re[4]=-.15094762,e.C_im[4]=.18200602,e.C_re[5]=1.01418179,e.C_im[5]=1.64497696,e.C_re[6]=1.9660549,e.C_im[6]=2.5127645,e.D=[],e.D[1]=1.5627014243,e.D[2]=.5185406398,e.D[3]=-.03333098,e.D[4]=-.1052906,e.D[5]=-.0368594,e.D[6]=.007317,e.D[7]=.0122,e.D[8]=.00394,e.D[9]=-.0013}function yB(e,t){var r,n=t.x,i=t.y,o=i-e.lat0,s=n-e.long0,a=o/Rf*1e-5,c=s,l=1,u=0;for(r=1;r<=10;r++)l=l*a,u=u+e.A[r]*l;var h=u,d=c,m=1,g=0,y,b,w=0,S=0;for(r=1;r<=6;r++)y=m*h-g*d,b=g*h+m*d,m=y,g=b,w=w+e.B_re[r]*m-e.B_im[r]*g,S=S+e.B_im[r]*m+e.B_re[r]*g;return t.x=S*e.a+e.x0,t.y=w*e.a+e.y0,t}function bB(e,t){var r,n=t.x,i=t.y,o=n-e.x0,s=i-e.y0,a=s/e.a,c=o/e.a,l=1,u=0,h,d,m=0,g=0;for(r=1;r<=6;r++)h=l*a-u*c,d=u*a+l*c,l=h,u=d,m=m+e.C_re[r]*l-e.C_im[r]*u,g=g+e.C_im[r]*l+e.C_re[r]*u;for(var y=0;y<e.iterations;y++){var b=m,w=g,S,M,v=a,T=c;for(r=2;r<=6;r++)S=b*m-w*g,M=w*m+b*g,b=S,w=M,v=v+(r-1)*(e.B_re[r]*b-e.B_im[r]*w),T=T+(r-1)*(e.B_im[r]*b+e.B_re[r]*w);b=1,w=0;var O=e.B_re[1],P=e.B_im[1];for(r=2;r<=6;r++)S=b*m-w*g,M=w*m+b*g,b=S,w=M,O=O+r*(e.B_re[r]*b-e.B_im[r]*w),P=P+r*(e.B_im[r]*b+e.B_re[r]*w);var _=O*O+P*P;m=(v*O+T*P)/_,g=(T*O-v*P)/_}var U=m,C=g,L=1,A=0;for(r=1;r<=9;r++)L=L*U,A=A+e.D[r]*L;var W=e.lat0+A*Rf*1e5,G=e.long0+C;return t.x=G,t.y=W,t}function wB(e,t={}){let r={...e,A:[],B_re:[],B_im:[],C_re:[],C_im:[],D:[],iterations:1,...t};return xK(r),r}var xB=p(()=>{Bt()});var Xx,_B=p(()=>{qa();Je();lt();kt();xB();qt();Xx={name:"nzmg",aliases:["New_Zealand_Map_Grid"],parameters:["lon_0","x_0","y_0","lat_0","iterations"],create(e){let t=Te(e),r=re(e.parameters,"iterations",1);if(!Number.isInteger(r)||r<0||r>10)throw new Error("NZMG iterations must be an integer from 0 to 10");if(!Object.prototype.hasOwnProperty.call(e.parameters,"lat_0")||!Object.prototype.hasOwnProperty.call(e.parameters,"lon_0"))throw new Error("NZMG requires lat_0 and lon_0");let n=wB(t,{iterations:r}),i=Ie("nzmg",e,n,yB,bB);return De(i,Q(t.long0-Math.PI/22.5,Math.max(-Math.PI/2,t.lat0-Math.PI/22.5),t.long0+Math.PI/22.5,Math.min(Math.PI/2,t.lat0+Math.PI/22.5)),o=>QL(Gt(n,e),o),t.primeMeridian,t.over)}}});function _K(e){return e.no_uoff||e.no_off||["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(e.projName.toLowerCase().replace(/[ _-]/g,""))}function SK(e){var t,r,n,i,o,s,a,c,l,u,h=0,d,m=0,g=0,y=0,b=0,w=0,S=0;e.k0||(e.k0=1),e.no_off=_K(e),e.no_rot=e.no_rot;var M=!1;Number.isFinite(e.alpha)&&(M=!0);var v=!1;if(Number.isFinite(e.rectified_grid_angle)&&(v=!0),M&&(S=e.alpha),v&&(h=e.rectified_grid_angle,M||(S=0,M=!0)),M||v)m=e.longc;else if(g=e.long1,b=e.lat1,y=e.long2,w=e.lat2,Math.abs(b-w)<=qu||Math.abs(b)<=qu||Math.abs(Math.abs(b)-F)<=qu||Math.abs(Math.abs(e.lat0)-F)<=qu||Math.abs(Math.abs(w)-F)<=qu)throw new Error;var T=1-e.es;if(r=Math.sqrt(T),Math.abs(e.lat0)>1e-10?(c=Math.sin(e.lat0),n=Math.cos(e.lat0),t=1-e.es*c*c,e.B=n*n,e.B=Math.sqrt(1+e.es*e.B*e.B/T),e.A=e.B*e.k0*r/t,i=e.B*r/(n*Math.sqrt(t)),o=i*i-1,o<=0?o=0:(o=Math.sqrt(o),e.lat0<0&&(o=-o)),e.E=o+=i,e.E*=Math.pow(Jr(e.e,e.lat0,c),e.B)):(e.B=1/r,e.A=e.k0,e.E=i=o=1),M||v){M?(d=Math.asin(Math.sin(S)/i),v||(h=S)):(d=h,S=Math.asin(i*Math.sin(d)));let O=.5*(o-1/o)*Math.tan(d);i>1&&Math.abs(Math.cos(S))<=8*Number.EPSILON?O=Math.sign(e.lat0)*Math.sign(Math.sin(S)):Math.abs(O)>1&&Math.abs(O)<=1+8*Number.EPSILON&&(O=Math.sign(O)),e.lam0=m-Math.asin(O)/e.B}else s=Math.pow(Jr(e.e,b,Math.sin(b)),e.B),a=Math.pow(Jr(e.e,w,Math.sin(w)),e.B),o=e.E/s,l=(a-s)/(a+s),u=e.E*e.E,u=(u-a*s)/(u+a*s),t=g-y,t<-Math.PI?y-=Ns:t>Math.PI&&(y+=Ns),e.lam0=k(.5*(g+y)-Math.atan(u*Math.tan(.5*e.B*(g-y))/l)/e.B,e.over),d=Math.atan(2*Math.sin(e.B*k(g-e.lam0,e.over))/(o-1/o)),h=S=Math.asin(i*Math.sin(d));e.singam=Math.sin(d),e.cosgam=Math.cos(d),e.sinrot=Math.sin(h),e.cosrot=Math.cos(h),e.rB=1/e.B,e.ArB=e.A*e.rB,e.BrA=1/e.ArB,e.no_off?e.u_0=0:(e.u_0=Math.abs(e.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(S))),e.lat0<0&&(e.u_0=-e.u_0)),o=.5*d,e.v_pole_n=e.ArB*Math.log(Math.tan(Qe-o)),e.v_pole_s=e.ArB*Math.log(Math.tan(Qe+o))}function SB(e,t){var r=t,n,i,o,s,a,c,l,u;if(t.x=t.x-e.lam0,Math.abs(Math.abs(t.y)-F)>1e-10){if(a=e.E/Math.pow(Jr(e.e,t.y,Math.sin(t.y)),e.B),c=1/a,n=.5*(a-c),i=.5*(a+c),s=Math.sin(e.B*t.x),o=(n*e.singam-s*e.cosgam)/i,Math.abs(Math.abs(o)-1)<1e-10)throw new Error;u=.5*e.ArB*Math.log((1-o)/(1+o)),c=Math.cos(e.B*t.x),Math.abs(c)<qu?l=e.A*t.x:l=e.ArB*Math.atan2(n*e.cosgam+s*e.singam,c)}else u=t.y>0?e.v_pole_n:e.v_pole_s,l=e.ArB*t.y;return e.no_rot?(r.x=l,r.y=u):(l-=e.u_0,r.x=u*e.cosrot+l*e.sinrot,r.y=l*e.cosrot-u*e.sinrot),r.x=e.a*r.x+e.x0,r.y=e.a*r.y+e.y0,r}function MB(e,t){var r,n,i,o,s,a,c,l=t;if(t.x=(t.x-e.x0)*(1/e.a),t.y=(t.y-e.y0)*(1/e.a),e.no_rot?(n=t.y,r=t.x):(n=t.x*e.cosrot-t.y*e.sinrot,r=t.y*e.cosrot+t.x*e.sinrot+e.u_0),i=Math.exp(-e.BrA*n),o=.5*(i-1/i),s=.5*(i+1/i),a=Math.sin(e.BrA*r),c=(a*e.cosgam+o*e.singam)/s,Math.abs(Math.abs(c)-1)<1e-10)l.x=0,l.y=c<0?-F:F;else{if(l.y=e.E/Math.sqrt((1+c)/(1-c)),l.y=hc(e.e,Math.pow(l.y,1/e.B)),l.y===1/0)throw new Error;l.x=-e.rB*Math.atan2(o*e.cosgam-a*e.singam,Math.cos(e.BrA*r))}return l.x+=e.lam0,l}function vB(e,t={}){let r={...e,no_off:!1,no_rot:!1,alpha:NaN,rectified_grid_angle:NaN,longc:0,long1:0,long2:0,B:0,A:0,E:0,lam0:0,singam:0,cosgam:0,sinrot:0,cosrot:0,rB:0,ArB:0,BrA:0,u_0:0,v_pole_n:0,v_pole_s:0,no_uoff:!1,projName:"",...t};return SK(r),r}var qu,EB=p(()=>{Bf();xt();Bm();Bt();qu=1e-7});var Yx,AB=p(()=>{qa();Je();lt();kt();EB();qt();Fn();Yx={name:"omerc",aliases:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0","alpha","gamma","lonc","lon_1","lon_2","lat_1","lat_2","no_off","no_uoff","no_rot"],flags:["no_off","no_uoff","no_rot"],create(e){let t=Te(e);if(Math.abs(t.lat0)>=Math.PI/2)throw new Error("Oblique Mercator origin must be away from the poles");let n=Object.prototype.hasOwnProperty.call(e.parameters,"alpha")||Object.prototype.hasOwnProperty.call(e.parameters,"gamma")?["lonc"]:["lon_1","lat_1","lon_2","lat_2"];for(let s of n)if(!Object.prototype.hasOwnProperty.call(e.parameters,s))throw new Error("Oblique Mercator requires "+s);let i=vB(t,{projName:e.parameters.proj||"omerc",alpha:re(e.parameters,"alpha",NaN)*Math.PI/180,rectified_grid_angle:re(e.parameters,"gamma",NaN)*Math.PI/180,longc:re(e.parameters,"lonc",0)*Math.PI/180,long1:re(e.parameters,"lon_1",0)*Math.PI/180,long2:re(e.parameters,"lon_2",0)*Math.PI/180,no_off:Ri(e.parameters,"no_off"),no_uoff:Ri(e.parameters,"no_uoff"),no_rot:Ri(e.parameters,"no_rot")}),o=Ie("omerc",e,i,SB,MB);return De(o,Q(i.lam0-Math.PI/18,Math.max(-Math.PI/2+1e-8,t.lat0-Math.PI/18),i.lam0+Math.PI/18,Math.min(Math.PI/2-1e-8,t.lat0+Math.PI/18)),s=>ZL(Gt(i,e),s),t.primeMeridian,t.over)}}});function TB(e){let t=Math.sin(e.lat0),r=Math.cos(e.lat0),n=1/Math.sqrt(1-e.es*t*t);return{...e,sin0:t,cos0:r,originY:-e.es*n*t*r}}function IB(e,t){let r=k(t.x-e.long0,e.over),n=Math.sin(t.y),i=Math.cos(t.y),o=1/Math.sqrt(1-e.es*n*n);return t.x=e.x0+e.a*e.k0*o*i*Math.sin(r),t.y=e.y0+e.a*e.k0*(o*((1-e.es)*n*e.cos0-i*Math.cos(r)*e.sin0)-e.originY),t}function PB(e,t){let r=(t.x-e.x0)/(e.a*e.k0),n=(t.y-e.y0)/(e.a*e.k0)+e.originY,i=1-e.es,o=e.cos0*e.cos0+e.sin0*e.sin0/i,s=n*e.sin0*e.cos0*e.es/i,a=r*r+n*n*(e.sin0*e.sin0+e.cos0*e.cos0/i)-1,c=s*s-o*a;if(c<-32*Number.EPSILON*o)throw new Error("Coordinate is outside the orthographic ellipse");let l=(-s+Math.sqrt(Math.max(0,c)))/o,u=l*e.cos0-n*e.sin0,h=l*e.sin0+n*e.cos0;return t.x=k(e.long0+Math.atan2(r,u),e.over),t.y=Math.atan2(h,i*Math.hypot(u,r)),t}var RB=p(()=>{xt()});var Zx,LB=p(()=>{Us();js();kt();RB();Zx={name:"ortho",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Te(e),r=TB(t);return bn(Ie("ortho",e,r,IB,PB,Va(t,0,!0)),t,Math.PI/2,(n,i)=>w8(Gt(t,e),n,i),Math.PI/2)}}});function MK(e){e.meridianPole=si(e.a,e.es,0,Math.PI/2),e.poleRadius=e.a/Math.sqrt(1-e.es),e.ml0=si(e.a,e.es,0,e.lat0)}function CB(e,t){var r=t.x,n=t.y,i,o,s,a=k(r-e.long0,e.over);if(s=a*Math.sin(n),e.sphere)n===0?(i=e.a*a,o=-1*e.a*e.lat0):(i=e.a*Math.sin(s)/Math.tan(n),o=e.a*(n-e.lat0+2*Math.sin(s/2)**2/Math.tan(n)));else if(n===0)i=e.a*a,o=-1*e.ml0;else{var c=Fu(e.a,e.e,Math.sin(n))/Math.tan(n);i=c*Math.sin(s),o=si(e.a,e.es,e.lat0,n)+c*(2*Math.sin(s/2)**2)}return t.x=i+e.x0,t.y=o+e.y0,t}function DB(e,t){var r,n,i,o,s,a,c,l,u;i=t.x-e.x0,o=t.y-e.y0;let h=o+(e.sphere?e.a*e.lat0:e.ml0),d=h<0?-1:1,g=(e.sphere?e.a*Math.PI/2:e.meridianPole)-d*h,y=Math.hypot(i,g);if(y/e.a<1e-6)return t.x=k(e.long0+Math.atan2(i,g),e.over),t.y=d*(Math.PI/2-y/e.poleRadius),t;if(e.sphere)if(Math.abs(o+e.a*e.lat0)<=1e-10)r=k(i/e.a+e.long0,e.over),n=0;else{a=e.lat0+o/e.a,c=i*i/e.a/e.a+a*a,l=a;var b;for(s=OB;s;--s)if(b=Math.tan(l),u=-1*(a*(l*b+1)-l-.5*(l*l+c)*b)/((l-a)/b-1),l+=u,Math.abs(u)<=1e-14){n=l;break}if(n=BB(e,n===void 0?l:n,i,o),n===void 0)return null;l=n,r=k(e.long0+Math.asin(i*Math.tan(l)/e.a)/Math.sin(n),e.over)}else if(Math.abs(o+e.ml0)<=1e-10)n=0,r=k(e.long0+i/e.a,e.over);else{a=(e.ml0+o)/e.a,c=i*i/e.a/e.a+a*a,l=a;var w,S,M,v,T;for(s=OB;s;--s)if(T=e.e*Math.sin(l),w=Math.sqrt(1-T*T)*Math.tan(l),S=si(e.a,e.es,0,l),M=(1-e.es)/Math.pow(1-T*T,1.5),v=S/e.a,u=(a*(w*v+1)-v-.5*w*(v*v+c))/(e.es*Math.sin(2*l)*(v*v+c-2*a*v)/(4*w)+(a-v)*(w*M-2/Math.sin(2*l))-M),l-=u,Math.abs(u)<=1e-14){n=l;break}if(n=BB(e,n===void 0?l:n,i,o),n===void 0)return null;l=n,w=Math.sqrt(1-e.es*Math.pow(Math.sin(n),2))*Math.tan(n),r=k(e.long0+Math.asin(i*w/e.a)/Math.sin(n),e.over)}return t.x=r,t.y=n,t}function NB(e,t={}){let r={...e,ml0:0,meridianPole:0,poleRadius:0,...t};return MK(r),r}function BB(e,t,r,n){for(let i=0;i<8;i++){if(!Number.isFinite(t)||Math.abs(t)>=Math.PI/2)return;let o=Math.sin(t),s=Math.cos(t),a=1-e.es*o*o,c=e.sphere?e.a:Fu(e.a,e.e,o),l=c/Math.tan(t),u=Math.asin(r/l),h=l*Math.sin(u),d=2*Math.sin(u/2)**2,m=e.sphere?e.a*(t-e.lat0):si(e.a,e.es,e.lat0,t),g=l*d,b=m+g-n;if(Math.abs(h-r)<=64*Number.EPSILON*Math.max(e.a,Math.abs(r))&&Math.abs(b)<=64*Number.EPSILON*Math.max(Math.abs(n),Math.abs(m),Math.abs(g),e.a*Math.max(Math.abs(t),Math.abs(e.lat0))))return t;let w=e.sphere?e.a:e.a*(1-e.es)/Math.pow(a,1.5),S=c*((e.sphere?0:e.es*s*s/a)-1/(o*o)),M=w+S*(-d/Math.cos(u)),v=b/M;if(!Number.isFinite(v)||Math.abs(v)>1e-6)return;t-=v}}var OB,FB=p(()=>{xt();Rx();Ex();OB=20});var Jx,GB=p(()=>{qa();Je();lt();kt();FB();Jx={name:"poly",aliases:["Polyconic","American_Polyconic"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Te(e),r=NB(t),n=Ie("poly",e,r,CB,DB);return De(n,Q(t.long0-Math.PI/6,Math.max(-Math.PI/2+1e-8,t.lat0-Math.PI/2+1e-8),t.long0+Math.PI/6,Math.min(Math.PI/2-1e-8,t.lat0+Math.PI/2-1e-8)),i=>KL(Gt(t,e),n.forward,i),t.primeMeridian,t.over)}}});function vK(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0,e.lat_ts=e.lat_ts||0,e.lat0>=F-Qe/2?e.face=Ut.TOP:e.lat0<=-(F-Qe/2)?e.face=Ut.BOTTOM:Math.abs(e.long0)<=Qe?e.face=Ut.FRONT:Math.abs(e.long0)<=F+Qe?e.face=e.long0>0?Ut.RIGHT:Ut.LEFT:e.face=Ut.BACK,e.es!==0&&(e.one_minus_f=1-(e.a-e.b)/e.a,e.one_minus_f_squared=e.one_minus_f*e.one_minus_f)}function kB(e,t){var r=t,n,i,o,s,a,c,l=0;if(t.x-=e.long0,e.es!==0?n=Math.atan(e.one_minus_f_squared*Math.tan(t.y)):n=t.y,i=t.x,e.face===Ut.TOP)s=F-n,i>=Qe&&i<=F+Qe?(l=dt.AREA_0,o=i-F):i>F+Qe||i<=-(F+Qe)?(l=dt.AREA_1,o=i>0?i-Math.PI:i+Math.PI):i>-(F+Qe)&&i<=-Qe?(l=dt.AREA_2,o=i+F):(l=dt.AREA_3,o=i);else if(e.face===Ut.BOTTOM)s=F+n,i>=Qe&&i<=F+Qe?(l=dt.AREA_0,o=-i+F):i<Qe&&i>=-Qe?(l=dt.AREA_1,o=-i):i<-Qe&&i>=-(F+Qe)?(l=dt.AREA_2,o=-i-F):(l=dt.AREA_3,o=i>0?-i+Math.PI:-i-Math.PI);else{var u,h,d,m,g,y,b;e.face===Ut.RIGHT?i=Vu(i,+F):e.face===Ut.BACK?i=Vu(i,+Math.PI):e.face===Ut.LEFT&&(i=Vu(i,-F)),m=Math.sin(n),g=Math.cos(n),y=Math.sin(i),b=Math.cos(i),u=g*b,h=g*y,d=m,e.face===Ut.FRONT?(s=Math.atan2(Math.hypot(h,d),u),o=f1(s,d,h)):e.face===Ut.RIGHT?(s=Math.atan2(Math.hypot(u,d),h),o=f1(s,d,-u)):e.face===Ut.BACK?(s=Math.atan2(Math.hypot(h,d),-u),o=f1(s,d,-h)):e.face===Ut.LEFT?(s=Math.atan2(Math.hypot(u,d),-h),o=f1(s,d,u)):s=o=0,Math.abs(o)<=Qe?l=dt.AREA_0:o>Qe&&o<=F+Qe?(l=dt.AREA_1,o-=F):o>F+Qe||o<=-(F+Qe)?(l=dt.AREA_2,o=o>=0?o-Math.PI:o+Math.PI):(l=dt.AREA_3,o+=F)}return c=Math.atan(12/Math.PI*(o+Math.acos(Math.sin(o)*Math.cos(Qe))-F)),a=Math.sqrt(2*Math.sin(s/2)**2/(Math.cos(c)*Math.cos(c))/(1-Math.cos(Math.atan(1/Math.cos(o))))),l===dt.AREA_1?c+=F:l===dt.AREA_2?c+=Math.PI:l===dt.AREA_3&&(c+=1.5*Math.PI),r.x=a*Math.cos(c),r.y=a*Math.sin(c),r.x=r.x*e.a+e.x0,r.y=r.y*e.a+e.y0,t}function UB(e,t){var r=0,n=0,i,o,s,a,c,l,u,h,d=0;t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d=dt.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(d=dt.AREA_1,i-=F):t.x<0&&-t.x>=Math.abs(t.y)?(d=dt.AREA_2,i=i<0?i+Math.PI:i-Math.PI):(d=dt.AREA_3,i+=F),h=Math.PI/12*Math.tan(i),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),c=Math.atan(a),o=Math.cos(i),s=Math.hypot(t.x,t.y);let m=o*o*s*s*(1-Math.cos(Math.atan(1/Math.cos(c))));if(l=1-m,l<-1?l=-1:l>1&&(l=1),e.face===Ut.TOP)u=2*Math.asin(Math.sqrt(Math.min(1,m/2))),n=F-u,d===dt.AREA_0?r=c+F:d===dt.AREA_1?r=c<0?c+Math.PI:c-Math.PI:d===dt.AREA_2?r=c-F:r=c;else if(e.face===Ut.BOTTOM)u=2*Math.asin(Math.sqrt(Math.min(1,m/2))),n=u-F,d===dt.AREA_0?r=-c+F:d===dt.AREA_1?r=-c:d===dt.AREA_2?r=-c-F:r=c<0?-c-Math.PI:-c+Math.PI;else{var g,y,b;g=l;let w=Math.sqrt(Math.max(0,m*(2-m)));b=w*Math.sin(c),y=w*Math.cos(c),d===dt.AREA_1?(h=y,y=-b,b=h):d===dt.AREA_2?(y=-y,b=-b):d===dt.AREA_3&&(h=y,y=b,b=-h),e.face===Ut.RIGHT?(h=g,g=-y,y=h):e.face===Ut.BACK?(g=-g,y=-y):e.face===Ut.LEFT&&(h=g,g=y,y=-h),n=Math.atan2(b,Math.hypot(g,y)),r=Math.atan2(y,g),e.face===Ut.RIGHT?r=Vu(r,-F):e.face===Ut.BACK?r=Vu(r,-Math.PI):e.face===Ut.LEFT&&(r=Vu(r,+F))}return e.es!==0&&(n=Math.atan2(Math.sin(n),e.one_minus_f_squared*Math.cos(n))),r+=e.long0,t.x=r,t.y=n,t}function f1(e,t,r){return e===0?0:Math.atan2(t,r)}function Vu(e,t){var r=e+t;return r<-Math.PI?r+=Ns:r>+Math.PI&&(r-=Ns),r}function jB(e,t={}){let r={...e,face:0,one_minus_f:0,one_minus_f_squared:0,...t};return vK(r),r}var Ut,dt,zB=p(()=>{Bt();Ut={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},dt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4}});var Qx,qB=p(()=>{sc();zh();kt();qt();zB();Je();lt();fc();Ot();Qx={name:"qsc",aliases:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Te(e),r=e.primeMeridian??0,n=jB(t),i=Ie("qsc",e,n,kB,UB),o=re(e.parameters,"x_0",0),s=re(e.parameters,"y_0",0);return{...i,longitudeOrigin:t.long0,getRenderingProfile(a){if(a)return cr(h=>{let d=w=>t.es?Math.atan((1-t.es)*Math.tan(w)):w,m=Q(h[0][0]-t.long0,d(h[0][1]),h[1][0]-t.long0,d(h[1][1])),g=n.face===5?[0,0,1]:n.face===6?[0,0,-1]:[1,0,0],y=ht(g,m)[0],b=t.a*Math.sqrt((1-y)/(.5*(1-Math.SQRT1_2)));return ct([o-b,o+b],[s-b,s+b])},a,t.long0,r);let c=[[o-t.a,s-t.a,0],[o+t.a,s+t.a,0]],l=ja(e.parameters,r)().normalize,u=Os(h=>{let[d,m]=i.forward(h.x,h.y);Math.abs(d-o)<=t.a&&Math.abs(m-s)<=t.a||([h.x,h.y]=i.inverse(o+Math.max(-t.a,Math.min(t.a,d-o)),s+Math.max(-t.a,Math.min(t.a,m-s))))},r);return{bounds:c,normalize(h){l(h),u(h)}}}}}}});function TK(e,t,r,n,i){for(var o=r;i;--i){var s=(h1(e,o)-t)/AK(e,o);if(o-=s,Math.abs(s)<n)break}return o}function IK(e){e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,e.es=0}function $B(e,t){var r=k(t.x-e.long0,e.over),n=Math.abs(t.y),i=Math.floor(n*HB+1e-15);i<0?i=0:i>=sl&&(i=sl),n=Ly*(n-EK*i);var o=h1(Wu[i],n)*r,s=h1(Wa[i],n);return t.y<0&&(s=-s),t.x=o*e.a*VB+e.x0,t.y=s*e.a*WB+e.y0,t}function KB(e,t){var r=t.y,n=t;n.x=(n.x-e.x0)/(e.a*VB),n.y=Math.abs(r-e.y0)/(e.a*WB);for(let a=0;a<=sl;a++)if(Math.abs(n.y-Wa[a][0])<=8*Number.EPSILON)return n.x=k(n.x/Wu[a][0]+e.long0,e.over),n.y=(r<e.y0?-1:1)*a*5*Ry,n;if(n.y>=1)n.x/=Wu[sl][0],n.y=r<0?-F:F;else{var i=Math.floor(n.y*sl);for(i<0?i=0:i>=sl&&(i=sl-1);;)if(Wa[i][0]>n.y)--i;else if(Wa[i+1][0]<=n.y)++i;else break;var o=Wa[i],s=5*(n.y-o[0])/(Wa[i+1][0]-o[0]);s=TK(o,n.y,s,1e-10,100),n.x/=h1(Wu[i],s),n.y=(5*i+s)*Ry,r<0&&(n.y=-n.y)}return n.x=k(n.x+e.long0,e.over),n}function XB(e,t={}){let r={...e,...t};return IK(r),r}var Wu,Wa,VB,WB,HB,EK,sl,h1,AK,YB=p(()=>{Bt();xt();Wu=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Wa=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]];Wu=Wu.map(e=>e.map(Math.fround));Wa=Wa.map(e=>e.map(Math.fround));VB=.8487,WB=1.3523,HB=Ly/5,EK=1/HB,sl=18,h1=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},AK=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])}});var e_,ZB=p(()=>{Ot();Je();lt();kt();YB();e_={name:"robin",aliases:["Robinson"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=XB(t),n=Ie("robin",e,r,$B,KB);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});var t_,JB=p(()=>{Ot();Je();lt();kt();Dx();t_={name:"sinu",aliases:["Sinusoidal"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=mO(t),n=Ie("sinu",e,r,a1,c1);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function PK(e){e.k0||(e.k0=1);var t=e.lat0;e.lambda0=e.long0;var r=Math.sin(t),n=e.a,i=e.rf,o=1/i,s=2*o-Math.pow(o,2);e.e=Math.sqrt(s);var a=e.e;e.R=e.k0*n*Math.sqrt(1-s)/(1-s*Math.pow(r,2)),e.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(t),4)),e.b0=Math.asin(r/e.alpha);var c=Math.log(Math.tan(Math.PI/4+e.b0/2)),l=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+a*r)/(1-a*r));e.K=c-e.alpha*l+e.alpha*a/2*u}function QB(e,t){let r=e.e*Math.sin(t.y),n=2*Math.atan(Math.exp(e.alpha*(Math.log(Math.tan(Math.PI/4+t.y/2))-e.e/2*Math.log((1+r)/(1-r)))+e.K))-Math.PI/2,i=e.alpha*(t.x-e.lambda0),o=Math.cos(n),s=Math.asin(Math.cos(e.b0)*Math.sin(n)-Math.sin(e.b0)*o*Math.cos(i)),a=Math.asin(o*Math.sin(i)/Math.cos(s));return t.x=e.x0+e.R*a,t.y=e.y0+e.R*Math.log(Math.tan(Math.PI/4+s/2)),t}function eC(e,t){let r=(t.x-e.x0)/e.R,n=2*(Math.atan(Math.exp((t.y-e.y0)/e.R))-Math.PI/4),i=Math.asin(Math.cos(e.b0)*Math.sin(n)+Math.sin(e.b0)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),s=(e.K-Math.log(Math.tan(Math.PI/4+i/2)))/e.alpha;for(let a=0;a<6;a++){let c=e.e*Math.sin(i),l=(s+Math.log(Math.tan(Math.PI/4+i/2))-e.e/2*Math.log((1+c)/(1-c)))*(1-c*c)*Math.cos(i)/(1-e.es);if(i-=l,Math.abs(l)<1e-10)return t.x=e.lambda0+o/e.alpha,t.y=i,t}return null}function tC(e,t={}){let r={...e,lambda0:0,rf:0,R:0,alpha:0,b0:0,K:0,...t};return PK(r),r}var rC=p(()=>{});var r_,nC=p(()=>{qa();Je();lt();kt();rC();r_={name:"somerc",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Te(e),r=tC(t,{rf:t.a===t.b?1/0:1/(1-t.b/t.a)}),n=Ie("somerc",e,r,QB,eC);return De(n,Q(t.long0-Math.PI/18,Math.max(-Math.PI/2+1e-8,t.lat0-Math.PI/18),t.long0+Math.PI/18,Math.min(Math.PI/2-1e-8,t.lat0+Math.PI/18)),i=>YL(Gt(r,e),i),t.primeMeridian,t.over)}}});function RK(e){if(Math.abs(Math.abs(e.lat0)-F)<1e-10?e.mode=e.lat0<0?$r.S_POLE:$r.N_POLE:Math.abs(e.lat0)<1e-10?e.mode=$r.EQUIT:(e.mode=$r.OBLIQ,e.sinph0=Math.sin(e.lat0),e.cosph0=Math.cos(e.lat0)),e.pn1=e.h/e.a,e.pn1<=0||e.pn1>1e10)throw new Error("Invalid height");e.p=1+e.pn1,e.rp=1/e.p,e.h1=1/e.pn1,e.pfact=(e.p+1)*e.h1,e.es=0;var t=e.tilt,r=e.azi;e.cg=Math.cos(r),e.sg=Math.sin(r),e.cw=Math.cos(t),e.sw=Math.sin(t)}function iC(e,t){t.x-=e.long0;var r=Math.sin(t.y),n=Math.cos(t.y),i=Math.cos(t.x),o,s;switch(e.mode){case $r.OBLIQ:s=e.sinph0*r+e.cosph0*n*i;break;case $r.EQUIT:s=n*i;break;case $r.S_POLE:s=-r;break;case $r.N_POLE:s=r;break}switch(s=e.pn1/(e.p-s),o=s*n*Math.sin(t.x),e.mode){case $r.OBLIQ:s*=e.cosph0*r-e.sinph0*n*i;break;case $r.EQUIT:s*=r;break;case $r.N_POLE:s*=-(n*i);break;case $r.S_POLE:s*=n*i;break}var a,c;return a=s*e.cg+o*e.sg,c=1/(a*e.sw*e.h1+e.cw),o=(o*e.cg-s*e.sg)*e.cw*c,s=a*c,t.x=o*e.a,t.y=s*e.a,t}function oC(e,t){t.x/=e.a,t.y/=e.a;var r=t.x,n=t.y,i,o,s;s=1/(e.pn1-t.y*e.sw),i=e.pn1*t.x*s,o=e.pn1*t.y*e.cw*s,t.x=i*e.cg+o*e.sg,t.y=o*e.cg-i*e.sg;var a=Jt(t.x,t.y);if(Math.abs(a)<1e-10)r=0,n=e.lat0;else{var c,l;switch(l=1-a*a*e.pfact,l=(e.p-Math.sqrt(l))/(e.pn1/a+a/e.pn1),c=Math.sqrt(1-l*l),e.mode){case $r.OBLIQ:n=Math.asin(c*e.sinph0+t.y*l*e.cosph0/a),t.y=(c-e.sinph0*Math.sin(n))*a,t.x*=l*e.cosph0;break;case $r.EQUIT:n=Math.asin(t.y*l/a),t.y=c*a,t.x*=l;break;case $r.N_POLE:n=Math.asin(c),t.y=-t.y;break;case $r.S_POLE:n=-Math.asin(c);break}r=Math.atan2(t.x,t.y)}return t.x=r+e.long0,t.y=n,t}function sC(e,t={}){let r={...e,mode:0,sinph0:0,cosph0:0,pn1:0,h:0,p:0,rp:0,h1:0,pfact:0,tilt:0,azi:0,cg:0,sg:0,cw:0,sw:0,...t};return RK(r),r}var $r,aC=p(()=>{Bt();lc();$r={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3}});var n_,cC=p(()=>{Us();js();kt();aC();qt();n_={name:"tpers",aliases:["Tilted_Perspective"],parameters:["lon_0","x_0","y_0","lat_0","h","tilt","azi"],create(e){let t=Te(e),r=re(e.parameters,"h",1e5),n=re(e.parameters,"tilt",0)*Math.PI/180,i=re(e.parameters,"azi",0)*Math.PI/180;if(Math.abs(n)>=Math.PI/2)throw new Error("Perspective tilt must be between -90 and 90 degrees");let o=sC(t,{h:r,tilt:n,azi:i}),s=1+r/t.a,a=Math.acos(1/s),c=Math.abs(n),l=s*Math.cos(c)<1?c-Math.acos(s*Math.cos(c)):a,u=Math.min(a,l)*(1-1e-10);return bn(Ie("tpers",e,o,iC,oC,Va(t,1/(1+r/t.a))),t,u,(h,d)=>S8(Gt(t,e),s,n,i,h,d),a)}}});function LK(e){e.R=e.a}function lC(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over),o,s;if(Math.abs(n)<=1e-10)return o=e.x0+e.R*i,s=e.y0,t.x=o,t.y=s,t;var a=il(2*Math.abs(n/Math.PI));if(Math.abs(i)<=1e-10||Math.abs(Math.abs(n)-F)<=1e-10)return o=e.x0,n>=0?s=e.y0+Math.PI*e.R*Math.tan(.5*a):s=e.y0+Math.PI*e.R*-Math.tan(.5*a),t.x=o,t.y=s,t;var c=.5*Math.abs(Math.PI/i-i/Math.PI),l=c*c,u=Math.sin(a),h=Math.cos(a),d=h/(u-2*Math.sin(a/2)**2),m=d*d,g=d*(2/u-1),y=g*g,b=Math.sqrt(l*(d-y)*(d-y)-(y+l)*(m-y)),w=Math.PI*e.R*(y-m)/(b-c*(d-y));i<0&&(w=-w),o=e.x0+w;var S=l+d;return w=Math.PI*e.R*(l*(2*d-1)+m)/(g*S+c*Math.sqrt((y+l)*(l+1)-S*S)),n>=0?s=e.y0+w:s=e.y0-w,t.x=o,t.y=s,t}function uC(e,t){var r,n,i,o,s,a,c,l,u,h,d,m,g;return t.x-=e.x0,t.y-=e.y0,Math.abs(t.y)<1e-10?(t.x=k(e.long0+t.x/e.R,e.over),t.y=0,t):(d=Math.PI*e.R,i=t.x/d,o=t.y/d,s=i*i+o*o,a=-Math.abs(o)*(1+s),c=a-2*o*o+i*i,l=-2*a+1+2*o*o+s*s,g=o*o/l+(2*c*c*c/l/l/l-9*a*c/l/l)/27,u=(a-c*c/3/l)/l,h=2*Math.sqrt(-u/3),d=3*g/u/h,Math.abs(d)>1&&(d>=0?d=1:d=-1),m=Math.acos(d)/3,t.y>=0?n=(-h*Math.cos(m+Math.PI/3)-c/3/l)*Math.PI:n=-(-h*Math.cos(m+Math.PI/3)-c/3/l)*Math.PI,Math.abs(i)<1e-10?r=e.long0:r=k(e.long0+2*Math.PI*i/(Math.sqrt(1+2*(i*i-o*o)+s*s)+1-s),e.over),t.x=r,t.y=n,t)}function fC(e,t={}){let r={...e,R:0,...t};return LK(r),r}var hC=p(()=>{xt();Bt();s1()});var i_,dC=p(()=>{Ot();Je();lt();kt();hC();i_={name:"vandg",aliases:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=fC(t),n=Ie("vandg",e,r,lC,uC);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>W4(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function OK(e){let t=[["o_alpha","o_lon_c","o_lat_c"],["o_lat_p","o_lon_p"],["o_lon_1","o_lat_1","o_lon_2","o_lat_2"]],r=t.find(c=>c.some(l=>s_(e,l)));if(!r)throw new Error("Oblique transformation requires a rotation parameter set");for(let c of r){if(!s_(e,c))throw new Error("Oblique transformation requires "+c);if(c.includes("lat")&&Math.abs(Ki(e,c))>Math.PI/2)throw new Error("Invalid rotation latitude: "+c)}if(r===t[0]){let c=Ki(e,"o_alpha"),l=Ki(e,"o_lon_c"),u=Ki(e,"o_lat_c");if(Math.abs(u)>=Math.PI/2-1e-10)throw new Error("Rotation center must be away from the poles");return{lamp:l+Math.atan2(-Math.cos(c),-Math.sin(c)*Math.sin(u)),phip:Math.asin(Math.cos(u)*Math.sin(c))}}if(r===t[1])return{lamp:Ki(e,"o_lon_p"),phip:Ki(e,"o_lat_p")};let n=Ki(e,"o_lon_1"),i=Ki(e,"o_lat_1"),o=Ki(e,"o_lon_2"),s=Ki(e,"o_lat_2");if(Math.abs(i)>=Math.PI/2-1e-10||Math.abs(s)>=Math.PI/2-1e-10||Math.abs(i)<1e-10||Math.abs(i-s)<1e-10)throw new Error("Invalid new-equator reference points");let a=Math.atan2(Math.cos(i)*Math.sin(s)*Math.cos(n)-Math.sin(i)*Math.cos(s)*Math.cos(o),Math.sin(i)*Math.cos(s)*Math.sin(o)-Math.cos(i)*Math.sin(s)*Math.sin(n));return{lamp:a,phip:Math.atan(-Math.cos(a-n)/Math.tan(i))}}function d1(e){let t=e==="longlat";if(!t&&["obtran","geocent"].includes(o_(e.name)))throw new Error("Cannot wrap a composite or geocentric projection");return{name:"ob_tran",aliases:["General Oblique Transformation","General_Oblique_Transformation"],parameters:[...mC,"lon_0",...t?[]:e.parameters],flags:t?[]:e.flags,create(r){var P;let{parameters:n}=r,i=n.o_proj,o=t?["longlat","latlong","lonlat","latlon","identity"]:[e.name,...e.aliases||[]];if(i&&!o.map(o_).includes(o_(i)))throw new oi("missing-plugin","Oblique transformation dependency does not match +o_proj="+i);let{lamp:s,phip:a}=OK(n),c=Math.cos(a),l=Math.sin(a),u=Math.abs(a)>1e-10,h=Ki(n,"lon_0"),d=s_(n,"over"),m={...n,proj:t?"longlat":i||e.name,lon_0:"0"};for(let _ of mC)delete m[_];let g=t?di(_=>{_.x*=180/Math.PI,_.y*=180/Math.PI},_=>{_.x*=Math.PI/180,_.y*=Math.PI/180}):e.create({...r,parameters:Object.freeze(m),primeMeridian:0}),y=qo(g,!1),b=qo(g,!0),w=_=>Math.asin(Math.max(-1,Math.min(1,_))),S=_=>{let U=_.x,C=_.y,L=Kt(U-h,d),A=Math.cos(L),W=Math.sin(C),G=Math.cos(C),E=Kt(Math.atan2(G*Math.sin(L),u?l*G*A+c*W:W)+s),B=w(u?l*W-c*G*A:-G*A);_.x=E,_.y=B},M=_=>{let U=_.x,C=_.y,L=U-s,A=Math.cos(L),W=Math.sin(C),G=Math.cos(C),E=Math.atan2(G*Math.sin(L),u?l*G*A-c*W:-W),B=w(u?l*W+c*G*A:G*A);_.x=Kt(E+h),_.y=B},v=di(_=>{S(_),y(_)},_=>{b(_),M(_)}),T=t?ja(m):(P=g.getRenderingProfile)==null?void 0:P.bind(g);if(!T)return v;let O=(_,U)=>{let C=U&&cr(()=>_.bounds,U,h,r.primeMeridian??0,d),L=Os(A=>{var D;let W=A.x,G=A.y;S(A);let E=A.x*180/Math.PI,B=A.y*180/Math.PI,N={x:E,y:B,z:A.z};if((D=_.normalize)==null||D.call(_,N),N.x===E&&N.y===B){A.x=W,A.y=G;return}A.x=N.x*Math.PI/180,A.y=N.y*Math.PI/180,M(A),d&&(A.x+=Math.round((W-A.x)/(2*Math.PI))*2*Math.PI)},r.primeMeridian??0);return{get bounds(){let A=_.bounds,W=G=>[G[0]*180/Math.PI,G[1]*180/Math.PI,G[2]];return t?[W(A[0]),W(A[1])]:A},normalize(A){C==null||C.normalize(A),L(A)}}};return{...v,longitudeOrigin:h,getRenderingProfile(_){if(!_)return O(T());let U=Ls(_,r.primeMeridian??0,h),C=Q(U[0][0]-h,U[0][1],U[1][0]-h,U[1][1]),L=ht(u?[-c,0,l]:[-1,0,0],C),A=u?[l,0,c]:[0,0,1],G=ht(A,C)[0]>0?ks([0,1,0],A,0,C).map(Math.atan):[-Math.PI,Math.PI];return O(T(Nn(Q(G[0]+s,w(L[0]),G[1]+s,w(L[1])))),_)}}}}}var mC,o_,s_,Ki,pC=p(()=>{ac();zh();qt();sc();Ua();lt();Je();fc();mC=["o_proj","o_alpha","o_lon_c","o_lat_c","o_lon_p","o_lat_p","o_lon_1","o_lat_1","o_lon_2","o_lat_2"],o_=e=>e.toLowerCase().replace(/[ _-]/g,""),s_=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ki=(e,t)=>re(e,t,0)*Math.PI/180});function Pt(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Expected a CRS object");return e}function Xh(e){return Array.isArray(e)?e:[]}function Kr(e){return String(e||"").toLowerCase().replace(/[^a-z0-9]/g,"")}function Lr(e){if(typeof e!="number"||!Number.isFinite(e))throw new Error("Expected a finite CRS parameter");return e}function On(e,t){if(e===void 0)return t;if(typeof e=="object"){let i=Lr(Pt(e).conversion_factor);if(i<=0)throw new Error("Unit conversion factor must be positive");return i}let n={metre:1,meter:1,degree:At,radian:1,grad:Math.PI/200,gon:Math.PI/200,foot:.3048,ussurveyfoot:1200/3937,kilometre:1e3,arcsecond:At/3600,partspermillion:1e-6,unity:1}[Kr(e)];return n||Ue("Unsupported CRS unit: "+String(e)),n}function al(e,t){var _,U,C;let r=String(e.type),n=FK(e.bbox);if(r==="CompoundCRS"){t.mode!=="horizontal"&&Ue("CompoundCRS requires explicit horizontal extraction");let L=Xh(e.components).map(Pt).filter(W=>["ProjectedCRS","GeographicCRS","GeodeticCRS","BoundCRS"].includes(String(W.type)));if(L.length!==1)throw new Error("CompoundCRS requires exactly one horizontal component");let A=al(L[0],t);return{...A,areaOfUse:n??A.areaOfUse,lossy:!0}}if(r==="BoundCRS"){let L=al(Pt(e.source_crs),t),A=al(Pt(e.target_crs),t);(A.parameters.datum!=="WGS84"||!["longlat","geocent"].includes(A.parameters.proj)||Number(A.parameters.pm||0)!==0||A.parameters.towgs84||Number(A.parameters.a)!==6378137||!(Math.abs(Number(A.parameters.rf)-298.257223563)<=1e-9||Math.abs(Number(A.parameters.b)-6356752314245179e-9)<=1e-6))&&Ue("BoundCRS requires a WGS84 target");let W=Pt(e.transformation),G=Kr(Pt(W.method).name),E=G==="geocentrictranslations"||/^geocentrictranslationsgeog[23]ddomain$/.test(G),B=/^positionvector(?:transformation)?(?:geog[23]ddomain|geocentricdomain)?$/.test(G),N=/^coordinateframe(?:rotation)?(?:geog[23]ddomain|geocentricdomain)?$/.test(G);!E&&!B&&!N&&Ue("Unsupported BoundCRS transformation: "+G);let D=["xaxistranslation","yaxistranslation","zaxistranslation","xaxisrotation","yaxisrotation","zaxisrotation","scaledifference"],R=new Array(E?3:7).fill(void 0);for(let j of Xh(W.parameters)){let we=Pt(j),_e=D.indexOf(Kr(we.name));(_e<0||_e>=R.length||R[_e]!==void 0)&&Ue("Unsupported or duplicate Helmert parameter: "+String(we.name));let ne=_e<3?1:_e<6?At/3600:1e-6;R[_e]=Lr(we.value)*On(we.unit,ne)/ne*(N&&_e>=3&&_e<6?-1:1)}if(R.some(j=>j===void 0))throw new Error("Incomplete BoundCRS Helmert transformation");let I={...L.parameters,towgs84:R.join(",")};return delete I.datum,{...L,parameters:I,areaOfUse:n??L.areaOfUse}}["ProjectedCRS","GeographicCRS","GeodeticCRS"].includes(r)||Ue("Unsupported CRS type: "+r);let i=r==="ProjectedCRS"?Pt(e.base_crs):e,o=Pt(i.datum||i.datum_ensemble);(o.type==="DynamicGeodeticReferenceFrame"||o.frame_reference_epoch!==void 0||e.coordinate_epoch!==void 0)&&Ue("Time-dependent datum transformations are not implemented");let s=Pt(o.ellipsoid),a=Lr(s.semi_major_axis??s.radius),c={proj:"longlat",a:String(a*On(s.unit,1))};if(s.inverse_flattening!==void 0)c.rf=String(Lr(s.inverse_flattening));else if(s.semi_minor_axis!==void 0)c.b=String(Lr(s.semi_minor_axis)*On(s.unit,1));else if(s.radius!==void 0)c.b=c.a;else throw new Error("Ellipsoid requires inverse flattening or semi-minor axis");let l=Cu(t),u=String(o.name||""),h=Kr(u),d=Object.keys(l),m=d.find(L=>nl(L)===nl(u)),g=m?[m]:d.filter(L=>Kr(L)===h||Kr(L)===h.replace(/^d/,"")),y=g[0],b=l[y];if(b&&g.some(L=>{let A=l[L];return A.ellipse!==b.ellipse||A.towgs84!==b.towgs84||A.nadgrids!==b.nadgrids}))throw new Error("Ambiguous structured datum name: "+u);if(h&&(c.datum=y||u),y&&nl(y)==="wgs84"&&(c.datum="WGS84"),y&&["nad83","northamericandatum1983"].includes(nl(y))&&(c.datum="NAD83"),!y){["wgs84","worldgeodeticsystem1984","worldgeodeticsystem1984ensemble","dwgs1984","wgs1984"].includes(h)&&(c.datum="WGS84"),["nad83","northamericandatum1983","dnorthamerican1983"].includes(h)&&(c.datum="NAD83"),["nad27","northamericandatum1927","dnorthamerican1927"].includes(h)&&(c.datum="NAD27");let A={newzealand1949:"nzgd49",belge1972:"rnb72"}[h.replace(/^d/,"")];A&&(c.datum=A)}if(r==="ProjectedCRS"&&i.id){let L=Pt(i.id),A=String(L.authority)+"_"+String(L.code);Object.prototype.hasOwnProperty.call(l,A)&&(c.datum=A)}o.towgs84!==void 0&&(c.towgs84=Xh(o.towgs84).map(Lr).join(","),delete c.datum);let w=e.coordinate_system?Pt(e.coordinate_system):{},S=Xh(w.axis).map(Pt),M=Kr(w.subtype)==="cartesian"&&r==="GeodeticCRS";r!=="ProjectedCRS"&&!M&&w.subtype&&Kr(w.subtype)!=="ellipsoidal"&&Ue("Unsupported coordinate system subtype"),M&&(c.proj="geocent");let v=On(i.angular_unit,At),T=On((_=S[0])==null?void 0:_.unit,r==="ProjectedCRS"||M?1:v);S[1]&&On(S[1].unit,T)!==T&&Ue("Mixed horizontal axis units are not supported"),M&&S[2]&&On(S[2].unit,T)!==T&&Ue("Mixed geocentric axis units are not supported");let O=i.prime_meridian||o.prime_meridian;if(O){let L=Pt(O);c.pm=String(Lr(L.longitude)*On(L.unit,v)/At)}if(r==="ProjectedCRS"){let L=Pt(e.conversion),A=Kr(Pt(L.method).name),W=Xh(L.parameters).map(Pt),G=A==="stereographicnorthpole"&&!W.some(D=>Kr(D.name).startsWith("scalefactor")),E=G?"stere":BK[A],B=W.filter(D=>["xscale","yscale","xyplanerotation"].includes(Kr(D.name)));if(B.length){let D={xscale:-1,yscale:1,xyplanerotation:90};(E!=="krovak"||B.length!==3||new Set(B.map(R=>Kr(R.name))).size!==3||B.some(R=>{let I=Kr(R.name),j=I==="xyplanerotation"?On(R.unit,v)/At:On(R.unit,1);return Math.abs(Lr(R.value)*j-D[I])>1e-10}))&&Ue("Unsupported ESRI Krovak axis adjustment")}(!E||E.startsWith("unsupported"))&&Ue("Unsupported projection method: "+String(Pt(L.method).name)),c.proj=E==="webmerc"?"merc":E;let N=!1;for(let D of W){let R=Kr(D.name);if(B.includes(D)||R==="auxiliaryspheretype"&&E==="webmerc"&&D.value===0)continue;if(R==="semiminor"&&E==="webmerc"){if(N)throw new Error("Duplicate conversion parameter: semi_minor");N=!0;let ne=Lr(D.value)*On(D.unit,1);Math.abs(ne-Number(c.a))>4*Number.EPSILON*Number(c.a)&&Ue("Pseudo-Mercator semi_minor must equal the semi-major axis");continue}let I=((U=DK[E])==null?void 0:U[R])||CK[R];if(I||Ue("Unsupported conversion parameter: "+String(D.name)),I==="lat_1"&&A==="stereographicnorthpole"&&!G?I="lat_0":I==="lat_1"&&["merc","webmerc","eqc","stere","cea"].includes(E)&&(I="lat_ts"),c[I]!==void 0)throw new Error("Duplicate conversion parameter: "+I);if(["merc","webmerc"].includes(E)&&I==="lat_0"&&D.value===0)continue;let j=I.startsWith("lat")||I.startsWith("lon")||I==="alpha"||I==="gamma",we=I==="x_0"||I==="y_0",_e=Lr(D.value)*On(D.unit,j?v:we?T:1)/(j?At:1);I.startsWith("lat")&&Math.abs(Math.abs(_e)-90)<=4*Number.EPSILON*90&&(_e=Math.sign(_e)*90),c[I]=String(_e)}if(E==="omerc"&&["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(A)&&(c.no_uoff=void 0),E==="omerc"&&c.lon_0!==void 0&&c.lonc!==void 0&&(Math.abs(Number(c.lon_0)-Number(c.lonc))>1e-10&&Ue("Oblique Mercator central meridian conflicts with projection centre"),delete c.lon_0),A==="stereographicnorthpole"&&Math.abs(Number(c.lat_0))===90&&(c.proj="stere"),E==="lcc"&&c.lat_1===void 0&&(c.lat_1=c.lat_0),A==="polarstereographic"&&c.lat_0!==void 0){if(c.lat_ts!==void 0)throw new Error("Duplicate polar stereographic latitude of true scale");c.lat_ts=c.lat_0,delete c.lat_0}E==="stere"&&(A.includes("polar")||A==="stereographicsouthpole"||G)&&c.lat_0===void 0&&(c.lat_0=Number(c.lat_ts||90)<0?"-90":"90"),E==="webmerc"&&(c.b=c.a,delete c.rf,c.nadgrids="@null")}let P=S.map(L=>GK(L,c,r==="ProjectedCRS")).join("");return P.length===2&&(P+="u"),!M&&/[ud]/.test(P.slice(0,2))&&Ue("Structured CRS vertical-first axes require an explicit PROJ axis definition"),P&&(c.axis=P),(r==="ProjectedCRS"||M)&&(c.to_meter=String(T)),{parameters:c,areaOfUse:n,angularUnit:r==="ProjectedCRS"||M?v:T,verticalUnit:M?1:On((C=S[2])==null?void 0:C.unit,1)}}function FK(e){let t;if(e!==void 0){let r=Pt(e),n=Lr(r.west_longitude),i=Lr(r.south_latitude),o=Lr(r.east_longitude),s=Lr(r.north_latitude);if(n<-180||n>180||o<-180||o>180||i<-90||s>90||i>=s||n===o)throw new Error("Invalid CRS geographic bounding box");t=[n,i,o,s]}return t}function GK(e,t,r){var a;let n=String(e.direction),i=e.meridian,o=/^(north|south) along ([+-]?(?:\d+(?:\.\d*)?|\.\d+)) deg(?: (east|west))?$/i.exec(n);if(o){if(i!==void 0)throw new Error("Duplicate axis meridian");n=o[1],i={longitude:Number(o[2])*(((a=o[3])==null?void 0:a.toLowerCase())==="west"?-1:1)}}if(i!==void 0){let c=Number(t.lat_0),l=c===90;(!r||t.proj!=="stere"||Math.abs(c)!==90||Kr(n)!==(l?"south":"north"))&&Ue("Axis meridians require an outward-facing polar stereographic axis");let u=Pt(i).longitude,h=typeof u=="number"?Lr(u):Lr(Pt(u).value)*On(Pt(u).unit,At)/At,d=Lr((h-Number(t.lon_0||0))/90);Math.abs(d-Math.round(d))>1e-12&&Ue("Non-cardinal axis meridians require an orientation operation");let m=(Math.round(d)%4+4)%4;return(l?"senw":"nesw")[m]}let s=NK[Kr(n)];return s||Ue("Unsupported axis direction: "+n),s}var BK,CK,DK,NK,a_=p(()=>{Hp();qt();Ua();BK={hotineobliquemercator:"omerc",hotineobliquemercatorvarianta:"omerc",hotineobliquemercatorvariantb:"omerc",hotineobliquemercatorazimuthnaturalorigin:"omerc",hotineobliquemercatorazimuthcenter:"omerc",obliquemercator:"omerc",krovak:"krovak",krovaknorthorientated:"krovak",quadrilateralizedsphericalcube:"qsc",transversemercator:"tmerc",transversemercatorsouthorientated:"unsupported-south-tmerc",mercator:"merc",mercator1sp:"merc",mercator2sp:"merc",mercatorvarianta:"merc",mercatorvariantb:"merc",mercatorauxiliarysphere:"webmerc",popularvisualisationpseudomercator:"webmerc",lambertconformalconic:"lcc",lambertconformalconic1sp:"lcc",lambertconformalconic2sp:"lcc",lambertconicconformal1sp:"lcc",lambertconicconformal2sp:"lcc",albers:"aea",albersconicequalarea:"aea",albersequalarea:"aea",equidistantconic:"eqdc",lambertazimuthalequalarea:"laea",stereographic:"stere",stereographicnorthpole:"sterea",stereographicsouthpole:"stere",polarstereographic:"stere",polarstereographicvarianta:"stere",polarstereographicvariantb:"stere",obliquestereographic:"sterea",doublestereographic:"sterea",azimuthalequidistant:"aeqd",modifiedazimuthalequidistant:"aeqd",equidistantcylindrical:"eqc",equidistantcylindricalspherical:"eqc",equirectangular:"eqc",platecarree:"eqc",bonne:"bonne",cassinisoldner:"cass",cassini:"cass",cylindricalequalarea:"cea",lambertcylindricalequalarea:"cea",eckertvi:"eck6",equalearth:"eqearth",millercylindrical:"mill",mollweide:"moll",robinson:"robin",sinusoidal:"sinu",vandergrinten:"vandg",vandergrinteni:"vandg",gnomonic:"gnom",orthographic:"ortho",polyconic:"poly",americanpolyconic:"poly",newzealandmapgrid:"nzmg",gaussschreibertransversemercator:"gstmerc"},CK={centralmeridian:"lon_0",longitudeoforigin:"lon_0",longitudeofcenter:"lon_0",longitudeofnaturalorigin:"lon_0",longitudeoffalseorigin:"lon_0",longitudeofprojectioncentre:"lon_0",straightverticalpolelongitude:"lon_0",longitudeoforiginmeridian:"lon_0",latitudeoforigin:"lat_0",latitudeofcenter:"lat_0",latitudeofnaturalorigin:"lat_0",latitudeoffalseorigin:"lat_0",latitudeofprojectioncentre:"lat_0",standardparallel1:"lat_1",latitudeof1ststandardparallel:"lat_1",standardparallel2:"lat_2",latitudeof2ndstandardparallel:"lat_2",latitudeofstandardparallel:"lat_ts",scalefactor:"k_0",scalefactoratnaturalorigin:"k_0",scalefactoratprojectionorigin:"k_0",falseeasting:"x_0",falsenorthing:"y_0",eastingatfalseorigin:"x_0",northingatfalseorigin:"y_0"},DK={omerc:{longitudeofcenter:"lonc",longitudeofprojectioncentre:"lonc",azimuth:"alpha",azimuthatprojectioncentre:"alpha",rectifiedgridangle:"gamma",anglefromrectifiedtoskewgrid:"gamma",scalefactoratprojectioncentre:"k_0",eastingatprojectioncentre:"x_0",northingatprojectioncentre:"y_0"},krovak:{azimuth:"alpha",colatitudeofconeaxis:"alpha",pseudostandardparallel1:"lat_ts",latitudeofpseudostandardparallel:"lat_ts",scalefactoronpseudostandardparallel:"k_0"}},NK={east:"e",west:"w",north:"n",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"}});function m1(e,...t){return e.values.filter(r=>r.type==="node"&&t.includes(r.keyword.toUpperCase()))}function Mt(e,...t){return m1(e,...t)[0]}function bt(e,t=0){let r=e.values[t];return r&&r.type!=="node"?r.value:void 0}function cl(e){return e?{name:bt(e),conversion_factor:bt(e,1)}:void 0}function kK(e,t){let r=bt(e,1);if(t&&String(r).toLowerCase()==="unknown"){let n=String(bt(e)).toLowerCase(),i=/^(easting|northing|westing|southing)(?:\s*\([a-z]\))?$/.exec(n);if(i)return{easting:"east",northing:"north",westing:"west",southing:"south"}[i[1]]}return r}function UK(e){let t=Mt(e,"MERIDIAN");if(t)return{longitude:{value:bt(t),unit:cl(Mt(t,"ANGLEUNIT"))}}}function gC(e){let t=Mt(e,"METHOD","PROJECTION");if(!t)throw new Error("WKT conversion requires a METHOD or PROJECTION");return Mt(e,"PARAMETERFILE")&&Ue("Grid-based WKT operation is not implemented"),{method:{name:bt(t)},parameters:m1(e,"PARAMETER").map(r=>({name:bt(r),value:bt(r,1),unit:cl(Mt(r,"ANGLEUNIT","LENGTHUNIT","SCALEUNIT"))}))}}function Yh(e){let t=e.keyword.toUpperCase();if(t==="COMPD_CS"||t==="COMPOUNDCRS")return{type:"CompoundCRS",components:m1(e,"PROJCS","PROJCRS","GEOGCS","GEOGCRS","GEODCRS","BOUNDCRS","VERT_CS","VERTCRS").map(Yh)};if(t==="BOUNDCRS"){let d=Mt(e,"SOURCECRS"),m=Mt(e,"TARGETCRS"),g=Mt(e,"ABRIDGEDTRANSFORMATION");if(!d||!m||!g)throw new Error("Incomplete WKT BoundCRS");let y=S=>{let M=S.values.find(v=>v.type==="node");if(!M)throw new Error("Missing bound CRS component");return M},b=gC(g),w=b.parameters;for(let S of w)String(S.name).toLowerCase()==="scale difference"&&S.unit===void 0&&(S.value=(Number(S.value)-1)*1e6);return{type:"BoundCRS",source_crs:Yh(y(d)),target_crs:Yh(y(m)),transformation:b}}if(["VERT_CS","VERTCRS"].includes(t))return{type:"VerticalCRS"};let r=["PROJCS","PROJCRS","PROJECTEDCRS"].includes(t),n=["GEOGCS","GEOGCRS","GEODCRS","GEODETICCRS","GEOGRAPHICCRS","BASEGEOGCRS","BASEGEODCRS","GEOCCS"].includes(t);!r&&!n&&Ue("Unsupported WKT CRS: "+t),Mt(e,"DYNAMIC","DERIVINGCONVERSION","VELOCITYGRID","EXTENSION")&&Ue("Unsupported WKT dynamic/extension operation");let i=Mt(e,"CS"),o=t==="GEOCCS"||String(bt(i||e)).toLowerCase()==="cartesian"&&!r,s=Mt(e,r||o?"LENGTHUNIT":"ANGLEUNIT","UNIT"),a=m1(e,"AXIS").sort((d,m)=>Number(bt(Mt(d,"ORDER")||d))-Number(bt(Mt(m,"ORDER")||m))).map((d,m)=>({name:bt(d),direction:t==="GEOCCS"?["geocentricX","geocentricY","geocentricZ"][m]:kK(d,r),unit:cl(Mt(d,"ANGLEUNIT","LENGTHUNIT")||(!o&&!r&&/^(up|down)$/i.test(String(bt(d,1)))?void 0:s)),meridian:UK(d)}));if(!a.length)for(let d of o?["geocentricX","geocentricY","geocentricZ"]:["east","north"])a.push({name:d,direction:d,unit:cl(s),meridian:void 0});let c=t==="GEOGCS"?void 0:Mt(e,"ID"),l={type:r?"ProjectedCRS":o?"GeodeticCRS":"GeographicCRS",name:bt(e),id:c?{authority:bt(c),code:bt(c,1)}:void 0,coordinate_system:{subtype:r||o?"Cartesian":"ellipsoidal",axis:a}},u=Mt(e,"USAGE"),h=Mt(u||e,"BBOX");if(h&&(l.bbox={south_latitude:bt(h,0),west_longitude:bt(h,1),north_latitude:bt(h,2),east_longitude:bt(h,3)}),r){let d=Mt(e,"GEOGCS","BASEGEOGCRS","BASEGEODCRS","GEODCRS","GEOGCRS");if(!d)throw new Error("Projected WKT requires a base geographic CRS");l.base_crs=Yh(d),l.conversion=gC(Mt(e,"CONVERSION")||e)}else{let d=Mt(e,"DATUM","GEODETICDATUM","ENSEMBLE");if(!d)throw new Error("WKT requires a geodetic datum");Mt(d,"EXTENSION","DYNAMIC")&&Ue("Unsupported datum extension");let m=Mt(d,"SPHEROID","ELLIPSOID");if(!m)throw new Error("WKT datum requires an ellipsoid");let g=Mt(d,"TOWGS84");l.datum={name:bt(d),ellipsoid:{name:bt(m),semi_major_axis:bt(m,1),inverse_flattening:bt(m,2),unit:cl(Mt(m,"LENGTHUNIT"))},towgs84:g==null?void 0:g.values.map((b,w)=>bt(g,w))};let y=Mt(e,"PRIMEM");y&&(l.prime_meridian={name:bt(y),longitude:bt(y,1),unit:cl(Mt(y,"ANGLEUNIT")||(o?void 0:s))}),l.angular_unit=o?void 0:cl(s)}return l}var c_,yC=p(()=>{Bl();qg();Ua();a_();c_={name:"wkt",canParse:e=>yr(e)==="wkt",parse(e,t){if(typeof e!="string")throw new Error("Expected serialized WKT");return al(Yh(wf(e).root),t)}}});var l_,bC=p(()=>{Bl();a_();l_={name:"projjson",canParse:e=>yr(e)==="projjson",parse:(e,t)=>al(Pt(e),t)}});var QMe,e3e,t3e,wC=p(()=>{QMe=new Float64Array(0),e3e=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,t3e={deg:Math.PI/180,rad:1,m:1,ft:.3048,"us-ft":1200/3937}});var u_=p(()=>{oL();sL();aL();hL();yL();SL();TL();P8();FL();WL();Cy();b8();HL();iO();cO();dO();wO();AO();LO();GO();$O();eB();oB();uB();gB();_B();AB();LB();GB();qB();ZB();JB();nC();cC();dC();pC();yC();bC();wC()});var p1,xC,_C=p(()=>{p1={ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clrk80ign",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-0.008393,0.000749,-0.010276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"372.87,149.23,585.29"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"},EPSG_10328:{towgs84:"0,0,0"},EPSG_9782:{towgs84:"0,0,0"},EPSG_9777:{towgs84:"0,0,0"},EPSG_10690:{towgs84:"0,0,0"},EPSG_10639:{towgs84:"0,0,0"},EPSG_10739:{towgs84:"0,0,0"},EPSG_7686:{towgs84:"0,0,0"},EPSG_8900:{towgs84:"0,0,0"},EPSG_5886:{towgs84:"0,0,0"},EPSG_7683:{towgs84:"0,0,0"},EPSG_6668:{towgs84:"0,0,0"},EPSG_20046:{towgs84:"0,0,0"},EPSG_10299:{towgs84:"0,0,0"},EPSG_10310:{towgs84:"0,0,0"},EPSG_10475:{towgs84:"0,0,0"},EPSG_4742:{towgs84:"0,0,0"},EPSG_10671:{towgs84:"0,0,0"},EPSG_10762:{towgs84:"0,0,0"},EPSG_10725:{towgs84:"0,0,0"},EPSG_10791:{towgs84:"0,0,0"},EPSG_10800:{towgs84:"0,0,0"},EPSG_10305:{towgs84:"0,0,0"},EPSG_10941:{towgs84:"0,0,0"},EPSG_10968:{towgs84:"0,0,0"},EPSG_10875:{towgs84:"0,0,0"},EPSG_6318:{towgs84:"0,0,0"},EPSG_10910:{towgs84:"0,0,0"}};for(let e in p1){let t=p1[e];t.datumName&&(p1[t.datumName]=t)}xC=p1});var SC,MC=p(()=>{_C();SC=Object.freeze({name:"regional-datums",datums:Object.freeze(xC)})});function jK(e){return{...e,parse(t,r){let n=e.parse(t,r),i=n.parameters.datum,o=s=>s.toLowerCase().replace(/[\s_-]/g,"");if(i&&!Object.keys(Cu(r)).some(s=>o(s)===o(i))){let s={...n.parameters};return delete s.datum,{...n,parameters:s}}return n}}}function qK(){if(g1)return g1;let e=[hx,dx,mx,gx,yx,_x,Gy,Sx,Ax,Oy,By,Dy,Tx,Px,Bx,Cx,Nx,kx,Ux,jx,zx,Wx,Hx,$x,Kx,Xx,Yx,Zx,Jx,Qx,e_,t_,r_,n_,i_],t=i=>i.toLowerCase().replace(/[\s_-]/g,""),r=d1("longlat"),n={name:r.name,aliases:r.aliases,parameters:[...new Set([...r.parameters,...e.flatMap(i=>i.parameters)])],flags:[...new Set(e.flatMap(i=>i.flags||[]))],create(i){let o=i.parameters.o_proj;if(!o)throw new Error("Oblique transformation requires +o_proj");let s=["longlat","latlong","latlon","lonlat","identity"].includes(t(o))?"longlat":e.find(l=>[l.name,...l.aliases||[]].some(u=>t(u)===t(o)));if(!s)throw new Error("Unknown oblique transformation projection: "+o);let a=d1(s),c=new Set([...$p,...a.parameters]);for(let l of Object.keys(i.parameters))if(!c.has(l))throw new Error("Unsupported PROJ parameter: +"+l);return a.create(i)}};return g1=[...e,n],g1}var zK,g1,Hu,VK,vC=p(()=>{iL();MC();Hp();u_();Du();zK=[c_,l_].map(jK);Hu=class extends r1{constructor(t={}){super({...t,projections:t.projections??qK(),parsers:t.parsers??zK,datumCatalogs:t.datumCatalogs??[SC]}),this.useDefinitionSignature=!Wh(t)}},VK=new Hu});var EC=p(()=>{u_();vC()});function AC(){return HK}function TC(e){return WK.get(e)}var WK,HK,IC=p(()=>{"use strict";EC();WK=new Map,HK=new Hu});function $K(e,t,r){let n=[];for(let i=0;i<3;i++){let o=t.slice(),s=t.slice();o[i]+=r,s[i]-=r;let a=e.transformPosition(o),c=e.transformPosition(s);n.push([(a[0]-c[0])/(2*r),(a[1]-c[1])/(2*r),(a[2]-c[2])/(2*r)])}return n}function KK(e,t){let[r,n,i]=e,o=r[0]*(n[1]*i[2]-n[2]*i[1])-n[0]*(r[1]*i[2]-r[2]*i[1])+i[0]*(r[1]*n[2]-r[2]*n[1]);return!Number.isFinite(o)||Math.abs(o)<1e-15?t:[[n[1]*i[2]-n[2]*i[1],r[2]*i[1]-r[1]*i[2],r[1]*n[2]-r[2]*n[1]],[n[2]*i[0]-n[0]*i[2],r[0]*i[2]-r[2]*i[0],r[2]*n[0]-r[0]*n[2]],[n[0]*i[1]-n[1]*i[0],r[1]*i[0]-r[0]*i[1],r[0]*n[1]-r[1]*n[0]]].map(a=>(a[0]*t[0]+a[1]*t[1]+a[2]*t[2])/o)}function Zh(e){if(!e)throw new Error("Cannot construct a projection because the CRS is unknown");if(typeof e!="string"&&e.type==="CompoundCRS"){let t=e.components.filter(r=>r.type!=="VerticalCRS");if(t.length!==1)throw new Error("CompoundCRS requires exactly one horizontal component");return Zh(t[0])}return e}function XK(e){if(e.outputCoordinates==="local-enu")throw new Error("local-enu output requires a dataset-derived local origin and must be created by a tileset source");if(e.outputCoordinates==="target-crs"&&!e.targetCrs)throw new Error("target-crs output requires targetCrs");if(!e.sourceCrs&&e.status==="unresolved")throw new Error("Cannot transform coordinates because the source CRS is unknown");if($u(e)&&e.heightReference==="unknown")throw new Error("Cannot convert heights because the source height reference is unknown");if(e.coordinateFrame==="geocentric"&&!f_(e.sourceCrs))throw new Error("Only EPSG:4978 geocentric coordinates are supported by the current spatial transformer");if(e.status==="unresolved")throw new Error("The requested spatial output cannot be resolved from the available metadata")}function f_(e){return typeof e=="string"&&Gh(e)===jp}function PC(e){if(typeof e!="string")return!1;let t=Gh(e);return t===Bu||t==="EPSG:4979"||t==="OGC:CRS84"}function $u(e){let t=e.targetHeightReference;return t!=="native"&&t!==e.heightReference}function YK(e){return typeof e=="string"?TC(e):e}function ZK(e,t,r,n){if(r===n||n==="native")return e;if(r==="orthometric"&&n==="ellipsoidal")return e+t;if(r==="ellipsoidal"&&n==="orthometric")return e-t;throw new Error(`Unsupported height conversion from ${r} to ${n}`)}var ll,h_=p(()=>{"use strict";Dn();Cf();uR();IC();Kw();Xw();ll=class{spatialReference;horizontalProjection;horizontalProjectionBuffer;geographicProjection;heightOutputProjection;sourceIsGeocentric;outputIsGeocentric;sourceIsGeographic;outputIsGeographic;geoid;constructor(t,r={}){this.spatialReference=t;let n=AC();XK(t);let i=t.targetCrs||t.sourceCrs;if(this.sourceIsGeocentric=f_(t.sourceCrs),this.outputIsGeocentric=f_(i),this.sourceIsGeographic=PC(t.sourceCrs),this.outputIsGeographic=PC(i),t.sourceCrs&&t.targetCrs&&!this.sourceIsGeocentric&&!this.outputIsGeocentric&&(this.horizontalProjection=n.createProjection({from:Zh(t.sourceCrs),to:Zh(t.targetCrs),enforceAxis:!1}),$u(t)||(this.horizontalProjectionBuffer=new Vp({projection:this.horizontalProjection,dimension:3}))),($u(t)||this.sourceIsGeocentric||this.outputIsGeocentric)&&(!this.sourceIsGeographic&&!this.sourceIsGeocentric&&(this.geographicProjection=n.createProjection({from:Zh(t.sourceCrs),to:Bu,enforceAxis:!1})),!this.outputIsGeographic&&!this.outputIsGeocentric&&(this.heightOutputProjection=n.createProjection({from:Bu,to:Zh(i),enforceAxis:!1}))),$u(t)&&(this.geoid=YK(r.geoidModel),!this.geoid)){let o=typeof r.geoidModel=="string"?` "${r.geoidModel}"`:"";throw new Error(`Height conversion requires a registered geoid model${o}; call registerGeoidModel() or pass a parsed Geoid instance`)}}transformPosition(t){if(t.length<2)throw new Error("A spatial coordinate must contain at least x and y components");let r=[...t];if($u(this.spatialReference)||this.sourceIsGeocentric||this.outputIsGeocentric){if(r.length<3||!Number.isFinite(r[2]))throw new Error("Three-dimensional CRS conversion requires a finite z coordinate");let n=this.toGeographic(r);if($u(this.spatialReference)){let o=this.geoid.getHeight(n[1],n[0]);n[2]=ZK(n[2],o,this.spatialReference.heightReference,this.spatialReference.targetHeightReference)}let i=this.fromGeographic(n);return r.splice(0,i.length,...i),r}if(this.horizontalProjection){let n=this.horizontalProjection.projectSync(r.slice(0,3));r.splice(0,n.length,...n)}return r}transformPositions(t){if(t.length%3!==0)throw new Error("Packed spatial positions must contain a multiple of three components");let r=new Float64Array(t.length);if(this.horizontalProjectionBuffer&&(r.set(t),r.every(Number.isFinite)))return this.horizontalProjectionBuffer.projectFlatTo(r,r);for(let n=0;n<t.length;n+=3){let i=this.transformPosition([Number(t[n]),Number(t[n+1]),Number(t[n+2])]);r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2]}return r}transformNormals(t,r){if(t.length!==r.length||t.length%3!==0)throw new Error("Spatial normals and positions must have matching xyz component counts");let n=new Float32Array(t.length),i=1e-5;for(let o=0;o<t.length;o+=3){let s=[Number(r[o]),Number(r[o+1]),Number(r[o+2])],a=[Number(t[o]),Number(t[o+1]),Number(t[o+2])],c=$K(this,s,i),l=KK(c,a),u=Math.hypot(...l);u>0&&Number.isFinite(u)?(n[o]=l[0]/u,n[o+1]=l[1]/u,n[o+2]=l[2]/u):(n[o]=a[0],n[o+1]=a[1],n[o+2]=a[2])}return n}toGeographic(t){return this.sourceIsGeocentric?Array.from(Et.WGS84.cartesianToCartographic(new J(t))):this.sourceIsGeographic?t.slice(0,3):this.geographicProjection.projectSync(t.slice(0,3))}fromGeographic(t){return this.outputIsGeocentric?Array.from(Et.WGS84.cartographicToCartesian(new J(t))):this.outputIsGeographic?t.slice(0,3):this.heightOutputProjection.projectSync(t.slice(0,3))}}});function JK(e,t){return e==="relativeToScene"?t.sceneElevationProvider:Ku(e)?t.terrainElevationProvider:void 0}function Ku(e){return e==="onTheGround"||e==="relativeToGround"||e==="relativeToScene"}function d_(e){if(e.length%3!==0)throw new Error("I3S position arrays must contain complete XYZ tuples");let t=[];for(let r=0;r<e.length;r+=3)t.push([e[r],e[r+1],e[r+2]]);return t}function QK(e){let t=Ha(e);return{west:t[0]*180/Math.PI,south:t[1]*180/Math.PI,east:t[2]*180/Math.PI,north:t[3]*180/Math.PI}}function RC(e){if(!e.length)throw new Error("I3S spatial transformation requires at least one bound sample");let t=e.map(o=>Et.WGS84.cartographicToCartesian(new J(o))),r=new J;for(let o of t)r.add(o);r.scale(1/t.length);let n=0;for(let o of t)n=Math.max(n,new J(o).subtract(r).magnitude());let i=Et.WGS84.cartesianToCartographic(r);return[i[0],i[1],i[2],n]}function LC(e,t,r,n){let i=e.obb;if(i){let c=Array.from(i.center).slice(0,3);c[2]*=n;let l=Array.from(i.halfSize).slice(0,3),u=new Mf().fromArray(Array.from(i.quaternion)),h=[new J([l[0],0,0]).transformByQuaternion(u),new J([0,l[1],0]).transformByQuaternion(u),new J([0,0,l[2]]).transformByQuaternion(u)];if(t==="geographic"){let d=r.transformPosition(c),m=Et.WGS84.cartographicToCartesian(new J(d)),g=e.normalReferenceFrame==="vertex-reference-frame"?h.map(y=>CC(y,d)):h;return OC().map(y=>{let b=new J(m);for(let w=0;w<3;w++)b.add(new J(g[w]).scale(y[w]));return Array.from(Et.WGS84.cartesianToCartographic(b))})}return OC().map(d=>{let m=new J(c);for(let g=0;g<3;g++)m.add(new J(h[g]).scale(d[g]));return Array.from(m)})}let o=e.mbs?Array.from(e.mbs):[];if(o.length<4)return[];let s=o.slice(0,3);s[2]*=n;let a=o[3];if(t==="geographic"){let c=r.transformPosition(s),l=Et.WGS84.cartographicToCartesian(new J(c));return BC().map(u=>Array.from(Et.WGS84.cartesianToCartographic(new J(l).add(new J(u).scale(a)))))}return BC().map(c=>Array.from(new J(s).add(new J(c).scale(a))))}function OC(){return[-1,1].flatMap(e=>[-1,1].flatMap(t=>[-1,1].map(r=>[e,t,r])))}function BC(){return[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]]}function eX(){return[new J([1,0,0]),new J([0,1,0]),new J([0,0,1])]}function CC(e,t){let r=t[0]*Math.PI/180,n=t[1]*Math.PI/180,i=new J([-Math.sin(r),Math.cos(r),0]),o=new J([-Math.sin(n)*Math.cos(r),-Math.sin(n)*Math.sin(r),Math.cos(n)]),s=new J([Math.cos(n)*Math.cos(r),Math.cos(n)*Math.sin(r),Math.sin(n)]);return i.scale(e[0]).add(o.scale(e[1])).add(s.scale(e[2]))}function tX(e,t){let r=t[0]*Math.PI/180,n=t[1]*Math.PI/180,i=new J([-Math.sin(r),Math.cos(r),0]),o=new J([-Math.sin(n)*Math.cos(r),-Math.sin(n)*Math.sin(r),Math.cos(n)]),s=new J([Math.cos(n)*Math.cos(r),Math.cos(n)*Math.sin(r),Math.sin(n)]);return new J([i.dot(e),o.dot(e),s.dot(e)])}function ul(e){let t=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(let o of e)for(let s=0;s<3;s++)t[s]=Math.min(t[s],o[s]),r[s]=Math.max(r[s],o[s]);let n=t.map((o,s)=>(o+r[s])/2),i=t.map((o,s)=>(r[s]-o)/2);return[n[0],n[1],n[2],i[0],0,0,0,i[1],0,0,0,i[2]]}function Ha(e){let t=e[0][0],r=1/0,n=-1/0,i=1/0,o=-1/0,s=1/0,a=-1/0;for(let c of e){let l=t+m_(c[0]-t);r=Math.min(r,l),n=Math.max(n,l),i=Math.min(i,c[1]),o=Math.max(o,c[1]),s=Math.min(s,c[2]),a=Math.max(a,c[2])}return[m_(r)*Math.PI/180,i*Math.PI/180,m_(n)*Math.PI/180,o*Math.PI/180,s,a]}function m_(e){return((e+180)%360+360)%360-180}var Jh,DC=p(()=>{"use strict";Dn();Cf();h_();oR();aR();Jh=class{spatialReference;targetCoordinateFrame;positionTransformer;sourceToGeographicTransformer;geographicToTargetTransformer;sourceCoordinateFrame;sourceVerticalUnitScale;elevationMode;elevationOffset;elevationProvider;providerUnitScale;providerHeightTransformer;constructor(t,r={}){var a;if(t.status!=="transformable"&&t.status!=="transformed")throw new Error("I3SSpatialTransformer requires a requested, transformable spatial output");let n=t.targetCrs||t.sourceCrs;if(!n)throw new Error("I3S spatial transformation requires a target CRS");if(this.positionTransformer=new ll(t,r),this.sourceCoordinateFrame=t.coordinateFrame,this.sourceVerticalUnitScale=t.verticalUnitScale,this.elevationMode=t.elevationMode,this.elevationOffset=(t.elevationOffset||0)*t.elevationUnitScale,this.elevationProvider=JK(this.elevationMode,r),this.elevationProvider&&(typeof this.elevationProvider.sampleElevations!="function"||typeof this.elevationProvider.getElevationRange!="function"))throw new Error("An I3S elevation provider must implement sampleElevations() and getElevationRange()");let i=sR(((a=this.elevationProvider)==null?void 0:a.unit)||"meter");if(this.elevationProvider&&i===void 0)throw new Error(`Unsupported elevation-provider unit ${this.elevationProvider.unit}`);this.providerUnitScale=i||1,this.targetCoordinateFrame=To(n),this.spatialReference=iR(t);let o=zp({sourceCrs:t.sourceCrs,heightReference:t.heightReference,coordinateFrame:t.coordinateFrame,axisOrder:t.axisOrder,provenance:t.provenance},{targetCrs:"EPSG:4326"});if(this.sourceToGeographicTransformer=new ll(o),Ku(this.elevationMode)){if(!this.elevationProvider){let l=this.elevationMode==="relativeToScene"?"scene":"terrain";throw new Error(`I3S elevation mode ${this.elevationMode} requires a ${l} elevation provider`)}if(t.heightReference==="unknown")throw new Error(`I3S elevation mode ${this.elevationMode} requires a known source height reference`);let c=this.elevationProvider.heightReference||t.heightReference;if(c!==t.heightReference){if(t.heightReference!=="ellipsoidal"&&t.heightReference!=="orthometric")throw new Error("Converting elevation-provider heights requires an ellipsoidal or orthometric source height reference");let l=zp({sourceCrs:"EPSG:4326",heightReference:c,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"caller-override"},{targetCrs:"EPSG:4326",targetHeightReference:t.heightReference,geoidModel:r.geoidModel});this.providerHeightTransformer=new ll(l,r)}}let s=zp({sourceCrs:"EPSG:4326",heightReference:t.heightReference,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"format-default"},{targetCrs:n,targetHeightReference:t.targetHeightReference,geoidModel:r.geoidModel});this.geographicToTargetTransformer=new ll(s,r)}transformPosition(t){let r=this.placeSourcePositionsSync(t),n=this.positionTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}async transformPositionAsync(t){let r=await this.placeSourcePositions(t),n=this.positionTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}transformPlacedPosition(t){let r=this.positionTransformer.transformPosition([t[0],t[1],t[2]]);return[r[0],r[1],r[2]]}transformSourcePositionToGeographic(t){let r=this.placeSourcePositionsSync(t),n=this.sourceToGeographicTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}async transformSourcePositionToGeographicAsync(t){let r=await this.placeSourcePositions(t),n=this.sourceToGeographicTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}transformPositions(t,r){let n=this.placeSourcePositionsSync(t),i=this.placeSourcePositionsSync(r);return this.transformPlacedPositions(n,i)}async transformPositionsAsync(t,r){let n=new Float64Array(t.length+3);n.set(Array.from(t),0),n.set(Array.from(r).slice(0,3),t.length);let i=await this.placeSourcePositions(n);return this.transformPlacedPositions(i.subarray(0,t.length),i.subarray(t.length))}async transformGeometryAsync(t,r,n="earth-centered"){if(t.length%3||r&&r.length!==t.length)throw new Error("Conversion positions and normals must contain matching finite xyz triples");for(let o=0;o<t.length;o++)if(!Number.isFinite(t[o])||r&&!Number.isFinite(r[o]))throw new Error("Conversion positions and normals must contain matching finite xyz triples");if(!["earth-centered","vertex-reference-frame"].includes(n))throw new Error("Unsupported I3S normal reference frame");let i=await this.placeSourcePositions(t);return{positions:this.positionTransformer.transformPositions(i),normals:r?this.transformNormals(r,i,n):void 0}}transformPlacedPositions(t,r){let n=this.transformPlacedPosition(r),i=new Float32Array(t.length),o=Float64Array.from(t);for(let c=0;c<t.length;c+=3){let l=this.transformPlacedPosition([t[c],t[c+1],t[c+2]]);i[c]=l[0]-n[0],i[c+1]=l[1]-n[1],i[c+2]=l[2]-n[2]}let s=this.targetCoordinateFrame==="geographic",a=s?new gn:new gn().translate(n);return{positions:i,sourcePositions:o,origin:n,cartographicOrigin:s?n:[0,0,0],coordinateSystem:s?"lnglat-offsets":"cartesian",modelMatrix:a}}transformNormals(t,r,n="earth-centered"){if(t.length!==r.length||t.length%3)throw new Error("I3S normals and positions must have matching xyz component counts");let i=new Float32Array(t.length);if(n==="earth-centered"&&(this.spatialReference.targetCrs||this.spatialReference.sourceCrs)==="EPSG:4978"){for(let o=0;o<t.length;o+=3){let s=Math.hypot(t[o],t[o+1],t[o+2]);for(let a=0;a<3;a++)i[o+a]=s?t[o+a]/s:t[o+a]}return i}for(let o=0;o<t.length;o+=3){let s=this.sourceToGeographicTransformer.transformPosition([r[o],r[o+1],r[o+2]]),a=new J([t[o],t[o+1],t[o+2]]).normalize(),c=n==="earth-centered"?a:CC(a,s),l=this.transformEcefNormal(c,s);i.set(l,o)}return i}transformBoundingVolume(t){let n=this.getGeographicBoundSamples(t).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:Ha(n)}:{box:ul(n)}}async transformBoundingVolumeAsync(t){let n=(await this.getGeographicBoundSamplesAsync(t)).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:Ha(n)}:{box:ul(n)}}transformBoundingVolumeToGeographic(t){return{region:Ha(this.getGeographicBoundSamples(t))}}async transformBoundingVolumeToGeographicAsync(t){return{region:Ha(await this.getGeographicBoundSamplesAsync(t))}}transformBoundingVolumeToGeocentric(t){let r=this.getGeographicBoundSamples(t).map(n=>Array.from(Et.WGS84.cartographicToCartesian(new J(n))));return{box:ul(r)}}async transformBoundingVolumeToGeocentricAsync(t){let r=(await this.getGeographicBoundSamplesAsync(t)).map(n=>Array.from(Et.WGS84.cartographicToCartesian(new J(n))));return{box:ul(r)}}transformBoundingSphereToGeographic(t){var s,a;let r=(s=t.mbs)!=null&&s.length?Array.from(t.mbs).slice(0,3):t.obb?Array.from(t.obb.center).slice(0,3):null;if(!r)throw new Error("I3S spatial transformation requires an MBS or OBB bound");let n=this.placeSourcePositionsSync(r),i=this.sourceToGeographicTransformer.transformPosition(Array.from(n)),o=(a=t.mbs)!=null&&a.length?t.mbs[3]:Math.hypot(...Array.from(t.obb.halfSize).slice(0,3));return[i[0],i[1],i[2],o]}async transformBoundingSphereToGeographicAsync(t){return RC(await this.getGeographicBoundSamplesAsync(t))}async transformBoundsAsync(t){let r=await this.getGeographicBoundSamplesAsync(t),n=r.map(o=>Array.from(Et.WGS84.cartographicToCartesian(new J(o)))),i=r.map(o=>this.geographicToTargetTransformer.transformPosition(o));return{boundingVolume:{box:ul(n)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:Ha(i)}:{box:ul(i)},i3sLodMbs:Ku(this.elevationMode)?RC(r):this.transformBoundingSphereToGeographic(t)}}async transformPointCloudBoundsAsync(t){let r=await this.getGeographicBoundSamplesAsync(t),n=r.map(i=>this.geographicToTargetTransformer.transformPosition(i));return{boundingVolume:{region:Ha(r)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:Ha(n)}:{box:ul(n)}}}getGeographicBoundSamples(t){let r=LC(t,this.sourceCoordinateFrame,this.sourceToGeographicTransformer,this.sourceVerticalUnitScale);if(!r.length)throw new Error("I3S spatial transformation requires an MBS or OBB bound");let n=this.placeSourcePositionsSync(r.flat(),!0),i=d_(n);return this.sourceCoordinateFrame==="geographic"?i:i.map(o=>this.sourceToGeographicTransformer.transformPosition(o))}async getGeographicBoundSamplesAsync(t){let r=LC(t,this.sourceCoordinateFrame,this.sourceToGeographicTransformer,this.sourceVerticalUnitScale);if(!r.length)throw new Error("I3S spatial transformation requires an MBS or OBB bound");if(Ku(this.elevationMode)){let i=this.sourceCoordinateFrame==="geographic"?r:r.map(o=>this.sourceToGeographicTransformer.transformPosition(o));return await this.placeGeographicBoundSamples(i)}let n=d_(await this.placeSourcePositions(r.flat(),!0));return this.sourceCoordinateFrame==="geographic"?n:n.map(i=>this.sourceToGeographicTransformer.transformPosition(i))}async placeGeographicBoundSamples(t){let n=await this.elevationProvider.getElevationRange(QK(t)),i=n.minimum*this.providerUnitScale,o=n.maximum*this.providerUnitScale;if(!Number.isFinite(i)||!Number.isFinite(o)||i>o)throw new Error("Elevation provider returned an invalid range; minimum and maximum must be finite and ordered");let s=t.map(u=>u[2]),a=Math.min(...s),c=Math.max(...s),l=[];for(let[u,h]of t){let d=this.providerHeightTransformer?this.providerHeightTransformer.transformPosition([u,h,i])[2]:i,m=this.providerHeightTransformer?this.providerHeightTransformer.transformPosition([u,h,o])[2]:o,g=Math.min(d,m),y=Math.max(d,m),b=this.elevationMode==="onTheGround"?g:g+a+this.elevationOffset,w=this.elevationMode==="onTheGround"?y:y+c+this.elevationOffset;l.push([u,h,b],[u,h,w])}return l}placeSourcePositionsSync(t,r=!1){if(Ku(this.elevationMode))throw new Error(`I3S elevation mode ${this.elevationMode} requires asynchronous surface placement`);let n=Float64Array.from(t),i=this.elevationMode==="absoluteHeight"?this.elevationOffset:0;for(let o=2;o<n.length;o+=3)n[o]=n[o]*(r?1:this.sourceVerticalUnitScale)+i;return n}async placeSourcePositions(t,r=!1){if(!Ku(this.elevationMode))return this.placeSourcePositionsSync(t,r);let n=Float64Array.from(t),i=d_(n).map(s=>{let a=this.sourceToGeographicTransformer.transformPosition(s);return[a[0],a[1]]}),o=await this.elevationProvider.sampleElevations(i);if(o.length!==i.length)throw new Error(`Elevation provider returned ${o.length} heights for ${i.length} positions`);for(let s=0;s<i.length;s++){let a=o[s]*this.providerUnitScale;if(!Number.isFinite(a))throw new Error(`Elevation provider returned a non-finite height at index ${s}`);let[c,l]=i[s],u=this.providerHeightTransformer?this.providerHeightTransformer.transformPosition([c,l,a])[2]:a,h=n[s*3+2]*(r?1:this.sourceVerticalUnitScale);n[s*3+2]=this.elevationMode==="onTheGround"?u:u+h+this.elevationOffset}return n}transformEcefNormal(t,r){if(this.targetCoordinateFrame==="geocentric")return t.normalize();if(this.targetCoordinateFrame==="geographic")return tX(t,r).normalize();let n=Et.WGS84.cartographicToCartesian(new J(r)),i=[];for(let s of eX()){let a=Et.WGS84.cartesianToCartographic(new J(n).add(s)),c=Et.WGS84.cartesianToCartographic(new J(n).subtract(s)),l=this.geographicToTargetTransformer.transformPosition(a),u=this.geographicToTargetTransformer.transformPosition(c);i.push((l[0]-u[0])/2,(l[1]-u[1])/2,(l[2]-u[2])/2)}let o=new ic(i);if(Math.abs(o.determinant())<1e-12)throw new Error("Cannot transform an I3S normal through a singular local projection");return o.invert().transpose(),new J(t).transformByMatrix3(o).normalize()}}});var NC=p(()=>{"use strict";h_();DC()});function FC(e,t=null){return p_(e,t?{token:t}:void 0)}function p_(e,t){if(!t||Object.keys(t).length===0||/^(?:data|blob):/i.test(e))return e;let r=e.indexOf("#"),n=r>=0?e.slice(r):"",i=r>=0?e.slice(0,r):e,o=i.indexOf("?"),s=o>=0?i.slice(0,o):i,a=o>=0?i.slice(o+1):"",c=new URLSearchParams(a),l=new URLSearchParams;for(let[h,d]of Object.entries(t))c.has(h)||l.set(h,String(d));let u=l.toString();return`${s}${o>=0?`?${a}`:""}${u?`${o>=0?"&":"?"}${u}`:""}${n}`}var GC=p(()=>{"use strict"});function g_(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}`)}}function Xu(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 kC,y1,y_=p(()=>{"use strict";z4();kC={UInt8:Ps.UNSIGNED_BYTE,UInt16:Ps.UNSIGNED_SHORT,Float32:Ps.FLOAT,UInt32:Ps.UNSIGNED_INT,UInt64:Ps.DOUBLE};y1={DEFAULT:"default",LNGLAT:"lnglat",METER_OFFSETS:"meter-offsets",LNGLAT_OFFSETS:"lnglat-offsets",CARTESIAN:"cartesian"}});function w_(e,t){if(!e)throw new Error(`parseI3STileContent requires LoaderContext to ${t}. Nested I3S parsing must run through parseFromContext().`);return e}function rX(e){switch(e){case"ktx-etc2":case"dds":return Ho;case"ktx2":return uo;default:return Wo}}async function VC(e,t,r,n,i){var h,d;let o=((h=n==null?void 0:n.i3s)==null?void 0:h.geometryMode)??"render";if(o!=="render"&&o!=="source")throw new Error("Unsupported I3S geometry mode");let s={geometryMode:o,attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new gn,coordinateSystem:"meter-offsets",byteLength:0,texture:null,topology:t.layerType==="Point"?"point-list":"triangle-list",pointRenderer:t.pointRenderer,pointSymbol:t.pointSymbol},a=i?w_(i,"parse nested resources"):null,c=(d=t.textureUrls)!=null&&d.length?t.textureUrls:t.textureUrl?[{textureSetDefinitionId:_X(t.materialDefinition),textureUrl:t.textureUrl,textureFormat:t.textureFormat||"jpg"}]:[],l={};for(let m of c)try{let g=await iX(m.textureUrl,m.textureFormat,t,n,a||i);g&&(l[m.textureSetDefinitionId]=g)}catch(g){console.warn(g)}let u=Object.values(l)[0]||null;return s.texture=u,Object.keys(l).length>0&&(s.textures=l),s.material=bX(t.materialDefinition,l,u),s.material&&(s.texture=null),await oX(e,s,t,r,n,i)}async function iX(e,t,r,n,i){var m;let o=n==null?void 0:n.i3s,s=p_(FC(e,o==null?void 0:o.token),n==null?void 0:n.searchParams),a=rX(t),l=await((i==null?void 0:i.fetch)||fetch)(s);if(!l.ok)throw new Error(`Failed to load I3S texture: ${l.status} ${l.statusText}`);let u=await l.arrayBuffer();if(!((m=n==null?void 0:n.i3s)!=null&&m.decodeTextures))return u;let h=w_(i,"decode texture payloads");if(a===Wo){let g={...r.textureLoaderOptions};try{let y=await Tl(u,Wo,g,h);return Fm(y)}catch{let b=await Tl(u,a,g,h);return Fm(b)}}let d=await Tl(u,a,r.textureLoaderOptions,h);return a===uo&&(d=d[0]),{compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}async function oX(e,t,r,n,i,o){var m,g,y,b,w,S;let s=e.byteLength,a,c,l=0,u=0,h;if(r.isDracoGeometry){let M=w_(o,"decode Draco geometry"),v=await Tl(e,vi,{draco:{shape:"mesh",attributeNameEntry:nX}},M);c=((m=v.header)==null?void 0:m.vertexCount)??0,h=(g=v.indices)==null?void 0:g.value;let{POSITION:T,NORMAL:O,COLOR_0:P,["feature-index"]:_,["uv-region"]:U}=v.attributes;if(a={position:T,normal:O,color:P,uvRegion:U,id:_},aX(a,v.attributes),t.geometryMode==="source")for(let[L,A]of Object.entries(v.attributes))!["POSITION","NORMAL","COLOR_0","feature-index","uv-region"].includes(L)&&!/^TEXCOORD_\d+$/.test(L)&&(a[L]=A);fX(a,v);let C=vX(_);C&&(MX(a,C),t.drawRanges=uX(a.id.value,h,t.topology))}else{let M=n.store.defaultGeometrySchema;if(!M)throw new Error("Uncompressed I3S geometry requires store.defaultGeometrySchema");let{vertexAttributes:v,ordering:T,featureAttributes:O,featureAttributeOrder:P}=M,_=dX(e,M);l=_.byteOffset,c=_.vertexCount,u=_.featureCount;let{attributes:U,byteOffset:C}=jC(e,l,v,c,T),{attributes:L,byteOffset:A}=jC(e,C,O,u,P),W=sX(e,A);W&&(t.meshSegmentation=W),t.drawRanges=lX(L),SX(L),a=hX(U,L)}let d=n.spatialReference;if(t.geometryMode==="source"){if(a.position.size!==3||a.position.transform||a.position.normalized||(a.position.byteStride??0)!==0||(a.position.byteOffset??0)!==0||a.position.value.length!==c*3||r.mbs.length<3||r.mbs.slice(0,3).some(v=>!Number.isFinite(v)))throw new Error("Source I3S geometry requires packed xyz values and a finite source origin");let M=b_(a.position.value,a.position.metadata,r.mbs);if(M.some(v=>!Number.isFinite(v)))throw new Error("Source I3S positions must be finite");a.position={value:M,size:3},t.origin=[0,0,0],t.cartographicOrigin=[0,0,0],t.coordinateSystem=d!=null&&d.sourceCrs&&To(d.sourceCrs)==="geographic"?"lnglat":"cartesian",t.spatialReference=d?Object.freeze({...d,status:"native",targetCrs:void 0,targetHeightReference:"native",outputCoordinates:"auto"}):void 0,t.normalReferenceFrame=n.store.normalReferenceFrame||"earth-centered",t.sourceAttributes=a}else if((d==null?void 0:d.status)==="transformable"||(d==null?void 0:d.status)==="transformed"){let M=new Jh(d,n.spatialOptions||((y=i==null?void 0:i.i3s)==null?void 0:y.spatial)),v=b_(a.position.value,a.position.metadata,r.mbs),T=await M.transformPositionsAsync(v,r.mbs);a.position.value=T.positions,(b=a.normal)!=null&&b.value&&(a.normal.value=M.transformNormals(a.normal.value,T.sourcePositions,n.store.normalReferenceFrame)),t.modelMatrix=T.modelMatrix,t.coordinateSystem=T.coordinateSystem,t.origin=T.origin,t.cartographicOrigin=T.cartographicOrigin,t.spatialReference=M.spatialReference}else if(!((w=i==null?void 0:i.i3s)!=null&&w.coordinateSystem)||i.i3s.coordinateSystem===y1.METER_OFFSETS){let M=pX(a.position,r);t.modelMatrix=M.invert(),t.coordinateSystem="meter-offsets"}else t.modelMatrix=yX(a.position),t.coordinateSystem="lnglat-offsets";t.attributes={positions:a.position,normals:a.normal,colors:UC(a.color,((S=i==null?void 0:i.i3s)==null?void 0:S.colorFormat)||"uint8norm"),uvRegions:UC(a.uvRegion||a.region)},cX(t.attributes,a),t.indices=h||null,a.id&&a.id.value&&(t.featureIds=a.id.value);for(let M in t.attributes)t.attributes[M]||delete t.attributes[M];return t.vertexCount=c,t.byteLength=s,t}function sX(e,t){return t<e.byteLength?e.slice(t):void 0}function aX(e,t){for(let[r,n]of Object.entries(t)){let i=/^TEXCOORD_(\d+)$/.exec(r);i&&(e[`uv${Number(i[1])}`]=n)}}function cX(e,t){for(let[r,n]of Object.entries(t)){let i=/^uv(\d+)$/.exec(r);if(!i||!n)continue;let o=Number(i[1]);e[o===0?"texCoords":`texCoords${o}`]=n}}function lX(e){var o,s;let t=(o=e.id)==null?void 0:o.value,r=(s=e.faceRange)==null?void 0:s.value;if(!t||!r)return;let n=[],i=Math.min(t.length,Math.floor(r.length/2));for(let a=0;a<i;a++){let c=Number(r[a*2]),l=Number(r[a*2+1]);if(l<c)continue;let u=l-c+1;n.push({featureId:Number(t[a]),firstPrimitive:c,primitiveCount:u,firstVertex:c*3,vertexCount:u*3})}return n.length?n:void 0}function uX(e,t,r){let n=r==="point-list"?1:3,i=(t==null?void 0:t.length)||e.length,o=Math.floor(i/n);if(!o)return;let s=[];for(let a=0;a<o;a++){let c=a*n,l=t?Number(t[c]):c,u=Number(e[l]),h=s[s.length-1];(h==null?void 0:h.featureId)===u?(h.primitiveCount++,h.vertexCount+=n):s.push({featureId:u,firstPrimitive:a,primitiveCount:1,firstVertex:c,vertexCount:n})}return s}function fX(e,t){for(let r in t.loaderData.attributes){let n=t.loaderData.attributes[r];switch(n.name){case"POSITION":e.position.metadata=n.metadata;break;case"feature-index":e.id.metadata=n.metadata;break;default:break}}}function hX(e,t){return{...e,...t}}function UC(e,t="uint8norm"){return e&&(t==="float16"&&!e.componentType?{...e,value:jw(e.value,255),normalized:!1,componentType:"float16"}:t==="float32"&&!e.componentType?{...e,value:Float32Array.from(e.value,r=>r/255),normalized:!1}:{...e,normalized:!0})}function dX(e,t){let r=0,n=0,i=0;for(let{property:o,type:s}of t.header){let a=g_(s);switch(o){case"vertexCount".toString():n=new a(e,0,4)[0],r+=Xu(s);break;case"featureCount".toString():i=new a(e,4,4)[0],r+=Xu(s);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function jC(e,t,r,n,i){let o={};for(let s of i)if(r[s]){let{valueType:a,valuesPerElement:c}=r[s];if(t+n*c*Xu(a)<=e.byteLength){let l=e.slice(t),u;if(a==="UInt64")u=mX(l,n*c,Xu(a));else{let h=g_(a);u=new h(l,0,n*c)}o[s]={value:u,type:kC[a],size:c},s==="color"&&(o.color.normalized=!0),t=t+n*c*Xu(a)}else if(s!=="uv0")break}return{attributes:o,byteOffset:t}}function mX(e,t,r){let n=[],i=new DataView(e),o=0;for(let s=0;s<t;s++){let a=i.getUint32(o,!0),c=i.getUint32(o+4,!0),l=a+2**32*c;n.push(l),o+=r}return new Float64Array(n)}function pX(e,t){let r=t.mbs,n=e.value,i=e.metadata,o=new gn,s=new J(r[0],r[1],r[2]),a=new J;return Et.WGS84.cartographicToCartesian(s,a),My(Et.WGS84,a,o),e.value=gX(n,i,s),o}function b_(e,t={},r){var s,a;let n=new Float64Array(e.length),i=((s=t["i3s-scale_x"])==null?void 0:s.double)??1,o=((a=t["i3s-scale_y"])==null?void 0:a.double)??1;for(let c=0;c<n.length;c+=3)n[c]=e[c]*i+r[0],n[c+1]=e[c+1]*o+r[1],n[c+2]=e[c+2]+r[2];return n}function gX(e,t={},r){let n=b_(e,t,r);for(let i=0;i<n.length;i+=3)Et.WGS84.cartographicToCartesian(n.subarray(i,i+3),b1),n[i]=b1.x,n[i+1]=b1.y,n[i+2]=b1.z;return n}function yX(e){var o,s;let t=e.metadata,r=((o=t==null?void 0:t["i3s-scale_x"])==null?void 0:o.double)||1,n=((s=t==null?void 0:t["i3s-scale_y"])==null?void 0:s.double)||1,i=new gn;return i[0]=r,i[5]=n,i}function bX(e,t={},r){var o;let n=[e==null?void 0:e.emissiveFactor,(o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.baseColorFactor].some(s=>s==null?void 0:s.some(a=>a>1))?255:1,i;return e?i={...e,normalTexture:e.normalTexture?{...e.normalTexture}:void 0,occlusionTexture:e.occlusionTexture?{...e.occlusionTexture}:void 0,emissiveTexture:e.emissiveTexture?{...e.emissiveTexture}:void 0,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness,baseColorTexture:e.pbrMetallicRoughness.baseColorTexture?{...e.pbrMetallicRoughness.baseColorTexture}:void 0,metallicRoughnessTexture:e.pbrMetallicRoughness.metallicRoughnessTexture?{...e.pbrMetallicRoughness.metallicRoughnessTexture}:void 0}:{baseColorFactor:[n,n,n,n]}}:(i={pbrMetallicRoughness:{}},r?i.pbrMetallicRoughness.baseColorTexture={texCoord:0,textureSetDefinitionId:0}:i.pbrMetallicRoughness.baseColorFactor=[n,n,n,n]),i.alphaCutoff=i.alphaCutoff??.25,i.alphaMode&&(i.alphaMode=i.alphaMode.toUpperCase()),i.emissiveFactor&&(i.emissiveFactor=zC(i.emissiveFactor,n)),i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorFactor&&(i.pbrMetallicRoughness.baseColorFactor=zC(i.pbrMetallicRoughness.baseColorFactor,n)),Object.keys(t).length>0?xX(i,t):r&&wX(i,r),i}function zC(e,t){let r=[...e];for(let n=0;n<e.length;n++){let i=e[n]/t;r[n]=n<3?i<=.04045?i/12.92:((i+.055)/1.055)**2.4:i}return r}function wX(e,t){if(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture){let r=e.pbrMetallicRoughness.baseColorTexture;e.pbrMetallicRoughness.baseColorTexture={...r,texture:Yu(t,r)}}else if(e.emissiveTexture){let r=e.emissiveTexture;e.emissiveTexture={...r,texture:Yu(t,r)}}else if(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture){let r=e.pbrMetallicRoughness.metallicRoughnessTexture;e.pbrMetallicRoughness.metallicRoughnessTexture={...r,texture:Yu(t,r)}}else if(e.normalTexture){let r=e.normalTexture;e.normalTexture={...r,texture:Yu(t,r)}}else if(e.occlusionTexture){let r=e.occlusionTexture;e.occlusionTexture={...r,texture:Yu(t,r)}}}function xX(e,t){var n,i;let r=[(n=e.pbrMetallicRoughness)==null?void 0:n.baseColorTexture,(i=e.pbrMetallicRoughness)==null?void 0:i.metallicRoughnessTexture,e.normalTexture,e.occlusionTexture,e.emissiveTexture];for(let o of r){if(!o)continue;let s=t[o.textureSetDefinitionId];s&&(o.texture=Yu(s,o))}}function Yu(e,t){let r=qC(t.wrapS),n=qC(t.wrapT),i=r||n?{wrapS:r||10497,wrapT:n||10497}:void 0;return i?{source:{image:e},sampler:i}:{source:{image:e}}}function qC(e){switch(e){case"none":return 33071;case"mirror":return 33648;case"repeat":return 10497;default:return}}function _X(e){var t,r,n,i,o,s,a;return((r=(t=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:t.baseColorTexture)==null?void 0:r.textureSetDefinitionId)??((i=(n=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:n.metallicRoughnessTexture)==null?void 0:i.textureSetDefinitionId)??((o=e==null?void 0:e.normalTexture)==null?void 0:o.textureSetDefinitionId)??((s=e==null?void 0:e.occlusionTexture)==null?void 0:s.textureSetDefinitionId)??((a=e==null?void 0:e.emissiveTexture)==null?void 0:a.textureSetDefinitionId)??0}function SX(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let n=t.value,i=r.value,o=i[i.length-1]+1,s=new Float64Array(o*3),a=0,c=0;for(let l=1;l<i.length;l+=2){let u=Number(n[a]),h=i[l],d=i[l-1],m=h-d+1,g=c+m*3;s.fill(u,c,g),a++,c=g}e.id.value=s}function MX(e,t){let r=e.id.value,n=new Float64Array(r.length);for(let i=0;i<r.length;i++)n[i]=t[r[i]];e.id.value=n}function vX(e){var t,r;return(r=(t=e==null?void 0:e.metadata)==null?void 0:t["i3s-feature-ids"])==null?void 0:r.intArray}var b1,nX,WC=p(()=>{"use strict";Oh();Dn();Cf();Cf();zs();Uf();$w();Uf();NC();GC();y_();b1=new J([0,0,0]);nX="i3s-attribute-type"});var w1,x_,Gve,HC,kve,Uve,jve,zve,qve,$C=p(()=>{"use strict";w1=(e,t,r,n)=>({name:e,id:t,module:"tiles-3d",encoding:"binary",format:r,extensions:n,mimeTypes:["application/octet-stream"],binary:!0}),x_=(e,t,r)=>({name:e,id:t,module:"tiles-3d",encoding:"json",format:r,extensions:["json"],mimeTypes:["application/json"],text:!0}),Gve=w1("I3S","i3s","i3s",["bin"]),HC=w1("I3S Content","i3s-content","i3s-content",["bin"]),kve=w1("I3S Attribute","i3s-attribute","i3s-attribute",["bin"]),Uve=w1("I3S LEPCC","i3s-lepcc","i3s-lepcc",["bin"]),jve=x_("I3S Node Page","i3s-node-page","i3s-node-page"),zve=x_("ArcGIS Web Scene","arcgis-web-scene","arcgis-web-scene"),qve=x_("I3S Building Scene Layer","i3s-building-scene-layer","i3s-building-scene-layer")});var KC,XC=p(()=>{"use strict";y_();KC={token:void 0,isTileset:"auto",isTileHeader:"auto",tile:void 0,tileset:void 0,_tileOptions:void 0,_tilesetOptions:void 0,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,attributeValues:"legacy",colorFormat:"uint8norm",geometryMode:"render",coordinateSystem:y1.METER_OFFSETS}});var EX,YC,ZC=p(()=>{"use strict";$C();XC();EX="5.0.0-beta.2",YC={...HC,dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"tiles-3d",worker:!0,workerSourceNode:"i3s/workers/i3s-content-worker-node.ts",version:EX,mimeTypes:["application/octet-stream"],preload:async()=>(await Promise.resolve().then(()=>(__(),JC))).I3SContentLoaderWithParser,extensions:["bin"],options:{i3s:KC,"i3s-content":{}}}});var JC={};ir(JC,{I3SContentLoaderWithParser:()=>S_});async function TX(e,t,r){let{tile:n,_tileOptions:i,tileset:o,_tilesetOptions:s}=(t==null?void 0:t.i3s)||{},a=i||n,c=s||o;return!a||!c?null:await VC(e,a,c,t,r)}var tEe,AX,S_,__=p(()=>{"use strict";Uf();$w();Uf();WC();ZC();({preload:tEe,...AX}=YC),S_={...AX,subloaders:{ImageLoader:Wo,DracoLoader:vi,BasisLoader:uo,CompressedTextureLoader:Ho},parse:TX}});var T_=typeof process!="object"||String(process)!=="[object process]"||process.browser;var I_={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"]=I_||{};function Ae(e,t,r){return t<=e&&e<=r}function oD(e,t){return e.indexOf(t)!==-1}var Ro=Math.floor;function ld(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function sD(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var o=t.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===r-1)i.push(65533);else{var s=t.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=o&1023,c=s&1023;i.push(65536+(a<<10)+c),n+=1}else i.push(65533)}n+=1}return i}function aD(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return t}function ci(e){return 0<=e&&e<=127}var ai=ci,Ye=-1;function N1(e){this.tokens=[].slice.call(e),this.tokens.reverse()}N1.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Ye},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};var pt=-1;function Xe(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Ai(e){throw TypeError("The code point "+e+" could not be encoded.")}function cD(){}cD.prototype={handler:function(e,t){}};function lD(){}lD.prototype={handler:function(e,t){}};function C1(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(D1,e)?D1[e]:null}var P_=[{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"}],D1={};P_.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){D1[r]=t})})});var dn={},mn={};function dl(e,t){return t&&t[e]||null}function ml(e,t){var r=t.indexOf(e);return r===-1?null:r}function Yr(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 uD(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Yr("gb18030-ranges"),i;for(i=0;i<n.length;++i){var o=n[i];if(o[0]<=e)t=o[0],r=o[1];else break}return r+e-t}function fD(e){if(e===59335)return 7457;var t=0,r=0,n=Yr("gb18030-ranges"),i;for(i=0;i<n.length;++i){var o=n[i];if(o[1]<=e)t=o[1],r=o[0];else break}return r+e-t}function hD(e){O1=O1||Yr("jis0208").map(function(r,n){return Ae(n,8272,8835)?null:r});var t=O1;return t.indexOf(e)}var O1;function dD(e){B1=B1||Yr("big5").map(function(r,n){return n<5024?null:r});var t=B1;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):ml(e,t)}var B1,R_="utf-8";function Ka(e,t){if(!(this instanceof Ka))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):R_,t=ld(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=C1(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!mn[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var n=this;return n._encoding=r,t.fatal&&(n._error_mode="fatal"),t.ignoreBOM&&(n._ignoreBOM=!0),Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase(),this.fatal=n._error_mode==="fatal",this.ignoreBOM=n._ignoreBOM),n}Object.defineProperty&&(Object.defineProperty(Ka.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Ka.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Ka.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Ka.prototype.decode=function(t,r){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),r=ld(r),this._do_not_flush||(this._decoder=mn[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=!!r.stream;for(var i=new N1(n),o=[],s;;){var a=i.read();if(a===Ye||(s=this._decoder.handler(i,a),s===pt))break;s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s))}if(!this._do_not_flush){do{if(s=this._decoder.handler(i,i.read()),s===pt)break;s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s))}while(!i.endOfStream());this._decoder=null}function c(l){return oD(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(l.length>0&&l[0]===65279?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),aD(l)}return c.call(this,o)};function sf(e,t){if(!(this instanceof sf))throw TypeError("Called as a function. Did you forget 'new'?");t=ld(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=t.fatal?"fatal":"replacement";var r=this;if(t.NONSTANDARD_allowLegacyEncoding){e=e!==void 0?String(e):R_;var n=C1(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!dn[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=C1("utf-8"),e!==void 0&&"console"in globalThis;return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(sf.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});sf.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=ld(r),this._do_not_flush||(this._encoder=dn[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=!!r.stream;for(var n=new N1(sD(t)),i=[],o;;){var s=n.read();if(s===Ye||(o=this._encoder.handler(n,s),o===pt))break;Array.isArray(o)?i.push.apply(i,o):i.push(o)}if(!this._do_not_flush){for(;o=this._encoder.handler(n,n.read()),o!==pt;)Array.isArray(o)?i.push.apply(i,o):i.push(o);this._encoder=null}return new Uint8Array(i)};function mD(e){var t=e.fatal,r=0,n=0,i=0,o=128,s=191;this.handler=function(a,c){if(c===Ye&&i!==0)return i=0,Xe(t);if(c===Ye)return pt;if(i===0){if(Ae(c,0,127))return c;if(Ae(c,194,223))i=1,r=c&31;else if(Ae(c,224,239))c===224&&(o=160),c===237&&(s=159),i=2,r=c&15;else if(Ae(c,240,244))c===240&&(o=144),c===244&&(s=143),i=3,r=c&7;else return Xe(t);return null}if(!Ae(c,o,s))return r=i=n=0,o=128,s=191,a.prepend(c),Xe(t);if(o=128,s=191,r=r<<6|c&63,n+=1,n!==i)return null;var l=r;return r=i=n=0,l}}function pD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return pt;if(ai(n))return n;var i,o;Ae(n,128,2047)?(i=1,o=192):Ae(n,2048,65535)?(i=2,o=224):Ae(n,65536,1114111)&&(i=3,o=240);for(var s=[(n>>6*i)+o];i>0;){var a=n>>6*(i-1);s.push(128|a&63),i-=1}return s}}dn["UTF-8"]=function(e){return new pD(e)};mn["UTF-8"]=function(e){return new mD(e)};function gD(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return pt;if(ci(i))return i;var o=e[i-128];return o===null?Xe(r):o}}function yD(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return pt;if(ai(i))return i;var o=ml(i,e);return o===null&&Ai(i),o+128}}(function(){"encoding-indexes"in globalThis&&P_.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Yr(r.toLowerCase());mn[r]=function(i){return new gD(n,i)},dn[r]=function(i){return new yD(n,i)}})})})();mn.GBK=function(e){return new L_(e)};dn.GBK=function(e){return new O_(e,!0)};function L_(e){var t=e.fatal,r=0,n=0,i=0;this.handler=function(o,s){if(s===Ye&&r===0&&n===0&&i===0)return pt;s===Ye&&(r!==0||n!==0||i!==0)&&(r=0,n=0,i=0,Xe(t));var a;if(i!==0){a=null,Ae(s,48,57)&&(a=uD((((r-129)*10+n-48)*126+i-129)*10+s-48));var c=[n,i,s];return r=0,n=0,i=0,a===null?(o.prepend(c),Xe(t)):a}if(n!==0)return Ae(s,129,254)?(i=s,null):(o.prepend([n,s]),r=0,n=0,Xe(t));if(r!==0){if(Ae(s,48,57))return n=s,null;var l=r,u=null;r=0;var h=s<127?64:65;return(Ae(s,64,126)||Ae(s,128,254))&&(u=(l-129)*190+(s-h)),a=u===null?null:dl(u,Yr("gb18030")),a===null&&ci(s)&&o.prepend(s),a===null?Xe(t):a}return ci(s)?s:s===128?8364:Ae(s,129,254)?(r=s,null):Xe(t)}}function O_(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Ye)return pt;if(ai(i))return i;if(i===58853)return Ai(i);if(t&&i===8364)return 128;var o=ml(i,Yr("gb18030"));if(o!==null){var s=Ro(o/190)+129,a=o%190,c=a<63?64:65;return[s,a+c]}if(t)return Ai(i);o=fD(i);var l=Ro(o/10/126/10);o=o-l*10*126*10;var u=Ro(o/10/126);o=o-u*10*126;var h=Ro(o/10),d=o-h*10;return[l+129,u+48,h+129,d+48]}}dn.gb18030=function(e){return new O_(e)};mn.gb18030=function(e){return new L_(e)};function bD(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(t);if(i===Ye&&r===0)return pt;if(r!==0){var o=r,s=null;r=0;var a=i<127?64:98;switch((Ae(i,64,126)||Ae(i,161,254))&&(s=(o-129)*157+(i-a)),s){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var c=s===null?null:dl(s,Yr("big5"));return c===null&&ci(i)&&n.prepend(i),c===null?Xe(t):c}return ci(i)?i:Ae(i,129,254)?(r=i,null):Xe(t)}}function wD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return pt;if(ai(n))return n;var i=dD(n);if(i===null)return Ai(n);var o=Ro(i/157)+129;if(o<161)return Ai(n);var s=i%157,a=s<63?64:98;return[o,s+a]}}dn.Big5=function(e){return new wD(e)};mn.Big5=function(e){return new bD(e)};function xD(e){var t=e.fatal,r=!1,n=0;this.handler=function(i,o){if(o===Ye&&n!==0)return n=0,Xe(t);if(o===Ye&&n===0)return pt;if(n===142&&Ae(o,161,223))return n=0,65216+o;if(n===143&&Ae(o,161,254))return r=!0,n=o,null;if(n!==0){var s=n;n=0;var a=null;return Ae(s,161,254)&&Ae(o,161,254)&&(a=dl((s-161)*94+(o-161),Yr(r?"jis0212":"jis0208"))),r=!1,Ae(o,161,254)||i.prepend(o),a===null?Xe(t):a}return ci(o)?o:o===142||o===143||Ae(o,161,254)?(n=o,null):Xe(t)}}function _D(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return pt;if(ai(n))return n;if(n===165)return 92;if(n===8254)return 126;if(Ae(n,65377,65439))return[142,n-65377+161];n===8722&&(n=65293);var i=ml(n,Yr("jis0208"));if(i===null)return Ai(n);var o=Ro(i/94)+161,s=i%94+161;return[o,s]}}dn["EUC-JP"]=function(e){return new _D(e)};mn["EUC-JP"]=function(e){return new xD(e)};function SD(e){var t=e.fatal,r={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},n=r.ASCII,i=r.ASCII,o=0,s=!1;this.handler=function(a,c){switch(n){default:case r.ASCII:return c===27?(n=r.EscapeStart,null):Ae(c,0,127)&&c!==14&&c!==15&&c!==27?(s=!1,c):c===Ye?pt:(s=!1,Xe(t));case r.Roman:return c===27?(n=r.EscapeStart,null):c===92?(s=!1,165):c===126?(s=!1,8254):Ae(c,0,127)&&c!==14&&c!==15&&c!==27&&c!==92&&c!==126?(s=!1,c):c===Ye?pt:(s=!1,Xe(t));case r.Katakana:return c===27?(n=r.EscapeStart,null):Ae(c,33,95)?(s=!1,65344+c):c===Ye?pt:(s=!1,Xe(t));case r.LeadByte:return c===27?(n=r.EscapeStart,null):Ae(c,33,126)?(s=!1,o=c,n=r.TrailByte,null):c===Ye?pt:(s=!1,Xe(t));case r.TrailByte:if(c===27)return n=r.EscapeStart,Xe(t);if(Ae(c,33,126)){n=r.LeadByte;var l=(o-33)*94+c-33,u=dl(l,Yr("jis0208"));return u===null?Xe(t):u}return c===Ye?(n=r.LeadByte,a.prepend(c),Xe(t)):(n=r.LeadByte,Xe(t));case r.EscapeStart:return c===36||c===40?(o=c,n=r.Escape,null):(a.prepend(c),s=!1,n=i,Xe(t));case r.Escape:var h=o;o=0;var d=null;if(h===40&&c===66&&(d=r.ASCII),h===40&&c===74&&(d=r.Roman),h===40&&c===73&&(d=r.Katakana),h===36&&(c===64||c===66)&&(d=r.LeadByte),d!==null){n=n=d;var m=s;return s=!0,m?Xe(t):null}return a.prepend([h,c]),s=!1,n=i,Xe(t)}}}function MD(e){var t=e.fatal,r={ASCII:0,Roman:1,jis0208:2},n=r.ASCII;this.handler=function(i,o){if(o===Ye&&n!==r.ASCII)return i.prepend(o),n=r.ASCII,[27,40,66];if(o===Ye&&n===r.ASCII)return pt;if((n===r.ASCII||n===r.Roman)&&(o===14||o===15||o===27))return Ai(65533);if(n===r.ASCII&&ai(o))return o;if(n===r.Roman&&(ai(o)&&o!==92&&o!==126||o===165||o===8254)){if(ai(o))return o;if(o===165)return 92;if(o===8254)return 126}if(ai(o)&&n!==r.ASCII)return i.prepend(o),n=r.ASCII,[27,40,66];if((o===165||o===8254)&&n!==r.Roman)return i.prepend(o),n=r.Roman,[27,40,74];o===8722&&(o=65293);var s=ml(o,Yr("jis0208"));if(s===null)return Ai(o);if(n!==r.jis0208)return i.prepend(o),n=r.jis0208,[27,36,66];var a=Ro(s/94)+33,c=s%94+33;return[a,c]}}dn["ISO-2022-JP"]=function(e){return new MD(e)};mn["ISO-2022-JP"]=function(e){return new SD(e)};function vD(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(t);if(i===Ye&&r===0)return pt;if(r!==0){var o=r,s=null;r=0;var a=i<127?64:65,c=o<160?129:193;if((Ae(i,64,126)||Ae(i,128,252))&&(s=(o-c)*188+i-a),Ae(s,8836,10715))return 48508+s;var l=s===null?null:dl(s,Yr("jis0208"));return l===null&&ci(i)&&n.prepend(i),l===null?Xe(t):l}return ci(i)||i===128?i:Ae(i,161,223)?65216+i:Ae(i,129,159)||Ae(i,224,252)?(r=i,null):Xe(t)}}function ED(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return pt;if(ai(n)||n===128)return n;if(n===165)return 92;if(n===8254)return 126;if(Ae(n,65377,65439))return n-65377+161;n===8722&&(n=65293);var i=hD(n);if(i===null)return Ai(n);var o=Ro(i/188),s=o<31?129:193,a=i%188,c=a<63?64:65;return[o+s,a+c]}}dn.Shift_JIS=function(e){return new ED(e)};mn.Shift_JIS=function(e){return new vD(e)};function AD(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(t);if(i===Ye&&r===0)return pt;if(r!==0){var o=r,s=null;r=0,Ae(i,65,254)&&(s=(o-129)*190+(i-65));var a=s===null?null:dl(s,Yr("euc-kr"));return s===null&&ci(i)&&n.prepend(i),a===null?Xe(t):a}return ci(i)?i:Ae(i,129,254)?(r=i,null):Xe(t)}}function TD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return pt;if(ai(n))return n;var i=ml(n,Yr("euc-kr"));if(i===null)return Ai(n);var o=Ro(i/190)+129,s=i%190+65;return[o,s]}}dn["EUC-KR"]=function(e){return new TD(e)};mn["EUC-KR"]=function(e){return new AD(e)};function cd(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function B_(e,t){var r=t.fatal,n=null,i=null;this.handler=function(o,s){if(s===Ye&&(n!==null||i!==null))return Xe(r);if(s===Ye&&n===null&&i===null)return pt;if(n===null)return n=s,null;var a;if(e?a=(n<<8)+s:a=(s<<8)+n,n=null,i!==null){var c=i;return i=null,Ae(a,56320,57343)?65536+(c-55296)*1024+(a-56320):(o.prepend(cd(a,e)),Xe(r))}return Ae(a,55296,56319)?(i=a,null):Ae(a,56320,57343)?Xe(r):a}}function C_(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return pt;if(Ae(i,0,65535))return cd(i,e);var o=cd((i-65536>>10)+55296,e),s=cd((i-65536&1023)+56320,e);return o.concat(s)}}dn["UTF-16BE"]=function(e){return new C_(!0,e)};mn["UTF-16BE"]=function(e){return new B_(!0,e)};dn["UTF-16LE"]=function(e){return new C_(!1,e)};mn["UTF-16LE"]=function(e){return new B_(!1,e)};function ID(e){var t=e.fatal;this.handler=function(r,n){return n===Ye?pt:ci(n)?n:63360+n-128}}function PD(e){var t=e.fatal;this.handler=function(r,n){return n===Ye?pt:ai(n)?n:Ae(n,63360,63487)?n-63360+128:Ai(n)}}dn["x-user-defined"]=function(e){return new PD(e)};mn["x-user-defined"]=function(e){return new ID(e)};function af(e){return Buffer.from(e).toString("base64")}function F1(e){return Buffer.from(e,"base64").toString("ascii")}async function Bd(){try{return(await Promise.resolve().then(()=>(J3(),Z3))).default}catch(e){throw new Error("Node image decoding and encoding require the optional 'sharp' package. Install it with 'npm install sharp'.",{cause:e})}}var Cd=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg+xml"];async function Dd(e,t){let r=await Bd(),{data:n,info:i}=await r(Buffer.from(e),{animated:!0}).toColourspace("srgb").ensureAlpha().raw().toBuffer({resolveWithObject:!0}),o=i.width,s=i.pageHeight||i.height,a=i.pages||1;return{shape:a>1?[a,o,s,4]:[o,s,4],data:new Uint8Array(n),width:o,height:s,components:4,layers:[a]}}function ev(e){return e instanceof ArrayBuffer?e:(ArrayBuffer.isView(e),Nd(e))}function Nd(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:r,byteLength:n}=e;return t instanceof ArrayBuffer&&r===0&&n===t.byteLength?t:Q3(t,r,n)}return Q3(e)}function Q3(e,t=0,r=e.byteLength-t){let n=new Uint8Array(r);return n.set(new Uint8Array(e,t,r)),n.buffer}async function _g(e,t={}){let r=await Bd(),n=(t.type||"jpeg").toLowerCase().replace(/^image\//,""),i=n==="jpg"?"jpeg":n,o=await r(Buffer.from(e.data),{raw:{width:e.width,height:e.height,channels:4}}).toFormat(i).toBuffer();return ev(o)}var Al=class{width;height;data;constructor(t){if(!t||!t.data||!t.width||!t.height)throw new Error("NodeImageBitmap requires decoded image data");this.width=t.width,this.height=t.height,this.data=t.data}close(){this.width=0,this.height=0,this.data=null}_getImageData(){if(!this.data)throw new Error("ImageBitmap is closed");return{data:this.data,width:this.width,height:this.height}}};function Sg(e){return e instanceof Al}function tv(e){return new Al(e)}function Mg(e){if(!Sg(e))throw new Error("getImageBitmapData");return e._getImageData()}var qk="",Vk=new Map;function Fd(e){for(let[t,r]of Vk)e.startsWith(t)&&(e=e.replace(t,r));return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${qk}${e}`),e}var Do=pe(require("fs"),1),Ja=class{handle;size;bigsize;url;constructor(t,r,n){t=Fd(t),this.handle=Do.default.openSync(t,r,n);let i=Do.default.fstatSync(this.handle,{bigint:!0});this.size=Number(i.size),this.bigsize=i.size,this.url=t}async close(){return new Promise((t,r)=>{Do.default.close(this.handle,n=>n?r(n):t())})}async truncate(t){return new Promise((r,n)=>{Do.default.ftruncate(this.handle,t,i=>{i?n(i):(this.bigsize=BigInt(t),this.size=Number(this.bigsize),r())})})}async append(t){return new Promise((r,n)=>{Do.default.appendFile(this.handle,t,i=>{i?n(i):(this.bigsize=this.bigsize+BigInt(t.length),this.size=Number(this.bigsize),r())})})}async stat(){return await new Promise((t,r)=>Do.default.fstat(this.handle,{bigint:!0},(n,i)=>{let o={size:Number(i.size),bigsize:i.size,isDirectory:i.isDirectory()};n?r(n):t(o)}))}async read(t,r){let n=new ArrayBuffer(r),i=BigInt(t),o=0,s=new Uint8Array(n),a;for(;r>0;){let c=await Wk(this.handle,s,0,r,i);if(c===0)break;o+=c,i+=BigInt(c),r-=c,a!==void 0&&(a+=c)}return o<r?n.slice(0,o):n}async write(t,r=0,n=t.byteLength){return new Promise((i,o)=>{let s=Number(r),a=new Uint8Array(t,Number(r),n);Do.default.write(this.handle,a,0,n,s,(c,l)=>c?o(c):i(l))})}};async function Wk(e,t,r,n,i){return await new Promise((o,s)=>Do.default.read(e,t,r,n,i,(a,c)=>a?s(a):o(c)))}var Ud=pe(require("fs/promises"),1);var Eg=pe(require("fs"),1),vg=require("stream");var Gd=pe(require("zlib"),1);function rv(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(Gd.default.createBrotliDecompress());case"gzip":return e.pipe(Gd.default.createGunzip());case"deflate":return e.pipe(Gd.default.createDeflate());default:return e}}var Hk=e=>typeof e=="boolean",nv=e=>typeof e=="function",$k=e=>e!==null&&typeof e=="object",Kk=e=>$k(e)&&nv(e.read)&&nv(e.pipe)&&Hk(e.readable);async function kd(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=Fd(n);let i=new Headers;e.endsWith(".gz")&&i.set("content-encoding","gzip"),e.endsWith(".br")&&i.set("content-encoding","br");try{let o=await new Promise((h,d)=>{let m=Eg.default.createReadStream(n,{encoding:null});m.once("readable",()=>h(m)),m.on("error",g=>d(g))}),s=o;Kk(o)?s=rv(o,i):typeof o=="string"?s=vg.Readable.from([new TextEncoder().encode(o)]):s=vg.Readable.from([o||new ArrayBuffer(0)]);let a=200,c="OK",l=Xk(n),u=new Response(s,{headers:l,status:a,statusText:c});return Object.defineProperty(u,"url",{value:e}),u}catch(o){let s=o.message,a=400,c=s,l={},u=new Response(s,{headers:l,status:a,statusText:c});return Object.defineProperty(u,"url",{value:e}),u}}function Xk(e){let t={};if(!t["content-length"]){let r=Eg.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new Headers(t)}var jd=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await Ud.default.readdir(t,r)}async stat(t){let r=await Ud.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await Ud.default.unlink(t)}async fetch(t,r){return await kd(t,r)}async openReadableFile(t,r="r"){return new Ja(t,r)}async openWritableFile(t,r="w",n){return new Ja(t,r,n)}};var gf=pe(require("crypto"),1),zd=class{name="crypto-node";options;_algorithm;_hash;constructor(t){var r,n;if(this.options=t,this.hashBatches=this.hashBatches.bind(this),!((n=(r=this.options)==null?void 0:r.crypto)!=null&&n.algorithm))throw new Error(this.name)}async preload(){}async hash(t,r){var i,o,s,a;let n=(s=(o=(i=this.options)==null?void 0:i.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase();try{if(!gf.createHash)throw new Error("crypto.createHash not available");let c=(a=gf.createHash)==null?void 0:a(n),l=new Uint8Array(t);return c.update(l).digest("base64")}catch(c){throw Error(`${n} hash not available. ${c}`)}}async*hashBatches(t,r="base64"){var o,s,a,c,l,u,h;if(!gf.createHash)throw new Error("crypto.createHash not available");let n=(c=gf.createHash)==null?void 0:c((a=(s=(o=this.options)==null?void 0:o.crypto)==null?void 0:s.algorithm)==null?void 0:a.toLowerCase());for await(let d of t){let m=new Uint8Array(d);n.update(m),yield d}let i=n.digest(r);(h=(u=(l=this.options)==null?void 0:l.crypto)==null?void 0:u.onEnd)==null||h.call(u,{hash:i})}};var lv=require("node:process"),uv=require("node:stream/web");var qd=require("node:stream");function iv(e,t){let r=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator](),n=!1,i={async next(){var c;try{let l=await r.next();return l.done?(await((c=r.return)==null?void 0:c.call(r)),{done:!0,value:void 0}):{done:!1,value:new Uint8Array(l.value)}}catch(l){throw n=!0,l}},async return(c){var l;return await((l=r.return)==null?void 0:l.call(r,c)),{done:!0,value:void 0}},async throw(c){return r.throw&&await r.throw(c),{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}},o=(t==null?void 0:t.objectMode)??!1,s=qd.Readable.from(i,{highWaterMark:(0,qd.getDefaultHighWaterMark)(o),...t,objectMode:o}),a=s._destroy;return s._destroy=function(c,l){a.call(this,c,u=>{l(!n&&u===c?null:u)})},s}var Vd=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(t){let r=await t.arrayBuffer();this.onload&&this.onload({target:{result:r}})}async readAsBinaryString(t){throw Error("Not implemented")}async readAsDataURL(t){let r=await t.text(),n=`data://;base64,${af(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};function ov(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=Vd),global}var Ag=pe(require("module"),1),Tg=pe(require("path"),1),Hd=pe(require("fs"),1),Ig=require("node:url");async function sv(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Nd(Hd.default.readFileSync(Pg(e)))}async function av(e){return e.startsWith("http")?await(await fetch(e)).text():Hd.default.readFileSync(Pg(e),"utf8")}async function cv(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return Wd(i)}let t=Pg(e),r=Hd.default.readFileSync(t,"utf8");return Wd(r,t)}function Wd(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t.startsWith("file:")&&(t=(0,Ig.fileURLToPath)(t)),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=Ag.default._nodeModulePaths(Tg.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),o=new Ag.default(t,i);return o.filename=t,o.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),o._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(o),1),o.exports}function Pg(e){return e.startsWith("file:")?(0,Ig.fileURLToPath)(e):Tg.default.resolve(e)}var nJ=parseInt(lv.versions.node.split(".")[0]),sJ=globalThis.Blob,aJ=globalThis.File;ov();T_&&console.error("loaders.gl: The @loaders.gl/core/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=iv;globalThis.loaders.NodeFile=Ja;globalThis.loaders.NodeFileSystem=jd;globalThis.loaders.fetchNode=kd;globalThis.loaders.NodeHash=zd;globalThis.TextEncoder||(globalThis.TextEncoder=sf);globalThis.TextDecoder||(globalThis.TextDecoder=Ka);globalThis.ReadableStream||(globalThis.ReadableStream=uv.ReadableStream);!("atob"in globalThis)&&af&&(globalThis.atob=af);!("btoa"in globalThis)&&F1&&(globalThis.btoa=F1);globalThis.loaders.encodeImageNode=_g;globalThis.loaders.parseImageNode=Dd;globalThis.loaders.imageFormatsNode=Cd;globalThis.loaders.createImageBitmapNode=tv;globalThis.loaders.getImageBitmapDataNode=Mg;globalThis.loaders.isImageBitmapNode=Sg;globalThis.ImageBitmap||(globalThis.ImageBitmap=Al);"getImageBitmapData"in globalThis||(globalThis.getImageBitmapData=Mg);globalThis._parseImageNode=Dd;globalThis._imageFormatsNode=Cd;globalThis.loaders.readFileAsArrayBuffer=sv;globalThis.loaders.readFileAsText=av;globalThis.loaders.requireFromFile=cv;globalThis.loaders.requireFromString=Wd;zs();__();kg(S_);
23
+ }`),this._recordBatchesWithDictionaries=[],this._recordBatches=[],super.close()}}});function iP(e,t){if(Mn(e))return new kw(e[Symbol.asyncIterator](),t);if(Wn(e))return new Gw(e[Symbol.iterator](),t);throw new Error("toNodeStream() must be called with an Iterable or AsyncIterable")}var Uw,Gw,kw,oP=p(()=>{Ar();Uw=require("node:stream");Yo();Gw=class extends Uw.Readable{constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}_read(t){let r=this._iterator;r&&!this._pulling&&(this._pulling=!0)&&(this._pulling=this._pull(t,r))}_destroy(t,r){let n=this._iterator,i;n&&(i=t!=null&&n.throw||n.return),i==null||i.call(n,t),r&&r(null)}_pull(t,r){let n=this._bytesMode,i=null;for(;this.readable&&!(i=r.next(n?t:null)).done&&(t!=null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(i.value)||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&r.return&&r.return(),!this.readable}},kw=class extends Uw.Readable{constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}_read(t){let r=this._iterator;r&&!this._pulling&&(this._pulling=!0)&&H(this,void 0,void 0,function*(){return this._pulling=yield this._pull(t,r)})}_destroy(t,r){let n=this._iterator,i;n&&(i=t!=null&&n.throw||n.return),i!=null&&i.call(n,t).then(()=>r&&r(null))||r&&r(null)}_pull(t,r){return H(this,void 0,void 0,function*(){let n=this._bytesMode,i=null;for(;this.readable&&!(i=yield r.next(n?t:null)).done&&(t!=null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(i.value)||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&r.return&&r.return(),!this.readable})}}});function aP(e){return new jw(oi(e),e)}var sP,jw,i$,o$,cP=p(()=>{sP=require("node:stream");Tu();jw=class extends sP.Duplex{constructor(t,r){let{queueingStrategy:n="count",autoDestroy:i=!0}=r,{highWaterMark:o=n!=="bytes"?1e3:Math.pow(2,14)}=r;super({autoDestroy:i,highWaterMark:1,allowHalfOpen:!0,writableObjectMode:!0,readableObjectMode:!0}),this._numChunks=0,this._finished=!1,this._builder=t,this._desiredSize=o,this._getSize=n!=="bytes"?i$:o$}_read(t){this._maybeFlush(this._builder,this._desiredSize=t)}_final(t){this._maybeFlush(this._builder.finish(),this._desiredSize),t&&t()}_write(t,r,n){let i=this._maybeFlush(this._builder.append(t),this._desiredSize);return n&&n(),i}_destroy(t,r){this._builder.clear(),r&&r(t)}_maybeFlush(t,r){return this._getSize(t)>=r&&++this._numChunks&&this.push(t.toVector()),t.finished?((t.length>0||this._numChunks===0)&&++this._numChunks&&this.push(t.toVector()),!this._finished&&(this._finished=!0)&&this.push(null),!1):this._getSize(t)<this.writableHighWaterMark}},i$=e=>e.length,o$=e=>e.byteLength});function uP(e){return new zw(e)}var lP,zw,fP=p(()=>{Ar();lP=require("node:stream");vo();el();zw=class extends lP.Duplex{constructor(t){super(Object.assign(Object.assign({allowHalfOpen:!1},t),{readableObjectMode:!0,writableObjectMode:!1})),this._pulling=!1,this._autoDestroy=!0,this._reader=null,this._pulling=!1,this._asyncQueue=new Ln,this._autoDestroy=t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:!0}_final(t){let r=this._asyncQueue;r==null||r.close(),t&&t()}_write(t,r,n){let i=this._asyncQueue;return i==null||i.write(t),n&&n(),!0}_read(t){let r=this._asyncQueue;r&&!this._pulling&&(this._pulling=!0)&&H(this,void 0,void 0,function*(){this._reader||(this._reader=yield this._open(r)),this._pulling=yield this._pull(t,this._reader)})}_destroy(t,r){let n=this._asyncQueue;n&&(t?n.abort(t):n.close()),r(this._asyncQueue=this._reader=null)}_open(t){return H(this,void 0,void 0,function*(){return yield(yield pr.from(t)).open({autoDestroy:this._autoDestroy})})}_pull(t,r){return H(this,void 0,void 0,function*(){let n=null;for(;this.readable&&!(n=yield r.next()).done&&!(!this.push(n.value)||t!=null&&--t<=0););return(!this.readable||n!=null&&n.done&&(r.autoDestroy||(yield r.reset().open()).closed))&&(this.push(null),yield r.cancel()),!this.readable})}}});function dP(e){return new qw(new this(e))}var hP,qw,mP=p(()=>{Ar();hP=require("node:stream");vo();qw=class extends hP.Duplex{constructor(t,r){super(Object.assign(Object.assign({allowHalfOpen:!1},r),{writableObjectMode:!0,readableObjectMode:!1})),this._pulling=!1,this._writer=t,this._reader=new $r(t)}_final(t){let r=this._writer;r==null||r.close(),t&&t()}_write(t,r,n){let i=this._writer;return i==null||i.write(t),n&&n(),!0}_read(t){let r=this._reader;r&&!this._pulling&&(this._pulling=!0)&&H(this,void 0,void 0,function*(){return this._pulling=yield this._pull(t,r)})}_destroy(t,r){let n=this._writer;n&&(t?n.abort(t):n.close()),r(this._reader=this._writer=null)}_pull(t,r){return H(this,void 0,void 0,function*(){let n=null;for(;this.readable&&!(n=yield r.next(t||null)).done&&(t!=null&&n.value&&(t-=n.value.byteLength),!(!this.push(n.value)||t<=0)););return(n!=null&&n.done||!this.readable)&&(this.push(null),yield r.cancel()),!this.readable})}}});function pP(e,t){if(Mn(e))return a$(e,t);if(Wn(e))return s$(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function s$(e,t){let r=null,n=(t==null?void 0:t.type)==="bytes"||!1,i=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){o(s,r||(r=e[Symbol.iterator]()))},pull(s){r?o(s,r):s.close()},cancel(){r!=null&&r.return&&r.return(),r=null}}),Object.assign({highWaterMark:n?i:void 0},t));function o(s,a){let c,l=null,u=s.desiredSize||null;for(;!(l=a.next(n?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=se(l.value))&&(u!=null&&n&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()}}function a$(e,t){let r=null,n=(t==null?void 0:t.type)==="bytes"||!1,i=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){return H(this,void 0,void 0,function*(){yield o(s,r||(r=e[Symbol.asyncIterator]()))})},pull(s){return H(this,void 0,void 0,function*(){r?yield o(s,r):s.close()})},cancel(){return H(this,void 0,void 0,function*(){r!=null&&r.return&&(yield r.return()),r=null})}}),Object.assign({highWaterMark:n?i:void 0},t));function o(s,a){return H(this,void 0,void 0,function*(){let c,l=null,u=s.desiredSize||null;for(;!(l=yield a.next(n?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=se(l.value))&&(u!=null&&n&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()})}}var gP=p(()=>{Ar();dr();Yo()});function wP(e){return new Vw(e)}var Vw,yP,bP,xP=p(()=>{Ar();Tu();Vw=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=t,o=NA(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=oi(o),this._getSize=i!=="bytes"?yP:bP;let{["highWaterMark"]:s=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r),{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:s,size:i!=="bytes"?yP:bP}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(t){let r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-r}_maybeFlush(t,r){r!=null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(t,r){this._bufferedSize=0,this._controller=null,r==null?t.close():t.enqueue(r)}},yP=e=>{var t;return(t=e==null?void 0:e.length)!==null&&t!==void 0?t:0},bP=e=>{var t;return(t=e==null?void 0:e.byteLength)!==null&&t!==void 0?t:0}});function _0(e,t){let r=new Ln,n=null,i=new ReadableStream({cancel(){return H(this,void 0,void 0,function*(){yield r.close()})},start(a){return H(this,void 0,void 0,function*(){yield s(a,n||(n=yield o()))})},pull(a){return H(this,void 0,void 0,function*(){n?yield s(a,n):a.close()})}});return{writable:new WritableStream(r,Object.assign({highWaterMark:Math.pow(2,14)},e)),readable:i};function o(){return H(this,void 0,void 0,function*(){return yield(yield pr.from(r)).open(t)})}function s(a,c){return H(this,void 0,void 0,function*(){let l=a.desiredSize,u=null;for(;!(u=yield c.next()).done;)if(a.enqueue(u.value),l!=null&&--l<=0)return;a.close()})}}var _P=p(()=>{Ar();vo();el()});function S0(e,t){let r=new this(e),n=new $r(r),i=new ReadableStream({cancel(){return H(this,void 0,void 0,function*(){yield n.cancel()})},pull(s){return H(this,void 0,void 0,function*(){yield o(s)})},start(s){return H(this,void 0,void 0,function*(){yield o(s)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(r,e),readable:i};function o(s){return H(this,void 0,void 0,function*(){let a=null,c=s.desiredSize;for(;a=yield n.read(c||null);)if(s.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;s.close()})}}var SP=p(()=>{Ar();vo()});function Lh(e){let t=pr.from(e);return Vn(t)?t.then(r=>Lh(r)):t.isAsync()?t.readAll().then(r=>new ot(r)):new ot(t.readAll())}function M0(e,t="stream",r=null){let n={compressionType:r};return(t==="stream"?bs:ws).writeAll(e,n).toUint8Array(!0)}var MP=p(()=>{Yc();Yo();el();Rh()});var Ww={};Jt(Ww,{isArrowData:()=>A0,isArrowDataType:()=>T0,isArrowField:()=>E0,isArrowRecordBatch:()=>P0,isArrowSchema:()=>v0,isArrowTable:()=>R0,isArrowVector:()=>I0});function v0(e){return ve.isSchema(e)}function E0(e){return ee.isField(e)}function T0(e){return z.isDataType(e)}function A0(e){return ce.isData(e)}function I0(e){return $.isVector(e)}function P0(e){return $e.isRecordBatch(e)}function R0(e){return ot.isTable(e)}var Hw=p(()=>{Vr();at();wi();zr();ds();Yc()});var vP,$w=p(()=>{mp();ou();Nt();wi();at();Yc();zr();Pn();Vr();mh();Cp();bt();Tu();Yb();lw();Zb();Jb();Qb();ew();rw();ow();hw();fw();nw();iw();mw();gw();pw();n0();o0();i0();sw();aw();tw();cw();uw();dw();vo();el();Rh();MP();p0();m0();ga();ds();Hw();pp();Vb();Sc();dh();dr();bu();oh();e0();Hw();Ah();vP=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},db),qb),Pb),mb),L2),Ib),lb),Xb),Ww),{compareSchemas:Xc,compareFields:B5,compareTypes:c0})});var EP=p(()=>{iu();bt();el();Rh();gP();xP();_P();SP();$w();$w();mr.toDOMStream=pP;ct.throughDOM=wP;pr.throughDOM=_0;ps.throughDOM=_0;Ki.throughDOM=_0;Ei.throughDOM=S0;ws.throughDOM=S0;bs.throughDOM=S0});var ja={};Jt(ja,{AsyncByteQueue:()=>Ln,AsyncByteStream:()=>$r,AsyncMessageReader:()=>Jc,AsyncRecordBatchFileReader:()=>Ru,AsyncRecordBatchStreamReader:()=>ms,Binary:()=>Tn,BinaryBuilder:()=>as,BinaryView:()=>Ee,BinaryViewBuilder:()=>us,Bool:()=>kr,BoolBuilder:()=>Ac,BufferType:()=>Ne,Builder:()=>ct,ByteStream:()=>_i,CompressionType:()=>Ir,Data:()=>ce,DataType:()=>z,DateBuilder:()=>Eo,DateDay:()=>ea,DateDayBuilder:()=>ba,DateMillisecond:()=>ta,DateMillisecondBuilder:()=>wa,DateUnit:()=>st,Date_:()=>sn,Decimal:()=>An,DecimalBuilder:()=>xa,DenseUnion:()=>ts,DenseUnionBuilder:()=>$c,Dictionary:()=>nr,DictionaryBuilder:()=>Ic,Duration:()=>an,DurationBuilder:()=>Si,DurationMicrosecond:()=>uh,DurationMicrosecondBuilder:()=>Aa,DurationMillisecond:()=>lh,DurationMillisecondBuilder:()=>Ta,DurationNanosecond:()=>fh,DurationNanosecondBuilder:()=>Ia,DurationSecond:()=>ch,DurationSecondBuilder:()=>Ea,Field:()=>ee,FixedSizeBinary:()=>In,FixedSizeBinaryBuilder:()=>_a,FixedSizeList:()=>Ht,FixedSizeListBuilder:()=>Pc,Float:()=>Fr,Float16:()=>ji,Float16Builder:()=>Rc,Float32:()=>nn,Float32Builder:()=>Lc,Float64:()=>Qn,Float64Builder:()=>Oc,FloatBuilder:()=>To,Int:()=>Pt,Int16:()=>Xn,Int16Builder:()=>Cc,Int32:()=>Yt,Int32Builder:()=>Dc,Int64:()=>Yn,Int64Builder:()=>Nc,Int8:()=>Kn,Int8Builder:()=>Bc,IntBuilder:()=>ln,Interval:()=>Ur,IntervalBuilder:()=>$i,IntervalDayTime:()=>la,IntervalDayTimeBuilder:()=>Sa,IntervalMonthDayNano:()=>ah,IntervalMonthDayNanoBuilder:()=>va,IntervalUnit:()=>ke,IntervalYearMonth:()=>ua,IntervalYearMonthBuilder:()=>Ma,JSONMessageReader:()=>Qc,LargeBinary:()=>zi,LargeBinaryBuilder:()=>cs,LargeList:()=>ei,LargeListBuilder:()=>zc,LargeUtf8:()=>qi,LargeUtf8Builder:()=>Ga,List:()=>rr,ListBuilder:()=>jc,MapBuilder:()=>qc,MapRow:()=>bi,Map_:()=>jr,Message:()=>Hr,MessageHeader:()=>Ge,MessageReader:()=>ka,MetadataVersion:()=>it,Null:()=>Wt,NullBuilder:()=>Vc,Precision:()=>He,RecordBatch:()=>$e,RecordBatchFileReader:()=>ps,RecordBatchFileWriter:()=>ws,RecordBatchJSONWriter:()=>Ph,RecordBatchReader:()=>pr,RecordBatchStreamReader:()=>Ki,RecordBatchStreamWriter:()=>bs,RecordBatchWriter:()=>Ei,Schema:()=>ve,SparseUnion:()=>fa,SparseUnionBuilder:()=>Hc,Struct:()=>tt,StructBuilder:()=>Wc,StructRow:()=>_o,Table:()=>ot,Time:()=>Pr,TimeBuilder:()=>vi,TimeMicrosecond:()=>ia,TimeMicrosecondBuilder:()=>Da,TimeMillisecond:()=>na,TimeMillisecondBuilder:()=>Ca,TimeNanosecond:()=>oa,TimeNanosecondBuilder:()=>Na,TimeSecond:()=>ra,TimeSecondBuilder:()=>Ba,TimeUnit:()=>q,Timestamp:()=>Rr,TimestampBuilder:()=>Mi,TimestampMicrosecond:()=>aa,TimestampMicrosecondBuilder:()=>La,TimestampMillisecond:()=>xo,TimestampMillisecondBuilder:()=>Ra,TimestampNanosecond:()=>ca,TimestampNanosecondBuilder:()=>Oa,TimestampSecond:()=>sa,TimestampSecondBuilder:()=>Pa,Type:()=>x,Uint16:()=>Jn,Uint16Builder:()=>Gc,Uint32:()=>rn,Uint32Builder:()=>kc,Uint64:()=>Ui,Uint64Builder:()=>Uc,Uint8:()=>Zn,Uint8Builder:()=>Fc,Union:()=>cn,UnionBuilder:()=>ls,UnionMode:()=>Ze,Utf8:()=>Gr,Utf8Builder:()=>Fa,Utf8View:()=>on,Utf8ViewBuilder:()=>Kc,Vector:()=>$,Visitor:()=>ie,builderThroughAsyncIterable:()=>_w,builderThroughIterable:()=>u0,compressionRegistry:()=>Ua,isArrowData:()=>A0,isArrowDataType:()=>T0,isArrowField:()=>E0,isArrowRecordBatch:()=>P0,isArrowSchema:()=>v0,isArrowTable:()=>R0,isArrowVector:()=>I0,makeBuilder:()=>oi,makeData:()=>te,makeTable:()=>Sw,makeVector:()=>Mo,tableFromArrays:()=>Mw,tableFromIPC:()=>Lh,tableFromJSON:()=>xw,tableToIPC:()=>M0,util:()=>vP,vectorFromArray:()=>Au});var tl=p(()=>{iu();bt();el();Rh();oP();cP();fP();mP();EP();mr.toNodeStream=iP;ct.throughNode=aP;pr.throughNode=uP;Ei.throughNode=dP});function L0(e){return{fields:e.fields.map(t=>rl(t)),metadata:RP(e.metadata)}}function PP(e,t){return new ve(e.fields.map(r=>Io(r,t)),O0(e.metadata))}function RP(e){return Object.fromEntries(e)}function O0(e){return e?new Map(Object.entries(e)):new Map}function rl(e){return{name:e.name,type:B0(e.type),nullable:e.nullable,metadata:RP(e.metadata)}}function Io(e,t){return new ee(e.name,Bu(e.type,t),e.nullable,O0(e.metadata))}function B0(e){if(TP(e,"BinaryView"))return"binary-view";if(TP(e,"Utf8View"))return"utf8-view";if(c$(e,"LargeList"))return{type:"large-list",children:[rl(e.valueField)]};switch(e.constructor){case Wt:return"null";case Tn:return"binary";case In:return{type:"fixed-size-binary",byteWidth:e.byteWidth};case kr:return"bool";case Pt:let t=e;return`${t.isSigned?"":"u"}int${t.bitWidth}`;case Kn:return"int8";case Xn:return"int16";case Yt:return"int32";case Yn:return"int64";case Zn:return"uint8";case Jn:return"uint16";case rn:return"uint32";case Ui:return"uint64";case Fr:switch(e.precision){case He.HALF:return"float16";case He.SINGLE:return"float32";case He.DOUBLE:return"float64";default:return"float16"}case ji:return"float16";case nn:return"float32";case Qn:return"float64";case Gr:return"utf8";case An:let n=e;return{type:"decimal",bitWidth:n.bitWidth,precision:n.precision,scale:n.scale};case sn:return e.unit===st.DAY?"date-day":"date-millisecond";case ea:return"date-day";case ta:return"date-millisecond";case Pr:switch(e.unit){case q.SECOND:return"time-second";case q.MILLISECOND:return"time-millisecond";case q.MICROSECOND:return"time-microsecond";case q.NANOSECOND:return"time-nanosecond";default:return"time-second"}case na:return"time-millisecond";case ra:return"time-second";case ia:return"time-microsecond";case oa:return"time-nanosecond";case Rr:switch(e.unit){case q.SECOND:return"timestamp-second";case q.MILLISECOND:return"timestamp-millisecond";case q.MICROSECOND:return"timestamp-microsecond";case q.NANOSECOND:return"timestamp-nanosecond";default:return"timestamp-second"}case sa:return"timestamp-second";case xo:return"timestamp-millisecond";case aa:return"timestamp-microsecond";case ca:return"timestamp-nanosecond";case Ur:switch(e.unit){case ke.DAY_TIME:return"interval-daytime";case ke.YEAR_MONTH:return"interval-yearmonth";default:return"interval-daytime"}case la:return"interval-daytime";case ua:return"interval-yearmonth";case jr:let c=e;return{type:"map",keysSorted:c.keysSorted,children:c.children.map(y=>rl(y))};case rr:let u=e.valueField;return{type:"list",children:[rl(u)]};case Ht:let h=e;return{type:"fixed-size-list",listSize:h.listSize,children:[rl(h.children[0])]};case tt:return{type:"struct",children:e.children.map(y=>rl(y))};case fa:case ts:let m=e;return{type:m instanceof ts?"dense-union":"sparse-union",typeIds:m.typeIds,children:m.children.map(y=>rl(y)),typeIdToChildIndex:{...m.typeIdToChildIndex}};case nr:let g=e;return{type:"dictionary",id:g.id,indices:l$(g.indices),dictionary:B0(g.dictionary),isOrdered:g.isOrdered};default:throw new Error(`arrow type not supported: ${e.constructor.name}`)}}function Bu(e,t){if(typeof e=="object")switch(e.type){case"decimal":return new An(e.scale,e.precision,e.bitWidth);case"map":{let r=e.children.map(n=>Io(n,t));return new jr(r[0],e.keysSorted)}case"list":{let r=Io(e.children[0],t);return new rr(r)}case"large-list":{let r=Io(e.children[0],t),n=Oh("LargeList");if(!n)throw new Error("LargeList requires an Apache Arrow runtime that exports the LargeList constructor");return new n(r)}case"fixed-size-list":{let r=Io(e.children[0],t);return new Ht(e.listSize,r)}case"fixed-size-binary":return new In(e.byteWidth);case"struct":{let r=e.children.map(n=>Io(n,t));return new tt(r)}case"sparse-union":case"dense-union":{let r=e.children.map(n=>Io(n,t));return e.type==="dense-union"?new ts(e.typeIds,r):new fa(e.typeIds,r)}case"dictionary":return new nr(Bu(e.dictionary,t),f$(e.indices),e.id,e.isOrdered);default:throw new Error("array type not supported")}switch(e){case"null":return new Wt;case"binary":return AP("BinaryView",new Tn,t);case"binary-view":return IP("BinaryView");case"bool":return new kr;case"int8":return new Kn;case"int16":return new Xn;case"int32":return new Yt;case"int64":return new Yn;case"uint8":return new Zn;case"uint16":return new Jn;case"uint32":return new rn;case"uint64":return new Ui;case"float16":return new ji;case"float32":return new nn;case"float64":return new Qn;case"utf8":return AP("Utf8View",new Gr,t);case"utf8-view":return IP("Utf8View");case"date-day":return new ea;case"date-millisecond":return new ta;case"time-second":return new ra;case"time-millisecond":return new na;case"time-microsecond":return new ia;case"time-nanosecond":return new oa;case"timestamp-second":return new sa;case"timestamp-millisecond":return new xo;case"timestamp-microsecond":return new aa;case"timestamp-nanosecond":return new ca;case"interval-daytime":return new la;case"interval-yearmonth":return new ua;default:throw new Error("array type not supported")}}function Oh(e){return ja[e]}function TP(e,t){let r=Oh(t);if(r&&e instanceof r)return!0;let n=z,i=t==="BinaryView"?n.isBinaryView:n.isUtf8View;return!!(i!=null&&i(e))}function c$(e,t){let r=Oh(t);return!!(r&&e instanceof r)}function AP(e,t,r){let n=(r==null?void 0:r.viewTypes)||"never";if(n==="never")return t;let i=Oh(e);if(i)return new i;if(n==="require")throw new Error(`${e} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return t}function IP(e){let t=Oh(e);if(!t)throw new Error(`${e} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return new t}function l$(e){if(e instanceof Pt){let r=`${e.isSigned?"int":"uint"}${e.bitWidth}`;if(u$(r))return r}switch(e.constructor){case Kn:return"int8";case Xn:return"int16";case Yt:return"int32";case Zn:return"uint8";case Jn:return"uint16";case rn:return"uint32";default:throw new Error(`arrow dictionary index type not supported: ${e.constructor.name}`)}}function u$(e){return["int8","int16","int32","uint8","uint16","uint32"].includes(e)}function f$(e){switch(e){case"int8":return new Kn;case"int16":return new Xn;case"int32":return new Yt;case"uint8":return new Zn;case"uint16":return new Jn;case"uint32":return new rn;default:throw new Error(`schema dictionary index type not supported: ${e}`)}}var C0=p(()=>{"use strict";tl()});function LP(e,t={}){let r={...t,copies:new WeakMap};return h$(e)?p$(e,r):d$(e)?OP(e,r):m$(e)?BP(e,r):N0(e,r)}function h$(e){return"batches"in e}function d$(e){return"schema"in e&&"data"in e&&!Array.isArray(e.data)}function m$(e){return"data"in e&&Array.isArray(e.data)}function p$(e,t){let r=e.batches.map(n=>OP(n,t));return new ot(e.schema,r)}function OP(e,t){return new $e(e.schema,N0(e.data,t))}function N0(e,t){let r=e.children.map(o=>N0(o,t)),n=e.dictionary?BP(e.dictionary,t):void 0,i={[Ne.OFFSET]:D0(e.buffers[Ne.OFFSET],t),[Ne.DATA]:D0(e.buffers[Ne.DATA],t),[Ne.VALIDITY]:D0(e.buffers[Ne.VALIDITY],t),[Ne.TYPE]:D0(e.buffers[Ne.TYPE],t)};return new ce(e.type,e.offset,e.length,e._nullCount,i,r,n)}function BP(e,t){return new $(e.data.map(r=>N0(r,t)))}function D0(e,t){if(!g$(e)||t.copy==="none"||t.copy!=="all"&&e.byteOffset===0&&e.byteLength===e.buffer.byteLength)return e;let r=t.copies.get(e);return r||(r=e.slice(),t.copies.set(e,r)),r}function g$(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Kw=p(()=>{"use strict";tl()});function y$(e,t){let r=LP(e,t);return{shape:"arrow-table",transport:"arrow-js",schema:L0(r.schema),batches:r.batches.map(n=>_$(n))}}function b$(e){let t=PP(e.schema),r=e.batches.map(n=>new $e(t,Yw(n.data)));return new ot(t,r)}function CP(e,t){var i;if(!w$(e))return e;let r=t,n=((i=r==null?void 0:r.core)==null?void 0:i.workerTransferBufferCopy)??(r==null?void 0:r.workerTransferBufferCopy);return{...e,data:y$(e.data,n?{copy:n}:void 0)}}function DP(e){return x$(e)?{...e,data:b$(e.data)}:e}function w$(e){let t=e;return!!(t&&t.shape==="arrow-table"&&t.data&&typeof t.data=="object"&&"batches"in t.data)}function x$(e){let t=e;return!!(t&&t.shape==="arrow-table"&&t.data&&t.data.transport==="arrow-js"&&Array.isArray(t.data.batches))}function _$(e){return{data:Xw(e.data)}}function Xw(e){return{type:B0(e.type),offset:e.offset,length:e.length,nullCount:e._nullCount,buffers:{[Ne.OFFSET]:e.buffers[Ne.OFFSET],[Ne.DATA]:e.buffers[Ne.DATA],[Ne.VALIDITY]:e.buffers[Ne.VALIDITY],[Ne.TYPE]:e.buffers[Ne.TYPE]},children:e.children.map(t=>Xw(t)),dictionary:e.dictionary?S$(e.dictionary):void 0}}function S$(e){return{data:e.data.map(t=>Xw(t))}}function Yw(e){let t=e.children.map(n=>Yw(n)),r=e.dictionary?M$(e.dictionary):void 0;return new ce(Bu(e.type),e.offset,e.length,e.nullCount,e.buffers,t,r)}function M$(e){return new $(e.data.map(t=>Yw(t)))}var NP=p(()=>{"use strict";tl();C0();Kw()});var FP=p(()=>{"use strict";NP();Kw()});function v$(e,t="float32"){return e instanceof Date?"date-millisecond":typeof e=="number"?t:typeof e=="boolean"?"bool":typeof e=="string"?"utf8":"null"}function GP(e){let t=Zw(e);return t!=="null"?{type:t,nullable:!1}:e.length>0?(t=v$(e[0]),{type:t,nullable:!0}):{type:"null",nullable:!0}}function Zw(e){if(typeof Float16Array<"u"&&e instanceof Float16Array)return"float16";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 BigInt64Array:return"int64";case BigUint64Array:return"uint64";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}var Jw=p(()=>{"use strict"});function Qw(e){let t=e==null?void 0:e.POSITION;if(!t||!("value"in t)||!t.value.length)return null;let r=1/0,n=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0,c=t.value,l=c.length;for(let u=0;u<l;u+=3){let h=c[u],d=c[u+1],m=c[u+2];r=h<r?h:r,n=d<n?d:n,i=m<i?m:i,o=h>o?h:o,s=d>s?d:s,a=m>a?m:a}return[[r,n,i],[o,s,a]]}var kP=p(()=>{"use strict"});function UP(e){let t=wm();return new t(e)}function nl(e){return!!(zl&&e instanceof zl)}function jP(e,t,r){nl(e)?e[t]=r:e[t]=zP(r)}function Bh(e){return nl(e)?new Uint16Array(e.buffer,e.byteOffset,e.length):e}function ex(e,t){let r=UP(e.length);for(let n=0;n<e.length;n++)jP(r,n,e[n]/t);return r}function zP(e){if(!Number.isFinite(e))return e===1/0?31744:e===-1/0?64512:32256;let t=e<0||Object.is(e,-0)?32768:0,r=Math.abs(e);if(r===0)return t;if(r>=65520)return t|31744;if(r>=65504)return t|31743;let n=Math.floor(Math.log2(r));if(n<-14)return t|Math.round(r/2**-24);let i=n+15,o=Math.round((r/2**n-1)*1024);return o===1024?t|i+1<<10:t|i<<10|o}var qP=p(()=>{"use strict";Fn()});var F0,tx,VP=p(()=>{"use strict";tl();F0=new ve([new ee("POSITION",new Ht(3,new ee("value",new nn,!1)),!1)]),tx=new ve([...F0.fields,new ee("indices",new rr(new ee("item",new rn,!1)),!0)])});var Ch=p(()=>{"use strict";qP();VP()});function rx(e,t,r){let n=E$(e,t,r);return new $([n])}function E$(e,t,r){let n=T$(e,t,r),i=n.children[0].type,o=r==="float16"&&nl(e)?Bh(e):e,s={[Ne.DATA]:o},a=new ce(i,0,o.length,0,s);return new ce(n,0,o.length/t,0,void 0,[a])}function T$(e,t,r){let n=r||GP(e).type,i=Bu(n);return new Ht(t,new ee("value",i,!1))}var WP=p(()=>{"use strict";Ch();tl();Jw();C0()});function nx(e,t){switch(t){case"columnar-table":return A$(e);case"arrow-table":return I$(e);default:throw new Error(t)}}function A$(e){let t={},r=KP(e);for(let[n,i]of Object.entries(e.attributes))t[n]=i.value;return{shape:"columnar-table",schema:e.schema,data:t,topology:e.topology,indices:r?e.indices:void 0}}function I$(e,t){var r;return $P(e.attributes,{schema:e.schema,topology:e.topology,mode:e.mode,boundingBox:(r=e.header)==null?void 0:r.boundingBox,indices:KP(e)?e.indices:void 0})}function $P(e,t={}){var c,l,u;let r=[],n={},i=R$(e);for(let h of i){let d=e[h],{value:m,size:g=1}=d,y=P$(m,g,d.componentType);if(n[h]=y,r.push(L$(t.schema,h,y,d.componentType)),h==="POSITION"&&((l=(c=t.indices)==null?void 0:c.value)!=null&&l.length)){let b=tx.fields.find(w=>w.name==="indices");n.indices=B$(t.indices.value,y.length,b.type),r.push(b)}}let o=new ve(r,C$(t)),s=((u=n[i[0]])==null?void 0:u.length)===0?new ot(o):new ot(o,n);return{shape:"arrow-table",schema:L0(s.schema),data:s,topology:t.topology||"point-list",indices:t.indices}}function P$(e,t,r){if(r==="float16"){let n=nl(e)?Bh(e):e;if(t===1){let i=new ce(new ji,0,n.length,0,{[Ne.DATA]:n});return new $([i])}return rx(e,t,r)}return t===1?Mo(e):rx(e,t)}function R$(e){let t=Object.keys(e),r=HP.filter(i=>i in e),n=t.filter(i=>!HP.includes(i));return[...r,...n]}function KP(e){var t,r;return!!((r=(t=e.indices)==null?void 0:t.value)!=null&&r.length)}function L$(e,t,r,n){if(t==="POSITION"&&O$(r)){let o=F0.fields[0],s=e==null?void 0:e.fields.find(c=>c.name===t);if(!(s!=null&&s.metadata))return o;let a=new Map(o.metadata);for(let[c,l]of Object.entries(s.metadata))a.set(c,l);return new ee(o.name,o.type,o.nullable,a)}let i=e==null?void 0:e.fields.find(o=>o.name===t);if(n==="float16"){let o=new Map(Object.entries((i==null?void 0:i.metadata)||{}));return o.set("componentType","float16"),new ee(t,r.type,!1,o)}if(i&&i.type.toString()!==r.type.toString()){let o=Io(i);return new ee(t,r.type,o.nullable,o.metadata)}return i?Io(i):new ee(t,r.type,!1)}function O$(e){return e.type instanceof Ht&&e.type.listSize===3&&e.type.children[0].type instanceof nn}function B$(e,t,r){let n=r,i=e instanceof Uint32Array?e:Uint32Array.from(e),o=new Int32Array(t+1);t>0&&o.fill(i.length,1);let s=new Uint8Array(Math.ceil(t/8));t>0&&(s[0]=1);let a=new ce(n.children[0].type,0,i.length,0,{[Ne.DATA]:i}),c=new ce(n,0,t,Math.max(0,t-1),{[Ne.OFFSET]:o,[Ne.VALIDITY]:s},[a]);return new $([c])}function C$(e){var r;let t={...(r=e.schema)==null?void 0:r.metadata};return e.topology&&(t.topology||=e.topology),Number.isFinite(e.mode)&&(t.mode||=String(e.mode)),e.boundingBox&&(t.boundingBox||=JSON.stringify(e.boundingBox)),O0(t)}var HP,XP=p(()=>{"use strict";Ch();Ch();tl();WP();C0();HP=["POSITION"]});function ix(e,t,r){let n=t.componentType||Zw(t.value),i=r||G0(t),o=t.size===1?n:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]};return{name:e,type:o,nullable:!1,metadata:i}}function G0(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),e.componentType&&(t.componentType=e.componentType),e.transform&&(t["loaders.gl.transform"]=JSON.stringify(e.transform)),t}var YP=p(()=>{"use strict";Jw()});var k0=p(()=>{"use strict";kP();XP();YP()});var ZP,JP=p(()=>{"use strict";ZP="5.0.0-beta.4"});var QP,eR=p(()=>{"use strict";QP={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var tR,rR=p(()=>{"use strict";tR={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"}});async function Dh(e,t=null,r={},n=null,i=null){var o;if(Pi&&r.useLocalLibraries&&!r.CDN&&n&&((o=r.modules)==null?void 0:o[n])===void 0){let s=tc?"./libs":`modules/${t}/dist/libs`;r={...r,modules:{[n]:`${s}/${n}`,...i?{[i]:`${s}/${i}`}:{},...r.modules}}}return await Cl(e,t,r,n,i)}var nR=p(()=>{"use strict";ic()});var D$,N$,Nh,iR,Gt,Fh,oR=p(()=>{"use strict";D$="1.5.7",N$="8786740086a9f4d83f44aa83badfbea4dce7a1b5",Nh=`https://www.gstatic.com/draco/versioned/decoders/${D$}`,iR=`https://cdn.jsdelivr.net/gh/google/draco@${N$}/javascript`,Gt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},Fh={[Gt.DECODER]:`${Nh}/${Gt.DECODER}`,[Gt.DECODER_WASM]:`${Nh}/${Gt.DECODER_WASM}`,[Gt.GLTF_DECODER]:`${Nh}/${Gt.GLTF_DECODER}`,[Gt.GLTF_DECODER_WASM]:`${Nh}/${Gt.GLTF_DECODER_WASM}`,[Gt.FALLBACK_DECODER]:`${Nh}/${Gt.FALLBACK_DECODER}`,[Gt.ENCODER]:`${iR}/${Gt.ENCODER}`,[Gt.ENCODER_WASM]:`${iR}/${Gt.ENCODER_WASM}`}});async function U0(e={},t,r="full"){let n=U$(e);return n?await ox(n):await F$(e,t==="js"?"javascript":t,r)}async function F$(e={},t,r="full"){let n=z$(`${t}:${r}`,e),i=sR.get(n);return i||(i=G$(e,t,r),sR.set(n,i)),await i}async function ox(e){let t=j$(e),r=aR.get(t);return r||(r=Ll(()=>t.createDecoderModule({}),n=>({draco:n})),aR.set(t,r)),await r}async function G$(e,t,r){try{return await lR(e,t,r)}catch(n){if(t==="javascript")throw n;try{return await lR(e,"javascript","full")}catch(i){throw new AggregateError([n,i],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function lR(e,t,r){let n=cR.then(()=>k$(e,t,r));return cR=n.then(()=>{},()=>{}),await n}async function k$(e,t,r){if(t==="javascript"){let s;try{s=await Dh(Fh[Gt.FALLBACK_DECODER],"scene",e,Gt.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(Pi||e.useLocalLibraries)throw c;s=await Dh(Fh[Gt.FALLBACK_DECODER],"scene",{...e,useLocalLibraries:!0},Gt.FALLBACK_DECODER,"draco_decoder.mjs")}let a=hR(s,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await fR(a)}let n,i;try{[n,i]=await uR(e,r)}catch(s){if(Pi||e.useLocalLibraries)throw s;[n,i]=await uR({...e,useLocalLibraries:!0},r)}let o=hR(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await fR(o,i)}async function uR(e,t){let r=t==="gltf"?Gt.GLTF_DECODER:Gt.DECODER,n=t==="gltf"?Gt.GLTF_DECODER_WASM:Gt.DECODER_WASM;return await Promise.all([Dh(Fh[r],"scene",e,r,t==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),Dh(Fh[n],"scene",e,n)])}function fR(e,t){if(typeof e!="function")throw new Error("Draco module initializer could not be loaded");return Ll(r=>e({...t?{wasmBinary:t}:{},onModuleLoaded:r}),r=>({draco:r}))}function hR(e,t){if(typeof e=="function")return e;if(e&&typeof e=="object"){let r=e,n=r[t]||r.default;return typeof n=="function"?n:void 0}}function U$(e){var r;let t=(r=e.modules)==null?void 0:r.draco3d;if(t){if(typeof t!="object"&&typeof t!="function")throw new Error("Invalid draco3d module");return t}}function j$(e){let t=e;if(typeof(t==null?void 0:t.createDecoderModule)!="function")throw new Error("Invalid draco3d decoder module");return t}function z$(e,t){let r=Object.entries(t.modules||{}).filter(([n])=>n!=="draco3d").map(([n,i])=>`${n}:${String(i)}`).sort().join("|");return[e,t.useLocalLibraries?"local":"remote",t.CDN||"",r].join("|")}var sR,aR,cR,j0=p(()=>{"use strict";Vs();nR();oR();sR=new Map,aR=new WeakMap;cR=Promise.resolve()});function mR(e,t,r){let n=pR(t.metadata),i=[],o=q$(t.attributes);for(let s in e){let a=e[s],c=dR(s,a,o[s]);i.push(c)}if(r){let s=dR("indices",r);i.push(s)}return{fields:i,metadata:n}}function q$(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function dR(e,t,r){let n={...G0(t),...r?pR(r.metadata):{}};return ix(e,t,n)}function pR(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var gR=p(()=>{"use strict";k0()});function $$(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function K$(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function X$(e){let t=e.size(),r=new Uint32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function Y$(e,t){if(!Object.prototype.hasOwnProperty.call(t,e))return e;let r=/^(.*)_([0-9]+)$/.exec(e),n=r?r[1]:e,i=r?BigInt(r[2])+1n:1n;for(;Object.prototype.hasOwnProperty.call(t,`${n}_${i}`);)i++;return`${n}_${i}`}function Z$(e){var t;if(e.quantization_transform){let{quantization_bits:r,min_values:n,range:i}=e.quantization_transform;if(r!==void 0&&n&&i!==void 0)return{type:"quantization",bits:r,origin:Array.from(n),range:i}}if(((t=e.octahedron_transform)==null?void 0:t.quantization_bits)!==void 0)return{type:"octahedron",bits:e.octahedron_transform.quantization_bits}}function J$(e){if(e.includeAttributes&&e.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function Q$(e,t){for(let r of e.includeAttributes||e.excludeAttributes||[])if(!t.includes(r))throw new Error(`DracoLoader: selected attribute "${r}" does not exist`)}function eK(e){var a;let t=Qw(e);if(!t)throw new Error("Decoded mesh is missing positions");let r=e.POSITION;if(((a=r==null?void 0:r.transform)==null?void 0:a.type)!=="quantization")return t;let{bits:n,origin:i,range:o}=r.transform,s=o/(2**n-1);return t.map(c=>c.map((l,u)=>i[u]+l*s))}var yR,V$,W$,H$,Gh,bR=p(()=>{"use strict";k0();gR();yR={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},V$={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},W$=2,H$=4,Gh=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){J$(r);let n=ArrayBuffer.isView(t)?new Int8Array(t.buffer,t.byteOffset,t.byteLength):new Int8Array(t);this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),o=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud,s=null;try{switch(i){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeArrayToMesh(n,n.byteLength,o);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeArrayToPointCloud(n,n.byteLength,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!o.ptr){let d=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(d)}let a=this._getDracoLoaderData(o,i,r),c=this._getMeshData(o,a,r),l=eK(c.attributes),u=mR(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:l},...c,schema:u}}finally{s&&this.draco.destroy(s),o&&this.draco.destroy(o)}}_getDracoLoaderData(t,r,n){let i=this._getTopLevelMetadata(t),o=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:o}}_getDracoAttributes(t,r){let n={};for(let i=0;i<t.num_attributes();i++){let o=this.decoder.GetAttribute(t,i),s=this._getAttributeMetadata(t,i);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:i,metadata:s};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(o,r);c&&(n[o.unique_id()].octahedron_transform=c)}return n}_getMeshData(t,r,n){let i=this._getMeshAttributes(r,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");return t instanceof this.draco.Mesh?n.topology==="triangle-strip"?{topology:"triangle-strip",mode:5,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}}:{topology:"triangle-list",mode:4,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}:{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,r,n){let i={},o={},a=Object.values(t.attributes).sort((c,l)=>c.attribute_index-l.attribute_index).map(c=>{let l=this._deduceAttributeName(c,n),u=Y$(l,o);return o[u]=!0,c.name=u,{attributeName:u,loaderAttribute:c}});Q$(n,Object.keys(o));for(let{attributeName:c,loaderAttribute:l}of a){if(!this._shouldExtractAttribute(c,l,n))continue;let u=this._getAttributeValues(r,l);if(u){let{value:h,size:d}=u;i[c]={value:h,size:d,byteOffset:l.byte_offset,byteStride:l.byte_stride,normalized:l.normalized,transform:Z$(l)}}}return i}_shouldExtractAttribute(t,r,n){var i,o;if(r.attribute_type===this.draco.POSITION){if((i=n.excludeAttributes)!=null&&i.includes(t))throw new Error(`DracoLoader: position attribute "${t}" cannot be excluded`);return!0}return n.includeAttributes&&!n.includeAttributes.includes(t)?!1:!((o=n.excludeAttributes)!=null&&o.includes(t))}_getTriangleListIndices(t){let n=t.num_faces()*3,i=t.num_points()<=65536,o=n*(i?W$:H$),s=this.draco._malloc(o);try{if(i){if(!this.decoder.GetTrianglesUInt16Array(t,o,s))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint16Array(this.draco.HEAPU8.buffer,s,n).slice()}if(!this.decoder.GetTrianglesUInt32Array(t,o,s))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint32Array(this.draco.HEAPU8.buffer,s,n).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),X$(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=V$[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let i=r.num_components,s=t.num_points()*i,a=s*n.BYTES_PER_ELEMENT,c=$$(this.draco,n),l,u=this.draco._malloc(a);try{let h=this.decoder.GetAttribute(t,r.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(t,h,c,a,u))throw new Error(`DRACO: Failed to decode attribute ${r.unique_id}.`);l=new n(this.draco.HEAPU8.buffer,u,s).slice()}finally{this.draco._free(u)}return{value:l,size:i}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[s,a]of Object.entries(r.extraAttributes||{}))if(a===n)return s;let i=r.attributeNameEntry||"name";if(t.metadata[i]){let s=t.metadata[i].string;return s==="COLOR"?"COLOR_0":s==="TEX_COORD"?"TEXCOORD_0":s}let o=t.attribute_type;for(let s in yR)if(this.draco[s]===o)return yR[s];return`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){let o=this.metadataQuerier.GetEntryName(t,i);r[o]=this._getDracoMetadataField(t,o)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let i=K$(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,i=[...r,...n];for(let o of i)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,i=t.attribute_type();if(n.map(s=>this.draco[s]).includes(i)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(t))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:Float32Array.from({length:t.num_components()},(a,c)=>s.min_value(c))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(t,r){let{octahedronAttributes:n=[]}=r,i=t.attribute_type();if(n.map(s=>this.draco[s]).includes(i)){let s=new this.draco.AttributeOctahedronTransform;try{if(s.InitFromAttribute(t))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}}});async function Cu(e,t,r,n){var a,c;let i=(n==null?void 0:n.reportProgress)||(t==null?void 0:t.onProgress);i==null||i({phase:"decode",completed:0,total:1,unit:"tasks"});let{draco:o}=await r();(a=(t==null?void 0:t.signal)||(n==null?void 0:n.signal))==null||a.throwIfAborted();let s=new Gh(o);try{let l=s.parseSync(e,t==null?void 0:t.draco);return i==null||i({phase:"decode",completed:1,total:1,unit:"tasks"}),((c=t==null?void 0:t.draco)==null?void 0:c.shape)==="arrow-table"?nx(l,"arrow-table"):l}finally{s.destroy()}}var z0=p(()=>{"use strict";k0();bR()});var cye,tK,rK,wR=p(()=>{"use strict";ic();j0();z0();kh();({preload:cye,...tK}=Ti),rK={...tK,parse:async(e,t,r)=>await Cu(e,t,async()=>{var n;return await U0(nc(t),"wasm",(n=t==null?void 0:t.draco)==null?void 0:n.decoderProfile)},r)}});var xR={};Jt(xR,{DracoWASMLoaderWithParser:()=>rK});var _R=p(()=>{"use strict";wR()});var pye,nK,iK,SR=p(()=>{"use strict";ic();j0();z0();kh();({preload:pye,...nK}=Ti),iK={...nK,parse:async(e,t,r)=>await Cu(e,t,async()=>await U0(nc(t),"js"),r)}});var MR={};Jt(MR,{DracoJavaScriptLoaderWithParser:()=>iK});var vR=p(()=>{"use strict";SR()});function aK(e){var r;let t=(r=e==null?void 0:e.modules)==null?void 0:r.draco3d;if(!t)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return t}var _ye,oK,sK,ER=p(()=>{"use strict";j0();z0();kh();({preload:_ye,...oK}=Ti),sK={...oK,parse:async(e,t,r)=>await Cu(e,t,async()=>await ox(aK(t)),r)}});var TR={};Jt(TR,{Draco3DLoaderWithParser:()=>sK});var AR=p(()=>{"use strict";ER()});async function cK(e,t){var n;let r=t;switch(lK(r)){case"wasm":{let{DracoWASMLoaderWithParser:i}=await Promise.resolve().then(()=>(_R(),xR));return i}case"javascript":{let{DracoJavaScriptLoaderWithParser:i}=await Promise.resolve().then(()=>(vR(),MR));return i}case"draco3d":{let{Draco3DLoaderWithParser:i}=await Promise.resolve().then(()=>(AR(),TR));return i}default:throw new Error(`DracoLoader: unsupported backend "${(n=r==null?void 0:r.draco)==null?void 0:n.backend}"`)}}function lK(e){var t;return(t=e==null?void 0:e.draco)!=null&&t.backend?e.draco.backend==="js"?"javascript":e.draco.backend:Ti.options.draco.backend}var Ti,kh=p(()=>{"use strict";FP();JP();eR();rR();Ti={dataType:null,batchType:null,...QP,version:ZP,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:CP,deserializeWorkerResult:DP,options:{draco:tR},preload:cK}});var sx=p(()=>{"use strict";CA();kh()});function Uh(e){let t=e.trim().toUpperCase(),r=t.match(/(?:\/DEF\/CRS\/|URN:OGC:DEF:CRS:)([A-Z0-9_-]+)(?:\/|::)(?:[^/:]*[/:])?([A-Z0-9_.-]+)$/);return r?`${r[1]}:${r[2]}`:t}var Du,q0,ax=p(()=>{"use strict";Du="EPSG:4326",q0="EPSG:4978"});function Po(e){var r,n;if(typeof e=="string"){let i=wr(e);return i==="wkt"?fK(e):i==="proj-string"?hK(e):uK(e)||"projected"}let t=e;return t.type==="BoundCRS"&&t.source_crs?Po(t.source_crs):t.type==="CompoundCRS"&&((r=t.components)!=null&&r[0])?Po(t.components[0]):String(t.type).includes("Projected")?"projected":String(t.type).includes("Geographic")?"geographic":String(t.type).includes("Geodetic")?((n=t.coordinate_system)==null?void 0:n.subtype)==="Cartesian"?"geocentric":"geographic":"unknown"}function uK(e){if(typeof e!="string")return;let t=Uh(e);if(t===q0)return"geocentric";if(t===Du||t==="OGC:CRS84")return"geographic";let r=/^EPSG:(\d+)$/.exec(t);if(!r)return;let n=Number(r[1]);if(n===7789)return"geocentric";if(n===4490||n===4979)return"geographic";if(n===3857||n>=32601&&n<=32660||n>=32701&&n<=32760)return"projected"}function fK(e){let t;try{t=_f(e).root}catch{return"unknown"}switch(t.keyword.toUpperCase()){case"GEOCCS":return"geocentric";case"GEOGCS":case"GEOGCRS":case"GEOGRAPHICCRS":case"GEOGRAPHIC2DCRS":case"GEOGRAPHIC3DCRS":return"geographic";case"PROJCS":case"PROJCRS":case"PROJECTEDCRS":return"projected";case"GEODCRS":case"GEODETICCRS":{let r=t.values.find(i=>i.type==="node"&&i.keyword.toUpperCase()==="CS"),n=r==null?void 0:r.values[0];return(n==null?void 0:n.type)!=="enumeration"&&(n==null?void 0:n.type)!=="string"?"unknown":n.value.toUpperCase()==="CARTESIAN"?"geocentric":n.value.toUpperCase()==="ELLIPSOIDAL"?"geographic":"unknown"}default:return"unknown"}}function hK(e){var t;try{let r=(t=Sf(e).parameters.find(n=>n.name.toLowerCase()==="proj"))==null?void 0:t.value;switch(r==null?void 0:r.toLowerCase()){case"longlat":case"latlong":return"geographic";case"geocent":return"geocentric";default:return r?"projected":"unknown"}}catch{return"unknown"}}var cx=p(()=>{"use strict";oy();ax()});function V0(e,t={}){let r=t.sourceCrs!==void 0,n=t.sourceCrs||e.sourceCrs,i=t.outputCoordinates||"auto",o=t.targetCrs||(i==="ecef"?"EPSG:4978":void 0),s=t.targetHeightReference||"native",a=e.verticalUnitScale??1,c=e.elevationUnitScale??1,l=e.elevationOffset||0,u=e.elevationMode==="onTheGround"||e.elevationMode==="relativeToGround"||e.elevationMode==="relativeToScene",h=e.elevationMode==="relativeToScene"?!!t.sceneElevationProvider:!u||!!t.terrainElevationProvider,d=a!==1||c!==1||e.elevationMode!==void 0&&(u||e.elevationMode==="absoluteHeight"&&l!==0),m=s!=="native"&&s!==e.heightReference,g=!!o||s!=="native"||i!=="auto"||d,y=i!=="target-crs"||!!o,b=!m||(e.heightReference||"unknown")!=="unknown",w=Number.isFinite(a)&&a>0&&Number.isFinite(c)&&c>0,_=!!n&&g&&y&&b&&w&&h&&i!=="local-enu",S=r?"caller-override":e.provenance||"unknown",v=r&&n?Po(n):e.coordinateFrame,T=r?"explicit":e.sourceCrsState||(n?S==="format-default"?"default":"explicit":"absent"),O=Jd({crs:n?{state:T==="default"?"default":"explicit",definition:n,representation:!r&&e.sourceCrsRepresentation||wr(n),provenance:S,alternatives:r?void 0:e.sourceCrsAlternatives}:{state:T==="unknown"?"unknown":"absent",provenance:S},vertical:e.verticalCrs?{state:"explicit",definition:e.verticalCrs,representation:wr(e.verticalCrs),provenance:e.provenance||"metadata"}:void 0,coordinateEpoch:t.coordinateEpoch??e.coordinateEpoch,coordinateFrame:v,coordinateOrder:mK(e.axisOrder),units:r?void 0:e.units}),P=lx(O.crs),M=O.vertical?lx(O.vertical):void 0,U=o?dK(o):void 0;return Object.freeze({...O,sourceCrs:P,verticalCrs:M,verticalUnitScale:a,coordinateEpoch:t.coordinateEpoch??e.coordinateEpoch,heightReference:e.heightReference||"unknown",elevationMode:e.elevationMode,elevationOffset:e.elevationOffset,elevationUnit:e.elevationUnit,elevationUnitScale:c,coordinateFrame:v||"unknown",axisOrder:e.axisOrder||"unknown",provenance:S,targetCrs:U,targetHeightReference:s,outputCoordinates:i,status:g?_?"transformable":"unresolved":"native",warnings:Object.freeze([...e.warnings||[]])})}function lx(e){return e.state==="explicit"||e.state==="default"?e.definition:void 0}function dK(e){let t=Jd({crs:{state:"explicit",definition:e,representation:wr(e),provenance:"caller-override"}}),r=lx(t.crs);if(!r)throw new Error("Failed to normalize a known target CRS definition");return r}function mK(e){switch(e){case"xy":return["x","y"];case"yx":return["y","x"];case"xyz":return["x","y","z"];default:return[]}}function IR(e){if(e.status!=="transformable"&&e.status!=="transformed")throw new Error("Only a transformable spatial reference can be marked as transformed");return Object.freeze({...e,status:"transformed"})}var PR=p(()=>{"use strict";oy();cx()});function RR(e){if(!e)return;let t=e.trim().toLowerCase().replaceAll("_","-"),r=gK[t]||t;return pK[r]}var pK,gK,LR=p(()=>{"use strict";pK=Object.freeze({meter:1,millimeter:.001,centimeter:.01,decimeter:.1,kilometer:1e3,foot:.3048,yard:.9144,mile:1609.344,"us-foot":.3048006096012192,"us-inch":.0254000508001016,"us-yard":.9144018288036576,"us-mile":1609.3472186944373,"clarke-foot":.3047972654,"clarke-yard":.9143917962,"clarke-link":.201166195164,"sears-yard":.914398414616,"sears-foot":.304799471539,"sears-chain":20.1167651216,"sears-1922-truncated-chain":20.116756,"benoit-1895-b-chain":20.1167824944,"indian-yard":.914398530744,"indian-1937-yard":.91439523,"gold-coast-foot":.304799710181}),gK=Object.freeze({m:"meter",metre:"meter",meters:"meter",metres:"meter",mm:"millimeter",millimetre:"millimeter",millimeters:"millimeter",millimetres:"millimeter",cm:"centimeter",centimetre:"centimeter",centimeters:"centimeter",centimetres:"centimeter",dm:"decimeter",decimetre:"decimeter",decimeters:"decimeter",decimetres:"decimeter",km:"kilometer",kilometre:"kilometer",kilometers:"kilometer",kilometres:"kilometer",ft:"foot",feet:"foot","us-survey-foot":"us-foot","us-survey-feet":"us-foot",yd:"yard",yards:"yard",mi:"mile",miles:"mile"})});function OR(e){return{input:new Float64Array(e),output:new Float64Array(e)}}function jh(e){return e instanceof Float32Array||e instanceof Float64Array}function BR(e){return typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function ux(e,t,r,n,i,o){return(e.buffer===n.buffer||BR(e.buffer)&&BR(n.buffer))&&t<o&&i<r}function W0(e,t,r,n){return e<t+n?0:Math.floor((e-t-n)/r)+1}var H0,CR=p(()=>{H0=class{constructor(t){var o,s;this.depth=0;let r=t.dimension??2,n=t.inputOffset??0,i=t.outputOffset??0;if(!Number.isSafeInteger(r)||r<2||!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(i)||i<0||t.inputStride!==void 0&&(!Number.isSafeInteger(t.inputStride)||t.inputStride<1)||t.outputStride!==void 0&&(!Number.isSafeInteger(t.outputStride)||t.outputStride<1)||typeof((o=t.projection)==null?void 0:o.projectToSync)!="function"||typeof((s=t.projection)==null?void 0:s.unprojectToSync)!="function")throw new Error("Invalid projection buffer transform or layout");this.dimension=r,this.projection=t.projection,this.inputOffset=n,this.outputOffset=i,this.inputStride=t.inputStride,this.outputStride=t.outputStride,this.scratch=[OR(r)]}projectFlatTo(t,r,n,i=0,o){return this.flat(t,r,n,i,!1,o)}unprojectFlatTo(t,r,n,i=0,o){return this.flat(t,r,n,i,!0,o)}projectColumnsTo(t,r,n,i=0,o){return this.columns(t,r,n,i,!1,o)}unprojectColumnsTo(t,r,n,i=0,o){return this.columns(t,r,n,i,!0,o)}range(t,r,n){let i=r??Math.max(0,t-n);if(!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(i)||i<0||!Number.isSafeInteger(n+i)||n+i>t)throw new Error("Invalid projection buffer record range");return i}epochStorage(t,r,n){if(t!==void 0){if(typeof t=="number"){if(!Number.isFinite(t))throw new Error("Coordinate epoch must be finite")}else if(!jh(t)||t.length<r+n)throw new Error("Epoch buffer requires one value per addressed record")}}aliases(t,r,n,i,o,s,a){if(!i)return;let c=t.byteOffset+(this.inputOffset+n*o)*t.BYTES_PER_ELEMENT,l=c+((i-1)*o+a)*t.BYTES_PER_ELEMENT,u=r.byteOffset+(this.outputOffset+n*s)*r.BYTES_PER_ELEMENT,h=u+((i-1)*s+a)*r.BYTES_PER_ELEMENT,d=t.buffer===r.buffer&&t.constructor===r.constructor&&c===u&&o===s;if(ux(t,c,l,r,u,h)&&!d)throw new Error("Projection input/output ranges overlap without an exact in-place mapping")}epochAlias(t,r,n,i,o,s){if(typeof t!="object"||!t||!i)return;let a=t.byteOffset+n*t.BYTES_PER_ELEMENT,c=a+i*t.BYTES_PER_ELEMENT,l=r.byteOffset+(this.outputOffset+n*o)*r.BYTES_PER_ELEMENT,u=l+((i-1)*o+s)*r.BYTES_PER_ELEMENT;if(ux(t,a,c,r,l,u))throw new Error("Epoch and output buffers must not overlap")}acquire(){var t;let r=this.depth++;return(t=this.scratch)[r]||(t[r]=OR(this.dimension)),this.scratch[r]}transform(t,r,n){if(n!==void 0&&!Number.isFinite(n))throw new Error("Coordinate epoch must be finite");r?this.projection.unprojectToSync(t.input,t.output,n):this.projection.projectToSync(t.input,t.output,n)}floatRange(t,r){for(let n=0;n<this.dimension;n++){let i=t[n];if(n<3&&!Number.isFinite(i)||r&&Number.isFinite(i)&&Math.abs(i)>34028234663852886e22)throw new Error("Projection output is nonfinite or exceeds Float32 range")}}flat(t,r,n,i,o,s){if(!jh(t)||!jh(r))throw new Error("Projection buffers require Float32Array or Float64Array");let a=this.inputStride??this.dimension,c=this.outputStride??this.dimension;if(a<this.dimension||c<this.dimension)throw new Error("Interleaved stride must contain every ordinate");let l=this.range(W0(t.length,this.inputOffset,a,this.dimension),n,i);if(i+l>W0(r.length,this.outputOffset,c,this.dimension))throw new Error("Projection output buffer is too short");this.epochStorage(s,i,l),this.aliases(t,r,i,l,a,c,this.dimension),this.epochAlias(s,r,i,l,c,this.dimension);let u=this.acquire();try{let h=typeof s=="number"?void 0:s,d=r instanceof Float32Array;for(let m=i;m<i+l;m++){let g=this.inputOffset+m*a,y=this.outputOffset+m*c;for(let b=0;b<this.dimension;b++)u.input[b]=t[g+b];this.transform(u,o,h?h[m]:s),this.floatRange(u.output,d);for(let b=0;b<this.dimension;b++)r[y+b]=u.output[b]}return r}finally{this.depth--}}columns(t,r,n,i,o,s){if(t.length!==this.dimension||r.length!==this.dimension)throw new Error("Projection columns must match dimension");let a=this.inputStride??1,c=this.outputStride??1,l=Number.MAX_SAFE_INTEGER;for(let d=0;d<this.dimension;d++){if(!jh(t[d])||!jh(r[d]))throw new Error("Projection columns require floating typed arrays");l=Math.min(l,W0(t[d].length,this.inputOffset,a,1))}let u=this.range(l,n,i);this.epochStorage(s,i,u);for(let d=0;d<this.dimension;d++){if(i+u>W0(r[d].length,this.outputOffset,c,1))throw new Error("Projection output column is too short");this.epochAlias(s,r[d],i,u,c,1);for(let m=0;m<this.dimension;m++)this.aliases(t[d],r[m],i,u,a,c,1);for(let m=0;m<d&&u;m++){let g=r[d].byteOffset+(this.outputOffset+i*c)*r[d].BYTES_PER_ELEMENT,y=r[m].byteOffset+(this.outputOffset+i*c)*r[m].BYTES_PER_ELEMENT;if(ux(r[d],g,g+((u-1)*c+1)*r[d].BYTES_PER_ELEMENT,r[m],y,y+((u-1)*c+1)*r[m].BYTES_PER_ELEMENT))throw new Error("Projection output columns overlap")}}let h=this.acquire();try{let d=typeof s=="number"?void 0:s;for(let m=i;m<i+u;m++){let g=this.inputOffset+m*a,y=this.outputOffset+m*c;for(let b=0;b<this.dimension;b++)h.input[b]=t[b][g];this.transform(h,o,d?d[m]:s);for(let b=0;b<this.dimension;b++){let w=h.output[b];if(b<3&&!Number.isFinite(w)||r[b]instanceof Float32Array&&Number.isFinite(w)&&Math.abs(w)>34028234663852886e22)throw new Error("Projection output is nonfinite or exceeds Float32 range")}for(let b=0;b<this.dimension;b++)r[b][y]=h.output[b]}return r}finally{this.depth--}}}});function DR(){return{bounds:[[-1,-1,0],[1,1,0]]}}var NR=p(()=>{});function hx(){let e=globalThis;return e[fx]||(e[fx]=new WeakMap),e[fx]}function FR(e){var t;return"create"in e?e:(t=hx().get(e))==null?void 0:t.implementation}function GR(e){if("create"in e)return Promise.resolve(e);let t=hx().get(e);if(t||(t={load:()=>e.preload()},hx().set(e,t)),t.implementation)return Promise.resolve(t.implementation);let r=t;return r.pending||(r.pending=Promise.resolve().then(r.load).then(n=>{let i=s=>s.toLowerCase().replace(/[\s_-]/g,""),o=new Set([n.name,...n.aliases||[]].map(i));if(typeof n.create!="function"||![e.name,...e.aliases||[]].every(s=>o.has(i(s))))throw new Error("Loaded projection does not match descriptor: "+e.name);return r.implementation=n,n}).catch(n=>{throw r.pending=void 0,n})),r.pending}var fx,kR=p(()=>{fx=Symbol.for("@math.gl/projection/projection-implementations")});function il(e,t,r){if(!(Array.isArray(e)||e instanceof Float32Array||e instanceof Float64Array))throw new Error("Scalar input requires a number array, Float32Array or Float64Array");if(!(Array.isArray(t)||t instanceof Float32Array||t instanceof Float64Array)||t.length<r)throw new Error("Scalar output requires a preallocated number array, Float32Array or Float64Array with sufficient capacity");if(e===t||Array.isArray(e)||Array.isArray(t))return;let n=e,i=t,o=typeof SharedArrayBuffer<"u"&&n.buffer instanceof SharedArrayBuffer&&i.buffer instanceof SharedArrayBuffer;if((n.buffer===i.buffer||o)&&n.byteOffset<i.byteOffset+r*i.BYTES_PER_ELEMENT&&i.byteOffset<n.byteOffset+n.byteLength)throw new Error("Scalar input/output views overlap; use the same view for in-place projection")}function zh(e,t,r,n){if(t instanceof Float32Array){if(Math.abs(r.x)>$0||Math.abs(r.y)>$0||n>=3&&Math.abs(r.z)>$0)throw new Error("Projected coordinate exceeds Float32 range");for(let i=3;i<e.length;i++){let o=e[i];if(Number.isFinite(o)&&Math.abs(o)>$0)throw new Error("Trailing ordinate exceeds Float32 range")}}for(let i=3;i<e.length;i++)t[i]=e[i];return t[0]=r.x,t[1]=r.y,n>=3&&(t[2]=r.z),t}var $0,dx=p(()=>{$0=34028234663852886e22});function Ue(e){throw new ai("missing-transform-stage",e)}var UR,jR,ai,za=p(()=>{jR=Symbol.for("@math.gl/projection/TypeScriptCRSError"),ai=class e extends Error{static[(UR=jR,Symbol.hasInstance)](t){return this!==e?Function.prototype[Symbol.hasInstance].call(this,t):t instanceof Error&&t[jR]===!0}constructor(t,r){super(r),this.reason=t,this[UR]=!0,this.name="TypeScriptCRSError"}}});function qh(e,t){if(typeof e=="string"||"type"in e)return{definition:e,lossy:!1};let r=e,n="crs"in r?r:void 0,i="crs"in r?r.crs:r;if(i.state!=="explicit"&&i.state!=="default")throw new ai("unknown-syntax","Cannot transform an "+i.state+" CRS reference");let o=!1;return(n==null?void 0:n.coordinateEpoch)!==void 0&&Ue("Coordinate epochs require a time-dependent transformation"),n!=null&&n.vertical&&n.vertical.state!=="absent"&&(t.mode!=="horizontal"&&Ue("A separately declared vertical CRS requires explicit horizontal extraction"),o=!0),{definition:i.definition,spatialReference:n,lossy:o}}function zR(e,t){var o;if(!t)return e;if(t.coordinateFrame!=="unknown"&&t.coordinateFrame!==e.kind)throw new Error("SpatialReference coordinate frame disagrees with its CRS");let r=t.coordinateOrder,n=e.kind==="geocentric"?{x:"e",y:"n",z:"u"}:{longitude:"e",lon:"e",latitude:"n",lat:"n",easting:"e",northing:"n",height:"u",altitude:"u",x:"e",y:"n",z:"u"},i;if(r.length&&(i=r.slice(0,3).map(s=>n[s.toLowerCase()]||"?").join(""),i.length===2&&(i+="u"),(i.length!==3||!i.includes("e")||!i.includes("n")||!i.includes("u"))&&Ue("Unsupported SpatialReference coordinate order"),(r.length>4||r.length>3&&!["m","measure"].includes(r[3]))&&Ue("Unsupported fourth coordinate component")),(o=t.units)!=null&&o.length){let s={m:1,meter:1,metre:1,meters:1,metres:1,km:1e3,ft:.3048,"us-ft":.3048006096012192,degree:Math.PI/180,degrees:Math.PI/180,radian:1,radians:1,grad:Math.PI/200};for(let a=0;a<Math.min(t.units.length,3);a++){let c=(i||"enu")[a]==="u",l=e.kind==="geocentric"?e.toMeter:c?e.verticalUnit:e.kind==="geographic"?e.angularUnit:e.toMeter;(Math.abs((s[t.units[a]]??NaN)-l)>1e-12||s[t.units[a]]===void 0)&&Ue("SpatialReference units disagree with its CRS")}}return Object.freeze({...e,storedAxis:i})}var mx=p(()=>{za()});function Nu(e){var i;if(!((i=e.datumCatalogs)!=null&&i.length))return px;let t=WR.get(e);if((t==null?void 0:t.catalogs)===e.datumCatalogs)return t.definitions;let r=Object.assign(Object.create(null),px),n=new Map(Object.entries(px).map(([o,s])=>[ol(o),{definition:s,owner:-1}]));return e.datumCatalogs.forEach((o,s)=>{if(!o.name||!o.datums)throw new Error("Invalid datum catalogue plugin");for(let[a,c]of Object.entries(o.datums)){let l=ol(a);if(!l||l==="none"||!c||["ellipse","towgs84","nadgrids"].some(h=>c[h]!==void 0&&typeof c[h]!="string"))throw new Error("Invalid datum definition: "+a);let u=n.get(l);if(u&&(u.owner!==s||u.definition.ellipse!==c.ellipse||u.definition.towgs84!==c.towgs84||u.definition.nadgrids!==c.nadgrids))throw new Error("Conflicting datum registration: "+a);n.set(l,{definition:c,owner:s}),r[a]=c}}),WR.set(e,{catalogs:e.datumCatalogs,definitions:r}),r}var qR,VR,px,WR,ol,K0=p(()=>{qR={towgs84:"0,0,0",ellipse:"WGS84"},VR={towgs84:"0,0,0",ellipse:"GRS80"},px={wgs84:qR,WGS84:qR,nad83:VR,North_American_Datum_1983:VR},WR=new WeakMap,ol=e=>e.toLowerCase().replace(/[\s_-]/g,"")});var yK,HR,$R=p(()=>{yK={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,b:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS72:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},HR=yK});var On,KR,XR=p(()=>{On={};On.greenwich=0;On.lisbon=-9.131906111111;On.paris=2.337229166667;On.bogota=-74.080916666667;On.madrid=-3.687938888889;On.rome=12.452333333333;On.bern=7.439583333333;On.jakarta=106.807719444444;On.ferro=-17.666666666667;On.brussels=4.367975;On.stockholm=18.058277777778;On.athens=23.7163375;On.oslo=10.722916666667;KR=On});function gx(e,t){let r=Object.keys(e).find(n=>ZR(n)===ZR(t));return r===void 0?void 0:e[r]}function JR(e){if(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(e)){let r=Number(e);if(Number.isFinite(r))return r}if(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?r$/i.test(e)){let r=Number(e.slice(0,-1))/At;if(Number.isFinite(r))return r}let t=/^([+-]?)(\d+(?:\.\d*)?)(?:d(?:(\d+(?:\.\d*)?)'(?:(\d+(?:\.\d*)?)")?)?)?([NSEW])?$/i.exec(e);if(t&&(/d/i.test(e)||t[5])){let r=Number(t[3]||0),n=Number(t[4]||0);if(r<60&&n<60){let i=t[1]==="-"?-1:1,o=/[SW]/i.test(t[5]||"")?-1:1,s=i*o*(Number(t[2])+r/60+n/3600);if(Number.isFinite(s))return s}}throw new Error("Invalid angular parameter: "+e)}function yx(e,t={}){let r=e,n=t.aliases||{},i=new Set;for(;typeof r=="string"&&(Ro(n,r)||Ro(YR,r));){if(i.has(r))throw new Error("Circular CRS alias: "+r);i.add(r),r=Ro(n,r)?n[r]:YR[r]}if(typeof r=="string"){let o=/^EPSG:(326|327)(\d{2})$/.exec(r);o&&Number(o[2])>=1&&Number(o[2])<=60&&(r="+proj=utm +datum=WGS84 +zone="+Number(o[2])+(o[1]==="327"?" +south":"")),(r==="EPSG:5041"||r==="EPSG:5042")&&(r="+proj=stere +datum=WGS84 +lat_0="+(r==="EPSG:5041"?90:-90)+" +k_0=0.994 +x_0=2000000 +y_0=2000000")}return r}function xs(e,t={}){var U;let r=Nu(t),n=qh(e,t),i=yx(n.definition,t),o;if(wr(i)==="proj-string"&&typeof i=="string"){let C=Object.create(null);for(let L of Sf(i).parameters){if(Ro(C,L.name))throw new Error("Duplicate PROJ parameter: +"+L.name);C[L.name]=L.value}o={parameters:C}}else{let C=(U=t.parsers)==null?void 0:U.find(L=>L.canParse(i));if(!C){let L=["wkt","projjson"].includes(wr(i));throw new ai(L?"missing-parser":"unknown-syntax",wr(i)==="identifier"?"Unsupported CRS definition: "+i+"; resolve it first":"Unsupported CRS definition; register a WKT or PROJJSON parser for structured definitions")}o=C.parse(i,t)}let s={...o.parameters};for(let C of["lon_0","lat_0","lat_1","lat_2","lat_ts","lon_wrap","lon_1","lon_2","lonc","alpha","gamma","tilt","azi","o_alpha","o_lon_c","o_lat_c","o_lon_p","o_lat_p","o_lon_1","o_lat_1","o_lon_2","o_lat_2"])s[C]!==void 0&&(s[C]=String(JR(s[C])));let a=s.proj,c=a==null?void 0:a.toLowerCase(),l=c==="geocentric"?"geocent":["longlat","latlong","latlon","lonlat","identity","geocent"].includes(c)?c:a;if(!l)throw new Error("CRS requires +proj");let u=["longlat","latlong","latlon","lonlat"].includes(l)?"geographic":l==="geocent"?"geocentric":l==="identity"?"identity":"projected",h=s.datum,d=h&&h!=="none"?gx(r,h):void 0;h&&h!=="none"&&!d&&Ue("Unknown datum: "+h+"; register a datumCatalogs plugin");let m=eL(s,d==null?void 0:d.ellipse),g=s.nadgrids??(d==null?void 0:d.nadgrids),y=g===void 0?void 0:g.split(",").map(C=>{let L=C.startsWith("@"),A=L?C.slice(1):C;if(!A||/\s/.test(A))throw new Error("Invalid datum grid name");return Object.freeze({name:A,optional:L})}),b=s.towgs84??(d==null?void 0:d.towgs84),w;if(b!==void 0&&(w=b.split(",").map(C=>re({value:C},"value",NaN)),![3,7].includes(w.length)||w.some(C=>!Number.isFinite(C))||w.length===7&&w[6]<=-1e6))throw new Error("+towgs84 requires three or seven finite values and positive scale");h==="none"&&(w=void 0),y&&h!=="none"&&(w=[0,0,0]);let _=g==="@null"||g==="null"?eL({ellps:"WGS84"}):m,S=s.axis||"enu";if(S.length!==3||!/[ew]/.test(S)||!/[ns]/.test(S)||!/[ud]/.test(S))throw new Error("Invalid axis: "+S);let v=o.angularUnit??At;if(u==="geographic"&&(s.units&&s.units!=="degrees"||Ro(s,"to_meter")))throw new Error("Geographic coordinates must use angular units");if(u!=="geographic"&&s.units==="degrees")throw new Error("Linear coordinates require linear units");let T=QR(s,"units","to_meter"),O=o.verticalUnit??QR(s,"vunits","vto_meter");if(!(O>0)||!Number.isFinite(O))throw new Error("Invalid vertical unit");if(!(v>0)||!Number.isFinite(v))throw new Error("Invalid angular unit");let P=s.pm,M=P===void 0?0:(gx(KR,P)??JR(P))*At;return zR(Object.freeze({kind:u,projection:l,parameters:Object.freeze(s),ellipsoid:m,datum:Object.freeze({ellipsoid:_,towgs84:w&&Object.freeze(w),grids:h==="none"||g==="@null"||g==="null"?void 0:y&&Object.freeze(y)}),areaOfUse:o.areaOfUse,angularUnit:v,toMeter:T,verticalUnit:O,primeMeridian:M,axis:S,longitudeWrap:s.lon_wrap===void 0?void 0:Number(s.lon_wrap)*At,lossy:!!(o.lossy||n.lossy)}),n.spatialReference)}function QR(e,t,r){let n=e[t],i=Mf;if(t==="vunits"&&n==="degrees")throw new Error("Height requires linear units");if(n&&!["m","degrees"].includes(n)&&!Ro(i,n))throw new Error("Unsupported units: "+n);let o=re(e,r,n&&i[n]?i[n].metersPerUnit:1);if(!(o>0))throw new Error("+"+r+" must be positive");return o}function eL(e,t){let r=t||e.ellps||"WGS84",n=gx(HR,r);if(!n)throw new Error("Unsupported ellipsoid: "+r);let i=re(e,"a",n.a),o=re(e,"f",NaN),s=re(e,"rf",Number.isNaN(o)?n.rf||0:o===0?0:1/o),a=re(e,"b",s?i*(1-1/s):Ro(e,"f")||Ro(e,"rf")||Ro(e,"a")?i:n.b||i),c=re(e,"R",0);if(i<=0||a<=0||a>i||s<0||s>0&&s<=1||Ro(e,"R")&&c<=0||!Number.isNaN(o)&&(o<0||o>=1))throw new Error("Invalid ellipsoid dimensions");return Object.freeze({semiMajorAxis:c||i,semiMinorAxis:c||a,eccentricitySquared:c?0:1-(a/i)**2})}var YR,X0,tL,Ro,ZR,Fu=p(()=>{Dl();ny();mx();Vt();K0();$R();XR();iy();za();YR={WGS84:"+proj=longlat +datum=WGS84","EPSG:4326":"+proj=longlat +datum=WGS84","EPSG:4269":"+proj=longlat +datum=NAD83","EPSG:4978":"+proj=geocent +datum=WGS84","EPSG:4979":"+proj=longlat +datum=WGS84","EPSG:3857":"+proj=merc +a=6378137 +b=6378137 +nadgrids=@null +units=m","EPSG:3785":"EPSG:3857",GOOGLE:"EPSG:3857","EPSG:900913":"EPSG:3857","EPSG:102113":"EPSG:3857"},X0=["proj","datum","ellps","a","b","rf","f","R","units","to_meter","vunits","vto_meter","no_defs","type","title","towgs84","nadgrids","geoidgrids","axis","pm","over","lon_wrap"],tL=["no_defs","over"],Ro=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ZR=e=>e.toLowerCase().replace(/[\s_-]/g,"")});function J0(e,t){if(Math.abs(e.y)>Math.PI/2)throw new Error("Latitude outside geocentric domain");if(!Tf(e,t))throw new Error("Geocentric coordinate must be finite")}function Q0(e,t){let r=e.x,n=e.y,i=e.z,{semiMajorAxis:o,semiMinorAxis:s,eccentricitySquared:a}=t;if(r===0&&n===0&&i===0)throw new Error("Geodetic coordinates are undefined at the Earth center");if(a!==0&&Math.abs(r)<1e-12*o&&Math.abs(n)<1e-12*o&&Math.hypot(r,n)<1e-12*o){if(!Number.isFinite(Math.hypot(r,n,i)))throw new Error("Geocentric radius must be finite");e.x=0,e.y=Math.sign(i)*Math.PI/2,e.z=Math.abs(i)-s;return}if(!Af(e,t))throw Number.isFinite(Math.hypot(r,n,i))?new Error("Geocentric inverse did not converge"):new Error("Geocentric radius must be finite")}function rL(e,t){let r=e[0],n=e[1],i=e[2],o=(e[3]||0)*bx,s=(e[4]||0)*bx,a=(e[5]||0)*bx,c=1+(e[6]||0)/1e6;return t?l=>{let u=(l.x-r)/c,h=(l.y-n)/c,d=(l.z-i)/c;l.x=u+a*h-s*d,l.y=-a*u+h+o*d,l.z=s*u-o*h+d}:l=>{let u=l.x,h=l.y,d=l.z;l.x=c*(u-a*h+s*d)+r,l.y=c*(a*u+h-o*d)+n,l.z=c*(-s*u+o*h+d)+i}}function Z0(e){var t;return!!((t=e.towgs84)!=null&&t.some(r=>r!==0))}function xx(e,t){if(!(!e.towgs84||!t.towgs84)){if(e.grids||t.grids){if(e.grids&&t.grids&&e.ellipsoid.semiMajorAxis===t.ellipsoid.semiMajorAxis&&e.ellipsoid.eccentricitySquared===t.ellipsoid.eccentricitySquared&&e.grids.length===t.grids.length&&e.grids.every((n,i)=>n.name===t.grids[i].name&&n.optional===t.grids[i].optional&&n.grid===t.grids[i].grid))return;let r=xx(e.grids?Y0:e,t.grids?Y0:t);return n=>{e.grids&&nL(n,e,!1),r==null||r(n),t.grids&&nL(n,t,!0)}}if(Z0(e)||Z0(t)){let r=wx(e,Y0),n=wx(Y0,t);return i=>{r==null||r(i),n==null||n(i)}}return wx(e,t)}}function wx(e,t){if(!e.towgs84||!t.towgs84)return;let r=e.ellipsoid,n=t.ellipsoid,i=!0;for(let a=0;a<7;a++)(e.towgs84[a]||0)!==(t.towgs84[a]||0)&&(i=!1);if(r.semiMajorAxis===n.semiMajorAxis&&Math.abs(r.eccentricitySquared-n.eccentricitySquared)<=5e-11&&i)return;let o=Z0(e)?rL(e.towgs84,!1):void 0,s=Z0(t)?rL(t.towgs84,!0):void 0;return a=>{J0(a,r),o==null||o(a),s==null||s(a),Q0(a,n)}}function nL(e,t,r){for(let n of t.grids){if(n.name==="null")return;if(!n.grid){if(n.optional)continue;throw new Error("Required datum grid is not registered: "+n.name)}let i=!1;if(n.grid.shiftInPlace)i=n.grid.shiftInPlace(e,r);else{let o=n.grid.shift(e.x,e.y,r);o&&(e.x=o[0],e.y=o[1],i=!0)}if(i){if(!Number.isFinite(e.x)||!Number.isFinite(e.y)||Math.abs(e.y)>Math.PI/2)throw new Error("Datum grid produced a coordinate outside the geographic domain");return}}throw new Error("No datum grid covers coordinate: "+t.grids.map(n=>n.name).join(","))}function iL(e,t){let r={x:e[0],y:e[1],z:e[2]};return J0(r,t),[r.x,r.y,r.z]}function oL(e,t){let r={x:e[0],y:e[1],z:e[2]};return Q0(r,t),[r.x,r.y,r.z]}var bx,Y0,_x=p(()=>{Fn();bx=Math.PI/(180*3600),Y0={ellipsoid:{semiMajorAxis:6378137,semiMinorAxis:6356752314245179e-9,eccentricitySquared:.0066943799901413165},towgs84:[0,0,0]}});function qa(e,t=0){let r=re(e,"lon_wrap",0)*At;return n=>ur(i=>{let o=Br(i,r);return[[r+o[0],i[0][1],0],[r+o[1],i[1][1],0]]},n??[-180,-90,180,90],r,t)}var Vh=p(()=>{Vt();ut();Bt()});function sL(e,t={}){if(e===void 0)return;let r=[];for(let n of e.split(",")){let i=n.startsWith("@"),o=i?n.slice(1):n;if(!o||/\s/.test(o))throw new Error("Invalid vertical grid name");if(o==="null"){r.push(null);break}let s=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(s){if(typeof s.getOffset!="function")throw new Error("Invalid vertical grid: "+o);r.push(s.getOffset.bind(s))}else i||Ue("Required vertical grid is not registered: "+o)}return(n,i)=>{for(let o of r){if(!o)return 0;let s=o(n,i);if(s!==void 0){if(!Number.isFinite(s))throw new Error("Vertical grid returned a non-finite offset");return s}}throw new Error("No vertical grid covers this coordinate")}}var aL=p(()=>{za()});function cL(e){let t=hL(e.projections||[]),r=new Set;for(let n of[e.from??"WGS84",e.to??"WGS84"]){let i=xs(n,e);if(["geographic","identity"].includes(i.kind))continue;let o=t.get(t1(i.projection));if(!o)throw new ai("missing-plugin","Projection plugin is not registered: "+i.projection);r.add(o)}return[...r]}function hL(e){let t=new Map;for(let r of e)for(let n of new Set([r.name,...r.aliases||[]].map(t1))){if(!n||["longlat","latlong","latlon","lonlat","identity"].includes(n)||t.has(n))throw new Error("Duplicate or reserved projection plugin: "+n);t.set(n,r)}return t}function lL(e,t,r){var m;let n=xs(e,r),i=t.get(t1(n.projection));if(!["geographic","identity"].includes(n.kind)&&!i)throw new ai("missing-plugin","Projection plugin is not registered: "+n.projection);let o=new Set([...X0,...(i==null?void 0:i.parameters)||[]]);for(let g of Object.keys(n.parameters)){if(!o.has(g))throw new ai("missing-transform-stage","Unsupported PROJ parameter: +"+g);let y=tL.includes(g)||((m=i==null?void 0:i.flags)==null?void 0:m.includes(g));if(y&&n.parameters[g]!==void 0)throw new Error("Expected a flag without a value: +"+g);if(!y&&!n.parameters[g])throw new Error("PROJ parameter requires a value: +"+g)}if(n.parameters.type&&n.parameters.type!=="crs")throw new Error("Only +type=crs is supported");let s=t1(n.projection)==="fasttransversemercator"?Object.freeze({...n.parameters,approx:void 0}):n.parameters,a=i==null?void 0:i.create({...n.ellipsoid,parameters:s,primeMeridian:n.primeMeridian});if(n.kind==="geocentric"&&(!(a!=null&&a.forward3D)||!(a!=null&&a.inverse3D)))throw new Error("Geocentric plugin must implement 3D operations");let c=n.datum.grids,l=(c==null?void 0:c.findIndex(g=>g.name==="null"))??-1,u=c==null?void 0:c.slice(0,l<0?void 0:l+1).map(g=>{let y=Object.prototype.hasOwnProperty.call(r.datumGrids||{},g.name)?r.datumGrids[g.name]:void 0;if(y&&typeof y.shift!="function")throw new Error("Invalid prepared datum grid: "+g.name);return Object.freeze({...g,grid:y})});for(let g of u||[]){if(g.name==="null")break;!g.optional&&!g.grid&&Ue("Required datum grid is not registered: "+g.name)}let h=u?Object.freeze({...n.datum,grids:Object.freeze(u)}):n.datum,d=sL(n.parameters.geoidgrids,r.verticalGrids);return d&&(n.kind==="geocentric"||n.kind==="identity"||n.lossy)&&Ue("Vertical grids require a non-lossy geographic or projected CRS"),{...n,datum:h,implementation:a,verticalGrid:d}}function Sx(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)}function uL(e,t){if(e==="enu")return;let r=[0,0,0],n=[0,0,0];for(let i=0;i<3;i++){let o=e[i],s="ew".includes(o)?0:"ns".includes(o)?1:2;r[t?i:s]=t?s:i,n[t?i:s]="wsd".includes(o)?-1:1}return i=>{let o=i.x,s=i.y,a=i.z;i.x=n[0]*(r[0]===0?o:r[0]===1?s:a),i.y=n[1]*(r[1]===0?o:r[1]===1?s:a),i.z=n[2]*(r[2]===0?o:r[2]===1?s:a)}}function fL(e,t,r){var v,T,O,P;let n=e.storedAxis||(r?e.axis:"enu"),i=t.storedAxis||(r?t.axis:"enu"),o=uL(n,!1),s=uL(i,!0),a=e.implementation&&Wo(e.implementation,!0,e.kind==="geocentric"),c=t.implementation&&Wo(t.implementation,!1,t.kind==="geocentric"),l=xx(e.datum,t.datum),u=e.lossy||t.lossy,h=e.kind==="geocentric",d=e.kind==="geographic"?e.angularUnit:e.toMeter,m=t.kind==="geographic"?t.angularUnit:t.toMeter,g=h?1:e.verticalUnit,y=t.kind==="geocentric"?m:t.verticalUnit,b=e.primeMeridian,w=t.primeMeridian,_=t.kind==="geographic"?t.longitudeWrap:void 0,S;if(!l&&!e.verticalGrid&&!t.verticalGrid&&!u&&!o&&!s&&!b&&!w&&e.verticalUnit===1&&t.verticalUnit===1&&_===void 0){let M=Object.freeze({inputScale:d,outputScale:m});e.kind==="geographic"&&t.kind==="projected"&&(S=(T=(v=t.implementation)==null?void 0:v.createForwardFlat)==null?void 0:T.call(v,M)),e.kind==="projected"&&t.kind==="geographic"&&(S=(P=(O=e.implementation)==null?void 0:O.createInverseFlat)==null?void 0:P.call(O,M))}return{flat:S,requiresInputZ:!!(e.verticalGrid||t.verticalGrid)||e.kind==="geocentric"||/[ud]/.test(n.slice(0,2))||/[ud]/.test(i.slice(0,2)),geocentricOutput:t.kind==="geocentric",run(M){if(!Sx(M))throw new Error("Coordinates must contain finite x, y and optional z values");o==null||o(M);let U=M.z;if(u&&(M.z=0),d!==1&&(M.x*=d,M.y*=d,h&&(M.z*=d)),a==null||a(M),g!==1&&(M.z*=g),Math.abs(M.y)>Math.PI/2||!Sx(M))throw new Error("Coordinate is outside the geographic domain");if(M.x+=b,e.verticalGrid&&(M.z+=e.verticalGrid(M.x,M.y)),l==null||l(M),t.verticalGrid&&(M.z-=t.verticalGrid(M.x,M.y)),M.x-=w,_!==void 0&&(M.x=_+Xt(M.x-_)),c==null||c(M),m!==1&&(M.x/=m,M.y/=m),y!==1&&(M.z/=y),u&&(M.z=U),s==null||s(M),!Sx(M))throw new Error("Projection produced non-finite coordinates")}}}function Gu(e,t,r,n){if(e.length<2)throw new Error("Coordinates must contain finite x, y and optional z values");if(e.length<3&&t.requiresInputZ)throw new Error("This transform requires three ordinates");let i=Math.max(e.length,t.geocentricOutput?3:2),o=r.acquire();try{if(o.x=e[0],o.y=e[1],o.z=e.length>=3?e[2]:0,t.run(o),n)return zh(e,n,o,i);let s=e.slice();return s[0]=o.x,s[1]=o.y,(e.length>=3||t.geocentricOutput)&&(s[2]=o.z),s}finally{r.release(o)}}function e1(e,t,r,n){if(!(e instanceof Float32Array||e instanceof Float64Array))throw new Error("In-place projection requires a Float32Array or Float64Array");if(!Number.isSafeInteger(t)||t<2||e.length%t!==0)throw new Error("Dimension must be an integer >= 2 and divide the typed array length");if(t<3&&(r.requiresInputZ||r.geocentricOutput))throw new Error("This transform requires a dimension of at least 3");if(r.flat)return r.flat(e,t),e;let i=n.acquire();try{let o=e instanceof Float32Array;for(let s=0;s<e.length;s+=t){if(i.x=e[s],i.y=e[s+1],i.z=t>=3?e[s+2]:0,r.run(i),o&&(Math.abs(i.x)>34028234663852886e22||Math.abs(i.y)>34028234663852886e22||t>=3&&Math.abs(i.z)>34028234663852886e22))throw new Error("Projected coordinate exceeds Float32 range");e[s]=i.x,e[s+1]=i.y,t>=3&&(e[s+2]=i.z)}return e}finally{n.release(i)}}var Wh,t1,dL=p(()=>{cc();NR();kR();lc();Im();dx();Fu();za();_x();Vt();Vh();aL();Wh=class e{static async create(t={}){let r=await Promise.all(cL(t).map(GR));return new e({...t,projections:r})}get targetProfile(){return this.getTargetRenderingProfile(this.targetCoverage)}getTargetRenderingProfile(t){return this.targetRenderingProfile&&wT(this.targetRenderingProfile,t)}constructor(t={}){var i,o,s;this.coordinateScratch=new Ds,this.targetLongitudeOrigin=0;let r=t.projections||[],n=hL(r);if(r.some(a=>!("create"in a))){let a=xs(t.from??"WGS84",t),c=xs(t.to??"WGS84",t);this.lossy=a.lossy||c.lossy,this.deferred={options:{...t,projections:[...r]}}}else{let a=t,c=n,l=lL(a.from??"WGS84",c,a),u=lL(a.to??"WGS84",c,a);this.targetRenderingProfile=((o=(i=u.implementation)==null?void 0:i.getRenderingProfile)==null?void 0:o.bind(u.implementation))??(u.kind==="geographic"?qa(u.parameters,u.primeMeridian):u.kind==="identity"?DR:void 0),this.targetCoverage=u.areaOfUse,this.targetLongitudeOrigin=((s=u.implementation)==null?void 0:s.longitudeOrigin)??(u.kind==="geographic"?u.longitudeWrap??0:0),this.lossy=l.lossy||u.lossy,this.lossy&&(l.kind==="geocentric"||u.kind==="geocentric")&&Ue("Horizontal extraction cannot supply ellipsoidal height for geocentric coordinates"),this.lossy&&(l.verticalGrid||u.verticalGrid)&&Ue("Horizontal extraction cannot be combined with vertical grids"),this.forwardTransform=fL(l,u,!!t.enforceAxis),this.inverseTransform=fL(u,l,!!t.enforceAxis)}this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectTo=this.projectTo.bind(this),this.unprojectTo=this.unprojectTo.bind(this),this.projectToSync=this.projectToSync.bind(this),this.unprojectToSync=this.unprojectToSync.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this),this.projectSync=this.projectSync.bind(this),this.unprojectSync=this.unprojectSync.bind(this),this.projectFlatSync=this.projectFlatSync.bind(this),this.unprojectFlatSync=this.unprojectFlatSync.bind(this)}load(){let t=this.deferred;return t?t.implementation?Promise.resolve(t.implementation):(t.pending||(t.pending=e.create(t.options).then(r=>(t.implementation=r,r)).catch(r=>{throw t.pending=void 0,r})),t.pending):Promise.resolve(this)}loadSync(){let t=this.deferred;if(!t)return this;if(!t.implementation){let r=cL(t.options).map(n=>{let i=FR(n);if(!i)throw new Error("Projection is not preloaded: "+n.name+". Call preload() first.");return i});t.implementation=new e({...t.options,projections:r})}return t.implementation}projectSync(t){return this.deferred?this.loadSync().project(t):Gu(t,this.forwardTransform,this.coordinateScratch)}unprojectSync(t){return this.deferred?this.loadSync().unproject(t):Gu(t,this.inverseTransform,this.coordinateScratch)}projectFlatSync(t,r=2){return this.deferred?this.loadSync().projectFlat(t,r):e1(t,r,this.forwardTransform,this.coordinateScratch)}unprojectFlatSync(t,r=2){return this.deferred?this.loadSync().unprojectFlat(t,r):e1(t,r,this.inverseTransform,this.coordinateScratch)}async preload(){await this.load()}project(t){return this.deferred?this.projectLoaded(t,!1):Gu(t,this.forwardTransform,this.coordinateScratch)}unproject(t){return this.deferred?this.projectLoaded(t,!0):Gu(t,this.inverseTransform,this.coordinateScratch)}projectTo(t,r){return this.deferred?this.projectToLoaded(t,r,!1):this.projectToSync(t,r)}unprojectTo(t,r){return this.deferred?this.projectToLoaded(t,r,!0):this.unprojectToSync(t,r)}projectToSync(t,r){return this.deferred?this.loadSync().projectTo(t,r):(il(t,r,Math.max(t.length,this.forwardTransform.geocentricOutput?3:2)),Gu(t,this.forwardTransform,this.coordinateScratch,r))}unprojectToSync(t,r){return this.deferred?this.loadSync().unprojectTo(t,r):(il(t,r,Math.max(t.length,this.inverseTransform.geocentricOutput?3:2)),Gu(t,this.inverseTransform,this.coordinateScratch,r))}projectToLoaded(t,r,n){il(t,r,t.length);let i=t.slice();return this.load().then(o=>n?o.unprojectTo(i,r):o.projectTo(i,r))}projectLoaded(t,r){let n=t.slice();return this.load().then(i=>r?i.unproject(n):i.project(n))}projectFlat(t,r=2){return this.deferred?this.load().then(i=>i.projectFlat(t,r)):e1(t,r,this.forwardTransform,this.coordinateScratch)}unprojectFlat(t,r=2){return this.deferred?this.load().then(i=>i.unprojectFlat(t,r)):e1(t,r,this.inverseTransform,this.coordinateScratch)}};t1=e=>e.toLowerCase().replace(/[\s_-]/g,"")});var r1,mL=p(()=>{r1=class{constructor(t){this.sample=t,this.result=[0,0,0],this.samples=Array.from({length:4},()=>[0,0,0]),this.coarse=[0,0,0],this.fine=[0,0,0]}evaluate(t,r,n=1e-6){if(!this.difference(t,this.coarse)||!this.difference(t/2,this.fine))return!1;let i=n*Math.max(r,Math.abs(this.fine[0]),Math.abs(this.fine[1]),Math.abs(this.fine[2]));for(let o=0;o<3;o++)if(Math.abs(this.coarse[o]-this.fine[o])>i||(this.fine[o]+=(this.fine[o]-this.coarse[o])/15,!Number.isFinite(this.fine[o])))return!1;for(let o=0;o<3;o++)this.result[o]=this.fine[o];return!0}difference(t,r){let[n,i,o,s]=this.samples;if(!this.sample(-2*t,n)||!this.sample(-t,i)||!this.sample(t,o)||!this.sample(2*t,s))return!1;for(let a=0;a<3;a++)if(r[a]=(n[a]-s[a]+8*(o[a]-i[a]))/(12*t),!Number.isFinite(r[a]))return!1;return!0}}});function Mx(e){if(e.length!==3||e.some(t=>!Number.isFinite(t)||t<=0))throw new Error("Invalid CRS rendering scale");return e}function gL(e,t,r,n){if(e.kind==="geocentric")return Mx([e.toMeter,e.toMeter,e.toMeter]);if(e.kind==="identity")return Mx([...r].map(g=>/[ud]/.test(g)?e.verticalUnit:e.toMeter));let i=[0,0,0],o=[0,0,0],s=[0,0,0],a=[0,0,0],c=Array.from({length:3},()=>[0,0,0]),l=0,u=0,h=0,d=!1,m=new r1((g,y)=>{for(let _=0;_<3;_++)o[_]=i[_];o[l]+=g,t.unprojectTo(o,a);let b=a[0]-s[0],w=Math.abs(b)<=180?b:((b+180)%360+360)%360-180;return Math.abs(a[1])>=90?!1:(y[0]=w*u,y[1]=(a[1]-s[1])*h,y[2]=a[2]-s[2],y.every(Number.isFinite))});return g=>{if(d||g.length<2)return null;d=!0;let y;try{if(i[0]=g[0],i[1]=g[1],i[2]=g[2]??0,!i.every(Number.isFinite))return null;t.unprojectTo(i,s);let b=s[1]*Hh,w=pL.semiMajorAxis,_=pL.eccentricitySquared,S=1-_*Math.sin(b)**2;if(u=w*Math.cos(b)/Math.sqrt(S)*Hh,h=w*(1-_)/S**1.5*Hh,!(u>w*Hh*1e-8)||!(h>0))return null;let v=((s[0]-n+180)%360+360)%360-180;if((e.kind==="geographic"?e.longitudeWrap!==void 0:!Object.prototype.hasOwnProperty.call(e.parameters,"over"))&&Math.abs(v)+2/u>=180||Math.abs(s[1])+2/h>=90)return null;for(l=0;l<3;l++){let O=r[l],P=/[ud]/.test(O)?e.verticalUnit:e.kind==="geographic"?(/[ew]/.test(O)?u:h)*e.angularUnit/Hh:e.toMeter;if(!m.evaluate(1/P,P))return null;for(let M=0;M<3;M++)c[l][M]=m.result[M]}if(y=c.map(O=>Math.hypot(...O)),e.kind==="projected"){let O=c[r.search(/[ew]/)],P=c[r.search(/[ns]/)],M=Math.abs(O[0]*P[1]-O[1]*P[0])/e.toMeter**2;y[r.search(/[ud]/)]=e.verticalUnit*Math.sqrt(M)}}catch{return null}finally{d=!1}return Mx(y)}}var Hh,pL,yL=p(()=>{mL();Fu();Hh=Math.PI/180,pL=xs("WGS84").ellipsoid});async function SL(e,t,r,n={},i=!1,o){let s=typeof t=="string"?t:JSON.parse(JSON.stringify(t)),a={enforceAxis:r.enforceAxis,mode:r.mode,...n,converters:n.converters&&[...n.converters]},c=o?await o(s,{...r,...a}):s,l=xs(c,{...r,...a}),u=await e.createProjectionAsync({...a,from:"WGS84",to:c}),h=l.storedAxis||(a.enforceAxis?l.axis:"enu"),d=_L(l.kind==="geographic"?l.angularUnit:l.toMeter,l.kind==="geographic"),m=_L(l.verticalUnit,!1),g=[...h].map(M=>l.kind!=="geocentric"&&/[ud]/.test(M)?m:d),y=u.targetProfile;if(!y)throw new Error("Projection must define a rendering profile for CRS retrieval");let b=(u.targetLongitudeOrigin+l.primeMeridian)*180/Math.PI,w=_K(y,l,h),_=xK(y.normalize),S=gL(l,u,h,b),v=[...new Set(["WGS84",...a.converters||[]])];if(v.some(M=>typeof M!="string"||!M.trim()))throw new Error("Converter source CRS must be a nonempty string");let T=await Promise.all(v.map(async M=>{if(M==="WGS84")return[M,wL(u,_)];let[U,C]=await Promise.all([e.createProjectionAsync({...a,from:M,to:c}),e.createProjectionAsync({...a,from:"WGS84",to:M})]);return[M,wL(U,wK(C,_))]})),O=Object.assign(Object.create(null),Object.fromEntries(T)),P={coordinateFrame:l.kind,projection:l.projection,parameters:l.parameters,ellipsoid:{semiMajorAxis:l.ellipsoid.semiMajorAxis,semiMinorAxis:l.ellipsoid.semiMinorAxis},axis:h,xUnit:g[0],yUnit:g[1],zUnit:g[2],areaOfUse:l.areaOfUse,lossy:l.lossy};return{...P,signature:i&&typeof c=="string"&&!a.enforceAxis&&!l.lossy?c:bE(P),renderingBounds:w,renderingScale:S,getRenderingScale:M=>typeof S=="function"?S(M):S,converter:O}}function wL(e,t){return{from:xL(e.project.bind(e),e.projectTo.bind(e)),to:xL(e.unproject.bind(e),e.unprojectTo.bind(e)),normalize:t}}function wK(e,t){function r(n,i){i!==void 0&&il(n,i,n.length);let o=e.unproject(Array.from(n)),[s,a,c]=o;return t(o,o),o[0]===s&&o[1]===a&&o[2]===c?i===void 0?Array.from(n):zh(n,i,{x:n[0],y:n[1],z:n[2]??0},n.length):i===void 0?e.project(o):e.projectTo(o,i)}return r}function xL(e,t){function r(n,i){return i===void 0?e(Array.isArray(n)?n:Array.from(n)):t(n,i)}return r}function xK(e){function t(r,n){let i=n??new Array(r.length);il(r,i,r.length);let o=r[0],s=r[1],a=r[2]??0;if(r.length<2||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(a))throw new Error("Normalization requires finite longitude, latitude and altitude");let c={x:o,y:s,z:a};return e==null||e(c),zh(r,i,c,r.length)}return t}function _K(e,t,r){let n=t.kind==="geographic"?t.angularUnit:t.toMeter,i=[n,n,t.kind==="geocentric"?t.toMeter:t.verticalUnit],o=e.bounds,s=[...r].map(a=>{let c=/[ew]/.test(a)?0:/[ns]/.test(a)?1:2,l=o[0][c]/i[c],u=o[1][c]/i[c];return/[wsd]/.test(a)?[-u,-l]:[l,u]});return[[s[0][0],s[1][0],s[2][0]],[s[0][1],s[1][1],s[2][1]]]}function _L(e,t){let r=t?bL:bK,n=Object.keys(r).find(i=>r[i]===e)||"custom";return t?{name:n,degreesPerUnit:e/bL.degrees}:{name:n,metersPerUnit:e}}var bL,bK,ML=p(()=>{Fu();yL();dx();iy();bL={degrees:Math.PI/180,radians:1,gradians:Math.PI/200},bK={...Object.fromEntries(Object.values(Mf).map(e=>[e.name,e.metersPerUnit]))}});function vL(e){return{...e,projections:e.projections&&[...e.projections],parsers:e.parsers&&[...e.parsers],datumCatalogs:e.datumCatalogs&&[...e.datumCatalogs],aliases:e.aliases&&JSON.parse(JSON.stringify(e.aliases)),datumGrids:e.datumGrids&&{...e.datumGrids},verticalGrids:e.verticalGrids&&{...e.verticalGrids}}}function $h(e){return!!(e.projections||e.parsers||e.datumCatalogs||e.aliases||e.datumGrids||e.verticalGrids||e.resolver)}var vx=p(()=>{});async function TL(e){let t={...e,from:EL(e.from??"WGS84"),to:EL(e.to??"WGS84")},[r,n]=await Promise.all([n1(t.from,t),n1(t.to,t)]);return{...t,from:r,to:n}}async function n1(e,t){var u;let r=qh(e,t),n=yx(r.definition,t),i=typeof e=="string"||"type"in e?void 0:"crs"in e?e.crs:e,o=n===r.definition&&i?i.representation:wr(n);if(o!=="identifier"||(u=t.parsers)!=null&&u.some(h=>h.canParse(n)))return e;let s=await t.resolver.resolve({state:"explicit",provenance:(i==null?void 0:i.provenance)??"unknown",definition:n,representation:o}),a=qh(s.input,t).definition;if(!i)return a;let c=e,l={...i,definition:a,representation:wr(a),alternatives:[{definition:i.definition,representation:i.representation},...i.alternatives??[]]};return"crs"in c?{...c,crs:l}:l}function EL(e){return typeof e=="string"?e:JSON.parse(JSON.stringify(e))}var AL=p(()=>{Dl();Fu();mx()});var i1,IL=p(()=>{ML();vx();AL();dL();vx();i1=class{constructor(t={}){this.options=vL(t),this.useDefinitionSignature=!$h(t)}getCRS(t,r={}){return SL(this,t,this.options,r,this.useDefinitionSignature,this.options.resolver?n1:void 0)}createProjection(t={}){return new Wh({...this.options,...t})}async createProjectionAsync(t={}){let r={...this.options,...t};return Wh.create(r.resolver?await TL(r):r)}}});var PL=p(()=>{});var Ex,RL=p(()=>{$l();Vt();Qe();ut();Bt();Ex={name:"merc",aliases:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A"],parameters:["lon_0","lat_ts","k","k_0","x_0","y_0"],create({semiMajorAxis:e,eccentricitySquared:t,parameters:r,primeMeridian:n=0}){let i=Math.sqrt(t),o=Object.prototype.hasOwnProperty.call(r,"over"),s=re(r,"lon_0",0)*At,a=re(r,"x_0",0),c=re(r,"y_0",0),l=re(r,"k_0",re(r,"k",1));if(Object.prototype.hasOwnProperty.call(r,"lat_ts")){let g=Pf(r,"lat_ts");l=Math.cos(g)/Math.sqrt(1-t*Math.sin(g)**2)}if(l<=0)throw new Error("Mercator scale must be positive");let u=e*l,h=Math.atan(Math.sinh(Math.PI)),d=u*Math.PI,m=u*(Math.PI-i*Math.atanh(i*Math.sin(h)));return{longitudeOrigin:s,getRenderingProfile(g){if(g){let b=g[1]<=-90||g[3]>=90,w=[g[0],b?Math.max(-h*180/Math.PI,Math.min(h*180/Math.PI,g[1])):g[1],g[2],b?Math.max(-h*180/Math.PI,Math.min(h*180/Math.PI,g[3])):g[3]],_=S=>c+u*(Math.asinh(Math.tan(S))-i*Math.atanh(i*Math.sin(S)));return ur(S=>lt(Ce([a,a],Fe(Br(S,s,o),u)),[_(S[0][1]),_(S[1][1])]),w,s,n,o)}let y=[[a-d,c-m,0],[a+d,c+m,0]];return{bounds:y,normalize:ur(()=>y,Gn(Q(s-Math.PI,-h,s+Math.PI,h),n),s,n,o).normalize}},...Bi(g=>{let y=g.x,b=g.y;if(Math.abs(b)>=Math.PI/2)throw new Error("Mercator is undefined at the poles");let w=Math.asinh(Math.tan(b));g.x=a+u*Xt(y-s,o),g.y=c+u*(i===0?w+0:w-i*Math.atanh(i*Math.sin(b)))},g=>{let y=g.x,w=(g.y-c)/u,_=Math.atan(Math.sinh(w));if(i===0){g.x=Xt(s+(y-a)/u,o),g.y=_+0;return}for(let S=0;S<30;S++){let v=Math.atan(Math.sinh(w+i*Math.atanh(i*Math.sin(_))));if(Math.abs(v-_)<1e-13){g.x=Xt(s+(y-a)/u,o),g.y=v;return}_=v}throw new Error("Mercator inverse did not converge")})}}}});var Tx,LL=p(()=>{lc();Vt();Qe();ut();Bt();Tx={name:"eqc",aliases:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical"],parameters:["lon_0","lat_0","lat_ts","x_0","y_0"],create({semiMajorAxis:e,parameters:t,primeMeridian:r=0}){let n=Object.prototype.hasOwnProperty.call(t,"over"),i=re(t,"lon_0",0)*At,o=Pf(t,"lat_0"),s=Math.cos(Pf(t,"lat_ts")),a=re(t,"x_0",0),c=re(t,"y_0",0),l=e*Math.abs(s)*Math.PI;return{longitudeOrigin:i,getRenderingProfile(u){if(u)return ur(d=>lt(Ce([a,a],Fe(Br(d,i,n),e*s)),[c+e*(d[0][1]-o),c+e*(d[1][1]-o)]),u,i,r,n);let h=[[a-l,c+e*(-Math.PI/2-o),0],[a+l,c+e*(Math.PI/2-o),0]];return{bounds:h,normalize:ur(()=>h,Gn(Q(i-Math.PI,-(Math.PI/2),i+Math.PI,Math.PI/2),r),i,r,n).normalize}},...pi(u=>{u.x=a+e*s*Xt(u.x-i,n),u.y=c+e*(u.y-o)},u=>{u.x=Xt(i+(u.x-a)/(e*s),n),u.y=o+(u.y-c)/e})}}}});function SK(e){if(e.k0||(e.k0=1),e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,!(Math.abs(e.lat1+e.lat2)<1e-10)){var t=e.b/e.a;e.e=Math.sqrt(1-t*t);var r=Math.sin(e.lat1),n=Math.cos(e.lat1),i=xn(e.e,r,n),o=Qr(e.e,e.lat1,r),s=Math.sin(e.lat2),a=Math.cos(e.lat2),c=xn(e.e,s,a),l=Qr(e.e,e.lat2,s),u=Qr(e.e,e.lat0,Math.sin(e.lat0));Math.abs(e.lat1-e.lat2)>1e-10?e.ns=Math.log(i/c)/Math.log(o/l):e.ns=r,Number.isNaN(e.ns)&&(e.ns=r),e.f0=i/(e.ns*Math.pow(o,e.ns)),e.rh=Math.abs(Math.abs(e.lat0)-F)<1e-10?0:e.a*e.f0*Math.pow(u,e.ns)}}function OL(e,t){var r=t.x,n=t.y,i=Math.abs(Math.abs(n)-F),o,s;if(i>1e-10)o=e.sphere?1/Math.tan(Math.PI/4+n/2):Qr(e.e,n,Math.sin(n)),s=e.a*e.f0*Math.pow(o,e.ns);else{if(i=n*e.ns,i<=0)return null;s=0}var a=e.ns*k(r-e.long0,e.over);return t.x=e.k0*(s*Math.sin(a))+e.x0,t.y=e.k0*(e.rh-s*Math.cos(a))+e.y0,t}function BL(e,t){var r,n,i,o,s,a=(t.x-e.x0)/e.k0,c=e.rh-(t.y-e.y0)/e.k0;e.ns>0?(r=Math.sqrt(a*a+c*c),n=1):(r=-Math.sqrt(a*a+c*c),n=-1);var l=0;if(r!==0&&(l=Math.atan2(n*a,n*c)),r!==0||e.ns>0){if(n=1/e.ns,i=Math.pow(r/(e.a*e.f0),n),o=mc(e.e,i),o===-9999)return null}else o=-F;return s=k(l/e.ns+e.long0,e.over),t.x=s,t.y=o,t}function CL(e){let t={...e,ns:0,f0:0,rh:0};return SK(t),t}var DL=p(()=>{Yl();Df();_t();Dm();Ct()});var Ax,NL=p(()=>{Bt();Qe();ut();$l();kn();DL();Ax={name:"lcc",aliases:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"],parameters:[...Er,...Ho,"lat_1","lat_2"],create(e){let t=xr(e);Hl(t,e.parameters);let r=CL(t),n=fr("lcc",r,OL,BL),i={...Bi(o=>{let s=o.y;if(Math.abs(s)===Math.PI/2&&s*r.ns<0)throw new Error("Lambert conformal conic is undefined at the opposite pole");n.forwardInPlace(o)},n.inverseInPlace)};return De(i,Q(t.long0-Math.PI,r.ns>0?-Math.PI/3:-Math.PI/2,t.long0+Math.PI,r.ns>0?Math.PI/2:Math.PI/3),o=>Wl(i.forward,o,t.long0,r.ns,r.x0,r.y0+r.k0*r.rh,t.over),t.primeMeridian,t.over)}}});function fn(e,t){var r;return e>1e-7?(r=e*t,(1-e*e)*(t/(1-r*r)-.5/e*Math.log((1-r)/(1+r)))):2*t}var Kh=p(()=>{});function o1(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));let n=4*Number.EPSILON*r;if(Math.abs(t)>r+n)return NaN;if(Math.abs(Math.abs(t)-r)<=n)return t<0?-1*F:F;for(var i=Math.asin(.5*t),o,s,a,c,l=0;l<30;l++)if(s=Math.sin(i),a=Math.cos(i),c=e*s,o=Math.pow(1-c*c,2)/(2*a)*(t/(1-e*e)-s/(1-c*c)+.5/e*Math.log((1-c)/(1+c))),i+=o,Math.abs(o)<=1e-10)return i;return NaN}var Ix=p(()=>{Ct()});function MK(e){Math.abs(e.lat1+e.lat2)<1e-10||(e.temp=e.b/e.a,e.es=1-Math.pow(e.temp,2),e.e3=Math.sqrt(e.es),e.sin_po=Math.sin(e.lat1),e.cos_po=Math.cos(e.lat1),e.t1=e.sin_po,e.con=e.sin_po,e.ms1=xn(e.e3,e.sin_po,e.cos_po),e.qs1=fn(e.e3,e.sin_po),e.sin_po=Math.sin(e.lat2),e.cos_po=Math.cos(e.lat2),e.t2=e.sin_po,e.ms2=xn(e.e3,e.sin_po,e.cos_po),e.qs2=fn(e.e3,e.sin_po),e.sin_po=Math.sin(e.lat0),e.cos_po=Math.cos(e.lat0),e.t3=e.sin_po,e.qs0=fn(e.e3,e.sin_po),Math.abs(e.lat1-e.lat2)>1e-10?e.ns0=(e.ms1*e.ms1-e.ms2*e.ms2)/(e.qs2-e.qs1):e.ns0=e.con,e.c=e.ms1*e.ms1+e.ns0*e.qs1,e.rh=e.a*Math.sqrt(e.c-e.ns0*e.qs0)/e.ns0)}function FL(e,t){var r=t.x,n=t.y;e.sin_phi=Math.sin(n),e.cos_phi=Math.cos(n);var i=fn(e.e3,e.sin_phi),o=e.a*Math.sqrt(e.c-e.ns0*i)/e.ns0,s=e.ns0*k(r-e.long0,e.over),a=o*Math.sin(s)+e.x0,c=e.rh-o*Math.cos(s)+e.y0;return t.x=a,t.y=c,t}function GL(e,t){var r,n,i,o,s,a;if(t.x-=e.x0,t.y=e.rh-t.y+e.y0,e.ns0>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),o=0,r!==0&&(o=Math.atan2(i*t.x,i*t.y)),i=r*e.ns0/e.a,e.sphere){let c=(e.c-i*i)/(2*e.ns0);if(Math.abs(c)>1+8*Number.EPSILON)return null;a=Math.asin(Math.max(-1,Math.min(1,c)))}else{n=(e.c-i*i)/e.ns0;let c=fn(e.e3,1);a=Math.abs(Math.abs(n)-c)<=16*Number.EPSILON*c?Math.sign(n)*Math.PI/2:o1(e.e3,n)}return s=k(o/e.ns0+e.long0,e.over),t.x=s,t.y=a,t}function kL(e){let t={...e,temp:0,e3:0,sin_po:0,cos_po:0,t1:0,con:0,ms1:0,qs1:0,t2:0,ms2:0,qs2:0,t3:0,qs0:0,ns0:0,c:0,rh:0,sin_phi:0,cos_phi:0};return MK(t),t}var UL=p(()=>{Yl();Kh();_t();Ix()});var Px,jL=p(()=>{$l();Bt();Qe();ut();kn();UL();Px={name:"aea",aliases:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers"],parameters:[...Er,"lat_1","lat_2"],create(e){let t=xr(e);Hl(t,e.parameters);let r=kL(t),n={...fr("aea",r,FL,GL,Bi)};return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Wl(n.forward,i,t.long0,r.ns0,r.x0,r.y0+r.rh,t.over),t.primeMeridian,t.over)}}});function _s(e){return Math.abs(e)<=F?e:e-ks(e)*Math.PI}var Xh=p(()=>{Ct();Bf()});function vK(e){Math.abs(e.lat1+e.lat2)<1e-10||(e.temp=e.b/e.a,e.es=1-Math.pow(e.temp,2),e.e=Math.sqrt(e.es),e.en=uo(e.es),e.sin_phi=Math.sin(e.lat1),e.cos_phi=Math.cos(e.lat1),e.ms1=xn(e.e,e.sin_phi,e.cos_phi),e.ml1=_r(e.lat1,Math.sin(e.lat1),Math.cos(e.lat1),e.en),Math.abs(e.lat1-e.lat2)<1e-10?e.ns=e.sin_phi:(e.sin_phi=Math.sin(e.lat2),e.cos_phi=Math.cos(e.lat2),e.ms2=xn(e.e,e.sin_phi,e.cos_phi),e.ml2=_r(e.lat2,Math.sin(e.lat2),Math.cos(e.lat2),e.en),e.ns=(e.ms1-e.ms2)/(e.ml2-e.ml1)),e.g=e.ml1+e.ms1/e.ns,e.ml0=_r(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en),e.rh=e.a*(e.g-e.ml0))}function zL(e,t){var r=t.x,n=t.y,i;if(e.sphere)i=e.a*(e.g-n);else{var o=_r(n,Math.sin(n),Math.cos(n),e.en);i=e.a*(e.g-o)}var s=e.ns*k(r-e.long0,e.over),a=e.x0+i*Math.sin(s),c=e.y0+e.rh-i*Math.cos(s);return t.x=a,t.y=c,t}function qL(e,t){t.x-=e.x0,t.y=e.rh-t.y+e.y0;var r,n,i,o;e.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1);var s=0;if(n!==0&&(s=Math.atan2(r*t.x,r*t.y)),e.sphere)return o=k(e.long0+s/e.ns,e.over),i=_s(e.g-n/e.a),t.x=o,t.y=i,t;var a=e.g-n/e.a;return i=fo(a,e.es,e.en),o=k(e.long0+s/e.ns,e.over),t.x=o,t.y=i,t}function VL(e){let t={...e,temp:0,en:[],sin_phi:0,cos_phi:0,ms1:0,ml1:0,ns:0,ms2:0,ml2:0,g:0,ml0:0,rh:0};return vK(t),t}var WL=p(()=>{Kl();hc();Xl();Yl();_t();Xh()});var Rx,HL=p(()=>{$l();Bt();Qe();ut();kn();WL();Rx={name:"eqdc",aliases:["Equidistant_Conic"],parameters:[...Er,"lat_1","lat_2"],create(e){let t=xr(e);Hl(t,e.parameters);let r=VL(t),n=fr("eqdc",r,zL,qL,Bi);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Wl(n.forward,i,t.long0,r.ns,r.x0,r.y0+r.rh,t.over),t.primeMeridian,t.over)}}});function Va(e,t){let r=Math.abs(Math.sin(t)),n=Math.cos(t),i=n*n/(1+r);if(e===0)return 2*i;let o=e*e;return i*(1+o*r)/(1-o*r*r)+(1-o)/e*Math.atanh(e*i/(1-o*r))}function Lx(e,t,r){if(r===0||e===0)return r;let n=Va(e,r)/t;return Math.atan2(Math.sign(r)*(1-n),Math.sqrt(n*(2-n)))}function Ox(e,t,r){if(e===0||r===0||Math.abs(r)===Math.PI/2)return r;let n=Math.abs(Math.sin(r)),i=Math.cos(r),o=t*i*i/(1+n),s=Math.abs(r),a=e*e,c=0,l=Math.PI/2;for(let u=0;u<48;u++){let h=Math.sin(s),d=1-a*h*h,m=2*(1-a)*Math.cos(s)/(d*d),g=Va(e,s)-o,y=g/m;if(Math.abs(y)<2e-15)return Math.sign(r)*s;g>0?c=s:l=s;let b=s+y;s=b>c&&b<l?b:(c+l)/2}throw new Error("Authalic latitude inverse did not converge")}var Bx=p(()=>{});function EK(e){var t=Math.abs(e.lat0);if(Math.abs(t-F)<1e-10?e.mode=e.lat0<0?Xi:Lo:Math.abs(t)<1e-10?e.mode=Ai:e.mode=hn,e.es>0){var r;switch(e.qp=fn(e.e,1),e.mmf=.5/(1-e.es),e.mode){case Lo:e.dd=1;break;case Xi:e.dd=1;break;case Ai:e.rq=Math.sqrt(.5*e.qp),e.dd=1/e.rq,e.xmf=1,e.ymf=.5*e.qp;break;case hn:e.rq=Math.sqrt(.5*e.qp),r=Math.sin(e.lat0),e.sinb1=fn(e.e,r)/e.qp,e.cosb1=Math.sqrt(1-e.sinb1*e.sinb1),e.dd=Math.cos(e.lat0)/(Math.sqrt(1-e.es*r*r)*e.rq*e.cosb1),e.xmf=e.rq,e.ymf=e.xmf/e.dd,e.xmf*=e.dd;break}}else e.mode===hn&&(e.sinph0=Math.sin(e.lat0),e.cosph0=Math.cos(e.lat0))}function $L(e,t){var r,n,i,o,s,a,c,l,u,h,d=t.x,m=t.y;if(d=k(d-e.long0,e.over),e.sphere){if(s=Math.sin(m),h=Math.cos(m),i=Math.cos(d),e.mode===hn||e.mode===Ai){if(n=e.mode===Ai?1+h*i:1+e.sinph0*s+e.cosph0*h*i,n<=1e-10)return null;n=Math.sqrt(2/n),r=n*h*Math.sin(d),n*=e.mode===Ai?s:e.cosph0*s-e.sinph0*h*i}else if(e.mode===Lo||e.mode===Xi){if(e.mode===Lo&&(i=-i),Math.abs(m+e.lat0)<1e-10)return null;n=et-m*.5,n=2*(e.mode===Xi?Math.cos(n):Math.sin(n)),r=n*Math.sin(d),n*=i}}else{if(c=0,l=0,u=0,i=Math.cos(d),o=Math.sin(d),s=Math.sin(m),a=fn(e.e,s),e.mode===hn||e.mode===Ai){c=a/e.qp;let g=Va(e.e,m)/e.qp;l=Math.sqrt(g*(2-g))}switch(e.mode){case hn:u=1+e.sinb1*c+e.cosb1*l*i;break;case Ai:u=1+l*i;break;case Lo:u=F+m,a=m>=0?Va(e.e,m):2*e.qp-Va(e.e,m);break;case Xi:u=m-F,a=m<=0?Va(e.e,m):2*e.qp-Va(e.e,m);break}if(Math.abs(u)<1e-10)return null;switch(e.mode){case hn:case Ai:u=Math.sqrt(2/u),e.mode===hn?n=e.ymf*u*(e.cosb1*c-e.sinb1*l*i):(u=Math.sqrt(2/(1+l*i)),n=u*c*e.ymf),r=e.xmf*u*l*o;break;case Lo:case Xi:a>=0?(u=Math.sqrt(a),r=u*o,n=i*(e.mode===Xi?u:-u)):r=n=0;break}}return t.x=e.a*r+e.x0,t.y=e.a*n+e.y0,t}function KL(e,t){t.x-=e.x0,t.y-=e.y0;var r=t.x/e.a,n=t.y/e.a,i,o,s,a,c,l,u;if(e.sphere){var h=0,d,m=0;if(d=Math.sqrt(r*r+n*n),o=d*.5,o>1+8*Number.EPSILON)return null;switch(o=2*Math.asin(Math.min(1,o)),(e.mode===hn||e.mode===Ai)&&(m=Math.sin(o),h=Math.cos(o)),e.mode){case Ai:o=Math.abs(d)<=1e-10?0:Ci(0,1,m,h,r,n,d),r*=m,n=h*d;break;case hn:o=Math.abs(d)<=1e-10?e.lat0:Ci(e.sinph0,e.cosph0,m,h,r,n,d),r*=m*e.cosph0,n=(h-Math.sin(o)*e.sinph0)*d;break;case Lo:n=-n,o=F-o;break;case Xi:o-=F;break}i=n===0&&(e.mode===Ai||e.mode===hn)?0:Math.atan2(r,n)}else{if(u=0,e.mode===hn||e.mode===Ai){if(r/=e.dd,n*=e.dd,l=Math.sqrt(r*r+n*n),l<1e-10)return t.x=e.long0,t.y=e.lat0,t;let g=.5*l/e.rq;if(g>1+8*Number.EPSILON)return null;a=2*Math.asin(Math.min(1,g)),s=Math.cos(a),a=Math.sin(a);let y=Ci(e.mode===hn?e.sinb1:0,e.mode===hn?e.cosb1:1,a,s,r,n,l);o=Ox(e.e,e.qp,y),r*=a,e.mode===hn?(u=s*e.sinb1+n*a*e.cosb1/l,c=e.qp*u,n=l*e.cosb1*s-n*e.sinb1*a):(u=n*a/l,c=e.qp*u,n=l*s)}else if(e.mode===Lo||e.mode===Xi){if(e.mode===Lo&&(n=-n),c=r*r+n*n,!c)return t.x=e.long0,t.y=e.lat0,t;u=1-c/e.qp,e.mode===Xi&&(u=-u)}if(i=Math.atan2(r,n),Math.abs(u)>1+8*Number.EPSILON)return null;if(e.mode===Lo||e.mode===Xi){let g=Math.max(0,Math.min(2,c/e.qp)),y=Math.atan2(u,Math.sqrt(g*(2-g)));o=Ox(e.e,e.qp,y)}}return t.x=k(e.long0+i,e.over),t.y=o,t}function XL(e){let t={...e,mode:0,qp:0,mmf:0,dd:0,rq:0,xmf:0,ymf:0,sinb1:0,cosb1:0,sinph0:0,cosph0:0};return EK(t),t}var Xi,Lo,Ai,hn,YL=p(()=>{Ct();Kh();_t();Bx();Cf();Xi=1,Lo=2,Ai=3,hn=4});var Cx,ZL=p(()=>{Bx();zs();qs();kn();YL();Cx={name:"laea",aliases:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area"],parameters:Er,create(e){let t=xr(e),r=XL(t);return wn(Fs(t,fr("laea",r,$L,KL)),t,Math.PI*179/180,(n,i)=>WT(t,t.sphere?1:r.xmf||Math.sqrt(r.qp/2),t.sphere?1:r.ymf||Math.sqrt(r.qp/2),n,i,t.sphere?t.lat0:Lx(t.e,r.qp,t.lat0),t.sphere?o=>o:o=>Lx(t.e,r.qp,o)))}}});function s1(e,t){return Math.pow((1-e)/(1+e),t)}var JL=p(()=>{});function AK(e){var t=Math.sin(e.lat0),r=Math.cos(e.lat0);r*=r,e.rc=Math.sqrt(1-e.es)/(1-e.es*t*t),e.C=Math.sqrt(1+e.es*r*r/(1-e.es)),e.phic0=Math.asin(t/e.C),e.ratexp=.5*e.C*e.e,e.K=Math.tan(.5*e.phic0+et)/(Math.pow(Math.tan(.5*e.lat0+et),e.C)*s1(e.e*t,e.ratexp))}function QL(e,t){var r=t.x,n=t.y;return t.y=2*Math.atan(e.K*Math.pow(Math.tan(.5*n+et),e.C)*s1(e.e*Math.sin(n),e.ratexp))-F,t.x=e.C*r,t}function eO(e,t){for(var r=1e-14,n=t.x/e.C,i=t.y,o=Math.pow(Math.tan(.5*i+et)/e.K,1/e.C),s=TK;s>0&&(i=2*Math.atan(o*s1(e.e*Math.sin(t.y),-.5*e.e))-F,!(Math.abs(i-t.y)<r));--s)t.y=i;return s?(t.x=n,t.y=i,t):null}function tO(e){let t={...e,rc:0,C:0,phic0:0,ratexp:0,K:0};return AK(t),t}var TK,rO=p(()=>{JL();Ct();TK=20});function IK(e){e.rc&&(e.sinc0=Math.sin(e.phic0),e.cosc0=Math.cos(e.phic0),e.R2=2*e.rc)}function nO(e,t){var r,n,i,o;return t.x=k(t.x-e.long0,e.over),QL(e,t),r=Math.sin(t.y),n=Math.cos(t.y),i=Math.cos(t.x),o=e.k0*e.R2/(1+e.sinc0*r+e.cosc0*n*i),t.x=o*n*Math.sin(t.x),t.y=o*(e.cosc0*r-e.sinc0*n*i),t.x=e.a*t.x+e.x0,t.y=e.a*t.y+e.y0,t}function iO(e,t){var r,n,i,o,s;if(t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,t.x/=e.k0,t.y/=e.k0,s=tr(t.x,t.y),s){var a=2*Math.atan2(s,e.R2);r=Math.sin(a),n=Math.cos(a),o=Ci(e.sinc0,e.cosc0,r,n,t.x,t.y,s),i=Math.atan2(t.x*r,s*e.cosc0*n-t.y*e.sinc0*r)}else o=e.phic0,i=0;if(t.x=i,t.y=o,!eO(e,t))throw new Error("Oblique stereographic inverse did not converge");return t.x=k(t.x+e.long0,e.over),t}function oO(e){let t={...tO(e),sinc0:0,cosc0:0,R2:0};return IK(t),t}var sO=p(()=>{Cf();rO();_t();fc()});var Dx,aO=p(()=>{zs();qs();kn();sO();Dx={name:"sterea",aliases:["Stereographic_North_Pole","Oblique_Stereographic","Oblique Stereographic Alternative","Double_Stereographic"],parameters:[...Er,...Ho],create(e){let t=xr(e);if(Math.abs(t.lat0)===Math.PI/2)throw new Error("sterea requires a non-polar origin; use stere at the poles");let r=oO(t);return wn(Fs(t,fr("sterea",r,nO,iO)),t,Math.PI*150/180,(n,i)=>Cm(t,o=>2*Math.atan(r.K*Math.pow(Math.tan(Math.PI/4+o/2),r.C)*Math.pow((1-t.e*Math.sin(o))/(1+t.e*Math.sin(o)),r.ratexp))-Math.PI/2,r.phic0,t.a*t.k0*r.R2,n,i,r.C,Math.abs(Math.log(r.C))+Math.abs(Math.log(r.K))+r.C*t.e*Math.atanh(t.e)))}}});function Nx(e,t){let r=1-e*Math.sin(t)**2;return(1-e)/(r*Math.sqrt(r))}function a1(e,t,r,n){return Nx(e,t-r*n)+Nx(e,t+r*n)}function ci(e,t,r,n){let i=(n-r)/8,o=0;for(let s=0;s<4;s++){let a=r+(2*s+1)*i;o+=i*(.362683783378362*a1(t,a,i,.1834346424956498)+.3137066458778873*a1(t,a,i,.525532409916329)+.2223810344533745*a1(t,a,i,.7966664774136267)+.1012285362903763*a1(t,a,i,.9602898564975363))}return e*o}function Fx(e,t,r){let n=Math.PI/2,i=ci(e,t,0,n);if(!Number.isFinite(r)||Math.abs(r)>i)return NaN;let o=-n,s=n,a=r/i*n;for(let c=0;c<48;c++){let l=ci(e,t,0,a)-r;if(Math.abs(l)<=8*Number.EPSILON*e)return a;l>0?s=a:o=a;let u=a-l/(e*Nx(t,a));a=u>o&&u<s?u:(o+s)/2}return NaN}var Gx=p(()=>{});function cO(e,t,r,n,i,o,s){let a=n-t,c=Math.atan((1-o)*Math.tan(e)),l=Math.atan((1-o)*Math.tan(r)),u=Math.sin(c),h=Math.cos(c),d=Math.sin(l),m=Math.cos(l),g=a,y,b=100,w,_,S,v,T,O,P,M,U,C,L,A,W,G;do{if(w=Math.sin(g),_=Math.cos(g),S=Math.sqrt(m*w*(m*w)+(h*d-u*m*_)*(h*d-u*m*_)),S===0){s.x=0,s.y=0;return}v=u*d+h*m*_,T=Math.atan2(S,v),O=h*m*w/S,P=1-O*O,M=P!==0?v-2*u*d/P:0,U=o/16*P*(4+o*(4-3*P)),y=g,g=a+(1-U)*o*O*(T+U*S*(M+U*v*(-1+2*M*M)))}while(Math.abs(g-y)>1e-12&&--b>0);if(b===0){s.x=NaN,s.y=NaN;return}C=P*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),L=1+C/16384*(4096+C*(-768+C*(320-175*C))),A=C/1024*(256+C*(-128+C*(74-47*C))),W=A*S*(M+A/4*(v*(-1+2*M*M)-A/6*M*(-3+4*S*S)*(-3+4*M*M))),G=i*(1-o)*L*(T-W);let E=Math.atan2(m*w,h*d-u*m*_);s.x=E,s.y=G}function lO(e,t,r,n,i,o,s){let a=Math.atan((1-o)*Math.tan(e)),c=Math.sin(a),l=Math.cos(a),u=Math.sin(r),h=Math.cos(r),d=Math.atan2(c,l*h),m=l*u,g=1-m*m,y=g*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),b=1+y/16384*(4096+y*(-768+y*(320-175*y))),w=y/1024*(256+y*(-128+y*(74-47*y))),_=n/(i*(1-o)*b),S,v=100,T,O,P,M;do T=Math.cos(2*d+_),O=Math.sin(_),P=Math.cos(_),M=w*O*(T+w/4*(P*(-1+2*T*T)-w/6*T*(-3+4*O*O)*(-3+4*T*T))),S=_,_=n/(i*(1-o)*b)+M;while(Math.abs(_-S)>1e-12&&--v>0);if(v===0){s.x=NaN,s.y=NaN;return}let U=c*O-l*P*h,C=Math.atan2(c*P+l*O*h,(1-o)*Math.sqrt(m*m+U*U)),L=Math.atan2(O*u,l*P-c*O*h),A=o/16*g*(4+o*(4-3*g)),W=L-(1-A)*o*m*(_+A*O*(T+A*P*(-1+2*T*T))),G=t+W;s.x=G,s.y=C}var uO=p(()=>{});function PK(e){e.sin_p12=Math.sin(e.lat0),e.cos_p12=Math.cos(e.lat0),e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,e.f=e.es/(1+Math.sqrt(1-e.es))}function fO(e,t){var r=t.x,n=t.y,i=Math.sin(t.y),o=Math.cos(t.y),s=k(r-e.long0,e.over),a,c,l,u,h;if(e.sphere)return Math.abs(e.sin_p12-1)<=1e-10?(t.x=e.x0+e.a*(F-n)*Math.sin(s),t.y=e.y0-e.a*(F-n)*Math.cos(s),t):Math.abs(e.sin_p12+1)<=1e-10?(t.x=e.x0+e.a*(F+n)*Math.sin(s),t.y=e.y0+e.a*(F+n)*Math.cos(s),t):(u=e.sin_p12*i+e.cos_p12*o*Math.cos(s),c=Math.acos(u),l=c?c/Math.sin(c):1,t.x=e.x0+e.a*l*o*Math.sin(s),t.y=e.y0+e.a*l*(e.cos_p12*i-e.sin_p12*o*Math.cos(s)),t);if(Math.abs(e.sin_p12-1)<=1e-10)return a=ci(e.a,e.es,n,F),t.x=e.x0+a*Math.sin(s),t.y=e.y0-a*Math.cos(s),t;if(Math.abs(e.sin_p12+1)<=1e-10)return a=ci(e.a,e.es,-F,n),t.x=e.x0+a*Math.sin(s),t.y=e.y0+a*Math.cos(s),t;{if(Math.abs(s)<1e-10&&Math.abs(n-e.lat0)<1e-10)return t.x=e.x0,t.y=e.y0,t;cO(e.lat0,e.long0,n,r,e.a,e.f,t),h=t.x;let d=t.y;return t.x=e.x0+d*Math.sin(h),t.y=e.y0+d*Math.cos(h),t}}function hO(e,t){t.x-=e.x0,t.y-=e.y0;var r,n,i,o,s,a,c,l,u,h,d;if(e.sphere){if(r=Math.sqrt(t.x*t.x+t.y*t.y),r>2*F*e.a)return null;if(n=r/e.a,i=Math.sin(n),o=Math.cos(n),s=e.long0,Math.abs(r)<=1e-10)a=e.lat0;else if(a=Ci(e.sin_p12,e.cos_p12,i,o,t.x,t.y,r),c=Math.abs(e.lat0)-F,Math.abs(c)<=1e-10)if(e.lat0>=0){if(!Number.isFinite(a))return null;s=k(e.long0+Math.atan2(t.x,-t.y),e.over)}else s=k(e.long0-Math.atan2(-t.x,t.y),e.over);else s=k(e.long0+Math.atan2(t.x*i,r*e.cos_p12*o-t.y*e.sin_p12*i),e.over);return t.x=s,t.y=a,t}else return Math.abs(e.sin_p12-1)<=1e-10?(l=ci(e.a,e.es,0,F),r=Math.sqrt(t.x*t.x+t.y*t.y),u=l-r,a=Fx(e.a,e.es,u),Number.isFinite(a)?(s=k(e.long0+Math.atan2(t.x,-1*t.y),e.over),t.x=s,t.y=a,t):null):Math.abs(e.sin_p12+1)<=1e-10?(l=ci(e.a,e.es,0,F),r=Math.sqrt(t.x*t.x+t.y*t.y),u=r-l,a=Fx(e.a,e.es,u),Number.isFinite(a)?(s=k(e.long0+Math.atan2(t.x,t.y),e.over),t.x=s,t.y=a,t):null):(h=Math.atan2(t.x,t.y),d=Math.sqrt(t.x*t.x+t.y*t.y),lO(e.lat0,e.long0,h,d,e.a,e.f,t),t)}function dO(e){let t={...e,sin_p12:0,cos_p12:0,f:0};return PK(t),t}var mO=p(()=>{Cf();_t();Ct();Gx();uO()});var kx,pO=p(()=>{zs();qs();kn();mO();kx={name:"aeqd",aliases:["Azimuthal_Equidistant"],parameters:Er,create(e){let t=xr(e),r=dO(t);return wn(Fs(t,fr("aeqd",r,fO,hO)),t,Math.PI*179/180,(n,i)=>VT(t,n,i))}}});var Ux,gO=p(()=>{Vh();_x();Ux={name:"geocent",aliases:["Geocentric","geocentric","Geocent"],parameters:[],create({semiMajorAxis:e,semiMinorAxis:t,eccentricitySquared:r,primeMeridian:n=0}){let i={semiMajorAxis:e,eccentricitySquared:r,semiMinorAxis:t??e*Math.sqrt(1-r)};return{getRenderingProfile:()=>({bounds:[[-e,-e,-i.semiMinorAxis],[e,e,i.semiMinorAxis]],normalize:qa({},n)().normalize}),forward(){throw new Error("Geocentric projection requires the 3D pipeline")},inverse(){throw new Error("Geocentric projection requires the 3D pipeline")},forwardInPlace:o=>J0(o,i),inverseInPlace:o=>Q0(o,i),forward3D:o=>iL(o,i),inverse3D:o=>oL(o,i)}}}});function yO(e,t,r){let n=Os(Br(r,e.long0,e.over)),i=e.a/Math.sqrt(1-e.es),o=mi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]),s=Math.max(Math.abs(e.a*(e.es?e.am1:e.cphi1)+e.y0-o[0]),Math.abs(e.a*(e.es?e.am1:e.cphi1)+e.y0-o[1])),a=Math.min(s,i*n),c=Math.min(2*s,i*n);return lt([e.x0-a,e.x0+a],[o[0]-c,o[1]+c])}function bO(e,t,r){let n=Os(Br(r,e.long0,e.over)),i=e.a/Math.sqrt(1-e.es),o=i*n*n/4,s=mi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]);return e.sphere&&(r[0][1]-e.lat0<-Math.PI/2||r[1][1]-e.lat0>Math.PI/2)&&(s=[e.y0-e.a*Math.PI/2,e.y0+e.a*Math.PI/2]),lt([e.x0-i*n,e.x0+i*n],[s[0]-o,s[1]+o])}function wO(e,t,r){let n=Os(Br(r,e.long0,e.over));if(e.sphere&&n>Math.PI/2)throw new Error("Unsupported Cassini rendering coverage");let i=e.a/Math.sqrt(1-e.es),o=e.es/(1-e.es),s=e.sphere?e.a*Math.asin(Math.min(1,Math.sin(Math.min(n,Math.PI/2)))):i*(n+n**3/6+(9+8*o)*n**5/120),a=e.sphere?e.a*n:i*(n*n/4+(6+6*o)*n**4/24),c=mi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]);return lt([e.x0-s,e.x0+s],[c[0]-a,c[1]+a])}function jx(e,t){return t[0]<=0&&t[1]>=0?[-1/0,1/0]:Ot(e,mi(1/t[0],1/t[1]))}function xO(e,t){let r=l=>{let u=e.alpha*(Math.asinh(Math.tan(l))-e.e*Math.atanh(e.e*Math.sin(l)))+e.K;return Math.asin(Math.tanh(u))},n=Q((t[0][0]-e.long0)*e.alpha,r(t[0][1]),(t[1][0]-e.long0)*e.alpha,r(t[1][1])),i=dt([-Math.sin(e.b0),0,Math.cos(e.b0)],n);if(Os(i)>=1-1e-14)throw new Error("Swiss oblique Mercator coverage reaches a rotated pole");let o=dt([0,1,0],n),s=dt([Math.cos(e.b0),0,Math.sin(e.b0)],n),a=jx(o,s).map(Math.atan),c=i.map(l=>Math.atanh(Math.max(-1+Number.EPSILON,Math.min(1-Number.EPSILON,l))));return lt(Ce([e.x0,e.x0],Fe(a,e.R)),Ce([e.y0,e.y0],Fe(c,e.R)))}function _O(e,t){let r=g=>Math.log(e.E)-e.B*Math.log(Qr(e.e,g,Math.sin(g))),n=mi(r(t[0][1]),r(t[1][1])),i=Fe([t[0][0]-e.lam0,t[1][0]-e.lam0],e.B),o=Q(i[0],Math.asin(Math.tanh(n[0])),i[1],Math.asin(Math.tanh(n[1]))),s=dt([0,-e.cosgam,e.singam],o),a=Fe(mi(-Math.atanh(s[0]),-Math.atanh(s[1])),e.ArB),c=Ce(Fe([Math.sinh(n[0]),Math.sinh(n[1])],e.cosgam),Fe(Rf(i),e.singam)),l=vm(i),u=l[0]>0?jx(c,l).map(Math.atan):[-Math.PI,Math.PI],h=Fe(u,e.ArB),d,m;return e.no_rot?(d=h,m=a):(h=Ce(h,[-e.u_0,-e.u_0]),d=Ce(Fe(a,e.cosrot),Fe(h,e.sinrot)),m=Ce(Fe(h,e.cosrot),Fe(a,-e.sinrot))),lt(Ce([e.x0,e.x0],Fe(d,e.a)),Ce([e.y0,e.y0],Fe(m,e.a)))}function SO(e,t){let r=m=>2*(Math.atan(e.k*Math.pow(Math.tan(m/2+e.s45),e.alfa)/Math.pow((1+e.e*Math.sin(m))/(1-e.e*Math.sin(m)),e.alfa*e.e/2))-e.s45),n=Fe(Br(t,e.long0,e.over),-e.alfa),i=Q(n[0],r(t[0][1]),n[1],r(t[1][1])),o=dt([Math.sin(e.ad),0,Math.cos(e.ad)],i),s=[Math.sqrt(Math.max(Number.EPSILON,1-Os(o)**2)),1],a=dt([0,1,0],i),c=jx(a,s),l=Fe(c.map(m=>Math.asin(Math.max(-1,Math.min(1,m)))),e.n),u=m=>e.ro0*Math.pow(Math.tan(e.s0/2+e.s45)/Math.tan(Math.asin(m)/2+e.s45),e.n),h=mi(u(o[0]),u(o[1])),d=e.czech?1:-1;return lt(Ce([e.x0,e.x0],Fe(Ot(h,Rf(l)),d)),Ce([e.y0,e.y0],Fe(Ot(h,vm(l)),d)))}function MO(e,t){let r=Fe([t[0][1]-e.lat0,t[1][1]-e.lat0],1e-5/Of),n=Br(t,e.long0,e.over),i=[0,0];for(let l=10;l>=1;l--)i=Ce([e.A[l],e.A[l]],Ot(i,r));i=Ot(i,r);let o=[0,0],s=[0,0];for(let l=6;l>=1;l--){let u=Ce(Ot(o,i),Fe(Ot(s,n),-1)),h=Ce(Ot(o,n),Ot(s,i));o=Ce(u,[e.B_re[l],e.B_re[l]]),s=Ce(h,[e.B_im[l],e.B_im[l]])}let a=Ce(Ot(o,i),Fe(Ot(s,n),-1)),c=Ce(Ot(o,n),Ot(s,i));return lt(Ce([e.x0,e.x0],Fe(c,e.a)),Ce([e.y0,e.y0],Fe(a,e.a)))}var Wa=p(()=>{Qe();dc();Bt();Df();Ct()});function Ae(e){let t=xr(e);return{...t,x0:0,y0:0,lat_ts:Number.isNaN(t.lat_ts)?0:t.lat_ts}}function kt(e,t){return{...e,x0:re(t.parameters,"x_0",0),y0:re(t.parameters,"y_0",0)}}function Ie(e,t,r,n,i,o){let s=fr(e,r,n,i),a=re(t.parameters,"x_0",0),c=re(t.parameters,"y_0",0);return pi(l=>{o==null||o(l.x,l.y),s.forwardInPlace(l),l.x+=a,l.y+=c},l=>{l.x-=a,l.y-=c,s.inverseInPlace(l)})}function Ha(e,t=0,r=!1){return(n,i)=>{let o=Math.sin(e.lat0)*Math.sin(i)+Math.cos(e.lat0)*Math.cos(i)*Math.cos(n-e.long0);if(r?o<t-1e-14:o<=t+1e-14)throw new Error("Coordinate is outside the visible projection horizon")}}var Ut=p(()=>{lc();kn();Vt()});function RK(e){var t;if(e.phi1=e.lat1,Math.abs(e.phi1)<Yh)throw new Error;e.es?(e.en=uo(e.es),e.am1=Math.sin(e.phi1),t=Math.cos(e.phi1),e.m1=_r(e.phi1,e.am1,t,e.en),e.am1=t/(Math.sqrt(1-e.es*e.am1*e.am1)*e.am1)):Math.abs(e.phi1)+Yh>=F?e.cphi1=0:e.cphi1=1/Math.tan(e.phi1)}function LK(e,t){var r=k(t.x-(e.long0||0),e.over),n=t.y,i,o,s;return o=Math.sin(n),s=Math.cos(n),i=e.am1+e.m1-_r(n,o,s,e.en),o=s*r/(i*Math.sqrt(1-e.es*o*o)),t.x=i*Math.sin(o),t.y=e.am1-i*Math.cos(o),t.x=e.a*t.x+(e.x0||0),t.y=e.a*t.y+(e.y0||0),t}function OK(e,t){t.x=(t.x-(e.x0||0))/e.a,t.y=(t.y-(e.y0||0))/e.a;var r,n,i,o;if(t.y=e.am1-t.y,n=tr(t.x,t.y),e.phi1<0&&(n=-n),o=fo(e.am1+e.m1-n,e.es,e.en),r=Math.abs(o),r<F)r=Math.sin(o),i=n*Math.atan2(Math.sign(e.phi1)*t.x,Math.sign(e.phi1)*t.y)*Math.sqrt(1-e.es*r*r)/Math.cos(o);else if(Math.abs(r-F)<=Yh)i=0;else throw new Error;return t.x=k(i+(e.long0||0),e.over),t.y=_s(o),t}function BK(e,t){var r=k(t.x-(e.long0||0),e.over),n=t.y,i,o;return o=e.cphi1+e.phi1-n,Math.abs(o)>Yh?(i=r*Math.cos(n)/o,t.x=o*Math.sin(i),t.y=e.cphi1-o*Math.cos(i)):t.x=t.y=0,t.x=e.a*t.x+(e.x0||0),t.y=e.a*t.y+(e.y0||0),t}function CK(e,t){t.x=(t.x-(e.x0||0))/e.a,t.y=(t.y-(e.y0||0))/e.a;var r,n;t.y=e.cphi1-t.y;var i=tr(t.x,t.y);if(e.phi1<0&&(i=-i),n=e.cphi1+e.phi1-i,Math.abs(n)>F)throw new Error;return Math.abs(Math.abs(n)-F)<=Yh?r=0:r=i*Math.atan2(Math.sign(e.phi1)*t.x,Math.sign(e.phi1)*t.y)/Math.cos(n),t.x=k(r+(e.long0||0),e.over),t.y=_s(n),t}function vO(e,t){return e.es?LK(e,t):BK(e,t)}function EO(e,t){return e.es?OK(e,t):CK(e,t)}function TO(e,t={}){let r={...e,phi1:0,en:[],m1:0,am1:0,cphi1:0,...t};return RK(r),r}var Yh,AO=p(()=>{Xh();_t();fc();Kl();Xl();hc();Ct();Yh=1e-10});var zx,IO=p(()=>{Wa();Qe();ut();Ut();AO();zx={name:"bonne",aliases:["Bonne (Werner lat_1=90)"],parameters:["lon_0","x_0","y_0","lat_1"],create(e){let t=Ae(e);if(!Object.prototype.hasOwnProperty.call(e.parameters,"lat_1")||Math.abs(t.lat1)<1e-10)throw new Error("Bonne requires a nonzero lat_1");let r=TO(t),n=Ie("bonne",e,r,vO,EO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>yO(kt(r,e),n.forward,i),t.primeMeridian,t.over)}}});function ku(e,t,r){var n=t*r;return e/Math.sqrt(1-n*n)}var qx=p(()=>{});function DK(e){e.sphere||(e.en=uo(e.es),e.ml0=e.a*_r(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en))}function Wx(e,t){var r,n,i=t.x,o=t.y;if(i=k(i-e.long0,e.over),e.sphere)r=e.a*Math.asin(Math.cos(o)*Math.sin(i)),n=e.a*(Math.atan2(Math.tan(o),Math.cos(i))-e.lat0);else{var s=Math.sin(o),a=Math.cos(o),c=ku(e.a,e.e,s),l=Math.tan(o)*Math.tan(o),u=i*Math.cos(o),h=u*u,d=e.es*a*a/(1-e.es),m=e.a*_r(o,s,a,e.en);r=c*u*(1-h*l*(1/6+(8-l+8*d)*h/120)),n=m-e.ml0+c*s/a*h*(.5+(5-l+6*d)*h/24)}return t.x=r+e.x0,t.y=n+e.y0,t}function PO(e,t){t.x-=e.x0,t.y-=e.y0;var r=t.x/e.a,n=t.y/e.a,i,o;if(e.sphere){var s=n+e.lat0;i=Math.asin(Math.sin(s)*Math.cos(r)),o=Math.atan2(Math.tan(r),Math.cos(s))}else{var a=e.ml0/e.a+n,c=fo(a,e.es,e.en);if(Math.abs(Math.abs(c)-F)<=1e-10)return t.x=e.long0,t.y=Math.sign(c)*F,t;var l=ku(e.a,e.e,Math.sin(c)),u=l*l*l/e.a/e.a*(1-e.es),h=Math.pow(Math.tan(c),2),d=r*e.a/l,m=d*d;i=c-l*Math.tan(c)/u*d*d*(.5-(1+3*h)*d*d/24),o=d*(1-m*(h/3-(1+3*h)*h*m/15))/Math.cos(c)}if(!e.sphere){let g=t.x+e.x0,y=t.y+e.y0,b=e.scratch,w=!1;for(let _=0;_<12;_++){Vx(e,o,i);let S=b.x-g,v=b.y-y;if(Math.max(Math.abs(S),Math.abs(v))<1e-7){w=!0;break}let T=1e-7,O=i>F-T?-T:T,P=b.x,M=b.y;Vx(e,o+T,i);let U=(b.x-P)/T,C=(b.y-M)/T;Vx(e,o,i+O);let L=(b.x-P)/O,A=(b.y-M)/O,W=U*A-L*C;if(!Number.isFinite(W)||Math.abs(W)<1e-12||(o-=(A*S-L*v)/W,i-=(U*v-C*S)/W,!Number.isFinite(o)||Math.abs(i)>F))break}if(!w)throw new Error("Cassini inverse did not converge")}return t.x=k(o+e.long0,e.over),t.y=_s(i),t}function Vx(e,t,r){e.scratch.x=t+e.long0,e.scratch.y=r,Wx(e,e.scratch)}function RO(e,t={}){let r={...e,en:[],scratch:{x:0,y:0},ml0:0,...t};return DK(r),r}var LO=p(()=>{Kl();hc();Xl();qx();_t();Xh();Ct()});var Hx,OO=p(()=>{Wa();Qe();ut();Ut();LO();Hx={name:"cass",aliases:["Cassini","Cassini_Soldner"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e),r=RO(t),n=Ie("cass",e,r,Wx,PO);return De(n,Q(t.long0-Math.PI/6,-Math.PI/2+1e-8,t.long0+Math.PI/6,Math.PI/2-1e-8),i=>wO(kt(t,e),n.forward,i),t.primeMeridian,t.over)}}});function NK(e){e.sphere||(e.k0=xn(e.e,Math.sin(e.lat_ts),Math.cos(e.lat_ts)))}function BO(e,t){var r=t.x,n=t.y,i,o,s=k(r-e.long0,e.over);if(e.sphere)i=e.x0+e.a*s*Math.cos(e.lat_ts),o=e.y0+e.a*Math.sin(n)/Math.cos(e.lat_ts);else{var a=fn(e.e,Math.sin(n));i=e.x0+e.a*e.k0*s,o=e.y0+e.a*a*.5/e.k0}return t.x=i,t.y=o,t}function CO(e,t){t.x-=e.x0,t.y-=e.y0;var r,n;return e.sphere?(r=k(e.long0+t.x/e.a/Math.cos(e.lat_ts),e.over),n=Math.asin(t.y/e.a*Math.cos(e.lat_ts))):(n=o1(e.e,2*t.y*e.k0/e.a),r=k(e.long0+t.x/(e.a*e.k0),e.over)),t.x=r,t.y=n,t}function DO(e,t={}){let r={...e,...t};return NK(r),r}var NO=p(()=>{_t();Kh();Yl();Ix()});var $x,FO=p(()=>{Bt();Qe();ut();Ut();NO();$x={name:"cea",aliases:[],parameters:["lon_0","x_0","y_0","lat_ts"],create(e){let t=Ae(e);if(Math.abs(t.lat_ts)>=Math.PI/2)throw new Error("CEA standard parallel must be away from the poles");let r=DO(t),n=Ie("cea",e,r,BO,CO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function sl(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}var c1=p(()=>{});function GK(e){e.long0=e.long0||0,e.sphere?(e.n=1,e.m=0,e.es=0,e.C_y=Math.sqrt((e.m+1)/e.n),e.C_x=e.C_y/(e.m+1)):e.en=uo(e.es)}function l1(e,t){var r,n,i=t.x,o=t.y;if(i=k(i-e.long0,e.over),e.sphere){if(!e.m)o=e.n!==1?Math.asin(e.n*Math.sin(o)):o;else for(var s=e.n*Math.sin(o),a=FK;a;--a){var c=(e.m*o+Math.sin(o)-s)/(e.m+Math.cos(o));if(o-=c,Math.abs(c)<1e-10)break}r=e.a*e.C_x*i*(e.m+Math.cos(o)),n=e.a*e.C_y*o}else{var l=Math.sin(o),u=Math.cos(o);n=e.a*_r(o,l,u,e.en),r=e.a*i*u/Math.sqrt(1-e.es*l*l)}return t.x=r,t.y=n,t}function u1(e,t){var r,n,i,o;if(t.x-=e.x0,i=t.x/e.a,t.y-=e.y0,r=t.y/e.a,e.sphere){if(r/=e.C_y,i=i/(e.C_x*(e.m+Math.cos(r))),e.m){let s=(e.m*r+Math.sin(r))/e.n;if(Math.abs(s)>1+8*Number.EPSILON)return null;r=sl(s)}else e.n!==1&&(r=sl(Math.sin(r)/e.n));i=k(i+e.long0,e.over),r=_s(r)}else r=fo(t.y/e.a,e.es,e.en),o=Math.abs(r),o<F?(o=Math.sin(r),n=e.long0+t.x*Math.sqrt(1-e.es*o*o)/(e.a*Math.cos(r)),i=k(n,e.over)):o-1e-10<F&&(i=e.long0);return t.x=i,t.y=r,t}function GO(e,t={}){let r={...e,en:[],n:0,m:0,C_y:0,C_x:0,...t};return GK(r),r}var FK,Kx=p(()=>{_t();Xh();Kl();hc();Xl();Ct();c1();FK=20});function kK(e){e.sphere=!0,e.b=e.a,e.m=1,e.n=2.5707963267948966,e.es=0,e.C_y=Math.sqrt((e.m+1)/e.n),e.C_x=e.C_y/(e.m+1)}function jO(e,t={}){let r={...e,m:0,n:0,C_y:0,C_x:0,en:[],...t};return kK(r),r}var kO,UO,zO=p(()=>{Kx();kO=l1,UO=u1});var Xx,qO=p(()=>{Bt();Qe();ut();Ut();zO();Xx={name:"eck6",aliases:["Eckert_VI"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=jO(t),n=Ie("eck6",e,r,kO,UO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function Yx(e){var t,r=[];return r[0]=e*UK,t=e*e,r[0]+=t*jK,r[1]=t*qK,t*=e,r[0]+=t*zK,r[1]+=t*VK,r[2]=t*WK,r}var UK,jK,zK,qK,VK,WK,VO=p(()=>{UK=.3333333333333333,jK=.17222222222222222,zK=.10257936507936508,qK=.06388888888888888,VK=.0664021164021164,WK=.016415012942191543});function Zx(e,t){var r=e+e;return e+t[0]*Math.sin(r)+t[1]*Math.sin(r+r)+t[2]*Math.sin(r+r+r)}var WO=p(()=>{});function HK(e){e.long0=e.long0!==void 0?e.long0:0,e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.es!==0&&(e.apa=Yx(e.es),e.qp=fn(e.e,1),e.rqda=Math.sqrt(.5*e.qp))}function HO(e,t){var r=k(t.x-e.long0,e.over),n=t.y,i=Math.sin(n);e.es!==0&&(i=fn(e.e,i)/e.qp);var o=Math.asin(f1*i),s=o*o,a=s*s*s;return t.x=r*Math.cos(o)/(f1*(Uu+3*ju*s+a*(7*zu+9*qu*s))),t.y=o*(Uu+ju*s+a*(zu+qu*s)),e.es!==0&&(t.x*=e.rqda,t.y*=e.rqda),t.x=e.a*t.x+e.x0,t.y=e.a*t.y+e.y0,t}function $O(e,t){t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,e.es!==0&&(t.x/=e.rqda,t.y/=e.rqda);let r=Math.PI/3,n=r*r,i=r*(Uu+ju*n+n**3*(zu+qu*n));if(Math.abs(t.y)>i+8*Number.EPSILON*i)return null;var o=1e-9,s=12,a=t.y,c,l,u,h,d,m;for(m=0;m<s&&(c=a*a,l=c*c*c,u=a*(Uu+ju*c+l*(zu+qu*c))-t.y,h=Uu+3*ju*c+l*(7*zu+9*qu*c),a-=d=u/h,!(Math.abs(d)<o));++m);c=a*a,l=c*c*c,t.x=f1*t.x*(Uu+3*ju*c+l*(7*zu+9*qu*c))/Math.cos(a);let g=Math.sin(a)/f1,y=8*Number.EPSILON;return Math.abs(g)>1+y?null:(t.y=Math.abs(g)>=1-y?Math.sign(g)*Math.PI/2:Math.asin(g),e.es!==0&&(t.y=Zx(t.y,e.apa)),t.x=k(t.x+e.long0,e.over),t)}function KO(e,t={}){let r={...e,apa:[],qp:0,rqda:0,...t};return HK(r),r}var Uu,ju,zu,qu,f1,XO=p(()=>{_t();Kh();VO();WO();Uu=1.340264,ju=-.081106,zu=893e-6,qu=.003796,f1=Math.sqrt(3)/2});var Jx,YO=p(()=>{Vt();Ut();XO();Qe();ut();Bt();Jx={name:"eqearth",aliases:["Equal Earth","Equal_Earth"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=e.primeMeridian??0,n=KO(t),i=Ie("eqearth",e,n,HO,$O),o=Math.sqrt(e.eccentricitySquared),s=e.semiMajorAxis*(o?Math.sqrt((1+(1-o*o)*Math.atanh(o)/o)/2):1),a=Math.PI/3,c=a*a,l=c**3,u=s*Math.PI/(Math.sqrt(3)/2*1.340264),h=re(e.parameters,"x_0",0),d=re(e.parameters,"y_0",0),m=s*a*(1.340264-.081106*c+l*(893e-6+.003796*c));return{...i,longitudeOrigin:t.long0,getRenderingProfile(g){if(g)return ur(b=>Cr(i.forward,b,t.long0,t.over),g,t.long0,r,t.over);let y=[[h-u,d-m,0],[h+u,d+m,0]];return{bounds:y,normalize:ur(()=>y,Gn(Q(t.long0-Math.PI,-(Math.PI/2),t.long0+Math.PI,Math.PI/2),r),t.long0,r,t.over).normalize}}}}}});function $K(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0}function ZO(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over),o=e.x0+e.a*i*Math.cos(e.lat0),s=e.y0+e.a*n;return e.t1=o,e.t2=Math.cos(e.lat0),t.x=o,t.y=s,t}function JO(e,t){t.x-=e.x0,t.y-=e.y0;var r=t.y/e.a;Math.abs(r)>Math.PI/2&&Math.abs(r)<=Math.PI/2+8*Number.EPSILON&&(r=Math.sign(r)*Math.PI/2);var n=k(e.long0+t.x/(e.a*Math.cos(e.lat0)),e.over);return t.x=n,t.y=r,t}function QO(e,t={}){let r={...e,t2:0,t1:0,...t};return $K(r),r}var eB=p(()=>{_t()});var Qx,tB=p(()=>{Bt();Qe();ut();Ut();eB();Qx={name:"equi",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e);if(Math.abs(t.lat0)>=Math.PI/2)throw new Error("Equirectangular standard parallel must be away from the poles");let r=QO(t),n=Ie("equi",e,r,ZO,JO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function rB(e,t,r=!1){let n=1+t/e.a,i=n/(1+1e-10),o=h=>Math.acos(Math.min(1,Math.sqrt(1-e.es*Math.sin(h)**2)/(i*Math.cos(h)))),s=h=>{let d=(i*Math.cos(h))**2;return Math.asin(Math.sqrt(Math.max(0,(d-1)/(d-e.es))))},a=t*Math.asin(1/n),c=t*Math.atan(Math.sqrt((1-e.es)/(n*n-1))),l=(h,d)=>{let m=Math.max(h[0][1],Math.min(h[1][1],0)),g=o(m),y=Math.max(h[0][0]-e.long0,-g),b=Math.min(h[1][0]-e.long0,g),w=s(Math.max(y,Math.min(b,0))),_=Math.max(h[0][1],-w),S=Math.min(h[1][1],w);if(b<y||S<_)return null;let v=Q(y,_,b,S),T=Gn(Q(y+e.long0,_,b+e.long0,S),e.primeMeridian),O=(e.long0+e.primeMeridian)*180/Math.PI,P=Cs(M=>{let U=Math.max(y,Math.min(b,Xt(M.x-e.long0))),C=s(U),L=Math.max(Math.max(_,-C),Math.min(Math.min(S,C),M.y));U!==M.x-e.long0&&(M.x=U+e.long0),M.y=L},e.primeMeridian);return{get bounds(){if(!d)return lt([e.x0-a,e.x0+a],[e.y0-c,e.y0+c]);let M=dt([0,0,1],v),U=[1,1/Math.sqrt(1-e.es*Math.max(M[0]**2,M[1]**2))],C=Ot(dt([1,0,0],v),U),L=Ot(dt([0,1,0],v),U),A=Ot(M,[1-e.es,(1-e.es)*U[1]]),W=[n-Math.min(1,C[1]),n-Math.max(1/n,C[0])],G=(E,B,N,D)=>{let R=B[0]<=0&&B[1]>=0?0:Math.min(Math.abs(B[0]),Math.abs(B[1])),I=D?[Math.hypot(W[0],R),Math.hypot(W[1],Math.max(Math.abs(B[0]),Math.abs(B[1])))]:W,j=E.flatMap(we=>I.map(_e=>t*Math.atan(we/_e)));return[Math.max(-N,Math.min(...j)),Math.min(N,Math.max(...j))]};return lt(Ce([e.x0,e.x0],G(L,A,a,r)),Ce([e.y0,e.y0],G(A,L,c,!r)))},normalize(M){Am(M,T,O),P(M)}}},u=Gn(Q(e.long0-o(0),-s(0),e.long0+o(0),s(0)),e.primeMeridian);return h=>{let d=h?Em(h,u):[u],m=Tm(d,g=>l(Bs(g,e.primeMeridian,e.long0),!!h));if(!m)throw new Error("CRS coverage does not intersect the satellite limb");return m}}var nB=p(()=>{Qe();cc();ut();Vt();dc();Bt()});function KK(e){if(e.flip_axis=e.sweep==="x"?1:0,e.h=Number(e.h),e.radius_g_1=e.h/e.a,e.radius_g_1<=0||e.radius_g_1>1e10)throw new Error;if(e.radius_g=1+e.radius_g_1,e.C=e.radius_g*e.radius_g-1,e.es!==0){var t=1-e.es,r=1/t;e.radius_p=Math.sqrt(t),e.radius_p2=t,e.radius_p_inv2=r,e.shape="ellipse"}else e.radius_p=1,e.radius_p2=1,e.radius_p_inv2=1,e.shape="sphere"}function iB(e,t){var r=t.x,n=t.y,i,o,s,a;if(r=r-e.long0,e.shape==="ellipse"){n=Math.atan(e.radius_p2*Math.tan(n));var c=e.radius_p/tr(e.radius_p*Math.cos(n),Math.sin(n));if(o=c*Math.cos(r)*Math.cos(n),s=c*Math.sin(r)*Math.cos(n),a=c*Math.sin(n),(e.radius_g-o)*o-s*s-a*a*e.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=e.radius_g-o,e.flip_axis?(t.x=e.radius_g_1*Math.atan(s/tr(a,i)),t.y=e.radius_g_1*Math.atan(a/i)):(t.x=e.radius_g_1*Math.atan(s/i),t.y=e.radius_g_1*Math.atan(a/tr(s,i)))}else e.shape==="sphere"&&(i=Math.cos(n),o=Math.cos(r)*i,s=Math.sin(r)*i,a=Math.sin(n),i=e.radius_g-o,e.flip_axis?(t.x=e.radius_g_1*Math.atan(s/tr(a,i)),t.y=e.radius_g_1*Math.atan(a/i)):(t.x=e.radius_g_1*Math.atan(s/i),t.y=e.radius_g_1*Math.atan(a/tr(s,i))));return t.x=t.x*e.a,t.y=t.y*e.a,t}function oB(e,t){var r=-1,n=0,i=0,o,s,a,c;if(t.x=t.x/e.a,t.y=t.y/e.a,e.shape==="ellipse"){e.flip_axis?(i=Math.tan(t.y/e.radius_g_1),n=Math.tan(t.x/e.radius_g_1)*tr(1,i)):(n=Math.tan(t.x/e.radius_g_1),i=Math.tan(t.y/e.radius_g_1)*tr(1,n));var l=i/e.radius_p;if(o=n*n+l*l+r*r,s=2*e.radius_g*r,a=s*s-4*o*e.C,a<0)return t.x=Number.NaN,t.y=Number.NaN,t;c=(-s-Math.sqrt(a))/(2*o),r=e.radius_g+c*r,n*=c,i*=c,t.x=Math.atan2(n,r),t.y=Math.atan(i*Math.cos(t.x)/r),t.y=Math.atan(e.radius_p_inv2*Math.tan(t.y))}else if(e.shape==="sphere"){if(e.flip_axis?(i=Math.tan(t.y/e.radius_g_1),n=Math.tan(t.x/e.radius_g_1)*Math.sqrt(1+i*i)):(n=Math.tan(t.x/e.radius_g_1),i=Math.tan(t.y/e.radius_g_1)*Math.sqrt(1+n*n)),o=n*n+i*i+r*r,s=2*e.radius_g*r,a=s*s-4*o*e.C,a<0)return t.x=Number.NaN,t.y=Number.NaN,t;c=(-s-Math.sqrt(a))/(2*o),r=e.radius_g+c*r,n*=c,i*=c,t.x=Math.atan2(n,r),t.y=Math.atan(i*Math.cos(t.x)/r)}return t.x=t.x+e.long0,t}function sB(e,t={}){let r={...e,flip_axis:0,sweep:"",h:0,radius_g_1:0,radius_g:0,C:0,radius_p:0,radius_p2:0,radius_p_inv2:0,shape:"",...t};return KK(r),r}var aB=p(()=>{fc()});var e_,cB=p(()=>{nB();Ut();aB();Vt();e_={name:"geos",aliases:["Geostationary Satellite View","Geostationary_Satellite"],parameters:["lon_0","x_0","y_0","h","sweep"],create(e){let t=Ae(e),r=re(e.parameters,"h",NaN);if(!Number.isFinite(r)||r<=0)throw new Error("Geostationary projection requires positive h");let n=e.parameters.sweep||"y";if(!["x","y"].includes(n))throw new Error("Geostationary sweep must be x or y");let i=sB(t,{h:r,sweep:n});return{...Ie("geos",e,i,iB,oB,t.sphere?Ha({...t,lat0:0},1/(1+r/t.a),!0):void 0),longitudeOrigin:t.long0,getRenderingProfile:rB(kt(t,e),r,n==="x")}}}});function lB(e){return{engine:rT({semiMajorAxis:1,semiMinorAxis:Math.sqrt(1-e.es)}),latitude:e.lat0*al}}function uB(e,t,r){let n=t.engine.Inverse(t.latitude,0,r.y*al,k(r.x-e.long0,e.over)*al,If);if(!(n.M12>0))throw new Error("Coordinate is outside the ellipsoidal gnomonic horizon");let i=e.a*n.m12/n.M12,o=n.azi1/al;return r.x=e.x0+i*Math.sin(o),r.y=e.y0+i*Math.cos(o),r}function fB(e,t,r){let n=(r.x-e.x0)/e.a,i=(r.y-e.y0)/e.a,o=Math.hypot(n,i);if(o===0)return r.x=e.long0,r.y=e.lat0,r;let s=t.engine.Line(t.latitude,0,Math.atan2(n,i)*al,If),a=o<=1,c=a?o:1/o,l=Math.atan(o);for(let u=0;u<20;u++){let h=s.Position(l,If),d=a?(h.m12-c*h.M12)*h.M12:(c*h.m12-h.M12)*h.m12;if(!Number.isFinite(d))break;if(l-=d,Math.abs(d)<1e-14){let m=s.Position(l,If);if(!(m.M12>0))break;return r.x=k(e.long0+m.lon2/al,e.over),r.y=m.lat2/al,r}}throw new Error("Ellipsoidal gnomonic inverse did not converge")}var al,hB=p(()=>{nT();_t();al=180/Math.PI});function XK(e){e.sphere||(e.ellipsoid=lB(e)),e.sin_p14=Math.sin(e.lat0),e.cos_p14=Math.cos(e.lat0),e.infinity_dist=1e3*e.a,e.rc=1}function dB(e,t){if(e.ellipsoid)return uB(e,e.ellipsoid,t);var r,n,i,o,s,a,c,l,u=t.x,h=t.y;return i=k(u-e.long0,e.over),r=Math.sin(h),n=Math.cos(h),o=Math.cos(i),a=e.sin_p14*r+e.cos_p14*n*o,s=1,a>0||Math.abs(a)<=1e-10?(c=e.x0+e.a*s*n*Math.sin(i)/a,l=e.y0+e.a*s*(e.cos_p14*r-e.sin_p14*n*o)/a):(c=e.x0+e.infinity_dist*n*Math.sin(i),l=e.y0+e.infinity_dist*(e.cos_p14*r-e.sin_p14*n*o)),t.x=c,t.y=l,t}function mB(e,t){if(e.ellipsoid)return fB(e,e.ellipsoid,t);var r,n,i,o,s,a;return t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,t.x/=e.k0,t.y/=e.k0,r=Math.sqrt(t.x*t.x+t.y*t.y),r?(o=Math.atan2(r,e.rc),n=Math.sin(o),i=Math.cos(o),a=sl(i*e.sin_p14+t.y*n*e.cos_p14/r),s=Math.atan2(t.x*n,r*e.cos_p14*i-t.y*e.sin_p14*n),s=k(e.long0+s,e.over)):(a=e.lat0,s=e.long0),t.x=s,t.y=a,t}function pB(e,t={}){let r={...e,sin_p14:0,cos_p14:0,infinity_dist:0,rc:0,phic0:0,...t};return XK(r),r}var gB=p(()=>{hB();_t();c1()});var t_,yB=p(()=>{zs();qs();Ut();gB();t_={name:"gnom",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e),r=pB(t);return wn(Ie("gnom",e,r,dB,mB,t.sphere?Ha(t):void 0),t,Math.min(Math.PI*80/180,(1-t.es)*Math.PI*.45),(n,i)=>t.sphere?Bm(kt(t,e),n,i,"gnom"):$T(kt(t,e),n,i),(1-t.es)*Math.PI/2)}}});function r_(e,t){return 2*Math.atan(e*Math.exp(t))-F}var bB=p(()=>{Ct()});function h1(e,t){var r=r_(1,t),n=0,i=0;let o=0;do{if(++o>50)throw new Error("Isometric latitude inverse did not converge");n=r,i=e*Math.sin(n),r=r_(Math.exp(e*Math.log((1+i)/(1-i))/2),t)}while(Math.abs(r-n)>1e-12);return r}var n_=p(()=>{bB()});function Vu(e,t,r){if(Math.abs(t)>F)return Number.NaN;if(t===F)return Number.POSITIVE_INFINITY;if(t===-1*F)return Number.NEGATIVE_INFINITY;var n=e*r;return Math.log(Math.tan((F+t)/2))+e*Math.log((1-n)/(1+n))/2}var wB=p(()=>{Ct()});function YK(e){e.k0||(e.k0=1);var t=e.b/e.a;e.e=Math.sqrt(1-t*t),e.lc=e.long0,e.rs=Math.sqrt(1+e.e*e.e*Math.pow(Math.cos(e.lat0),4)/(1-e.e*e.e));var r=Math.sin(e.lat0),n=Math.asin(r/e.rs),i=Math.sin(n);e.cp=Vu(0,n,i)-e.rs*Vu(e.e,e.lat0,r),e.n2=e.k0*e.a*Math.sqrt(1-e.e*e.e)/(1-e.e*e.e*r*r),e.xs=e.x0,e.ys=e.y0-e.n2*n}function xB(e,t){var r=t.x,n=t.y,i=e.rs*(r-e.lc),o=e.cp+e.rs*Vu(e.e,n,Math.sin(n)),s=Math.asin(Math.sin(i)/Lf(o)),a=Vu(0,s,Math.sin(s));return t.x=e.xs+e.n2*a,t.y=e.ys+e.n2*Math.atan(uc(o)/Math.cos(i)),t}function _B(e,t){var r=t.x,n=t.y,i=Math.atan(uc((r-e.xs)/e.n2)/Math.cos((n-e.ys)/e.n2)),o=Math.asin(Math.sin((n-e.ys)/e.n2)/Lf((r-e.xs)/e.n2)),s=Vu(0,o,Math.sin(o));return t.x=e.lc+i/e.rs,t.y=h1(e.e,(s-e.cp)/e.rs),t}function SB(e,t={}){let r={...e,lc:0,rs:0,cp:0,n2:0,xs:0,ys:0,...t};return YK(r),r}var MB=p(()=>{wB();Pm();jy();n_()});var i_,vB=p(()=>{Bt();n_();Qe();ut();Ut();MB();i_={name:"gstmerc",aliases:["gstmerg"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Ae(e),r=SB(t),n=Ie("gstmerc",e,r,xB,_B);return De(n,Q(t.long0-Math.PI/6,-Math.PI/3,t.long0+Math.PI/6,Math.PI/3),i=>Vl(n.forward,i,t.long0,t.over,h1(r.e,-r.cp/r.rs)),t.primeMeridian,t.over)}}});function ZK(e){e.a=6377397155e-3,e.es=.006674372230614,e.e=Math.sqrt(e.es),e.s45=Math.PI/4,e.s90=2*e.s45,e.fi0=e.lat0,e.e2=e.es,e.e=Math.sqrt(e.e2),e.alfa=Math.sqrt(1+e.e2*Math.pow(Math.cos(e.fi0),4)/(1-e.e2)),e.uq=1.04216856380474,e.u0=Math.asin(Math.sin(e.fi0)/e.alfa),e.g=Math.pow((1+e.e*Math.sin(e.fi0))/(1-e.e*Math.sin(e.fi0)),e.alfa*e.e/2),e.k=Math.tan(e.u0/2+e.s45)/Math.pow(Math.tan(e.fi0/2+e.s45),e.alfa)*e.g,e.k1=e.k0,e.n0=e.a*Math.sqrt(1-e.e2)/(1-e.e2*Math.pow(Math.sin(e.fi0),2)),e.s0=1.37008346281555,e.n=Math.sin(e.s0),e.ro0=e.k1*e.n0/Math.tan(e.s0),e.ad=e.s90-e.uq}function EB(e,t){var r,n,i,o,s,a,c,l=t.x,u=t.y,h=k(l-e.long0,e.over);return r=Math.pow((1+e.e*Math.sin(u))/(1-e.e*Math.sin(u)),e.alfa*e.e/2),n=2*(Math.atan(e.k*Math.pow(Math.tan(u/2+e.s45),e.alfa)/r)-e.s45),i=-h*e.alfa,o=Math.asin(Math.cos(e.ad)*Math.sin(n)+Math.sin(e.ad)*Math.cos(n)*Math.cos(i)),s=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(o)),a=e.n*s,c=e.ro0*Math.pow(Math.tan(e.s0/2+e.s45),e.n)/Math.pow(Math.tan(o/2+e.s45),e.n),t.y=c*Math.cos(a)/1,t.x=c*Math.sin(a)/1,e.czech||(t.y*=-1,t.x*=-1),t}function TB(e,t){var r,n,i,o,s,a,c,l,u=t.x;t.x=t.y,t.y=u,e.czech||(t.y*=-1,t.x*=-1),a=Math.sqrt(t.x*t.x+t.y*t.y),s=Math.atan2(t.y,t.x),o=s/Math.sin(e.s0),i=2*(Math.atan(Math.pow(e.ro0/a,1/e.n)*Math.tan(e.s0/2+e.s45))-e.s45),r=Math.asin(Math.cos(e.ad)*Math.sin(i)-Math.sin(e.ad)*Math.cos(i)*Math.cos(o)),n=Math.asin(Math.cos(i)*Math.sin(o)/Math.cos(r)),t.x=e.long0-n/e.alfa,c=r,l=0;var h=0;do t.y=2*(Math.atan(Math.pow(e.k,-1/e.alfa)*Math.pow(Math.tan(r/2+e.s45),1/e.alfa)*Math.pow((1+e.e*Math.sin(c))/(1-e.e*Math.sin(c)),e.e/2))-e.s45),Math.abs(c-t.y)<1e-10&&(l=1),c=t.y,h+=1;while(l===0&&h<15);return h>=15?null:t}function AB(e,t={}){let r={...e,s45:0,s90:0,fi0:0,e2:0,alfa:0,uq:0,u0:0,g:0,k:0,k1:0,n0:0,s0:0,n:0,ro0:0,ad:0,czech:!1,...t};return ZK(r),r}var IB=p(()=>{_t()});var o_,PB=p(()=>{Wa();Qe();ut();Ut();IB();Vt();kn();o_={name:"krovak",aliases:["Krovak","Krovak Modified","Krovak (North Orientated)","Krovak Modified (North Orientated)"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0","czech","alpha","lat_ts"],flags:["czech"],create(e){let t=re(e.parameters,"alpha",30.28813972222222),r=re(e.parameters,"lat_ts",78.5);if(![30.28813972222222,30.28813975277778].some(s=>Math.abs(t-s)<=1e-10))throw new Error("Krovak requires its fixed cone-axis co-latitude");if(Math.abs(r-78.5)>1e-10)throw new Error("Krovak requires its fixed 78.5 degree pseudo standard parallel");let n=Ae(e);n.lat0=Ns(e.parameters,"lat_0",49.5),n.long0=Ns(e.parameters,"lon_0",24.83333333333333),n.k0=re(e.parameters,"k_0",re(e.parameters,"k",.9999));let i=AB(n,{czech:Oi(e.parameters,"czech")}),o=Ie("krovak",e,i,EB,TB);return De(o,Q(n.long0-Math.PI/12,Math.max(-Math.PI/2+1e-8,n.lat0-Math.PI/36),n.long0+Math.PI/12,Math.min(Math.PI/2-1e-8,n.lat0+Math.PI/36)),s=>SO(kt(i,e),s),n.primeMeridian,n.over)}}});function RB(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over),o=e.x0+e.a*i,s=e.y0+e.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return t.x=o,t.y=s,t}function LB(e,t){t.x-=e.x0,t.y-=e.y0;var r=k(e.long0+t.x/e.a,e.over),n=2.5*(Math.atan(Math.exp(.8*t.y/e.a))-Math.PI/4);return t.x=r,t.y=n,t}function OB(e,t={}){let r={...e,...t};return r}var BB=p(()=>{_t()});var s_,CB=p(()=>{Bt();Qe();ut();Ut();BB();s_={name:"mill",aliases:["Miller_Cylindrical"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=OB(t),n=Ie("mill",e,r,RB,LB);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function JK(e){e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.long0=e.long0!==void 0?e.long0:0}function DB(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over);let o=Math.sin(Math.abs(n)),s=Math.cos(n),a=Math.abs(n)===Math.PI/2?0:Math.PI*s*s/(1+o),c=Math.cbrt(6*a),l=0,u=Math.PI;c=Math.min(c,u);for(let m=0;m<32&&c>0;m++){let g=GB(c)-a,y=g/(2*Math.sin(c/2)**2);if(Math.abs(y)<=16*Number.EPSILON*c)break;g>0?u=c:l=c;let b=c-y;if(b===c||u-l<=8*Number.EPSILON*Math.max(1,c))break;if(c=b>=l&&b<=u?b:(l+u)/2,m===31)throw new Error("Mollweide forward did not converge")}var h=2*Math.SQRT2/Math.PI*e.a*i*Math.sin(c/2)+e.x0,d=Math.sign(n)*Math.SQRT2*e.a*Math.cos(c/2)+e.y0;return t.x=h,t.y=d,t}function NB(e,t){let r=t.x-e.x0,n=(t.y-e.y0)/(Math.SQRT2*e.a);if(Math.abs(n)>1+8*Number.EPSILON)return null;let i=r/(2*Math.SQRT2*e.a),o=i*i+n*n;if(!e.over&&o>1+8*Number.EPSILON)return null;let s=2*Math.acos(Math.min(1,Math.abs(n))),a=Math.sin(s/2);if(!e.over&&Math.abs(o-1)<=8*Number.EPSILON&&(a=Math.min(1,Math.abs(i)),s=2*Math.asin(a)),a===0&&Math.abs(r)>8*Number.EPSILON*e.a)return null;let c=a===0?0:Math.PI*i/a;var l=k(e.long0+c,e.over),u=Math.sign(n)*(Math.PI/2-2*Math.asin(Math.sqrt(GB(s)/(2*Math.PI))));return t.x=l,t.y=u,t}function FB(e,t={}){let r={...e,...t};return JK(r),r}function GB(e){if(e>.5)return e-Math.sin(e);let t=e*e;return e*t*(1/6+t*(-1/120+t*(1/5040+t*(-1/362880+t*(1/39916800+t*(-1/6227020800+t/1307674368e3))))))}var kB=p(()=>{_t()});var a_,UB=p(()=>{Bt();Qe();ut();Ut();kB();a_={name:"moll",aliases:["Mollweide"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=FB(t),n=Ie("moll",e,r,DB,NB);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function QK(e){e.A=[],e.A[1]=.6399175073,e.A[2]=-.1358797613,e.A[3]=.063294409,e.A[4]=-.02526853,e.A[5]=.0117879,e.A[6]=-.0055161,e.A[7]=.0026906,e.A[8]=-.001333,e.A[9]=67e-5,e.A[10]=-34e-5,e.B_re=[],e.B_im=[],e.B_re[1]=.7557853228,e.B_im[1]=0,e.B_re[2]=.249204646,e.B_im[2]=.003371507,e.B_re[3]=-.001541739,e.B_im[3]=.04105856,e.B_re[4]=-.10162907,e.B_im[4]=.01727609,e.B_re[5]=-.26623489,e.B_im[5]=-.36249218,e.B_re[6]=-.6870983,e.B_im[6]=-1.1651967,e.C_re=[],e.C_im=[],e.C_re[1]=1.3231270439,e.C_im[1]=0,e.C_re[2]=-.577245789,e.C_im[2]=-.007809598,e.C_re[3]=.508307513,e.C_im[3]=-.112208952,e.C_re[4]=-.15094762,e.C_im[4]=.18200602,e.C_re[5]=1.01418179,e.C_im[5]=1.64497696,e.C_re[6]=1.9660549,e.C_im[6]=2.5127645,e.D=[],e.D[1]=1.5627014243,e.D[2]=.5185406398,e.D[3]=-.03333098,e.D[4]=-.1052906,e.D[5]=-.0368594,e.D[6]=.007317,e.D[7]=.0122,e.D[8]=.00394,e.D[9]=-.0013}function jB(e,t){var r,n=t.x,i=t.y,o=i-e.lat0,s=n-e.long0,a=o/Of*1e-5,c=s,l=1,u=0;for(r=1;r<=10;r++)l=l*a,u=u+e.A[r]*l;var h=u,d=c,m=1,g=0,y,b,w=0,_=0;for(r=1;r<=6;r++)y=m*h-g*d,b=g*h+m*d,m=y,g=b,w=w+e.B_re[r]*m-e.B_im[r]*g,_=_+e.B_im[r]*m+e.B_re[r]*g;return t.x=_*e.a+e.x0,t.y=w*e.a+e.y0,t}function zB(e,t){var r,n=t.x,i=t.y,o=n-e.x0,s=i-e.y0,a=s/e.a,c=o/e.a,l=1,u=0,h,d,m=0,g=0;for(r=1;r<=6;r++)h=l*a-u*c,d=u*a+l*c,l=h,u=d,m=m+e.C_re[r]*l-e.C_im[r]*u,g=g+e.C_im[r]*l+e.C_re[r]*u;for(var y=0;y<e.iterations;y++){var b=m,w=g,_,S,v=a,T=c;for(r=2;r<=6;r++)_=b*m-w*g,S=w*m+b*g,b=_,w=S,v=v+(r-1)*(e.B_re[r]*b-e.B_im[r]*w),T=T+(r-1)*(e.B_im[r]*b+e.B_re[r]*w);b=1,w=0;var O=e.B_re[1],P=e.B_im[1];for(r=2;r<=6;r++)_=b*m-w*g,S=w*m+b*g,b=_,w=S,O=O+r*(e.B_re[r]*b-e.B_im[r]*w),P=P+r*(e.B_im[r]*b+e.B_re[r]*w);var M=O*O+P*P;m=(v*O+T*P)/M,g=(T*O-v*P)/M}var U=m,C=g,L=1,A=0;for(r=1;r<=9;r++)L=L*U,A=A+e.D[r]*L;var W=e.lat0+A*Of*1e5,G=e.long0+C;return t.x=G,t.y=W,t}function qB(e,t={}){let r={...e,A:[],B_re:[],B_im:[],C_re:[],C_im:[],D:[],iterations:1,...t};return QK(r),r}var VB=p(()=>{Ct()});var c_,WB=p(()=>{Wa();Qe();ut();Ut();VB();Vt();c_={name:"nzmg",aliases:["New_Zealand_Map_Grid"],parameters:["lon_0","x_0","y_0","lat_0","iterations"],create(e){let t=Ae(e),r=re(e.parameters,"iterations",1);if(!Number.isInteger(r)||r<0||r>10)throw new Error("NZMG iterations must be an integer from 0 to 10");if(!Object.prototype.hasOwnProperty.call(e.parameters,"lat_0")||!Object.prototype.hasOwnProperty.call(e.parameters,"lon_0"))throw new Error("NZMG requires lat_0 and lon_0");let n=qB(t,{iterations:r}),i=Ie("nzmg",e,n,jB,zB);return De(i,Q(t.long0-Math.PI/22.5,Math.max(-Math.PI/2,t.lat0-Math.PI/22.5),t.long0+Math.PI/22.5,Math.min(Math.PI/2,t.lat0+Math.PI/22.5)),o=>MO(kt(n,e),o),t.primeMeridian,t.over)}}});function eX(e){return e.no_uoff||e.no_off||["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(e.projName.toLowerCase().replace(/[ _-]/g,""))}function tX(e){var t,r,n,i,o,s,a,c,l,u,h=0,d,m=0,g=0,y=0,b=0,w=0,_=0;e.k0||(e.k0=1),e.no_off=eX(e),e.no_rot=e.no_rot;var S=!1;Number.isFinite(e.alpha)&&(S=!0);var v=!1;if(Number.isFinite(e.rectified_grid_angle)&&(v=!0),S&&(_=e.alpha),v&&(h=e.rectified_grid_angle,S||(_=0,S=!0)),S||v)m=e.longc;else if(g=e.long1,b=e.lat1,y=e.long2,w=e.lat2,Math.abs(b-w)<=Wu||Math.abs(b)<=Wu||Math.abs(Math.abs(b)-F)<=Wu||Math.abs(Math.abs(e.lat0)-F)<=Wu||Math.abs(Math.abs(w)-F)<=Wu)throw new Error;var T=1-e.es;if(r=Math.sqrt(T),Math.abs(e.lat0)>1e-10?(c=Math.sin(e.lat0),n=Math.cos(e.lat0),t=1-e.es*c*c,e.B=n*n,e.B=Math.sqrt(1+e.es*e.B*e.B/T),e.A=e.B*e.k0*r/t,i=e.B*r/(n*Math.sqrt(t)),o=i*i-1,o<=0?o=0:(o=Math.sqrt(o),e.lat0<0&&(o=-o)),e.E=o+=i,e.E*=Math.pow(Qr(e.e,e.lat0,c),e.B)):(e.B=1/r,e.A=e.k0,e.E=i=o=1),S||v){S?(d=Math.asin(Math.sin(_)/i),v||(h=_)):(d=h,_=Math.asin(i*Math.sin(d)));let O=.5*(o-1/o)*Math.tan(d);i>1&&Math.abs(Math.cos(_))<=8*Number.EPSILON?O=Math.sign(e.lat0)*Math.sign(Math.sin(_)):Math.abs(O)>1&&Math.abs(O)<=1+8*Number.EPSILON&&(O=Math.sign(O)),e.lam0=m-Math.asin(O)/e.B}else s=Math.pow(Qr(e.e,b,Math.sin(b)),e.B),a=Math.pow(Qr(e.e,w,Math.sin(w)),e.B),o=e.E/s,l=(a-s)/(a+s),u=e.E*e.E,u=(u-a*s)/(u+a*s),t=g-y,t<-Math.PI?y-=Gs:t>Math.PI&&(y+=Gs),e.lam0=k(.5*(g+y)-Math.atan(u*Math.tan(.5*e.B*(g-y))/l)/e.B,e.over),d=Math.atan(2*Math.sin(e.B*k(g-e.lam0,e.over))/(o-1/o)),h=_=Math.asin(i*Math.sin(d));e.singam=Math.sin(d),e.cosgam=Math.cos(d),e.sinrot=Math.sin(h),e.cosrot=Math.cos(h),e.rB=1/e.B,e.ArB=e.A*e.rB,e.BrA=1/e.ArB,e.no_off?e.u_0=0:(e.u_0=Math.abs(e.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(_))),e.lat0<0&&(e.u_0=-e.u_0)),o=.5*d,e.v_pole_n=e.ArB*Math.log(Math.tan(et-o)),e.v_pole_s=e.ArB*Math.log(Math.tan(et+o))}function HB(e,t){var r=t,n,i,o,s,a,c,l,u;if(t.x=t.x-e.lam0,Math.abs(Math.abs(t.y)-F)>1e-10){if(a=e.E/Math.pow(Qr(e.e,t.y,Math.sin(t.y)),e.B),c=1/a,n=.5*(a-c),i=.5*(a+c),s=Math.sin(e.B*t.x),o=(n*e.singam-s*e.cosgam)/i,Math.abs(Math.abs(o)-1)<1e-10)throw new Error;u=.5*e.ArB*Math.log((1-o)/(1+o)),c=Math.cos(e.B*t.x),Math.abs(c)<Wu?l=e.A*t.x:l=e.ArB*Math.atan2(n*e.cosgam+s*e.singam,c)}else u=t.y>0?e.v_pole_n:e.v_pole_s,l=e.ArB*t.y;return e.no_rot?(r.x=l,r.y=u):(l-=e.u_0,r.x=u*e.cosrot+l*e.sinrot,r.y=l*e.cosrot-u*e.sinrot),r.x=e.a*r.x+e.x0,r.y=e.a*r.y+e.y0,r}function $B(e,t){var r,n,i,o,s,a,c,l=t;if(t.x=(t.x-e.x0)*(1/e.a),t.y=(t.y-e.y0)*(1/e.a),e.no_rot?(n=t.y,r=t.x):(n=t.x*e.cosrot-t.y*e.sinrot,r=t.y*e.cosrot+t.x*e.sinrot+e.u_0),i=Math.exp(-e.BrA*n),o=.5*(i-1/i),s=.5*(i+1/i),a=Math.sin(e.BrA*r),c=(a*e.cosgam+o*e.singam)/s,Math.abs(Math.abs(c)-1)<1e-10)l.x=0,l.y=c<0?-F:F;else{if(l.y=e.E/Math.sqrt((1+c)/(1-c)),l.y=mc(e.e,Math.pow(l.y,1/e.B)),l.y===1/0)throw new Error;l.x=-e.rB*Math.atan2(o*e.cosgam-a*e.singam,Math.cos(e.BrA*r))}return l.x+=e.lam0,l}function KB(e,t={}){let r={...e,no_off:!1,no_rot:!1,alpha:NaN,rectified_grid_angle:NaN,longc:0,long1:0,long2:0,B:0,A:0,E:0,lam0:0,singam:0,cosgam:0,sinrot:0,cosrot:0,rB:0,ArB:0,BrA:0,u_0:0,v_pole_n:0,v_pole_s:0,no_uoff:!1,projName:"",...t};return tX(r),r}var Wu,XB=p(()=>{Df();_t();Dm();Ct();Wu=1e-7});var l_,YB=p(()=>{Wa();Qe();ut();Ut();XB();Vt();kn();l_={name:"omerc",aliases:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0","alpha","gamma","lonc","lon_1","lon_2","lat_1","lat_2","no_off","no_uoff","no_rot"],flags:["no_off","no_uoff","no_rot"],create(e){let t=Ae(e);if(Math.abs(t.lat0)>=Math.PI/2)throw new Error("Oblique Mercator origin must be away from the poles");let n=Object.prototype.hasOwnProperty.call(e.parameters,"alpha")||Object.prototype.hasOwnProperty.call(e.parameters,"gamma")?["lonc"]:["lon_1","lat_1","lon_2","lat_2"];for(let s of n)if(!Object.prototype.hasOwnProperty.call(e.parameters,s))throw new Error("Oblique Mercator requires "+s);let i=KB(t,{projName:e.parameters.proj||"omerc",alpha:re(e.parameters,"alpha",NaN)*Math.PI/180,rectified_grid_angle:re(e.parameters,"gamma",NaN)*Math.PI/180,longc:re(e.parameters,"lonc",0)*Math.PI/180,long1:re(e.parameters,"lon_1",0)*Math.PI/180,long2:re(e.parameters,"lon_2",0)*Math.PI/180,no_off:Oi(e.parameters,"no_off"),no_uoff:Oi(e.parameters,"no_uoff"),no_rot:Oi(e.parameters,"no_rot")}),o=Ie("omerc",e,i,HB,$B);return De(o,Q(i.lam0-Math.PI/18,Math.max(-Math.PI/2+1e-8,t.lat0-Math.PI/18),i.lam0+Math.PI/18,Math.min(Math.PI/2-1e-8,t.lat0+Math.PI/18)),s=>_O(kt(i,e),s),t.primeMeridian,t.over)}}});function ZB(e){let t=Math.sin(e.lat0),r=Math.cos(e.lat0),n=1/Math.sqrt(1-e.es*t*t);return{...e,sin0:t,cos0:r,originY:-e.es*n*t*r}}function JB(e,t){let r=k(t.x-e.long0,e.over),n=Math.sin(t.y),i=Math.cos(t.y),o=1/Math.sqrt(1-e.es*n*n);return t.x=e.x0+e.a*e.k0*o*i*Math.sin(r),t.y=e.y0+e.a*e.k0*(o*((1-e.es)*n*e.cos0-i*Math.cos(r)*e.sin0)-e.originY),t}function QB(e,t){let r=(t.x-e.x0)/(e.a*e.k0),n=(t.y-e.y0)/(e.a*e.k0)+e.originY,i=1-e.es,o=e.cos0*e.cos0+e.sin0*e.sin0/i,s=n*e.sin0*e.cos0*e.es/i,a=r*r+n*n*(e.sin0*e.sin0+e.cos0*e.cos0/i)-1,c=s*s-o*a;if(c<-32*Number.EPSILON*o)throw new Error("Coordinate is outside the orthographic ellipse");let l=(-s+Math.sqrt(Math.max(0,c)))/o,u=l*e.cos0-n*e.sin0,h=l*e.sin0+n*e.cos0;return t.x=k(e.long0+Math.atan2(r,u),e.over),t.y=Math.atan2(h,i*Math.hypot(u,r)),t}var eC=p(()=>{_t()});var u_,tC=p(()=>{zs();qs();Ut();eC();u_={name:"ortho",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Ae(e),r=ZB(t);return wn(Ie("ortho",e,r,JB,QB,Ha(t,0,!0)),t,Math.PI/2,(n,i)=>qT(kt(t,e),n,i),Math.PI/2)}}});function rX(e){e.meridianPole=ci(e.a,e.es,0,Math.PI/2),e.poleRadius=e.a/Math.sqrt(1-e.es),e.ml0=ci(e.a,e.es,0,e.lat0)}function iC(e,t){var r=t.x,n=t.y,i,o,s,a=k(r-e.long0,e.over);if(s=a*Math.sin(n),e.sphere)n===0?(i=e.a*a,o=-1*e.a*e.lat0):(i=e.a*Math.sin(s)/Math.tan(n),o=e.a*(n-e.lat0+2*Math.sin(s/2)**2/Math.tan(n)));else if(n===0)i=e.a*a,o=-1*e.ml0;else{var c=ku(e.a,e.e,Math.sin(n))/Math.tan(n);i=c*Math.sin(s),o=ci(e.a,e.es,e.lat0,n)+c*(2*Math.sin(s/2)**2)}return t.x=i+e.x0,t.y=o+e.y0,t}function oC(e,t){var r,n,i,o,s,a,c,l,u;i=t.x-e.x0,o=t.y-e.y0;let h=o+(e.sphere?e.a*e.lat0:e.ml0),d=h<0?-1:1,g=(e.sphere?e.a*Math.PI/2:e.meridianPole)-d*h,y=Math.hypot(i,g);if(y/e.a<1e-6)return t.x=k(e.long0+Math.atan2(i,g),e.over),t.y=d*(Math.PI/2-y/e.poleRadius),t;if(e.sphere)if(Math.abs(o+e.a*e.lat0)<=1e-10)r=k(i/e.a+e.long0,e.over),n=0;else{a=e.lat0+o/e.a,c=i*i/e.a/e.a+a*a,l=a;var b;for(s=rC;s;--s)if(b=Math.tan(l),u=-1*(a*(l*b+1)-l-.5*(l*l+c)*b)/((l-a)/b-1),l+=u,Math.abs(u)<=1e-14){n=l;break}if(n=nC(e,n===void 0?l:n,i,o),n===void 0)return null;l=n,r=k(e.long0+Math.asin(i*Math.tan(l)/e.a)/Math.sin(n),e.over)}else if(Math.abs(o+e.ml0)<=1e-10)n=0,r=k(e.long0+i/e.a,e.over);else{a=(e.ml0+o)/e.a,c=i*i/e.a/e.a+a*a,l=a;var w,_,S,v,T;for(s=rC;s;--s)if(T=e.e*Math.sin(l),w=Math.sqrt(1-T*T)*Math.tan(l),_=ci(e.a,e.es,0,l),S=(1-e.es)/Math.pow(1-T*T,1.5),v=_/e.a,u=(a*(w*v+1)-v-.5*w*(v*v+c))/(e.es*Math.sin(2*l)*(v*v+c-2*a*v)/(4*w)+(a-v)*(w*S-2/Math.sin(2*l))-S),l-=u,Math.abs(u)<=1e-14){n=l;break}if(n=nC(e,n===void 0?l:n,i,o),n===void 0)return null;l=n,w=Math.sqrt(1-e.es*Math.pow(Math.sin(n),2))*Math.tan(n),r=k(e.long0+Math.asin(i*w/e.a)/Math.sin(n),e.over)}return t.x=r,t.y=n,t}function sC(e,t={}){let r={...e,ml0:0,meridianPole:0,poleRadius:0,...t};return rX(r),r}function nC(e,t,r,n){for(let i=0;i<8;i++){if(!Number.isFinite(t)||Math.abs(t)>=Math.PI/2)return;let o=Math.sin(t),s=Math.cos(t),a=1-e.es*o*o,c=e.sphere?e.a:ku(e.a,e.e,o),l=c/Math.tan(t),u=Math.asin(r/l),h=l*Math.sin(u),d=2*Math.sin(u/2)**2,m=e.sphere?e.a*(t-e.lat0):ci(e.a,e.es,e.lat0,t),g=l*d,b=m+g-n;if(Math.abs(h-r)<=64*Number.EPSILON*Math.max(e.a,Math.abs(r))&&Math.abs(b)<=64*Number.EPSILON*Math.max(Math.abs(n),Math.abs(m),Math.abs(g),e.a*Math.max(Math.abs(t),Math.abs(e.lat0))))return t;let w=e.sphere?e.a:e.a*(1-e.es)/Math.pow(a,1.5),_=c*((e.sphere?0:e.es*s*s/a)-1/(o*o)),S=w+_*(-d/Math.cos(u)),v=b/S;if(!Number.isFinite(v)||Math.abs(v)>1e-6)return;t-=v}}var rC,aC=p(()=>{_t();qx();Gx();rC=20});var f_,cC=p(()=>{Wa();Qe();ut();Ut();aC();f_={name:"poly",aliases:["Polyconic","American_Polyconic"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e),r=sC(t),n=Ie("poly",e,r,iC,oC);return De(n,Q(t.long0-Math.PI/6,Math.max(-Math.PI/2+1e-8,t.lat0-Math.PI/2+1e-8),t.long0+Math.PI/6,Math.min(Math.PI/2-1e-8,t.lat0+Math.PI/2-1e-8)),i=>bO(kt(t,e),n.forward,i),t.primeMeridian,t.over)}}});function nX(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0,e.lat_ts=e.lat_ts||0,e.lat0>=F-et/2?e.face=jt.TOP:e.lat0<=-(F-et/2)?e.face=jt.BOTTOM:Math.abs(e.long0)<=et?e.face=jt.FRONT:Math.abs(e.long0)<=F+et?e.face=e.long0>0?jt.RIGHT:jt.LEFT:e.face=jt.BACK,e.es!==0&&(e.one_minus_f=1-(e.a-e.b)/e.a,e.one_minus_f_squared=e.one_minus_f*e.one_minus_f)}function lC(e,t){var r=t,n,i,o,s,a,c,l=0;if(t.x-=e.long0,e.es!==0?n=Math.atan(e.one_minus_f_squared*Math.tan(t.y)):n=t.y,i=t.x,e.face===jt.TOP)s=F-n,i>=et&&i<=F+et?(l=mt.AREA_0,o=i-F):i>F+et||i<=-(F+et)?(l=mt.AREA_1,o=i>0?i-Math.PI:i+Math.PI):i>-(F+et)&&i<=-et?(l=mt.AREA_2,o=i+F):(l=mt.AREA_3,o=i);else if(e.face===jt.BOTTOM)s=F+n,i>=et&&i<=F+et?(l=mt.AREA_0,o=-i+F):i<et&&i>=-et?(l=mt.AREA_1,o=-i):i<-et&&i>=-(F+et)?(l=mt.AREA_2,o=-i-F):(l=mt.AREA_3,o=i>0?-i+Math.PI:-i-Math.PI);else{var u,h,d,m,g,y,b;e.face===jt.RIGHT?i=Hu(i,+F):e.face===jt.BACK?i=Hu(i,+Math.PI):e.face===jt.LEFT&&(i=Hu(i,-F)),m=Math.sin(n),g=Math.cos(n),y=Math.sin(i),b=Math.cos(i),u=g*b,h=g*y,d=m,e.face===jt.FRONT?(s=Math.atan2(Math.hypot(h,d),u),o=d1(s,d,h)):e.face===jt.RIGHT?(s=Math.atan2(Math.hypot(u,d),h),o=d1(s,d,-u)):e.face===jt.BACK?(s=Math.atan2(Math.hypot(h,d),-u),o=d1(s,d,-h)):e.face===jt.LEFT?(s=Math.atan2(Math.hypot(u,d),-h),o=d1(s,d,u)):s=o=0,Math.abs(o)<=et?l=mt.AREA_0:o>et&&o<=F+et?(l=mt.AREA_1,o-=F):o>F+et||o<=-(F+et)?(l=mt.AREA_2,o=o>=0?o-Math.PI:o+Math.PI):(l=mt.AREA_3,o+=F)}return c=Math.atan(12/Math.PI*(o+Math.acos(Math.sin(o)*Math.cos(et))-F)),a=Math.sqrt(2*Math.sin(s/2)**2/(Math.cos(c)*Math.cos(c))/(1-Math.cos(Math.atan(1/Math.cos(o))))),l===mt.AREA_1?c+=F:l===mt.AREA_2?c+=Math.PI:l===mt.AREA_3&&(c+=1.5*Math.PI),r.x=a*Math.cos(c),r.y=a*Math.sin(c),r.x=r.x*e.a+e.x0,r.y=r.y*e.a+e.y0,t}function uC(e,t){var r=0,n=0,i,o,s,a,c,l,u,h,d=0;t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d=mt.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(d=mt.AREA_1,i-=F):t.x<0&&-t.x>=Math.abs(t.y)?(d=mt.AREA_2,i=i<0?i+Math.PI:i-Math.PI):(d=mt.AREA_3,i+=F),h=Math.PI/12*Math.tan(i),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),c=Math.atan(a),o=Math.cos(i),s=Math.hypot(t.x,t.y);let m=o*o*s*s*(1-Math.cos(Math.atan(1/Math.cos(c))));if(l=1-m,l<-1?l=-1:l>1&&(l=1),e.face===jt.TOP)u=2*Math.asin(Math.sqrt(Math.min(1,m/2))),n=F-u,d===mt.AREA_0?r=c+F:d===mt.AREA_1?r=c<0?c+Math.PI:c-Math.PI:d===mt.AREA_2?r=c-F:r=c;else if(e.face===jt.BOTTOM)u=2*Math.asin(Math.sqrt(Math.min(1,m/2))),n=u-F,d===mt.AREA_0?r=-c+F:d===mt.AREA_1?r=-c:d===mt.AREA_2?r=-c-F:r=c<0?-c-Math.PI:-c+Math.PI;else{var g,y,b;g=l;let w=Math.sqrt(Math.max(0,m*(2-m)));b=w*Math.sin(c),y=w*Math.cos(c),d===mt.AREA_1?(h=y,y=-b,b=h):d===mt.AREA_2?(y=-y,b=-b):d===mt.AREA_3&&(h=y,y=b,b=-h),e.face===jt.RIGHT?(h=g,g=-y,y=h):e.face===jt.BACK?(g=-g,y=-y):e.face===jt.LEFT&&(h=g,g=y,y=-h),n=Math.atan2(b,Math.hypot(g,y)),r=Math.atan2(y,g),e.face===jt.RIGHT?r=Hu(r,-F):e.face===jt.BACK?r=Hu(r,-Math.PI):e.face===jt.LEFT&&(r=Hu(r,+F))}return e.es!==0&&(n=Math.atan2(Math.sin(n),e.one_minus_f_squared*Math.cos(n))),r+=e.long0,t.x=r,t.y=n,t}function d1(e,t,r){return e===0?0:Math.atan2(t,r)}function Hu(e,t){var r=e+t;return r<-Math.PI?r+=Gs:r>+Math.PI&&(r-=Gs),r}function fC(e,t={}){let r={...e,face:0,one_minus_f:0,one_minus_f_squared:0,...t};return nX(r),r}var jt,mt,hC=p(()=>{Ct();jt={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},mt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4}});var h_,dC=p(()=>{cc();Vh();Ut();Vt();hC();Qe();ut();dc();Bt();h_={name:"qsc",aliases:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e),r=e.primeMeridian??0,n=fC(t),i=Ie("qsc",e,n,lC,uC),o=re(e.parameters,"x_0",0),s=re(e.parameters,"y_0",0);return{...i,longitudeOrigin:t.long0,getRenderingProfile(a){if(a)return ur(h=>{let d=w=>t.es?Math.atan((1-t.es)*Math.tan(w)):w,m=Q(h[0][0]-t.long0,d(h[0][1]),h[1][0]-t.long0,d(h[1][1])),g=n.face===5?[0,0,1]:n.face===6?[0,0,-1]:[1,0,0],y=dt(g,m)[0],b=t.a*Math.sqrt((1-y)/(.5*(1-Math.SQRT1_2)));return lt([o-b,o+b],[s-b,s+b])},a,t.long0,r);let c=[[o-t.a,s-t.a,0],[o+t.a,s+t.a,0]],l=qa(e.parameters,r)().normalize,u=Cs(h=>{let[d,m]=i.forward(h.x,h.y);Math.abs(d-o)<=t.a&&Math.abs(m-s)<=t.a||([h.x,h.y]=i.inverse(o+Math.max(-t.a,Math.min(t.a,d-o)),s+Math.max(-t.a,Math.min(t.a,m-s))))},r);return{bounds:c,normalize(h){l(h),u(h)}}}}}}});function sX(e,t,r,n,i){for(var o=r;i;--i){var s=(m1(e,o)-t)/oX(e,o);if(o-=s,Math.abs(s)<n)break}return o}function aX(e){e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,e.es=0}function yC(e,t){var r=k(t.x-e.long0,e.over),n=Math.abs(t.y),i=Math.floor(n*gC+1e-15);i<0?i=0:i>=cl&&(i=cl),n=Vy*(n-iX*i);var o=m1($u[i],n)*r,s=m1($a[i],n);return t.y<0&&(s=-s),t.x=o*e.a*mC+e.x0,t.y=s*e.a*pC+e.y0,t}function bC(e,t){var r=t.y,n=t;n.x=(n.x-e.x0)/(e.a*mC),n.y=Math.abs(r-e.y0)/(e.a*pC);for(let a=0;a<=cl;a++)if(Math.abs(n.y-$a[a][0])<=8*Number.EPSILON)return n.x=k(n.x/$u[a][0]+e.long0,e.over),n.y=(r<e.y0?-1:1)*a*5*qy,n;if(n.y>=1)n.x/=$u[cl][0],n.y=r<0?-F:F;else{var i=Math.floor(n.y*cl);for(i<0?i=0:i>=cl&&(i=cl-1);;)if($a[i][0]>n.y)--i;else if($a[i+1][0]<=n.y)++i;else break;var o=$a[i],s=5*(n.y-o[0])/($a[i+1][0]-o[0]);s=sX(o,n.y,s,1e-10,100),n.x/=m1($u[i],s),n.y=(5*i+s)*qy,r<0&&(n.y=-n.y)}return n.x=k(n.x+e.long0,e.over),n}function wC(e,t={}){let r={...e,...t};return aX(r),r}var $u,$a,mC,pC,gC,iX,cl,m1,oX,xC=p(()=>{Ct();_t();$u=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],$a=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]];$u=$u.map(e=>e.map(Math.fround));$a=$a.map(e=>e.map(Math.fround));mC=.8487,pC=1.3523,gC=Vy/5,iX=1/gC,cl=18,m1=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},oX=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])}});var d_,_C=p(()=>{Bt();Qe();ut();Ut();xC();d_={name:"robin",aliases:["Robinson"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=wC(t),n=Ie("robin",e,r,yC,bC);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});var m_,SC=p(()=>{Bt();Qe();ut();Ut();Kx();m_={name:"sinu",aliases:["Sinusoidal"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=GO(t),n=Ie("sinu",e,r,l1,u1);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function cX(e){e.k0||(e.k0=1);var t=e.lat0;e.lambda0=e.long0;var r=Math.sin(t),n=e.a,i=e.rf,o=1/i,s=2*o-Math.pow(o,2);e.e=Math.sqrt(s);var a=e.e;e.R=e.k0*n*Math.sqrt(1-s)/(1-s*Math.pow(r,2)),e.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(t),4)),e.b0=Math.asin(r/e.alpha);var c=Math.log(Math.tan(Math.PI/4+e.b0/2)),l=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+a*r)/(1-a*r));e.K=c-e.alpha*l+e.alpha*a/2*u}function MC(e,t){let r=e.e*Math.sin(t.y),n=2*Math.atan(Math.exp(e.alpha*(Math.log(Math.tan(Math.PI/4+t.y/2))-e.e/2*Math.log((1+r)/(1-r)))+e.K))-Math.PI/2,i=e.alpha*(t.x-e.lambda0),o=Math.cos(n),s=Math.asin(Math.cos(e.b0)*Math.sin(n)-Math.sin(e.b0)*o*Math.cos(i)),a=Math.asin(o*Math.sin(i)/Math.cos(s));return t.x=e.x0+e.R*a,t.y=e.y0+e.R*Math.log(Math.tan(Math.PI/4+s/2)),t}function vC(e,t){let r=(t.x-e.x0)/e.R,n=2*(Math.atan(Math.exp((t.y-e.y0)/e.R))-Math.PI/4),i=Math.asin(Math.cos(e.b0)*Math.sin(n)+Math.sin(e.b0)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),s=(e.K-Math.log(Math.tan(Math.PI/4+i/2)))/e.alpha;for(let a=0;a<6;a++){let c=e.e*Math.sin(i),l=(s+Math.log(Math.tan(Math.PI/4+i/2))-e.e/2*Math.log((1+c)/(1-c)))*(1-c*c)*Math.cos(i)/(1-e.es);if(i-=l,Math.abs(l)<1e-10)return t.x=e.lambda0+o/e.alpha,t.y=i,t}return null}function EC(e,t={}){let r={...e,lambda0:0,rf:0,R:0,alpha:0,b0:0,K:0,...t};return cX(r),r}var TC=p(()=>{});var p_,AC=p(()=>{Wa();Qe();ut();Ut();TC();p_={name:"somerc",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Ae(e),r=EC(t,{rf:t.a===t.b?1/0:1/(1-t.b/t.a)}),n=Ie("somerc",e,r,MC,vC);return De(n,Q(t.long0-Math.PI/18,Math.max(-Math.PI/2+1e-8,t.lat0-Math.PI/18),t.long0+Math.PI/18,Math.min(Math.PI/2-1e-8,t.lat0+Math.PI/18)),i=>xO(kt(r,e),i),t.primeMeridian,t.over)}}});function lX(e){if(Math.abs(Math.abs(e.lat0)-F)<1e-10?e.mode=e.lat0<0?Kr.S_POLE:Kr.N_POLE:Math.abs(e.lat0)<1e-10?e.mode=Kr.EQUIT:(e.mode=Kr.OBLIQ,e.sinph0=Math.sin(e.lat0),e.cosph0=Math.cos(e.lat0)),e.pn1=e.h/e.a,e.pn1<=0||e.pn1>1e10)throw new Error("Invalid height");e.p=1+e.pn1,e.rp=1/e.p,e.h1=1/e.pn1,e.pfact=(e.p+1)*e.h1,e.es=0;var t=e.tilt,r=e.azi;e.cg=Math.cos(r),e.sg=Math.sin(r),e.cw=Math.cos(t),e.sw=Math.sin(t)}function IC(e,t){t.x-=e.long0;var r=Math.sin(t.y),n=Math.cos(t.y),i=Math.cos(t.x),o,s;switch(e.mode){case Kr.OBLIQ:s=e.sinph0*r+e.cosph0*n*i;break;case Kr.EQUIT:s=n*i;break;case Kr.S_POLE:s=-r;break;case Kr.N_POLE:s=r;break}switch(s=e.pn1/(e.p-s),o=s*n*Math.sin(t.x),e.mode){case Kr.OBLIQ:s*=e.cosph0*r-e.sinph0*n*i;break;case Kr.EQUIT:s*=r;break;case Kr.N_POLE:s*=-(n*i);break;case Kr.S_POLE:s*=n*i;break}var a,c;return a=s*e.cg+o*e.sg,c=1/(a*e.sw*e.h1+e.cw),o=(o*e.cg-s*e.sg)*e.cw*c,s=a*c,t.x=o*e.a,t.y=s*e.a,t}function PC(e,t){t.x/=e.a,t.y/=e.a;var r=t.x,n=t.y,i,o,s;s=1/(e.pn1-t.y*e.sw),i=e.pn1*t.x*s,o=e.pn1*t.y*e.cw*s,t.x=i*e.cg+o*e.sg,t.y=o*e.cg-i*e.sg;var a=tr(t.x,t.y);if(Math.abs(a)<1e-10)r=0,n=e.lat0;else{var c,l;switch(l=1-a*a*e.pfact,l=(e.p-Math.sqrt(l))/(e.pn1/a+a/e.pn1),c=Math.sqrt(1-l*l),e.mode){case Kr.OBLIQ:n=Math.asin(c*e.sinph0+t.y*l*e.cosph0/a),t.y=(c-e.sinph0*Math.sin(n))*a,t.x*=l*e.cosph0;break;case Kr.EQUIT:n=Math.asin(t.y*l/a),t.y=c*a,t.x*=l;break;case Kr.N_POLE:n=Math.asin(c),t.y=-t.y;break;case Kr.S_POLE:n=-Math.asin(c);break}r=Math.atan2(t.x,t.y)}return t.x=r+e.long0,t.y=n,t}function RC(e,t={}){let r={...e,mode:0,sinph0:0,cosph0:0,pn1:0,h:0,p:0,rp:0,h1:0,pfact:0,tilt:0,azi:0,cg:0,sg:0,cw:0,sw:0,...t};return lX(r),r}var Kr,LC=p(()=>{Ct();fc();Kr={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3}});var g_,OC=p(()=>{zs();qs();Ut();LC();Vt();g_={name:"tpers",aliases:["Tilted_Perspective"],parameters:["lon_0","x_0","y_0","lat_0","h","tilt","azi"],create(e){let t=Ae(e),r=re(e.parameters,"h",1e5),n=re(e.parameters,"tilt",0)*Math.PI/180,i=re(e.parameters,"azi",0)*Math.PI/180;if(Math.abs(n)>=Math.PI/2)throw new Error("Perspective tilt must be between -90 and 90 degrees");let o=RC(t,{h:r,tilt:n,azi:i}),s=1+r/t.a,a=Math.acos(1/s),c=Math.abs(n),l=s*Math.cos(c)<1?c-Math.acos(s*Math.cos(c)):a,u=Math.min(a,l)*(1-1e-10);return wn(Ie("tpers",e,o,IC,PC,Ha(t,1/(1+r/t.a))),t,u,(h,d)=>HT(kt(t,e),s,n,i,h,d),a)}}});function uX(e){e.R=e.a}function BC(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over),o,s;if(Math.abs(n)<=1e-10)return o=e.x0+e.R*i,s=e.y0,t.x=o,t.y=s,t;var a=sl(2*Math.abs(n/Math.PI));if(Math.abs(i)<=1e-10||Math.abs(Math.abs(n)-F)<=1e-10)return o=e.x0,n>=0?s=e.y0+Math.PI*e.R*Math.tan(.5*a):s=e.y0+Math.PI*e.R*-Math.tan(.5*a),t.x=o,t.y=s,t;var c=.5*Math.abs(Math.PI/i-i/Math.PI),l=c*c,u=Math.sin(a),h=Math.cos(a),d=h/(u-2*Math.sin(a/2)**2),m=d*d,g=d*(2/u-1),y=g*g,b=Math.sqrt(l*(d-y)*(d-y)-(y+l)*(m-y)),w=Math.PI*e.R*(y-m)/(b-c*(d-y));i<0&&(w=-w),o=e.x0+w;var _=l+d;return w=Math.PI*e.R*(l*(2*d-1)+m)/(g*_+c*Math.sqrt((y+l)*(l+1)-_*_)),n>=0?s=e.y0+w:s=e.y0-w,t.x=o,t.y=s,t}function CC(e,t){var r,n,i,o,s,a,c,l,u,h,d,m,g;return t.x-=e.x0,t.y-=e.y0,Math.abs(t.y)<1e-10?(t.x=k(e.long0+t.x/e.R,e.over),t.y=0,t):(d=Math.PI*e.R,i=t.x/d,o=t.y/d,s=i*i+o*o,a=-Math.abs(o)*(1+s),c=a-2*o*o+i*i,l=-2*a+1+2*o*o+s*s,g=o*o/l+(2*c*c*c/l/l/l-9*a*c/l/l)/27,u=(a-c*c/3/l)/l,h=2*Math.sqrt(-u/3),d=3*g/u/h,Math.abs(d)>1&&(d>=0?d=1:d=-1),m=Math.acos(d)/3,t.y>=0?n=(-h*Math.cos(m+Math.PI/3)-c/3/l)*Math.PI:n=-(-h*Math.cos(m+Math.PI/3)-c/3/l)*Math.PI,Math.abs(i)<1e-10?r=e.long0:r=k(e.long0+2*Math.PI*i/(Math.sqrt(1+2*(i*i-o*o)+s*s)+1-s),e.over),t.x=r,t.y=n,t)}function DC(e,t={}){let r={...e,R:0,...t};return uX(r),r}var NC=p(()=>{_t();Ct();c1()});var y_,FC=p(()=>{Bt();Qe();ut();Ut();NC();y_={name:"vandg",aliases:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=DC(t),n=Ie("vandg",e,r,BC,CC);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>pT(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function fX(e){let t=[["o_alpha","o_lon_c","o_lat_c"],["o_lat_p","o_lon_p"],["o_lon_1","o_lat_1","o_lon_2","o_lat_2"]],r=t.find(c=>c.some(l=>w_(e,l)));if(!r)throw new Error("Oblique transformation requires a rotation parameter set");for(let c of r){if(!w_(e,c))throw new Error("Oblique transformation requires "+c);if(c.includes("lat")&&Math.abs(Yi(e,c))>Math.PI/2)throw new Error("Invalid rotation latitude: "+c)}if(r===t[0]){let c=Yi(e,"o_alpha"),l=Yi(e,"o_lon_c"),u=Yi(e,"o_lat_c");if(Math.abs(u)>=Math.PI/2-1e-10)throw new Error("Rotation center must be away from the poles");return{lamp:l+Math.atan2(-Math.cos(c),-Math.sin(c)*Math.sin(u)),phip:Math.asin(Math.cos(u)*Math.sin(c))}}if(r===t[1])return{lamp:Yi(e,"o_lon_p"),phip:Yi(e,"o_lat_p")};let n=Yi(e,"o_lon_1"),i=Yi(e,"o_lat_1"),o=Yi(e,"o_lon_2"),s=Yi(e,"o_lat_2");if(Math.abs(i)>=Math.PI/2-1e-10||Math.abs(s)>=Math.PI/2-1e-10||Math.abs(i)<1e-10||Math.abs(i-s)<1e-10)throw new Error("Invalid new-equator reference points");let a=Math.atan2(Math.cos(i)*Math.sin(s)*Math.cos(n)-Math.sin(i)*Math.cos(s)*Math.cos(o),Math.sin(i)*Math.cos(s)*Math.sin(o)-Math.cos(i)*Math.sin(s)*Math.sin(n));return{lamp:a,phip:Math.atan(-Math.cos(a-n)/Math.tan(i))}}function p1(e){let t=e==="longlat";if(!t&&["obtran","geocent"].includes(b_(e.name)))throw new Error("Cannot wrap a composite or geocentric projection");return{name:"ob_tran",aliases:["General Oblique Transformation","General_Oblique_Transformation"],parameters:[...GC,"lon_0",...t?[]:e.parameters],flags:t?[]:e.flags,create(r){var P;let{parameters:n}=r,i=n.o_proj,o=t?["longlat","latlong","lonlat","latlon","identity"]:[e.name,...e.aliases||[]];if(i&&!o.map(b_).includes(b_(i)))throw new ai("missing-plugin","Oblique transformation dependency does not match +o_proj="+i);let{lamp:s,phip:a}=fX(n),c=Math.cos(a),l=Math.sin(a),u=Math.abs(a)>1e-10,h=Yi(n,"lon_0"),d=w_(n,"over"),m={...n,proj:t?"longlat":i||e.name,lon_0:"0"};for(let M of GC)delete m[M];let g=t?pi(M=>{M.x*=180/Math.PI,M.y*=180/Math.PI},M=>{M.x*=Math.PI/180,M.y*=Math.PI/180}):e.create({...r,parameters:Object.freeze(m),primeMeridian:0}),y=Wo(g,!1),b=Wo(g,!0),w=M=>Math.asin(Math.max(-1,Math.min(1,M))),_=M=>{let U=M.x,C=M.y,L=Xt(U-h,d),A=Math.cos(L),W=Math.sin(C),G=Math.cos(C),E=Xt(Math.atan2(G*Math.sin(L),u?l*G*A+c*W:W)+s),B=w(u?l*W-c*G*A:-G*A);M.x=E,M.y=B},S=M=>{let U=M.x,C=M.y,L=U-s,A=Math.cos(L),W=Math.sin(C),G=Math.cos(C),E=Math.atan2(G*Math.sin(L),u?l*G*A-c*W:-W),B=w(u?l*W+c*G*A:G*A);M.x=Xt(E+h),M.y=B},v=pi(M=>{_(M),y(M)},M=>{b(M),S(M)}),T=t?qa(m):(P=g.getRenderingProfile)==null?void 0:P.bind(g);if(!T)return v;let O=(M,U)=>{let C=U&&ur(()=>M.bounds,U,h,r.primeMeridian??0,d),L=Cs(A=>{var D;let W=A.x,G=A.y;_(A);let E=A.x*180/Math.PI,B=A.y*180/Math.PI,N={x:E,y:B,z:A.z};if((D=M.normalize)==null||D.call(M,N),N.x===E&&N.y===B){A.x=W,A.y=G;return}A.x=N.x*Math.PI/180,A.y=N.y*Math.PI/180,S(A),d&&(A.x+=Math.round((W-A.x)/(2*Math.PI))*2*Math.PI)},r.primeMeridian??0);return{get bounds(){let A=M.bounds,W=G=>[G[0]*180/Math.PI,G[1]*180/Math.PI,G[2]];return t?[W(A[0]),W(A[1])]:A},normalize(A){C==null||C.normalize(A),L(A)}}};return{...v,longitudeOrigin:h,getRenderingProfile(M){if(!M)return O(T());let U=Bs(M,r.primeMeridian??0,h),C=Q(U[0][0]-h,U[0][1],U[1][0]-h,U[1][1]),L=dt(u?[-c,0,l]:[-1,0,0],C),A=u?[l,0,c]:[0,0,1],G=dt(A,C)[0]>0?js([0,1,0],A,0,C).map(Math.atan):[-Math.PI,Math.PI];return O(T(Gn(Q(G[0]+s,w(L[0]),G[1]+s,w(L[1])))),M)}}}}}var GC,b_,w_,Yi,kC=p(()=>{lc();Vh();Vt();cc();za();ut();Qe();dc();GC=["o_proj","o_alpha","o_lon_c","o_lat_c","o_lon_p","o_lat_p","o_lon_1","o_lat_1","o_lon_2","o_lat_2"],b_=e=>e.toLowerCase().replace(/[ _-]/g,""),w_=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Yi=(e,t)=>re(e,t,0)*Math.PI/180});function Rt(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Expected a CRS object");return e}function Zh(e){return Array.isArray(e)?e:[]}function Xr(e){return String(e||"").toLowerCase().replace(/[^a-z0-9]/g,"")}function Or(e){if(typeof e!="number"||!Number.isFinite(e))throw new Error("Expected a finite CRS parameter");return e}function Bn(e,t){if(e===void 0)return t;if(typeof e=="object"){let i=Or(Rt(e).conversion_factor);if(i<=0)throw new Error("Unit conversion factor must be positive");return i}let n={metre:1,meter:1,degree:At,radian:1,grad:Math.PI/200,gon:Math.PI/200,foot:.3048,ussurveyfoot:1200/3937,kilometre:1e3,arcsecond:At/3600,partspermillion:1e-6,unity:1}[Xr(e)];return n||Ue("Unsupported CRS unit: "+String(e)),n}function ll(e,t){var M,U,C;let r=String(e.type),n=gX(e.bbox);if(r==="CompoundCRS"){t.mode!=="horizontal"&&Ue("CompoundCRS requires explicit horizontal extraction");let L=Zh(e.components).map(Rt).filter(W=>["ProjectedCRS","GeographicCRS","GeodeticCRS","BoundCRS"].includes(String(W.type)));if(L.length!==1)throw new Error("CompoundCRS requires exactly one horizontal component");let A=ll(L[0],t);return{...A,areaOfUse:n??A.areaOfUse,lossy:!0}}if(r==="BoundCRS"){let L=ll(Rt(e.source_crs),t),A=ll(Rt(e.target_crs),t);(A.parameters.datum!=="WGS84"||!["longlat","geocent"].includes(A.parameters.proj)||Number(A.parameters.pm||0)!==0||A.parameters.towgs84||Number(A.parameters.a)!==6378137||!(Math.abs(Number(A.parameters.rf)-298.257223563)<=1e-9||Math.abs(Number(A.parameters.b)-6356752314245179e-9)<=1e-6))&&Ue("BoundCRS requires a WGS84 target");let W=Rt(e.transformation),G=Xr(Rt(W.method).name),E=G==="geocentrictranslations"||/^geocentrictranslationsgeog[23]ddomain$/.test(G),B=/^positionvector(?:transformation)?(?:geog[23]ddomain|geocentricdomain)?$/.test(G),N=/^coordinateframe(?:rotation)?(?:geog[23]ddomain|geocentricdomain)?$/.test(G);!E&&!B&&!N&&Ue("Unsupported BoundCRS transformation: "+G);let D=["xaxistranslation","yaxistranslation","zaxistranslation","xaxisrotation","yaxisrotation","zaxisrotation","scaledifference"],R=new Array(E?3:7).fill(void 0);for(let j of Zh(W.parameters)){let we=Rt(j),_e=D.indexOf(Xr(we.name));(_e<0||_e>=R.length||R[_e]!==void 0)&&Ue("Unsupported or duplicate Helmert parameter: "+String(we.name));let ne=_e<3?1:_e<6?At/3600:1e-6;R[_e]=Or(we.value)*Bn(we.unit,ne)/ne*(N&&_e>=3&&_e<6?-1:1)}if(R.some(j=>j===void 0))throw new Error("Incomplete BoundCRS Helmert transformation");let I={...L.parameters,towgs84:R.join(",")};return delete I.datum,{...L,parameters:I,areaOfUse:n??L.areaOfUse}}["ProjectedCRS","GeographicCRS","GeodeticCRS"].includes(r)||Ue("Unsupported CRS type: "+r);let i=r==="ProjectedCRS"?Rt(e.base_crs):e,o=Rt(i.datum||i.datum_ensemble);(o.type==="DynamicGeodeticReferenceFrame"||o.frame_reference_epoch!==void 0||e.coordinate_epoch!==void 0)&&Ue("Time-dependent datum transformations are not implemented");let s=Rt(o.ellipsoid),a=Or(s.semi_major_axis??s.radius),c={proj:"longlat",a:String(a*Bn(s.unit,1))};if(s.inverse_flattening!==void 0)c.rf=String(Or(s.inverse_flattening));else if(s.semi_minor_axis!==void 0)c.b=String(Or(s.semi_minor_axis)*Bn(s.unit,1));else if(s.radius!==void 0)c.b=c.a;else throw new Error("Ellipsoid requires inverse flattening or semi-minor axis");let l=Nu(t),u=String(o.name||""),h=Xr(u),d=Object.keys(l),m=d.find(L=>ol(L)===ol(u)),g=m?[m]:d.filter(L=>Xr(L)===h||Xr(L)===h.replace(/^d/,"")),y=g[0],b=l[y];if(b&&g.some(L=>{let A=l[L];return A.ellipse!==b.ellipse||A.towgs84!==b.towgs84||A.nadgrids!==b.nadgrids}))throw new Error("Ambiguous structured datum name: "+u);if(h&&(c.datum=y||u),y&&ol(y)==="wgs84"&&(c.datum="WGS84"),y&&["nad83","northamericandatum1983"].includes(ol(y))&&(c.datum="NAD83"),!y){["wgs84","worldgeodeticsystem1984","worldgeodeticsystem1984ensemble","dwgs1984","wgs1984"].includes(h)&&(c.datum="WGS84"),["nad83","northamericandatum1983","dnorthamerican1983"].includes(h)&&(c.datum="NAD83"),["nad27","northamericandatum1927","dnorthamerican1927"].includes(h)&&(c.datum="NAD27");let A={newzealand1949:"nzgd49",belge1972:"rnb72"}[h.replace(/^d/,"")];A&&(c.datum=A)}if(r==="ProjectedCRS"&&i.id){let L=Rt(i.id),A=String(L.authority)+"_"+String(L.code);Object.prototype.hasOwnProperty.call(l,A)&&(c.datum=A)}o.towgs84!==void 0&&(c.towgs84=Zh(o.towgs84).map(Or).join(","),delete c.datum);let w=e.coordinate_system?Rt(e.coordinate_system):{},_=Zh(w.axis).map(Rt),S=Xr(w.subtype)==="cartesian"&&r==="GeodeticCRS";r!=="ProjectedCRS"&&!S&&w.subtype&&Xr(w.subtype)!=="ellipsoidal"&&Ue("Unsupported coordinate system subtype"),S&&(c.proj="geocent");let v=Bn(i.angular_unit,At),T=Bn((M=_[0])==null?void 0:M.unit,r==="ProjectedCRS"||S?1:v);_[1]&&Bn(_[1].unit,T)!==T&&Ue("Mixed horizontal axis units are not supported"),S&&_[2]&&Bn(_[2].unit,T)!==T&&Ue("Mixed geocentric axis units are not supported");let O=i.prime_meridian||o.prime_meridian;if(O){let L=Rt(O);c.pm=String(Or(L.longitude)*Bn(L.unit,v)/At)}if(r==="ProjectedCRS"){let L=Rt(e.conversion),A=Xr(Rt(L.method).name),W=Zh(L.parameters).map(Rt),G=A==="stereographicnorthpole"&&!W.some(D=>Xr(D.name).startsWith("scalefactor")),E=G?"stere":hX[A],B=W.filter(D=>["xscale","yscale","xyplanerotation"].includes(Xr(D.name)));if(B.length){let D={xscale:-1,yscale:1,xyplanerotation:90};(E!=="krovak"||B.length!==3||new Set(B.map(R=>Xr(R.name))).size!==3||B.some(R=>{let I=Xr(R.name),j=I==="xyplanerotation"?Bn(R.unit,v)/At:Bn(R.unit,1);return Math.abs(Or(R.value)*j-D[I])>1e-10}))&&Ue("Unsupported ESRI Krovak axis adjustment")}(!E||E.startsWith("unsupported"))&&Ue("Unsupported projection method: "+String(Rt(L.method).name)),c.proj=E==="webmerc"?"merc":E;let N=!1;for(let D of W){let R=Xr(D.name);if(B.includes(D)||R==="auxiliaryspheretype"&&E==="webmerc"&&D.value===0)continue;if(R==="semiminor"&&E==="webmerc"){if(N)throw new Error("Duplicate conversion parameter: semi_minor");N=!0;let ne=Or(D.value)*Bn(D.unit,1);Math.abs(ne-Number(c.a))>4*Number.EPSILON*Number(c.a)&&Ue("Pseudo-Mercator semi_minor must equal the semi-major axis");continue}let I=((U=mX[E])==null?void 0:U[R])||dX[R];if(I||Ue("Unsupported conversion parameter: "+String(D.name)),I==="lat_1"&&A==="stereographicnorthpole"&&!G?I="lat_0":I==="lat_1"&&["merc","webmerc","eqc","stere","cea"].includes(E)&&(I="lat_ts"),c[I]!==void 0)throw new Error("Duplicate conversion parameter: "+I);if(["merc","webmerc"].includes(E)&&I==="lat_0"&&D.value===0)continue;let j=I.startsWith("lat")||I.startsWith("lon")||I==="alpha"||I==="gamma",we=I==="x_0"||I==="y_0",_e=Or(D.value)*Bn(D.unit,j?v:we?T:1)/(j?At:1);I.startsWith("lat")&&Math.abs(Math.abs(_e)-90)<=4*Number.EPSILON*90&&(_e=Math.sign(_e)*90),c[I]=String(_e)}if(E==="omerc"&&["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(A)&&(c.no_uoff=void 0),E==="omerc"&&c.lon_0!==void 0&&c.lonc!==void 0&&(Math.abs(Number(c.lon_0)-Number(c.lonc))>1e-10&&Ue("Oblique Mercator central meridian conflicts with projection centre"),delete c.lon_0),A==="stereographicnorthpole"&&Math.abs(Number(c.lat_0))===90&&(c.proj="stere"),E==="lcc"&&c.lat_1===void 0&&(c.lat_1=c.lat_0),A==="polarstereographic"&&c.lat_0!==void 0){if(c.lat_ts!==void 0)throw new Error("Duplicate polar stereographic latitude of true scale");c.lat_ts=c.lat_0,delete c.lat_0}E==="stere"&&(A.includes("polar")||A==="stereographicsouthpole"||G)&&c.lat_0===void 0&&(c.lat_0=Number(c.lat_ts||90)<0?"-90":"90"),E==="webmerc"&&(c.b=c.a,delete c.rf,c.nadgrids="@null")}let P=_.map(L=>yX(L,c,r==="ProjectedCRS")).join("");return P.length===2&&(P+="u"),!S&&/[ud]/.test(P.slice(0,2))&&Ue("Structured CRS vertical-first axes require an explicit PROJ axis definition"),P&&(c.axis=P),(r==="ProjectedCRS"||S)&&(c.to_meter=String(T)),{parameters:c,areaOfUse:n,angularUnit:r==="ProjectedCRS"||S?v:T,verticalUnit:S?1:Bn((C=_[2])==null?void 0:C.unit,1)}}function gX(e){let t;if(e!==void 0){let r=Rt(e),n=Or(r.west_longitude),i=Or(r.south_latitude),o=Or(r.east_longitude),s=Or(r.north_latitude);if(n<-180||n>180||o<-180||o>180||i<-90||s>90||i>=s||n===o)throw new Error("Invalid CRS geographic bounding box");t=[n,i,o,s]}return t}function yX(e,t,r){var a;let n=String(e.direction),i=e.meridian,o=/^(north|south) along ([+-]?(?:\d+(?:\.\d*)?|\.\d+)) deg(?: (east|west))?$/i.exec(n);if(o){if(i!==void 0)throw new Error("Duplicate axis meridian");n=o[1],i={longitude:Number(o[2])*(((a=o[3])==null?void 0:a.toLowerCase())==="west"?-1:1)}}if(i!==void 0){let c=Number(t.lat_0),l=c===90;(!r||t.proj!=="stere"||Math.abs(c)!==90||Xr(n)!==(l?"south":"north"))&&Ue("Axis meridians require an outward-facing polar stereographic axis");let u=Rt(i).longitude,h=typeof u=="number"?Or(u):Or(Rt(u).value)*Bn(Rt(u).unit,At)/At,d=Or((h-Number(t.lon_0||0))/90);Math.abs(d-Math.round(d))>1e-12&&Ue("Non-cardinal axis meridians require an orientation operation");let m=(Math.round(d)%4+4)%4;return(l?"senw":"nesw")[m]}let s=pX[Xr(n)];return s||Ue("Unsupported axis direction: "+n),s}var hX,dX,mX,pX,x_=p(()=>{K0();Vt();za();hX={hotineobliquemercator:"omerc",hotineobliquemercatorvarianta:"omerc",hotineobliquemercatorvariantb:"omerc",hotineobliquemercatorazimuthnaturalorigin:"omerc",hotineobliquemercatorazimuthcenter:"omerc",obliquemercator:"omerc",krovak:"krovak",krovaknorthorientated:"krovak",quadrilateralizedsphericalcube:"qsc",transversemercator:"tmerc",transversemercatorsouthorientated:"unsupported-south-tmerc",mercator:"merc",mercator1sp:"merc",mercator2sp:"merc",mercatorvarianta:"merc",mercatorvariantb:"merc",mercatorauxiliarysphere:"webmerc",popularvisualisationpseudomercator:"webmerc",lambertconformalconic:"lcc",lambertconformalconic1sp:"lcc",lambertconformalconic2sp:"lcc",lambertconicconformal1sp:"lcc",lambertconicconformal2sp:"lcc",albers:"aea",albersconicequalarea:"aea",albersequalarea:"aea",equidistantconic:"eqdc",lambertazimuthalequalarea:"laea",stereographic:"stere",stereographicnorthpole:"sterea",stereographicsouthpole:"stere",polarstereographic:"stere",polarstereographicvarianta:"stere",polarstereographicvariantb:"stere",obliquestereographic:"sterea",doublestereographic:"sterea",azimuthalequidistant:"aeqd",modifiedazimuthalequidistant:"aeqd",equidistantcylindrical:"eqc",equidistantcylindricalspherical:"eqc",equirectangular:"eqc",platecarree:"eqc",bonne:"bonne",cassinisoldner:"cass",cassini:"cass",cylindricalequalarea:"cea",lambertcylindricalequalarea:"cea",eckertvi:"eck6",equalearth:"eqearth",millercylindrical:"mill",mollweide:"moll",robinson:"robin",sinusoidal:"sinu",vandergrinten:"vandg",vandergrinteni:"vandg",gnomonic:"gnom",orthographic:"ortho",polyconic:"poly",americanpolyconic:"poly",newzealandmapgrid:"nzmg",gaussschreibertransversemercator:"gstmerc"},dX={centralmeridian:"lon_0",longitudeoforigin:"lon_0",longitudeofcenter:"lon_0",longitudeofnaturalorigin:"lon_0",longitudeoffalseorigin:"lon_0",longitudeofprojectioncentre:"lon_0",straightverticalpolelongitude:"lon_0",longitudeoforiginmeridian:"lon_0",latitudeoforigin:"lat_0",latitudeofcenter:"lat_0",latitudeofnaturalorigin:"lat_0",latitudeoffalseorigin:"lat_0",latitudeofprojectioncentre:"lat_0",standardparallel1:"lat_1",latitudeof1ststandardparallel:"lat_1",standardparallel2:"lat_2",latitudeof2ndstandardparallel:"lat_2",latitudeofstandardparallel:"lat_ts",scalefactor:"k_0",scalefactoratnaturalorigin:"k_0",scalefactoratprojectionorigin:"k_0",falseeasting:"x_0",falsenorthing:"y_0",eastingatfalseorigin:"x_0",northingatfalseorigin:"y_0"},mX={omerc:{longitudeofcenter:"lonc",longitudeofprojectioncentre:"lonc",azimuth:"alpha",azimuthatprojectioncentre:"alpha",rectifiedgridangle:"gamma",anglefromrectifiedtoskewgrid:"gamma",scalefactoratprojectioncentre:"k_0",eastingatprojectioncentre:"x_0",northingatprojectioncentre:"y_0"},krovak:{azimuth:"alpha",colatitudeofconeaxis:"alpha",pseudostandardparallel1:"lat_ts",latitudeofpseudostandardparallel:"lat_ts",scalefactoronpseudostandardparallel:"k_0"}},pX={east:"e",west:"w",north:"n",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"}});function g1(e,...t){return e.values.filter(r=>r.type==="node"&&t.includes(r.keyword.toUpperCase()))}function vt(e,...t){return g1(e,...t)[0]}function wt(e,t=0){let r=e.values[t];return r&&r.type!=="node"?r.value:void 0}function ul(e){return e?{name:wt(e),conversion_factor:wt(e,1)}:void 0}function bX(e,t){let r=wt(e,1);if(t&&String(r).toLowerCase()==="unknown"){let n=String(wt(e)).toLowerCase(),i=/^(easting|northing|westing|southing)(?:\s*\([a-z]\))?$/.exec(n);if(i)return{easting:"east",northing:"north",westing:"west",southing:"south"}[i[1]]}return r}function wX(e){let t=vt(e,"MERIDIAN");if(t)return{longitude:{value:wt(t),unit:ul(vt(t,"ANGLEUNIT"))}}}function UC(e){let t=vt(e,"METHOD","PROJECTION");if(!t)throw new Error("WKT conversion requires a METHOD or PROJECTION");return vt(e,"PARAMETERFILE")&&Ue("Grid-based WKT operation is not implemented"),{method:{name:wt(t)},parameters:g1(e,"PARAMETER").map(r=>({name:wt(r),value:wt(r,1),unit:ul(vt(r,"ANGLEUNIT","LENGTHUNIT","SCALEUNIT"))}))}}function Jh(e){let t=e.keyword.toUpperCase();if(t==="COMPD_CS"||t==="COMPOUNDCRS")return{type:"CompoundCRS",components:g1(e,"PROJCS","PROJCRS","GEOGCS","GEOGCRS","GEODCRS","BOUNDCRS","VERT_CS","VERTCRS").map(Jh)};if(t==="BOUNDCRS"){let d=vt(e,"SOURCECRS"),m=vt(e,"TARGETCRS"),g=vt(e,"ABRIDGEDTRANSFORMATION");if(!d||!m||!g)throw new Error("Incomplete WKT BoundCRS");let y=_=>{let S=_.values.find(v=>v.type==="node");if(!S)throw new Error("Missing bound CRS component");return S},b=UC(g),w=b.parameters;for(let _ of w)String(_.name).toLowerCase()==="scale difference"&&_.unit===void 0&&(_.value=(Number(_.value)-1)*1e6);return{type:"BoundCRS",source_crs:Jh(y(d)),target_crs:Jh(y(m)),transformation:b}}if(["VERT_CS","VERTCRS"].includes(t))return{type:"VerticalCRS"};let r=["PROJCS","PROJCRS","PROJECTEDCRS"].includes(t),n=["GEOGCS","GEOGCRS","GEODCRS","GEODETICCRS","GEOGRAPHICCRS","BASEGEOGCRS","BASEGEODCRS","GEOCCS"].includes(t);!r&&!n&&Ue("Unsupported WKT CRS: "+t),vt(e,"DYNAMIC","DERIVINGCONVERSION","VELOCITYGRID","EXTENSION")&&Ue("Unsupported WKT dynamic/extension operation");let i=vt(e,"CS"),o=t==="GEOCCS"||String(wt(i||e)).toLowerCase()==="cartesian"&&!r,s=vt(e,r||o?"LENGTHUNIT":"ANGLEUNIT","UNIT"),a=g1(e,"AXIS").sort((d,m)=>Number(wt(vt(d,"ORDER")||d))-Number(wt(vt(m,"ORDER")||m))).map((d,m)=>({name:wt(d),direction:t==="GEOCCS"?["geocentricX","geocentricY","geocentricZ"][m]:bX(d,r),unit:ul(vt(d,"ANGLEUNIT","LENGTHUNIT")||(!o&&!r&&/^(up|down)$/i.test(String(wt(d,1)))?void 0:s)),meridian:wX(d)}));if(!a.length)for(let d of o?["geocentricX","geocentricY","geocentricZ"]:["east","north"])a.push({name:d,direction:d,unit:ul(s),meridian:void 0});let c=t==="GEOGCS"?void 0:vt(e,"ID"),l={type:r?"ProjectedCRS":o?"GeodeticCRS":"GeographicCRS",name:wt(e),id:c?{authority:wt(c),code:wt(c,1)}:void 0,coordinate_system:{subtype:r||o?"Cartesian":"ellipsoidal",axis:a}},u=vt(e,"USAGE"),h=vt(u||e,"BBOX");if(h&&(l.bbox={south_latitude:wt(h,0),west_longitude:wt(h,1),north_latitude:wt(h,2),east_longitude:wt(h,3)}),r){let d=vt(e,"GEOGCS","BASEGEOGCRS","BASEGEODCRS","GEODCRS","GEOGCRS");if(!d)throw new Error("Projected WKT requires a base geographic CRS");l.base_crs=Jh(d),l.conversion=UC(vt(e,"CONVERSION")||e)}else{let d=vt(e,"DATUM","GEODETICDATUM","ENSEMBLE");if(!d)throw new Error("WKT requires a geodetic datum");vt(d,"EXTENSION","DYNAMIC")&&Ue("Unsupported datum extension");let m=vt(d,"SPHEROID","ELLIPSOID");if(!m)throw new Error("WKT datum requires an ellipsoid");let g=vt(d,"TOWGS84");l.datum={name:wt(d),ellipsoid:{name:wt(m),semi_major_axis:wt(m,1),inverse_flattening:wt(m,2),unit:ul(vt(m,"LENGTHUNIT"))},towgs84:g==null?void 0:g.values.map((b,w)=>wt(g,w))};let y=vt(e,"PRIMEM");y&&(l.prime_meridian={name:wt(y),longitude:wt(y,1),unit:ul(vt(y,"ANGLEUNIT")||(o?void 0:s))}),l.angular_unit=o?void 0:ul(s)}return l}var __,jC=p(()=>{Dl();ry();za();x_();__={name:"wkt",canParse:e=>wr(e)==="wkt",parse(e,t){if(typeof e!="string")throw new Error("Expected serialized WKT");return ll(Jh(_f(e).root),t)}}});var S_,zC=p(()=>{Dl();x_();S_={name:"projjson",canParse:e=>wr(e)==="projjson",parse:(e,t)=>ll(Rt(e),t)}});var q3e,V3e,W3e,qC=p(()=>{q3e=new Float64Array(0),V3e=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,W3e={deg:Math.PI/180,rad:1,m:1,ft:.3048,"us-ft":1200/3937}});var M_=p(()=>{PL();RL();LL();NL();jL();HL();ZL();QT();aO();pO();$y();zT();gO();IO();OO();FO();qO();YO();tB();cB();yB();vB();PB();CB();UB();WB();YB();tC();cC();dC();_C();SC();AC();OC();FC();kC();jC();zC();qC()});var y1,VC,WC=p(()=>{y1={ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clrk80ign",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-0.008393,0.000749,-0.010276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"372.87,149.23,585.29"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"},EPSG_10328:{towgs84:"0,0,0"},EPSG_9782:{towgs84:"0,0,0"},EPSG_9777:{towgs84:"0,0,0"},EPSG_10690:{towgs84:"0,0,0"},EPSG_10639:{towgs84:"0,0,0"},EPSG_10739:{towgs84:"0,0,0"},EPSG_7686:{towgs84:"0,0,0"},EPSG_8900:{towgs84:"0,0,0"},EPSG_5886:{towgs84:"0,0,0"},EPSG_7683:{towgs84:"0,0,0"},EPSG_6668:{towgs84:"0,0,0"},EPSG_20046:{towgs84:"0,0,0"},EPSG_10299:{towgs84:"0,0,0"},EPSG_10310:{towgs84:"0,0,0"},EPSG_10475:{towgs84:"0,0,0"},EPSG_4742:{towgs84:"0,0,0"},EPSG_10671:{towgs84:"0,0,0"},EPSG_10762:{towgs84:"0,0,0"},EPSG_10725:{towgs84:"0,0,0"},EPSG_10791:{towgs84:"0,0,0"},EPSG_10800:{towgs84:"0,0,0"},EPSG_10305:{towgs84:"0,0,0"},EPSG_10941:{towgs84:"0,0,0"},EPSG_10968:{towgs84:"0,0,0"},EPSG_10875:{towgs84:"0,0,0"},EPSG_6318:{towgs84:"0,0,0"},EPSG_10910:{towgs84:"0,0,0"}};for(let e in y1){let t=y1[e];t.datumName&&(y1[t.datumName]=t)}VC=y1});var HC,$C=p(()=>{WC();HC=Object.freeze({name:"regional-datums",datums:Object.freeze(VC)})});function xX(e){return{...e,parse(t,r){let n=e.parse(t,r),i=n.parameters.datum,o=s=>s.toLowerCase().replace(/[\s_-]/g,"");if(i&&!Object.keys(Nu(r)).some(s=>o(s)===o(i))){let s={...n.parameters};return delete s.datum,{...n,parameters:s}}return n}}}function SX(){if(b1)return b1;let e=[Ex,Tx,Ax,Px,Rx,Cx,Zy,Dx,kx,Wy,Hy,Ky,Ux,zx,Hx,$x,Xx,Jx,Qx,e_,t_,i_,o_,s_,a_,c_,l_,u_,f_,h_,d_,m_,p_,g_,y_],t=i=>i.toLowerCase().replace(/[\s_-]/g,""),r=p1("longlat"),n={name:r.name,aliases:r.aliases,parameters:[...new Set([...r.parameters,...e.flatMap(i=>i.parameters)])],flags:[...new Set(e.flatMap(i=>i.flags||[]))],create(i){let o=i.parameters.o_proj;if(!o)throw new Error("Oblique transformation requires +o_proj");let s=["longlat","latlong","latlon","lonlat","identity"].includes(t(o))?"longlat":e.find(l=>[l.name,...l.aliases||[]].some(u=>t(u)===t(o)));if(!s)throw new Error("Unknown oblique transformation projection: "+o);let a=p1(s),c=new Set([...X0,...a.parameters]);for(let l of Object.keys(i.parameters))if(!c.has(l))throw new Error("Unsupported PROJ parameter: +"+l);return a.create(i)}};return b1=[...e,n],b1}var _X,b1,Ku,MX,KC=p(()=>{IL();$C();K0();M_();Fu();_X=[__,S_].map(xX);Ku=class extends i1{constructor(t={}){super({...t,projections:t.projections??SX(),parsers:t.parsers??_X,datumCatalogs:t.datumCatalogs??[HC]}),this.useDefinitionSignature=!$h(t)}},MX=new Ku});var XC=p(()=>{M_();KC()});function YC(){return EX}function ZC(e){return vX.get(e)}var vX,EX,JC=p(()=>{"use strict";XC();vX=new Map,EX=new Ku});function TX(e,t,r){let n=[];for(let i=0;i<3;i++){let o=t.slice(),s=t.slice();o[i]+=r,s[i]-=r;let a=e.transformPosition(o),c=e.transformPosition(s);n.push([(a[0]-c[0])/(2*r),(a[1]-c[1])/(2*r),(a[2]-c[2])/(2*r)])}return n}function AX(e,t){let[r,n,i]=e,o=r[0]*(n[1]*i[2]-n[2]*i[1])-n[0]*(r[1]*i[2]-r[2]*i[1])+i[0]*(r[1]*n[2]-r[2]*n[1]);return!Number.isFinite(o)||Math.abs(o)<1e-15?t:[[n[1]*i[2]-n[2]*i[1],r[2]*i[1]-r[1]*i[2],r[1]*n[2]-r[2]*n[1]],[n[2]*i[0]-n[0]*i[2],r[0]*i[2]-r[2]*i[0],r[2]*n[0]-r[0]*n[2]],[n[0]*i[1]-n[1]*i[0],r[1]*i[0]-r[0]*i[1],r[0]*n[1]-r[1]*n[0]]].map(a=>(a[0]*t[0]+a[1]*t[1]+a[2]*t[2])/o)}function Qh(e){if(!e)throw new Error("Cannot construct a projection because the CRS is unknown");if(typeof e!="string"&&e.type==="CompoundCRS"){let t=e.components.filter(r=>r.type!=="VerticalCRS");if(t.length!==1)throw new Error("CompoundCRS requires exactly one horizontal component");return Qh(t[0])}return e}function IX(e){if(e.outputCoordinates==="local-enu")throw new Error("local-enu output requires a dataset-derived local origin and must be created by a tileset source");if(e.outputCoordinates==="target-crs"&&!e.targetCrs)throw new Error("target-crs output requires targetCrs");if(!e.sourceCrs&&e.status==="unresolved")throw new Error("Cannot transform coordinates because the source CRS is unknown");if(Xu(e)&&e.heightReference==="unknown")throw new Error("Cannot convert heights because the source height reference is unknown");if(e.coordinateFrame==="geocentric"&&!v_(e.sourceCrs))throw new Error("Only EPSG:4978 geocentric coordinates are supported by the current spatial transformer");if(e.status==="unresolved")throw new Error("The requested spatial output cannot be resolved from the available metadata")}function v_(e){return typeof e=="string"&&Uh(e)===q0}function QC(e){if(typeof e!="string")return!1;let t=Uh(e);return t===Du||t==="EPSG:4979"||t==="OGC:CRS84"}function Xu(e){let t=e.targetHeightReference;return t!=="native"&&t!==e.heightReference}function PX(e){return typeof e=="string"?ZC(e):e}function RX(e,t,r,n){if(r===n||n==="native")return e;if(r==="orthometric"&&n==="ellipsoidal")return e+t;if(r==="ellipsoidal"&&n==="orthometric")return e-t;throw new Error(`Unsupported height conversion from ${r} to ${n}`)}var fl,E_=p(()=>{"use strict";Fn();Nf();CR();JC();ax();cx();fl=class{spatialReference;horizontalProjection;horizontalProjectionBuffer;geographicProjection;heightOutputProjection;sourceIsGeocentric;outputIsGeocentric;sourceIsGeographic;outputIsGeographic;geoid;constructor(t,r={}){this.spatialReference=t;let n=YC();IX(t);let i=t.targetCrs||t.sourceCrs;if(this.sourceIsGeocentric=v_(t.sourceCrs),this.outputIsGeocentric=v_(i),this.sourceIsGeographic=QC(t.sourceCrs),this.outputIsGeographic=QC(i),t.sourceCrs&&t.targetCrs&&!this.sourceIsGeocentric&&!this.outputIsGeocentric&&(this.horizontalProjection=n.createProjection({from:Qh(t.sourceCrs),to:Qh(t.targetCrs),enforceAxis:!1}),Xu(t)||(this.horizontalProjectionBuffer=new H0({projection:this.horizontalProjection,dimension:3}))),(Xu(t)||this.sourceIsGeocentric||this.outputIsGeocentric)&&(!this.sourceIsGeographic&&!this.sourceIsGeocentric&&(this.geographicProjection=n.createProjection({from:Qh(t.sourceCrs),to:Du,enforceAxis:!1})),!this.outputIsGeographic&&!this.outputIsGeocentric&&(this.heightOutputProjection=n.createProjection({from:Du,to:Qh(i),enforceAxis:!1}))),Xu(t)&&(this.geoid=PX(r.geoidModel),!this.geoid)){let o=typeof r.geoidModel=="string"?` "${r.geoidModel}"`:"";throw new Error(`Height conversion requires a registered geoid model${o}; call registerGeoidModel() or pass a parsed Geoid instance`)}}transformPosition(t){if(t.length<2)throw new Error("A spatial coordinate must contain at least x and y components");let r=[...t];if(Xu(this.spatialReference)||this.sourceIsGeocentric||this.outputIsGeocentric){if(r.length<3||!Number.isFinite(r[2]))throw new Error("Three-dimensional CRS conversion requires a finite z coordinate");let n=this.toGeographic(r);if(Xu(this.spatialReference)){let o=this.geoid.getHeight(n[1],n[0]);n[2]=RX(n[2],o,this.spatialReference.heightReference,this.spatialReference.targetHeightReference)}let i=this.fromGeographic(n);return r.splice(0,i.length,...i),r}if(this.horizontalProjection){let n=this.horizontalProjection.projectSync(r.slice(0,3));r.splice(0,n.length,...n)}return r}transformPositions(t){if(t.length%3!==0)throw new Error("Packed spatial positions must contain a multiple of three components");let r=new Float64Array(t.length);if(this.horizontalProjectionBuffer&&(r.set(t),r.every(Number.isFinite)))return this.horizontalProjectionBuffer.projectFlatTo(r,r);for(let n=0;n<t.length;n+=3){let i=this.transformPosition([Number(t[n]),Number(t[n+1]),Number(t[n+2])]);r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2]}return r}transformNormals(t,r){if(t.length!==r.length||t.length%3!==0)throw new Error("Spatial normals and positions must have matching xyz component counts");let n=new Float32Array(t.length),i=1e-5;for(let o=0;o<t.length;o+=3){let s=[Number(r[o]),Number(r[o+1]),Number(r[o+2])],a=[Number(t[o]),Number(t[o+1]),Number(t[o+2])],c=TX(this,s,i),l=AX(c,a),u=Math.hypot(...l);u>0&&Number.isFinite(u)?(n[o]=l[0]/u,n[o+1]=l[1]/u,n[o+2]=l[2]/u):(n[o]=a[0],n[o+1]=a[1],n[o+2]=a[2])}return n}toGeographic(t){return this.sourceIsGeocentric?Array.from(Tt.WGS84.cartesianToCartographic(new J(t))):this.sourceIsGeographic?t.slice(0,3):this.geographicProjection.projectSync(t.slice(0,3))}fromGeographic(t){return this.outputIsGeocentric?Array.from(Tt.WGS84.cartographicToCartesian(new J(t))):this.outputIsGeographic?t.slice(0,3):this.heightOutputProjection.projectSync(t.slice(0,3))}}});function LX(e,t){return e==="relativeToScene"?t.sceneElevationProvider:Yu(e)?t.terrainElevationProvider:void 0}function Yu(e){return e==="onTheGround"||e==="relativeToGround"||e==="relativeToScene"}function T_(e){if(e.length%3!==0)throw new Error("I3S position arrays must contain complete XYZ tuples");let t=[];for(let r=0;r<e.length;r+=3)t.push([e[r],e[r+1],e[r+2]]);return t}function OX(e){let t=Ka(e);return{west:t[0]*180/Math.PI,south:t[1]*180/Math.PI,east:t[2]*180/Math.PI,north:t[3]*180/Math.PI}}function eD(e){if(!e.length)throw new Error("I3S spatial transformation requires at least one bound sample");let t=e.map(o=>Tt.WGS84.cartographicToCartesian(new J(o))),r=new J;for(let o of t)r.add(o);r.scale(1/t.length);let n=0;for(let o of t)n=Math.max(n,new J(o).subtract(r).magnitude());let i=Tt.WGS84.cartesianToCartographic(r);return[i[0],i[1],i[2],n]}function tD(e,t,r,n){let i=e.obb;if(i){let c=Array.from(i.center).slice(0,3);c[2]*=n;let l=Array.from(i.halfSize).slice(0,3),u=new Ef().fromArray(Array.from(i.quaternion)),h=[new J([l[0],0,0]).transformByQuaternion(u),new J([0,l[1],0]).transformByQuaternion(u),new J([0,0,l[2]]).transformByQuaternion(u)];if(t==="geographic"){let d=r.transformPosition(c),m=Tt.WGS84.cartographicToCartesian(new J(d)),g=e.normalReferenceFrame==="vertex-reference-frame"?h.map(y=>iD(y,d)):h;return rD().map(y=>{let b=new J(m);for(let w=0;w<3;w++)b.add(new J(g[w]).scale(y[w]));return Array.from(Tt.WGS84.cartesianToCartographic(b))})}return rD().map(d=>{let m=new J(c);for(let g=0;g<3;g++)m.add(new J(h[g]).scale(d[g]));return Array.from(m)})}let o=e.mbs?Array.from(e.mbs):[];if(o.length<4)return[];let s=o.slice(0,3);s[2]*=n;let a=o[3];if(t==="geographic"){let c=r.transformPosition(s),l=Tt.WGS84.cartographicToCartesian(new J(c));return nD().map(u=>Array.from(Tt.WGS84.cartesianToCartographic(new J(l).add(new J(u).scale(a)))))}return nD().map(c=>Array.from(new J(s).add(new J(c).scale(a))))}function rD(){return[-1,1].flatMap(e=>[-1,1].flatMap(t=>[-1,1].map(r=>[e,t,r])))}function nD(){return[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]]}function BX(){return[new J([1,0,0]),new J([0,1,0]),new J([0,0,1])]}function iD(e,t){let r=t[0]*Math.PI/180,n=t[1]*Math.PI/180,i=new J([-Math.sin(r),Math.cos(r),0]),o=new J([-Math.sin(n)*Math.cos(r),-Math.sin(n)*Math.sin(r),Math.cos(n)]),s=new J([Math.cos(n)*Math.cos(r),Math.cos(n)*Math.sin(r),Math.sin(n)]);return i.scale(e[0]).add(o.scale(e[1])).add(s.scale(e[2]))}function CX(e,t){let r=t[0]*Math.PI/180,n=t[1]*Math.PI/180,i=new J([-Math.sin(r),Math.cos(r),0]),o=new J([-Math.sin(n)*Math.cos(r),-Math.sin(n)*Math.sin(r),Math.cos(n)]),s=new J([Math.cos(n)*Math.cos(r),Math.cos(n)*Math.sin(r),Math.sin(n)]);return new J([i.dot(e),o.dot(e),s.dot(e)])}function hl(e){let t=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(let o of e)for(let s=0;s<3;s++)t[s]=Math.min(t[s],o[s]),r[s]=Math.max(r[s],o[s]);let n=t.map((o,s)=>(o+r[s])/2),i=t.map((o,s)=>(r[s]-o)/2);return[n[0],n[1],n[2],i[0],0,0,0,i[1],0,0,0,i[2]]}function Ka(e){let t=e[0][0],r=1/0,n=-1/0,i=1/0,o=-1/0,s=1/0,a=-1/0;for(let c of e){let l=t+A_(c[0]-t);r=Math.min(r,l),n=Math.max(n,l),i=Math.min(i,c[1]),o=Math.max(o,c[1]),s=Math.min(s,c[2]),a=Math.max(a,c[2])}return[A_(r)*Math.PI/180,i*Math.PI/180,A_(n)*Math.PI/180,o*Math.PI/180,s,a]}function A_(e){return((e+180)%360+360)%360-180}var ed,oD=p(()=>{"use strict";Fn();Nf();E_();PR();LR();ed=class{spatialReference;targetCoordinateFrame;positionTransformer;sourceToGeographicTransformer;geographicToTargetTransformer;sourceCoordinateFrame;sourceVerticalUnitScale;elevationMode;elevationOffset;elevationProvider;providerUnitScale;providerHeightTransformer;constructor(t,r={}){var a;if(t.status!=="transformable"&&t.status!=="transformed")throw new Error("I3SSpatialTransformer requires a requested, transformable spatial output");let n=t.targetCrs||t.sourceCrs;if(!n)throw new Error("I3S spatial transformation requires a target CRS");if(this.positionTransformer=new fl(t,r),this.sourceCoordinateFrame=t.coordinateFrame,this.sourceVerticalUnitScale=t.verticalUnitScale,this.elevationMode=t.elevationMode,this.elevationOffset=(t.elevationOffset||0)*t.elevationUnitScale,this.elevationProvider=LX(this.elevationMode,r),this.elevationProvider&&(typeof this.elevationProvider.sampleElevations!="function"||typeof this.elevationProvider.getElevationRange!="function"))throw new Error("An I3S elevation provider must implement sampleElevations() and getElevationRange()");let i=RR(((a=this.elevationProvider)==null?void 0:a.unit)||"meter");if(this.elevationProvider&&i===void 0)throw new Error(`Unsupported elevation-provider unit ${this.elevationProvider.unit}`);this.providerUnitScale=i||1,this.targetCoordinateFrame=Po(n),this.spatialReference=IR(t);let o=V0({sourceCrs:t.sourceCrs,heightReference:t.heightReference,coordinateFrame:t.coordinateFrame,axisOrder:t.axisOrder,provenance:t.provenance},{targetCrs:"EPSG:4326"});if(this.sourceToGeographicTransformer=new fl(o),Yu(this.elevationMode)){if(!this.elevationProvider){let l=this.elevationMode==="relativeToScene"?"scene":"terrain";throw new Error(`I3S elevation mode ${this.elevationMode} requires a ${l} elevation provider`)}if(t.heightReference==="unknown")throw new Error(`I3S elevation mode ${this.elevationMode} requires a known source height reference`);let c=this.elevationProvider.heightReference||t.heightReference;if(c!==t.heightReference){if(t.heightReference!=="ellipsoidal"&&t.heightReference!=="orthometric")throw new Error("Converting elevation-provider heights requires an ellipsoidal or orthometric source height reference");let l=V0({sourceCrs:"EPSG:4326",heightReference:c,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"caller-override"},{targetCrs:"EPSG:4326",targetHeightReference:t.heightReference,geoidModel:r.geoidModel});this.providerHeightTransformer=new fl(l,r)}}let s=V0({sourceCrs:"EPSG:4326",heightReference:t.heightReference,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"format-default"},{targetCrs:n,targetHeightReference:t.targetHeightReference,geoidModel:r.geoidModel});this.geographicToTargetTransformer=new fl(s,r)}transformPosition(t){let r=this.placeSourcePositionsSync(t),n=this.positionTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}async transformPositionAsync(t){let r=await this.placeSourcePositions(t),n=this.positionTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}transformPlacedPosition(t){let r=this.positionTransformer.transformPosition([t[0],t[1],t[2]]);return[r[0],r[1],r[2]]}transformSourcePositionToGeographic(t){let r=this.placeSourcePositionsSync(t),n=this.sourceToGeographicTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}async transformSourcePositionToGeographicAsync(t){let r=await this.placeSourcePositions(t),n=this.sourceToGeographicTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}transformPositions(t,r){let n=this.placeSourcePositionsSync(t),i=this.placeSourcePositionsSync(r);return this.transformPlacedPositions(n,i)}async transformPositionsAsync(t,r){let n=new Float64Array(t.length+3);n.set(Array.from(t),0),n.set(Array.from(r).slice(0,3),t.length);let i=await this.placeSourcePositions(n);return this.transformPlacedPositions(i.subarray(0,t.length),i.subarray(t.length))}async transformGeometryAsync(t,r,n="earth-centered"){if(t.length%3||r&&r.length!==t.length)throw new Error("Conversion positions and normals must contain matching finite xyz triples");for(let o=0;o<t.length;o++)if(!Number.isFinite(t[o])||r&&!Number.isFinite(r[o]))throw new Error("Conversion positions and normals must contain matching finite xyz triples");if(!["earth-centered","vertex-reference-frame"].includes(n))throw new Error("Unsupported I3S normal reference frame");let i=await this.placeSourcePositions(t);return{positions:this.positionTransformer.transformPositions(i),normals:r?this.transformNormals(r,i,n):void 0}}transformPlacedPositions(t,r){let n=this.transformPlacedPosition(r),i=new Float32Array(t.length),o=Float64Array.from(t);for(let c=0;c<t.length;c+=3){let l=this.transformPlacedPosition([t[c],t[c+1],t[c+2]]);i[c]=l[0]-n[0],i[c+1]=l[1]-n[1],i[c+2]=l[2]-n[2]}let s=this.targetCoordinateFrame==="geographic",a=s?new yn:new yn().translate(n);return{positions:i,sourcePositions:o,origin:n,cartographicOrigin:s?n:[0,0,0],coordinateSystem:s?"lnglat-offsets":"cartesian",modelMatrix:a}}transformNormals(t,r,n="earth-centered"){if(t.length!==r.length||t.length%3)throw new Error("I3S normals and positions must have matching xyz component counts");let i=new Float32Array(t.length);if(n==="earth-centered"&&(this.spatialReference.targetCrs||this.spatialReference.sourceCrs)==="EPSG:4978"){for(let o=0;o<t.length;o+=3){let s=Math.hypot(t[o],t[o+1],t[o+2]);for(let a=0;a<3;a++)i[o+a]=s?t[o+a]/s:t[o+a]}return i}for(let o=0;o<t.length;o+=3){let s=this.sourceToGeographicTransformer.transformPosition([r[o],r[o+1],r[o+2]]),a=new J([t[o],t[o+1],t[o+2]]).normalize(),c=n==="earth-centered"?a:iD(a,s),l=this.transformEcefNormal(c,s);i.set(l,o)}return i}transformBoundingVolume(t){let n=this.getGeographicBoundSamples(t).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:Ka(n)}:{box:hl(n)}}async transformBoundingVolumeAsync(t){let n=(await this.getGeographicBoundSamplesAsync(t)).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:Ka(n)}:{box:hl(n)}}transformBoundingVolumeToGeographic(t){return{region:Ka(this.getGeographicBoundSamples(t))}}async transformBoundingVolumeToGeographicAsync(t){return{region:Ka(await this.getGeographicBoundSamplesAsync(t))}}transformBoundingVolumeToGeocentric(t){let r=this.getGeographicBoundSamples(t).map(n=>Array.from(Tt.WGS84.cartographicToCartesian(new J(n))));return{box:hl(r)}}async transformBoundingVolumeToGeocentricAsync(t){let r=(await this.getGeographicBoundSamplesAsync(t)).map(n=>Array.from(Tt.WGS84.cartographicToCartesian(new J(n))));return{box:hl(r)}}transformBoundingSphereToGeographic(t){var s,a;let r=(s=t.mbs)!=null&&s.length?Array.from(t.mbs).slice(0,3):t.obb?Array.from(t.obb.center).slice(0,3):null;if(!r)throw new Error("I3S spatial transformation requires an MBS or OBB bound");let n=this.placeSourcePositionsSync(r),i=this.sourceToGeographicTransformer.transformPosition(Array.from(n)),o=(a=t.mbs)!=null&&a.length?t.mbs[3]:Math.hypot(...Array.from(t.obb.halfSize).slice(0,3));return[i[0],i[1],i[2],o]}async transformBoundingSphereToGeographicAsync(t){return eD(await this.getGeographicBoundSamplesAsync(t))}async transformBoundsAsync(t){let r=await this.getGeographicBoundSamplesAsync(t),n=r.map(o=>Array.from(Tt.WGS84.cartographicToCartesian(new J(o)))),i=r.map(o=>this.geographicToTargetTransformer.transformPosition(o));return{boundingVolume:{box:hl(n)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:Ka(i)}:{box:hl(i)},i3sLodMbs:Yu(this.elevationMode)?eD(r):this.transformBoundingSphereToGeographic(t)}}async transformPointCloudBoundsAsync(t){let r=await this.getGeographicBoundSamplesAsync(t),n=r.map(i=>this.geographicToTargetTransformer.transformPosition(i));return{boundingVolume:{region:Ka(r)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:Ka(n)}:{box:hl(n)}}}getGeographicBoundSamples(t){let r=tD(t,this.sourceCoordinateFrame,this.sourceToGeographicTransformer,this.sourceVerticalUnitScale);if(!r.length)throw new Error("I3S spatial transformation requires an MBS or OBB bound");let n=this.placeSourcePositionsSync(r.flat(),!0),i=T_(n);return this.sourceCoordinateFrame==="geographic"?i:i.map(o=>this.sourceToGeographicTransformer.transformPosition(o))}async getGeographicBoundSamplesAsync(t){let r=tD(t,this.sourceCoordinateFrame,this.sourceToGeographicTransformer,this.sourceVerticalUnitScale);if(!r.length)throw new Error("I3S spatial transformation requires an MBS or OBB bound");if(Yu(this.elevationMode)){let i=this.sourceCoordinateFrame==="geographic"?r:r.map(o=>this.sourceToGeographicTransformer.transformPosition(o));return await this.placeGeographicBoundSamples(i)}let n=T_(await this.placeSourcePositions(r.flat(),!0));return this.sourceCoordinateFrame==="geographic"?n:n.map(i=>this.sourceToGeographicTransformer.transformPosition(i))}async placeGeographicBoundSamples(t){let n=await this.elevationProvider.getElevationRange(OX(t)),i=n.minimum*this.providerUnitScale,o=n.maximum*this.providerUnitScale;if(!Number.isFinite(i)||!Number.isFinite(o)||i>o)throw new Error("Elevation provider returned an invalid range; minimum and maximum must be finite and ordered");let s=t.map(u=>u[2]),a=Math.min(...s),c=Math.max(...s),l=[];for(let[u,h]of t){let d=this.providerHeightTransformer?this.providerHeightTransformer.transformPosition([u,h,i])[2]:i,m=this.providerHeightTransformer?this.providerHeightTransformer.transformPosition([u,h,o])[2]:o,g=Math.min(d,m),y=Math.max(d,m),b=this.elevationMode==="onTheGround"?g:g+a+this.elevationOffset,w=this.elevationMode==="onTheGround"?y:y+c+this.elevationOffset;l.push([u,h,b],[u,h,w])}return l}placeSourcePositionsSync(t,r=!1){if(Yu(this.elevationMode))throw new Error(`I3S elevation mode ${this.elevationMode} requires asynchronous surface placement`);let n=Float64Array.from(t),i=this.elevationMode==="absoluteHeight"?this.elevationOffset:0;for(let o=2;o<n.length;o+=3)n[o]=n[o]*(r?1:this.sourceVerticalUnitScale)+i;return n}async placeSourcePositions(t,r=!1){if(!Yu(this.elevationMode))return this.placeSourcePositionsSync(t,r);let n=Float64Array.from(t),i=T_(n).map(s=>{let a=this.sourceToGeographicTransformer.transformPosition(s);return[a[0],a[1]]}),o=await this.elevationProvider.sampleElevations(i);if(o.length!==i.length)throw new Error(`Elevation provider returned ${o.length} heights for ${i.length} positions`);for(let s=0;s<i.length;s++){let a=o[s]*this.providerUnitScale;if(!Number.isFinite(a))throw new Error(`Elevation provider returned a non-finite height at index ${s}`);let[c,l]=i[s],u=this.providerHeightTransformer?this.providerHeightTransformer.transformPosition([c,l,a])[2]:a,h=n[s*3+2]*(r?1:this.sourceVerticalUnitScale);n[s*3+2]=this.elevationMode==="onTheGround"?u:u+h+this.elevationOffset}return n}transformEcefNormal(t,r){if(this.targetCoordinateFrame==="geocentric")return t.normalize();if(this.targetCoordinateFrame==="geographic")return CX(t,r).normalize();let n=Tt.WGS84.cartographicToCartesian(new J(r)),i=[];for(let s of BX()){let a=Tt.WGS84.cartesianToCartographic(new J(n).add(s)),c=Tt.WGS84.cartesianToCartographic(new J(n).subtract(s)),l=this.geographicToTargetTransformer.transformPosition(a),u=this.geographicToTargetTransformer.transformPosition(c);i.push((l[0]-u[0])/2,(l[1]-u[1])/2,(l[2]-u[2])/2)}let o=new sc(i);if(Math.abs(o.determinant())<1e-12)throw new Error("Cannot transform an I3S normal through a singular local projection");return o.invert().transpose(),new J(t).transformByMatrix3(o).normalize()}}});var sD=p(()=>{"use strict";E_();oD()});function aD(e,t=null){return I_(e,t?{token:t}:void 0)}function I_(e,t){if(!t||Object.keys(t).length===0||/^(?:data|blob):/i.test(e))return e;let r=e.indexOf("#"),n=r>=0?e.slice(r):"",i=r>=0?e.slice(0,r):e,o=i.indexOf("?"),s=o>=0?i.slice(0,o):i,a=o>=0?i.slice(o+1):"",c=new URLSearchParams(a),l=new URLSearchParams;for(let[h,d]of Object.entries(t))c.has(h)||l.set(h,String(d));let u=l.toString();return`${s}${o>=0?`?${a}`:""}${u?`${o>=0?"&":"?"}${u}`:""}${n}`}var cD=p(()=>{"use strict"});function P_(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}`)}}function Zu(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 lD,w1,R_=p(()=>{"use strict";hT();lD={UInt8:Ls.UNSIGNED_BYTE,UInt16:Ls.UNSIGNED_SHORT,Float32:Ls.FLOAT,UInt32:Ls.UNSIGNED_INT,UInt64:Ls.DOUBLE};w1={DEFAULT:"default",LNGLAT:"lnglat",METER_OFFSETS:"meter-offsets",LNGLAT_OFFSETS:"lnglat-offsets",CARTESIAN:"cartesian"}});function O_(e,t){if(!e)throw new Error(`parseI3STileContent requires LoaderContext to ${t}. Nested I3S parsing must run through parseFromContext().`);return e}function DX(e){switch(e){case"ktx-etc2":case"dds":return Ko;case"ktx2":return ho;default:return $o}}async function mD(e,t,r,n,i){var h,d;let o=((h=n==null?void 0:n.i3s)==null?void 0:h.geometryMode)??"render";if(o!=="render"&&o!=="source")throw new Error("Unsupported I3S geometry mode");let s={geometryMode:o,attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new yn,coordinateSystem:"meter-offsets",byteLength:0,texture:null,topology:t.layerType==="Point"?"point-list":"triangle-list",pointRenderer:t.pointRenderer,pointSymbol:t.pointSymbol},a=i?O_(i,"parse nested resources"):null,c=(d=t.textureUrls)!=null&&d.length?t.textureUrls:t.textureUrl?[{textureSetDefinitionId:eY(t.materialDefinition),textureUrl:t.textureUrl,textureFormat:t.textureFormat||"jpg"}]:[],l={};for(let m of c)try{let g=await FX(m.textureUrl,m.textureFormat,t,n,a||i);g&&(l[m.textureSetDefinitionId]=g)}catch(g){console.warn(g)}let u=Object.values(l)[0]||null;return s.texture=u,Object.keys(l).length>0&&(s.textures=l),s.material=ZX(t.materialDefinition,l,u),s.material&&(s.texture=null),await GX(e,s,t,r,n,i)}async function FX(e,t,r,n,i){var m;let o=n==null?void 0:n.i3s,s=I_(aD(e,o==null?void 0:o.token),n==null?void 0:n.searchParams),a=DX(t),l=await((i==null?void 0:i.fetch)||fetch)(s);if(!l.ok)throw new Error(`Failed to load I3S texture: ${l.status} ${l.statusText}`);let u=await l.arrayBuffer();if(!((m=n==null?void 0:n.i3s)!=null&&m.decodeTextures))return u;let h=O_(i,"decode texture payloads");if(a===$o){let g={...r.textureLoaderOptions};try{let y=await Pl(u,$o,g,h);return km(y)}catch{let b=await Pl(u,a,g,h);return km(b)}}let d=await Pl(u,a,r.textureLoaderOptions,h);return a===ho&&(d=d[0]),{compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}async function GX(e,t,r,n,i,o){var m,g,y,b,w,_;let s=e.byteLength,a,c,l=0,u=0,h;if(r.isDracoGeometry){let S=O_(o,"decode Draco geometry"),v=await Pl(e,Ti,{draco:{shape:"mesh",attributeNameEntry:NX}},S);c=((m=v.header)==null?void 0:m.vertexCount)??0,h=(g=v.indices)==null?void 0:g.value;let{POSITION:T,NORMAL:O,COLOR_0:P,["feature-index"]:M,["uv-region"]:U}=v.attributes;if(a={position:T,normal:O,color:P,uvRegion:U,id:M},UX(a,v.attributes),t.geometryMode==="source")for(let[L,A]of Object.entries(v.attributes))!["POSITION","NORMAL","COLOR_0","feature-index","uv-region"].includes(L)&&!/^TEXCOORD_\d+$/.test(L)&&(a[L]=A);VX(a,v);let C=nY(M);C&&(rY(a,C),t.drawRanges=qX(a.id.value,h,t.topology))}else{let S=n.store.defaultGeometrySchema;if(!S)throw new Error("Uncompressed I3S geometry requires store.defaultGeometrySchema");let{vertexAttributes:v,ordering:T,featureAttributes:O,featureAttributeOrder:P}=S,M=HX(e,S);l=M.byteOffset,c=M.vertexCount,u=M.featureCount;let{attributes:U,byteOffset:C}=fD(e,l,v,c,T),{attributes:L,byteOffset:A}=fD(e,C,O,u,P),W=kX(e,A);W&&(t.meshSegmentation=W),t.drawRanges=zX(L),tY(L),a=WX(U,L)}let d=n.spatialReference;if(t.geometryMode==="source"){if(a.position.size!==3||a.position.transform||a.position.normalized||(a.position.byteStride??0)!==0||(a.position.byteOffset??0)!==0||a.position.value.length!==c*3||r.mbs.length<3||r.mbs.slice(0,3).some(v=>!Number.isFinite(v)))throw new Error("Source I3S geometry requires packed xyz values and a finite source origin");let S=L_(a.position.value,a.position.metadata,r.mbs);if(S.some(v=>!Number.isFinite(v)))throw new Error("Source I3S positions must be finite");a.position={value:S,size:3},t.origin=[0,0,0],t.cartographicOrigin=[0,0,0],t.coordinateSystem=d!=null&&d.sourceCrs&&Po(d.sourceCrs)==="geographic"?"lnglat":"cartesian",t.spatialReference=d?Object.freeze({...d,status:"native",targetCrs:void 0,targetHeightReference:"native",outputCoordinates:"auto"}):void 0,t.normalReferenceFrame=n.store.normalReferenceFrame||"earth-centered",t.sourceAttributes=a}else if((d==null?void 0:d.status)==="transformable"||(d==null?void 0:d.status)==="transformed"){let S=new ed(d,n.spatialOptions||((y=i==null?void 0:i.i3s)==null?void 0:y.spatial)),v=L_(a.position.value,a.position.metadata,r.mbs),T=await S.transformPositionsAsync(v,r.mbs);a.position.value=T.positions,(b=a.normal)!=null&&b.value&&(a.normal.value=S.transformNormals(a.normal.value,T.sourcePositions,n.store.normalReferenceFrame)),t.modelMatrix=T.modelMatrix,t.coordinateSystem=T.coordinateSystem,t.origin=T.origin,t.cartographicOrigin=T.cartographicOrigin,t.spatialReference=S.spatialReference}else if(!((w=i==null?void 0:i.i3s)!=null&&w.coordinateSystem)||i.i3s.coordinateSystem===w1.METER_OFFSETS){let S=KX(a.position,r);t.modelMatrix=S.invert(),t.coordinateSystem="meter-offsets"}else t.modelMatrix=YX(a.position),t.coordinateSystem="lnglat-offsets";t.attributes={positions:a.position,normals:a.normal,colors:uD(a.color,((_=i==null?void 0:i.i3s)==null?void 0:_.colorFormat)||"uint8norm"),uvRegions:uD(a.uvRegion||a.region)},jX(t.attributes,a),t.indices=h||null,a.id&&a.id.value&&(t.featureIds=a.id.value);for(let S in t.attributes)t.attributes[S]||delete t.attributes[S];return t.vertexCount=c,t.byteLength=s,t}function kX(e,t){return t<e.byteLength?e.slice(t):void 0}function UX(e,t){for(let[r,n]of Object.entries(t)){let i=/^TEXCOORD_(\d+)$/.exec(r);i&&(e[`uv${Number(i[1])}`]=n)}}function jX(e,t){for(let[r,n]of Object.entries(t)){let i=/^uv(\d+)$/.exec(r);if(!i||!n)continue;let o=Number(i[1]);e[o===0?"texCoords":`texCoords${o}`]=n}}function zX(e){var o,s;let t=(o=e.id)==null?void 0:o.value,r=(s=e.faceRange)==null?void 0:s.value;if(!t||!r)return;let n=[],i=Math.min(t.length,Math.floor(r.length/2));for(let a=0;a<i;a++){let c=Number(r[a*2]),l=Number(r[a*2+1]);if(l<c)continue;let u=l-c+1;n.push({featureId:Number(t[a]),firstPrimitive:c,primitiveCount:u,firstVertex:c*3,vertexCount:u*3})}return n.length?n:void 0}function qX(e,t,r){let n=r==="point-list"?1:3,i=(t==null?void 0:t.length)||e.length,o=Math.floor(i/n);if(!o)return;let s=[];for(let a=0;a<o;a++){let c=a*n,l=t?Number(t[c]):c,u=Number(e[l]),h=s[s.length-1];(h==null?void 0:h.featureId)===u?(h.primitiveCount++,h.vertexCount+=n):s.push({featureId:u,firstPrimitive:a,primitiveCount:1,firstVertex:c,vertexCount:n})}return s}function VX(e,t){for(let r in t.loaderData.attributes){let n=t.loaderData.attributes[r];switch(n.name){case"POSITION":e.position.metadata=n.metadata;break;case"feature-index":e.id.metadata=n.metadata;break;default:break}}}function WX(e,t){return{...e,...t}}function uD(e,t="uint8norm"){return e&&(t==="float16"&&!e.componentType?{...e,value:ex(e.value,255),normalized:!1,componentType:"float16"}:t==="float32"&&!e.componentType?{...e,value:Float32Array.from(e.value,r=>r/255),normalized:!1}:{...e,normalized:!0})}function HX(e,t){let r=0,n=0,i=0;for(let{property:o,type:s}of t.header){let a=P_(s);switch(o){case"vertexCount".toString():n=new a(e,0,4)[0],r+=Zu(s);break;case"featureCount".toString():i=new a(e,4,4)[0],r+=Zu(s);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function fD(e,t,r,n,i){let o={};for(let s of i)if(r[s]){let{valueType:a,valuesPerElement:c}=r[s];if(t+n*c*Zu(a)<=e.byteLength){let l=e.slice(t),u;if(a==="UInt64")u=$X(l,n*c,Zu(a));else{let h=P_(a);u=new h(l,0,n*c)}o[s]={value:u,type:lD[a],size:c},s==="color"&&(o.color.normalized=!0),t=t+n*c*Zu(a)}else if(s!=="uv0")break}return{attributes:o,byteOffset:t}}function $X(e,t,r){let n=[],i=new DataView(e),o=0;for(let s=0;s<t;s++){let a=i.getUint32(o,!0),c=i.getUint32(o+4,!0),l=a+2**32*c;n.push(l),o+=r}return new Float64Array(n)}function KX(e,t){let r=t.mbs,n=e.value,i=e.metadata,o=new yn,s=new J(r[0],r[1],r[2]),a=new J;return Tt.WGS84.cartographicToCartesian(s,a),Ny(Tt.WGS84,a,o),e.value=XX(n,i,s),o}function L_(e,t={},r){var s,a;let n=new Float64Array(e.length),i=((s=t["i3s-scale_x"])==null?void 0:s.double)??1,o=((a=t["i3s-scale_y"])==null?void 0:a.double)??1;for(let c=0;c<n.length;c+=3)n[c]=e[c]*i+r[0],n[c+1]=e[c+1]*o+r[1],n[c+2]=e[c+2]+r[2];return n}function XX(e,t={},r){let n=L_(e,t,r);for(let i=0;i<n.length;i+=3)Tt.WGS84.cartographicToCartesian(n.subarray(i,i+3),x1),n[i]=x1.x,n[i+1]=x1.y,n[i+2]=x1.z;return n}function YX(e){var o,s;let t=e.metadata,r=((o=t==null?void 0:t["i3s-scale_x"])==null?void 0:o.double)||1,n=((s=t==null?void 0:t["i3s-scale_y"])==null?void 0:s.double)||1,i=new yn;return i[0]=r,i[5]=n,i}function ZX(e,t={},r){var o;let n=[e==null?void 0:e.emissiveFactor,(o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.baseColorFactor].some(s=>s==null?void 0:s.some(a=>a>1))?255:1,i;return e?i={...e,normalTexture:e.normalTexture?{...e.normalTexture}:void 0,occlusionTexture:e.occlusionTexture?{...e.occlusionTexture}:void 0,emissiveTexture:e.emissiveTexture?{...e.emissiveTexture}:void 0,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness,baseColorTexture:e.pbrMetallicRoughness.baseColorTexture?{...e.pbrMetallicRoughness.baseColorTexture}:void 0,metallicRoughnessTexture:e.pbrMetallicRoughness.metallicRoughnessTexture?{...e.pbrMetallicRoughness.metallicRoughnessTexture}:void 0}:{baseColorFactor:[n,n,n,n]}}:(i={pbrMetallicRoughness:{}},r?i.pbrMetallicRoughness.baseColorTexture={texCoord:0,textureSetDefinitionId:0}:i.pbrMetallicRoughness.baseColorFactor=[n,n,n,n]),i.alphaCutoff=i.alphaCutoff??.25,i.alphaMode&&(i.alphaMode=i.alphaMode.toUpperCase()),i.emissiveFactor&&(i.emissiveFactor=hD(i.emissiveFactor,n)),i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorFactor&&(i.pbrMetallicRoughness.baseColorFactor=hD(i.pbrMetallicRoughness.baseColorFactor,n)),Object.keys(t).length>0?QX(i,t):r&&JX(i,r),i}function hD(e,t){let r=[...e];for(let n=0;n<e.length;n++){let i=e[n]/t;r[n]=n<3?i<=.04045?i/12.92:((i+.055)/1.055)**2.4:i}return r}function JX(e,t){if(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture){let r=e.pbrMetallicRoughness.baseColorTexture;e.pbrMetallicRoughness.baseColorTexture={...r,texture:Ju(t,r)}}else if(e.emissiveTexture){let r=e.emissiveTexture;e.emissiveTexture={...r,texture:Ju(t,r)}}else if(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture){let r=e.pbrMetallicRoughness.metallicRoughnessTexture;e.pbrMetallicRoughness.metallicRoughnessTexture={...r,texture:Ju(t,r)}}else if(e.normalTexture){let r=e.normalTexture;e.normalTexture={...r,texture:Ju(t,r)}}else if(e.occlusionTexture){let r=e.occlusionTexture;e.occlusionTexture={...r,texture:Ju(t,r)}}}function QX(e,t){var n,i;let r=[(n=e.pbrMetallicRoughness)==null?void 0:n.baseColorTexture,(i=e.pbrMetallicRoughness)==null?void 0:i.metallicRoughnessTexture,e.normalTexture,e.occlusionTexture,e.emissiveTexture];for(let o of r){if(!o)continue;let s=t[o.textureSetDefinitionId];s&&(o.texture=Ju(s,o))}}function Ju(e,t){let r=dD(t.wrapS),n=dD(t.wrapT),i=r||n?{wrapS:r||10497,wrapT:n||10497}:void 0;return i?{source:{image:e},sampler:i}:{source:{image:e}}}function dD(e){switch(e){case"none":return 33071;case"mirror":return 33648;case"repeat":return 10497;default:return}}function eY(e){var t,r,n,i,o,s,a;return((r=(t=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:t.baseColorTexture)==null?void 0:r.textureSetDefinitionId)??((i=(n=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:n.metallicRoughnessTexture)==null?void 0:i.textureSetDefinitionId)??((o=e==null?void 0:e.normalTexture)==null?void 0:o.textureSetDefinitionId)??((s=e==null?void 0:e.occlusionTexture)==null?void 0:s.textureSetDefinitionId)??((a=e==null?void 0:e.emissiveTexture)==null?void 0:a.textureSetDefinitionId)??0}function tY(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let n=t.value,i=r.value,o=i[i.length-1]+1,s=new Float64Array(o*3),a=0,c=0;for(let l=1;l<i.length;l+=2){let u=Number(n[a]),h=i[l],d=i[l-1],m=h-d+1,g=c+m*3;s.fill(u,c,g),a++,c=g}e.id.value=s}function rY(e,t){let r=e.id.value,n=new Float64Array(r.length);for(let i=0;i<r.length;i++)n[i]=t[r[i]];e.id.value=n}function nY(e){var t,r;return(r=(t=e==null?void 0:e.metadata)==null?void 0:t["i3s-feature-ids"])==null?void 0:r.intArray}var x1,NX,pD=p(()=>{"use strict";Ch();Fn();Nf();Nf();Vs();zf();sx();zf();sD();cD();R_();x1=new J([0,0,0]);NX="i3s-attribute-type"});var _1,B_,IEe,gD,PEe,REe,LEe,OEe,BEe,yD=p(()=>{"use strict";_1=(e,t,r,n)=>({name:e,id:t,module:"tiles-3d",encoding:"binary",format:r,extensions:n,mimeTypes:["application/octet-stream"],binary:!0}),B_=(e,t,r)=>({name:e,id:t,module:"tiles-3d",encoding:"json",format:r,extensions:["json"],mimeTypes:["application/json"],text:!0}),IEe=_1("I3S","i3s","i3s",["bin"]),gD=_1("I3S Content","i3s-content","i3s-content",["bin"]),PEe=_1("I3S Attribute","i3s-attribute","i3s-attribute",["bin"]),REe=_1("I3S LEPCC","i3s-lepcc","i3s-lepcc",["bin"]),LEe=B_("I3S Node Page","i3s-node-page","i3s-node-page"),OEe=B_("ArcGIS Web Scene","arcgis-web-scene","arcgis-web-scene"),BEe=B_("I3S Building Scene Layer","i3s-building-scene-layer","i3s-building-scene-layer")});var bD,wD=p(()=>{"use strict";R_();bD={token:void 0,isTileset:"auto",isTileHeader:"auto",tile:void 0,tileset:void 0,_tileOptions:void 0,_tilesetOptions:void 0,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,attributeValues:"legacy",colorFormat:"uint8norm",geometryMode:"render",coordinateSystem:w1.METER_OFFSETS}});var iY,xD,_D=p(()=>{"use strict";yD();wD();iY="5.0.0-beta.4",xD={...gD,dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"tiles-3d",worker:!0,workerSourceNode:"i3s/workers/i3s-content-worker-node.ts",version:iY,mimeTypes:["application/octet-stream"],preload:async()=>(await Promise.resolve().then(()=>(C_(),SD))).I3SContentLoaderWithParser,extensions:["bin"],options:{i3s:bD,"i3s-content":{}}}});var SD={};Jt(SD,{I3SContentLoaderWithParser:()=>D_});async function sY(e,t,r){let{tile:n,_tileOptions:i,tileset:o,_tilesetOptions:s}=(t==null?void 0:t.i3s)||{},a=i||n,c=s||o;return!a||!c?null:await mD(e,a,c,t,r)}var WEe,oY,D_,C_=p(()=>{"use strict";zf();sx();zf();pD();_D();({preload:WEe,...oY}=xD),D_={...oY,subloaders:{ImageLoader:$o,DracoLoader:Ti,BasisLoader:ho,CompressedTextureLoader:Ko},parse:sY}});var U_=typeof process!="object"||String(process)!=="[object process]"||process.browser;var j_={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"]=j_||{};function Te(e,t,r){return t<=e&&e<=r}function PD(e,t){return e.indexOf(t)!==-1}var Oo=Math.floor;function fd(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function RD(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var o=t.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===r-1)i.push(65533);else{var s=t.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=o&1023,c=s&1023;i.push(65536+(a<<10)+c),n+=1}else i.push(65533)}n+=1}return i}function LD(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return t}function ui(e){return 0<=e&&e<=127}var li=ui,Ye=-1;function G1(e){this.tokens=[].slice.call(e),this.tokens.reverse()}G1.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Ye},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};var gt=-1;function Xe(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Ii(e){throw TypeError("The code point "+e+" could not be encoded.")}function OD(){}OD.prototype={handler:function(e,t){}};function BD(){}BD.prototype={handler:function(e,t){}};function N1(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(F1,e)?F1[e]:null}var z_=[{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"}],F1={};z_.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){F1[r]=t})})});var mn={},pn={};function pl(e,t){return t&&t[e]||null}function gl(e,t){var r=t.indexOf(e);return r===-1?null:r}function Zr(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 CD(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Zr("gb18030-ranges"),i;for(i=0;i<n.length;++i){var o=n[i];if(o[0]<=e)t=o[0],r=o[1];else break}return r+e-t}function DD(e){if(e===59335)return 7457;var t=0,r=0,n=Zr("gb18030-ranges"),i;for(i=0;i<n.length;++i){var o=n[i];if(o[1]<=e)t=o[1],r=o[0];else break}return r+e-t}function ND(e){C1=C1||Zr("jis0208").map(function(r,n){return Te(n,8272,8835)?null:r});var t=C1;return t.indexOf(e)}var C1;function FD(e){D1=D1||Zr("big5").map(function(r,n){return n<5024?null:r});var t=D1;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):gl(e,t)}var D1,q_="utf-8";function Ya(e,t){if(!(this instanceof Ya))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):q_,t=fd(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=N1(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!pn[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var n=this;return n._encoding=r,t.fatal&&(n._error_mode="fatal"),t.ignoreBOM&&(n._ignoreBOM=!0),Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase(),this.fatal=n._error_mode==="fatal",this.ignoreBOM=n._ignoreBOM),n}Object.defineProperty&&(Object.defineProperty(Ya.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Ya.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Ya.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Ya.prototype.decode=function(t,r){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),r=fd(r),this._do_not_flush||(this._decoder=pn[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=!!r.stream;for(var i=new G1(n),o=[],s;;){var a=i.read();if(a===Ye||(s=this._decoder.handler(i,a),s===gt))break;s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s))}if(!this._do_not_flush){do{if(s=this._decoder.handler(i,i.read()),s===gt)break;s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s))}while(!i.endOfStream());this._decoder=null}function c(l){return PD(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(l.length>0&&l[0]===65279?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),LD(l)}return c.call(this,o)};function cf(e,t){if(!(this instanceof cf))throw TypeError("Called as a function. Did you forget 'new'?");t=fd(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=t.fatal?"fatal":"replacement";var r=this;if(t.NONSTANDARD_allowLegacyEncoding){e=e!==void 0?String(e):q_;var n=N1(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!mn[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=N1("utf-8"),e!==void 0&&"console"in globalThis;return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(cf.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});cf.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=fd(r),this._do_not_flush||(this._encoder=mn[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=!!r.stream;for(var n=new G1(RD(t)),i=[],o;;){var s=n.read();if(s===Ye||(o=this._encoder.handler(n,s),o===gt))break;Array.isArray(o)?i.push.apply(i,o):i.push(o)}if(!this._do_not_flush){for(;o=this._encoder.handler(n,n.read()),o!==gt;)Array.isArray(o)?i.push.apply(i,o):i.push(o);this._encoder=null}return new Uint8Array(i)};function GD(e){var t=e.fatal,r=0,n=0,i=0,o=128,s=191;this.handler=function(a,c){if(c===Ye&&i!==0)return i=0,Xe(t);if(c===Ye)return gt;if(i===0){if(Te(c,0,127))return c;if(Te(c,194,223))i=1,r=c&31;else if(Te(c,224,239))c===224&&(o=160),c===237&&(s=159),i=2,r=c&15;else if(Te(c,240,244))c===240&&(o=144),c===244&&(s=143),i=3,r=c&7;else return Xe(t);return null}if(!Te(c,o,s))return r=i=n=0,o=128,s=191,a.prepend(c),Xe(t);if(o=128,s=191,r=r<<6|c&63,n+=1,n!==i)return null;var l=r;return r=i=n=0,l}}function kD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n))return n;var i,o;Te(n,128,2047)?(i=1,o=192):Te(n,2048,65535)?(i=2,o=224):Te(n,65536,1114111)&&(i=3,o=240);for(var s=[(n>>6*i)+o];i>0;){var a=n>>6*(i-1);s.push(128|a&63),i-=1}return s}}mn["UTF-8"]=function(e){return new kD(e)};pn["UTF-8"]=function(e){return new GD(e)};function UD(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(ui(i))return i;var o=e[i-128];return o===null?Xe(r):o}}function jD(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(li(i))return i;var o=gl(i,e);return o===null&&Ii(i),o+128}}(function(){"encoding-indexes"in globalThis&&z_.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Zr(r.toLowerCase());pn[r]=function(i){return new UD(n,i)},mn[r]=function(i){return new jD(n,i)}})})})();pn.GBK=function(e){return new V_(e)};mn.GBK=function(e){return new W_(e,!0)};function V_(e){var t=e.fatal,r=0,n=0,i=0;this.handler=function(o,s){if(s===Ye&&r===0&&n===0&&i===0)return gt;s===Ye&&(r!==0||n!==0||i!==0)&&(r=0,n=0,i=0,Xe(t));var a;if(i!==0){a=null,Te(s,48,57)&&(a=CD((((r-129)*10+n-48)*126+i-129)*10+s-48));var c=[n,i,s];return r=0,n=0,i=0,a===null?(o.prepend(c),Xe(t)):a}if(n!==0)return Te(s,129,254)?(i=s,null):(o.prepend([n,s]),r=0,n=0,Xe(t));if(r!==0){if(Te(s,48,57))return n=s,null;var l=r,u=null;r=0;var h=s<127?64:65;return(Te(s,64,126)||Te(s,128,254))&&(u=(l-129)*190+(s-h)),a=u===null?null:pl(u,Zr("gb18030")),a===null&&ui(s)&&o.prepend(s),a===null?Xe(t):a}return ui(s)?s:s===128?8364:Te(s,129,254)?(r=s,null):Xe(t)}}function W_(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(li(i))return i;if(i===58853)return Ii(i);if(t&&i===8364)return 128;var o=gl(i,Zr("gb18030"));if(o!==null){var s=Oo(o/190)+129,a=o%190,c=a<63?64:65;return[s,a+c]}if(t)return Ii(i);o=DD(i);var l=Oo(o/10/126/10);o=o-l*10*126*10;var u=Oo(o/10/126);o=o-u*10*126;var h=Oo(o/10),d=o-h*10;return[l+129,u+48,h+129,d+48]}}mn.gb18030=function(e){return new W_(e)};pn.gb18030=function(e){return new V_(e)};function zD(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(t);if(i===Ye&&r===0)return gt;if(r!==0){var o=r,s=null;r=0;var a=i<127?64:98;switch((Te(i,64,126)||Te(i,161,254))&&(s=(o-129)*157+(i-a)),s){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var c=s===null?null:pl(s,Zr("big5"));return c===null&&ui(i)&&n.prepend(i),c===null?Xe(t):c}return ui(i)?i:Te(i,129,254)?(r=i,null):Xe(t)}}function qD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n))return n;var i=FD(n);if(i===null)return Ii(n);var o=Oo(i/157)+129;if(o<161)return Ii(n);var s=i%157,a=s<63?64:98;return[o,s+a]}}mn.Big5=function(e){return new qD(e)};pn.Big5=function(e){return new zD(e)};function VD(e){var t=e.fatal,r=!1,n=0;this.handler=function(i,o){if(o===Ye&&n!==0)return n=0,Xe(t);if(o===Ye&&n===0)return gt;if(n===142&&Te(o,161,223))return n=0,65216+o;if(n===143&&Te(o,161,254))return r=!0,n=o,null;if(n!==0){var s=n;n=0;var a=null;return Te(s,161,254)&&Te(o,161,254)&&(a=pl((s-161)*94+(o-161),Zr(r?"jis0212":"jis0208"))),r=!1,Te(o,161,254)||i.prepend(o),a===null?Xe(t):a}return ui(o)?o:o===142||o===143||Te(o,161,254)?(n=o,null):Xe(t)}}function WD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n))return n;if(n===165)return 92;if(n===8254)return 126;if(Te(n,65377,65439))return[142,n-65377+161];n===8722&&(n=65293);var i=gl(n,Zr("jis0208"));if(i===null)return Ii(n);var o=Oo(i/94)+161,s=i%94+161;return[o,s]}}mn["EUC-JP"]=function(e){return new WD(e)};pn["EUC-JP"]=function(e){return new VD(e)};function HD(e){var t=e.fatal,r={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},n=r.ASCII,i=r.ASCII,o=0,s=!1;this.handler=function(a,c){switch(n){default:case r.ASCII:return c===27?(n=r.EscapeStart,null):Te(c,0,127)&&c!==14&&c!==15&&c!==27?(s=!1,c):c===Ye?gt:(s=!1,Xe(t));case r.Roman:return c===27?(n=r.EscapeStart,null):c===92?(s=!1,165):c===126?(s=!1,8254):Te(c,0,127)&&c!==14&&c!==15&&c!==27&&c!==92&&c!==126?(s=!1,c):c===Ye?gt:(s=!1,Xe(t));case r.Katakana:return c===27?(n=r.EscapeStart,null):Te(c,33,95)?(s=!1,65344+c):c===Ye?gt:(s=!1,Xe(t));case r.LeadByte:return c===27?(n=r.EscapeStart,null):Te(c,33,126)?(s=!1,o=c,n=r.TrailByte,null):c===Ye?gt:(s=!1,Xe(t));case r.TrailByte:if(c===27)return n=r.EscapeStart,Xe(t);if(Te(c,33,126)){n=r.LeadByte;var l=(o-33)*94+c-33,u=pl(l,Zr("jis0208"));return u===null?Xe(t):u}return c===Ye?(n=r.LeadByte,a.prepend(c),Xe(t)):(n=r.LeadByte,Xe(t));case r.EscapeStart:return c===36||c===40?(o=c,n=r.Escape,null):(a.prepend(c),s=!1,n=i,Xe(t));case r.Escape:var h=o;o=0;var d=null;if(h===40&&c===66&&(d=r.ASCII),h===40&&c===74&&(d=r.Roman),h===40&&c===73&&(d=r.Katakana),h===36&&(c===64||c===66)&&(d=r.LeadByte),d!==null){n=n=d;var m=s;return s=!0,m?Xe(t):null}return a.prepend([h,c]),s=!1,n=i,Xe(t)}}}function $D(e){var t=e.fatal,r={ASCII:0,Roman:1,jis0208:2},n=r.ASCII;this.handler=function(i,o){if(o===Ye&&n!==r.ASCII)return i.prepend(o),n=r.ASCII,[27,40,66];if(o===Ye&&n===r.ASCII)return gt;if((n===r.ASCII||n===r.Roman)&&(o===14||o===15||o===27))return Ii(65533);if(n===r.ASCII&&li(o))return o;if(n===r.Roman&&(li(o)&&o!==92&&o!==126||o===165||o===8254)){if(li(o))return o;if(o===165)return 92;if(o===8254)return 126}if(li(o)&&n!==r.ASCII)return i.prepend(o),n=r.ASCII,[27,40,66];if((o===165||o===8254)&&n!==r.Roman)return i.prepend(o),n=r.Roman,[27,40,74];o===8722&&(o=65293);var s=gl(o,Zr("jis0208"));if(s===null)return Ii(o);if(n!==r.jis0208)return i.prepend(o),n=r.jis0208,[27,36,66];var a=Oo(s/94)+33,c=s%94+33;return[a,c]}}mn["ISO-2022-JP"]=function(e){return new $D(e)};pn["ISO-2022-JP"]=function(e){return new HD(e)};function KD(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(t);if(i===Ye&&r===0)return gt;if(r!==0){var o=r,s=null;r=0;var a=i<127?64:65,c=o<160?129:193;if((Te(i,64,126)||Te(i,128,252))&&(s=(o-c)*188+i-a),Te(s,8836,10715))return 48508+s;var l=s===null?null:pl(s,Zr("jis0208"));return l===null&&ui(i)&&n.prepend(i),l===null?Xe(t):l}return ui(i)||i===128?i:Te(i,161,223)?65216+i:Te(i,129,159)||Te(i,224,252)?(r=i,null):Xe(t)}}function XD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n)||n===128)return n;if(n===165)return 92;if(n===8254)return 126;if(Te(n,65377,65439))return n-65377+161;n===8722&&(n=65293);var i=ND(n);if(i===null)return Ii(n);var o=Oo(i/188),s=o<31?129:193,a=i%188,c=a<63?64:65;return[o+s,a+c]}}mn.Shift_JIS=function(e){return new XD(e)};pn.Shift_JIS=function(e){return new KD(e)};function YD(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(t);if(i===Ye&&r===0)return gt;if(r!==0){var o=r,s=null;r=0,Te(i,65,254)&&(s=(o-129)*190+(i-65));var a=s===null?null:pl(s,Zr("euc-kr"));return s===null&&ui(i)&&n.prepend(i),a===null?Xe(t):a}return ui(i)?i:Te(i,129,254)?(r=i,null):Xe(t)}}function ZD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n))return n;var i=gl(n,Zr("euc-kr"));if(i===null)return Ii(n);var o=Oo(i/190)+129,s=i%190+65;return[o,s]}}mn["EUC-KR"]=function(e){return new ZD(e)};pn["EUC-KR"]=function(e){return new YD(e)};function ud(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function H_(e,t){var r=t.fatal,n=null,i=null;this.handler=function(o,s){if(s===Ye&&(n!==null||i!==null))return Xe(r);if(s===Ye&&n===null&&i===null)return gt;if(n===null)return n=s,null;var a;if(e?a=(n<<8)+s:a=(s<<8)+n,n=null,i!==null){var c=i;return i=null,Te(a,56320,57343)?65536+(c-55296)*1024+(a-56320):(o.prepend(ud(a,e)),Xe(r))}return Te(a,55296,56319)?(i=a,null):Te(a,56320,57343)?Xe(r):a}}function $_(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(Te(i,0,65535))return ud(i,e);var o=ud((i-65536>>10)+55296,e),s=ud((i-65536&1023)+56320,e);return o.concat(s)}}mn["UTF-16BE"]=function(e){return new $_(!0,e)};pn["UTF-16BE"]=function(e){return new H_(!0,e)};mn["UTF-16LE"]=function(e){return new $_(!1,e)};pn["UTF-16LE"]=function(e){return new H_(!1,e)};function JD(e){var t=e.fatal;this.handler=function(r,n){return n===Ye?gt:ui(n)?n:63360+n-128}}function QD(e){var t=e.fatal;this.handler=function(r,n){return n===Ye?gt:li(n)?n:Te(n,63360,63487)?n-63360+128:Ii(n)}}mn["x-user-defined"]=function(e){return new QD(e)};pn["x-user-defined"]=function(e){return new JD(e)};function lf(e){return Buffer.from(e).toString("base64")}function k1(e){return Buffer.from(e,"base64").toString("ascii")}async function Dd(){try{return(await Promise.resolve().then(()=>(fv(),uv))).default}catch(e){throw new Error("Node image decoding and encoding require the optional 'sharp' package. Install it with 'npm install sharp'.",{cause:e})}}var Nd=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg+xml"];async function Fd(e,t){let r=await Dd(),{data:n,info:i}=await r(Buffer.from(e),{animated:!0}).toColourspace("srgb").ensureAlpha().raw().toBuffer({resolveWithObject:!0}),o=i.width,s=i.pageHeight||i.height,a=i.pages||1;return{shape:a>1?[a,o,s,4]:[o,s,4],data:new Uint8Array(n),width:o,height:s,components:4,layers:[a]}}function dv(e){return e instanceof ArrayBuffer?e:(ArrayBuffer.isView(e),Gd(e))}function Gd(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:r,byteLength:n}=e;return t instanceof ArrayBuffer&&r===0&&n===t.byteLength?t:hv(t,r,n)}return hv(e)}function hv(e,t=0,r=e.byteLength-t){let n=new Uint8Array(r);return n.set(new Uint8Array(e,t,r)),n.buffer}async function Mg(e,t={}){let r=await Dd(),n=(t.type||"jpeg").toLowerCase().replace(/^image\//,""),i=n==="jpg"?"jpeg":n,o=await r(Buffer.from(e.data),{raw:{width:e.width,height:e.height,channels:4}}).toFormat(i).toBuffer();return dv(o)}var Il=class{width;height;data;constructor(t){if(!t||!t.data||!t.width||!t.height)throw new Error("NodeImageBitmap requires decoded image data");this.width=t.width,this.height=t.height,this.data=t.data}close(){this.width=0,this.height=0,this.data=null}_getImageData(){if(!this.data)throw new Error("ImageBitmap is closed");return{data:this.data,width:this.width,height:this.height}}};function vg(e){return e instanceof Il}function mv(e){return new Il(e)}function Eg(e){if(!vg(e))throw new Error("getImageBitmapData");return e._getImageData()}var dU="",mU=new Map;function kd(e){for(let[t,r]of mU)e.startsWith(t)&&(e=e.replace(t,r));return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${dU}${e}`),e}var Fo=me(require("fs"),1),ec=class{handle;size;bigsize;url;constructor(t,r,n){t=kd(t),this.handle=Fo.default.openSync(t,r,n);let i=Fo.default.fstatSync(this.handle,{bigint:!0});this.size=Number(i.size),this.bigsize=i.size,this.url=t}async close(){return new Promise((t,r)=>{Fo.default.close(this.handle,n=>n?r(n):t())})}async truncate(t){return new Promise((r,n)=>{Fo.default.ftruncate(this.handle,t,i=>{i?n(i):(this.bigsize=BigInt(t),this.size=Number(this.bigsize),r())})})}async append(t){return new Promise((r,n)=>{Fo.default.appendFile(this.handle,t,i=>{i?n(i):(this.bigsize=this.bigsize+BigInt(t.length),this.size=Number(this.bigsize),r())})})}async stat(){return await new Promise((t,r)=>Fo.default.fstat(this.handle,{bigint:!0},(n,i)=>{let o={size:Number(i.size),bigsize:i.size,isDirectory:i.isDirectory()};n?r(n):t(o)}))}async read(t,r){let n=new ArrayBuffer(r),i=BigInt(t),o=0,s=new Uint8Array(n),a;for(;r>0;){let c=await pU(this.handle,s,0,r,i);if(c===0)break;o+=c,i+=BigInt(c),r-=c,a!==void 0&&(a+=c)}return o<r?n.slice(0,o):n}async write(t,r=0,n=t.byteLength){return new Promise((i,o)=>{let s=Number(r),a=new Uint8Array(t,Number(r),n);Fo.default.write(this.handle,a,0,n,s,(c,l)=>c?o(c):i(l))})}};async function pU(e,t,r,n,i){return await new Promise((o,s)=>Fo.default.read(e,t,r,n,i,(a,c)=>a?s(a):o(c)))}var zd=me(require("fs/promises"),1);var Ag=me(require("fs"),1),Tg=require("stream");var Ud=me(require("zlib"),1);function pv(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(Ud.default.createBrotliDecompress());case"gzip":return e.pipe(Ud.default.createGunzip());case"deflate":return e.pipe(Ud.default.createDeflate());default:return e}}var gU=e=>typeof e=="boolean",gv=e=>typeof e=="function",yU=e=>e!==null&&typeof e=="object",bU=e=>yU(e)&&gv(e.read)&&gv(e.pipe)&&gU(e.readable);async function jd(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=kd(n);let i=new Headers;e.endsWith(".gz")&&i.set("content-encoding","gzip"),e.endsWith(".br")&&i.set("content-encoding","br");try{let o=await new Promise((h,d)=>{let m=Ag.default.createReadStream(n,{encoding:null});m.once("readable",()=>h(m)),m.on("error",g=>d(g))}),s=o;bU(o)?s=pv(o,i):typeof o=="string"?s=Tg.Readable.from([new TextEncoder().encode(o)]):s=Tg.Readable.from([o||new ArrayBuffer(0)]);let a=200,c="OK",l=wU(n),u=new Response(s,{headers:l,status:a,statusText:c});return Object.defineProperty(u,"url",{value:e}),u}catch(o){let s=o.message,a=400,c=s,l={},u=new Response(s,{headers:l,status:a,statusText:c});return Object.defineProperty(u,"url",{value:e}),u}}function wU(e){let t={};if(!t["content-length"]){let r=Ag.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new Headers(t)}var qd=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await zd.default.readdir(t,r)}async stat(t){let r=await zd.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await zd.default.unlink(t)}async fetch(t,r){return await jd(t,r)}async openReadableFile(t,r="r"){return new ec(t,r)}async openWritableFile(t,r="w",n){return new ec(t,r,n)}};var bf=me(require("crypto"),1),Vd=class{name="crypto-node";options;_algorithm;_hash;constructor(t){var r,n;if(this.options=t,this.hashBatches=this.hashBatches.bind(this),!((n=(r=this.options)==null?void 0:r.crypto)!=null&&n.algorithm))throw new Error(this.name)}async preload(){}async hash(t,r){var i,o,s,a;let n=(s=(o=(i=this.options)==null?void 0:i.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase();try{if(!bf.createHash)throw new Error("crypto.createHash not available");let c=(a=bf.createHash)==null?void 0:a(n),l=new Uint8Array(t);return c.update(l).digest("base64")}catch(c){throw Error(`${n} hash not available. ${c}`)}}async*hashBatches(t,r="base64"){var o,s,a,c,l,u,h;if(!bf.createHash)throw new Error("crypto.createHash not available");let n=(c=bf.createHash)==null?void 0:c((a=(s=(o=this.options)==null?void 0:o.crypto)==null?void 0:s.algorithm)==null?void 0:a.toLowerCase());for await(let d of t){let m=new Uint8Array(d);n.update(m),yield d}let i=n.digest(r);(h=(u=(l=this.options)==null?void 0:l.crypto)==null?void 0:u.onEnd)==null||h.call(u,{hash:i})}};var Sv=require("node:process"),Mv=require("node:stream/web");var Wd=require("node:stream");function yv(e,t){let r=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator](),n=!1,i={async next(){var c;try{let l=await r.next();return l.done?(await((c=r.return)==null?void 0:c.call(r)),{done:!0,value:void 0}):{done:!1,value:new Uint8Array(l.value)}}catch(l){throw n=!0,l}},async return(c){var l;return await((l=r.return)==null?void 0:l.call(r,c)),{done:!0,value:void 0}},async throw(c){return r.throw&&await r.throw(c),{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}},o=(t==null?void 0:t.objectMode)??!1,s=Wd.Readable.from(i,{highWaterMark:(0,Wd.getDefaultHighWaterMark)(o),...t,objectMode:o}),a=s._destroy;return s._destroy=function(c,l){a.call(this,c,u=>{l(!n&&u===c?null:u)})},s}var Hd=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(t){let r=await t.arrayBuffer();this.onload&&this.onload({target:{result:r}})}async readAsBinaryString(t){throw Error("Not implemented")}async readAsDataURL(t){let r=await t.text(),n=`data://;base64,${lf(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};function bv(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=Hd),global}var Ig=me(require("module"),1),Pg=me(require("path"),1),Kd=me(require("fs"),1),Rg=require("node:url");async function wv(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Gd(Kd.default.readFileSync(Lg(e)))}async function xv(e){return e.startsWith("http")?await(await fetch(e)).text():Kd.default.readFileSync(Lg(e),"utf8")}async function _v(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return $d(i)}let t=Lg(e),r=Kd.default.readFileSync(t,"utf8");return $d(r,t)}function $d(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t.startsWith("file:")&&(t=(0,Rg.fileURLToPath)(t)),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=Ig.default._nodeModulePaths(Pg.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),o=new Ig.default(t,i);return o.filename=t,o.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),o._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(o),1),o.exports}function Lg(e){return e.startsWith("file:")?(0,Rg.fileURLToPath)(e):Pg.default.resolve(e)}var NJ=parseInt(Sv.versions.node.split(".")[0]),kJ=globalThis.Blob,UJ=globalThis.File;bv();U_&&console.error("loaders.gl: The @loaders.gl/core/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=yv;globalThis.loaders.NodeFile=ec;globalThis.loaders.NodeFileSystem=qd;globalThis.loaders.fetchNode=jd;globalThis.loaders.NodeHash=Vd;globalThis.TextEncoder||(globalThis.TextEncoder=cf);globalThis.TextDecoder||(globalThis.TextDecoder=Ya);globalThis.ReadableStream||(globalThis.ReadableStream=Mv.ReadableStream);!("atob"in globalThis)&&lf&&(globalThis.atob=lf);!("btoa"in globalThis)&&k1&&(globalThis.btoa=k1);globalThis.loaders.encodeImageNode=Mg;globalThis.loaders.parseImageNode=Fd;globalThis.loaders.imageFormatsNode=Nd;globalThis.loaders.createImageBitmapNode=mv;globalThis.loaders.getImageBitmapDataNode=Eg;globalThis.loaders.isImageBitmapNode=vg;globalThis.ImageBitmap||(globalThis.ImageBitmap=Il);"getImageBitmapData"in globalThis||(globalThis.getImageBitmapData=Eg);globalThis._parseImageNode=Fd;globalThis._imageFormatsNode=Nd;globalThis.loaders.readFileAsArrayBuffer=wv;globalThis.loaders.readFileAsText=xv;globalThis.loaders.requireFromFile=_v;globalThis.loaders.requireFromString=$d;Vs();C_();Jg(D_);
24
24
  /*! Bundled license information:
25
25
 
26
26
  sharp/dist/is.mjs: