@loaders.gl/tiles-3d 5.0.0-beta.10 → 5.0.0-beta.11

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 (154) hide show
  1. package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
  2. package/dist/3d-tiles/dist.dev.js +169 -581
  3. package/dist/3d-tiles/dist.min.js +16 -16
  4. package/dist/3d-tiles/index.cjs +115 -390
  5. package/dist/3d-tiles/index.cjs.map +3 -3
  6. package/dist/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.d.ts +1 -2
  7. package/dist/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.d.ts.map +1 -1
  8. package/dist/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.js +3 -4
  9. package/dist/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.js.map +1 -1
  10. package/dist/3d-tiles/lib/classes/helpers/tile-component-types.d.ts +4 -0
  11. package/dist/3d-tiles/lib/classes/helpers/tile-component-types.d.ts.map +1 -0
  12. package/dist/3d-tiles/lib/classes/helpers/tile-component-types.js +36 -0
  13. package/dist/3d-tiles/lib/classes/helpers/tile-component-types.js.map +1 -0
  14. package/dist/3d-tiles/lib/classes/tile-3d-batch-table-hierarchy.d.ts.map +1 -1
  15. package/dist/3d-tiles/lib/classes/tile-3d-batch-table-hierarchy.js +3 -4
  16. package/dist/3d-tiles/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
  17. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.d.ts +1 -1
  18. package/dist/3d-tiles/lib/classes/tile-3d-feature-table.d.ts +9 -5
  19. package/dist/3d-tiles/lib/classes/tile-3d-feature-table.d.ts.map +1 -1
  20. package/dist/3d-tiles/lib/classes/tile-3d-feature-table.js +15 -12
  21. package/dist/3d-tiles/lib/classes/tile-3d-feature-table.js.map +1 -1
  22. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.d.ts +0 -1
  23. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.d.ts.map +1 -1
  24. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.js +2 -4
  25. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
  26. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.d.ts +1 -2
  27. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.d.ts.map +1 -1
  28. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.js +7 -7
  29. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
  30. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-positions.d.ts.map +1 -1
  31. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-positions.js +0 -2
  32. package/dist/3d-tiles/lib/parsers/helpers/normalize-3d-tile-positions.js.map +1 -1
  33. package/dist/3d-tiles/lib/parsers/parse-3d-tile-batched-model.d.ts.map +1 -1
  34. package/dist/3d-tiles/lib/parsers/parse-3d-tile-batched-model.js +1 -2
  35. package/dist/3d-tiles/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
  36. package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js +13 -13
  37. package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
  38. package/dist/3d-tiles/lib/parsers/parse-3d-tile-point-cloud.d.ts.map +1 -1
  39. package/dist/3d-tiles/lib/parsers/parse-3d-tile-point-cloud.js +22 -23
  40. package/dist/3d-tiles/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
  41. package/dist/3d-tiles/lib/utils/version.js +1 -1
  42. package/dist/3d-tiles/types.d.ts +7 -3
  43. package/dist/3d-tiles/types.d.ts.map +1 -1
  44. package/dist/3d-tiles-archive-writer.cjs +1 -1
  45. package/dist/copc/copc-loader.d.ts.map +1 -1
  46. package/dist/copc/copc-loader.js +10 -7
  47. package/dist/copc/copc-loader.js.map +1 -1
  48. package/dist/copc/copc-writer.d.ts +5 -4
  49. package/dist/copc/copc-writer.d.ts.map +1 -1
  50. package/dist/copc/copc-writer.js +1 -1
  51. package/dist/copc/copc-writer.js.map +1 -1
  52. package/dist/copc/index.cjs +809 -124
  53. package/dist/copc/index.cjs.map +3 -3
  54. package/dist/dist.dev.js +45 -77
  55. package/dist/dist.min.js +10 -10
  56. package/dist/i3s/arcgis-webscene-loader.js +1 -1
  57. package/dist/i3s/dist.dev.js +11915 -12119
  58. package/dist/i3s/dist.min.js +25 -25
  59. package/dist/i3s/i3s-attribute-loader.js +1 -1
  60. package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
  61. package/dist/i3s/i3s-content-loader.js +1 -1
  62. package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
  63. package/dist/i3s/i3s-loader.js +1 -1
  64. package/dist/i3s/i3s-mesh-attributes.d.ts +2 -2
  65. package/dist/i3s/i3s-mesh-attributes.d.ts.map +1 -1
  66. package/dist/i3s/i3s-mesh-attributes.js +6 -11
  67. package/dist/i3s/i3s-mesh-attributes.js.map +1 -1
  68. package/dist/i3s/i3s-mesh-writer.js +2 -3
  69. package/dist/i3s/i3s-mesh-writer.js.map +1 -1
  70. package/dist/i3s/i3s-node-page-loader.js +1 -1
  71. package/dist/i3s/i3s-slpk-loader.js +1 -1
  72. package/dist/i3s/i3s-slpk-writer.js +1 -1
  73. package/dist/i3s/index.cjs +314 -442
  74. package/dist/i3s/index.cjs.map +3 -3
  75. package/dist/i3s/lib/parsers/constants.d.ts +0 -3
  76. package/dist/i3s/lib/parsers/constants.d.ts.map +1 -1
  77. package/dist/i3s/lib/parsers/constants.js +0 -8
  78. package/dist/i3s/lib/parsers/constants.js.map +1 -1
  79. package/dist/i3s/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
  80. package/dist/i3s/lib/parsers/parse-i3s-tile-content.js +1 -2
  81. package/dist/i3s/lib/parsers/parse-i3s-tile-content.js.map +1 -1
  82. package/dist/i3s/types.d.ts +0 -1
  83. package/dist/i3s/types.d.ts.map +1 -1
  84. package/dist/i3s-content-worker-node.js +11 -11
  85. package/dist/i3s-content-worker-node.js.map +4 -4
  86. package/dist/i3s-content-worker.js +485 -879
  87. package/dist/i3s-lepcc-worker-node.js +2 -2
  88. package/dist/i3s-lepcc-worker.js +2 -2
  89. package/dist/i3s-mesh-writer.cjs +87 -206
  90. package/dist/i3s-mesh-writer.cjs.map +3 -3
  91. package/dist/i3s-slpk-writer.cjs +1 -1
  92. package/dist/index.cjs +44 -41
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/point-cloud-tile-loader-types.js +1 -1
  95. package/dist/point-cloud-tile-loader.cjs +17 -28
  96. package/dist/point-cloud-tile-loader.cjs.map +1 -1
  97. package/dist/point-cloud-tile-source.cjs +16 -27
  98. package/dist/point-cloud-tile-source.cjs.map +1 -1
  99. package/dist/point-cloud-tile-source.js +2 -2
  100. package/dist/point-cloud-tile-source.js.map +1 -1
  101. package/dist/potree/dist.dev.js +985 -139
  102. package/dist/potree/dist.min.js +28 -28
  103. package/dist/potree/index.cjs +813 -140
  104. package/dist/potree/index.cjs.map +3 -3
  105. package/dist/potree/lib/potree-node-source.d.ts.map +1 -1
  106. package/dist/potree/lib/potree-node-source.js +2 -14
  107. package/dist/potree/lib/potree-node-source.js.map +1 -1
  108. package/dist/potree/parsers/parse-potree-bin.js +3 -3
  109. package/dist/potree/parsers/parse-potree-bin.js.map +1 -1
  110. package/dist/potree/potree-bin-loader.js +1 -1
  111. package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
  112. package/dist/potree/potree-loader-types.js +1 -1
  113. package/dist/potree/potree-writer.d.ts +3 -3
  114. package/dist/potree/potree-writer.d.ts.map +1 -1
  115. package/dist/potree/potree-writer.js +2 -2
  116. package/dist/potree/potree-writer.js.map +1 -1
  117. package/dist/potree/potree2-source.d.ts +1 -1
  118. package/dist/potree/potree2-source.d.ts.map +1 -1
  119. package/dist/potree/potree2-source.js +6 -3
  120. package/dist/potree/potree2-source.js.map +1 -1
  121. package/dist/potree-loader.cjs +817 -153
  122. package/dist/potree-loader.cjs.map +3 -3
  123. package/dist/tileset-3d/helpers/frame-state.d.ts +2 -1
  124. package/dist/tileset-3d/helpers/frame-state.d.ts.map +1 -1
  125. package/dist/tileset-3d/helpers/frame-state.js +41 -15
  126. package/dist/tileset-3d/helpers/frame-state.js.map +1 -1
  127. package/dist/types.d.ts +15 -0
  128. package/dist/types.d.ts.map +1 -1
  129. package/package.json +13 -13
  130. package/src/3d-tiles/lib/classes/helpers/tile-3d-accessor-utils.ts +3 -4
  131. package/src/3d-tiles/lib/classes/helpers/tile-component-types.ts +39 -0
  132. package/src/3d-tiles/lib/classes/tile-3d-batch-table-hierarchy.ts +3 -4
  133. package/src/3d-tiles/lib/classes/tile-3d-feature-table.ts +38 -14
  134. package/src/3d-tiles/lib/parsers/helpers/normalize-3d-tile-colors.ts +2 -5
  135. package/src/3d-tiles/lib/parsers/helpers/normalize-3d-tile-normals.ts +10 -10
  136. package/src/3d-tiles/lib/parsers/helpers/normalize-3d-tile-positions.ts +0 -2
  137. package/src/3d-tiles/lib/parsers/parse-3d-tile-batched-model.ts +1 -2
  138. package/src/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.ts +19 -19
  139. package/src/3d-tiles/lib/parsers/parse-3d-tile-point-cloud.ts +22 -23
  140. package/src/3d-tiles/types.ts +4 -3
  141. package/src/copc/copc-loader.ts +8 -8
  142. package/src/copc/copc-writer.ts +6 -5
  143. package/src/i3s/i3s-mesh-attributes.ts +9 -17
  144. package/src/i3s/i3s-mesh-writer.ts +4 -3
  145. package/src/i3s/lib/parsers/constants.ts +0 -9
  146. package/src/i3s/lib/parsers/parse-i3s-tile-content.ts +1 -2
  147. package/src/i3s/types.ts +0 -1
  148. package/src/point-cloud-tile-source.ts +2 -2
  149. package/src/potree/lib/potree-node-source.ts +2 -15
  150. package/src/potree/parsers/parse-potree-bin.ts +3 -3
  151. package/src/potree/potree-writer.ts +6 -11
  152. package/src/potree/potree2-source.ts +6 -3
  153. package/src/tileset-3d/helpers/frame-state.ts +43 -15
  154. package/src/types.ts +15 -0
@@ -1,26 +1,26 @@
1
- "use strict";var iF=Object.create;var hg=Object.defineProperty;var oF=Object.getOwnPropertyDescriptor;var sF=Object.getOwnPropertyNames;var aF=Object.getPrototypeOf,cF=Object.prototype.hasOwnProperty;var p=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var ae=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Qt=(t,e)=>{for(var r in e)hg(t,r,{get:e[r],enumerable:!0})},lF=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of sF(e))!cF.call(t,i)&&i!==r&&hg(t,i,{get:()=>e[i],enumerable:!(n=oF(e,i))||n.enumerable});return t};var me=(t,e,r)=>(r=t!=null?iF(aF(t)):{},lF(e||!t||!t.__esModule?hg(r,"default",{value:t,enumerable:!0}):r,t));var xf,uF,Rd,fF,hF,dg=p(()=>{xf=globalThis,uF=globalThis.document||{},Rd=globalThis.process||{},fF=globalThis.console,hF=globalThis.navigator||{}});function Ld(t){var n,i;if(typeof window<"u"&&((n=window.process)==null?void 0:n.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;let e=typeof navigator<"u"&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}var Od=p(()=>{});function Rs(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||Ld()}var mg=p(()=>{Od()});var HS=p(()=>{mg();Od();dg()});var KS=p(()=>{});var pg,Bd=p(()=>{dg();mg();HS();Od();KS();pg="5.0.0"});function vl(t,e){if(!t)throw new Error(e||"Assertion failed")}var gg=p(()=>{});function Cd(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return vl(Number.isFinite(e)&&e>=0),e}function yg(t){let{logLevel:e,message:r}=t;t.logLevel=Cd(e);let n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break;default:}typeof t.message=="function"&&(t.message=t.message());let i=typeof t.message;return vl(i==="string"||i==="object"),Object.assign(t,{args:n},t.opts)}var Dd=p(()=>{gg()});var Ls,nc,_f=p(()=>{Dd();Ls=()=>{},nc=class{constructor({level:e=0}={}){this.userData={},this._onceCache=new Set,this._level=e}set level(e){this.setLevel(e)}get level(){return this.getLevel()}setLevel(e){return this._level=e,this}getLevel(){return this._level}warn(e,...r){return this._log("warn",0,e,r,{once:!0})}error(e,...r){return this._log("error",0,e,r)}log(e,r,...n){return this._log("log",e,r,n)}info(e,r,...n){return this._log("info",e,r,n)}once(e,r,...n){return this._log("once",e,r,n,{once:!0})}_log(e,r,n,i,o={}){let s=yg({logLevel:r,message:n,args:this._buildArgs(r,n,i),opts:o});return this._createLogFunction(e,s,o)}_buildArgs(e,r,n){return[e,r,...n]}_createLogFunction(e,r,n){if(!this._shouldLog(r.logLevel))return Ls;let i=this._getOnceTag(n.tag??r.tag??r.message);if((n.once||r.once)&&i!==void 0){if(this._onceCache.has(i))return Ls;this._onceCache.add(i)}return this._emit(e,r)}_shouldLog(e){return this.getLevel()>=Cd(e)}_getOnceTag(e){if(e!==void 0)try{return typeof e=="string"?e:String(e)}catch{return}}}});function mF(t){try{let e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var Sf,bg=p(()=>{Sf=class{constructor(e,r,n="sessionStorage"){this.storage=mF(n),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){let r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}}});function XS(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function wg(t,e=8){let r=Math.max(e-t.length,0);return`${" ".repeat(r)}${t}`}var xg=p(()=>{});function YS(t){return typeof t!="string"?t:(t=t.toUpperCase(),Mf[t]||Mf.WHITE)}function _g(t,e,r){return!Rs&&typeof t=="string"&&(e&&(t=`\x1B[${YS(e)}m${t}\x1B[39m`),r&&(t=`\x1B[${YS(r)+pF}m${t}\x1B[49m`)),t}var Mf,pF,Nd=p(()=>{Bd();(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Mf||(Mf={}));pF=10});function Sg(t,e=["constructor"]){let r=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(r),i=t;for(let o of n){let s=i[o];typeof s=="function"&&(e.find(a=>o===a)||(i[o]=s.bind(t)))}}var Mg=p(()=>{});var Fd,li,vf=p(()=>{Bd();Fd=class{getHighResolutionTimer(){var r,n,i,o,s;let e;if(Rs()&&xf.performance)e=(i=(n=(r=xf)==null?void 0:r.performance)==null?void 0:n.now)==null?void 0:i.call(n);else if("hrtime"in Rd){let a=(s=(o=Rd)==null?void 0:o.hrtime)==null?void 0:s.call(o);e=a[0]*1e3+a[1]/1e6}else e=Date.now();return e}getMemoryUsageMB(){var n,i;let e=(n=xf)==null?void 0:n.performance,r=(i=e==null?void 0:e.memory)==null?void 0:i.usedJSHeapSize;return r==null?null:Math.trunc(r/1024/1024)}},li=new Fd;globalThis.Probe=Fd;globalThis.probe=li});function gF(t,e,r){if(typeof e=="string"){let n=r.time?wg(XS(r.total)):"";e=r.time?`${t}: ${n} ${e}`:`${t}: ${e}`,e=_g(e,r.color,r.background)}return e}function yF(t){for(let e in t)for(let r in t[e])return r||"untitled";return"empty"}var El,vg,No,Eg=p(()=>{Bd();_f();bg();xg();Nd();Mg();gg();vf();Dd();Dd();El={debug:Rs()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},vg={enabled:!0,level:0},No=class extends nc{constructor({id:e}={id:""}){super({level:0}),this.VERSION=pg,this._startTs=li.getHighResolutionTimer(),this._deltaTs=li.getHighResolutionTimer(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new Sf(`__probe-${this.id}__`,{[this.id]:vg}),this.timeStamp(`${this.id} started`),Sg(this),Object.seal(this)}isEnabled(){return this._getConfiguration().enabled}getLevel(){return this._getConfiguration().level}getTotal(){return Number((li.getHighResolutionTimer()-this._startTs).toPrecision(10))}getDelta(){return Number((li.getHighResolutionTimer()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._updateConfiguration({enabled:e}),this}setLevel(e){return this._updateConfiguration({level:e}),this}get(e){return this._getConfiguration()[e]}set(e,r){this._updateConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){if(!e)throw new Error(r||"Assertion failed")}warn(e,...r){return this._log("warn",0,e,r,{method:El.warn,once:!0})}error(e,...r){return this._log("error",0,e,r,{method:El.error})}deprecated(e,r){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${r}\` instead`)}removed(e,r){return this.error(`\`${e}\` has been removed. Use \`${r}\` instead`)}probe(e,r,...n){let i=li.getMemoryUsageMB();if(i!==null){let o=`${i}MB `;typeof r=="function"?r=()=>`${o}${r()}`:typeof r=="string"&&(r=`${o}${r}`)}return this._log("log",e,r,n,{method:El.log,time:!0,once:!0})}log(e,r,...n){return this._log("log",e,r,n,{method:El.debug})}info(e,r,...n){return this._log("info",e,r,n,{method:console.info})}once(e,r,...n){return this._log("once",e,r,n,{method:El.debug||El.info,once:!0})}table(e,r,n){return r?this._log("table",e,r,n&&[n]||[],{method:console.table||Ls,tag:yF(r)}):Ls}time(e,r){return this._log("time",e,r,[],{method:console.time?console.time:console.info})}timeEnd(e,r){return this._log("time",e,r,[],{method:console.timeEnd?console.timeEnd:console.info})}timeStamp(e,r){return this._log("time",e,r,[],{method:console.timeStamp||Ls})}group(e,r,n={collapsed:!1}){let i=(n.collapsed?console.groupCollapsed:console.group)||console.info;return this._log("group",e,r,[],{method:i})}groupCollapsed(e,r,n={}){return this.group(e,r,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._log("groupEnd",e,"",[],{method:console.groupEnd||Ls})}withGroup(e,r,n){this.group(e,r)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&super._shouldLog(e)}_emit(e,r){let n=r.method;vl(n),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=li.getHighResolutionTimer();let i=gF(this.id,r.message,r);return n.bind(console,i,...r.args)}_getConfiguration(){return this._storage.config[this.id]||this._updateConfiguration(vg),this._storage.config[this.id]}_updateConfiguration(e){let r=this._storage.config[this.id]||{...vg};this._storage.setConfiguration({[this.id]:{...r,...e}})}};No.VERSION=pg});var ZS=p(()=>{_f()});var JS=p(()=>{_f()});var QS=p(()=>{vf()});var eM=p(()=>{vf();globalThis.probe||(globalThis.probe=li)});var tM,Tg=p(()=>{Eg();vf();Eg();ZS();_f();JS();Nd();Nd();xg();Mg();bg();QS();eM();tM=new No({id:"@probe.gl/log"})});var uM,qF,VF,WF,$F,HF,KF,XF,YF,ZF,JF,QF,e7,t7,r7,f,to=p(()=>{uM=t=>typeof t<"u"&&t!==null,qF=t=>typeof t=="object",VF=t=>Object.prototype.toString.call(t)==="[object Object]",WF=t=>typeof t=="function",$F=t=>typeof t=="boolean",HF=t=>t instanceof Buffer,KF=t=>{if(uM(t))switch(t.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},XF=t=>t instanceof ArrayBuffer,YF=t=>typeof t=="string"&&t.length>0,ZF=t=>typeof t=="number"&&Number.isFinite(t),JF=t=>Number.isInteger(t),QF=(t,e,r)=>t>=e&&t<=r,e7=(t,e)=>e.includes(t),t7=(t,e,r)=>{let n;try{n=String(r).slice(0,100)}catch{}return new Error(`Expected ${e} for ${t} but received ${n} of type ${typeof r}`)},r7=(t,e)=>(e.message=t.message,e),f={defined:uM,object:qF,plainObject:VF,fn:WF,bool:$F,buffer:HF,typedArray:KF,arrayBuffer:XF,string:YF,number:ZF,integer:JF,inRange:QF,inArray:e7,invalidParameterError:t7,nativeError:r7}});var dM=ae((yQ,hM)=>{"use strict";var fM=()=>process.platform==="linux",Ud=null,n7=()=>{if(!Ud)if(fM()&&process.report){let t=process.report.excludeNetwork;process.report.excludeNetwork=!0,Ud=process.report.getReport(),process.report.excludeNetwork=t}else Ud={};return Ud};hM.exports={isLinux:fM,getReport:n7}});var pM=ae((bQ,mM)=>{"use strict";var Il=require("fs"),i7="/usr/bin/ldd",o7="/proc/self/exe",jd=2048,s7=t=>{let e=Il.openSync(t,"r"),r=Buffer.alloc(jd),n=Il.readSync(e,r,0,jd,0);return Il.close(e,()=>{}),r.subarray(0,n)},a7=t=>new Promise((e,r)=>{Il.open(t,"r",(n,i)=>{if(n)r(n);else{let o=Buffer.alloc(jd);Il.read(i,o,0,jd,0,(s,a)=>{e(o.subarray(0,a)),Il.close(i,()=>{})})}})});mM.exports={LDD_PATH:i7,SELF_PATH:o7,readFileSync:s7,readFile:a7}});var yM=ae((wQ,gM)=>{"use strict";var c7=t=>{if(t.length<64||t.readUInt32BE(0)!==2135247942||t.readUInt8(4)!==2||t.readUInt8(5)!==1)return null;let e=t.readUInt32LE(32),r=t.readUInt16LE(54),n=t.readUInt16LE(56);for(let i=0;i<n;i++){let o=e+i*r;if(t.readUInt32LE(o)===3){let a=t.readUInt32LE(o+8),c=t.readUInt32LE(o+32);return t.subarray(a,a+c).toString().replace(/\0.*$/g,"")}}return null};gM.exports={interpreterPath:c7}});var qd=ae((xQ,DM)=>{"use strict";var wM=require("child_process"),{isLinux:Pl,getReport:xM}=dM(),{LDD_PATH:zd,SELF_PATH:_M,readFile:Bg,readFileSync:Cg}=pM(),{interpreterPath:SM}=yM(),ro,no,io,MM="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",Os="",vM=()=>Os||new Promise(t=>{wM.exec(MM,(e,r)=>{Os=e?" ":r,t(Os)})}),EM=()=>{if(!Os)try{Os=wM.execSync(MM,{encoding:"utf8"})}catch{Os=" "}return Os},ko="glibc",TM=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,oc="musl",l7=t=>t.includes("libc.musl-")||t.includes("ld-musl-"),AM=()=>{let t=xM();return t.header&&t.header.glibcVersionRuntime?ko:Array.isArray(t.sharedObjects)&&t.sharedObjects.some(l7)?oc:null},IM=t=>{let[e,r]=t.split(/[\r\n]+/);return e&&e.includes(ko)?ko:r&&r.includes(oc)?oc:null},PM=t=>{if(t){if(t.includes("/ld-musl-"))return oc;if(t.includes("/ld-linux-"))return ko}return null},RM=t=>(t=t.toString(),t.includes("musl")?oc:t.includes("GNU C Library")?ko:null),u7=async()=>{if(no!==void 0)return no;no=null;try{let t=await Bg(zd);no=RM(t)}catch{}return no},f7=()=>{if(no!==void 0)return no;no=null;try{let t=Cg(zd);no=RM(t)}catch{}return no},h7=async()=>{if(ro!==void 0)return ro;ro=null;try{let t=await Bg(_M),e=SM(t);ro=PM(e)}catch{}return ro},d7=()=>{if(ro!==void 0)return ro;ro=null;try{let t=Cg(_M),e=SM(t);ro=PM(e)}catch{}return ro},LM=async()=>{let t=null;if(Pl()&&(t=await h7(),!t&&(t=await u7(),t||(t=AM()),!t))){let e=await vM();t=IM(e)}return t},OM=()=>{let t=null;if(Pl()&&(t=d7(),!t&&(t=f7(),t||(t=AM()),!t))){let e=EM();t=IM(e)}return t},m7=async()=>Pl()&&await LM()!==ko,p7=()=>Pl()&&OM()!==ko,g7=async()=>{if(io!==void 0)return io;io=null;try{let e=(await Bg(zd)).match(TM);e&&(io=e[1])}catch{}return io},y7=()=>{if(io!==void 0)return io;io=null;try{let e=Cg(zd).match(TM);e&&(io=e[1])}catch{}return io},BM=()=>{let t=xM();return t.header&&t.header.glibcVersionRuntime?t.header.glibcVersionRuntime:null},bM=t=>t.trim().split(/\s+/)[1],CM=t=>{let[e,r,n]=t.split(/[\r\n]+/);return e&&e.includes(ko)?bM(e):r&&n&&r.includes(oc)?bM(n):null},b7=async()=>{let t=null;if(Pl()&&(t=await g7(),t||(t=BM()),!t)){let e=await vM();t=CM(e)}return t},w7=()=>{let t=null;if(Pl()&&(t=y7(),t||(t=BM()),!t)){let e=EM();t=CM(e)}return t};DM.exports={GLIBC:ko,MUSL:oc,family:LM,familySync:OM,isNonGlibcLinux:m7,isNonGlibcLinuxSync:p7,version:b7,versionSync:w7}});var Rl=ae((_Q,NM)=>{"use strict";var x7="2.0.0",_7=Number.MAX_SAFE_INTEGER||9007199254740991,S7=16,M7=250,v7=["major","premajor","minor","preminor","patch","prepatch","prerelease"];NM.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:S7,MAX_SAFE_BUILD_LENGTH:M7,MAX_SAFE_INTEGER:_7,RELEASE_TYPES:v7,SEMVER_SPEC_VERSION:x7,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Af=ae((SQ,FM)=>{"use strict";var E7=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};FM.exports=E7});var Ll=ae((oo,kM)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Dg,MAX_SAFE_BUILD_LENGTH:T7,MAX_LENGTH:A7}=Rl(),I7=Af();oo=kM.exports={};var P7=oo.re=[],R7=oo.safeRe=[],Y=oo.src=[],L7=oo.safeSrc=[],Z=oo.t={},O7=0,Ng="[a-zA-Z0-9-]",B7=[["\\s",1],["\\d",A7],[Ng,T7]],C7=t=>{for(let[e,r]of B7)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Pe=(t,e,r)=>{let n=C7(e),i=O7++;I7(t,i,e),Z[t]=i,Y[i]=e,L7[i]=n,P7[i]=new RegExp(e,r?"g":void 0),R7[i]=new RegExp(n,r?"g":void 0)};Pe("NUMERICIDENTIFIER","0|[1-9]\\d*");Pe("NUMERICIDENTIFIERLOOSE","\\d+");Pe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ng}*`);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",`${Ng}+`);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,${Dg}})(?:\\.(\\d{1,${Dg}}))?(?:\\.(\\d{1,${Dg}}))?`);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);oo.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);oo.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);oo.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 Vd=ae((MQ,GM)=>{"use strict";var D7=Object.freeze({loose:!0}),N7=Object.freeze({}),F7=t=>t?typeof t!="object"?D7:t:N7;GM.exports=F7});var Fg=ae((vQ,zM)=>{"use strict";var UM=/^[0-9]+$/,jM=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=UM.test(t),n=UM.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},k7=(t,e)=>jM(e,t);zM.exports={compareIdentifiers:jM,rcompareIdentifiers:k7}});var Mr=ae((EQ,VM)=>{"use strict";var Wd=Af(),{MAX_LENGTH:qM,MAX_SAFE_INTEGER:$d}=Rl(),{safeRe:Hd,t:Kd}=Ll(),G7=Vd(),{compareIdentifiers:kg}=Fg(),U7=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(kg(t[n],r[n])!==0)return!1;return!0},Gg=class t{constructor(e,r){if(r=G7(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>qM)throw new TypeError(`version is longer than ${qM} characters`);Wd("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Hd[Kd.LOOSE]:Hd[Kd.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>$d||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$d||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$d||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<$d)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(e){if(Wd("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(Wd("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 kg(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(Wd("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 kg(n,i)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?Hd[Kd.PRERELEASELOOSE]:Hd[Kd.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){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]),U7(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: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};VM.exports=Gg});var Bs=ae((TQ,$M)=>{"use strict";var WM=Mr(),j7=(t,e,r=!1)=>{if(t instanceof WM)return t;try{return new WM(t,e)}catch(n){if(!r)return null;throw n}};$M.exports=j7});var KM=ae((AQ,HM)=>{"use strict";var z7=Bs(),q7=(t,e)=>{let r=z7(t,e);return r?r.version:null};HM.exports=q7});var YM=ae((IQ,XM)=>{"use strict";var V7=Bs(),W7=(t,e)=>{let r=V7(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};XM.exports=W7});var QM=ae((PQ,JM)=>{"use strict";var ZM=Mr(),$7=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new ZM(t instanceof ZM?t.version:t,r).inc(e,n,i).version}catch{return null}};JM.exports=$7});var rv=ae((RQ,tv)=>{"use strict";var ev=Bs(),H7=(t,e)=>{let r=ev(t,null,!0),n=ev(e,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"};tv.exports=H7});var iv=ae((LQ,nv)=>{"use strict";var K7=Mr(),X7=(t,e)=>new K7(t,e).major;nv.exports=X7});var sv=ae((OQ,ov)=>{"use strict";var Y7=Mr(),Z7=(t,e)=>new Y7(t,e).minor;ov.exports=Z7});var cv=ae((BQ,av)=>{"use strict";var J7=Mr(),Q7=(t,e)=>new J7(t,e).patch;av.exports=Q7});var uv=ae((CQ,lv)=>{"use strict";var e9=Bs(),t9=(t,e)=>{let r=e9(t,e);return r&&r.prerelease.length?r.prerelease:null};lv.exports=t9});var hi=ae((DQ,hv)=>{"use strict";var fv=Mr(),r9=(t,e,r)=>new fv(t,r).compare(new fv(e,r));hv.exports=r9});var mv=ae((NQ,dv)=>{"use strict";var n9=hi(),i9=(t,e,r)=>n9(e,t,r);dv.exports=i9});var gv=ae((FQ,pv)=>{"use strict";var o9=hi(),s9=(t,e)=>o9(t,e,!0);pv.exports=s9});var Xd=ae((kQ,bv)=>{"use strict";var yv=Mr(),a9=(t,e,r)=>{let n=new yv(t,r),i=new yv(e,r);return n.compare(i)||n.compareBuild(i)};bv.exports=a9});var xv=ae((GQ,wv)=>{"use strict";var c9=Xd(),l9=(t,e)=>t.sort((r,n)=>c9(r,n,e));wv.exports=l9});var Sv=ae((UQ,_v)=>{"use strict";var u9=Xd(),f9=(t,e)=>t.sort((r,n)=>u9(n,r,e));_v.exports=f9});var If=ae((jQ,Mv)=>{"use strict";var h9=hi(),d9=(t,e,r)=>h9(t,e,r)>0;Mv.exports=d9});var Yd=ae((zQ,vv)=>{"use strict";var m9=hi(),p9=(t,e,r)=>m9(t,e,r)<0;vv.exports=p9});var Ug=ae((qQ,Ev)=>{"use strict";var g9=hi(),y9=(t,e,r)=>g9(t,e,r)===0;Ev.exports=y9});var jg=ae((VQ,Tv)=>{"use strict";var b9=hi(),w9=(t,e,r)=>b9(t,e,r)!==0;Tv.exports=w9});var Zd=ae((WQ,Av)=>{"use strict";var x9=hi(),_9=(t,e,r)=>x9(t,e,r)>=0;Av.exports=_9});var Jd=ae(($Q,Iv)=>{"use strict";var S9=hi(),M9=(t,e,r)=>S9(t,e,r)<=0;Iv.exports=M9});var zg=ae((HQ,Pv)=>{"use strict";var v9=Ug(),E9=jg(),T9=If(),A9=Zd(),I9=Yd(),P9=Jd(),R9=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return v9(t,r,n);case"!=":return E9(t,r,n);case">":return T9(t,r,n);case">=":return A9(t,r,n);case"<":return I9(t,r,n);case"<=":return P9(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Pv.exports=R9});var Lv=ae((KQ,Rv)=>{"use strict";var L9=Mr(),O9=Bs(),{safeRe:Qd,t:em}=Ll(),B9=(t,e)=>{if(t instanceof L9)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Qd[em.COERCEFULL]:Qd[em.COERCE]);else{let c=e.includePrerelease?Qd[em.COERCERTLFULL]:Qd[em.COERCERTL],l;for(;(l=c.exec(t))&&(!r||r.index+r[0].length!==t.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=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return O9(`${n}.${i}.${o}${s}${a}`,e)};Rv.exports=B9});var Bv=ae((XQ,Ov)=>{"use strict";var C9=Bs(),D9=Rl(),N9=Mr(),F9=(t,e,r)=>{if(!D9.RELEASE_TYPES.includes(e))return null;let n=k9(t,r);return n&&G9(n,e)},k9=(t,e)=>{let r=t instanceof N9?t.version:t;return C9(r,e)},G9=(t,e)=>{if(U9(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},U9=t=>t.startsWith("pre");Ov.exports=F9});var Dv=ae((YQ,Cv)=>{"use strict";var qg=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};Cv.exports=qg});var di=ae((ZQ,Gv)=>{"use strict";var j9=/\s+/g,Vg=class t{constructor(e,r){if(r=q9(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Wg)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(j9," "),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=>!Fv(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&&J9(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];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(e){e=e.replace(Z9,"");let n=((this.options.includePrerelease&&X9)|(this.options.loose&&Y9))+":"+e,i=Nv.get(n);if(i)return i;let o=this.options.loose,s=o?Jr[vr.HYPHENRANGELOOSE]:Jr[vr.HYPHENRANGE];e=e.replace(s,lk(this.options.includePrerelease)),Et("hyphen replace",e),e=e.replace(Jr[vr.COMPARATORTRIM],$9),Et("comparator trim",e),e=e.replace(Jr[vr.TILDETRIM],H9),Et("tilde trim",e),e=e.replace(Jr[vr.CARETTRIM],K9),Et("caret trim",e);let a=e.split(" ").map(h=>Q9(h,this.options)).join(" ").split(/\s+/).map(h=>ck(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 Wg(h,this.options));for(let h of l){if(Fv(h))return[h];c.set(h.value,h)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return Nv.set(n,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>kv(n,r)&&e.set.some(i=>kv(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new V9(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(uk(this.set[r],e,this.options))return!0;return!1}};Gv.exports=Vg;var z9=Dv(),Nv=new z9,q9=Vd(),Wg=Pf(),Et=Af(),V9=Mr(),{safeRe:Jr,src:W9,t:vr,comparatorTrimReplace:$9,tildeTrimReplace:H9,caretTrimReplace:K9}=Ll(),{FLAG_INCLUDE_PRERELEASE:X9,FLAG_LOOSE:Y9}=Rl(),Z9=new RegExp(W9[vr.BUILD],"g"),Fv=t=>t.value==="<0.0.0-0",J9=t=>t.value==="",kv=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},Q9=(t,e)=>(t=t.replace(Jr[vr.BUILD],""),Et("comp",t,e),t=nk(t,e),Et("caret",t),t=tk(t,e),Et("tildes",t),t=ok(t,e),Et("xrange",t),t=ak(t,e),Et("stars",t),t),ar=t=>!t||t.toLowerCase()==="x"||t==="*",ek=(t,e,r)=>ar(t)&&!ar(e)||ar(e)&&r&&!ar(r),tk=(t,e)=>t.trim().split(/\s+/).map(r=>rk(r,e)).join(" "),rk=(t,e)=>{let r=e.loose?Jr[vr.TILDELOOSE]:Jr[vr.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,c)=>{Et("tilde",t,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})},nk=(t,e)=>t.trim().split(/\s+/).map(r=>ik(r,e)).join(" "),ik=(t,e)=>{Et("caret",t,e);let r=e.loose?Jr[vr.CARETLOOSE]:Jr[vr.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,c)=>{Et("caret",t,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})},ok=(t,e)=>(Et("replaceXRanges",t,e),t.split(/\s+/).map(r=>sk(r,e)).join(" ")),sk=(t,e)=>{t=t.trim();let r=e.loose?Jr[vr.XRANGELOOSE]:Jr[vr.XRANGE];return t.replace(r,(n,i,o,s,a,c)=>{if(Et("xRange",t,n,i,o,s,a,c),ek(o,s,a))return t;let l=ar(o),u=l||ar(s),h=u||ar(a),d=h;return i==="="&&d&&(i=""),c=e.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})},ak=(t,e)=>(Et("replaceStars",t,e),t.trim().replace(Jr[vr.STAR],"")),ck=(t,e)=>(Et("replaceGTE0",t,e),t.trim().replace(Jr[e.includePrerelease?vr.GTE0PRE:vr.GTE0],"")),lk=t=>(e,r,n,i,o,s,a,c,l,u,h,d)=>(ar(n)?r="":ar(i)?r=`>=${n}.0.0${t?"-0":""}`:ar(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-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}`:t?c=`<${l}.${u}.${+h+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),uk=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Et(t[n].semver),t[n].semver!==Wg.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Pf=ae((JQ,Wv)=>{"use strict";var Rf=Symbol("SemVer ANY"),Kg=class t{static get ANY(){return Rf}constructor(e,r){if(r=Uv(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Hg("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Rf?this.value="":this.value=this.operator+this.semver.version,Hg("comp",this)}parse(e){let r=this.options.loose?jv[zv.COMPARATORLOOSE]:jv[zv.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new qv(n[2],this.options.loose):this.semver=Rf}toString(){return this.value}test(e){if(Hg("Comparator.test",e,this.options.loose),this.semver===Rf||e===Rf)return!0;if(typeof e=="string")try{e=new qv(e,this.options)}catch{return!1}return $g(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Vv(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Vv(this.value,r).test(e.semver):(r=Uv(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||$g(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||$g(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Wv.exports=Kg;var Uv=Vd(),{safeRe:jv,t:zv}=Ll(),$g=zg(),Hg=Af(),qv=Mr(),Vv=di()});var Lf=ae((QQ,$v)=>{"use strict";var fk=di(),hk=(t,e,r)=>{try{e=new fk(e,r)}catch{return!1}return e.test(t)};$v.exports=hk});var Kv=ae((eee,Hv)=>{"use strict";var dk=di(),mk=(t,e)=>new dk(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Hv.exports=mk});var Yv=ae((tee,Xv)=>{"use strict";var pk=Mr(),gk=di(),yk=(t,e,r)=>{let n=null,i=null,o=null;try{o=new gk(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new pk(n,r))}),n};Xv.exports=yk});var Jv=ae((ree,Zv)=>{"use strict";var bk=Mr(),wk=di(),xk=(t,e,r)=>{let n=null,i=null,o=null;try{o=new wk(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new bk(n,r))}),n};Zv.exports=xk});var t3=ae((nee,e3)=>{"use strict";var Xg=Mr(),_k=di(),Qv=If(),Sk=(t,e)=>{t=new _k(t,e);let r=new Xg("0.0.0");if(t.test(r)||(r=new Xg("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],o=null;i.forEach(s=>{let a=new Xg(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||Qv(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||Qv(r,o))&&(r=o)}return r&&t.test(r)?r:null};e3.exports=Sk});var n3=ae((iee,r3)=>{"use strict";var Mk=di(),vk=(t,e)=>{try{return new Mk(t,e).range||"*"}catch{return null}};r3.exports=vk});var tm=ae((oee,a3)=>{"use strict";var Ek=Mr(),s3=Pf(),{ANY:Tk}=s3,Ak=di(),Ik=Lf(),i3=If(),o3=Yd(),Pk=Jd(),Rk=Zd(),Lk=(t,e,r,n)=>{t=new Ek(t,n),e=new Ak(e,n);let i,o,s,a,c;switch(r){case">":i=i3,o=Pk,s=o3,a=">",c=">=";break;case"<":i=o3,o=Rk,s=i3,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ik(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],h=null,d=null;if(u.forEach(m=>{m.semver===Tk&&(m=new s3(">=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(t,d.semver))return!1;if(d.operator===c&&s(t,d.semver))return!1}return!0};a3.exports=Lk});var l3=ae((see,c3)=>{"use strict";var Ok=tm(),Bk=(t,e,r)=>Ok(t,e,">",r);c3.exports=Bk});var f3=ae((aee,u3)=>{"use strict";var Ck=tm(),Dk=(t,e,r)=>Ck(t,e,"<",r);u3.exports=Dk});var m3=ae((cee,d3)=>{"use strict";var h3=di(),Nk=(t,e,r)=>(t=new h3(t,r),e=new h3(e,r),t.intersects(e,r));d3.exports=Nk});var g3=ae((lee,p3)=>{"use strict";var Fk=Lf(),kk=hi();p3.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((u,h)=>kk(u,h,r));for(let u of s)Fk(u,e,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 e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var S3=ae((uee,_3)=>{"use strict";var y3=di(),Jg=Pf(),{ANY:Yg}=Jg,Zg=Lf(),Qg=hi(),Gk=(t,e,r={})=>{if(t===e)return!0;t=new y3(t,r),e=new y3(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=jk(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Uk=[new Jg(">=0.0.0-0")],b3=[new Jg(">=0.0.0")],jk=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Yg){if(e.length===1&&e[0].semver===Yg)return!0;r.includePrerelease?t=Uk:t=b3}if(e.length===1&&e[0].semver===Yg){if(r.includePrerelease)return!0;e=b3}let n=new Set,i,o;for(let m of t)m.operator===">"||m.operator===">="?i=w3(i,m,r):m.operator==="<"||m.operator==="<="?o=x3(o,m,r):n.add(m.semver);if(n.size>1)return null;let s;if(i&&o){if(s=Qg(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&&!Zg(m,String(i),r)||o&&!Zg(m,String(o),r))return null;for(let g of e)if(!Zg(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 e){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=w3(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=x3(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)},w3=(t,e,r)=>{if(!t)return e;let n=Qg(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},x3=(t,e,r)=>{if(!t)return e;let n=Qg(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};_3.exports=Gk});var T3=ae((fee,E3)=>{"use strict";var ey=Ll(),M3=Rl(),zk=Mr(),v3=Fg(),qk=Bs(),Vk=KM(),Wk=YM(),$k=QM(),Hk=rv(),Kk=iv(),Xk=sv(),Yk=cv(),Zk=uv(),Jk=hi(),Qk=mv(),eG=gv(),tG=Xd(),rG=xv(),nG=Sv(),iG=If(),oG=Yd(),sG=Ug(),aG=jg(),cG=Zd(),lG=Jd(),uG=zg(),fG=Lv(),hG=Bv(),dG=Pf(),mG=di(),pG=Lf(),gG=Kv(),yG=Yv(),bG=Jv(),wG=t3(),xG=n3(),_G=tm(),SG=l3(),MG=f3(),vG=m3(),EG=g3(),TG=S3();E3.exports={parse:qk,valid:Vk,clean:Wk,inc:$k,diff:Hk,major:Kk,minor:Xk,patch:Yk,prerelease:Zk,compare:Jk,rcompare:Qk,compareLoose:eG,compareBuild:tG,sort:rG,rsort:nG,gt:iG,lt:oG,eq:sG,neq:aG,gte:cG,lte:lG,cmp:uG,coerce:fG,truncate:hG,Comparator:dG,Range:mG,satisfies:pG,toComparators:gG,maxSatisfying:yG,minSatisfying:bG,minVersion:wG,validRange:xG,outside:_G,gtr:SG,ltr:MG,intersects:vG,simplifyRange:EG,subset:TG,SemVer:zk,re:ey.re,src:ey.src,tokens:ey.t,SEMVER_SPEC_VERSION:M3.SEMVER_SPEC_VERSION,RELEASE_TYPES:M3.RELEASE_TYPES,compareIdentifiers:v3.compareIdentifiers,rcompareIdentifiers:v3.rcompareIdentifiers}});var Go,rm=p(()=>{Go={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 Bl,I3,Of,ry,IG,P3,PG,ny,RG,R3,LG,Ol,OG,BG,CG,DG,L3,NG,A3,FG,kG,O3,GG,UG,B3,ty,jG,nm,iy=p(()=>{Bl=require("node:child_process"),I3=require("node:crypto"),Of=me(T3(),1),ry=me(qd(),1);rm();IG=process.env.npm_package_config_libvips||Go.config.libvips,P3=Of.default.coerce(IG).version,PG=["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"],ny={encoding:"utf8",shell:!0},RG=t=>{t instanceof Error?console.error(`sharp: Installation error: ${t.message}`):console.log(`sharp: ${t}`)},R3=()=>ry.default.isNonGlibcLinuxSync()?ry.default.familySync():"",LG=()=>`${process.platform}${R3()}-${process.arch}`,Ol=()=>{if(L3())return"wasm32";let{npm_config_arch:t,npm_config_platform:e,npm_config_libc:r}=process.env,n=typeof r=="string"?r:R3();return`${e||process.platform}${n}-${t||process.arch}`},OG=()=>{try{return require(`@img/sharp-libvips-dev-${Ol()}/include`)}catch{try{return require("@img/sharp-libvips-dev/include")}catch{}}return""},BG=()=>{try{return require("@img/sharp-libvips-dev/cplusplus")}catch{}return""},CG=()=>{try{return require(`@img/sharp-libvips-dev-${Ol()}/lib`)}catch{try{return require(`@img/sharp-libvips-${Ol()}/lib`)}catch{}}return""},DG=()=>{var t;if(((t=process.release)==null?void 0:t.name)==="node"&&process.versions&&!Of.default.satisfies(process.versions.node,Go.engines.node))return{found:process.versions.node,expected:Go.engines.node}},L3=()=>{let{CC:t}=process.env;return!!(t!=null&&t.endsWith("/emcc"))},NG=()=>process.platform==="darwin"&&process.arch==="x64"?((0,Bl.spawnSync)("sysctl sysctl.proc_translated",ny).stdout||"").trim()==="sysctl.proc_translated: 1":!1,A3=t=>(0,I3.createHash)("sha512").update(t).digest("hex"),FG=()=>{try{let t=A3(`imgsharp-libvips-${Ol()}`),e=Of.default.coerce(Go.optionalDependencies[`@img/sharp-libvips-${Ol()}`],{includePrerelease:!0}).version;return A3(`${t}npm:${e}`).slice(0,10)}catch{}return""},kG=()=>(0,Bl.spawnSync)(`node-gyp rebuild --directory=src ${L3()?"--nodedir=emscripten":""}`,{...ny,stdio:"inherit"}).status,O3=()=>process.platform!=="win32"?((0,Bl.spawnSync)("pkg-config --modversion vips-cpp",{...ny,env:{...process.env,PKG_CONFIG_PATH:B3()}}).stdout||"").trim():"",GG=()=>{try{let t=((0,Bl.spawnSync)("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(t)return`${t}/lib/pkgconfig`}catch{}},UG=()=>{try{let t=((0,Bl.spawnSync)("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(t)return t}catch{}},B3=()=>process.platform!=="win32"?[GG(),UG(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":"):"",ty=(t,e,r)=>(r&&r(`Detected ${e}, skipping search for globally-installed libvips`),t),jG=t=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return ty(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",t);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return ty(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",t);if(NG())return ty(!1,"Rosetta",t);let e=O3();return!!e&&Of.default.gte(e,P3)},nm={minimumLibvipsVersion:P3,prebuiltPlatforms:PG,buildPlatformArch:Ol,buildSharpLibvipsIncludeDir:OG,buildSharpLibvipsCPlusPlusDir:BG,buildSharpLibvipsLibDir:CG,isUnsupportedNodeRuntime:DG,runtimePlatformArch:LG,log:RG,yarnLocator:FG,spawnRebuild:kG,globalLibvipsVersion:O3,pkgConfigPath:B3,useGlobalLibvips:jG}});var D3,im,WG,cr,N3,zG,C3,qG,VG,Uo,yt,Cs,it,Bf=p(()=>{D3=require("node:module"),im=me(qd(),1);iy();rm();WG={};cr=(0,D3.createRequire)(WG.url),{version:N3}=Go,{runtimePlatformArch:zG,isUnsupportedNodeRuntime:C3,prebuiltPlatforms:qG,minimumLibvipsVersion:VG}=nm,Uo=zG(),Cs=[];try{yt=cr(`../src/build/Release/sharp-${Uo}-${N3}.node`)}catch(t){Cs.push(t)}if(!yt)try{yt=cr(`../src/build/Release/sharp-wasm32-${N3}.node`)}catch(t){Cs.push(t)}if(!yt)try{switch(Uo){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(Uo)&&!yt._isUsingX64V2()){let t=new Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");t.code="Unsupported CPU",Cs.push(t),yt=null}yt&&process.versions.electron&&Uo.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(t){Cs.push(t)}if(!yt)try{yt=cr("@img/sharp-wasm32/sharp.node")}catch(t){Cs.push(t)}if(!yt){let[t,e,r]=["linux","darwin","win32"].map(o=>Uo.startsWith(o)),n=[`Could not load the "sharp" module using the ${Uo} runtime`];Cs.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=Cs.map(o=>o.message).join(" ");if(n.push("Possible solutions:"),C3()){let{found:o,expected:s}=C3();n.push("- Please upgrade Node.js:",` Found ${o}`,` Requires ${s}`)}else if(qG.includes(Uo)&&!/libstdc\+\+\.so/.test(i)){let[o,s]=Uo.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 >= ${VG}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(t&&/(symbol not found|CXXABI_)/i.test(i))try{let{config:o}=cr(`@img/sharp-libvips-${Uo}/package`),s=`${(0,im.familySync)()} ${(0,im.versionSync)()}`,a=`${o.musl?"musl":"glibc"} ${o.musl||o.glibc}`;n.push("- Update your OS:",` Found ${s}`,` Requires ${a}`)}catch{}throw t&&/\/snap\/core[0-9]{2}/.test(i)&&n.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),e&&/Incompatible library version/.test(i)&&n.push("- Update Homebrew:"," brew update && brew upgrade vips"),Cs.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
- `))}it=yt});function KG(){let t=this.constructor.call(),{debuglog:e,queueListener:r,...n}=this.options;return t.options=structuredClone(n),t.options.debuglog=e,t.options.queueListener=r,this._isStreamInput()&&this._whenStreamInFinished(()=>{this._flattenBufferIn(),t.options.input.buffer=this.options.input.buffer,t.emit("finish")}),t}var F3,om,$G,HG,sc,so,k3=p(()=>{F3=me(require("node:util"),1),om=me(require("node:stream"),1);to();Bf();$G=F3.default.debuglog("sharp"),HG=t=>{sc.queue.emit("change",t)},sc=function(t,e){if(arguments.length===1&&!f.defined(t))throw new Error("Invalid input");return this instanceof sc?(om.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),$G(r)},queueListener:HG},this.options.input=this._createInputDescriptor(t,e,{allowStream:!0}),this):new sc(t,e)};Object.setPrototypeOf(sc.prototype,om.default.Duplex.prototype);Object.setPrototypeOf(sc,om.default.Duplex);Object.assign(sc.prototype,{clone:KG});so=sc});function G3(t){let e=YG.filter(r=>f.defined(t[r])).map(r=>[r,t[r]]);return e.length?Object.fromEntries(e):void 0}function ZG(t,e,r){let n={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(f.string(t))n.file=t;else if(f.buffer(t)){if(t.length===0)throw Error("Input Buffer is empty");n.buffer=t}else if(f.arrayBuffer(t)){if(t.byteLength===0)throw Error("Input bit Array is empty");n.buffer=Buffer.from(t,0,t.byteLength)}else if(f.typedArray(t)){if(t.length===0)throw Error("Input Bit Array is empty");n.buffer=Buffer.from(t.buffer,t.byteOffset,t.byteLength)}else if(f.plainObject(t)&&!f.defined(e))e=t,G3(e)&&(n.buffer=[]);else if(!f.defined(t)&&!f.defined(e)&&f.object(r)&&r.allowStream)n.buffer=[];else if(Array.isArray(t))if(t.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=t.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 '${t}' of type ${typeof t}${f.defined(e)?` when also providing options of type ${typeof e}`:""}`);if(f.object(e)){if(f.defined(e.failOn))if(f.string(e.failOn)&&f.inArray(e.failOn,["none","truncated","error","warning"]))n.failOn=e.failOn;else throw f.invalidParameterError("failOn","one of: none, truncated, error, warning",e.failOn);if(f.defined(e.autoOrient))if(f.bool(e.autoOrient))n.autoOrient=e.autoOrient;else throw f.invalidParameterError("autoOrient","boolean",e.autoOrient);if(f.defined(e.density))if(f.number(e.density)&&f.inRange(e.density,1,1e5))n.density=e.density;else throw f.invalidParameterError("density","number between 1 and 100000",e.density);if(f.defined(e.ignoreIcc))if(f.bool(e.ignoreIcc))n.ignoreIcc=e.ignoreIcc;else throw f.invalidParameterError("ignoreIcc","boolean",e.ignoreIcc);if(f.defined(e.limitInputPixels))if(f.bool(e.limitInputPixels))n.limitInputPixels=e.limitInputPixels?16383**2:0;else if(f.integer(e.limitInputPixels)&&f.inRange(e.limitInputPixels,0,Number.MAX_SAFE_INTEGER))n.limitInputPixels=e.limitInputPixels;else throw f.invalidParameterError("limitInputPixels","positive integer",e.limitInputPixels);if(f.defined(e.limitInputChannels))if(f.bool(e.limitInputChannels))n.limitInputChannels=e.limitInputChannels?5:0;else if(f.integer(e.limitInputChannels)&&f.inRange(e.limitInputChannels,0,Number.MAX_SAFE_INTEGER))n.limitInputChannels=e.limitInputChannels;else throw f.invalidParameterError("limitInputChannels","positive integer",e.limitInputChannels);if(f.defined(e.unlimited))if(f.bool(e.unlimited))n.unlimited=e.unlimited;else throw f.invalidParameterError("unlimited","boolean",e.unlimited);if(f.defined(e.sequentialRead))if(f.bool(e.sequentialRead))n.sequentialRead=e.sequentialRead;else throw f.invalidParameterError("sequentialRead","boolean",e.sequentialRead);if(f.defined(e.raw)){if(f.object(e.raw)&&f.integer(e.raw.width)&&f.inRange(e.raw.width,1,1e8)&&f.integer(e.raw.height)&&f.inRange(e.raw.height,1,1e8)&&f.integer(e.raw.channels)&&f.inRange(e.raw.channels,1,4))switch(n.rawWidth=e.raw.width,n.rawHeight=e.raw.height,n.rawChannels=e.raw.channels,t.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(e.raw.premultiplied))if(f.bool(e.raw.premultiplied))n.rawPremultiplied=e.raw.premultiplied;else throw f.invalidParameterError("raw.premultiplied","boolean",e.raw.premultiplied);if(n.rawPageHeight=0,f.defined(e.raw.pageHeight))if(f.integer(e.raw.pageHeight)&&e.raw.pageHeight>0&&e.raw.pageHeight<=e.raw.height){if(e.raw.height%e.raw.pageHeight!==0)throw new Error(`Expected raw.height ${e.raw.height} to be a multiple of raw.pageHeight ${e.raw.pageHeight}`);n.rawPageHeight=e.raw.pageHeight}else throw f.invalidParameterError("raw.pageHeight","positive integer",e.raw.pageHeight)}if(f.defined(e.animated))if(f.bool(e.animated))n.pages=e.animated?-1:1;else throw f.invalidParameterError("animated","boolean",e.animated);if(f.defined(e.pages))if(f.integer(e.pages)&&f.inRange(e.pages,-1,1e5))n.pages=e.pages;else throw f.invalidParameterError("pages","integer between -1 and 100000",e.pages);if(f.defined(e.page))if(f.integer(e.page)&&f.inRange(e.page,0,1e5))n.page=e.page;else throw f.invalidParameterError("page","integer between 0 and 100000",e.page);if(f.object(e.openSlide)&&f.defined(e.openSlide.level))if(f.integer(e.openSlide.level)&&f.inRange(e.openSlide.level,0,256))n.openSlideLevel=e.openSlide.level;else throw f.invalidParameterError("openSlide.level","integer between 0 and 256",e.openSlide.level);else if(f.defined(e.level))if(f.integer(e.level)&&f.inRange(e.level,0,256))n.openSlideLevel=e.level;else throw f.invalidParameterError("level","integer between 0 and 256",e.level);if(f.object(e.tiff)&&f.defined(e.tiff.subifd))if(f.integer(e.tiff.subifd)&&f.inRange(e.tiff.subifd,-1,1e5))n.tiffSubifd=e.tiff.subifd;else throw f.invalidParameterError("tiff.subifd","integer between -1 and 100000",e.tiff.subifd);else if(f.defined(e.subifd))if(f.integer(e.subifd)&&f.inRange(e.subifd,-1,1e5))n.tiffSubifd=e.subifd;else throw f.invalidParameterError("subifd","integer between -1 and 100000",e.subifd);if(f.object(e.svg)){if(f.defined(e.svg.stylesheet))if(f.string(e.svg.stylesheet))n.svgStylesheet=e.svg.stylesheet;else throw f.invalidParameterError("svg.stylesheet","string",e.svg.stylesheet);if(f.defined(e.svg.highBitdepth))if(f.bool(e.svg.highBitdepth))n.svgHighBitdepth=e.svg.highBitdepth;else throw f.invalidParameterError("svg.highBitdepth","boolean",e.svg.highBitdepth)}if(f.object(e.pdf)&&f.defined(e.pdf.background)?n.pdfBackground=this._getBackgroundColourOption(e.pdf.background):f.defined(e.pdfBackground)&&(n.pdfBackground=this._getBackgroundColourOption(e.pdfBackground)),f.object(e.jp2)&&f.defined(e.jp2.oneshot))if(f.bool(e.jp2.oneshot))n.jp2Oneshot=e.jp2.oneshot;else throw f.invalidParameterError("jp2.oneshot","boolean",e.jp2.oneshot);if(f.defined(e.create))if(f.object(e.create)&&f.integer(e.create.width)&&f.inRange(e.create.width,1,1e8)&&f.integer(e.create.height)&&f.inRange(e.create.height,1,1e8)&&f.integer(e.create.channels)){if(n.createWidth=e.create.width,n.createHeight=e.create.height,n.createChannels=e.create.channels,n.createPageHeight=0,f.defined(e.create.pageHeight))if(f.integer(e.create.pageHeight)&&e.create.pageHeight>0&&e.create.pageHeight<=e.create.height){if(e.create.height%e.create.pageHeight!==0)throw new Error(`Expected create.height ${e.create.height} to be a multiple of create.pageHeight ${e.create.pageHeight}`);n.createPageHeight=e.create.pageHeight}else throw f.invalidParameterError("create.pageHeight","positive integer",e.create.pageHeight);if(f.defined(e.create.noise)){if(!f.object(e.create.noise))throw new Error("Expected noise to be an object");if(e.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(n.createNoiseType=e.create.noise.type,!f.inRange(e.create.channels,1,4))throw f.invalidParameterError("create.channels","number between 1 and 4",e.create.channels);if(n.createNoiseMean=128,f.defined(e.create.noise.mean))if(f.number(e.create.noise.mean)&&f.inRange(e.create.noise.mean,0,1e4))n.createNoiseMean=e.create.noise.mean;else throw f.invalidParameterError("create.noise.mean","number between 0 and 10000",e.create.noise.mean);if(n.createNoiseSigma=30,f.defined(e.create.noise.sigma))if(f.number(e.create.noise.sigma)&&f.inRange(e.create.noise.sigma,0,1e4))n.createNoiseSigma=e.create.noise.sigma;else throw f.invalidParameterError("create.noise.sigma","number between 0 and 10000",e.create.noise.sigma)}else if(f.defined(e.create.background)){if(!f.inRange(e.create.channels,3,4))throw f.invalidParameterError("create.channels","number between 3 and 4",e.create.channels);n.createBackground=this._getBackgroundColourOption(e.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(e.text))if(f.object(e.text)&&f.string(e.text.text)){if(n.textValue=e.text.text,f.defined(e.text.height)&&f.defined(e.text.dpi))throw new Error("Expected only one of dpi or height");if(f.defined(e.text.font))if(f.string(e.text.font))n.textFont=e.text.font;else throw f.invalidParameterError("text.font","string",e.text.font);if(f.defined(e.text.fontfile))if(f.string(e.text.fontfile))n.textFontfile=e.text.fontfile;else throw f.invalidParameterError("text.fontfile","string",e.text.fontfile);if(f.defined(e.text.width))if(f.integer(e.text.width)&&f.inRange(e.text.width,1,1e6))n.textWidth=e.text.width;else throw f.invalidParameterError("text.width","integer between 1 and 1000000",e.text.width);if(f.defined(e.text.height))if(f.integer(e.text.height)&&f.inRange(e.text.height,1,1e6))n.textHeight=e.text.height;else throw f.invalidParameterError("text.height","integer between 1 and 1000000",e.text.height);if(f.defined(e.text.align))if(f.string(e.text.align)&&f.string(this.constructor.align[e.text.align]))n.textAlign=this.constructor.align[e.text.align];else throw f.invalidParameterError("text.align","valid alignment",e.text.align);if(f.defined(e.text.justify))if(f.bool(e.text.justify))n.textJustify=e.text.justify;else throw f.invalidParameterError("text.justify","boolean",e.text.justify);if(f.defined(e.text.dpi))if(f.integer(e.text.dpi)&&f.inRange(e.text.dpi,1,1e6))n.textDpi=e.text.dpi;else throw f.invalidParameterError("text.dpi","integer between 1 and 1000000",e.text.dpi);if(f.defined(e.text.rgba))if(f.bool(e.text.rgba))n.textRgba=e.text.rgba;else throw f.invalidParameterError("text.rgba","bool",e.text.rgba);if(f.defined(e.text.spacing))if(f.integer(e.text.spacing)&&f.inRange(e.text.spacing,-1e6,1e6))n.textSpacing=e.text.spacing;else throw f.invalidParameterError("text.spacing","integer between -1000000 and 1000000",e.text.spacing);if(f.defined(e.text.wrap))if(f.string(e.text.wrap)&&f.inArray(e.text.wrap,["word","char","word-char","none"]))n.textWrap=e.text.wrap;else throw f.invalidParameterError("text.wrap","one of: word, char, word-char, none",e.text.wrap);delete n.buffer}else throw new Error("Expected a valid string to create an image with text.");if(f.defined(e.join))if(f.defined(this.options.join)){if(f.defined(e.join.animated))if(f.bool(e.join.animated))n.joinAnimated=e.join.animated;else throw f.invalidParameterError("join.animated","boolean",e.join.animated);if(f.defined(e.join.across))if(f.integer(e.join.across)&&f.inRange(e.join.across,1,1e6))n.joinAcross=e.join.across;else throw f.invalidParameterError("join.across","integer between 1 and 100000",e.join.across);if(f.defined(e.join.shim))if(f.integer(e.join.shim)&&f.inRange(e.join.shim,0,1e6))n.joinShim=e.join.shim;else throw f.invalidParameterError("join.shim","integer between 0 and 100000",e.join.shim);if(f.defined(e.join.background)&&(n.joinBackground=this._getBackgroundColourOption(e.join.background)),f.defined(e.join.halign))if(f.string(e.join.halign)&&f.string(this.constructor.align[e.join.halign]))n.joinHalign=this.constructor.align[e.join.halign];else throw f.invalidParameterError("join.halign","valid alignment",e.join.halign);if(f.defined(e.join.valign))if(f.string(e.join.valign)&&f.string(this.constructor.align[e.join.valign]))n.joinValign=this.constructor.align[e.join.valign];else throw f.invalidParameterError("join.valign","valid alignment",e.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(f.defined(e))throw new Error(`Invalid input options ${e}`);return n}function JG(t,e,r){Array.isArray(this.options.input.buffer)?f.buffer(t)?(this.options.input.buffer.push(t),r()):r(new Error("Non-Buffer data on Writable Stream")):r(new Error("Unexpected data on Writable Stream"))}function QG(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function eU(){return Array.isArray(this.options.input.buffer)}function tU(t){this.writableFinished?t():this.once("finish",t)}function rU(t){let e=Error();return f.fn(t)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.metadata(this.options,(r,n)=>{r?t(f.nativeError(r,e)):t(null,n)})}):it.metadata(this.options,(r,n)=>{r?t(f.nativeError(r,e)):t(null,n)}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,e)):r(o)})})}):new Promise((r,n)=>{it.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,e)):r(o)})})}function nU(t){let e=Error();return f.fn(t)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.stats(this.options,(r,n)=>{r?t(f.nativeError(r,e)):t(null,n)})}):it.stats(this.options,(r,n)=>{r?t(f.nativeError(r,e)):t(null,n)}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.stats(this.options,(i,o)=>{i?n(f.nativeError(i,e)):r(o)})})}):new Promise((r,n)=>{it.stats(this.options,(i,o)=>{i?n(f.nativeError(i,e)):r(o)})})}var XG,YG,U3,j3=p(()=>{to();Bf();XG={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},YG=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"];U3=t=>{Object.assign(t.prototype,{_inputOptionsFromObject:G3,_createInputDescriptor:ZG,_write:JG,_flattenBufferIn:QG,_isStreamInput:eU,_whenStreamInFinished:tU,metadata:rU,stats:nU}),t.align=XG}});function sy(t){return t.angle%360!==0||t.rotationAngle!==0}function sm(t){return t.width!==-1||t.height!==-1}function sU(t,e,r){if(sm(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(t))if(f.object(t)&&!f.defined(r))r=t;else if(f.integer(t)&&f.inRange(t,1,1e8))this.options.width=t;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",t);else this.options.width=-1;if(f.defined(e))if(f.integer(e)&&f.inRange(e,1,1e8))this.options.height=e;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",e);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=oU[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:W3[r.position]||V3[r.position]||q3[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(oy[r.kernel]))this.options.kernel=oy[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 sy(this.options)&&sm(this.options)&&(this.options.rotateBefore=!0),this}function aU(t){if(f.integer(t))if(f.inRange(t,1,1e8))this.options.extendTop=t,this.options.extendBottom=t,this.options.extendLeft=t,this.options.extendRight=t;else throw f.invalidParameterError("extend","integer between 1 and 100000000",t);else if(f.object(t)){if(f.defined(t.top))if(f.integer(t.top)&&f.inRange(t.top,0,1e8))this.options.extendTop=t.top;else throw f.invalidParameterError("top","integer between 0 and 100000000",t.top);if(f.defined(t.bottom))if(f.integer(t.bottom)&&f.inRange(t.bottom,0,1e8))this.options.extendBottom=t.bottom;else throw f.invalidParameterError("bottom","integer between 0 and 100000000",t.bottom);if(f.defined(t.left))if(f.integer(t.left)&&f.inRange(t.left,0,1e8))this.options.extendLeft=t.left;else throw f.invalidParameterError("left","integer between 0 and 100000000",t.left);if(f.defined(t.right))if(f.integer(t.right)&&f.inRange(t.right,0,1e8))this.options.extendRight=t.right;else throw f.invalidParameterError("right","integer between 0 and 100000000",t.right);if(this._setBackgroundColourOption("extendBackground",t.background),f.defined(t.extendWith))if(f.string(z3[t.extendWith]))this.options.extendWith=z3[t.extendWith];else throw f.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",t.extendWith)}else throw f.invalidParameterError("extend","integer or object",t);return this}function cU(t){let e=sm(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${e}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(r){let n=t[r];if(f.integer(n)&&f.inRange(n,0,1e8))this.options[r+(r==="left"||r==="top"?"Offset":"")+e]=n;else throw f.invalidParameterError(r,"integer between 0 and 100000000",n)},this),sy(this.options)&&!sm(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function lU(t){if(this.options.trimThreshold=10,f.defined(t))if(f.object(t)){if(f.defined(t.background)&&this._setBackgroundColourOption("trimBackground",t.background),f.defined(t.threshold))if(f.number(t.threshold)&&t.threshold>=0)this.options.trimThreshold=t.threshold;else throw f.invalidParameterError("threshold","positive number",t.threshold);if(f.defined(t.lineArt)&&this._setBooleanOption("trimLineArt",t.lineArt),f.defined(t.margin))if(f.integer(t.margin)&&f.inRange(t.margin,0,1e7))this.options.trimMargin=t.margin;else throw f.invalidParameterError("margin","integer between 0 and 10000000",t.margin)}else throw f.invalidParameterError("trim","object",t);return sy(this.options)&&(this.options.rotateBefore=!0),this}var q3,V3,z3,W3,oy,iU,oU,$3,H3=p(()=>{to();q3={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},V3={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},z3={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},W3={entropy:16,attention:17},oy={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},iU={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},oU={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};$3=t=>{Object.assign(t.prototype,{resize:sU,extend:aU,extract:cU,trim:lU}),t.gravity=q3,t.strategy=W3,t.kernel=oy,t.fit=iU,t.position=V3}});function uU(t){if(!Array.isArray(t))throw f.invalidParameterError("images to composite","array",t);return this.options.composite=t.map(e=>{if(!f.object(e))throw f.invalidParameterError("image to composite","object",e);let r=this._inputOptionsFromObject(e),n={input:this._createInputDescriptor(e.input,r,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(f.defined(e.blend))if(f.string(ay[e.blend]))n.blend=ay[e.blend];else throw f.invalidParameterError("blend","valid blend name",e.blend);if(f.defined(e.tile))if(f.bool(e.tile))n.tile=e.tile;else throw f.invalidParameterError("tile","boolean",e.tile);if(f.defined(e.left))if(f.integer(e.left)&&f.inRange(e.left,-1e8,1e8))n.left=e.left;else throw f.invalidParameterError("left","integer between -100000000 and 100000000",e.left);if(f.defined(e.top))if(f.integer(e.top)&&f.inRange(e.top,-1e8,1e8))n.top=e.top;else throw f.invalidParameterError("top","integer between -100000000 and 100000000",e.top);if(f.defined(e.top)!==f.defined(e.left))throw new Error("Expected both left and top to be set");if(n.hasOffset=f.integer(e.top)&&f.integer(e.left),f.defined(e.gravity))if(f.integer(e.gravity)&&f.inRange(e.gravity,0,8))n.gravity=e.gravity;else if(f.string(e.gravity)&&f.integer(this.constructor.gravity[e.gravity]))n.gravity=this.constructor.gravity[e.gravity];else throw f.invalidParameterError("gravity","valid gravity",e.gravity);if(f.defined(e.premultiplied))if(f.bool(e.premultiplied))n.premultiplied=e.premultiplied;else throw f.invalidParameterError("premultiplied","boolean",e.premultiplied);return n}),this}var ay,K3,X3=p(()=>{to();ay={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"};K3=t=>{t.prototype.composite=uU,t.blend=ay}});function fU(t,e){if(!f.defined(t))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(t)&&!(t%90))this.options.angle=t;else if(f.number(t))this.options.rotationAngle=t,f.object(e)&&e.background&&this._setBackgroundColourOption("rotationBackground",e.background);else throw f.invalidParameterError("angle","numeric",t);return this}function hU(){return this.options.input.autoOrient=!0,this}function dU(t){return this.options.flip=f.bool(t)?t:!0,this}function mU(t){return this.options.flop=f.bool(t)?t:!0,this}function pU(t,e){let n=Array.isArray(t)&&(t.length===4&&t.every(f.number)||t.length===2&&t.every(i=>Array.isArray(i)&&i.length===2))?t.flat():[];if(n.length===4&&n.every(f.number))this.options.affineMatrix=n;else throw f.invalidParameterError("matrix","1x4 or 2x2 array",t);if(f.defined(e))if(f.object(e)){if(this._setBackgroundColourOption("affineBackground",e.background),f.defined(e.idx))if(f.number(e.idx))this.options.affineIdx=e.idx;else throw f.invalidParameterError("options.idx","number",e.idx);if(f.defined(e.idy))if(f.number(e.idy))this.options.affineIdy=e.idy;else throw f.invalidParameterError("options.idy","number",e.idy);if(f.defined(e.odx))if(f.number(e.odx))this.options.affineOdx=e.odx;else throw f.invalidParameterError("options.odx","number",e.odx);if(f.defined(e.ody))if(f.number(e.ody))this.options.affineOdy=e.ody;else throw f.invalidParameterError("options.ody","number",e.ody);if(f.defined(e.interpolator))if(f.inArray(e.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=e.interpolator;else throw f.invalidParameterError("options.interpolator","valid interpolator name",e.interpolator)}else throw f.invalidParameterError("options","object",e);return this}function gU(t){if(f.plainObject(t)){if(f.number(t.sigma)&&f.inRange(t.sigma,1e-6,10))this.options.sharpenSigma=t.sigma;else throw f.invalidParameterError("options.sigma","number between 0.000001 and 10",t.sigma);if(f.defined(t.m1))if(f.number(t.m1)&&f.inRange(t.m1,0,1e6))this.options.sharpenM1=t.m1;else throw f.invalidParameterError("options.m1","number between 0 and 1000000",t.m1);if(f.defined(t.m2))if(f.number(t.m2)&&f.inRange(t.m2,0,1e6))this.options.sharpenM2=t.m2;else throw f.invalidParameterError("options.m2","number between 0 and 1000000",t.m2);if(f.defined(t.x1))if(f.number(t.x1)&&f.inRange(t.x1,0,1e6))this.options.sharpenX1=t.x1;else throw f.invalidParameterError("options.x1","number between 0 and 1000000",t.x1);if(f.defined(t.y2))if(f.number(t.y2)&&f.inRange(t.y2,0,1e6))this.options.sharpenY2=t.y2;else throw f.invalidParameterError("options.y2","number between 0 and 1000000",t.y2);if(f.defined(t.y3))if(f.number(t.y3)&&f.inRange(t.y3,0,1e6))this.options.sharpenY3=t.y3;else throw f.invalidParameterError("options.y3","number between 0 and 1000000",t.y3)}else this.options.sharpenSigma=-1;return this}function yU(t){if(!f.defined(t))this.options.medianSize=3;else if(f.integer(t)&&f.inRange(t,1,1e3))this.options.medianSize=t;else throw f.invalidParameterError("size","integer between 1 and 1000",t);return this}function bU(t){let e;if(f.number(t))e=t;else if(f.plainObject(t)){if(!f.number(t.sigma))throw f.invalidParameterError("options.sigma","number between 0.3 and 1000",e);if(e=t.sigma,"precision"in t)if(f.string(Y3[t.precision]))this.options.precision=Y3[t.precision];else throw f.invalidParameterError("precision","one of: integer, float, approximate",t.precision);if("minAmplitude"in t)if(f.number(t.minAmplitude)&&f.inRange(t.minAmplitude,.001,1))this.options.minAmpl=t.minAmplitude;else throw f.invalidParameterError("minAmplitude","number between 0.001 and 1",t.minAmplitude)}if(!f.defined(t))this.options.blurSigma=-1;else if(f.bool(t))this.options.blurSigma=t?-1:0;else if(f.number(e)&&f.inRange(e,.3,1e3))this.options.blurSigma=e;else throw f.invalidParameterError("sigma","number between 0.3 and 1000",e);return this}function wU(t){if(!f.defined(t))this.options.dilateWidth=1;else if(f.integer(t)&&f.inRange(t,1,65536))this.options.dilateWidth=t;else throw f.invalidParameterError("width","integer between 1 and 65536",t);return this}function xU(t){if(!f.defined(t))this.options.erodeWidth=1;else if(f.integer(t)&&f.inRange(t,1,65536))this.options.erodeWidth=t;else throw f.invalidParameterError("width","integer between 1 and 65536",t);return this}function _U(t){return this.options.flatten=f.bool(t)?t:!0,f.object(t)&&this._setBackgroundColourOption("flattenBackground",t.background),this}function SU(){return this.options.unflatten=!0,this}function MU(t,e){if(!f.defined(t))this.options.gamma=2.2;else if(f.number(t)&&f.inRange(t,1,3))this.options.gamma=t;else throw f.invalidParameterError("gamma","number between 1.0 and 3.0",t);if(!f.defined(e))this.options.gammaOut=this.options.gamma;else if(f.number(e)&&f.inRange(e,1,3))this.options.gammaOut=e;else throw f.invalidParameterError("gammaOut","number between 1.0 and 3.0",e);return this}function vU(t){if(this.options.negate=f.bool(t)?t:!0,f.plainObject(t)&&"alpha"in t)if(f.bool(t.alpha))this.options.negateAlpha=t.alpha;else throw f.invalidParameterError("alpha","should be boolean value",t.alpha);return this}function EU(t){if(f.plainObject(t)){if(f.defined(t.lower))if(f.number(t.lower)&&f.inRange(t.lower,0,99))this.options.normaliseLower=t.lower;else throw f.invalidParameterError("lower","number between 0 and 99",t.lower);if(f.defined(t.upper))if(f.number(t.upper)&&f.inRange(t.upper,1,100))this.options.normaliseUpper=t.upper;else throw f.invalidParameterError("upper","number between 1 and 100",t.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 TU(t){return this.normalise(t)}function AU(t){if(f.plainObject(t)){if(f.integer(t.width)&&f.inRange(t.width,1,65536))this.options.claheWidth=t.width;else throw f.invalidParameterError("width","integer between 1 and 65536",t.width);if(f.integer(t.height)&&f.inRange(t.height,1,65536))this.options.claheHeight=t.height;else throw f.invalidParameterError("height","integer between 1 and 65536",t.height);if(f.defined(t.maxSlope))if(f.integer(t.maxSlope)&&f.inRange(t.maxSlope,0,100))this.options.claheMaxSlope=t.maxSlope;else throw f.invalidParameterError("maxSlope","integer between 0 and 100",t.maxSlope)}else throw f.invalidParameterError("options","plain object",t);return this}function IU(t){if(!f.object(t)||!Array.isArray(t.kernel)||!f.integer(t.width)||!f.integer(t.height)||!f.inRange(t.width,3,1001)||!f.inRange(t.height,3,1001)||t.height*t.width!==t.kernel.length||!t.kernel.every(f.number))throw new Error("Invalid convolution kernel");return f.integer(t.scale)||(t.scale=t.kernel.reduce((e,r)=>e+r,0)),t.scale<1&&(t.scale=1),f.integer(t.offset)||(t.offset=0),this.options.convKernel=t,this}function PU(t,e){if(!f.defined(t))this.options.threshold=128;else if(f.bool(t))this.options.threshold=t?128:0;else if(f.integer(t)&&f.inRange(t,0,255))this.options.threshold=t;else throw f.invalidParameterError("threshold","integer between 0 and 255",t);return!f.object(e)||e.greyscale===!0||e.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function RU(t,e,r){if(this.options.boolean=this._createInputDescriptor(t,r),f.string(e)&&f.inArray(e,["and","or","eor"]))this.options.booleanOp=e;else throw f.invalidParameterError("operator","one of: and, or, eor",e);return this}function LU(t,e){if(!f.defined(t)&&f.number(e)?t=1:f.number(t)&&!f.defined(e)&&(e=0),!f.defined(t))this.options.linearA=[];else if(f.number(t))this.options.linearA=[t];else if(Array.isArray(t)&&f.inRange(t.length,1,1e6)&&t.every(f.number))this.options.linearA=t;else throw f.invalidParameterError("a","number or array of numbers",t);if(!f.defined(e))this.options.linearB=[];else if(f.number(e))this.options.linearB=[e];else if(Array.isArray(e)&&f.inRange(e.length,1,1e6)&&e.every(f.number))this.options.linearB=e;else throw f.invalidParameterError("b","number or array of numbers",e);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 OU(t){if(!Array.isArray(t))throw f.invalidParameterError("inputMatrix","array",t);let e=t.length;if(e!==3&&e!==4)throw f.invalidParameterError("inputMatrix","3x3 or 4x4 array",e);if(!t.every(n=>Array.isArray(n)&&n.length===e))throw f.invalidParameterError("inputMatrix",`array of ${e} arrays of length ${e}`,t);let r=t.flat();if(!r.every(f.number))throw f.invalidParameterError("inputMatrix","array of numbers",r);return this.options.recombMatrix=r,this}function BU(t){if(!f.plainObject(t))throw f.invalidParameterError("options","plain object",t);if("brightness"in t)if(f.number(t.brightness)&&t.brightness>=0)this.options.brightness=t.brightness;else throw f.invalidParameterError("brightness","number above zero",t.brightness);if("saturation"in t)if(f.number(t.saturation)&&t.saturation>=0)this.options.saturation=t.saturation;else throw f.invalidParameterError("saturation","number above zero",t.saturation);if("hue"in t)if(f.integer(t.hue))this.options.hue=t.hue%360;else throw f.invalidParameterError("hue","number",t.hue);if("lightness"in t)if(f.number(t.lightness))this.options.lightness=t.lightness;else throw f.invalidParameterError("lightness","number",t.lightness);return this}var Y3,Z3,J3=p(()=>{to();Y3={integer:"integer",float:"float",approximate:"approximate"};Z3=t=>{Object.assign(t.prototype,{autoOrient:hU,rotate:fU,flip:dU,flop:mU,affine:pU,sharpen:gU,erode:xU,dilate:wU,median:yU,blur:bU,flatten:_U,unflatten:SU,gamma:MU,negate:vU,normalise:EU,normalize:TU,clahe:AU,convolve:IU,threshold:PU,boolean:RU,linear:LU,recomb:OU,modulate:BU})}});var iE=ae((Ree,nE)=>{var hy=Object.defineProperty,CU=Object.getOwnPropertyDescriptor,DU=Object.getOwnPropertyNames,NU=Object.prototype.hasOwnProperty,FU=(t,e)=>{for(var r in e)hy(t,r,{get:e[r],enumerable:!0})},kU=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of DU(e))!NU.call(t,i)&&i!==r&&hy(t,i,{get:()=>e[i],enumerable:!(n=CU(e,i))||n.enumerable});return t},GU=t=>kU(hy({},"__esModule",{value:!0}),t),Q3={};FU(Q3,{default:()=>QU});nE.exports=GU(Q3);var cy={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 t in cy)Object.freeze(cy[t]);var ao=Object.freeze(cy),eE=Object.create(null);for(let t in ao)Object.hasOwn(ao,t)&&(eE[ao[t]]=t);var gn={to:{},get:{}};gn.get=function(t){let e=t.slice(0,3).toLowerCase(),r,n;switch(e){case"hsl":{r=gn.get.hsl(t),n="hsl";break}case"hwb":{r=gn.get.hwb(t),n="hwb";break}default:{r=gn.get.rgb(t),n="rgb";break}}return r?{model:n,value:r}:null};gn.get.rgb=function(t){if(!t)return null;let e=/^#([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=t.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=t.match(e)){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=t.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=t.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=t.toLowerCase().match(o))?a[1]==="transparent"?[0,0,0,0]:Object.hasOwn(ao,a[1])?(s=ao[a[1]].slice(),s[3]=1,s):null:null;for(c=0;c<3;c++)s[c]=Ds(s[c],0,255);return s[3]=Ds(s[3],0,1),s};gn.get.hsl=function(t){if(!t)return null;let e=/^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=t.match(e);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,o=Ds(Number.parseFloat(r[2]),0,100),s=Ds(Number.parseFloat(r[3]),0,100),a=Ds(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};gn.get.hwb=function(t){if(!t)return null;let e=/^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=t.match(e);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,o=Ds(Number.parseFloat(r[2]),0,100),s=Ds(Number.parseFloat(r[3]),0,100),a=Ds(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};gn.to.hex=function(...t){return"#"+am(t[0])+am(t[1])+am(t[2])+(t[3]<1?am(Math.round(t[3]*255)):"")};gn.to.rgb=function(...t){return t.length<4||t[3]===1?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"};gn.to.rgb.percent=function(...t){let e=Math.round(t[0]/255*100),r=Math.round(t[1]/255*100),n=Math.round(t[2]/255*100);return t.length<4||t[3]===1?"rgb("+e+"%, "+r+"%, "+n+"%)":"rgba("+e+"%, "+r+"%, "+n+"%, "+t[3]+")"};gn.to.hsl=function(...t){return t.length<4||t[3]===1?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};gn.to.hwb=function(...t){let e="";return t.length>=4&&t[3]!==1&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"};gn.to.keyword=function(...t){return eE[t.slice(0,3)]};function Ds(t,e,r){return Math.min(Math.max(e,t),r)}function am(t){let e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}var Cl=gn,tE={};for(let t of Object.keys(ao))tE[ao[t]]=t;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"]}},ac=X,jo=(6/29)**3;function Nl(t){let e=t>.0031308?1.055*t**.4166666666666667-.055:t*12.92;return Math.min(Math.max(0,e),1)}function Fl(t){return t>.04045?((t+.055)/1.055)**2.4:t/12.92}for(let t of Object.keys(X)){if(!("channels"in X[t]))throw new Error("missing channels property: "+t);if(!("labels"in X[t]))throw new Error("missing channel labels property: "+t);if(X[t].labels.length!==X[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=X[t];delete X[t].channels,delete X[t].labels,Object.defineProperty(X[t],"channels",{value:e}),Object.defineProperty(X[t],"labels",{value:r})}X.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,c;switch(o){case i:{a=0;break}case e:{a=(r-n)/s;break}case r:{a=2+(n-e)/s;break}case n:{a=4+(e-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(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,c=t[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,e=h(s),r=h(a),n=h(c),l){case s:{i=n-r;break}case a:{i=1/3+e-n;break}case c:{i=2/3+r-e;break}}i<0?i+=1:i>1&&(i-=1)}return[i*360,o*100,l*100]};X.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=X.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};X.rgb.oklab=function(t){let e=Fl(t[0]/255),r=Fl(t[1]/255),n=Fl(t[2]/255),i=Math.cbrt(.4122214708*e+.5363325363*r+.0514459929*n),o=Math.cbrt(.2119034982*e+.6806995451*r+.1073969566*n),s=Math.cbrt(.0883024619*e+.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(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),o=(1-e-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 UU(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}X.rgb.keyword=function(t){let e=tE[t];if(e)return e;let r=Number.POSITIVE_INFINITY,n;for(let i of Object.keys(ao)){let o=ao[i],s=UU(t,o);s<r&&(r=s,n=i)}return n};X.keyword.rgb=function(t){return[...ao[t]]};X.rgb.xyz=function(t){let e=Fl(t[0]/255),r=Fl(t[1]/255),n=Fl(t[2]/255),i=e*.4124564+r*.3575761+n*.1804375,o=e*.2126729+r*.7151522+n*.072175,s=e*.0193339+r*.119192+n*.9503041;return[i*100,o*100,s*100]};X.rgb.lab=function(t){let e=X.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>jo?r**(1/3):7.787*r+16/116,n=n>jo?n**(1/3):7.787*n+16/116,i=i>jo?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(t){let e=t[0]/360,r=t[1]/100,n=t[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=e+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(t){let e=t[0],r=t[1]/100,n=t[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[e,a*100,s*100]};X.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),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(t){let e=t[0],r=t[1]/100,n=t[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,[e,o*100,s*100]};X.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-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(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o=1-Math.min(1,e*(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(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2404542+r*-1.5371385+n*-.4985314,o=e*-.969266+r*1.8760108+n*.041556,s=e*.0556434+r*-.2040259+n*1.0572252,i=Nl(i),o=Nl(o),s=Nl(s),[i*255,o*255,s*255]};X.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>jo?e**(1/3):7.787*e+16/116,r=r>jo?r**(1/3):7.787*r+16/116,n=n>jo?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(e-r),s=200*(r-n);return[i,o,s]};X.xyz.oklab=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=Math.cbrt(.8189330101*e+.3618667424*r-.1288597137*n),o=Math.cbrt(.0329845436*e+.9293118715*r+.0361456387*n),s=Math.cbrt(.0482003018*e+.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(t){return X.lab.lch(t)};X.oklab.xyz=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=(.999999998*e+.396337792*r+.215803758*n)**3,o=(1.000000008*e-.105561342*r-.063854175*n)**3,s=(1.000000055*e-.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(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=(e+.3963377774*r+.2158037573*n)**3,o=(e-.1055613458*r-.0638541728*n)**3,s=(e-.0894841775*r-1.291485548*n)**3,a=Nl(4.0767416621*i-3.3077115913*o+.2309699292*s),c=Nl(-1.2684380046*i+2.6097574011*o-.3413193965*s),l=Nl(-.0041960863*i-.7034186147*o+1.707614701*s);return[a*255,c*255,l*255]};X.oklch.oklab=function(t){return X.lch.lab(t)};X.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;let a=o**3,c=i**3,l=s**3;return o=a>jo?a:(o-16/116)/7.787,i=c>jo?c:(i-16/116)/7.787,s=l>jo?l:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};X.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[e,s,i]};X.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[e,o,s]};X.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?X.rgb.hsv(t)[2]:e;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(t){return X.rgb.ansi16(X.hsv.rgb(t),t[2])};X.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e>>4===r>>4&&r>>4===n>>4?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};X.ansi16.rgb=function(t){t=t[0];let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(Math.trunc(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};X.ansi256.rgb=function(t){if(t=t[0],t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};X.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r};X.hex.rgb=function(t){let e=t.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!e)return[0,0,0];let r=e[0];e[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(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,c=s<1?o/(1-s):0;return s<=0?a=0:i===e?a=(r-n)/s%6:i===r?a=2+(n-e)/s:a=4+(e-r)/s,a/=6,a%=1,[a*360,s*100,c*100]};X.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};X.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};X.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%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(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};X.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};X.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};X.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};X.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};X.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};X.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};X.gray.hsl=function(t){return[0,0,t[0]]};X.gray.hsv=X.gray.hsl;X.gray.hwb=function(t){return[0,100,t[0]]};X.gray.cmyk=function(t){return[0,0,0,t[0]]};X.gray.lab=function(t){return[t[0],0,0]};X.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".slice(n.length)+n};X.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};function jU(){let t={},e=Object.keys(ac);for(let{length:r}=e,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function zU(t){let e=jU(),r=[t];for(e[t].distance=0;r.length>0;){let n=r.pop(),i=Object.keys(ac[n]);for(let{length:o}=i,s=0;s<o;s++){let a=i[s],c=e[a];c.distance===-1&&(c.distance=e[n].distance+1,c.parent=n,r.unshift(a))}}return e}function qU(t,e){return function(r){return e(t(r))}}function VU(t,e){let r=[e[t].parent,t],n=ac[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=qU(ac[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}function WU(t){let e=zU(t),r={},n=Object.keys(e);for(let{length:i}=n,o=0;o<i;o++){let s=n[o];e[s].parent!==null&&(r[s]=VU(s,e))}return r}var $U=WU,Dl={},HU=Object.keys(ac);function KU(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function XU(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=t(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 t&&(e.conversion=t.conversion),e}for(let t of HU){Dl[t]={},Object.defineProperty(Dl[t],"channels",{value:ac[t].channels}),Object.defineProperty(Dl[t],"labels",{value:ac[t].labels});let e=$U(t),r=Object.keys(e);for(let n of r){let i=e[n];Dl[t][n]=XU(i),Dl[t][n].raw=KU(i)}}var Dn=Dl,rE=["keyword","gray","hex"],ly={};for(let t of Object.keys(Dn))ly[[...Dn[t].labels].sort().join("")]=t;var uy={};function br(t,e){if(!(this instanceof br))return new br(t,e);if(e&&e in rE&&(e=null),e&&!(e in Dn))throw new Error("Unknown model: "+e);let r,n;if(t==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof br)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if(typeof t=="string"){let i=Cl.get(t);if(i===null)throw new Error("Unable to parse color from string: "+t);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(t.length>0){this.model=e||"rgb",n=Dn[this.model].channels;let i=Array.prototype.slice.call(t,0,n);this.color=fy(i,n),this.valpha=typeof t[n]=="number"?t[n]:1}else if(typeof t=="number")this.model="rgb",this.color=[t>>16&255,t>>8&255,t&255],this.valpha=1;else{this.valpha=1;let i=Object.keys(t);"alpha"in t&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof t.alpha=="number"?t.alpha:0);let o=i.sort().join("");if(!(o in ly))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=ly[o];let{labels:s}=Dn[this.model],a=[];for(r=0;r<s.length;r++)a.push(t[s[r]]);this.color=fy(a)}if(uy[this.model])for(n=Dn[this.model].channels,r=0;r<n;r++){let i=uy[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(t){let e=this.model in Cl.to?this:this.rgb();e=e.round(typeof t=="number"?t:1);let r=e.valpha===1?e.color:[...e.color,this.valpha];return Cl.to[e.model](...r)},percentString(t){let e=this.rgb().round(typeof t=="number"?t:1),r=e.valpha===1?e.color:[...e.color,this.valpha];return Cl.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let t={},{channels:e}=Dn[this.model],{labels:r}=Dn[this.model];for(let n=0;n<e;n++)t[r[n]]=this.color[n];return this.valpha!==1&&(t.alpha=this.valpha),t},unitArray(){let t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,this.valpha!==1&&t.push(this.valpha),t},unitObject(){let t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,this.valpha!==1&&(t.alpha=this.valpha),t},round(t){return t=Math.max(t||0,0),new br([...this.color.map(ZU(t)),this.valpha],this.model)},alpha(t){return t!==void 0?new br([...this.color,Math.max(0,Math.min(1,t))],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,t=>(t%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(t){return t!==void 0?new br(t):Dn[this.model].keyword(this.color)},hex(t){return t!==void 0?new br(t):Cl.to.hex(...this.rgb().round().color)},hexa(t){if(t!==void 0)return new br(t);let e=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r="0"+r),Cl.to.hex(...e)+r},rgbNumber(){let t=this.rgb().color;return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255},luminosity(){let t=this.rgb().color,e=[];for(let[r,n]of t.entries()){let i=n/255;e[r]=i<=.04045?i/12.92:((i+.055)/1.055)**2.4}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast(t){let e=this.luminosity(),r=t.luminosity();return e>r?(e+.05)/(r+.05):(r+.05)/(e+.05)},level(t){let e=this.contrast(t);return e>=7?"AAA":e>=4.5?"AA":""},isDark(){let t=this.rgb().color;return(t[0]*2126+t[1]*7152+t[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let t=this.rgb();for(let e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten(t){let e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){let e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate(t){let e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate(t){let e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten(t){let e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken(t){let e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale(){let t=this.rgb().color,e=t[0]*.3+t[1]*.59+t[2]*.11;return br.rgb(e,e,e)},fade(t){return this.alpha(this.valpha-this.valpha*t)},opaquer(t){return this.alpha(this.valpha+this.valpha*t)},rotate(t){let e=this.hsl(),r=e.color[0];return r=(r+t)%360,r=r<0?360+r:r,e.color[0]=r,e},mix(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);let r=t.rgb(),n=this.rgb(),i=e===void 0?.5:e,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 t of Object.keys(Dn)){if(rE.includes(t))continue;let{channels:e}=Dn[t];br.prototype[t]=function(...r){return this.model===t?new br(this):r.length>0?new br(r,t):new br([...JU(Dn[this.model][t].raw(this.color)),this.valpha],t)},br[t]=function(...r){let n=r[0];return typeof n=="number"&&(n=fy(r,e)),new br(n,t)}}function YU(t,e){return Number(t.toFixed(e))}function ZU(t){return function(e){return YU(e,t)}}function qt(t,e,r){t=Array.isArray(t)?t:[t];for(let n of t)(uy[n]||=[])[e]=r;return t=t[0],function(n){let i;return n!==void 0?(r&&(n=r(n)),i=this[t](),i.color[e]=n,i):(i=this[t]().color[e],r&&(i=r(i)),i)}}function lr(t){return function(e){return Math.max(0,Math.min(t,e))}}function JU(t){return Array.isArray(t)?t:[t]}function fy(t,e){for(let r=0;r<e;r++)typeof t[r]!="number"&&(t[r]=0);return t}var QU=br});var sE=ae((Lee,oE)=>{oE.exports=iE().default});function ej(t){return this._setBackgroundColourOption("tint",t),this}function tj(t){return this.options.greyscale=f.bool(t)?t:!0,this}function rj(t){return this.greyscale(t)}function nj(t){if(!f.string(t))throw f.invalidParameterError("colourspace","string",t);return this.options.colourspacePipeline=t,this}function ij(t){return this.pipelineColourspace(t)}function oj(t){if(!f.string(t))throw f.invalidParameterError("colourspace","string",t);return this.options.colourspace=t,this}function sj(t){return this.toColourspace(t)}function lE(t){if(f.object(t)||f.string(t)&&t.length>=3&&t.length<=200){let e=(0,cE.default)(t),r=e.red(),n=e.green(),i=e.blue(),o=Math.round(e.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",t)}function aj(t,e){f.defined(e)&&(this.options[t]=lE(e))}var cE,aE,uE,fE=p(()=>{cE=me(sE(),1);to();aE={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};uE=t=>{Object.assign(t.prototype,{tint:ej,greyscale:tj,grayscale:rj,pipelineColourspace:nj,pipelineColorspace:ij,toColourspace:oj,toColorspace:sj,_getBackgroundColourOption:lE,_setBackgroundColourOption:aj}),t.colourspace=aE,t.colorspace=aE}});function lj(){return this.options.removeAlpha=!0,this}function uj(t){if(f.defined(t))if(f.number(t)&&f.inRange(t,0,1))this.options.ensureAlpha=t;else throw f.invalidParameterError("alpha","number between 0 and 1",t);else this.options.ensureAlpha=1;return this}function fj(t){let e={red:0,green:1,blue:2,alpha:3};if(Object.keys(e).includes(t)&&(t=e[t]),f.integer(t)&&f.inRange(t,0,4))this.options.extractChannel=t;else throw f.invalidParameterError("channel","integer or one of: red, green, blue, alpha",t);return this}function hj(t,e){return Array.isArray(t)?t.forEach(function(r){this.options.joinChannelIn.push(this._createInputDescriptor(r,e))},this):this.options.joinChannelIn.push(this._createInputDescriptor(t,e)),this}function dj(t){if(f.string(t)&&f.inArray(t,["and","or","eor"]))this.options.bandBoolOp=t;else throw f.invalidParameterError("boolOp","one of: and, or, eor",t);return this}var cj,hE,dE=p(()=>{to();cj={and:"and",or:"or",eor:"eor"};hE=t=>{Object.assign(t.prototype,{removeAlpha:lj,ensureAlpha:uj,extractChannel:fj,joinChannel:hj,bandbool:dj}),t.bool=cj}});function pj(t,e){let r;if(f.string(t)?f.string(this.options.input.file)&&cm.default.resolve(this.options.input.file)===cm.default.resolve(t)?r=new Error("Cannot use same file for input and output"):mj.test(cm.default.extname(t))&&!this.constructor.format.jp2.output.file&&(r=pE()):r=new Error("Missing output file path"),r)if(f.fn(e))e(r);else return Promise.reject(r);else{this.options.fileOut=t;let n=Error();return this._pipeline(e,n)}return this}function gj(t,e){f.object(t)?this._setBooleanOption("resolveWithObject",t.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let r=Error();return this._pipeline(f.fn(t)?t:e,r)}function yj(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let t=Error();return this._pipeline(null,t)}function bj(t){if(f.number(t)&&t>0)this.options.withMetadataDensity=t;else throw f.invalidParameterError("density","positive number",t);return this.keepExif()}function wj(){return this.options.keepMetadata|=1,this}function xj(t){if(f.object(t))for(let[e,r]of Object.entries(t))if(f.object(r))for(let[n,i]of Object.entries(r))if(f.string(i))this.options.withExif[`exif-${e.toLowerCase()}-${n}`]=i;else throw f.invalidParameterError(`${e}.${n}`,"string",i);else throw f.invalidParameterError(e,"object",r);else throw f.invalidParameterError("exif","object",t);return this.options.withExifMerge=!1,this.keepExif()}function _j(t){return this.withExif(t),this.options.withExifMerge=!0,this}function Sj(){return this.options.keepMetadata|=8,this}function Mj(t,e){if(f.string(t))this.options.withIccProfile=t;else throw f.invalidParameterError("icc","string",t);if(this.keepIccProfile(),f.object(e)&&f.defined(e.attach))if(f.bool(e.attach))e.attach||(this.options.keepMetadata&=-9);else throw f.invalidParameterError("attach","boolean",e.attach);return this}function vj(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function Ej(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function Tj(){return this.options.keepMetadata|=2,this}function Aj(t){if(f.string(t)&&t.length>0)this.options.withXmp=t,this.options.keepMetadata|=2;else throw f.invalidParameterError("xmp","non-empty string",t);return this}function Ij(){return this.options.keepMetadata|=31,this}function Pj(t){if(this.keepMetadata(),this.withIccProfile("srgb"),f.object(t)){if(f.defined(t.orientation))if(f.integer(t.orientation)&&f.inRange(t.orientation,1,8))this.options.withMetadataOrientation=t.orientation;else throw f.invalidParameterError("orientation","integer between 1 and 8",t.orientation);if(f.defined(t.density))if(f.number(t.density)&&t.density>0)this.options.withMetadataDensity=t.density;else throw f.invalidParameterError("density","positive number",t.density);f.defined(t.icc)&&this.withIccProfile(t.icc),f.defined(t.exif)&&this.withExifMerge(t.exif)}return this}function Rj(t,e){let r=mE.get((f.object(t)&&f.string(t.id)?t.id:t).toLowerCase());if(!r)throw f.invalidParameterError("format",`one of: ${[...mE.keys()].join(", ")}`,t);return this[r](e)}function Lj(t){if(f.object(t)){if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,1,100))this.options.jpegQuality=t.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",t.quality);if(f.defined(t.progressive)&&this._setBooleanOption("jpegProgressive",t.progressive),f.defined(t.chromaSubsampling))if(f.string(t.chromaSubsampling)&&f.inArray(t.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=t.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",t.chromaSubsampling);let e=f.bool(t.optimizeCoding)?t.optimizeCoding:t.optimiseCoding;if(f.defined(e)&&this._setBooleanOption("jpegOptimiseCoding",e),f.defined(t.mozjpeg))if(f.bool(t.mozjpeg))t.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",t.mozjpeg);let r=f.bool(t.trellisQuantization)?t.trellisQuantization:t.trellisQuantisation;f.defined(r)&&this._setBooleanOption("jpegTrellisQuantisation",r),f.defined(t.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",t.overshootDeringing);let n=f.bool(t.optimizeScans)?t.optimizeScans:t.optimiseScans;f.defined(n)&&(this._setBooleanOption("jpegOptimiseScans",n),n&&(this.options.jpegProgressive=!0));let i=f.number(t.quantizationTable)?t.quantizationTable:t.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",t)}function Oj(t){if(f.object(t)){if(f.defined(t.progressive)&&this._setBooleanOption("pngProgressive",t.progressive),f.defined(t.compressionLevel))if(f.integer(t.compressionLevel)&&f.inRange(t.compressionLevel,0,9))this.options.pngCompressionLevel=t.compressionLevel;else throw f.invalidParameterError("compressionLevel","integer between 0 and 9",t.compressionLevel);f.defined(t.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",t.adaptiveFiltering);let e=t.colours||t.colors;if(f.defined(e))if(f.integer(e)&&f.inRange(e,2,256))this.options.pngBitdepth=gE(e);else throw f.invalidParameterError("colours","integer between 2 and 256",e);if(f.defined(t.palette)?this._setBooleanOption("pngPalette",t.palette):[t.quality,t.effort,t.colours,t.colors,t.dither].some(f.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,0,100))this.options.pngQuality=t.quality;else throw f.invalidParameterError("quality","integer between 0 and 100",t.quality);if(f.defined(t.effort))if(f.integer(t.effort)&&f.inRange(t.effort,1,10))this.options.pngEffort=t.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",t.effort);if(f.defined(t.dither))if(f.number(t.dither)&&f.inRange(t.dither,0,1))this.options.pngDither=t.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",t.dither)}}return this._updateFormatOut("png",t)}function Bj(t){if(f.object(t)){if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,1,100))this.options.webpQuality=t.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",t.quality);if(f.defined(t.alphaQuality))if(f.integer(t.alphaQuality)&&f.inRange(t.alphaQuality,0,100))this.options.webpAlphaQuality=t.alphaQuality;else throw f.invalidParameterError("alphaQuality","integer between 0 and 100",t.alphaQuality);if(f.defined(t.lossless)&&this._setBooleanOption("webpLossless",t.lossless),f.defined(t.nearLossless)&&this._setBooleanOption("webpNearLossless",t.nearLossless),f.defined(t.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",t.smartSubsample),f.defined(t.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",t.smartDeblock),f.defined(t.preset))if(f.string(t.preset)&&f.inArray(t.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=t.preset;else throw f.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",t.preset);if(f.defined(t.effort))if(f.integer(t.effort)&&f.inRange(t.effort,0,6))this.options.webpEffort=t.effort;else throw f.invalidParameterError("effort","integer between 0 and 6",t.effort);f.defined(t.minSize)&&this._setBooleanOption("webpMinSize",t.minSize),f.defined(t.mixed)&&this._setBooleanOption("webpMixed",t.mixed),f.defined(t.exact)&&this._setBooleanOption("webpExact",t.exact)}return dy(t,this.options),this._updateFormatOut("webp",t)}function Cj(t){if(f.object(t)){f.defined(t.reuse)&&this._setBooleanOption("gifReuse",t.reuse),f.defined(t.progressive)&&this._setBooleanOption("gifProgressive",t.progressive);let e=t.colours||t.colors;if(f.defined(e))if(f.integer(e)&&f.inRange(e,2,256))this.options.gifBitdepth=gE(e);else throw f.invalidParameterError("colours","integer between 2 and 256",e);if(f.defined(t.effort))if(f.integer(t.effort)&&f.inRange(t.effort,1,10))this.options.gifEffort=t.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",t.effort);if(f.defined(t.dither))if(f.number(t.dither)&&f.inRange(t.dither,0,1))this.options.gifDither=t.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",t.dither);if(f.defined(t.interFrameMaxError))if(f.number(t.interFrameMaxError)&&f.inRange(t.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=t.interFrameMaxError;else throw f.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",t.interFrameMaxError);if(f.defined(t.interPaletteMaxError))if(f.number(t.interPaletteMaxError)&&f.inRange(t.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=t.interPaletteMaxError;else throw f.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",t.interPaletteMaxError);if(f.defined(t.keepDuplicateFrames))if(f.bool(t.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",t.keepDuplicateFrames);else throw f.invalidParameterError("keepDuplicateFrames","boolean",t.keepDuplicateFrames)}return dy(t,this.options),this._updateFormatOut("gif",t)}function Dj(t){if(!this.constructor.format.jp2.output.buffer)throw pE();if(f.object(t)){if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,1,100))this.options.jp2Quality=t.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",t.quality);if(f.defined(t.lossless))if(f.bool(t.lossless))this.options.jp2Lossless=t.lossless;else throw f.invalidParameterError("lossless","boolean",t.lossless);if(f.defined(t.tileWidth))if(f.integer(t.tileWidth)&&f.inRange(t.tileWidth,1,32768))this.options.jp2TileWidth=t.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",t.tileWidth);if(f.defined(t.tileHeight))if(f.integer(t.tileHeight)&&f.inRange(t.tileHeight,1,32768))this.options.jp2TileHeight=t.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",t.tileHeight);if(f.defined(t.chromaSubsampling))if(f.string(t.chromaSubsampling)&&f.inArray(t.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=t.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",t.chromaSubsampling)}return this._updateFormatOut("jp2",t)}function dy(t,e){if(f.object(t)&&f.defined(t.loop))if(f.integer(t.loop)&&f.inRange(t.loop,0,65535))e.loop=t.loop;else throw f.invalidParameterError("loop","integer between 0 and 65535",t.loop);if(f.object(t)&&f.defined(t.delay))if(f.integer(t.delay)&&f.inRange(t.delay,0,65535))e.delay=[t.delay];else if(Array.isArray(t.delay)&&f.inRange(t.delay.length,1,1e6)&&t.delay.every(f.integer)&&t.delay.every(r=>f.inRange(r,0,65535)))e.delay=t.delay;else throw f.invalidParameterError("delay","integer or an array of integers between 0 and 65535",t.delay)}function Nj(t){if(f.object(t)){if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,1,100))this.options.tiffQuality=t.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",t.quality);if(f.defined(t.bitdepth))if(f.integer(t.bitdepth)&&f.inArray(t.bitdepth,[1,2,4]))this.options.tiffBitdepth=t.bitdepth;else throw f.invalidParameterError("bitdepth","1, 2 or 4",t.bitdepth);if(f.defined(t.tile)&&this._setBooleanOption("tiffTile",t.tile),f.defined(t.tileWidth))if(f.integer(t.tileWidth)&&f.inRange(t.tileWidth,1,32768))this.options.tiffTileWidth=t.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",t.tileWidth);if(f.defined(t.tileHeight))if(f.integer(t.tileHeight)&&f.inRange(t.tileHeight,1,32768))this.options.tiffTileHeight=t.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",t.tileHeight);if(f.defined(t.miniswhite)&&this._setBooleanOption("tiffMiniswhite",t.miniswhite),f.defined(t.pyramid)&&this._setBooleanOption("tiffPyramid",t.pyramid),f.defined(t.xres))if(f.number(t.xres)&&f.inRange(t.xres,.001,1e6))this.options.tiffXres=t.xres;else throw f.invalidParameterError("xres","number between 0.001 and 1000000",t.xres);if(f.defined(t.yres))if(f.number(t.yres)&&f.inRange(t.yres,.001,1e6))this.options.tiffYres=t.yres;else throw f.invalidParameterError("yres","number between 0.001 and 1000000",t.yres);if(f.defined(t.compression))if(f.string(t.compression)&&f.inArray(t.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=t.compression;else throw f.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",t.compression);if(f.defined(t.bigtiff)&&this._setBooleanOption("tiffBigtiff",t.bigtiff),f.defined(t.predictor))if(f.string(t.predictor)&&f.inArray(t.predictor,["none","horizontal","float"]))this.options.tiffPredictor=t.predictor;else throw f.invalidParameterError("predictor","one of: none, horizontal, float",t.predictor);if(f.defined(t.resolutionUnit))if(f.string(t.resolutionUnit)&&f.inArray(t.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=t.resolutionUnit;else throw f.invalidParameterError("resolutionUnit","one of: inch, cm",t.resolutionUnit)}return this._updateFormatOut("tiff",t)}function Fj(t){return this.heif({...t,compression:"av1"})}function kj(t){if(f.object(t)){if(f.string(t.compression)&&f.inArray(t.compression,["av1","hevc"]))this.options.heifCompression=t.compression;else throw f.invalidParameterError("compression","one of: av1, hevc",t.compression);if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,1,100))this.options.heifQuality=t.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",t.quality);if(f.defined(t.lossless))if(f.bool(t.lossless))this.options.heifLossless=t.lossless;else throw f.invalidParameterError("lossless","boolean",t.lossless);if(f.defined(t.effort))if(f.integer(t.effort)&&f.inRange(t.effort,0,9))this.options.heifEffort=t.effort;else throw f.invalidParameterError("effort","integer between 0 and 9",t.effort);if(f.defined(t.chromaSubsampling))if(f.string(t.chromaSubsampling)&&f.inArray(t.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=t.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",t.chromaSubsampling);if(f.defined(t.bitdepth))if(f.integer(t.bitdepth)&&f.inArray(t.bitdepth,[8,10,12]))this.options.heifBitdepth=t.bitdepth;else throw f.invalidParameterError("bitdepth","8, 10 or 12",t.bitdepth);if(f.defined(t.tune))if(f.string(t.tune)&&f.inArray(t.tune,["auto","iq","psnr","ssim"]))this.options.heifLossless&&t.tune==="iq"?this.options.heifTune="ssim":this.options.heifTune=t.tune;else throw f.invalidParameterError("tune","one of: auto, iq, psnr, ssim",t.tune)}else throw f.invalidParameterError("options","Object",t);return this._updateFormatOut("heif",t)}function Gj(t){if(f.object(t)){if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,1,100))this.options.jxlDistance=t.quality>=30?.1+(100-t.quality)*.09:53/3e3*t.quality*t.quality-23/20*t.quality+25;else throw f.invalidParameterError("quality","integer between 1 and 100",t.quality);else if(f.defined(t.distance))if(f.number(t.distance)&&f.inRange(t.distance,0,15))this.options.jxlDistance=t.distance;else throw f.invalidParameterError("distance","number between 0.0 and 15.0",t.distance);if(f.defined(t.decodingTier))if(f.integer(t.decodingTier)&&f.inRange(t.decodingTier,0,4))this.options.jxlDecodingTier=t.decodingTier;else throw f.invalidParameterError("decodingTier","integer between 0 and 4",t.decodingTier);if(f.defined(t.lossless))if(f.bool(t.lossless))this.options.jxlLossless=t.lossless;else throw f.invalidParameterError("lossless","boolean",t.lossless);if(f.defined(t.effort))if(f.integer(t.effort)&&f.inRange(t.effort,1,9))this.options.jxlEffort=t.effort;else throw f.invalidParameterError("effort","integer between 1 and 9",t.effort)}return dy(t,this.options),this._updateFormatOut("jxl",t)}function Uj(t){if(f.object(t)&&f.defined(t.depth))if(f.string(t.depth)&&f.inArray(t.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=t.depth;else throw f.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",t.depth);return this._updateFormatOut("raw")}function jj(t){if(f.object(t)){if(f.defined(t.size))if(f.integer(t.size)&&f.inRange(t.size,1,8192))this.options.tileSize=t.size;else throw f.invalidParameterError("size","integer between 1 and 8192",t.size);if(f.defined(t.overlap))if(f.integer(t.overlap)&&f.inRange(t.overlap,0,8192)){if(t.overlap>this.options.tileSize)throw f.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,t.overlap);this.options.tileOverlap=t.overlap}else throw f.invalidParameterError("overlap","integer between 0 and 8192",t.overlap);if(f.defined(t.container))if(f.string(t.container)&&f.inArray(t.container,["fs","zip"]))this.options.tileContainer=t.container;else throw f.invalidParameterError("container","one of: fs, zip",t.container);if(f.defined(t.layout))if(f.string(t.layout)&&f.inArray(t.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=t.layout;else throw f.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",t.layout);if(f.defined(t.angle))if(f.integer(t.angle)&&!(t.angle%90))this.options.tileAngle=t.angle;else throw f.invalidParameterError("angle","positive/negative multiple of 90",t.angle);if(this._setBackgroundColourOption("tileBackground",t.background),f.defined(t.depth))if(f.string(t.depth)&&f.inArray(t.depth,["onepixel","onetile","one"]))this.options.tileDepth=t.depth;else throw f.invalidParameterError("depth","one of: onepixel, onetile, one",t.depth);if(f.defined(t.skipBlanks))if(f.integer(t.skipBlanks)&&f.inRange(t.skipBlanks,-1,65535))this.options.tileSkipBlanks=t.skipBlanks;else throw f.invalidParameterError("skipBlanks","integer between -1 and 255/65535",t.skipBlanks);else f.defined(t.layout)&&t.layout==="google"&&(this.options.tileSkipBlanks=5);let e=f.bool(t.center)?t.center:t.centre;if(f.defined(e)&&this._setBooleanOption("tileCentre",e),f.defined(t.id))if(f.string(t.id))this.options.tileId=t.id;else throw f.invalidParameterError("id","string",t.id);if(f.defined(t.basename))if(f.string(t.basename))this.options.tileBasename=t.basename;else throw f.invalidParameterError("basename","string",t.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 zj(t){if(!f.plainObject(t))throw f.invalidParameterError("options","object",t);if(f.integer(t.seconds)&&f.inRange(t.seconds,0,3600))this.options.timeoutSeconds=t.seconds;else throw f.invalidParameterError("seconds","integer between 0 and 3600",t.seconds);return this}function qj(t,e){return f.object(e)&&e.force===!1||(this.options.formatOut=t),this}function Vj(t,e){if(f.bool(e))this.options[t]=e;else throw f.invalidParameterError(t,"boolean",e)}function Wj(){if(!this.options.streamOut){this.options.streamOut=!0;let t=Error();this._pipeline(void 0,t)}}function $j(t,e){return typeof t=="function"?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.pipeline(this.options,(r,n,i)=>{r?t(f.nativeError(r,e)):t(null,n,i)})}):it.pipeline(this.options,(r,n,i)=>{r?t(f.nativeError(r,e)):t(null,n,i)}),this):this.options.streamOut?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.pipeline(this.options,(r,n,i)=>{r?this.emit("error",f.nativeError(r,e)):(this.emit("info",i),this.push(n)),this.push(null),this.on("end",()=>this.emit("close"))})}):it.pipeline(this.options,(r,n,i)=>{r?this.emit("error",f.nativeError(r,e)):(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(),it.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,e)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}):new Promise((r,n)=>{it.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,e)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}var cm,mE,mj,pE,gE,yE,bE=p(()=>{cm=me(require("node:path"),1);to();Bf();mE=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"]]),mj=/\.(jp[2x]|j2[kc])$/i,pE=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),gE=t=>1<<32-Math.clz32(Math.ceil(Math.log2(t))-1);yE=t=>{Object.assign(t.prototype,{toFile:pj,toBuffer:gj,toUint8Array:yj,withDensity:bj,keepExif:wj,withExif:xj,withExifMerge:_j,keepIccProfile:Sj,withIccProfile:Mj,keepGainMap:vj,withGainMap:Ej,keepXmp:Tj,withXmp:Aj,keepMetadata:Ij,withMetadata:Pj,toFormat:Rj,jpeg:Lj,jp2:Dj,png:Oj,webp:Bj,tiff:Nj,avif:Fj,heif:kj,jxl:Gj,gif:Cj,raw:Uj,tile:jj,timeout:zj,_updateFormatOut:qj,_setBooleanOption:Vj,_read:Wj,_pipeline:$j})}});function ME(t){if(f.bool(t))return t?it.cache(50,20,100):it.cache(0,0,0);if(f.object(t)){for(let e of["memory","files","items"]){let r=t[e];if(f.defined(r)&&!(f.integer(r)&&r>=0))throw f.invalidParameterError(e,"a positive integer",r)}return it.cache(t.memory,t.files,t.items)}else return it.cache()}function Kj(t){return it.concurrency(f.integer(t)?t:null)}function Yj(){return it.counters()}function Zj(t){return it.simd(f.bool(t)?t:null)}function Jj(t){if(f.object(t))if(Array.isArray(t.operation)&&t.operation.every(f.string))it.block(t.operation,!0);else throw f.invalidParameterError("operation","Array<string>",t.operation);else throw f.invalidParameterError("options","object",t)}function Qj(t){if(f.object(t))if(Array.isArray(t.operation)&&t.operation.every(f.string))it.block(t.operation,!1);else throw f.invalidParameterError("operation","Array<string>",t.operation);else throw f.invalidParameterError("options","object",t)}var xE,_E,SE,Cf,ez,my,wE,py,Ns,Hj,kl,Xj,vE,EE=p(()=>{xE=me(require("node:events"),1),_E=require("node:module"),SE=require("node:os"),Cf=me(qd(),1);to();iy();Bf();rm();ez={};my=(0,_E.createRequire)(ez.url),wE=nm.runtimePlatformArch(),py=it.libvipsVersion(),Ns=it.format();Ns.heif.output.alias=["avif","heic"];Ns.jpeg.output.alias=["jpe","jpg"];Ns.tiff.output.alias=["tif"];Ns.jp2.output.alias=["j2c","j2k","jp2","jpx"];Hj={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},kl={vips:py.semver};if(!py.isGlobal)if(py.isWasm)try{kl=my("@img/sharp-wasm32/versions")}catch{}else try{kl=my(`@img/sharp-${wE}/versions`)}catch{try{kl=my(`@img/sharp-libvips-${wE}/versions`)}catch{}}kl.sharp=Go.version;kl.heif&&Ns.heif&&(Ns.heif.input.fileSuffix=[".avif"],Ns.heif.output.alias=["avif"]);ME(!0);!process.env.MALLOC_ARENA_MAX&&Cf.default.familySync()===Cf.default.GLIBC&&!it._isUsingJemalloc()?it.concurrency(1):Cf.default.familySync()===Cf.default.MUSL&&it.concurrency()===1024&&it.concurrency((0,SE.availableParallelism)());Xj=new xE.default.EventEmitter;vE=t=>{t.cache=ME,t.concurrency=Kj,t.counters=Yj,t.simd=Zj,t.format=Ns,t.interpolators=Hj,t.versions=kl,t.queue=Xj,t.block=Jj,t.unblock=Qj}});var TE={};Qt(TE,{default:()=>tz});var tz,AE=p(()=>{k3();j3();H3();X3();J3();fE();dE();bE();EE();U3(so);$3(so);K3(so);Z3(so);uE(so);hE(so);yE(so);vE(so);tz=so});async function Ul(t,e,r,n){return n._parse(t,e,r,n)}var UE=p(()=>{"use strict"});function jl(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var jE=p(()=>{"use strict"});var co,lz,uz,fz,hz,Mm,zE,dz,qE=p(()=>{"use strict";co={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},lz=co.self||co.window||co.global||{},uz=co.window||co.self||co.global||{},fz=co.global||co.self||co.window||{},hz=co.document||{},Mm=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),zE=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),dz=zE&&parseFloat(zE[1])||0});function pz(){let t=new No({id:"loaders.gl"});return globalThis.loaders||={},globalThis.loaders.log=t,globalThis.loaders.version=mz,globalThis.probe||={},globalThis.probe.loaders=t,t}function Nf(){}function Li(t){var r;let e=(r=t==null?void 0:t.core)==null?void 0:r.log;return e===null?gz:e||vm}var Ey,mz,vm,Ty,gz,Ay=p(()=>{"use strict";Tg();Ey="5.0.0-beta.10",mz=Ey[0]>="0"&&Ey[0]<="9"?`v${Ey}`:"";vm=pz(),Ty=class{log(){return Nf}info(){return Nf}once(){return Nf}warn(){return Nf}error(){return Nf}};gz=new Ty});function zl(t,e){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(e(a))}catch(c){n(c)}}}try{let a=t(s,o);a==null||a.then(s,o)}catch(a){o(a)}})}var VE=p(()=>{"use strict"});function Iy(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function Py(t){var r,n;return((n=(r=globalThis.loaders)==null?void 0:r.modules)==null?void 0:n[t])||null}var Ry=p(()=>{"use strict"});function yz(){let t="5.0.0-beta.10";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=t,t}var WE,$E=p(()=>{"use strict";WE=yz()});function HE(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var KE=p(()=>{"use strict"});var lo,rre,nre,ire,ore,Oi,lc,sre,XE,are,Ly=p(()=>{"use strict";lo={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},rre=lo.self||lo.window||lo.global||{},nre=lo.window||lo.self||lo.global||{},ire=lo.global||lo.self||lo.window||{},ore=lo.document||{},Oi=typeof process!="object"||String(process)!=="[object process]"||process.browser,lc=typeof importScripts=="function",sre=typeof window<"u"&&typeof window.orientation<"u",XE=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),are=XE&&parseFloat(XE[1])||0});var Oy,YE,ZE=p(()=>{Oy=require("worker_threads"),YE=Oy.parentPort});function uc(t,e=!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),JE(s))n.add(s);else if(ArrayBuffer.isView(s))JE(s.buffer)&&n.add(s.buffer);else if(e&&typeof MessageChannel<"u"&&s instanceof MessageChannel)o(s.port1),o(s.port2);else if(e&&s instanceof Map)for(let[a,c]of s)o(a),o(c);else if(e&&s instanceof Set)for(let a of s)o(a);else if(e)for(let a of Object.keys(s))o(s[a])}}return o(t),r===void 0?Array.from(n):[]}function JE(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}var By=p(()=>{});async function ql(){return YE}function bz(t){if(!t||typeof t!="object")return null;let e="data"in t&&t.type==="message"?t.data:t;return e&&typeof e.source=="string"&&e.source.startsWith("loaders.gl")?e:null}var Em,Vt,Cy=p(()=>{By();ZE();Em=new Map,Vt=class{static async inWorkerThread(){let e=globalThis.WorkerGlobalScope;return typeof e=="function"&&globalThis instanceof e||!!await ql()}static set onmessage(e){async function r(n){let i=await ql(),{type:o,payload:s}=i?n:n.data;e(o,s)}ql().then(n=>{n?(n.on("message",i=>{r(i)}),n.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=r})}static async addEventListener(e){let r=Em.get(e);r||(r=i=>{let o=bz(i);o&&e(o.type,o.payload)},Em.set(e,r));let n=await ql();n?n.on("message",r):globalThis.addEventListener("message",r)}static async removeEventListener(e){let r=Em.get(e);if(Em.delete(e),!r)return;let n=await ql();n?n.off("message",r):globalThis.removeEventListener("message",r)}static async postMessage(e,r,n=!1){let i={source:"loaders.gl",type:e,payload:r},o=n?[]:uc(r),s=await ql();s?s.postMessage(i,o):globalThis.postMessage(i,o)}}});var Vl,QE=p(()=>{Vl=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(e){return this.enqueue(e)}enqueue(e){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();e instanceof Error?r.reject(e):r.resolve({value:e})}else this._values.push(e)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let e=this._values.shift();return e instanceof Error?Promise.reject(e):Promise.resolve({done:!1,value:e})}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((e,r)=>{this._settlers.push({resolve:e,reject:r})})}}});var Tm,eT=p(()=>{Tm=class{constructor(e){if(typeof SharedArrayBuffer>"u"||!(e instanceof SharedArrayBuffer)||e.byteLength!==16)throw new Error("Expected a 16-byte shared worker control buffer");this.buffer=e,this.values=new Int32Array(e)}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 e=new Error("Shared worker task was cancelled");throw e.name="AbortError",e}}setProgress(e,r=-1){if(!Number.isInteger(e)||e<0||e>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,e),Atomics.store(this.values,2,r),Atomics.add(this.values,3,1)}}});function Dy(t){if(t!==void 0&&t!=="copy"&&t!=="transfer")throw new Error("Invalid worker output ownership")}var tT=p(()=>{});async function Ny(t,e,r){if(!await Vt.inWorkerThread())return;let n={process:_z};Vt.onmessage=async(i,o)=>{var d,m,g,y,b;if(i==="cancel"){Vo==null||Vo.abort(),qo==null||qo.close(),fc==null||fc.close();return}let s=i==="process"||i==="process-in-batches"?new AbortController:void 0;s&&(Vo=s);let a=performance.now(),c=i==="process"||i==="process-in-batches"?Sz():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 Tm(o.options.sharedState),h.sharedState=l),i){case"preload":await(r==null?void 0:r()),Vt.postMessage("done",{});break;case"process":if(u(),Dy((m=o.options)==null?void 0:m.outputOwnership),!t)throw new Error("Worker does not support atomic processing");let w=await t(o.input,o.options||{},h,o.context||{});u(),c==null||c.finish(),await Vt.postMessage("done",{result:w,executionMs:performance.now()-a},((g=o.options)==null?void 0:g.outputOwnership)==="copy");break;case"process-in-batches":if(u(),Dy((y=o.options)==null?void 0:y.outputOwnership),!e)throw new Error("Worker does not support batched processing");let _=new Vl,S=new Vl;qo=_,fc=S;try{let M=e(xz(_),o.options||{},h,o.context||{});for await(let v of M)u(),await Vt.postMessage("output-batch",{result:v},((b=o.options)==null?void 0:b.outputOwnership)==="copy"),await S.next();u(),c==null||c.finish(),await Vt.postMessage("done",{executionMs:performance.now()-a})}finally{qo=null,fc=null}break;case"input-batch":if(!qo)throw new Error("Worker has no active batched processing session");qo.push(o.input);break;case"input-done":if(!qo)throw new Error("Worker has no active batched processing session");qo.close();break;case"output-ack":if(!fc)throw new Error("Worker has no active batched processing session");fc.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 Vt.postMessage("error",{error:_,errorName:w instanceof Error?w.name:"Error"})}finally{s&&Vo===s&&(Vo=null)}},await Vt.postMessage("ready",{})}async function*xz(t){for(;;){await Vt.postMessage("input-request",{});let e=await t.next();if(e.done)return;yield e.value}}function _z(t,e={},r={}){let n=Vo==null?void 0:Vo.signal;return n==null||n.throwIfAborted(),new Promise((i,o)=>{let s=wz++,a=()=>{n==null||n.removeEventListener("abort",c),Vt.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)))};Vt.addEventListener(l).then(async()=>{if(n!=null&&n.aborted){c();return}n==null||n.addEventListener("abort",c,{once:!0}),await Vt.postMessage("process",{id:s,input:t,options:e,context:r})}).catch(u=>{a(),o(u)})})}function Sz(){let t,e=!1,r=!1,n=()=>{r=!1,t&&(Vt.postMessage("progress",{progress:t}),t=void 0)};return{report(i){e||(t&&t.phase!==i.phase&&n(),t={...i},r||(r=!0,setTimeout(n,0)))},finish(i=!1){i&&(t=void 0),n(),e=!0}}}var wz,Vo,qo,fc,rT=p(()=>{eT();QE();Cy();tT();wz=0,Vo=null,qo=null,fc=null});var Mz,Fy,Mre,nT=p(()=>{Cy();rT();By();Mz={},Fy=typeof __filename=="string"?__filename.replace(/\\/g,"/"):"",Mre=Fy?`file://${Fy.startsWith("/")?"":"/"}${encodeURI(Fy).replace(/#/g,"%23").replace(/\?/g,"%3F")}`:Mz.url});function Gy(t,e){if(!t.preload)return Promise.resolve();let r=ky.get(t);return r||(r=Promise.resolve().then(()=>t.preload()).then(()=>{vz.add(t)}),ky.set(t,r),r.catch(()=>ky.delete(t))),Ez(r,e)}function Ez(t,e){return e?new Promise((r,n)=>{let i=()=>{e.removeEventListener("abort",i),n(e.reason)};e.addEventListener("abort",i,{once:!0}),e.aborted&&i(),t.then(o=>{e.removeEventListener("abort",i),r(o)},o=>{e.removeEventListener("abort",i),n(o)})}):t}var ky,vz,iT=p(()=>{ky=new WeakMap,vz=new WeakSet});var Uy,Am,oT=p(()=>{Uy=class extends Error{},Am=class{constructor(e){this.options=e,this.nextId=1,this.pending=new Map,this.incoming=new Map}request(e,r,n,i=[]){if(this.failure)return Promise.reject(this.failure.reason);if(n!=null&&n.aborted)return Promise.reject(n.reason);let o=this.nextId++;return new Promise((s,a)=>{let c=()=>{let l=this.pending.get(o);l&&(this.pending.delete(o),l.cleanup(),a(n==null?void 0:n.reason),this.send({source:"math.gl/tasks",kind:"cancel",id:o}))};this.pending.set(o,{resolve:s,reject:a,cleanup:()=>n==null?void 0:n.removeEventListener("abort",c)}),n==null||n.addEventListener("abort",c,{once:!0}),this.send({source:"math.gl/tasks",kind:"request",id:o,operation:e,value:r},i)})}emit(e,r,n=[]){if(this.failure)throw this.failure.reason;this.send({source:"math.gl/tasks",kind:"event",id:0,operation:e,value:r},n)}receive(e){var r,n,i,o,s,a,c,l;if(!(this.failure||(e==null?void 0:e.source)!=="math.gl/tasks")){if(e.kind==="failure"){let u=new Error(((r=e.error)==null?void 0:r.message)??"Task channel failed");this.close(u),(i=(n=this.options).onFailure)==null||i.call(n,u)}else if(e.kind==="result"||e.kind==="error"){let u=this.pending.get(e.id);if(!u)return;if(this.pending.delete(e.id),u.cleanup(),e.kind==="result")u.resolve(e.value);else{let h=new Uy(((o=e.error)==null?void 0:o.message)??"Task request failed");h.name=((s=e.error)==null?void 0:s.name)??"Error",u.reject(h)}}else if(e.kind==="cancel")(a=this.incoming.get(e.id))==null||a.abort(new DOMException("Task request cancelled","AbortError"));else if(e.kind==="event")try{(l=(c=this.options).handleEvent)==null||l.call(c,e.operation,e.value)}catch(u){this.fail(u)}else if(e.kind==="request"){if(this.incoming.has(e.id)){this.fail(new Error("Duplicate task request identifier"));return}let u=new AbortController;this.incoming.set(e.id,u),Promise.resolve().then(()=>(u.signal.throwIfAborted(),this.options.handleRequest(e.operation,e.value,u.signal))).then(h=>{var d,m;!u.signal.aborted&&!this.failure&&this.send({source:"math.gl/tasks",kind:"result",id:e.id,value:h},(m=(d=this.options).getResultTransferList)==null?void 0:m.call(d,h,e.value))}).catch(h=>{!u.signal.aborted&&!this.failure&&this.send({source:"math.gl/tasks",kind:"error",id:e.id,error:{name:h instanceof Error?h.name:"Error",message:h instanceof Error?h.message:String(h)}})}).finally(()=>this.incoming.delete(e.id))}}}close(e=new Error("Task channel closed")){if(!this.failure){this.failure={reason:e};for(let r of this.pending.values())r.cleanup(),r.reject(e);this.pending.clear();for(let r of this.incoming.values())r.abort(e);this.incoming.clear()}}send(e,r=[]){if(!this.failure)try{this.options.send(e,r)}catch(n){this.fail(n)}}fail(e){var r,n;if(!this.failure){this.close(e);try{this.options.send({source:"math.gl/tasks",kind:"failure",id:0,error:{name:e instanceof Error?e.name:"Error",message:e instanceof Error?e.message:String(e)}},[])}catch{}(n=(r=this.options).onFailure)==null||n.call(r,e)}}}});function Wl(t){if(!t||typeof t!="object"||Object.getPrototypeOf(t)!==Object.prototype)throw new TypeError("Task payloads must be plain objects with named fields")}function Tz(t,e="copy"){if(Wl(t),!["copy","transfer","share"].includes(e))throw new TypeError("Invalid input ownership");let r=uc(t);if(e==="share"&&r.length)throw new TypeError("Share requires shared storage");return structuredClone(t,{transfer:e==="transfer"?r:[]})}function jy(t,e={}){let r=e.signal??new AbortController().signal;return{state:t,signal:r,requestHost:async(n,i,o)=>{if(r.throwIfAborted(),!e.requestHost)throw new Error("No host request handler configured");return e.requestHost(n,i,o)},emitHost:(n,i)=>{var o;r.throwIfAborted(),(o=e.emitHost)==null||o.call(e,n,i)},throwIfAborted:()=>{var n;r.throwIfAborted(),(n=e.throwIfAborted)==null||n.call(e)},reportProgress:n=>{var i;return(i=e.reportProgress)==null?void 0:i.call(e,{...n,phase:n.phase??"process",unit:n.unit??"items"})}}}async function qy(t){if(!await Vt.inWorkerThread())throw new Error("initializeTaskWorker must run inside a worker");if(sT)throw new Error("A task is already installed in this worker");sT=!0;let e=new zy(t),r,n=new Am({getResultTransferList:(o,s)=>s.outputOwnership==="transfer"?uc(o):[],send:(o,s)=>{let a=structuredClone(o,{transfer:s});Vt.postMessage("task-channel",a).catch(c=>n.fail(c))},handleRequest:async(o,s,a)=>{var u;let c=s,l={signal:a,reportProgress:h=>n.emit("task:progress",{id:c.progressId,progress:h}),requestHost:(h,d,m={})=>{let g={operation:h,payload:Tz(d,m.inputOwnership),outputOwnership:m.outputOwnership??"copy"};return n.request("task:host-request",g,a,uc(g))},emitHost:(h,d)=>n.emit("task:host-event",{operation:h,payload:d,id:c.progressId})};switch(o){case"initialize":return e.initialize(c.input,l);case"process":return e.process(c.input,c.options,l);case"stream-open":{if(r)throw new Error("A task stream is already open");async function*h(){for(;;){let d=await n.request("task:next-input",{outputOwnership:"transfer"},a);if(d.done)return;yield d.value}}return r=e.stream(h(),c.options,l)[Symbol.asyncIterator](),{}}case"stream-next":if(!r)throw new Error("No active task stream");return r.next();case"stream-close":try{await((u=r==null?void 0:r.return)==null?void 0:u.call(r))}finally{r=void 0}return{};case"destroy":return e.destroy();default:throw new Error("Unknown task channel operation")}}});await Vt.addEventListener((o,s)=>{o==="task-channel"&&n.receive(s)});let i={};return Ny(async(o,s,a)=>{switch(o.operation){case"initialize":return e.initialize(o.input,a);case"destroy":return e.destroy();case"stream-options":return i=o.options,{};case"process":return e.process(o.input,o.options,a);default:throw new Error("Unknown task operation")}},async function*(o,s,a){async function*c(){for await(let l of o)Wl(l),yield l}try{yield*e.stream(c(),i,a)}finally{i={}}},()=>Gy(t))}var zy,sT,aT=p(()=>{nT();iT();oT();zy=class{constructor(e){this.task=e,this.initialized=!1}async initialize(e,r={}){var n,i,o;if(this.initialized)throw new Error("Task is already initialized");return Wl(e),await Gy(this.task,r.signal),(n=r.signal)==null||n.throwIfAborted(),this.state=await((o=(i=this.task).initialize)==null?void 0:o.call(i,e,jy(void 0,r))),this.initialized=!0,{}}async destroy(){var e,r;if(this.initialized){this.initialized=!1;let n=this.state;this.state=void 0,this.task.initialize&&await((r=(e=this.task).destroy)==null?void 0:r.call(e,n))}return{}}async process(e,r,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.process)throw new Error("Task has no atomic processor");Wl(e);let i=await this.task.process(e,r,jy(this.state,n));return Wl(i),i}async*stream(e,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(e,r,jy(this.state,n)))Wl(i),yield i}};sT=!1});var cT=p(()=>{aT()});var lT=p(()=>{cT()});var uT={};Qt(uT,{BroadcastChannel:()=>et.BroadcastChannel,MessageChannel:()=>et.MessageChannel,MessagePort:()=>et.MessagePort,NodeWorker:()=>Iz,SHARE_ENV:()=>et.SHARE_ENV,Worker:()=>et.Worker,getEnvironmentData:()=>et.getEnvironmentData,isInternalThread:()=>Pz,isMainThread:()=>et.isMainThread,isMarkedAsUntransferable:()=>et.isMarkedAsUntransferable,locks:()=>Lz,markAsUncloneable:()=>et.markAsUncloneable,markAsUntransferable:()=>et.markAsUntransferable,moveMessagePortToContext:()=>et.moveMessagePortToContext,parentPort:()=>Az,postMessageToThread:()=>et.postMessageToThread,receiveMessageOnPort:()=>et.receiveMessageOnPort,resourceLimits:()=>et.resourceLimits,setEnvironmentData:()=>et.setEnvironmentData,structuredClone:()=>Oz,threadId:()=>et.threadId,threadName:()=>Rz,workerData:()=>et.workerData});var Nn,et,Az,Iz,Pz,Rz,Lz,Oz,fT=p(()=>{"use strict";Nn=me(require("worker_threads"),1),et=require("worker_threads"),Az=Nn==null?void 0:Nn.parentPort,Iz=Nn.Worker,Pz=Nn.isInternalThread,Rz=Nn.threadName,Lz=Nn.locks,Oz=Nn.structuredClone});function hT(t){return{...t,phase:t.phase??"process",unit:t.unit??"items"}}async function dT(){var t;if(typeof self<"u"&&typeof document>"u"&&typeof self.postMessage=="function")return!0;if(typeof process<"u"&&((t=process.versions)!=null&&t.node)){let{isMainThread:e}=await Promise.resolve().then(()=>(fT(),uT));return!e}return!1}var mT,pT=p(()=>{"use strict";lT();mT=qy});function Vy(t,e=!0,r){let n=r||new Set;if(t){if(gT(t))n.add(t);else if(gT(t.buffer))n.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(let i in t)Vy(t[i],e,n)}}return r===void 0?Array.from(n):[]}function gT(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}var yT=p(()=>{"use strict"});async function Wy(t,e){await dT()&&await mT(Bz(t,e))}function Bz(t,e){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(!t)throw new Error("Worker does not support atomic processing");return{value:await t(r,n,bT(i),i.state.context)}},...e?{processInBatches:async function*(r,n,i){async function*o(){for await(let s of r)yield s.value}for await(let s of e(o(),n,bT(i),i.state.context))yield{value:s}}}:{}}}function bT(t){let e=0,r=t.state.port;return{signal:t.signal,throwIfAborted:()=>t.throwIfAborted(),reportProgress:n=>t.reportProgress(hT(n)),process:r?(n,i={},o={})=>{t.throwIfAborted();let s=++e;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(t.signal.reason)},h=()=>{r.removeEventListener("message",l),t.signal.removeEventListener("abort",u)};r.addEventListener("message",l),t.signal.addEventListener("abort",u,{once:!0}),r.start();try{let d={identifier:s,input:n,options:i,context:o};r.postMessage(d,Vy(d))}catch(d){h(),c(d)}})}:void 0}}var wT=p(()=>{"use strict";pT();yT()});function hc(t={}){var i,o;let e=t.useLocalLibraries??((i=t.core)==null?void 0:i.useLocalLibraries),r=Cz(t.CDN,(o=t.core)==null?void 0:o.CDN),n=t.modules;return{...e!==void 0?{useLocalLibraries:e}:{},...r!==void 0?{CDN:r}:{},...n!==void 0?{modules:n}:{}}}function Cz(t,e){if(typeof t=="string"||t===null)return t;if(typeof e=="string"||e===null)return e}async function $l(t,e=null,r={},n=null,i=null){var a,c;let o=t;if(e){let l=n||t,u=(a=r.modules)==null?void 0:a[l];if(u!==void 0&&typeof u!="string")return u;t=Hy(t,e,r,n),o=i&&(!(typeof u=="string")||typeof((c=r.modules)==null?void 0:c[i])=="string")?Hy(i,e,r,i):t}let s=Dz(t,o,lc);return $y[s]=$y[s]||Nz(t,o),await $y[s]}function Dz(t,e,r){return r?JSON.stringify([t,e]):t}function Hy(t,e,r={},n=null){if(r!=null&&r.core)throw new Error("loadLibrary: options.core must be pre-normalized");n=n||t;let i=r.modules||{};if(typeof i[n]=="string")return i[n];if(!r.useLocalLibraries&&t.startsWith("http"))return t;if(!Oi)return`modules/${e}/dist/libs/${n}`;if(r.CDN){if(typeof r.CDN!="string")throw new Error("loadLibrary: options.CDN must be a string or null");return HE(r.CDN.startsWith("http")),`${r.CDN}/${e}@${WE}/dist/libs/${n}`}return lc?n.endsWith(".mjs")?`./libs/${n}`:`../src/libs/${n}`:`modules/${e}/src/libs/${n}`}async function Nz(t,e){if(t.endsWith("wasm"))return await Gz(t);if(!Oi){let{requireFromFile:n}=globalThis.loaders||{};try{let i=await(n==null?void 0:n(t));return i||!t.includes("/dist/libs/")?i:await(n==null?void 0:n(t.replace("/dist/libs/","/src/libs/")))}catch(i){if(t.includes("/dist/libs/"))try{return await(n==null?void 0:n(t.replace("/dist/libs/","/src/libs/")))}catch{}return vm.error(String(i))(),null}}if(lc)return Fz(t,e);let r=await Uz(t);return kz(r,t)}async function Fz(t,e=t){try{importScripts()}catch{let n=await import(new URL(e,globalThis.location.href).href);return n.default??n}return importScripts(t)}function kz(t,e){let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}async function Gz(t){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};if(Oi||!e||t.startsWith("http"))return await(await fetch(t)).arrayBuffer();try{return await e(t)}catch{if(t.includes("/dist/libs/"))return await e(t.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load ArrayBuffer from ${t}`)}}async function Uz(t){let{readFileAsText:e}=globalThis.loaders||{};if(Oi||!e||t.startsWith("http"))return await(await fetch(t)).text();try{return await e(t)}catch{if(t.includes("/dist/libs/"))return await e(t.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load text from ${t}`)}}var $y,xT=p(()=>{"use strict";Ay();Ly();KE();$E();$y={}});var dc=p(()=>{"use strict";Ly();wT();xT()});async function Xy(t,e=()=>t){await Wy((r,n,i,o)=>jz(e(n||{}),r,n,i,o),(r,n,i,o)=>_T(e(n||{}),r,n,i,o))}async function jz(t,e,r={},n,i={}){let o=await qz({loader:t,arrayBuffer:e,options:r,context:{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:ST(),_parse:MT(n==null?void 0:n.process)}});return t.serializeWorkerResult?t.serializeWorkerResult(o,r,i):o}async function*_T(t,e,r={},n,i={}){if(!t.parseInBatches)throw new Error(`${t.id} loader does not support batched parsing`);let o=ET(t,r),s=t.parseInBatches(e,o,{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:ST(),_parse:MT(n==null?void 0:n.process)});for await(let a of s)yield t.serializeWorkerBatch?t.serializeWorkerBatch(a,r,i):a}function ST(){let t=e=>()=>{throw new Error(`context.coreApi.${e} is unavailable inside worker loaders.`)};return{fetchFile:async(e,r)=>await fetch(e,r),parseSync:t("parseSync"),parse:t("parse"),parseFile:t("parseFile"),parseInBatches:t("parseInBatches"),load:t("load"),loadInBatches:t("loadInBatches")}}function MT(t){return(e,r,n,i)=>{if(!t)throw new Error("Worker not set up to parse on main thread");let o=zz(r,n,i);return t(e,o.options,{...o.context,...Array.isArray(r)||r&&vT(r)?{_loaderIsArray:Array.isArray(r),_loaderIds:(Array.isArray(r)?r:[r]).map(s=>s.id)}:{}})}}function zz(t,e,r){return e?{options:e,context:Ky(r)}:Array.isArray(t)||t&&vT(t)?{options:void 0,context:Ky(r)}:t&&!Array.isArray(t)?{options:t}:{options:void 0,context:Ky(r)}}function vT(t){return"id"in t&&"extensions"in t}function Ky(t){if(!t)return;let{fetch:e,loaders:r,coreApi:n,signal:i,reportProgress:o,_parse:s,_parseSync:a,_parseInBatches:c,...l}=t;return JSON.parse(JSON.stringify(l))}async function qz({loader:t,arrayBuffer:e,options:r,context:n}){let i,o;if(t.parse||t.parseSync)i=e,o=t.parse||t.parseSync;else if(t.parseTextSync)i=new TextDecoder().decode(e),o=t.parseTextSync;else throw new Error(`Could not load data with ${t.name} loader`);return r=ET(t,r),await o(i,{...r},n,t)}function ET(t,e){var r;return{...e,modules:{...(r=t.options)==null?void 0:r.modules,...e.modules},core:{...e.core,worker:!1}}}var TT=p(()=>{"use strict";dc()});function Im(t={}){if(t.coordinateEpoch!==void 0&&!Number.isFinite(t.coordinateEpoch))throw new Error("Spatial reference coordinate epoch must be a finite decimal year");return Object.freeze({crs:AT(t.crs||{state:"absent",provenance:"unknown"}),vertical:t.vertical?AT(t.vertical):void 0,coordinateEpoch:t.coordinateEpoch,coordinateFrame:t.coordinateFrame||"unknown",coordinateOrder:Object.freeze([...t.coordinateOrder||[]]),units:t.units?Object.freeze([...t.units]):void 0})}function wr(t){if(typeof t=="object")return"projjson";let e=t.trim();return/^[A-Z][A-Z0-9_]*\s*[\[(]/i.test(e)?"wkt":/(?:^|\s)\+?proj=/i.test(e)?"proj-string":/^[A-Z][A-Z0-9._-]*(?::[A-Z0-9._-]+)+$/i.test(e)||/^urn:ogc:def:crs:/i.test(e)||/^https?:\/\//i.test(e)||/^[A-Z][A-Z0-9._-]*$/i.test(e)?"identifier":"opaque"}function AT(t){return t.state==="explicit"||t.state==="default"?Object.freeze({...t,definition:IT(t.definition),alternatives:t.alternatives?Object.freeze(t.alternatives.map(e=>Object.freeze({...e,definition:IT(e.definition)}))):void 0}):Object.freeze({...t})}function IT(t){return typeof t=="string"?t:Yy(t)}function Yy(t){return Array.isArray(t)?Object.freeze(t.map(e=>Yy(e))):t&&typeof t=="object"?Object.freeze(Object.fromEntries(Object.entries(t).map(([e,r])=>[e,Yy(r)]))):t}var Hl=p(()=>{});function kf(t,e){let n={type:"wkt-crs",root:new Zy(t).parse()};if(e!=null&&e.strict){let i=OT(n,{profile:e.profile,allowExtensions:!1});if(i.length>0)throw new Rm(i)}return n}function OT(t,e){var a;if(!t||t.type!=="wkt-crs"||((a=t.root)==null?void 0:a.type)!=="node")throw new TypeError("validateWKTCRS expects a WKTCRSAst");let r=eq(t.root.keyword,(e==null?void 0:e.profile)||"auto"),n=Jz[r],i=Qz[r],o=[],s=t.root.keyword.toUpperCase();return n.has(s)||o.push({code:"invalid-root",message:`${t.root.keyword} is not a ${r} root keyword`,path:[],keyword:t.root.keyword}),BT(t.root,[],c=>{let l=c.node.keyword.toUpperCase();!(e!=null&&e.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=tq(c.node);u&&o.push({code:"invalid-value",message:u,path:c.path,keyword:c.node.keyword})}),o}function eq(t,e){return e!=="auto"?e:Ff.has(t.toUpperCase())?"wkt1":"wkt2:2019"}function tq(t){let e=t.keyword.toUpperCase(),r=t.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(e)&&!(r.length>=2&&n(0,"string")&&n(1,"number")))return`${t.keyword} must start with a quoted name and numeric conversion factor`;if(e==="CS"&&!i(2,"enumeration","number"))return`${t.keyword} must contain a coordinate-system type and dimension`;if(e==="BBOX"&&!i(4,"number","number","number","number"))return`${t.keyword} must contain four numeric bounds`;if(["ENSEMBLEACCURACY","EPOCH","COORDEPOCH","FRAMEEPOCH","OPERATIONACCURACY","ORDER"].includes(e)&&!i(1,"number"))return`${t.keyword} must contain one number`;if(["ANCHOR","AREA","CALENDAR","CITATION","REMARK","SCOPE","URI","VERSION"].includes(e)&&!i(1,"string"))return`${t.keyword} must contain one quoted string`;if(["ELLIPSOID","SPHEROID","TRIAXIAL"].includes(e)&&!(r.length>=3&&n(0,"string")&&n(1,"number")&&n(2,"number")))return`${t.keyword} must start with a quoted name and numeric ellipsoid axes`;if(["PARAMETER"].includes(e)&&!(r.length>=2&&n(0,"string")&&n(1,"number")))return`${t.keyword} must start with a quoted name and numeric value`;if(e==="PARAMETERFILE"&&!i(2,"string","string"))return`${t.keyword} must contain a quoted name and file name`;if(["AUTHORITY","ID"].includes(e)&&!(r.length>=2&&n(0,"string")&&n(1,"string","number")))return`${t.keyword} must start with a quoted authority and identifier`;if(["AXIS"].includes(e)&&!(r.length>=2&&n(0,"string")&&n(1,"enumeration")))return`${t.keyword} must start with a quoted name and axis direction`;if(["METHOD","PROJECTION"].includes(e)&&!(r.length>=1&&n(0,"string")))return`${t.keyword} must start with a quoted name`;if(e==="TIMEEXTENT"){let o=s=>n(s,"enumeration","string");if(r.length!==2||!o(0)||!o(1))return`${t.keyword} must contain two date-time or quoted values`}if(e==="VERTICALEXTENT"&&(r.length<2||r.length>3||!n(0,"number")||!n(1,"number")||r.length===3&&!n(2,"node")))return`${t.keyword} must contain two numeric bounds and an optional unit`;if(e==="COORDINATEMETADATA"&&(r.length<1||r.length>2||!n(0,"node")||r.length===2&&(!n(1,"node")||!["EPOCH","COORDEPOCH"].includes(r[1].keyword.toUpperCase()))))return`${t.keyword} must contain a CRS and an optional coordinate epoch`;if(e==="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`${t.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(e)&&!n(0,"string")?`${t.keyword} must start with a quoted name`:null}function BT(t,e,r){r({node:t,path:e});for(let n=0;n<t.values.length;n++){let i=t.values[n];i.type==="node"&&BT(i,[...e,n],r)}}function rq(t,e){let r=1,n=1;for(let i=0;i<e&&i<t.length;i++)t[i]===`
3
- `?(r++,n=1):n++;return{line:r,column:n}}var Pm,Rm,Vz,Wz,Ff,Jy,$z,Hz,Kz,Xz,PT,RT,LT,Yz,Zz,Jz,Qz,Zy,Qy=p(()=>{Pm=class extends SyntaxError{constructor(e,r,n){let i=rq(r,n);super(`${e} at ${i.line}:${i.column}`),this.name="WKTCRSSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}},Rm=class extends Error{constructor(e){var r;super(((r=e[0])==null?void 0:r.message)||"WKT validation failed"),this.name="WKTCRSValidationError",this.issues=e}},Vz=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?$/,Wz=/^[A-Za-z][A-Za-z0-9_]*/,Ff=new Set(["COMPD_CS","CONCAT_MT","FITTED_CS","GEOCCS","GEOGCS","INVERSE_MT","LOCAL_CS","PARAM_MT","PASSTHROUGH_MT","PROJCS","VERT_CS"]),Jy=new Set([...Ff,"AUTHORITY","AXIS","CONCAT_MT","DATUM","INVERSE_MT","LOCAL_DATUM","PARAMETER","PARAM_MT","PASSTHROUGH_MT","PRIMEM","PROJECTION","SPHEROID","TOWGS84","UNIT","VERT_DATUM"]),$z=new Set(Ff),Hz=new Set([...Jy,"EXTENSION"]),Kz=new Set([...Ff,"COMPDCS","LOCALCS","VERTCS"]),Xz=new Set([...Jy,"COMPDCS","LOCALCS","VDATUM","VERTCS"]),PT=new Set(["BOUNDCRS","COMPOUNDCRS","COORDINATEOPERATION","ENGCRS","ENGINEERINGCRS","GEODCRS","GEODETICCRS","PARAMETRICCRS","PROJCRS","PROJECTEDCRS","TIMECRS","VERTCRS","VERTICALCRS"]),RT=new Set([...PT,"CONCATENATEDOPERATION","COORDINATEMETADATA","DERIVEDPROJCRS","GEOGCRS","GEOGRAPHICCRS","POINTMOTIONOPERATION"]),LT=new Set([...RT,"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"]),Yz=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"]),Zz=new Set([...LT].filter(t=>!Yz.has(t))),Jz={wkt1:Ff,gdal:$z,esri:Kz,"wkt2:2015":PT,"wkt2:2019":RT},Qz={wkt1:Jy,gdal:Hz,esri:Xz,"wkt2:2015":Zz,"wkt2:2019":LT};Zy=class{constructor(e){this.offset=0,this.source=e}parse(){this.skipWhitespace();let e=this.parseNode();return this.skipWhitespace(),this.offset!==this.source.length&&this.fail("Unexpected content after WKT root"),e}parseNode(){let e=this.parseKeyword();return this.parseNodeAfterKeyword(e)}parseNodeAfterKeyword(e){this.skipWhitespace();let r=this.source[this.offset];r!=="["&&r!=="("&&this.fail(`Expected '[' or '(' after ${e}`),this.offset++;let n=r==="["?"bracket":"parenthesis",i=r==="["?"]":")",o=[];if(this.skipWhitespace(),this.source[this.offset]===i)return this.offset++,{type:"node",keyword:e,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:e,delimiter:n,values:o};(s==="]"||s===")")&&this.fail(`Expected '${i}' to close ${e}`),this.fail(`Expected ',' or '${i}' in ${e}`)}this.fail(`Unterminated ${e} 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)):Vz.test(n)?{type:"number",value:Number(n),raw:n}:{type:"enumeration",value:n}}parseKeyword(){let e=this.source.slice(this.offset).match(Wz);return e||this.fail("Expected a WKT keyword"),this.offset+=e[0].length,e[0]}parseString(){this.offset++;let e="";for(;this.offset<this.source.length;){let r=this.source[this.offset++];if(r==='"'){if(this.source[this.offset]==='"'){e+='"',this.offset++;continue}return{type:"string",value:e}}e+=r}this.fail("Unterminated WKT string")}skipWhitespace(){for(;this.offset<this.source.length&&/\s/.test(this.source[this.offset]);)this.offset++}fail(e){throw new Pm(e,this.source,this.offset)}}});function Gf(t){let e=oq(t);if(e.length===0)throw new Wo("PROJ string is empty",t,0);return{type:"proj-string",parameters:e.map(n=>iq(n.raw,n.offset,t))}}function iq(t,e,r){let n=t.startsWith("+")?t.slice(1):t;if(!n)throw new Wo("Expected a parameter after '+'",r,e);let i=n.indexOf("="),o=i<0?n:n.slice(0,i);if(!o||/[\s+=]/.test(o))throw new Wo(`Invalid PROJ parameter name '${o}'`,r,e);if(i<0)return{type:"parameter",name:o};let s=n.slice(i+1),a=sq(s,r,e+i+1);return{type:"parameter",name:o,value:a,rawValue:s}}function oq(t){let e=[],r=0;for(;r<t.length;){for(;r<t.length&&/\s/.test(t[r]);)r++;if(r>=t.length)break;let n=r,i=null,o=!1;for(;r<t.length;){let s=t[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==="'")&&t[r-1]==="="){i=s,r++;continue}if(/\s/.test(s))break;r++}if(i)throw new Wo("Unterminated quoted PROJ value",t,n);e.push({raw:t.slice(n,r),offset:n})}return e}function sq(t,e,r){if(!t)return"";let n=t[0];if(n!=='"'&&n!=="'"){if((t.includes('"')||t.includes("'"))&&!nq.test(t))throw new Wo("Quote must begin a PROJ parameter value",e,r);return t}if(t[t.length-1]!==n)throw new Wo("Unterminated quoted PROJ value",e,r);let i="";for(let o=1;o<t.length-1;o++){let s=t[o];s==="\\"&&o+1<t.length-1?i+=t[++o]:i+=s}return i}function aq(t,e){let r=1,n=1;for(let i=0;i<e&&i<t.length;i++)t[i]===`
4
- `?(r++,n=1):n++;return{line:r,column:n}}var Wo,nq,e2=p(()=>{Wo=class extends SyntaxError{constructor(e,r,n){let i=aq(r,n);super(`${e} at ${i.line}:${i.column}`),this.name="PROJStringSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}};nq=/^[+-]?\d+(?:\.\d*)?d(?:\d+(?:\.\d*)?'(?:\d+(?:\.\d*)?")?)?[NSEW]?$/i});var Uf,CT=p(()=>{Uf={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 DT(t){return JSON.stringify([t.coordinateFrame,t.projection,Object.keys(t.parameters).sort().map(e=>[e,t.parameters[e]]),[t.ellipsoid.semiMajorAxis,t.ellipsoid.semiMinorAxis],t.axis,[t.xUnit.name,t.xUnit.metersPerUnit,t.xUnit.degreesPerUnit],[t.yUnit.name,t.yUnit.metersPerUnit,t.yUnit.degreesPerUnit],[t.zUnit.name,t.zUnit.metersPerUnit,t.zUnit.degreesPerUnit],t.lossy,t.areaOfUse])}var t2=p(()=>{CT()});var r2=p(()=>{Hl();Qy();e2()});var Lm={};Qt(Lm,{EPSILON1:()=>cq,EPSILON10:()=>yq,EPSILON11:()=>bq,EPSILON12:()=>wq,EPSILON13:()=>xq,EPSILON14:()=>_q,EPSILON15:()=>Sq,EPSILON16:()=>Mq,EPSILON17:()=>vq,EPSILON18:()=>Eq,EPSILON19:()=>Tq,EPSILON2:()=>lq,EPSILON20:()=>Aq,EPSILON3:()=>uq,EPSILON4:()=>fq,EPSILON5:()=>hq,EPSILON6:()=>dq,EPSILON7:()=>mq,EPSILON8:()=>pq,EPSILON9:()=>gq,PI:()=>Lq,PI_OVER_FOUR:()=>Pq,PI_OVER_SIX:()=>Rq,PI_OVER_TWO:()=>Iq,TWO_PI:()=>Oq});var cq,lq,uq,fq,hq,dq,mq,pq,gq,yq,bq,wq,xq,_q,Sq,Mq,vq,Eq,Tq,Aq,Iq,Pq,Rq,Lq,Oq,NT=p(()=>{cq=.1,lq=.01,uq=.001,fq=1e-4,hq=1e-5,dq=1e-6,mq=1e-7,pq=1e-8,gq=1e-9,yq=1e-10,bq=1e-11,wq=1e-12,xq=1e-13,_q=1e-14,Sq=1e-15,Mq=1e-16,vq=1e-17,Eq=1e-18,Tq=1e-19,Aq=1e-20,Iq=Math.PI/2,Pq=Math.PI/4,Rq=Math.PI/6,Lq=Math.PI,Oq=Math.PI*2});function n2(t,{precision:e=xt.precision}={}){return t=Nq(t),`${parseFloat(t.toPrecision(e))}`}function uo(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function i2(t){return FT(t)}function o2(t){return kT(t)}function FT(t,e){return GT(t,r=>r*Cq,e)}function kT(t,e){return GT(t,r=>r*Bq,e)}function Om(t,e,r){let n=xt.EPSILON;r&&(xt.EPSILON=r);try{if(t===e)return!0;if(uo(t)&&uo(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!Om(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=xt.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{xt.EPSILON=n}}function Nq(t){return Math.round(t/xt.EPSILON)*xt.EPSILON}function Fq(t){return t.clone?t.clone():new Array(t.length)}function GT(t,e,r){if(uo(t)){let n=t;r=r||Fq(n);for(let i=0;i<r.length&&i<n.length;++i){let o=typeof t=="number"?t:t[i];r[i]=e(o,i,r)}return r}return e(t)}var Bq,Cq,Dq,xt,Kl=p(()=>{Bq=1/Math.PI*180,Cq=1/180*Math.PI,Dq={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Dq}};xt=globalThis.mathgl.config});var Fs,Bm=p(()=>{Kl();Fs=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:uo(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toString(){return this.formatString(xt)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+n2(this[n],e);return`${e.printTypes?this.constructor.name:""}[${r}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Om(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let i=0;i<this.ELEMENTS;++i){let o=e[i],s=typeof r=="number"?r:r[i];this[i]=o+n*(s-o)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(xt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}}});function kq(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function Xt(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function Xl(t,e,r=""){if(xt.debug&&!kq(t,e))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return t}var mc=p(()=>{Kl()});var Yl,s2=p(()=>{Bm();mc();Kl();Yl=class extends Fs{toString(){let e="[";if(xt.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=` ${this[n*this.RANK+r]}`}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=` ${this[r]}`}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=Xt(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(e,r){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}}});function Bi(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}var a2=p(()=>{});var Cm,UT=p(()=>{Bm();mc();a2();Cm=class extends Fs{get x(){return this[0]}set x(e){this[0]=Xt(e)}get y(){return this[1]}set y(e){this[1]=Xt(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-e[n];r+=i*i}return Xt(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return Xt(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Bi(e>=0&&e<this.ELEMENTS,"index is out of range"),Xt(this[e])}setComponent(e,r){return Bi(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]+=e[n]*r;return this.check()}}});var Dm,Ane,jT=p(()=>{Dm=typeof Float32Array<"u"?Float32Array:Array,Ane=Math.PI/180});function zT(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function qT(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}var Nm=p(()=>{});function VT(t,e,r){let n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function Fm(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/s,t[1]=(r[1]*n+r[5]*i+r[9]*o)/s,t[2]=(r[2]*n+r[6]*i+r[10]*o)/s,t}function WT(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t}function $T(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=r[0]*n+r[3]*i+r[6]*o,t[1]=r[1]*n+r[4]*i+r[7]*o,t[2]=r[2]*n+r[5]*i+r[8]*o,t[3]=e[3],t}var km=p(()=>{});function HT(){let t=new Dm(3);return Dm!==Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Uq(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function c2(t,e,r){let n=new Dm(3);return n[0]=t,n[1]=e,n[2]=r,n}function KT(t,e){let r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function l2(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Zl(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[0],a=r[1],c=r[2];return t[0]=i*c-o*a,t[1]=o*s-n*c,t[2]=n*a-i*s,t}function Gm(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return s=s||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/s,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,t}function Um(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function XT(t,e,r){let n=r[0],i=r[1],o=r[2],s=r[3],a=e[0],c=e[1],l=e[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,t[0]=a+u+m,t[1]=c+h+g,t[2]=l+d+y,t}function YT(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function ZT(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function JT(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function QT(t,e){let r=t[0],n=t[1],i=t[2],o=e[0],s=e[1],a=e[2],c=Math.sqrt((r*r+n*n+i*i)*(o*o+s*s+a*a)),l=c&&l2(t,e)/c;return Math.acos(Math.min(Math.max(l,-1),1))}var e4,Jl=p(()=>{jT();e4=Uq});var u2,jm,J,t4=p(()=>{UT();Kl();mc();Jl();km();u2=[0,0,0],J=class t extends Cm{static get ZERO(){return jm||(jm=new t(0,0,0),Object.freeze(jm)),jm}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&uo(e)?this.copy(e):(xt.debug&&(Xt(e),Xt(r),Xt(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return xt.debug&&(Xt(e.x),Xt(e.y),Xt(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=Xt(e)}angle(e){return QT(this,e)}cross(e){return Zl(this,this,e),this.check()}rotateX({radians:e,origin:r=u2}){return YT(this,this,r,e),this.check()}rotateY({radians:e,origin:r=u2}){return ZT(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=u2}){return JT(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Gm(this,this,e),this.check()}transformAsVector(e){return Fm(this,this,e),this.check()}transformByMatrix3(e){return Um(this,this,e),this.check()}transformByMatrix2(e){return WT(this,this,e),this.check()}transformByQuaternion(e){return XT(this,this,e),this.check()}}});function r4(t,e){if(t===e){let r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function n4(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=e[6],l=e[7],u=e[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,t[0]=h*g,t[1]=(-u*n+i*l)*g,t[2]=(a*n-i*s)*g,t[3]=d*g,t[4]=(u*r-i*c)*g,t[5]=(-a*r+i*o)*g,t[6]=m*g,t[7]=(-l*r+n*c)*g,t[8]=(s*r-n*o)*g,t):null}function i4(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],c=t[7],l=t[8];return e*(l*o-s*c)+r*(-l*i+s*a)+n*(c*i-o*a)}function f2(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],h=e[8],d=r[0],m=r[1],g=r[2],y=r[3],b=r[4],w=r[5],_=r[6],S=r[7],M=r[8];return t[0]=d*n+m*s+g*l,t[1]=d*i+m*a+g*u,t[2]=d*o+m*c+g*h,t[3]=y*n+b*s+w*l,t[4]=y*i+b*a+w*u,t[5]=y*o+b*c+w*h,t[6]=_*n+S*s+M*l,t[7]=_*i+S*a+M*u,t[8]=_*o+S*c+M*h,t}function o4(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],h=e[8],d=r[0],m=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=c,t[6]=d*n+m*s+l,t[7]=d*i+m*a+u,t[8]=d*o+m*c+h,t}function s4(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],h=e[8],d=Math.sin(r),m=Math.cos(r);return t[0]=m*n+d*s,t[1]=m*i+d*a,t[2]=m*o+d*c,t[3]=m*s-d*n,t[4]=m*a-d*i,t[5]=m*c-d*o,t[6]=l,t[7]=u,t[8]=h,t}function h2(t,e,r){let n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function a4(t,e){let r=e[0],n=e[1],i=e[2],o=e[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 t[0]=1-h-g,t[3]=u-w,t[6]=d+b,t[1]=u+w,t[4]=1-l-g,t[7]=m-y,t[2]=d-b,t[5]=m+y,t[8]=1-l-h,t}var d2=p(()=>{});function qq(){return zm||(zm=new pc([0,0,0,0,0,0,0,0,0]),Object.freeze(zm)),zm}function Vq(){return qm||(qm=new pc,Object.freeze(qm)),qm}var m2,zq,pc,zm,qm,c4=p(()=>{s2();mc();km();d2();Nm();Jl();(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(m2||(m2={}));zq=Object.freeze([1,0,0,0,1,0,0,0,1]),pc=class extends Yl{static get IDENTITY(){return Vq()}static get ZERO(){return qq()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return m2}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(zq)}fromObject(e){return this.check()}fromQuaternion(e){return a4(this,e),this.check()}fromMatrix4(e){return this.set(e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10])}set(e,r,n,i,o,s,a,c,l){return this[0]=e,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(e,r,n,i,o,s,a,c,l){return this[0]=e,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 i4(this)}transpose(){return r4(this,this),this.check()}invert(){return n4(this,this),this.check()}multiplyLeft(e){return f2(this,e,this),this.check()}multiplyRight(e){return f2(this,this,e),this.check()}rotate(e){return s4(this,this,e),this.check()}scale(e){return Array.isArray(e)?h2(this,this,e):h2(this,this,[e,e]),this.check()}translate(e){return o4(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=zT(r||[-0,-0],e,this);break;case 3:n=Um(r||[-0,-0,-0],e,this);break;case 4:n=$T(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Xl(n,e.length),n}},qm=null});function Wq(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function l4(t,e){if(t===e){let r=e[1],n=e[2],i=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function u4(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=e[6],l=e[7],u=e[8],h=e[9],d=e[10],m=e[11],g=e[12],y=e[13],b=e[14],w=e[15],_=r*a-n*s,S=r*c-i*s,M=r*l-o*s,v=n*c-i*a,B=n*l-o*a,R=i*l-o*c,E=u*y-h*g,j=u*b-d*g,I=u*w-m*g,O=h*b-d*y,A=h*w-m*y,W=d*w-m*b,k=_*W-S*A+M*O+v*I-B*j+R*E;return k?(k=1/k,t[0]=(a*W-c*A+l*O)*k,t[1]=(i*A-n*W-o*O)*k,t[2]=(y*R-b*B+w*v)*k,t[3]=(d*B-h*R-m*v)*k,t[4]=(c*I-s*W-l*j)*k,t[5]=(r*W-i*I+o*j)*k,t[6]=(b*M-g*R-w*S)*k,t[7]=(u*R-d*M+m*S)*k,t[8]=(s*A-a*I+l*E)*k,t[9]=(n*I-r*A-o*E)*k,t[10]=(g*B-y*M+w*_)*k,t[11]=(h*M-u*B-m*_)*k,t[12]=(a*j-s*O-c*E)*k,t[13]=(r*O-n*j+i*E)*k,t[14]=(y*S-g*v-b*_)*k,t[15]=(u*v-h*S+d*_)*k,t):null}function f4(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],c=t[7],l=t[8],u=t[9],h=t[10],d=t[11],m=t[12],g=t[13],y=t[14],b=t[15],w=e*s-r*o,_=e*a-n*o,S=r*a-n*s,M=l*g-u*m,v=l*y-h*m,B=u*y-h*g,R=e*B-r*v+n*M,E=o*B-s*v+a*M,j=l*S-u*_+h*w,I=m*S-g*_+y*w;return c*R-i*E+b*j-d*I}function p2(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],h=e[8],d=e[9],m=e[10],g=e[11],y=e[12],b=e[13],w=e[14],_=e[15],S=r[0],M=r[1],v=r[2],B=r[3];return t[0]=S*n+M*a+v*h+B*y,t[1]=S*i+M*c+v*d+B*b,t[2]=S*o+M*l+v*m+B*w,t[3]=S*s+M*u+v*g+B*_,S=r[4],M=r[5],v=r[6],B=r[7],t[4]=S*n+M*a+v*h+B*y,t[5]=S*i+M*c+v*d+B*b,t[6]=S*o+M*l+v*m+B*w,t[7]=S*s+M*u+v*g+B*_,S=r[8],M=r[9],v=r[10],B=r[11],t[8]=S*n+M*a+v*h+B*y,t[9]=S*i+M*c+v*d+B*b,t[10]=S*o+M*l+v*m+B*w,t[11]=S*s+M*u+v*g+B*_,S=r[12],M=r[13],v=r[14],B=r[15],t[12]=S*n+M*a+v*h+B*y,t[13]=S*i+M*c+v*d+B*b,t[14]=S*o+M*l+v*m+B*w,t[15]=S*s+M*u+v*g+B*_,t}function h4(t,e,r){let n=r[0],i=r[1],o=r[2],s,a,c,l,u,h,d,m,g,y,b,w;return e===t?(t[12]=e[0]*n+e[4]*i+e[8]*o+e[12],t[13]=e[1]*n+e[5]*i+e[9]*o+e[13],t[14]=e[2]*n+e[6]*i+e[10]*o+e[14],t[15]=e[3]*n+e[7]*i+e[11]*o+e[15]):(s=e[0],a=e[1],c=e[2],l=e[3],u=e[4],h=e[5],d=e[6],m=e[7],g=e[8],y=e[9],b=e[10],w=e[11],t[0]=s,t[1]=a,t[2]=c,t[3]=l,t[4]=u,t[5]=h,t[6]=d,t[7]=m,t[8]=g,t[9]=y,t[10]=b,t[11]=w,t[12]=s*n+u*i+g*o+e[12],t[13]=a*n+h*i+y*o+e[13],t[14]=c*n+d*i+b*o+e[14],t[15]=l*n+m*i+w*o+e[15]),t}function d4(t,e,r){let n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function m4(t,e,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,B,R,E,j,I,O,A,W,k,T;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=e[0],d=e[1],m=e[2],g=e[3],y=e[4],b=e[5],w=e[6],_=e[7],S=e[8],M=e[9],v=e[10],B=e[11],R=i*i*u+c,E=o*i*u+s*l,j=s*i*u-o*l,I=i*o*u-s*l,O=o*o*u+c,A=s*o*u+i*l,W=i*s*u+o*l,k=o*s*u-i*l,T=s*s*u+c,t[0]=h*R+y*E+S*j,t[1]=d*R+b*E+M*j,t[2]=m*R+w*E+v*j,t[3]=g*R+_*E+B*j,t[4]=h*I+y*O+S*A,t[5]=d*I+b*O+M*A,t[6]=m*I+w*O+v*A,t[7]=g*I+_*O+B*A,t[8]=h*W+y*k+S*T,t[9]=d*W+b*k+M*T,t[10]=m*W+w*k+v*T,t[11]=g*W+_*k+B*T,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function p4(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[4],s=e[5],a=e[6],c=e[7],l=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*n,t[5]=s*i+u*n,t[6]=a*i+h*n,t[7]=c*i+d*n,t[8]=l*i-o*n,t[9]=u*i-s*n,t[10]=h*i-a*n,t[11]=d*i-c*n,t}function g4(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],c=e[3],l=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*n,t[1]=s*i-u*n,t[2]=a*i-h*n,t[3]=c*i-d*n,t[8]=o*n+l*i,t[9]=s*n+u*i,t[10]=a*n+h*i,t[11]=c*n+d*i,t}function y4(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],c=e[3],l=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*n,t[1]=s*i+u*n,t[2]=a*i+h*n,t[3]=c*i+d*n,t[4]=l*i-o*n,t[5]=u*i-s*n,t[6]=h*i-a*n,t[7]=d*i-c*n,t}function b4(t,e){let r=e[0],n=e[1],i=e[2],o=e[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 t[0]=1-h-g,t[1]=u+w,t[2]=d-b,t[3]=0,t[4]=u-w,t[5]=1-l-g,t[6]=m+y,t[7]=0,t[8]=d+b,t[9]=m-y,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function w4(t,e,r,n,i,o,s){let a=1/(r-e),c=1/(i-n),l=1/(o-s);return t[0]=o*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*c,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*c,t[10]=(s+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*l,t[15]=0,t}function $q(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let s=1/(n-i);t[10]=(i+n)*s,t[14]=2*i*n*s}else t[10]=-1,t[14]=-2*n;return t}function Hq(t,e,r,n,i,o,s){let a=1/(e-r),c=1/(n-i),l=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*c,t[14]=(s+o)*l,t[15]=1,t}function S4(t,e,r,n){let i,o,s,a,c,l,u,h,d,m,g=e[0],y=e[1],b=e[2],w=n[0],_=n[1],S=n[2],M=r[0],v=r[1],B=r[2];return Math.abs(g-M)<1e-6&&Math.abs(y-v)<1e-6&&Math.abs(b-B)<1e-6?Wq(t):(h=g-M,d=y-v,m=b-B,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),t[0]=o,t[1]=c,t[2]=h,t[3]=0,t[4]=s,t[5]=l,t[6]=d,t[7]=0,t[8]=a,t[9]=u,t[10]=m,t[11]=0,t[12]=-(o*g+s*y+a*b),t[13]=-(c*g+l*y+u*b),t[14]=-(h*g+d*y+m*b),t[15]=1,t)}function g2(t){if(t.length!==16||Array.from(t).some(i=>!Number.isFinite(i))||t[3]!==0||t[7]!==0||t[11]!==0||t[15]!==1)throw new RangeError("Expected a finite affine matrix");let e=[Math.hypot(t[0],t[1],t[2]),Math.hypot(t[4],t[5],t[6]),Math.hypot(t[8],t[9],t[10])];if(e.some(i=>i===0||!Number.isFinite(i)))throw new RangeError("Singular transform");let r=Array.from({length:9},(i,o)=>t[Math.floor(o/3)*4+o%3]/e[Math.floor(o/3)]);for(let[i,o]of[[0,3],[0,6],[3,6]])if(Math.abs(r[i]*r[o]+r[i+1]*r[o+1]+r[i+2]*r[o+2])>1e-7)throw new RangeError("Sheared transforms do not have a TRS decomposition");if(r[0]*(r[4]*r[8]-r[5]*r[7])-r[3]*(r[1]*r[8]-r[2]*r[7])+r[6]*(r[1]*r[5]-r[2]*r[4])<0){e[0]=-e[0];for(let i=0;i<3;i++)r[i]=-r[i]}return{rotation:r,scale:e,translation:[t[12],t[13],t[14]]}}var x4,_4,Vm=p(()=>{x4=$q;_4=Hq});function M4(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function v4(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function E4(t){let e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}function T4(t){let e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function A4(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=o*s,t}function I4(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function P4(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=s+n*(r[2]-s),t[3]=a+n*(r[3]-a),t}function R4(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,t}var Wm=p(()=>{});function Jq(){return $m||($m=new yn([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze($m)),$m}function Qq(){return Hm||(Hm=new yn,Object.freeze(Hm)),Hm}function L4(t){if(t>Math.PI*2)throw Error("expected radians")}function eV(t,e,r,n,i,o){let s=2*o/(r-e),a=2*o/(i-n),c=(r+e)/(r-e),l=(i+n)/(i-n),u=-1,h=-1,d=-2*o;return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=c,t[9]=l,t[10]=u,t[11]=h,t[12]=0,t[13]=0,t[14]=d,t[15]=0,t}var w2,Xq,Yq,y2,b2,Zq,yn,$m,Hm,O4=p(()=>{s2();Vm();mc();km();Vm();Nm();Jl();Wm();(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(w2||(w2={}));Xq=45*Math.PI/180,Yq=1,y2=.1,b2=500,Zq=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),yn=class extends Yl{static get IDENTITY(){return Qq()}static get ZERO(){return Jq()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return w2}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,i,o,s,a,c,l,u,h,d,m,g,y,b){return this[0]=e,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(e,r,n,i,o,s,a,c,l,u,h,d,m,g,y,b){return this[0]=e,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(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(Zq)}fromObject(e){return this.check()}fromQuaternion(e){return b4(this,e),this.check()}fromMatrix3(e){return this.set(e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1)}frustum(e){let{left:r,right:n,bottom:i,top:o,near:s=y2,far:a=b2}=e;return a===1/0?eV(this,r,n,i,o,s):w4(this,r,n,i,o,s,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=e;return S4(this,r,n,i),this.check()}ortho(e){let{left:r,right:n,bottom:i,top:o,near:s=y2,far:a=b2}=e;return _4(this,r,n,i,o,s,a),this.check()}orthographic(e){let{fovy:r=Xq,aspect:n=Yq,focalDistance:i=1,near:o=y2,far:s=b2}=e;L4(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(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=e;return L4(r),x4(this,r,n,i,o),this.check()}determinant(){return f4(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){let{rotation:n,scale:i}=g2(this);if(e=e||new Array(16),r)for(let o=0;o<3;o++)r[o]=i[o];for(let o=0;o<16;o++)e[o]=0;for(let o=0;o<9;o++)e[Math.floor(o/3)*4+o%3]=n[o];return e[15]=1,e}getRotationMatrix3(e,r){let{rotation:n,scale:i}=g2(this);if(e=e||new Array(9),r)for(let o=0;o<3;o++)r[o]=i[o];for(let o=0;o<9;o++)e[o]=n[o];return e}transpose(){return l4(this,this),this.check()}invert(){return u4(this,this),this.check()}multiplyLeft(e){return p2(this,e,this),this.check()}multiplyRight(e){return p2(this,this,e),this.check()}rotateX(e){return p4(this,this,e),this.check()}rotateY(e){return g4(this,this,e),this.check()}rotateZ(e){return y4(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return m4(this,this,e,r),this.check()}scale(e){return d4(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return h4(this,this,e),this.check()}transform(e,r){return e.length===4?(r=R4(r||[-0,-0,-0,-0],e,this),Xl(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,i;switch(n){case 2:i=qT(r||[-0,-0],e,this);break;case 3:i=Gm(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Xl(i,e.length),i}transformAsVector(e,r){let n;switch(e.length){case 2:n=VT(r||[-0,-0],e,this);break;case 3:n=Fm(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Xl(n,e.length),n}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}}});function B4(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function x2(t,e,r){r=r*.5;let n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function _2(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=r[0],c=r[1],l=r[2],u=r[3];return t[0]=n*u+s*a+i*l-o*c,t[1]=i*u+s*c+o*a-n*l,t[2]=o*u+s*l+n*c-i*a,t[3]=s*u-n*a-i*c-o*l,t}function C4(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*a,t[1]=i*c+o*a,t[2]=o*c-i*a,t[3]=s*c-n*a,t}function D4(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c-o*a,t[1]=i*c+s*a,t[2]=o*c+n*a,t[3]=s*c-i*a,t}function N4(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c+i*a,t[1]=i*c-n*a,t[2]=o*c+s*a,t[3]=s*c-o*a,t}function F4(t,e){let r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function S2(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[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),t[0]=g*i+y*c,t[1]=g*o+y*l,t[2]=g*s+y*u,t[3]=g*a+y*h,t}function k4(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=o*a,t}function G4(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function U4(t,e){let r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);let o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(e[i*3+i]-e[o*3+o]-e[s*3+s]+1),t[i]=.5*n,n=.5/n,t[3]=(e[o*3+s]-e[s*3+o])*n,t[o]=(e[o*3+i]+e[i*3+o])*n,t[s]=(e[s*3+i]+e[i*3+s])*n}return t}function K4(t,e,r,n){if(e.length!==4||r.length!==4||[...Array.from(e),...Array.from(r),n].some(d=>!Number.isFinite(d)))throw new RangeError("Expected finite quaternions and step");if(e.length!==4||n<0)throw new RangeError("Expected quaternions and a nonnegative step");let i=Math.max(...Array.from(e,Math.abs)),o=Math.max(...Array.from(r,Math.abs));if(!i||!o)throw new RangeError("Zero quaternion");let s=Array.from(e,d=>d/i),a=Array.from(r,d=>d/o),c=Math.hypot(...s),l=Math.hypot(...a);for(let d=0;d<4;d++)s[d]/=c,a[d]/=l;let u=s.reduce((d,m,g)=>d+m*a[g],0),h=2*Math.acos(Math.min(1,Math.abs(u)));if(t.length<4)throw new RangeError("Result buffer is too short");return S2(t,s,a,h===0?0:Math.min(1,n/h)),t}var j4,z4,q4,V4,W4,$4,tV,H4,Km=p(()=>{Jl();Wm();j4=M4,z4=v4,q4=I4,V4=P4,W4=E4,$4=T4,tV=A4,H4=(function(){let t=HT(),e=c2(1,0,0),r=c2(0,1,0);return function(n,i,o){let s=l2(i,o);return s<-.999999?(Zl(t,e,i),e4(t)<1e-6&&Zl(t,r,i),KT(t,t),x2(n,t,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Zl(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+s,tV(n,n))}})()});var zf,X4=p(()=>{Km();Bm();mc();Km();zf=class extends Fs{constructor(e=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,i)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,r,n,i){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return U4(this,e),this.check()}fromEuler(e){switch(this.identity(),e.order){case"xyz":return this.rotateX(e.x).rotateY(e.y).rotateZ(e.z);case"yxz":return this.rotateY(e.y).rotateX(e.x).rotateZ(e.z);case"zxy":return this.rotateZ(e.z).rotateX(e.x).rotateY(e.y);case"zyx":return this.rotateZ(e.z).rotateY(e.y).rotateX(e.x);case"yzx":return this.rotateY(e.y).rotateZ(e.z).rotateX(e.x);case"xzy":return this.rotateX(e.x).rotateZ(e.z).rotateY(e.y);default:throw new Error("Unknown Euler angle order")}}fromAxisRotation(e,r){return x2(this,e,r),this.check()}rotateTowards(e,r){return K4(this,this,e,r)}identity(){return B4(this),this.check()}setAxisAngle(e,r){return this.fromAxisRotation(e,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=Xt(e)}get y(){return this[1]}set y(e){this[1]=Xt(e)}get z(){return this[2]}set z(e){this[2]=Xt(e)}get w(){return this[3]}set w(e){this[3]=Xt(e)}len(){return W4(this)}lengthSquared(){return $4(this)}dot(e){return q4(this,e)}rotationTo(e,r){return H4(this,e,r),this.check()}add(e){return j4(this,this,e),this.check()}calculateW(){return F4(this,this),this.check()}conjugate(){return G4(this,this),this.check()}invert(){return k4(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(V4(this,e,r,n),this.check())}multiplyRight(e){return _2(this,this,e),this.check()}multiplyLeft(e){return _2(this,e,this),this.check()}normalize(){let e=this.len(),r=e>0?1/e:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,e===0&&(this[3]=1),this.check()}rotateX(e){return C4(this,this,e),this.check()}rotateY(e){return D4(this,this,e),this.check()}rotateZ(e){return N4(this,this,e),this.check()}scale(e){return z4(this,this,e),this.check()}slerp(e,r,n){let i,o,s;return arguments.length===2?(i=this,o=e,s=r):(i=e,o=r,s=n),S2(this,i,o,s),this.check()}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,r){return this.setAxisAngle(e,r)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}}});function v2(){return{eastX:0,eastY:1,northZ:1,upX:1,upY:0,upZ:0}}function E2(t,e,r){let n=t.x,i=t.y,o=t.z,s=e.x,a=e.y,c=e.z;return o!==0?!1:rV(r,n,i,s*i-a*n,s,a,c)}function T2(t,e,r,n,i,o){let s=M2(r),a=M2(n),c=M2(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=t.eastX,g=t.eastY,y=t.northZ,b=t.upX,w=t.upY,_=t.upZ,S=-_*g,M=_*m,v=e.x,B=e.y,R=e.z,E=(l===1?m:l===2?S:b)*Math.sign(s),j=(l===1?g:l===2?M:w)*Math.sign(s),I=(l===1?0:l===2?y:_)*Math.sign(s),O=(u===1?m:u===2?S:b)*Math.sign(a),A=(u===1?g:u===2?M:w)*Math.sign(a),W=(u===1?0:u===2?y:_)*Math.sign(a),k=(h===1?m:h===2?S:b)*Math.sign(c),T=(h===1?g:h===2?M:w)*Math.sign(c),C=(h===1?0:h===2?y:_)*Math.sign(c);return!Number.isFinite(E)||!Number.isFinite(j)||!Number.isFinite(I)||!Number.isFinite(O)||!Number.isFinite(A)||!Number.isFinite(W)||!Number.isFinite(k)||!Number.isFinite(T)||!Number.isFinite(C)||!Number.isFinite(v)||!Number.isFinite(B)||!Number.isFinite(R)||o instanceof Float32Array&&(!Number.isFinite(Math.fround(E))||!Number.isFinite(Math.fround(j))||!Number.isFinite(Math.fround(I))||!Number.isFinite(Math.fround(O))||!Number.isFinite(Math.fround(A))||!Number.isFinite(Math.fround(W))||!Number.isFinite(Math.fround(k))||!Number.isFinite(Math.fround(T))||!Number.isFinite(Math.fround(C))||!Number.isFinite(Math.fround(v))||!Number.isFinite(Math.fround(B))||!Number.isFinite(Math.fround(R)))?!1:(o[0]=E,o[1]=j,o[2]=I,o[3]=0,o[4]=O,o[5]=A,o[6]=W,o[7]=0,o[8]=k,o[9]=T,o[10]=C,o[11]=0,o[12]=v,o[13]=B,o[14]=R,o[15]=1,!0)}function M2(t){switch(t){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 rV(t,e,r,n,i,o,s){return!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)?!1:(t.eastX=e,t.eastY=r,t.northZ=n,t.upX=i,t.upY=o,t.upZ=s,!0)}var Y4=p(()=>{});function qf(t,e,r=t){let n=t.x,i=t.y,o=t.z,{semiMajorAxis:s,semiMinorAxis:a,eccentricitySquared:c}=e,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 Ql(r,m,g,y)}function Vf(t,e,r=t){let n=t.x,i=t.y,o=t.z,{semiMajorAxis:s,semiMinorAxis:a,eccentricitySquared:c}=e,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 Ql(r,u===0?0:l,Math.atan2(o,u),h-s);if(u===0)return Ql(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*Ym||c>=.9)return A2(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 M=s/Math.sqrt(1-c*_*_),v=u*w+o*_-M*(1-c*_*_),B=c*M/(M+v);b=1/Math.sqrt(1-B*(2-B)*y*y);let R=y*(1-B)*b,E=g*b;if(Math.abs(E*w-R*_)<=1e-12){if(!Number.isFinite(v))break;return Ql(r,l,Math.atan2(E,Math.abs(R)),v)}w=R,_=E}return A2(n,i,o,u,s,a,r)}function A2(t,e,r,n,i,o,s){let a=Math.atan2(e,t),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+ks(o,o,g)-l*ks(i,i,m)-ks(l,m,l*m))/m:0,b=n*n,w=t*t,_=e*e,S=w+_,M=Number.isFinite(b)&&b>0?(S-b+Xm(w,_,S)+ks(t,t,w)+ks(e,e,_)-ks(n,n,b))/(2*n):0,v=i*l,B=n-i,R=B+v,E=M+Xm(n,-i,B)+Xm(B,v,R)+ks(i,l,v)+i*y;if(r===0)return R+E<0?!1:Ql(s,a,0,B);let j=Math.abs(h)*c,I=0,O=l+Math.hypot(u,h*c);if(!Number.isFinite(O))return!1;let A=Math.max(j,u-d);A>I&&A<O||(A=O/2);let W=-(R+E)/i,k=Math.sqrt(W*(u+d))/d,T=W>0&&Math.abs(r)/k/i*c<=Ym*W?Math.atan2(Math.sign(r)*k/c,u/d):void 0;for(let C=0;C<1024&&T===void 0;C++){let N=d+A,D=u/N,L=r/A/i,P=L*c,z=i*A,we=R-z,ne=(we+(Xm(R,-z,we)+E-ks(i,A,z)))/(i*N)*(D+1),Oe=ne+P*P;if(!Number.isFinite(Oe))return!1;Oe>0?I=A:O=A;let oe=-2*(D*D/N+P*P/A),Se=A-Oe/oe,Be=Se>I&&Se<O?Se:I+(O-I)/2;if(Math.abs(Oe)<=4*Ym*(Math.abs(ne)+P*P)||O-I<=4*Ym*A){T=Math.atan2(L,D);break}A=Be}return T!==void 0&&nV(s,a,T,n,r,i,c)}function Xm(t,e,r){let n=r-t;return t-(r-n)+(e-n)}function ks(t,e,r){let n=134217729*t,i=134217729*e;if(!Number.isFinite(n)||!Number.isFinite(i))return 0;let o=n-(n-t),s=i-(i-e),a=t-o,c=e-s;return o*s-r+o*c+a*s+a*c}function nV(t,e,r,n,i,o,s){let a=Math.sin(r),c=Math.cos(r);return Ql(t,e,r,n*c+i*a-o*Math.hypot(c,s*a))}function Ql(t,e,r,n){return!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)?!1:(t.x=e,t.y=r,t.z=n,!0)}var Ym,Z4=p(()=>{Ym=Number.EPSILON});function Zm(){return eu??Uint16Array}var eu,J4=p(()=>{eu=globalThis.Float16Array});var Q4=p(()=>{J4()});var eA=p(()=>{Q4()});var tA=p(()=>{d2()});var rA=p(()=>{Vm()});var nA=p(()=>{Km()});var iA=p(()=>{Nm()});var oA=p(()=>{Jl()});var sA=p(()=>{Wm()});var Fn=p(()=>{t4();c4();O4();X4();NT();a2();Kl();Y4();Z4();eA();tA();rA();nA();iA();oA();sA()});var $o,Kie,aA=p(()=>{$o=6356752314245179e-9,Kie={radii:[6378137,6378137,$o],radiiSquared:[6378137*6378137,6378137*6378137,$o*$o],oneOverRadii:[1/6378137,1/6378137,1/$o],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/($o*$o)],maximumRadius:Math.max(6378137,6378137,$o),centerToleranceSquared:.1}});function I2(t){return t}function Ho(t,e=[],r=I2){return"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):"x"in t?(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function cA(t,e=[]){return Ho(t,e,xt._cartographicRadians?I2:i2)}function P2(t,e,r,n){let i=xt._cartographicRadians?I2:o2,o=i(t),s=i(e);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 Zie,lA=p(()=>{Fn();Zie=new J});function fo(t,e,r,n,i,o,s){let c=[n,i,o,Math.abs(t),Math.abs(e),Math.abs(r)].map(R=>{let E=R.toString(2),j=E.indexOf(".");return{integer:BigInt("0b"+E.replace(".","")),exponent:j<0?0:j+1-E.length}}),l=Math.min(...c.filter(R=>R.integer!==0n).map(R=>R.exponent)),u=c.map(R=>R.integer<<BigInt(R.exponent-l)),h=u.slice(0,3).map(R=>R*R),d=h.reduce((R,E)=>R<E?R:E),m=h.map(R=>R-d),g=h.map((R,E)=>u[E]*u[E+3]),y=64;if(!g.some((R,E)=>m[E]===0n&&R!==0n)){let R=-1n,E=1n;for(let O=0;O<3;O++){if(m[O]===0n)continue;let A=m[O]*m[O];R=R*A+g[O]*g[O]*E,E*=A}if(R<0n)return!1;if(R===0n)return B(0n,1n);let I=m.filter(O=>O>0n).reduce((O,A)=>O<A?O:A);y=Math.max(64,(2n*(E+R)).toString(2).length-(R*I).toString(2).length+128)}let b=1n<<BigInt(y),w=m.map(R=>R*b),_=g.map(R=>R*b),S=_.map(R=>R*R),M=0n,v=_.reduce((R,E)=>R+E,0n);if(v===0n)return!1;for(let R=0;R<4096;R++){let E=M+v>>1n;if(E===M)return!1;let j=w[0]+E,I=w[1]+E,O=w[2]+E,A=j*j,W=I*I,k=O*O,T=S[0]*W*k+S[1]*A*k+S[2]*A*W-A*W*k;if(T===0n)return B(E,b);if(T>0n?M=E:v=E,M>0n&&v-M<=M>>60n)return B(M+v>>1n,b)}return!1;function B(R,E){let j=h.map((W,k)=>{let T=m[k]*E+R;return T===0n?0:hV(W*u[k+3]*E,T,l)});if(!j.every(Number.isFinite))return!1;let I=Math.sign(t)*j[0],O=Math.sign(e)*j[1],A=Math.sign(r)*j[2];return s.x=I,s.y=O,s.z=A,!0}}function hV(t,e,r){if(t===0n)return 0;let n=52-(t.toString(2).length-e.toString(2).length),i=n>=0?t<<BigInt(n):t,o=n>=0?e:e<<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 uA=p(()=>{});function fA(t,e,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=gc(a,a,c),m=l-c,g=u-c,y=h-c,b=Ko(l,-c,m)+gc(n,n,l)-d,w=Ko(u,-c,g)+gc(i,i,u)-d,_=Ko(h,-c,y)+gc(o,o,h)-d,S=n*Math.abs(t),M=i*Math.abs(e),v=o*Math.abs(r);if(c<2**-1022||t!==0&&S<2**-1022||e!==0&&M<2**-1022||r!==0&&v<2**-1022)return fo(t,e,r,n,i,o,s);let B=gc(n,Math.abs(t),S),R=gc(i,Math.abs(e),M),E=gc(o,Math.abs(r),v);if(Math.hypot(m===0?S===0?0:1/0:S/(m+b),g===0?M===0?0:1/0:M/(g+w),y===0?v===0?0:1/0:v/(y+_))<=1+64*Number.EPSILON)return fo(t,e,r,n,i,o,s);if((t!==0?1:0)+(e!==0?1:0)+(r!==0?1:0)==1)return s.x=t===0?t:Math.sign(t)*n,s.y=e===0?e:Math.sign(e)*i,s.z=r===0?r:Math.sign(r)*o,!0;let I=Math.hypot(m===0?S:0,g===0?M:0,y===0?v:0),O=Math.hypot(S,M,v);if(!(O>0)||!Number.isFinite(O))return fo(t,e,r,n,i,o,s);let A=I>0?I:O;for(let W=0;W<512;W++){let k=m+A,T=g+A,C=y+A,N=Ko(m,A,k)+b,D=Ko(g,A,T)+w,L=Ko(y,A,C)+_,P=S/k,z=M/T,we=v/C,_e,ne;P>=z&&P>=we?(_e=R2(S,B,m,b,A,k)*(P+1),ne=(z*(1-D/T))**2+(we*(1-L/C))**2):z>=we?(_e=R2(M,R,g,w,A,T)*(z+1),ne=(P*(1-N/k))**2+(we*(1-L/C))**2):(_e=R2(v,E,y,_,A,C)*(we+1),ne=(P*(1-N/k))**2+(z*(1-D/T))**2);let Oe=-2*(P*P/k+z*z/T+we*we/C),oe=4*Number.EPSILON*(Math.abs(_e)+ne),Se=_e+ne;if(!Number.isFinite(Se))return fo(t,e,r,n,i,o,s);if(Math.abs(Se)<=4*Number.EPSILON*(Math.abs(_e)+ne)||O-I<=4*Number.EPSILON*A){let ze=oe/Math.abs(Oe);if(!Number.isFinite(Oe)||!(Math.abs(Oe)>0)||ze>2e-13*A)return fo(t,e,r,n,i,o,s);let Ye=Math.sign(t)*n*(P*(1-N/k)),ft=Math.sign(e)*i*(z*(1-D/T)),ht=Math.sign(r)*o*(we*(1-L/C)),pt=2*ze*Math.max(Math.abs(Ye/k),Math.abs(ft/T),Math.abs(ht/C));return!Number.isFinite(pt)||pt>2e-13*Math.max(n,i,o)?fo(t,e,r,n,i,o,s):!Number.isFinite(Ye)||!Number.isFinite(ft)||!Number.isFinite(ht)?fo(t,e,r,n,i,o,s):(s.x=Ye,s.y=ft,s.z=ht,!0)}Se>0?I=A:O=A;let Be=A-Se/Oe,V=Be>I&&Be<O?Be:I+(O-I)/2;if(V===A)return fo(t,e,r,n,i,o,s);A=V}return fo(t,e,r,n,i,o,s)}function R2(t,e,r,n,i,o){let s=t-r,a=Ko(t,-r,s)+e-n,c=s+a,l=Ko(s,a,c),u=c-i;return(u+(Ko(c,-i,u)+l))/o}function Ko(t,e,r){let n=r-t;return t-(r-n)+(e-n)}function gc(t,e,r){let n=134217729*t,i=134217729*e;if(!Number.isFinite(n)||!Number.isFinite(i))return 0;let o=n-(n-t),s=i-(i-e),a=t-o,c=e-s;return o*s-r+o*c+a*s+a*c}var hA=p(()=>{uA()});function dA(t,e,r=[]){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)||!Number.isFinite(i*i+o*o+s*s))return;let{radii:a}=e;if(fA(i,o,s,a.x,a.y,a.z,Jm))return ho(r,Jm.x,Jm.y,Jm.z)}function ho(t,e,r,n){if(uo(t))t[0]=e,t[1]=r,t[2]=n;else{let i=t;i.x=e,i.y=r,i.z=n}return t}var Jm,mA=p(()=>{Fn();hA();Jm={x:0,y:0,z:0}});function pA(t,e){if(!Number.isFinite(t)||!Number.isFinite(e)||t<=0||e<=0||e>t)throw new Error("Spheroid requires finite positive axes with semiMinorAxis <= semiMajorAxis")}function tp(t,e,r,n){let i=Math.max(Math.abs(t),Math.abs(e),Math.abs(r));if(!(i>0)||!Number.isFinite(i))return;let o=t/i,s=e/i,a=r/i,c=Math.hypot(o,s,a);return ho(n,o/c,s/c,a/c)}var bn,Qm,pV,mi,ep,Tt,gA=p(()=>{Fn();Fn();aA();lA();mA();bn={x:0,y:0,z:0},Qm=new J,pV=new J,mi=new J,ep=new J,Tt=class t{static fromSpheroid(e){let{semiMajorAxis:r,semiMinorAxis:n}=e;return pA(r,n),new t(r,r,n)}constructor(e=0,r=0,n=0){this.centerToleranceSquared=Lm.EPSILON1,Bi(Number.isFinite(e)&&e>=0),Bi(Number.isFinite(r)&&r>=0),Bi(Number.isFinite(n)&&n>=0),this.radii=new J(e,r,n),this.radiiSquared=new J(e*e,r*r,n*n),this.radiiToTheFourth=new J(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new J(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new J(e===0?0:1/(e*e),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,r,n),this.maximumRadius=Math.max(e,r,n),n!==0&&(this.squaredXOverSquaredZ=(e/n)**2),e===r&&n>0&&n<=e&&Number.isFinite(this.radiiSquared.x)&&this.radiiSquared.z>0&&(this.spheroidGeometry=Object.freeze({semiMajorAxis:e,semiMinorAxis:n,eccentricitySquared:1-(n/e)**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:e,y:r,z:n}=this.radii;if(e!==r)throw new Error("Spheroid requires equal X/Y radii");return pA(e,n),Object.freeze({semiMajorAxis:e,semiMinorAxis:n})}equals(e){return this===e||!!(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,r=[0,0,0]){let n=cA(e,ep),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,qf(bn,this.spheroidGeometry)?ho(r,bn.x,bn.y,bn.z):void 0;let a=pV;this.geodeticSurfaceNormalCartographic(e,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 ho(r,y,b,w)}cartesianToCartographic(e,r=[0,0,0]){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))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)&&Vf(bn,_)){let M=i===0&&o===0?Math.atan2(o,i):bn.x;return P2(M,bn.y,bn.z,r)}}if(!(this.minimumRadius>0)||!Number.isFinite(this.maximumRadius*this.maximumRadius)||!Number.isFinite(1/(this.minimumRadius*this.minimumRadius)))return;ep.set(i,o,s);let a=this.scaleToGeodeticSurface(ep,mi);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 P2(y,b,w,r)}geocentricSurfaceNormal(e,r=[0,0,0]){Ho(e,Qm);let n=Qm;return tp(n.x,n.y,n.z,r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=Ho(e,ep),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 tp(c*Math.cos(i),c*Math.sin(i),l,r)}geodeticSurfaceNormal(e,r=[0,0,0]){if(!(this.minimumRadius>0))return;Ho(e,Qm);let n=Qm,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 tp(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 tp(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(e,r){return dA(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){Ho(e,mi);let n=mi,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 ho(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 ho(r,s/l,a/l,c/l)}transformPositionToScaledSpace(e,r=[0,0,0]){Ho(e,mi);let n=mi.scale(this.oneOverRadii);return ho(r,n.x,n.y,n.z)}transformPositionFromScaledSpace(e,r=[0,0,0]){Ho(e,mi);let n=mi.scale(this.radii);return ho(r,n.x,n.y,n.z)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){if(Bi(this.radii.x===this.radii.y&&this.minimumRadius>0),Ho(e,mi),!Number.isFinite(mi.x)||!Number.isFinite(mi.y)||!Number.isFinite(mi.z)||!Number.isFinite(r))return;let i=mi.z*(1-this.squaredXOverSquaredZ);if(Number.isFinite(i)&&!(Math.abs(i)>=this.radii.z-r))return ho(n,0,0,i)}};Tt.WGS84=new Tt(6378137,6378137,$o)});var er,yA=p(()=>{er={};er.Constants={};er.Math={};er.Accumulator={};(function(t){"use strict";t.WGS84={a:6378137,f:1/298.257223563},t.version={major:2,minor:2,patch:0},t.version_string="2.2.0"})(er.Constants);(function(t){"use strict";t.digits=53,t.epsilon=Math.pow(.5,t.digits-1),t.degree=Math.PI/180,t.sq=function(e){return e*e},t.hypot=function(e,r){return Math.sqrt(e*e+r*r)},t.cbrt=Math.cbrt||function(e){var r=Math.pow(Math.abs(e),.3333333333333333);return e>0?r:e<0?-r:e},t.log1p=Math.log1p||function(e){var r=1+e,n=r-1;return n===0?e:e*Math.log(r)/n},t.atanh=Math.atanh||function(e){var r=Math.abs(e);return r=t.log1p(2*r/(1-r))/2,e>0?r:e<0?-r:e},t.copysign=function(e,r){return Math.abs(e)*(r<0||r===0&&1/r<0?-1:1)},t.sum=function(e,r){var n=e+r,i=n-r,o=n-i,s;return i-=e,o-=r,s=n&&0-(i+o),{s:n,t:s}},t.polyval=function(e,r,n,i){for(var o=e<0?0:r[n++];--e>=0;)o=o*i+r[n++];return o},t.AngRound=function(e){var r=.0625,n=Math.abs(e);return n=n<r?r-(r-n):n,t.copysign(n,e)},t.remainder=function(e,r){return e%=r,e<-r/2?e+r:e<r/2?e:e-r},t.AngNormalize=function(e){var r=t.remainder(e,360);return Math.abs(r)===180?t.copysign(180,e):r},t.LatFix=function(e){return Math.abs(e)>90?NaN:e},t.AngDiff=function(e,r){var n=t.sum(t.remainder(-e,360),t.remainder(r,360)),i,o;return n=t.sum(t.remainder(n.s,360),n.t),i=n.s,o=n.t,(i===0||Math.abs(i)===180)&&(i=t.copysign(i,o===0?r-e:-o)),{d:i,e:o}},t.sincosd=function(e){var r,n,i,o,s,a,c;switch(r=e%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=t.copysign(s,n)):Math.abs(r)===30&&(s=Math.sqrt(.75),o=t.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=t.copysign(a,e)),{s:a,c}},t.sincosde=function(e,r){var n,i,o,s,a,c,l;switch(n=e%360,o=Math.round(n/90),n=t.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=t.copysign(a,i)):Math.abs(n)===30&&(a=Math.sqrt(.75),s=t.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=t.copysign(c,e+r)),{s:c,c:l}},t.atan2d=function(e,r){var n=0,i;switch(Math.abs(e)>Math.abs(r)&&([e,r]=[r,e],n=2),t.copysign(1,r)<0&&(r=-r,++n),i=Math.atan2(e,r)/this.degree,n){case 1:i=t.copysign(180,e)-i;break;case 2:i=90-i;break;case 3:i=-90+i;break;default:break}return i}})(er.Math);(function(t,e){"use strict";t.Accumulator=function(r){this.Set(r)},t.Accumulator.prototype.Set=function(r){r||(r=0),r.constructor===t.Accumulator?(this._s=r._s,this._t=r._t):(this._s=r,this._t=0)},t.Accumulator.prototype.Add=function(r){var n=e.sum(r,this._t),i=e.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},t.Accumulator.prototype.Sum=function(r){var n;return r?(n=new t.Accumulator(this),n.Add(r),n._s):this._s},t.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1},t.Accumulator.prototype.Remainder=function(r){this._s=e.remainder(this._s,r),this.Add(0)}})(er.Accumulator,er.Math);er.Geodesic={};er.GeodesicLine={};er.PolygonArea={};(function(t,e,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,M=31,v=32640,B,R,E,j,I,O,A,W,k;t.tiny_=Math.sqrt(Number.MIN_VALUE/Number.EPSILON),t.nC1_=o,t.nC1p_=o,t.nC2_=o,t.nC3_=o,t.nC4_=o,u=t.nC3_*(t.nC3_-1)/2,h=t.nC4_*(t.nC4_+1)/2,t.CAP_C1=1,t.CAP_C1p=2,t.CAP_C2=4,t.CAP_C3=8,t.CAP_C4=16,t.NONE=0,t.ARC=64,t.LATITUDE=128|S,t.LONGITUDE=256|t.CAP_C3,t.AZIMUTH=512|S,t.DISTANCE=1024|t.CAP_C1,t.STANDARD=t.LATITUDE|t.LONGITUDE|t.AZIMUTH|t.DISTANCE,t.DISTANCE_IN=2048|t.CAP_C1|t.CAP_C1p,t.REDUCEDLENGTH=4096|t.CAP_C1|t.CAP_C2,t.GEODESICSCALE=8192|t.CAP_C1|t.CAP_C2,t.AREA=16384|t.CAP_C4,t.ALL=v|M,t.LONG_UNROLL=32768,t.OUT_MASK=v|t.LONG_UNROLL,t.SinCosSeries=function(T,C,N,D,L){if(L!==void 0){var P=L/2,z=Math.sin(P),we=Math.cos(P);return-2*t.SinCosSeries(!1,N*we-C*z,C*we+N*z,D.map(function(Be,V){return(V%2?-Be:Be)*Math.sin((2*V+1)*P)}))}var _e=D.length,ne=_e-(T?1:0),Oe=2*(N-C)*(N+C),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 T?2*C*N*oe:N*(oe-Se)},B=function(T,C){var N,D=n.sq(T),L=n.sq(C),P=(D+L-1)/6,z,we,_e,ne,Oe,oe,Se,Be,V,ze,Ye;return L===0&&P<=0?N=0:(z=D*L/4,we=n.sq(P),_e=P*we,ne=z*(z+2*_e),Oe=P,ne>=0?(oe=z+_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),-(z+_e)),Oe+=2*P*Math.cos(Be/3)),V=Math.sqrt(n.sq(Oe)+L),ze=Oe<0?L/(V-Oe):Oe+V,Ye=(ze-L)/(2*V),N=ze/(Math.sqrt(ze+n.sq(Ye))+Ye)),N},R=[1,4,64,0,256],t.A1m1f=function(T){var C=Math.floor(s/2),N=n.polyval(C,R,0,n.sq(T))/R[C+1];return(N+T)/(1-T)},E=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],t.C1f=function(T,C){var N=n.sq(T),D=T,L=0,P,z;for(P=1;P<=t.nC1_;++P)z=Math.floor((t.nC1_-P)/2),C[P]=D*n.polyval(z,E,L,N)/E[L+z+1],L+=z+2,D*=T},j=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],t.C1pf=function(T,C){var N=n.sq(T),D=T,L=0,P,z;for(P=1;P<=t.nC1p_;++P)z=Math.floor((t.nC1p_-P)/2),C[P]=D*n.polyval(z,j,L,N)/j[L+z+1],L+=z+2,D*=T},I=[-11,-28,-192,0,256],t.A2m1f=function(T){var C=Math.floor(a/2),N=n.polyval(C,I,0,n.sq(T))/I[C+1];return(N-T)/(1+T)},O=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],t.C2f=function(T,C){var N=n.sq(T),D=T,L=0,P,z;for(P=1;P<=t.nC2_;++P)z=Math.floor((t.nC2_-P)/2),C[P]=D*n.polyval(z,O,L,N)/O[L+z+1],L+=z+2,D*=T},t.Geodesic=function(T,C){if(this.a=T,this.f=C,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],t.Geodesic.prototype.A3coeff=function(){var T=0,C=0,N,D;for(N=c-1;N>=0;--N)D=Math.min(c-N-1,N),this._A3x[C++]=n.polyval(D,A,T,this._n)/A[T+D+1],T+=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],t.Geodesic.prototype.C3coeff=function(){var T=0,C=0,N,D,L;for(N=1;N<t.nC3_;++N)for(D=t.nC3_-1;D>=N;--D)L=Math.min(t.nC3_-D-1,D),this._C3x[C++]=n.polyval(L,W,T,this._n)/W[T+L+1],T+=L+2},k=[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],t.Geodesic.prototype.C4coeff=function(){var T=0,C=0,N,D,L;for(N=0;N<t.nC4_;++N)for(D=t.nC4_-1;D>=N;--D)L=t.nC4_-D-1,this._C4x[C++]=n.polyval(L,k,T,this._n)/k[T+L+1],T+=L+2},t.Geodesic.prototype.A3f=function(T){return n.polyval(l-1,this._A3x,0,T)},t.Geodesic.prototype.C3f=function(T,C){var N=1,D=0,L,P;for(L=1;L<t.nC3_;++L)P=t.nC3_-L-1,N*=T,C[L]=N*n.polyval(P,this._C3x,D,T),D+=P+1},t.Geodesic.prototype.C4f=function(T,C){var N=1,D=0,L,P;for(L=0;L<t.nC4_;++L)P=t.nC4_-L-1,C[L]=N*n.polyval(P,this._C4x,D,T),D+=P+1,N*=T},t.Geodesic.prototype.Lengths=function(T,C,N,D,L,P,z,we,_e,ne,Oe,oe,Se){Oe&=t.OUT_MASK;var Be={},V=0,ze=0,Ye=0,ft=0,ht,pt,Lt,Jt,gr;if(Oe&(t.DISTANCE|t.REDUCEDLENGTH|t.GEODESICSCALE)&&(Ye=t.A1m1f(T),t.C1f(T,oe),Oe&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(ft=t.A2m1f(T),t.C2f(T,Se),V=Ye-ft,ft=1+ft),Ye=1+Ye),Oe&t.DISTANCE)ht=t.SinCosSeries(!0,P,z,oe)-t.SinCosSeries(!0,N,D,oe),Be.s12b=Ye*(C+ht),Oe&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(pt=t.SinCosSeries(!0,P,z,Se)-t.SinCosSeries(!0,N,D,Se),ze=V*C+(Ye*ht-ft*pt));else if(Oe&(t.REDUCEDLENGTH|t.GEODESICSCALE)){for(Lt=1;Lt<=t.nC2_;++Lt)Se[Lt]=Ye*oe[Lt]-ft*Se[Lt];ze=V*C+(t.SinCosSeries(!0,P,z,Se)-t.SinCosSeries(!0,N,D,Se))}return Oe&t.REDUCEDLENGTH?(Be.m0=V,Be.m12b=we*(D*P)-L*(N*z)-D*z*ze):Be.m12b=NaN,Oe&t.GEODESICSCALE&&(Jt=D*z+N*P,gr=this._ep2*(_e-ne)*(_e+ne)/(L+we),Be.M12=Jt+(gr*P-z*ze)*N/L,Be.M21=Jt-(gr*N-D*ze)*P/we),Be},t.Geodesic.prototype.InverseStart=function(T,C,N,D,L,P,z,we,_e,ne,Oe){var oe={},Se=D*C-L*T,Be=L*C+D*T,V,ze,Ye,ft,ht,pt,Lt,Jt,gr,He,We,Ke,zt,yr,Is,Ps,hf,eo,nt,Yr,Sr,dn,Cn;return oe.sig12=-1,V=D*C,V+=L*T,ze=Be>=0&&Se<.5&&L*z<.5,ze?(ft=n.sq(T+D),ft/=ft+n.sq(C+L),oe.dnm=Math.sqrt(1+this._ep2*ft),Ye=z/(this._f1*oe.dnm),ht=Math.sin(Ye),pt=Math.cos(Ye)):(ht=we,pt=_e),oe.salp1=L*ht,oe.calp1=pt>=0?Se+L*T*n.sq(ht)/(1+pt):V-L*T*n.sq(ht)/(1-pt),Jt=n.hypot(oe.salp1,oe.calp1),gr=T*D+C*L*pt,ze&&Jt<this._etol2?(oe.salp2=C*ht,oe.calp2=Se-C*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(Jt,gr)):Math.abs(this._n)>.1||gr>=0||Jt>=6*Math.abs(this._n)*Math.PI*n.sq(C)||(Cn=Math.atan2(-we,-_e),this.f>=0?(yr=n.sq(T)*this._ep2,Is=yr/(2*(1+Math.sqrt(1+yr))+yr),Ke=this.f*C*this.A3f(Is)*Math.PI,zt=Ke*C,He=Cn/Ke,We=V/zt):(Ps=L*C-D*T,hf=Math.atan2(V,Ps),Yr=this.Lengths(this._n,Math.PI+hf,T,-C,N,D,L,P,C,L,t.REDUCEDLENGTH,ne,Oe),eo=Yr.m12b,nt=Yr.m0,He=-1+eo/(C*L*nt*Math.PI),zt=He<-.01?V/He:-this.f*n.sq(C)*Math.PI,Ke=zt/C,We=z/Ke),We>-y&&He>-1-_?this.f>=0?(oe.salp1=Math.min(1,-He),oe.calp1=-Math.sqrt(1-n.sq(oe.salp1))):(oe.calp1=Math.max(He>-y?0:-1,He),oe.salp1=Math.sqrt(1-n.sq(oe.calp1))):(Sr=B(He,We),dn=Ke*(this.f>=0?-He*Sr/(1+Sr):-We*(1+Sr)/Sr),ht=Math.sin(dn),pt=-Math.cos(dn),oe.salp1=L*ht,oe.calp1=V-L*T*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},t.Geodesic.prototype.Lambda12=function(T,C,N,D,L,P,z,we,_e,ne,Oe,oe,Se,Be){var V={},ze,Ye,ft,ht,pt,Lt,Jt,gr,He,We,Ke,zt,yr;return T===0&&we===0&&(we=-t.tiny_),Ye=z*C,ft=n.hypot(we,z*T),V.ssig1=T,ht=Ye*T,V.csig1=pt=we*C,ze=n.hypot(V.ssig1,V.csig1),V.ssig1/=ze,V.csig1/=ze,V.salp2=L!==C?Ye/L:z,V.calp2=L!==C||Math.abs(D)!==-T?Math.sqrt(n.sq(we*C)+(C<-T?(L-C)*(C+L):(T-D)*(T+D)))/L:Math.abs(we),V.ssig2=D,Lt=Ye*D,V.csig2=Jt=V.calp2*L,ze=n.hypot(V.ssig2,V.csig2),V.ssig2/=ze,V.csig2/=ze,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*Jt),He=pt*Jt+ht*Lt,Ke=Math.atan2(gr*ne-He*_e,He*ne+gr*_e),zt=n.sq(ft)*this._ep2,V.eps=zt/(2*(1+Math.sqrt(1+zt))+zt),this.C3f(V.eps,Be),We=t.SinCosSeries(!0,V.ssig2,V.csig2,Be)-t.SinCosSeries(!0,V.ssig1,V.csig1,Be),V.domg12=-this.f*this.A3f(V.eps)*Ye*(V.sig12+We),V.lam12=Ke+V.domg12,Oe&&(V.calp2===0?V.dlam12=-2*this._f1*N/T:(yr=this.Lengths(V.eps,V.sig12,V.ssig1,V.csig1,N,V.ssig2,V.csig2,P,C,L,t.REDUCEDLENGTH,oe,Se),V.dlam12=yr.m12b,V.dlam12*=this._f1/(V.calp2*L))),V},t.Geodesic.prototype.Inverse=function(T,C,N,D,L){var P,z;return L||(L=t.STANDARD),L===t.LONG_UNROLL&&(L|=t.STANDARD),L&=t.OUT_MASK,P=this.InverseInt(T,C,N,D,L),z=P.vals,L&t.AZIMUTH&&(z.azi1=n.atan2d(P.salp1,P.calp1),z.azi2=n.atan2d(P.salp2,P.calp2)),z},t.Geodesic.prototype.InverseInt=function(T,C,N,D,L){var P={},z,we,_e,ne,Oe,oe,Se,Be,V,ze,Ye,ft,ht,pt,Lt,Jt,gr,He,We,Ke,zt,yr,Is,Ps,hf,eo,nt,Yr,Sr,dn,Cn,_d,Sd,Sl,rc,df,mf,pf,gf,Md,tg,Ml,rg,vd,ng,ig,og,qS,sg,Ed,ag,Td,VS,yf,WS,$S,bf,Ad,wf,cg,lg,Id,Pd,ug,fg;if(P.lat1=T=n.LatFix(T),P.lat2=N=n.LatFix(N),T=n.AngRound(T),N=n.AngRound(N),z=n.AngDiff(C,D),we=z.e,z=z.d,L&t.LONG_UNROLL?(P.lon1=C,P.lon2=C+z+we):(P.lon1=n.AngNormalize(C),P.lon2=n.AngNormalize(D)),_e=n.copysign(1,z),z*=_e,we*=_e,Lt=z*n.degree,ne=n.sincosde(z,we),Jt=ne.s,gr=ne.c,we=180-z-we,Oe=Math.abs(T)<Math.abs(N)||isNaN(N)?-1:1,Oe<0&&(_e*=-1,[N,T]=[T,N]),oe=n.copysign(1,-T),T*=oe,N*=oe,ne=n.sincosd(T),Se=this._f1*ne.s,Be=ne.c,ne=n.hypot(Se,Be),Se/=ne,Be/=ne,Be=Math.max(t.tiny_,Be),ne=n.sincosd(N),V=this._f1*ne.s,ze=ne.c,ne=n.hypot(V,ze),V/=ne,ze/=ne,ze=Math.max(t.tiny_,ze),Be<-Se?ze===Be&&(V=n.copysign(Se,V)):Math.abs(V)===-Se&&(ze=Be),ht=Math.sqrt(1+this._ep2*n.sq(Se)),pt=Math.sqrt(1+this._ep2*n.sq(V)),Is=new Array(t.nC1_+1),Ps=new Array(t.nC2_+1),hf=new Array(t.nC3_),eo=T===-90||Jt===0,eo&&(We=gr,Ke=Jt,zt=1,yr=0,Yr=Se,Sr=We*Be,dn=V,Cn=zt*ze,He=Math.atan2(Math.max(0,Sr*dn-Yr*Cn),Sr*Cn+Yr*dn),nt=this.Lengths(this._n,He,Yr,Sr,ht,dn,Cn,pt,Be,ze,L|t.DISTANCE|t.REDUCEDLENGTH,Is,Ps),Ye=nt.s12b,ft=nt.m12b,L&t.GEODESICSCALE&&(P.M12=nt.M12,P.M21=nt.M21),He<b||ft>=0?((He<3*t.tiny_||He<g&&(Ye<0||ft<0))&&(He=ft=Ye=0),ft*=this._b,Ye*=this._b,P.a12=He/n.degree):eo=!1),bf=2,!eo&&Se===0&&(this.f<=0||we>=this.f*180))We=zt=0,Ke=yr=1,Ye=this.a*Lt,He=Sd=Lt/this._f1,ft=this._b*Math.sin(He),L&t.GEODESICSCALE&&(P.M12=P.M21=Math.cos(He)),P.a12=z/this._f1;else if(!eo)if(nt=this.InverseStart(Se,Be,ht,V,ze,pt,Lt,Jt,gr,Is,Ps),He=nt.sig12,Ke=nt.salp1,We=nt.calp1,He>=0)yr=nt.salp2,zt=nt.calp2,Sl=nt.dnm,Ye=He*this._b*Sl,ft=n.sq(Sl)*this._b*Math.sin(He/Sl),L&t.GEODESICSCALE&&(P.M12=P.M21=Math.cos(He/Sl)),P.a12=He/n.degree,Sd=Lt/(this._f1*Sl);else{for(rc=0,df=t.tiny_,mf=1,pf=t.tiny_,gf=-1,Md=!1,tg=!1;nt=this.Lambda12(Se,Be,ht,V,ze,pt,Ke,We,Jt,gr,rc<d,Is,Ps,hf),Ml=nt.lam12,yr=nt.salp2,zt=nt.calp2,He=nt.sig12,Yr=nt.ssig1,Sr=nt.csig1,dn=nt.ssig2,Cn=nt.csig2,_d=nt.eps,wf=nt.domg12,rg=nt.dlam12,!(tg||!(Math.abs(Ml)>=(Md?8:1)*g)||rc==m);++rc){if(Ml>0&&(rc<d||We/Ke>gf/pf)?(pf=Ke,gf=We):Ml<0&&(rc<d||We/Ke<mf/df)&&(df=Ke,mf=We),rc<d&&rg>0&&(vd=-Ml/rg,Math.abs(vd)<Math.PI&&(ng=Math.sin(vd),ig=Math.cos(vd),og=Ke*ig+We*ng,og>0))){We=We*ig-Ke*ng,Ke=og,ne=n.hypot(Ke,We),Ke/=ne,We/=ne,Md=Math.abs(Ml)<=16*g;continue}Ke=(df+pf)/2,We=(mf+gf)/2,ne=n.hypot(Ke,We),Ke/=ne,We/=ne,Md=!1,tg=Math.abs(df-Ke)+(mf-We)<w||Math.abs(Ke-pf)+(We-gf)<w}qS=L|(L&(t.REDUCEDLENGTH|t.GEODESICSCALE)?t.DISTANCE:t.NONE),nt=this.Lengths(_d,He,Yr,Sr,ht,dn,Cn,pt,Be,ze,qS,Is,Ps),Ye=nt.s12b,ft=nt.m12b,L&t.GEODESICSCALE&&(P.M12=nt.M12,P.M21=nt.M21),ft*=this._b,Ye*=this._b,P.a12=He/n.degree,L&t.AREA&&(ug=Math.sin(wf),fg=Math.cos(wf),bf=Jt*fg-gr*ug,Ad=gr*fg+Jt*ug)}return L&t.DISTANCE&&(P.s12=0+Ye),L&t.REDUCEDLENGTH&&(P.m12=0+ft),L&t.AREA&&(sg=Ke*Be,Ed=n.hypot(We,Ke*Se),Ed!==0&&sg!==0?(Yr=Se,Sr=We*Be,dn=V,Cn=zt*ze,Td=n.sq(Ed)*this._ep2,_d=Td/(2*(1+Math.sqrt(1+Td))+Td),VS=n.sq(this.a)*Ed*sg*this._e2,ne=n.hypot(Yr,Sr),Yr/=ne,Sr/=ne,ne=n.hypot(dn,Cn),dn/=ne,Cn/=ne,yf=new Array(t.nC4_),this.C4f(_d,yf),WS=t.SinCosSeries(!1,Yr,Sr,yf),$S=t.SinCosSeries(!1,dn,Cn,yf),P.S12=VS*(He<.01?t.SinCosSeries(!1,Yr,Sr,yf,He):$S-WS)):P.S12=0,!eo&&bf==2&&(bf=Math.sin(Sd),Ad=Math.cos(Sd)),!eo&&Ad>-.7071&&V-Se<1.75?(wf=1+Ad,cg=1+Be,lg=1+ze,ag=2*Math.atan2(bf*(Se*lg+V*cg),wf*(Se*V+cg*lg))):(Id=yr*We-zt*Ke,Pd=zt*We+yr*Ke,Id===0&&Pd<0&&(Id=t.tiny_*We,Pd=-1),ag=Math.atan2(Id,Pd)),P.S12+=this._c2*ag,P.S12*=Oe*_e*oe,P.S12+=0),Oe<0&&([yr,Ke]=[Ke,yr],[zt,We]=[We,zt],L&t.GEODESICSCALE&&([P.M21,P.M12]=[P.M12,P.M21])),Ke*=Oe*_e,We*=Oe*oe,yr*=Oe*_e,zt*=Oe*oe,{vals:P,salp1:Ke,calp1:We,salp2:yr,calp2:zt}},t.Geodesic.prototype.GenDirect=function(T,C,N,D,L,P){var z;return P?P===t.LONG_UNROLL&&(P|=t.STANDARD):P=t.STANDARD,D||(P|=t.DISTANCE_IN),z=new e.GeodesicLine(this,T,C,N,P),z.GenPosition(D,L,P)},t.Geodesic.prototype.Direct=function(T,C,N,D,L){return this.GenDirect(T,C,N,!1,D,L)},t.Geodesic.prototype.ArcDirect=function(T,C,N,D,L){return this.GenDirect(T,C,N,!0,D,L)},t.Geodesic.prototype.Line=function(T,C,N,D){return new e.GeodesicLine(this,T,C,N,D)},t.Geodesic.prototype.DirectLine=function(T,C,N,D,L){return this.GenDirectLine(T,C,N,!1,D,L)},t.Geodesic.prototype.ArcDirectLine=function(T,C,N,D,L){return this.GenDirectLine(T,C,N,!0,D,L)},t.Geodesic.prototype.GenDirectLine=function(T,C,N,D,L,P){var z;return P||(P=t.STANDARD|t.DISTANCE_IN),D||(P|=t.DISTANCE_IN),z=new e.GeodesicLine(this,T,C,N,P),z.GenSetDistance(D,L),z},t.Geodesic.prototype.InverseLine=function(T,C,N,D,L){var P,z,we;return L||(L=t.STANDARD|t.DISTANCE_IN),P=this.InverseInt(T,C,N,D,t.ARC),we=n.atan2d(P.salp1,P.calp1),L&(t.OUT_MASK&t.DISTANCE_IN)&&(L|=t.DISTANCE),z=new e.GeodesicLine(this,T,C,we,L,P.salp1,P.calp1),z.SetArc(P.vals.a12),z},t.Geodesic.prototype.Polygon=function(T){return new r.PolygonArea(this,T)},t.WGS84=new t.Geodesic(i.WGS84.a,i.WGS84.f)})(er.Geodesic,er.GeodesicLine,er.PolygonArea,er.Math,er.Constants);(function(t,e,r){"use strict";e.GeodesicLine=function(n,i,o,s,a,c,l){var u,h,d,m,g,y;a||(a=t.STANDARD|t.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|t.LATITUDE|t.AZIMUTH|t.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(t.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&t.CAP_C1&&(this._A1m1=t.A1m1f(m),this._C1a=new Array(t.nC1_+1),t.C1f(m,this._C1a),this._B11=t.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&t.CAP_C1p&&(this._C1pa=new Array(t.nC1p_+1),t.C1pf(m,this._C1pa)),this.caps&t.CAP_C2&&(this._A2m1=t.A2m1f(m),this._C2a=new Array(t.nC2_+1),t.C2f(m,this._C2a),this._B21=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&t.CAP_C3&&(this._C3a=new Array(t.nC3_),n.C3f(m,this._C3a),this._A3c=-this.f*this._salp0*n.A3f(m),this._B31=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&t.CAP_C4&&(this._C4a=new Array(t.nC4_),n.C4f(m,this._C4a),this._A4=r.sq(this.a)*this._calp0*this._salp0*n._e2,this._B41=t.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=NaN},e.GeodesicLine.prototype.GenPosition=function(n,i,o,s={}){var a,c,l,u,h,d,m,g,y,b,w,_,S,M,v,B,R,E,j,I,O,A,W,k,T,C,N,D,L;return o?o===t.LONG_UNROLL&&(o|=t.STANDARD):o=t.STANDARD,o&=this.caps&t.OUT_MASK,s.lat1=this.lat1,s.azi1=this.azi1,s.lon1=o&t.LONG_UNROLL?this.lon1:r.AngNormalize(this.lon1),n?s.a12=i:s.s12=i,n||this.caps&t.DISTANCE_IN&t.OUT_MASK?(u=0,h=0,n?(a=i*r.degree,C=r.sincosd(i),c=C.s,l=C.c):(g=i/(this._b*(1+this._A1m1)),y=Math.sin(g),b=Math.cos(g),u=-t.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=t.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&(t.DISTANCE|t.REDUCEDLENGTH|t.GEODESICSCALE)&&((n||Math.abs(this.f)>.01)&&(u=t.SinCosSeries(!0,d,m,this._C1a)),h=(1+this._A1m1)*(u-this._B11)),B=this._calp0*d,R=r.hypot(this._salp0,this._calp0*m),R===0&&(R=m=t.tiny_),I=this._salp0,O=this._calp0*m,n&&o&t.DISTANCE&&(s.s12=this._b*((1+this._A1m1)*a+h)),o&t.LONGITUDE&&(E=this._salp0*d,j=m,v=r.copysign(1,this._salp0),_=o&t.LONG_UNROLL?v*(a-(Math.atan2(d,m)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(v*E,j)-Math.atan2(v*this._somg1,this._comg1))):Math.atan2(E*this._comg1-j*this._somg1,j*this._comg1+E*this._somg1),S=_+this._A3c*(a+(t.SinCosSeries(!0,d,m,this._C3a)-this._B31)),M=S/r.degree,s.lon2=o&t.LONG_UNROLL?this.lon1+M:r.AngNormalize(r.AngNormalize(this.lon1)+r.AngNormalize(M))),o&t.LATITUDE&&(s.lat2=r.atan2d(B,this._f1*R)),o&t.AZIMUTH&&(s.azi2=r.atan2d(I,O)),o&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(W=t.SinCosSeries(!0,d,m,this._C2a),k=(1+this._A2m1)*(W-this._B21),T=(this._A1m1-this._A2m1)*a+(h-k),o&t.REDUCEDLENGTH&&(s.m12=this._b*(A*(this._csig1*d)-this._dn1*(this._ssig1*m)-this._csig1*m*T)),o&t.GEODESICSCALE&&(C=this._k2*(d-this._ssig1)*(d+this._ssig1)/(this._dn1+A),s.M12=l+(C*d-m*T)*this._ssig1/this._dn1,s.M21=l-(C*this._ssig1-this._csig1*T)*d/A)),o&t.AREA&&(N=t.SinCosSeries(!1,d,m,this._C4a),this._calp0===0||this._salp0===0?(D=I*this.calp1-O*this.salp1,L=O*this.calp1+I*this.salp1):(D=this._calp0*this._salp0*(l<=0?this._csig1*(1-l)+c*this._ssig1:c*(this._csig1*c/(1+l)+this._ssig1)),L=r.sq(this._salp0)+r.sq(this._calp0)*this._csig1*m),s.S12=this._c2*Math.atan2(D,L)+this._A4*(Math.abs(a)<.01?t.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a,a):N-this._B41)),n||(s.a12=a/r.degree),s):(s.a12=NaN,s)},e.GeodesicLine.prototype.Position=function(n,i){return this.GenPosition(!1,n,i)},e.GeodesicLine.prototype.ArcPosition=function(n,i){return this.GenPosition(!0,n,i)},e.GeodesicLine.prototype.GenSetDistance=function(n,i){n?this.SetArc(i):this.SetDistance(i)},e.GeodesicLine.prototype.SetDistance=function(n){var i;this.s13=n,i=this.GenPosition(!1,this.s13,t.ARC),this.a13=0+i.a12},e.GeodesicLine.prototype.SetArc=function(n){var i;this.a13=n,i=this.GenPosition(!0,this.a13,t.DISTANCE),this.s13=0+i.s12}})(er.Geodesic,er.GeodesicLine,er.Math)});function bA(t){if(!Number.isFinite(t))throw new Error("Nonfinite axis, azimuth, distance or arc")}function wA({semiMajorAxis:t,semiMinorAxis:e}){return bA(t),bA(e),new L2.Geodesic(t,(t-e)/t)}var L2,Wf,xA=p(()=>{yA();L2=er.Geodesic;Wf=L2.ALL&~L2.AREA});function MA(t,e,r,n,i,o){let s=SA[e]&&SA[e][r];Bi(s&&(!n||n===s));let a,c,l,u=yV.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=gV*Math.min(1,t.maximumRadius),d=Math.abs(u.x)<=h&&Math.abs(u.y)<=h,m=t.radii;if(m.x===m.y&&m.x>0&&m.z>0&&m.z<=m.x&&(!d||u.z!==0)){let{east:I,up:O}=tu;if(d)I.set(0,1,0),O.set(0,0,Math.sign(u.z));else{let A=Math.max(Math.abs(u.x),Math.abs(u.y));I.set(-u.y/A,u.x/A,0).normalize(),t.geodeticSurfaceNormal(u,O)}if(!E2(I,O,_A)||!T2(_A,u,e,r,n,o))throw new Error("Unsupported local frame");return o}if(d){let I=Math.sign(u.z);a=bV.fromArray(O2[e]),e!=="east"&&e!=="west"&&a.scale(I),c=wV.fromArray(O2[r]),r!=="east"&&r!=="west"&&c.scale(I),l=xV.fromArray(O2[n]),n!=="east"&&n!=="west"&&l.scale(I)}else{let{up:I,east:O,north:A}=tu,W=Math.max(Math.abs(u.x),Math.abs(u.y));O.set(-u.y/W,u.x/W,0).normalize(),t.geodeticSurfaceNormal(u,I),A.copy(I).cross(O);let{down:k,west:T,south:C}=tu;k.copy(I).scale(-1),T.copy(O).scale(-1),C.copy(A).scale(-1),a=tu[e],c=tu[r],l=tu[n]}let g=a.x,y=a.y,b=a.z,w=c.x,_=c.y,S=c.z,M=l.x,v=l.y,B=l.z,R=u.x,E=u.y,j=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]=M,o[9]=v,o[10]=B,o[11]=0,o[12]=R,o[13]=E,o[14]=j,o[15]=1,o}var gV,yV,_A,SA,O2,tu,bV,wV,xV,vA=p(()=>{Fn();Fn();gV=1e-14,yV=new J,_A=v2(),SA={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},O2={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},tu={east:new J,north:new J,up:new J,west:new J,south:new J,down:new J},bV=new J,wV=new J,xV=new J});function B2(t,e,r=new yn){return MA(t,"east","north","up",e,r)}var EA=p(()=>{Fn();vA()});var TA=p(()=>{gA();EA()});var C2,D2,Gs,AA=p(()=>{C2={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},D2={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},Gs={...C2,...D2}});var IA=p(()=>{AA()});var PA=p(()=>{IA()});var RA=p(()=>{});var LA=p(()=>{});function re(t,e,r){if(!Object.prototype.hasOwnProperty.call(t,e))return r;let n=t[e];if(typeof n!="string"||!/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i.test(n))throw new Error(`Invalid numeric PROJ parameter: +${e}`);let i=Number(n);if(!Number.isFinite(i))throw new Error(`Invalid numeric PROJ parameter: +${e}`);return i}function $f(t,e){let r=re(t,e,0);if(Math.abs(r)>=90)throw new Error(`+${e} must be between -90 and 90 degrees`);return r*At}function Yt(t,e=!1){if(e||Math.abs(t)<=Math.PI)return t;let r=2*Math.PI;return((t+Math.PI)%r+r)%r-Math.PI}var At,Wt=p(()=>{At=Math.PI/180});function Ot(t,e){let r=[t[0]*e[0],t[0]*e[1],t[1]*e[0],t[1]*e[1]];return[Math.min(...r),Math.max(...r)]}function Hf([t,e]){let r=[Math.sin(t),Math.sin(e)];for(let[n,i]of[[Math.PI/2,1],[-Math.PI/2,-1]])Math.ceil((t-n)/(2*Math.PI))<=Math.floor((e-n)/(2*Math.PI))&&r.push(i);return[Math.min(...r),Math.max(...r)]}function lt(t,e){let r=n=>Math.max(1,Us(n))*1e-12;if(![...t,...e].every(Number.isFinite))throw new Error("Projection rendering bounds are not finite");return[[t[0]-r(t),e[0]-r(e),0],[t[1]+r(t),e[1]+r(e),0]]}function Br(t,e,r=!1){let n=t[0][0]-e,i=t[1][0]-e;if(r)return[n,i];let o=i-n;if(o>=2*Math.PI-1e-12)return[-Math.PI,Math.PI];let s=Yt(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(t,e,r,n=!1){let i=Br(e,r,n),o=[e[0][1],e[1][1],Math.max(e[0][1],Math.min(e[1][1],0))],s=i.flatMap(a=>o.map(c=>t(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 ru(t,e,r,n=!1,i=0){let o=Br(e,r,n);if(Us(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=[e[0][1],e[1][1],Math.max(e[0][1],Math.min(e[1][1],i))],c=s.flatMap(l=>a.map(u=>t(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 OA(t,e,r,n=!1){let i=Br(e,r,n),o=[i[0],i[1],Math.max(i[0],Math.min(i[1],0))],s=[e[0][1],e[1][1],Math.max(e[0][1],Math.min(e[1][1],0))],a=o.flatMap(c=>s.map(l=>t(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 nu(t,e,r,n,i,o,s=!1){let a=Fe(Br(e,r,s),n),c=pi(o-t(r,e[0][1])[1],o-t(r,e[1][1])[1]);return lt(Ce([i,i],Ot(c,Hf(a))),Ce([o,o],Fe(Ot(c,rp(a)),-1)))}var pi,Ce,Fe,rp,Us,Bt=p(()=>{Wt();pi=(t,e)=>[Math.min(t,e),Math.max(t,e)],Ce=(t,e)=>[t[0]+e[0],t[1]+e[1]],Fe=(t,e)=>pi(t[0]*e,t[1]*e);rp=t=>Hf([t[0]+Math.PI/2,t[1]+Math.PI/2]),Us=t=>Math.max(Math.abs(t[0]),Math.abs(t[1]))});function Q(t,e,r,n){return[[t,e],[r,n]]}function Ci(t){return t>=-180&&t<180?t:((t+180)%360+360)%360-180}function SV(t,e,r,n){if(![t,e,r,n].every(Number.isFinite)||e<-90||n>90||e>n||r-t<-360||r-t>360+1e-10)throw new Error("Invalid geographic coverage");if(r-t>=360-1e-10)return[-180,e,180,n];let i=Ci(r);return[Ci(t),e,i===-180&&r>t?180:i,n]}function N2(t){let e=t[2]-t[0];return e<0?e+360:e}function BA(t){let[e,r,n,i]=t;return e<=n?[t]:[[e,r,180,i],[-180,r,n,i]]}function MV(t,e){let[r,n,i,o]=t,s=Ci(e[0]);return e[1]>=n&&e[1]<=o&&(r<=i?s>=r&&s<=i||s===-180&&i===180:s>=r||s<=i)}function np(t,e){let r=Math.max(t[1],e[1]),n=Math.min(t[3],e[3]);if(r>n)return[];let i=[];for(let s of BA(t))for(let a of BA(e)){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 CA(t,e){let r=Ci(e[0]),n=Math.max(t[1],Math.min(t[3],e[1]));if(!MV(t,[r,n])){let i=Math.abs(Ci(r-t[0])),o=Math.abs(Ci(r-t[2]));r=i<=o?t[0]:t[2]}return[r,n]}function js(t,e=0,r=0){let n=N2(t),i=t[0]*Xo-e,o=i+n*Xo/2,s=Math.round((r-o)/(2*Math.PI))*2*Math.PI;return Q(n===360?r-Math.PI:i+s,t[1]*Xo,n===360?r+Math.PI:i+s+n*Xo,t[3]*Xo)}function kn(t,e=0){return SV((t[0][0]+e)/Xo,t[0][1]/Xo,(t[1][0]+e)/Xo,t[1][1]/Xo)}function DA(t){if(!t.length)throw new Error("CRS coverage does not intersect the rendering target");return[[0,1,2].map(e=>Math.min(...t.map(r=>r[0][e]))),[0,1,2].map(e=>Math.max(...t.map(r=>r[1][e])))]}var Xo,tt=p(()=>{Xo=Math.PI/180});function NA(t,e){if(e)try{let n=t(e);return F2(n)}catch{}let r=t();return F2(r)}function F2(t){var r;let e=t.bounds;if(e.some(n=>n.some(i=>!Number.isFinite(i))))throw new Error("Projection rendering bounds must be finite");return{bounds:e,normalize:(r=t.normalize)==null?void 0:r.bind(t)}}function zs(t,e=0){return r=>{let n=r.x*Math.PI/180-e,i=r.y*Math.PI/180,o={x:n,y:i,z:r.z};t(o),o.x!==n&&(r.x=(o.x+e)*180/Math.PI),o.y!==i&&(r.y=o.y*180/Math.PI)}}function ip(t,e){let r=[];for(let n of t){let i=e(n);i!==null&&r.push(F2(i))}return r.length?r.length===1?r[0]:{bounds:DA(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 yc=p(()=>{tt()});function op(t,e,r=0,n=!1){let i=N2(e),o=i===360?r-180:e[0]+Math.round((r-e[0]-i/2)/360)*360,s=o+i;if(n){t.x=Math.max(o,Math.min(s,t.x)),t.y=Math.max(e[1],Math.min(e[3],t.y));return}let a=CA(e,[t.x,t.y]),c=a[0];a[0]===Ci(t.x)&&t.x>=o&&t.x<=s?c=t.x:(c<o||c>s)&&(c+=Math.round(((o+s)/2-c)/360)*360);let l=c-r;t.x=Math.abs(l)<=180?c:r+Ci(l),t.y=a[1]}function ur(t,e,r=0,n=0,i=!1){let o=(r+n)*180/Math.PI;return{get bounds(){return t(js(e,n,r))},normalize(s){op(s,e,o,i)}}}function vV(t,e,r,n,i){let o=ip(e,s=>ur(t,s,r,n,i));if(!o)throw new Error("CRS coverage does not intersect the rendering target");return o}function De(t,e,r,n=0,i=!1){let o=(e[0][0]+e[1][0])/2,s=kn(e,n),a=(o+n)*180/Math.PI;return{...t,longitudeOrigin:o,getRenderingProfile(c){if(!c)return{bounds:r(e),normalize(l){op(l,s,a,i)}};try{let l=ur(r,c,o,n,i);return{bounds:l.bounds,normalize:l.normalize}}catch{return vV(r,np(c,s),o,n,i)}}}}var ut=p(()=>{tt();yc()});function FA(){return{x:0,y:0,z:0}}var qs,sp=p(()=>{qs=class{constructor(){this.point=FA(),this.points=[this.point],this.active=0}get depth(){return this.active}acquire(){var e;let r=this.active++;return(e=this.points)[r]||(e[r]=FA()),this.points[r]}release(e){this.active>0&&this.points[this.active-1]===e&&this.active--}}});function gi(t,e){let r=new qs,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,t)},inverse(i,o){return n(i,o,e)},forwardInPlace:t,inverseInPlace:e}}function Yo(t,e,r=!1){let n=e?t.inverseInPlace:t.forwardInPlace;if(n)return n.bind(t);if(r){let o=e?t.inverse3D:t.forward3D;return s=>{let a=o.call(t,[s.x,s.y,s.z]);s.x=a[0],s.y=a[1],s.z=a[2]}}let i=e?t.inverse:t.forward;return o=>{let s=i.call(t,o.x,o.y);o.x=s[0],o.y=s[1]}}var bc=p(()=>{sp()});function Vs(t,e,r=0){let n=re(t,e,r);if(e!=="lon_0"&&Math.abs(n)>90)throw new Error("Latitude parameter must be between -90 and 90 degrees: +"+e);return n*At}function Di(t,e){let r=Object.prototype.hasOwnProperty.call(t,e);if(r&&t[e]!==void 0)throw new Error("Expected a flag without a value: +"+e);return r}function xr({semiMajorAxis:t,eccentricitySquared:e,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:t,b:t*Math.sqrt(1-e),es:e,e:Math.sqrt(e),ep2:e/(1-e),sphere:e===0,over:Di(r,"over"),long0:Vs(r,"lon_0"),lat0:Vs(r,"lat_0"),lat1:Vs(r,"lat_1"),lat2:Vs(r,"lat_2",re(r,"lat_1",0)),lat_ts:Vs(r,"lat_ts",NaN),x0:re(r,"x_0",0),y0:re(r,"y_0",0),k0:i}}function iu(t,e){if(!Object.prototype.hasOwnProperty.call(e,"lat_1"))throw new Error("Conic projections require +lat_1");if(Math.abs(t.lat1+t.lat2)<1e-10||Math.abs(t.lat1)>=Math.PI/2||Math.abs(t.lat2)>=Math.PI/2)throw new Error("Conic standard parallels must not be opposite or at a pole")}function fr(t,e,r,n,i=gi){let o=(s,a)=>{let c=s(e,a);if(!c||typeof c!="object"||!Number.isFinite(c.x)||!Number.isFinite(c.y))throw new Error(t+": 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 Ws(t,e){let r=Yo(e,!1);return gi(n=>{let i=n.x,o=n.y,s=Math.atan2(Math.sin(i-t.long0),Math.cos(i-t.long0)),a=Math.abs(Math.abs(t.lat0)-Math.PI/2)<1e-10;if(Math.abs(o+t.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)},Yo(e,!0))}var Er,Zo,Gn=p(()=>{bc();Wt();Er=["lon_0","lat_0","x_0","y_0"],Zo=["k","k_0"]});function Ni(t,e){return{...gi(t,e),createForwardFlat(r){return this.forwardInPlace===t?kA(t,!1,r):void 0},createInverseFlat(r){return this.inverseInPlace===e?kA(e,!0,r):void 0}}}function kA(t,e,{inputScale:r,outputScale:n}){let i=new qs;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),e&&t(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,e||t(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 ou=p(()=>{bc();sp()});function wc(t){var e=Math.exp(t);return e=(e-1/e)/2,e}var ap=p(()=>{});function tr(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),n=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}var xc=p(()=>{});function GA(t){var e=1+t,r=e-1;return r===0?t:t*Math.log(e)/r}var UA=p(()=>{});function jA(t){var e=Math.abs(t);return e=GA(e*(1+e/(tr(1,e)+1))),t<0?-e:e}var zA=p(()=>{xc();UA()});function cp(t,e){for(var r=2*Math.cos(2*e),n=t.length-1,i=t[n],o=0,s;--n>=0;)s=-o+r*i+t[n],o=i,i=s;return e+s*Math.sin(2*e)}var qA=p(()=>{});function VA(t,e){for(var r=2*Math.cos(e),n=t.length-1,i=t[n],o=0,s;--n>=0;)s=-o+r*i+t[n],o=i,i=s;return Math.sin(e)*s}var WA=p(()=>{});function Kf(t){var e=Math.exp(t);return e=(e+1/e)/2,e}var k2=p(()=>{});function G2(t,e,r,n){for(var i=Math.sin(e),o=Math.cos(e),s=wc(r),a=Kf(r),c=2*o*a,l=-2*i*s,u=t.length-1,h=t[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+t[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 $A=p(()=>{ap();k2()});var F,rt,$s,HA,U2,j2,Xf,Ct=p(()=>{F=Math.PI/2,rt=Math.PI/4,$s=Math.PI*2,HA=3.14159265359,U2=Math.PI/180,j2=180/Math.PI,Xf=Math.PI/(180*3600)});function Hs(t){return t<0?-1:1}var Yf=p(()=>{});function G(t,e){return e||Math.abs(t)<=HA?t:t-Hs(t)*$s}var _t=p(()=>{Ct();Yf()});function EV(t){t.x0=t.x0!==void 0?t.x0:0,t.y0=t.y0!==void 0?t.y0:0,t.long0=t.long0!==void 0?t.long0:0,t.lat0=t.lat0!==void 0?t.lat0:0,t.k0=t.k0!==void 0?t.k0:1,t.cgb=[],t.cbg=[],t.utg=[],t.gtu=[];var e=t.es/(1+Math.sqrt(1-t.es)),r=e/(2-e),n=r;t.cgb[0]=r*(2+r*(-2/3+r*(-2+r*(116/45+r*(26/45+r*(-2854/675)))))),t.cbg[0]=r*(-2+r*(2/3+r*(4/3+r*(-82/45+r*(32/45+r*(4642/4725)))))),n=n*r,t.cgb[1]=n*(7/3+r*(-8/5+r*(-227/45+r*(2704/315+r*(2323/945))))),t.cbg[1]=n*(5/3+r*(-16/15+r*(-13/9+r*(904/315+r*(-1522/945))))),n=n*r,t.cgb[2]=n*(56/15+r*(-136/35+r*(-1262/105+r*(73814/2835)))),t.cbg[2]=n*(-26/15+r*(34/21+r*(8/5+r*(-12686/2835)))),n=n*r,t.cgb[3]=n*(4279/630+r*(-332/35+r*(-399572/14175))),t.cbg[3]=n*(1237/630+r*(-12/5+r*(-24832/14175))),n=n*r,t.cgb[4]=n*(4174/315+r*(-144838/6237)),t.cbg[4]=n*(-734/315+r*(109598/31185)),n=n*r,t.cgb[5]=n*(601676/22275),t.cbg[5]=n*(444337/155925),n=Math.pow(r,2),t.Qn=t.k0/(1+r)*(1+n*(1/4+n*(1/64+n/256))),t.utg[0]=r*(-.5+r*(2/3+r*(-37/96+r*(1/360+r*(81/512+r*(-96199/604800)))))),t.gtu[0]=r*(.5+r*(-2/3+r*(5/16+r*(41/180+r*(-127/288+r*(7891/37800)))))),t.utg[1]=n*(-1/48+r*(-1/15+r*(437/1440+r*(-46/105+r*(1118711/3870720))))),t.gtu[1]=n*(13/48+r*(-3/5+r*(557/1440+r*(281/630+r*(-1983433/1935360))))),n=n*r,t.utg[2]=n*(-17/480+r*(37/840+r*(209/4480+r*(-5569/90720)))),t.gtu[2]=n*(61/240+r*(-103/140+r*(15061/26880+r*(167603/181440)))),n=n*r,t.utg[3]=n*(-4397/161280+r*(11/504+r*(830251/7257600))),t.gtu[3]=n*(49561/161280+r*(-179/168+r*(6601661/7257600))),n=n*r,t.utg[4]=n*(-4583/161280+r*(108847/3991680)),t.gtu[4]=n*(34729/80640+r*(-3418889/1995840)),n=n*r,t.utg[5]=n*(-20648693/638668800),t.gtu[5]=n*(212378941/319334400);var i=cp(t.cbg,t.lat0);t.Zb=-t.Qn*(i+VA(t.gtu,2*i))}function KA(t,e){var r=G(e.x-t.long0,t.over),n=e.y;n=cp(t.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=jA(Math.tan(r)),G2(t.gtu,2*n,2*r,e),n=n+e.x,r=r+e.y;var c,l;return Math.abs(r)<=2.623395162778?(c=t.a*(t.Qn*r)+t.x0,l=t.a*(t.Qn*n+t.Zb)+t.y0):(c=1/0,l=1/0),e.x=c,e.y=l,e}function XA(t,e){var r=(e.x-t.x0)*(1/t.a),n=(e.y-t.y0)*(1/t.a);n=(n-t.Zb)/t.Qn,r=r/t.Qn;var i,o;if(Math.abs(r)<=2.623395162778){G2(t.utg,2*n,2*r,e),n=n+e.x,r=r+e.y,r=Math.atan(wc(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=G(r+t.long0,t.over),o=cp(t.cgb,n)}else i=1/0,o=1/0;return e.x=i,e.y=o,e}function YA(t){let e={...t,cgb:[],cbg:[],utg:[],gtu:[],Qn:0,Zb:0};return EV(e),e}var ZA=p(()=>{ap();xc();zA();qA();WA();$A();_t()});function mo(t){var e=[];e[0]=TV-t*(AV+t*(JA+t*(QA+t*e8))),e[1]=t*(IV-t*(JA+t*(QA+t*e8)));var r=t*t;return e[2]=r*(PV-t*(RV+t*LV)),r*=t,e[3]=r*(OV-t*BV),e[4]=r*t*CV,e}var TV,AV,JA,QA,e8,IV,PV,RV,LV,OV,BV,CV,su=p(()=>{TV=1,AV=.25,JA=.046875,QA=.01953125,e8=.01068115234375,IV=.75,PV=.46875,RV=.013020833333333334,LV=.007120768229166667,OV=.3645833333333333,BV=.005696614583333333,CV=.3076171875});function _r(t,e,r,n){return r*=e,e*=e,n[0]*t-r*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var _c=p(()=>{});function po(t,e,r){for(var n=1/(1-e),i=t,o=DV;o;--o){var s=Math.sin(i),a=1-e*s*s;if(a=(_r(i,s,Math.cos(i),r)-t)*(a*Math.sqrt(a))*n,i-=a,Math.abs(a)<1e-10)return i}return i}var DV,au=p(()=>{_c();DV=20});function NV(t){t.x0=t.x0!==void 0?t.x0:0,t.y0=t.y0!==void 0?t.y0:0,t.long0=t.long0!==void 0?t.long0:0,t.lat0=t.lat0!==void 0?t.lat0:0,t.es&&(t.en=mo(t.es),t.ml0=_r(t.lat0,Math.sin(t.lat0),Math.cos(t.lat0),t.en))}function t8(t,e){var r=e.x,n=e.y,i=G(r-t.long0,t.over),o,s,a,c=Math.sin(n),l=Math.cos(n);if(t.es){var h=l*i,d=Math.pow(h,2),m=t.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-t.es*Math.pow(c,2),h=h/Math.sqrt(o);var _=_r(n,c,l,t.en);s=t.a*(t.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)))))+t.x0,a=t.a*(t.k0*(_-t.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))))))+t.y0}else{var u=l*Math.sin(i);if(Math.abs(Math.abs(u)-1)<1e-10)return 93;if(s=.5*t.a*t.k0*Math.log((1+u)/(1-u))+t.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=t.a*t.k0*(a-t.lat0)+t.y0}return e.x=s,e.y=a,e}function r8(t,e){var r,n,i,o,s=(e.x-t.x0)*(1/t.a),a=(e.y-t.y0)*(1/t.a);if(t.es)if(r=t.ml0+a/t.k0,n=po(r,t.es,t.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=t.ep2*Math.pow(m,2),b=Math.pow(y,2),w=Math.pow(g,2),_=Math.pow(w,2);r=1-t.es*Math.pow(d,2);var S=s*Math.sqrt(r)/t.k0,M=Math.pow(S,2);r=r*g,i=n-r*M/(1-t.es)*.5*(1-M/12*(5+3*w-9*y*w+y-4*b-M/30*(61+90*w-252*y*w+45*_+46*y-M/56*(1385+3633*w+4095*_+1574*_*w)))),o=G(t.long0+S*(1-M/6*(1+2*w+y-M/20*(5+28*w+24*_+8*y*w+6*y-M/42*(61+662*w+1320*_+720*_*w))))/m,t.over)}else i=F*Hs(a),o=0;else{var c=Math.exp(s/t.k0),l=.5*(c-1/c),u=t.lat0+a/t.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=G(Math.atan2(l,h)+t.long0,t.over)}return e.x=o,e.y=i,e}function n8(t){let e={...t,en:[],ml0:0};return NV(e),e}var i8=p(()=>{su();_c();au();_t();Ct();Yf()});function lp(t){let e=xr(t),r=n=>De(n,Q(e.long0-Math.PI/6,-Math.PI/2,e.long0+Math.PI/6,Math.PI/2),i=>ru(n.forward,i,e.long0,e.over),e.primeMeridian,e.over);if(Di(t.parameters,"approx"))return r({...fr("tmerc +approx",n8(e),t8,r8,Ni)});if(e.sphere)throw new Error("Spherical transverse Mercator requires +approx");return r({...fr("etmerc",YA(e),KA,XA,Ni)})}var z2,q2,V2=p(()=>{ou();Bt();tt();ut();Gn();ZA();i8();z2={name:"tmerc",aliases:["Fast_Transverse_Mercator","Fast Transverse Mercator","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger"],parameters:[...Er,...Zo,"approx"],flags:["approx"],create:lp},q2={name:"etmerc",aliases:["Extended_Transverse_Mercator","Extended Transverse Mercator"],parameters:[...Er,...Zo,"approx"],flags:["approx"],create:lp}});var W2,o8=p(()=>{Bt();tt();ut();Wt();Gn();V2();W2={name:"utm",aliases:["Universal Transverse Mercator System"],parameters:["zone","south","approx"],flags:["south","approx"],create(t){let e=re(t.parameters,"zone",NaN);if(!Number.isInteger(e)||e<1||e>60)throw new Error("UTM requires an integer +zone from 1 to 60");let r=Di(t.parameters,"south"),n=lp({...t,parameters:{...t.parameters,lat_0:"0",lon_0:String(6*e-183),x_0:"500000",y_0:r?"10000000":"0",k_0:"0.9996"}}),i=(6*e-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=>ru(n.forward,o,i),t.primeMeridian??0,Object.prototype.hasOwnProperty.call(t.parameters,"over"))}}});function H2(t,e){return[Math.cos(e)*Math.cos(t),Math.cos(e)*Math.sin(t),Math.sin(e)]}function up(t,e,r,n,i){let o=Math.hypot(t,e);if(!o||Math.abs(r)>o+1e-14)return[];let s=Math.atan2(e,t),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 Ks(t,e,r,n=!0){let[[i,o],[s,a]]=e,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+Yt(y-c),y<i-1e-12||y>s+1e-12||b<o-1e-12||b>a+1e-12)return;let w=H2(y,b);if(r&&$2(l,w)<u-1e-13)return;let _=$2(t,w);(n?_>h:_<h)&&(h=_,d=[y,b])},g=[i,s,...up(-t[1],t[0],0,i,s)];for(let y of g){let b=t[0]*Math.cos(y)+t[1]*Math.sin(y);for(let w of[o,a,...up(t[2],-b,0,o,a)])m(y,w)}if(r){let[y,,b]=l;for(let M of[o,a])for(let v of up(y*Math.cos(M),0,u-b*Math.sin(M),i,s))m(v,M);for(let M of[i,s])for(let v of up(y*Math.cos(M),b,u,o,a))m(M,v);let w=$2(t,l),_=t.map((M,v)=>M-w*l[v]),S=Math.hypot(..._);if(S<=1e-14&&(_=[-l[2],0,l[0]],S=1),S>1e-14)for(let M of[-1,1]){let v=l.map((B,R)=>B*u+M*_[R]*Math.sin(r.distance)/S);m(Math.atan2(v[1],v[0]),Math.atan2(v[2],Math.hypot(v[0],v[1])))}}if(!Number.isFinite(h))throw new Error("CRS coverage does not intersect the rendering domain");return{value:h,point:d}}function dt(t,e,r){return[Ks(t,e,r,!1).value,Ks(t,e,r).value]}function Xs(t,e,r,n,i){let o=dt(t,n,i),s=dt(e,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=t.map((y,b)=>y-d*e[b]);Ks(m,n,i,c).value-d*r>0?l=d:u=d}return c?u:l})}var $2,Sc=p(()=>{Wt();$2=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2]});function FV(t,e,r,n=Math.PI){let i=[-180,-90,180,90],o=(s,a)=>{let c=js(s,t.primeMeridian,t.long0),l=Q(c[0][0]-t.long0,c[0][1],c[1][0]-t.long0,c[1][1]),u=[Math.cos(t.lat0),0,Math.sin(t.lat0)],h=a?Ks(u,l,void 0,!1).value:-1,m=!a||h<=Math.cos(n)+1e-13?{latitude:t.lat0,distance:e}:void 0,g=ur(()=>r(l,m),s,t.long0,t.primeMeridian),y=Math.abs(Math.cos(t.lat0))<1e-12,b=(Math.PI/2-e)*180/Math.PI,w=m&&!y&&zs(_=>{let S=H2(_.x-t.long0,_.y);if(S[0]*Math.cos(t.lat0)+S[2]*Math.sin(t.lat0)>=Math.cos(m.distance)-1e-14)return;if(Math.hypot(S[0]+u[0],S[1],S[2]+u[2])<1e-12){let v=t.lat0+m.distance,B=(l[0][0]+l[1][0])/2,R=B+Yt((Math.cos(v)<0?Math.PI:0)-B),E=Math.atan2(Math.sin(v),Math.abs(Math.cos(v)));if(R>=l[0][0]&&R<=l[1][0]&&E>=l[0][1]&&E<=l[1][1]){_.x=R+t.long0,_.y=E;return}}let M=Ks(S,l,m);[_.x,_.y]=[M.point[0]+t.long0,M.point[1]]},t.primeMeridian);return{get bounds(){return r(l,m)},normalize(_){g.normalize(_),m&&y?_.y=t.lat0>0?Math.max(b,_.y):Math.min(-b,_.y):w==null||w(_);let S=(t.long0+t.primeMeridian)*180/Math.PI,M=_.x-S;Math.abs(M)>180&&(_.x=S+Ci(M))}}};return s=>o(s??i,!!s)}function wn(t,e,r,n,i=Math.PI){return{...t,longitudeOrigin:e.long0,getRenderingProfile:FV(e,r,n,i)}}var Ys=p(()=>{tt();ut();Sc();Wt();yc()});function fp(t,e,r,n){let i=[-Math.sin(t.lat0),0,Math.cos(t.lat0)],o=[Math.cos(t.lat0),0,Math.sin(t.lat0)],s=[0,1,0],a=n==="stere"?1:0,c=u=>n==="ortho"?dt(u,e,r):Xs(u,o,a,e,r),l=t.a*(n==="stere"?2*t.k0:1);return lt(Ce([t.x0,t.x0],Fe(c(s),l)),Ce([t.y0,t.y0],Fe(c(i),l)))}function s8(t,e,r){let n=Math.sin(t.lat0),i=Math.cos(t.lat0),o=dt([0,0,1],e,r);if(Math.abs(n)<1e-15&&(!r||Math.abs(r.distance-Math.PI/2)<1e-15)){let h=m=>{let g=Ks([0,1,0],e,r,m);return g.value/Math.sqrt(1-t.es*Math.sin(g.point[1])**2)},d=m=>(1-t.es)*m/Math.sqrt(1-t.es*m*m);return lt(Ce([t.x0,t.x0],Fe([h(!1),h(!0)],t.a*t.k0)),Ce([t.y0,t.y0],Fe([d(o[0]),d(o[1])],t.a*t.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=pi(1/Math.sqrt(1-t.es*s),1/Math.sqrt(1-t.es*a)),l=t.a*t.k0,u=t.es*n*i/Math.sqrt(1-t.es*n*n);return lt(Ce([t.x0,t.x0],Fe(Ot(dt([0,1,0],e,r),c),l)),Ce([t.y0+l*u,t.y0+l*u],Fe(Ot(dt([-n,0,(1-t.es)*i],e,r),c),l)))}function a8(t,e,r){let n=dt([Math.cos(t.lat0),0,Math.sin(t.lat0)],e,r)[0],i=t.a/Math.sqrt(1-t.es)*Math.acos(Math.max(-1,Math.min(1,n)));return lt([t.x0-i,t.x0+i],[t.y0-i,t.y0+i])}function c8(t,e,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-t.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)],t.a*b)};return lt(Ce([t.x0,t.x0],g([0,1,0],e)),Ce([t.y0,t.y0],g(h,r)))}function hp(t,e,r,n,i,o,s=1,a=t.e*Math.atanh(t.e)){let c=Q(i[0][0]*s,e(i[0][1]),i[1][0]*s,e(i[1][1])),l=2*a+Math.PI*Math.abs(s-1),u=o&&s===1?Math.min(o.distance+l,Math.PI-(1-t.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=Xs([0,1,0],d,1,y,h),w=Xs(m,d,1,y,h);return lt(Ce([t.x0,t.x0],Fe(b,n)),Ce([t.y0,t.y0],Fe(w,n)))}function l8(t,e,r,n,i,o){let s=[Math.cos(t.lat0),0,Math.sin(t.lat0)],a=[-Math.sin(t.lat0),0,Math.cos(t.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=Xs(g,y,h*e,i,o),w=Xs(m,y,h*e,i,o);return lt(Ce([t.x0,t.x0],Fe(b,t.a*(e-1)*h)),Ce([t.y0,t.y0],Fe(w,t.a*(e-1))))}function u8(t,e,r){let n=dt([Math.cos(t.lat0),0,Math.sin(t.lat0)],e,r)[0],i=Math.acos(Math.max(-1,Math.min(1,n))),o=1-t.es,s=t.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([t.x0-c,t.x0+c],[t.y0-c,t.y0+c])}var Zs=p(()=>{tt();Sc();Bt()});function Fi(t,e,r,n,i,o,s){let a=i*r/s,c=n*e-o*r*t/s,l=n*t+o*r*e/s;return Math.atan2(l,Math.hypot(a,c))}var Zf=p(()=>{});function xn(t,e,r){var n=t*e;return r/Math.sqrt(1-n*n)}var cu=p(()=>{});function Qr(t,e,r){let n=Math.cos(e);return Math.exp(t*Math.atanh(t*r))*(r>0?n/(1+r):(1-r)/n)}var Jf=p(()=>{});function Mc(t,e){for(var r=.5*t,n,i,o=F-2*Math.atan(e),s=0;s<=15;s++)if(n=t*Math.sin(o),i=F-2*Math.atan(e*Math.pow((1-n)/(1+n),r))-o,o+=i,Math.abs(i)<=1e-10)return o;return-9999}var dp=p(()=>{Ct()});function f8(t,e,r){return e*=r,Math.tan(.5*(F+t))*Math.pow((1-e)/(1+e),.5*r)}function kV(t){t.x0=t.x0||0,t.y0=t.y0||0,t.lat0=t.lat0||0,t.long0=t.long0||0,t.coslat0=Math.cos(t.lat0),t.sinlat0=Math.sin(t.lat0),t.sphere?!Number.isNaN(t.lat_ts)&&Math.abs(t.coslat0)<=1e-10&&(t.k0=.5*(1+Hs(t.lat0)*Math.sin(t.lat_ts))):(Math.abs(t.coslat0)<=1e-10&&(t.lat0>0?t.con=1:t.con=-1),t.cons=Math.sqrt(Math.pow(1+t.e,1+t.e)*Math.pow(1-t.e,1-t.e)),!Number.isNaN(t.lat_ts)&&Math.abs(t.coslat0)<=1e-10&&Math.abs(Math.cos(t.lat_ts))>1e-10&&(t.k0=.5*t.cons*xn(t.e,Math.sin(t.lat_ts),Math.cos(t.lat_ts))/Qr(t.e,t.con*t.lat_ts,t.con*Math.sin(t.lat_ts))),t.ms1=xn(t.e,t.sinlat0,t.coslat0),t.X0=2*Math.atan(f8(t.lat0,t.sinlat0,t.e))-F,t.cosX0=Math.cos(t.X0),t.sinX0=Math.sin(t.X0))}function h8(t,e){var r=e.x,n=e.y,i=Math.sin(n),o=Math.cos(n),s,a,c,l,u,h,d=G(r-t.long0,t.over);if(Math.abs(Math.abs(r-t.long0)-Math.PI)<=1e-10&&Math.abs(n+t.lat0)<=1e-10)return e.x=NaN,e.y=NaN,e;if(t.sphere&&Math.abs(t.coslat0)<=1e-10){let m=t.lat0>0?1:-1,g=2*t.a*t.k0*Math.tan(Math.PI/4-m*n/2);return e.x=t.x0+g*Math.sin(d),e.y=t.y0-m*g*Math.cos(d),e}return t.sphere?(s=2*t.k0/(1+t.sinlat0*i+t.coslat0*o*Math.cos(d)),e.x=t.a*s*o*Math.sin(d)+t.x0,e.y=t.a*s*(t.coslat0*i-t.sinlat0*o*Math.cos(d))+t.y0,e):(a=2*Math.atan(f8(n,i,t.e))-F,l=Math.cos(a),c=Math.sin(a),Math.abs(t.coslat0)<=1e-10?(u=Qr(t.e,n*t.con,t.con*i),h=2*t.a*t.k0*u/t.cons,e.x=t.x0+h*Math.sin(r-t.long0),e.y=t.y0-t.con*h*Math.cos(r-t.long0),e):(Math.abs(t.sinlat0)<1e-10?(s=2*t.a*t.k0/(1+l*Math.cos(d)),e.y=s*c+t.y0):(s=2*t.a*t.k0*t.ms1/(t.cosX0*(1+t.sinX0*c+t.cosX0*l*Math.cos(d))),e.y=s*(t.cosX0*c-t.sinX0*l*Math.cos(d))+t.y0),e.x=s*l*Math.sin(d)+t.x0,e))}function d8(t,e){e.x-=t.x0,e.y-=t.y0;var r,n,i,o,s,a=Math.sqrt(e.x*e.x+e.y*e.y);if(t.sphere){var c=2*Math.atan(a/(2*t.a*t.k0));return r=t.long0,n=t.lat0,a<=1e-10?(e.x=r,e.y=n,e):(n=Fi(t.sinlat0,t.coslat0,Math.sin(c),Math.cos(c),e.x,e.y,a),Math.abs(t.coslat0)<1e-10?t.lat0>0?r=G(t.long0+Math.atan2(e.x,-1*e.y),t.over):r=G(t.long0+Math.atan2(e.x,e.y),t.over):r=G(t.long0+Math.atan2(e.x*Math.sin(c),a*t.coslat0*Math.cos(c)-e.y*t.sinlat0*Math.sin(c)),t.over),e.x=r,e.y=n,e)}else if(Math.abs(t.coslat0)<=1e-10){if(a<=1e-10)return n=t.lat0,r=t.long0,e.x=r,e.y=n,e;e.x*=t.con,e.y*=t.con,i=a*t.cons/(2*t.a*t.k0),n=t.con*Mc(t.e,i),r=t.con*G(t.con*t.long0+Math.atan2(e.x,-1*e.y),t.over)}else o=2*Math.atan(a*t.cosX0/(2*t.a*t.k0*t.ms1)),r=t.long0,a<=1e-10?s=t.X0:(s=Fi(t.sinX0,t.cosX0,Math.sin(o),Math.cos(o),e.x,e.y,a),r=G(t.long0+Math.atan2(e.x*Math.sin(o),a*t.cosX0*Math.cos(o)-e.y*t.sinX0*Math.sin(o)),t.over)),n=-1*Mc(t.e,Math.tan(.5*(F+s)));return e.x=r,e.y=n,e}function m8(t){let e={...t,coslat0:0,sinlat0:0,con:0,cons:0,ms1:0,X0:0,cosX0:0,sinX0:0};return kV(e),e}var p8=p(()=>{Zf();Ct();Yf();cu();Jf();dp();_t()});var K2,g8=p(()=>{Ys();Zs();Gn();p8();K2={name:"stere",aliases:["Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],parameters:[...Er,...Zo,"lat_ts"],create(t){let e=xr(t),r=m8(e),n=Ws(e,fr("stere",r,h8,d8));return wn(n,e,150*Math.PI/180,(i,o)=>r.sphere?fp(r,i,o,"stere"):hp(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 Qf=p(()=>{TA();RA();LA()});var yi=p(()=>{"use strict";UE();jE();qE();Ay();VE();Ry();Ry();TT()});function y8(t){return!zV(t,"ftyp",4)||(t[8]&96)===0?null:GV(t)}function GV(t){switch(UV(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function UV(t,e,r){return String.fromCharCode(...t.slice(e,r))}function jV(t){return[...t].map(e=>e.charCodeAt(0))}function zV(t,e,r=0){let n=jV(e);for(let i=0;i<n.length;++i)if(n[i]!==t[i+r])return!1;return!0}var b8=p(()=>{"use strict"});function mp(t){let e=th(t);return VV(e)||HV(e)||WV(e)||$V(e)||qV(e)}function qV(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=y8(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function VV(t){let e=th(t);return e.byteLength>=33&&e.getUint32(0,Un)===2303741511&&e.getUint32(4,Un)===218765834&&e.getUint32(8,Un)===13&&e.getUint32(12,Un)===1229472850?{mimeType:"image/png",width:e.getUint32(16,Un),height:e.getUint32(20,Un)}:null}function WV(t){let e=th(t);return e.byteLength>=10&&e.getUint32(0,Un)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,eh),height:e.getUint16(8,eh)}:null}function $V(t){let e=th(t);return e.byteLength>=14&&e.getUint16(0,Un)===16973&&e.getUint32(2,eh)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,eh),height:e.getUint32(22,eh)}:null}function HV(t){let e=th(t);if(!(e.byteLength>=3&&e.getUint16(0,Un)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=KV(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,Un);if(i.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,Un),width:e.getUint16(o+7,Un)};if(!n.has(s))return null;o+=2,o+=e.getUint16(o,Un)}return null}function KV(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function th(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}var Un,eh,X2=p(()=>{"use strict";b8();Un=!1,eh=!0});var XV,YV,ZV,w8,x8=p(()=>{"use strict";X2();XV=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],YV=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],ZV={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:YV,extensions:XV,tests:[t=>!!mp(new DataView(t))]},w8={...ZV,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var lu,pp=p(()=>{"use strict";lu="5.0.0-beta.10"});function uu(t){if(!t)return!1;if(JV.test(t))return!0;for(let e=t.indexOf(".svg");e>=0;e=t.indexOf(".svg",e+4)){let r=t[e+4];if(r===void 0||r==="?"||r==="#")return!0}return!1}function _8(t,e){if(uu(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Y2(t,e)}function Y2(t,e){if(uu(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}var JV,gp=p(()=>{"use strict";JV=/^data:image\/svg\+xml/});async function S8(t,e){let r=_8(t,e),n=self.URL||self.webkitURL,i=typeof r!="string"&&n.createObjectURL(r);try{return await QV(i||r)}finally{i&&n.revokeObjectURL(i)}}async function QV(t){let e=new Image;return e.src=t,await new Promise((r,n)=>{try{e.onload=()=>r(e),e.onerror=i=>{let o=i instanceof Error?i.message:"error";n(new Error(o))}}catch(i){n(i)}})}var M8=p(()=>{"use strict";gp()});async function E8(t,e,r){let n;uu(r)?n=await S8(t,r):n=Y2(t,r);let i=e&&e.imagebitmap;return await A8(n,i,Li(e))}async function T8(t,e){let r=e&&e.imagebitmap;return await A8(t,r,Li(e))}async function A8(t,e=null,r=Li()){if((eW(e)||!v8)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(n){r.warn(String(n))(),v8=!1}return await createImageBitmap(t)}function eW(t){if(!t)return!0;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}var v8,I8=p(()=>{"use strict";yi();gp();M8();v8=!0});async function P8(t,e){var s,a;let{mimeType:r}=mp(t)||{},n=(s=globalThis.loaders)==null?void 0:s.parseImageNode;jl(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(t,r);return i(o)}var R8=p(()=>{"use strict";yi();X2()});async function Z2(t,e,r){var i;e=e||{},B8(e);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!Mm||n)return await P8(t,e);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(L8);return await E8(t,e,r==null?void 0:r.url)}async function O8(t,e,r){var i;e=e||{},B8(e);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!Mm||n||uu(r==null?void 0:r.url)||t.type.startsWith("image/svg+xml"))return await Z2(await t.arrayBuffer(),e,r);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(L8);return await T8(t,e)}function B8(t){var r;let e=(r=t.image)==null?void 0:r.type;if(e&&e!=="imagebitmap")throw new Error(tW)}var tW,L8,C8=p(()=>{"use strict";yi();I8();gp();R8();tW="@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.",L8="@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 D8={};Qt(D8,{ImageLoaderWithParser:()=>nW});var Fce,rW,nW,N8=p(()=>{"use strict";C8();J2();({preload:Fce,...rW}=Jo),nW={...rW,parse:Z2,parseBlob:O8}});async function oW(){let{ImageLoaderWithParser:t}=await Promise.resolve().then(()=>(N8(),D8));return t}var iW,Jo,J2=p(()=>{"use strict";pp();x8();iW={image:{}};Jo={dataType:null,batchType:null,...w8,version:lu,options:iW,preload:oW}});function k8(t){let e=lW(t);if(!e)throw new Error("Not an image");return e}function yp(t){switch(k8(t)){case"data":return t;case"imagebitmap":return sW(t)?aW(t):F8(t);case"image":return F8(t);default:throw new Error("getImageData")}}function sW(t){var r;let e=(r=globalThis.loaders)==null?void 0:r.isImageBitmapNode;return!!(e!=null&&e(t))}function aW(t){var r;let e=(r=globalThis.loaders)==null?void 0:r.getImageBitmapDataNode;if(!e)throw new Error("getImageData");return e(t)}function F8(t){let e=cW(t.width,t.height),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height)}function cW(t,e){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(t,e);if(typeof document<"u"){let r=document.createElement("canvas");return r.width=t,r.height=e,r}throw new Error("getImageData")}function lW(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var G8=p(()=>{"use strict"});var U8,j8,Q2=p(()=>{"use strict";U8={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]},j8={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 q8(t){if(!bp){t=t||fW()||void 0,bp=new Set;for(let e of uW)for(let r in z8)if(t&&t.getExtension(`${e}${r}`))for(let n of z8[r])bp.add(n)}return bp}function fW(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var uW,z8,bp,V8=p(()=>{"use strict";uW=["","WEBKIT_","MOZ_"],z8={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"]},bp=null});function $8(t=q8(),e,r={}){let n=new Set(t);if(!e)return dW(n);if(e.isHDR){let i=W8(e);return r.astcHDR&&(i==="astc-4x4"||i==="astc-6x6")&&wp(n,i.slice(5))?i==="astc-4x4"?"astc-hdr-4x4":"astc-hdr-6x6":n.has("bc6h-rgb-ufloat")?"bc6h":"rgba16f"}if(e.codec==="xubc7")return tb(n)?"bc7":"rgba32";if(e.codec.startsWith("xuastc-ldr-")||e.codec.startsWith("astc-ldr-")){let i=W8(e);return i&&wp(n,i.slice(5))?i:eb(n,e,["bc7","bc","etc2","atc"])}return e.codec==="uastc-ldr-4x4"?wp(n,"4x4")?"astc-4x4":eb(n,e,["bc7","bc","etc2","etc1","pvrtc","atc"]):eb(n,e,["etc2","etc1","bc7","bc","pvrtc","atc"])}function dW(t){return wp(t,"4x4")?"astc-4x4":tb(t)?"bc7":H8(t)?{alpha:"bc3",noAlpha:"bc1"}:K8(t)?"etc2":t.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:X8(t)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:Y8(t)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function eb(t,e,r){for(let n of r)switch(n){case"bc7":if(tb(t))return"bc7";break;case"bc":if(H8(t))return e.hasAlpha?"bc3":"bc1";break;case"etc2":if(K8(t))return"etc2";break;case"etc1":if(!e.hasAlpha&&t.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(X8(t))return e.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(Y8(t))return e.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return e.hasAlpha?"rgba32":"rgb565"}function W8(t){let e=`${t.blockWidth}x${t.blockHeight}`;return hW.includes(e)?`astc-${e}`:null}function wp(t,e){return fu(t,[`astc-${e}-unorm`,`astc-${e}-unorm-srgb`])}function tb(t){return fu(t,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function H8(t){return fu(t,["bc1-rgb-unorm-webgl","bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb"])}function K8(t){return fu(t,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function X8(t){return fu(t,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function Y8(t){return fu(t,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function fu(t,e){return e.some(r=>t.has(r))}var hW,Z8=p(()=>{"use strict";V8();hW=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function eI(t){Iy(t.modules);let e=Py("basis");return e||(Q8||=mW(t),await Q8)}async function mW(t){let e=null,r=null;return[e,r]=await Promise.all([await $l(J8.TRANSCODER,"images",t,null,"basis_transcoder.mjs"),await $l(J8.TRANSCODER_WASM,"images",t)]),e=e||globalThis.BASIS,await pW(e,r)}function pW(t,e){let r={};return e&&(r.wasmBinary=e),zl(()=>t(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 J8,Q8,tI=p(()=>{"use strict";yi();dc();J8={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function Sp(t){if(t!==void 0)return AI[t]}function II(t){if(t!==void 0)return BW[t]}var AI,BW,mb=p(()=>{"use strict";AI={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"},BW=Object.fromEntries(Object.entries(AI).map(([t,e])=>[e,Number(t)]))});function hu(t,e){let r=new Array(e.mipMapLevels),n=e.textureFormat||Sp(e.internalFormat),i=e.internalFormat||II(e.textureFormat),o=e.width,s=e.height,a=0;for(let c=0;c<e.mipMapLevels;++c){let l=DW(e,o,s,t,c),h={shape:"texture-level",compressed:!0,data:CW(t,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 CW(t,e,r,n){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+r,n)}function DW(t,e,r,n,i){return Array.isArray(n)?t.sizeFunction(n[i]):t.sizeFunction(e,r)}var Mp=p(()=>{"use strict";mb()});function FW(t){return NW[t]}function PI(t){return Sp(FW(t))}var NW,RI=p(()=>{"use strict";mb();NW={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 Js(t){if(t.byteLength<pb.byteLength)return!1;let e=new Uint8Array(t,0,pb.byteLength);return pb.every((r,n)=>e[n]===r)}function OI(t){let e=wb(t);if(e.pixelDepth>0)throw new Error("CompressedTextureLoader does not support 3D KTX2 textures");if(e.supercompressionScheme!==kW)throw new Error(`KTX2 supercompression scheme ${e.supercompressionScheme} requires BasisLoader`);if(e.vkFormat===0)throw new Error("KTX2 vkFormat is undefined; decode this texture with BasisLoader");let r=PI(e.vkFormat);if(!r)throw new Error(`Unsupported KTX2 Vulkan format ${e.vkFormat}`);return hu(e.levels,{mipMapLevels:e.levelCount,width:e.pixelWidth,height:Math.max(1,e.pixelHeight),sizeFunction:n=>n.uncompressedByteLength,textureFormat:r})}function wb(t){if(!Js(t))throw new Error("Invalid KTX2 identifier");if(t.byteLength<gb)throw new Error("Truncated KTX2 header");let e=new DataView(t),r=Math.max(1,e.getUint32(40,!0)),n=GW(r,LI,"KTX2 level index");bb(gb,n,t.byteLength,"KTX2 level index");let i={vkFormat:e.getUint32(12,!0),pixelWidth:e.getUint32(20,!0),pixelHeight:e.getUint32(24,!0),pixelDepth:e.getUint32(28,!0),layerCount:e.getUint32(32,!0),faceCount:e.getUint32(36,!0),levelCount:r,supercompressionScheme:e.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}`);yb(e.getUint32(48,!0),e.getUint32(52,!0),t.byteLength,"KTX2 data format descriptor"),yb(e.getUint32(56,!0),e.getUint32(60,!0),t.byteLength,"KTX2 key/value data"),yb(rh(e,64,"KTX2 supercompression global data offset"),rh(e,72,"KTX2 supercompression global data length"),t.byteLength,"KTX2 supercompression global data");for(let o=0;o<r;o++){let s=gb+o*LI,a=rh(e,s,`KTX2 level ${o} offset`),c=rh(e,s+8,`KTX2 level ${o} length`),l=rh(e,s+16,`KTX2 level ${o} uncompressed length`);bb(a,c,t.byteLength,`KTX2 level ${o}`),i.levels.push({levelData:new Uint8Array(t,a,c),uncompressedByteLength:l})}return i}function rh(t,e,r){let n=t.getUint32(e,!0),o=t.getUint32(e+4,!0)*4294967296+n;if(!Number.isSafeInteger(o))throw new Error(`${r} exceeds JavaScript's safe integer range`);return o}function GW(t,e,r){let n=t*e;if(!Number.isSafeInteger(n))throw new Error(`${r} size exceeds JavaScript's safe integer range`);return n}function yb(t,e,r,n){e>0&&bb(t,e,r,n)}function bb(t,e,r,n){if(!Number.isSafeInteger(t)||!Number.isSafeInteger(e)||t<0||e<0)throw new Error(`${n} has an invalid byte range`);let i=t+e;if(!Number.isSafeInteger(i)||i>r)throw new Error(`${n} is outside the KTX2 container`)}var pb,gb,LI,kW,vp=p(()=>{"use strict";Mp();RI();pb=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10]),gb=80,LI=24,kW=0});async function jW(t){let e=BI,r;BI=new Promise(n=>{r=n}),await e;try{return await t()}finally{r()}}async function Ep(t,e={}){return await jW(async()=>{var o;let r=await eI(hc({core:e==null?void 0:e.core,modules:e==null?void 0:e.modules})),n=((o=e.basis)==null?void 0:o.containerFormat)||"auto";if(n==="ktx2"||n==="auto"&&Js(t)){if(!r.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return qW(r,t,e)}return zW(r,t,e)})}function zW(t,e,r){let n=new t.BasisFile(new Uint8Array(e));try{let i=NI(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(DI(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 qW(t,e,r){let n=new t.KTX2File(new Uint8Array(e));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=NI(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(DI(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 DI(t,e,r,n,i,o,s){let a=WW(i,e);VW(e,xb(i,e));let c=o(a.basisFormat),l=HW(c,a.dataType);if(!s(l,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${xb(i,e)}`);let u=e.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:e.hasAlpha}}function VW(t,e){let r=e==="bc6h"||e==="rgba16f"||e==="rgb9e5"||e.startsWith("astc-hdr-");if(t.isHDR!==r)throw new Error(`Basis source codec ${t.codec} cannot be transcoded to ${e}`);if(t.codec==="xubc7"&&e!=="bc7"&&e!=="rgba32")throw new Error(`Basis source codec ${t.codec} cannot be transcoded to ${e}`)}function WW(t,e){let r=xb(t,e),n=CI[r];if(!n)throw new Error(`Unknown Basis format ${r}`);return n}function xb(t,e){var n,i,o;let r=((n=t.basis)==null?void 0:n.format)||"auto";return r==="auto"&&(r=$8((i=t.basis)==null?void 0:i.supportedTextureFormats,e,(o=t.basis)==null?void 0:o.supportedTextureFeatures)),typeof r=="object"&&(r=e.hasAlpha?r.alpha:r.noAlpha),r.toLowerCase()}function NI(t,e){let r=t.getBasisTexFormat(),n=$W[r];if(!n)throw new Error(`Unsupported Basis source texture format ${r}`);return{codec:n,isHDR:!!t.isHDR(),isSRGB:e?!!t.isSRGB():!1,hasAlpha:!!t.getHasAlpha(),blockWidth:t.getBlockWidth(),blockHeight:t.getBlockHeight()}}function HW(t,e){return e==="uint16"?new Uint16Array(t/Uint16Array.BYTES_PER_ELEMENT):e==="uint32"?new Uint32Array(t/Uint32Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function Tr(t,e,r){return{basisFormat:t,compressed:!0,format:e,textureFormat:r}}function du(t,e,r,n,i){return{basisFormat:t,compressed:!1,format:e,textureFormat:r,srgbFormat:n,srgbTextureFormat:i}}function Sn(t,e,r,n){return{...Tr(t,e,`astc-${n}-unorm`),srgbFormat:r,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var _n,CI,wle,BI,$W,_b=p(()=>{"use strict";dc();Z8();tI();vp();_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")},CI={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:du(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:du(14,36194,"rgb565unorm-webgl"),bgr565:du(15,36194,"rgb565unorm-webgl"),rgba4444:du(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:{...du(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...du(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":Tr(27,37812,"astc-6x6-unorm")},wle=Object.freeze(Object.keys(CI)),BI=Promise.resolve();$W={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 FI={};Qt(FI,{BasisLoaderWithParser:()=>ZW,BasisWorkerLoaderWithParser:()=>YW});var vle,KW,Ele,XW,YW,ZW,kI=p(()=>{"use strict";_b();Tp();Tp();({preload:vle,...KW}=go),{preload:Ele,...XW}=go,YW={...KW},ZW={...XW,parse:Ep}});async function JW(){let{BasisLoaderWithParser:t}=await Promise.resolve().then(()=>(kI(),FI));return t}var go,Tp=p(()=>{"use strict";Q2();pp();go={...U8,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:lu,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:JW}});function GI(t){return new Uint32Array(t,0,jn.HEADER_LENGTH)[jn.MAGIC_NUMBER_INDEX]===jn.MAGIC_NUMBER}function UI(t){let e=new Int32Array(t,0,jn.HEADER_LENGTH),r=e[jn.HEADER_PF_FOURCC_INDEX];jl(!!(e[jn.HEADER_PF_FLAGS_INDEX]&jn.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=i$(r),i=QW[n],o=n$[n];jl(i&&o,`DDS: Unknown pixel format ${r}`);let s=1;e[jn.HEADER_FLAGS_INDEX]&jn.DDSD_MIPMAPCOUNT&&(s=Math.max(1,e[jn.MIPMAPCOUNT_INDEX]));let a=e[jn.HEADER_WIDTH_INDEX],c=e[jn.HEADER_HEIGHT_INDEX],l=e[jn.HEADER_SIZE_INDEX]+4,u=new Uint8Array(t,l);return hu(u,{mipMapLevels:s,width:a,height:c,sizeFunction:o,textureFormat:i})}function jI(t,e){return(t+3>>2)*(e+3>>2)*8}function Ap(t,e){return(t+3>>2)*(e+3>>2)*16}function i$(t){return String.fromCharCode(t&255,t>>8&255,t>>16&255,t>>24&255)}var jn,QW,e$,t$,r$,n$,zI=p(()=>{"use strict";yi();Mp();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},QW={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"},e$=jI,t$=Ap,r$=Ap,n$={DXT1:jI,DXT3:Ap,DXT5:Ap,"ATC ":e$,ATCA:t$,ATCI:r$}});function WI(t){let r=new Uint32Array(t,0,bi.HEADER_LENGTH)[bi.MAGIC_NUMBER_INDEX];return r===bi.MAGIC_NUMBER||r===bi.MAGIC_NUMBER_EXTRA}function $I(t){let e=new Uint32Array(t,0,bi.HEADER_LENGTH),r=e[bi.PIXEL_FORMAT_INDEX],n=e[bi.COLOUR_SPACE_INDEX],i=o$[r]||[],o=i.length>1&&n?i[1]:i[0],s=s$[r],a=e[bi.MIPMAPCOUNT_INDEX],c=e[bi.WIDTH_INDEX],l=e[bi.HEIGHT_INDEX],u=bi.HEADER_SIZE+e[bi.METADATA_SIZE_INDEX],h=new Uint8Array(t,u);return hu(h,{mipMapLevels:a,width:c,height:l,sizeFunction:s,textureFormat:o})}function qI(t,e){return t=Math.max(t,16),e=Math.max(e,8),t*e/4}function VI(t,e){return t=Math.max(t,8),e=Math.max(e,8),t*e/2}function nh(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function ih(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function a$(t,e){return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16}function c$(t,e){return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16}function l$(t,e){return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16}function u$(t,e){return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16}function f$(t,e){return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16}function h$(t,e){return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16}function d$(t,e){return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16}function m$(t,e){return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16}function p$(t,e){return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16}function g$(t,e){return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16}function y$(t,e){return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16}function b$(t,e){return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16}function w$(t,e){return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16}var bi,o$,s$,HI=p(()=>{"use strict";Mp();bi={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},o$={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"]},s$={0:qI,1:qI,2:VI,3:VI,6:nh,7:nh,9:ih,11:ih,22:nh,23:ih,24:nh,25:nh,26:ih,27:ih,28:a$,29:c$,30:l$,31:u$,32:f$,33:h$,34:d$,35:m$,36:p$,37:g$,38:y$,39:b$,40:w$}});function Sb(t){if(Js(t))return OI(t);if(GI(t))return UI(t);if(WI(t))return $I(t);throw new Error("Texture container format not recognized")}var KI=p(()=>{"use strict";vp();zI();HI()});var XI={};Qt(XI,{CompressedTextureLoaderWithParser:()=>M$,CompressedTextureWorkerLoaderWithParser:()=>S$});var qle,x$,Vle,_$,S$,M$,YI=p(()=>{"use strict";KI();_b();vp();Ip();Ip();({preload:qle,...x$}=Qo),{preload:Vle,..._$}=Qo,S$={...x$},M$={..._$,parse:async(t,e)=>{var r,n;if(e={...e},(r=e==null?void 0:e["compressed-texture"])!=null&&r.useBasis||Js(t)){let i=Js(t)?wb(t):null;return!((n=e==null?void 0:e["compressed-texture"])!=null&&n.useBasis||(i==null?void 0:i.supercompressionScheme)!==0||(i==null?void 0:i.vkFormat)===0)?Sb(t):(e.basis={...e.basis,containerFormat:"ktx2"},(await Ep(t,e))[0])}return Sb(t)}}});async function v$(){let{CompressedTextureLoaderWithParser:t}=await Promise.resolve().then(()=>(YI(),XI));return t}var Qo,Ip=p(()=>{"use strict";Q2();pp();Qo={...j8,dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"images",version:lu,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:v$}});var oh=p(()=>{"use strict";J2();G8();Tp();Ip()});var ZI=p(()=>{"use strict"});function QI(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function $(t,e,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(t,e||[])).next())})}function JI(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Me(t){return this instanceof Me?(this.v=t,this):new Me(t)}function en(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),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 mu(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Me(t[i](s)),done:!1}:o?o(s):s}:o}}function zn(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof JI=="function"?JI(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,c){s=t[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 e6,pu,E$,qn,es=p(()=>{e6=new TextDecoder("utf-8"),pu=e6.decode.bind(e6),E$=new TextEncoder,qn=t=>E$.encode(t)});var T$,t6,hr,tn,Vn,Wn,Mn,Pp,Rp,Lp,Op,Bp,r6,sh,n6,Cp,i6,ts=p(()=>{T$=t=>typeof t=="number",t6=t=>typeof t=="boolean",hr=t=>typeof t=="function",tn=t=>t!=null&&Object(t)===t,Vn=t=>tn(t)&&hr(t.then),Wn=t=>tn(t)&&hr(t[Symbol.iterator]),Mn=t=>tn(t)&&hr(t[Symbol.asyncIterator]),Pp=t=>tn(t)&&tn(t.schema),Rp=t=>tn(t)&&"done"in t&&"value"in t,Lp=t=>tn(t)&&hr(t.stat)&&T$(t.fd),Op=t=>tn(t)&&sh(t.body),Bp=t=>"_getDOMStream"in t&&"_getNodeStream"in t,r6=t=>tn(t)&&hr(t.abort)&&hr(t.getWriter)&&!Bp(t),sh=t=>tn(t)&&hr(t.cancel)&&hr(t.getReader)&&!Bp(t),n6=t=>tn(t)&&hr(t.end)&&hr(t.write)&&t6(t.writable)&&!Bp(t),Cp=t=>tn(t)&&hr(t.read)&&hr(t.pipe)&&t6(t.readable)&&!Bp(t),i6=t=>tn(t)&&hr(t.clear)&&hr(t.bytes)&&hr(t.position)&&hr(t.setPosition)&&hr(t.capacity)&&hr(t.getBufferIdentifier)&&hr(t.createLong)});var Ib={};Qt(Ib,{compareArrayLike:()=>Ab,joinUint8Arrays:()=>$n,memcpy:()=>ah,rebaseValueOffsets:()=>Dp,toArrayBufferView:()=>Re,toArrayBufferViewAsyncIterator:()=>ki,toArrayBufferViewIterator:()=>yo,toBigInt64Array:()=>ch,toBigUint64Array:()=>O$,toFloat32Array:()=>B$,toFloat32ArrayAsyncIterator:()=>X$,toFloat32ArrayIterator:()=>j$,toFloat64Array:()=>C$,toFloat64ArrayAsyncIterator:()=>Y$,toFloat64ArrayIterator:()=>z$,toInt16Array:()=>P$,toInt16ArrayAsyncIterator:()=>W$,toInt16ArrayIterator:()=>F$,toInt32Array:()=>vc,toInt32ArrayAsyncIterator:()=>$$,toInt32ArrayIterator:()=>k$,toInt8Array:()=>I$,toInt8ArrayAsyncIterator:()=>V$,toInt8ArrayIterator:()=>N$,toUint16Array:()=>R$,toUint16ArrayAsyncIterator:()=>H$,toUint16ArrayIterator:()=>G$,toUint32Array:()=>L$,toUint32ArrayAsyncIterator:()=>K$,toUint32ArrayIterator:()=>U$,toUint8Array:()=>se,toUint8ArrayAsyncIterator:()=>Tb,toUint8ArrayIterator:()=>Eb,toUint8ClampedArray:()=>D$,toUint8ClampedArrayAsyncIterator:()=>Z$,toUint8ClampedArrayIterator:()=>q$});function A$(t){let e=t[0]?[t[0]]:[],r,n,i,o;for(let s,a,c=0,l=0,u=t.length;++c<u;){if(s=e[l],a=t[c],!s||!a||s.buffer!==a.buffer||a.byteOffset<s.byteOffset){a&&(e[++l]=a);continue}if({byteOffset:r,byteLength:i}=s,{byteOffset:n,byteLength:o}=a,r+i<n||n+o<r){a&&(e[++l]=a);continue}e[l]=new Uint8Array(s.buffer,r,n-r+o)}return e}function ah(t,e,r=0,n=e.byteLength){let i=t.byteLength,o=new Uint8Array(t.buffer,t.byteOffset,i),s=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,i));return o.set(s,r),t}function $n(t,e){let r=A$(t),n=r.reduce((u,h)=>u+h.byteLength,0),i,o,s,a=0,c=-1,l=Math.min(e||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?ah(s,o,a):s=o;break}ah(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(t,e){let r=Rp(e)?e.value:e;return r instanceof t?t===Uint8Array?new t(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=qn(r)),r instanceof ArrayBuffer?new t(r):r instanceof vb?new t(r):i6(r)?Re(t,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new t(0):new t(r.buffer,r.byteOffset,r.byteLength/t.BYTES_PER_ELEMENT):t.from(r)):new t(0)}function*yo(t,e){let r=function*(i){yield i},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof vb?r(e):Wn(e)?e:r(e);return yield*Mb((function*(i){let o=null;do o=i.next(yield Re(t,o));while(!o.done)})(n[Symbol.iterator]())),new t}function ki(t,e){return en(this,arguments,function*(){if(Vn(e))return yield Me(yield Me(yield*mu(zn(ki(t,yield Me(e))))));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*mu(zn(Mb((function*(a){let c=null;do c=a.next(yield c==null?void 0:c.value);while(!c.done)})(s[Symbol.iterator]())))))})},o=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof vb?n(e):Wn(e)?i(e):Mn(e)?e:n(e);return yield Me(yield*mu(zn(Mb((function(s){return en(this,arguments,function*(){let a=null;do a=yield Me(s.next(yield yield Me(Re(t,a))));while(!a.done)})})(o[Symbol.asyncIterator]()))))),yield Me(new t)})}function Dp(t,e,r){if(t!==0){r=r.slice(0,e);let n=typeof r[0]=="bigint"?BigInt(t):t;for(let i=-1,o=r.length;++i<o;)r[i]+=n}return r.subarray(0,e)}function Ab(t,e){let r=0,n=t.length;if(n!==e.length)return!1;if(n>0)do if(t[r]!==e[r])return!1;while(++r<n);return!0}var vb,I$,P$,vc,ch,se,R$,L$,O$,B$,C$,D$,Mb,N$,F$,k$,Eb,G$,U$,j$,z$,q$,V$,W$,$$,Tb,H$,K$,X$,Y$,Z$,dr=p(()=>{Ar();es();ts();vb=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;I$=t=>Re(Int8Array,t),P$=t=>Re(Int16Array,t),vc=t=>Re(Int32Array,t),ch=t=>Re(BigInt64Array,t),se=t=>Re(Uint8Array,t),R$=t=>Re(Uint16Array,t),L$=t=>Re(Uint32Array,t),O$=t=>Re(BigUint64Array,t),B$=t=>Re(Float32Array,t),C$=t=>Re(Float64Array,t),D$=t=>Re(Uint8ClampedArray,t),Mb=t=>(t.next(),t);N$=t=>yo(Int8Array,t),F$=t=>yo(Int16Array,t),k$=t=>yo(Int32Array,t),Eb=t=>yo(Uint8Array,t),G$=t=>yo(Uint16Array,t),U$=t=>yo(Uint32Array,t),j$=t=>yo(Float32Array,t),z$=t=>yo(Float64Array,t),q$=t=>yo(Uint8ClampedArray,t);V$=t=>ki(Int8Array,t),W$=t=>ki(Int16Array,t),$$=t=>ki(Int32Array,t),Tb=t=>ki(Uint8Array,t),H$=t=>ki(Uint16Array,t),K$=t=>ki(Uint32Array,t),X$=t=>ki(Float32Array,t),Y$=t=>ki(Float64Array,t),Z$=t=>ki(Uint8ClampedArray,t)});function*J$(t){let e,r=!1,n=[],i,o,s,a=0;function c(){return o==="peek"?$n(n,s)[0]:([i,n,a]=$n(n,s),i)}({cmd:o,size:s}=(yield null)||{cmd:"read",size:0});let l=Eb(t)[Symbol.iterator]();try{do if({done:e,value:i}=Number.isNaN(s-a)?l.next():l.next(s-a),!e&&i.byteLength>0&&(n.push(i),a+=i.byteLength),e||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!e)}catch(u){r=!0,typeof l.throw=="function"&&l.throw(u)}finally{r===!1&&typeof l.return=="function"&&l.return(null)}return null}function Q$(t){return en(this,arguments,function*(){let r,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?$n(i,a)[0]:([o,i,c]=$n(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=Tb(t)[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 eH(t){return en(this,arguments,function*(){let r=!1,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?$n(i,a)[0]:([o,i,c]=$n(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=new Rb(t);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()):t.locked&&u.releaseLock()}return yield Me(null)})}function tH(t){return en(this,arguments,function*(){let r=[],n="error",i=!1,o=null,s,a,c=0,l=[],u;function h(){return s==="peek"?$n(l,a)[0]:([u,l,c]=$n(l,a),u)}if({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0},t.isTTY)return yield yield Me(new Uint8Array(0)),yield Me(null);try{r[0]=Pb(t,"end"),r[1]=Pb(t,"error");do{if(r[2]=Pb(t,"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(t.read(a-c)),u.byteLength<a-c&&(u=se(t.read()))):u=se(t.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)t.off(w,_);try{let w=t.destroy;w&&w.call(t,g),g=void 0}catch(w){g=w||g}finally{g!=null?b(g):y()}})}})}var mr,Np,Rb,Pb,gu=p(()=>{Ar();dr();mr={fromIterable(t){return Np(J$(t))},fromAsyncIterable(t){return Np(Q$(t))},fromDOMStream(t){return Np(eH(t))},fromNodeStream(t){return Np(tH(t))},toDOMStream(t,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(t,e){throw new Error('"toNodeStream" not available in this environment')}},Np=t=>(t.next(),t);Rb=class{constructor(e){this.source=e,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(e){return $(this,void 0,void 0,function*(){let{reader:r,source:n}=this;r&&(yield r.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return $(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=yield this.reader.read();return!r.done&&(r.value=se(r)),r})}},Pb=(t,e)=>{let r=i=>n([e,i]),n;return[e,r,new Promise(i=>(n=i)&&t.once(e,r))]}});var ot,Fp=p(()=>{(function(t){t[t.V1=0]="V1",t[t.V2=1]="V2",t[t.V3=2]="V3",t[t.V4=3]="V4",t[t.V5=4]="V5"})(ot||(ot={}))});var Qe,Lb=p(()=>{(function(t){t[t.Sparse=0]="Sparse",t[t.Dense=1]="Dense"})(Qe||(Qe={}))});var Xe,Ob=p(()=>{(function(t){t[t.HALF=0]="HALF",t[t.SINGLE=1]="SINGLE",t[t.DOUBLE=2]="DOUBLE"})(Xe||(Xe={}))});var st,Bb=p(()=>{(function(t){t[t.DAY=0]="DAY",t[t.MILLISECOND=1]="MILLISECOND"})(st||(st={}))});var q,lh=p(()=>{(function(t){t[t.SECOND=0]="SECOND",t[t.MILLISECOND=1]="MILLISECOND",t[t.MICROSECOND=2]="MICROSECOND",t[t.NANOSECOND=3]="NANOSECOND"})(q||(q={}))});var Ge,Cb=p(()=>{(function(t){t[t.YEAR_MONTH=0]="YEAR_MONTH",t[t.DAY_TIME=1]="DAY_TIME",t[t.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Ge||(Ge={}))});var kp=ae(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.SIZE_PREFIX_LENGTH=bo.FILE_IDENTIFIER_LENGTH=bo.SIZEOF_INT=bo.SIZEOF_SHORT=void 0;bo.SIZEOF_SHORT=2;bo.SIZEOF_INT=4;bo.FILE_IDENTIFIER_LENGTH=4;bo.SIZE_PREFIX_LENGTH=4});var Db=ae(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.isLittleEndian=wi.float64=wi.float32=wi.int32=void 0;wi.int32=new Int32Array(2);wi.float32=new Float32Array(wi.int32.buffer);wi.float64=new Float64Array(wi.int32.buffer);wi.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var Nb=ae(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});Gp.Encoding=void 0;var o6;(function(t){t[t.UTF8_BYTES=1]="UTF8_BYTES",t[t.UTF16_STRING=2]="UTF16_STRING"})(o6||(Gp.Encoding=o6={}))});var kb=ae(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});Up.ByteBuffer=void 0;var wo=kp(),rH=Nb(),vn=Db(),Fb=class t{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new t(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return vn.int32[0]=this.readInt32(e),vn.float32[0]}readFloat64(e){return vn.int32[vn.isLittleEndian?0:1]=this.readInt32(e),vn.int32[vn.isLittleEndian?1:0]=this.readInt32(e+4),vn.float64[0]}writeInt8(e,r){this.bytes_[e]=r}writeUint8(e,r){this.bytes_[e]=r}writeInt16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeUint16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeInt32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeUint32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeInt64(e,r){this.writeInt32(e,Number(BigInt.asIntN(32,r))),this.writeInt32(e+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(e,r){this.writeUint32(e,Number(BigInt.asUintN(32,r))),this.writeUint32(e+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(e,r){vn.float32[0]=r,this.writeInt32(e,vn.int32[0])}writeFloat64(e,r){vn.float64[0]=r,this.writeInt32(e,vn.int32[vn.isLittleEndian?0:1]),this.writeInt32(e+4,vn.int32[vn.isLittleEndian?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+wo.SIZEOF_INT+wo.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let r=0;r<wo.FILE_IDENTIFIER_LENGTH;r++)e+=String.fromCharCode(this.readInt8(this.position_+wo.SIZEOF_INT+r));return e}__offset(e,r){let n=e-this.readInt32(e);return r<this.readInt16(n)?this.readInt16(n+r):0}__union(e,r){return e.bb_pos=r+this.readInt32(r),e.bb=this,e}__string(e,r){e+=this.readInt32(e);let n=this.readInt32(e);e+=wo.SIZEOF_INT;let i=this.bytes_.subarray(e,e+n);return r===rH.Encoding.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(e,r){return typeof e=="string"?this.__string(r):this.__union(e,r)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+wo.SIZEOF_INT}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=wo.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+wo.FILE_IDENTIFIER_LENGTH);for(let r=0;r<wo.FILE_IDENTIFIER_LENGTH;r++)if(e.charCodeAt(r)!=this.readInt8(this.position()+wo.SIZEOF_INT+r))return!1;return!0}createScalarList(e,r){let n=[];for(let i=0;i<r;++i){let o=e(i);o!==null&&n.push(o)}return n}createObjList(e,r){let n=[];for(let i=0;i<r;++i){let o=e(i);o!==null&&n.push(o.unpack())}return n}};Up.ByteBuffer=Fb});var a6=ae(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.Builder=void 0;var s6=kb(),Hn=kp(),Gb=class t{constructor(e){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;e?r=e:r=1024,this.bb=s6.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(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,r){e>this.minalign&&(this.minalign=e);let n=~(this.bb.capacity()-this.space+r)+1&e-1;for(;this.space<n+e+r;){let i=this.bb.capacity();this.bb=t.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)}pad(e){for(let r=0;r<e;r++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,r,n){(this.force_defaults||r!=n)&&(this.addInt8(r),this.slot(e))}addFieldInt16(e,r,n){(this.force_defaults||r!=n)&&(this.addInt16(r),this.slot(e))}addFieldInt32(e,r,n){(this.force_defaults||r!=n)&&(this.addInt32(r),this.slot(e))}addFieldInt64(e,r,n){(this.force_defaults||r!==n)&&(this.addInt64(r),this.slot(e))}addFieldFloat32(e,r,n){(this.force_defaults||r!=n)&&(this.addFloat32(r),this.slot(e))}addFieldFloat64(e,r,n){(this.force_defaults||r!=n)&&(this.addFloat64(r),this.slot(e))}addFieldOffset(e,r,n){(this.force_defaults||r!=n)&&(this.addOffset(r),this.slot(e))}addFieldStruct(e,r,n){r!=n&&(this.nested(r),this.slot(e))}nested(e){if(e!=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(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let r=e.capacity();if(r&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=r<<1,i=s6.ByteBuffer.allocate(n);return i.setPosition(n-r),i.bytes().set(e.bytes(),n-r),i}addOffset(e){this.prep(Hn.SIZEOF_INT,0),this.writeInt32(this.offset()-e+Hn.SIZEOF_INT)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let r=0;r<e;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 e=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?e-this.vtable[r]:0);let i=2;this.addInt16(e-this.object_start);let o=(n+i)*Hn.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=Hn.SIZEOF_SHORT;l<o;l+=Hn.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()-e,this.bb.writeInt32(this.space,s-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,r,n){let i=n?Hn.SIZE_PREFIX_LENGTH:0;if(r){let o=r;if(this.prep(this.minalign,Hn.SIZEOF_INT+Hn.FILE_IDENTIFIER_LENGTH+i),o.length!=Hn.FILE_IDENTIFIER_LENGTH)throw new TypeError("FlatBuffers: file identifier must be length "+Hn.FILE_IDENTIFIER_LENGTH);for(let s=Hn.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,Hn.SIZEOF_INT+i),this.addOffset(e),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,r){this.finish(e,r,!0)}requiredField(e,r){let n=this.bb.capacity()-e,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(e,r,n){this.notNested(),this.vector_num_elems=r,this.prep(Hn.SIZEOF_INT,e*r),this.prep(n,e*r)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let r=this.createString(e);return this.string_maps.set(e,r),r}createString(e){if(e==null)return 0;let r;return e instanceof Uint8Array?r=e:r=this.text_encoder.encode(e),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(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let r=[];for(let n=0;n<e.length;++n){let i=e[n];if(i!==null)r.push(this.createObjectOffset(i));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return r}createStructOffsetList(e,r){return r(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}};jp.Builder=Gb});var Ve=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 zp=kp();Object.defineProperty(It,"FILE_IDENTIFIER_LENGTH",{enumerable:!0,get:function(){return zp.FILE_IDENTIFIER_LENGTH}});Object.defineProperty(It,"SIZEOF_INT",{enumerable:!0,get:function(){return zp.SIZEOF_INT}});Object.defineProperty(It,"SIZEOF_SHORT",{enumerable:!0,get:function(){return zp.SIZEOF_SHORT}});Object.defineProperty(It,"SIZE_PREFIX_LENGTH",{enumerable:!0,get:function(){return zp.SIZE_PREFIX_LENGTH}});var qp=Db();Object.defineProperty(It,"float32",{enumerable:!0,get:function(){return qp.float32}});Object.defineProperty(It,"float64",{enumerable:!0,get:function(){return qp.float64}});Object.defineProperty(It,"int32",{enumerable:!0,get:function(){return qp.int32}});Object.defineProperty(It,"isLittleEndian",{enumerable:!0,get:function(){return qp.isLittleEndian}});var nH=a6();Object.defineProperty(It,"Builder",{enumerable:!0,get:function(){return nH.Builder}});var iH=kb();Object.defineProperty(It,"ByteBuffer",{enumerable:!0,get:function(){return iH.ByteBuffer}});var oH=Nb();Object.defineProperty(It,"Encoding",{enumerable:!0,get:function(){return oH.Encoding}})});var Ec,Ub=p(()=>{(function(t){t[t.BUFFER=0]="BUFFER"})(Ec||(Ec={}))});var Ir,yu=p(()=>{(function(t){t[t.LZ4_FRAME=0]="LZ4_FRAME",t[t.ZSTD=1]="ZSTD"})(Ir||(Ir={}))});var c6,rs,jb=p(()=>{c6=me(Ve(),1);Ub();yu();rs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBodyCompression(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,r){return e.setPosition(e.position()+c6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):Ir.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):Ec.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,r){e.addFieldInt8(0,r,Ir.LZ4_FRAME)}static addMethod(e,r){e.addFieldInt8(1,r,Ec.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,r,n){return t.startBodyCompression(e),t.addCodec(e,r),t.addMethod(e,n),t.endBodyCompression(e)}}});var bu,zb=p(()=>{bu=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,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(e,r,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(r??0)),e.offset()}}});var wu,qb=p(()=>{wu=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,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(e,r,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(r??0)),e.offset()}}});var l6,Dr,Vb=p(()=>{l6=me(Ve(),1);jb();zb();qb();Dr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsRecordBatch(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,r){return e.setPosition(e.position()+l6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new wu).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new bu).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let r=this.bb.__offset(this.bb_pos,10);return r?(e||new rs).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}variadicBufferCounts(e){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+e*8):BigInt(0)}variadicBufferCountsLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startRecordBatch(e){e.startObject(5)}static addLength(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addNodes(e,r){e.addFieldOffset(1,r,0)}static startNodesVector(e,r){e.startVector(16,r,8)}static addBuffers(e,r){e.addFieldOffset(2,r,0)}static startBuffersVector(e,r){e.startVector(16,r,8)}static addCompression(e,r){e.addFieldOffset(3,r,0)}static addVariadicBufferCounts(e,r){e.addFieldOffset(4,r,0)}static createVariadicBufferCountsVector(e,r){e.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)e.addInt64(r[n]);return e.endVector()}static startVariadicBufferCountsVector(e,r){e.startVector(8,r,8)}static endRecordBatch(e){return e.endObject()}}});var u6,ns,f6=p(()=>{u6=me(Ve(),1);Vb();ns=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDictionaryBatch(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,r){return e.setPosition(e.position()+u6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Dr).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addData(e,r){e.addFieldOffset(1,r,0)}static addIsDelta(e,r){e.addFieldInt8(2,+r,0)}static endDictionaryBatch(e){return e.endObject()}}});var Qs,Wb=p(()=>{(function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"})(Qs||(Qs={}))});var uh,h6=p(()=>{(function(t){t[t.DenseArray=0]="DenseArray"})(uh||(uh={}))});var d6,Gi,Vp=p(()=>{d6=me(Ve(),1),Gi=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsInt(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,r){return e.setPosition(e.position()+d6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,r){e.addFieldInt32(0,r,0)}static addIsSigned(e,r){e.addFieldInt8(1,+r,0)}static endInt(e){return e.endObject()}static createInt(e,r,n){return t.startInt(e),t.addBitWidth(e,r),t.addIsSigned(e,n),t.endInt(e)}}});var m6,xo,$b=p(()=>{m6=me(Ve(),1);h6();Vp();xo=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDictionaryEncoding(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,r){return e.setPosition(e.position()+m6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Gi).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):uh.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addIndexType(e,r){e.addFieldOffset(1,r,0)}static addIsOrdered(e,r){e.addFieldInt8(2,+r,0)}static addDictionaryKind(e,r){e.addFieldInt16(3,r,uh.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}});var p6,Dt,xu=p(()=>{p6=me(Ve(),1),Dt=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsKeyValue(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,r){return e.setPosition(e.position()+p6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}key(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}value(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,r){e.addFieldOffset(0,r,0)}static addValue(e,r){e.addFieldOffset(1,r,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,r,n){return t.startKeyValue(e),t.addKey(e,r),t.addValue(e,n),t.endKeyValue(e)}}});var g6,fh,y6=p(()=>{g6=me(Ve(),1),fh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,r){return e.setPosition(e.position()+g6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return t.startBinary(e),t.endBinary(e)}}});var b6,hh,w6=p(()=>{b6=me(Ve(),1),hh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBinaryView(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinaryView(e,r){return e.setPosition(e.position()+b6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBinaryView(e){e.startObject(0)}static endBinaryView(e){return e.endObject()}static createBinaryView(e){return t.startBinaryView(e),t.endBinaryView(e)}}});var x6,dh,_6=p(()=>{x6=me(Ve(),1),dh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBool(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,r){return e.setPosition(e.position()+x6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return t.startBool(e),t.endBool(e)}}});var S6,ea,Hb=p(()=>{S6=me(Ve(),1);Bb();ea=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDate(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,r){return e.setPosition(e.position()+S6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):st.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,st.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,r){return t.startDate(e),t.addUnit(e,r),t.endDate(e)}}});var M6,_o,Kb=p(()=>{M6=me(Ve(),1),_o=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDecimal(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,r){return e.setPosition(e.position()+M6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,r){e.addFieldInt32(0,r,0)}static addScale(e,r){e.addFieldInt32(1,r,0)}static addBitWidth(e,r){e.addFieldInt32(2,r,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,r,n,i){return t.startDecimal(e),t.addPrecision(e,r),t.addScale(e,n),t.addBitWidth(e,i),t.endDecimal(e)}}});var v6,ta,Xb=p(()=>{v6=me(Ve(),1);lh();ta=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDuration(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,r){return e.setPosition(e.position()+v6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):q.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,q.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,r){return t.startDuration(e),t.addUnit(e,r),t.endDuration(e)}}});var E6,ra,Yb=p(()=>{E6=me(Ve(),1),ra=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFixedSizeBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,r){return e.setPosition(e.position()+E6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,r){e.addFieldInt32(0,r,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,r){return t.startFixedSizeBinary(e),t.addByteWidth(e,r),t.endFixedSizeBinary(e)}}});var T6,na,Zb=p(()=>{T6=me(Ve(),1),na=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFixedSizeList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,r){return e.setPosition(e.position()+T6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,r){e.addFieldInt32(0,r,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,r){return t.startFixedSizeList(e),t.addListSize(e,r),t.endFixedSizeList(e)}}});var A6,ia,Jb=p(()=>{A6=me(Ve(),1);Ob();ia=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFloatingPoint(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,r){return e.setPosition(e.position()+A6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Xe.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,r){e.addFieldInt16(0,r,Xe.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,r){return t.startFloatingPoint(e),t.addPrecision(e,r),t.endFloatingPoint(e)}}});var I6,oa,Qb=p(()=>{I6=me(Ve(),1);Cb();oa=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsInterval(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,r){return e.setPosition(e.position()+I6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ge.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,Ge.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,r){return t.startInterval(e),t.addUnit(e,r),t.endInterval(e)}}});var P6,mh,R6=p(()=>{P6=me(Ve(),1),mh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,r){return e.setPosition(e.position()+P6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return t.startLargeBinary(e),t.endLargeBinary(e)}}});var L6,ph,O6=p(()=>{L6=me(Ve(),1),ph=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,r){return e.setPosition(e.position()+L6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return t.startLargeList(e),t.endLargeList(e)}}});var B6,gh,C6=p(()=>{B6=me(Ve(),1),gh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeUtf8(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,r){return e.setPosition(e.position()+B6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return t.startLargeUtf8(e),t.endLargeUtf8(e)}}});var D6,yh,N6=p(()=>{D6=me(Ve(),1),yh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,r){return e.setPosition(e.position()+D6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return t.startList(e),t.endList(e)}}});var F6,sa,ew=p(()=>{F6=me(Ve(),1),sa=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsMap(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,r){return e.setPosition(e.position()+F6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,r){e.addFieldInt8(0,+r,0)}static endMap(e){return e.endObject()}static createMap(e,r){return t.startMap(e),t.addKeysSorted(e,r),t.endMap(e)}}});var k6,bh,G6=p(()=>{k6=me(Ve(),1),bh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsNull(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,r){return e.setPosition(e.position()+k6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return t.startNull(e),t.endNull(e)}}});var U6,wh,j6=p(()=>{U6=me(Ve(),1),wh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsStruct_(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,r){return e.setPosition(e.position()+U6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return t.startStruct_(e),t.endStruct_(e)}}});var z6,is,tw=p(()=>{z6=me(Ve(),1);lh();is=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsTime(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,r){return e.setPosition(e.position()+z6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):q.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,r){e.addFieldInt16(0,r,q.MILLISECOND)}static addBitWidth(e,r){e.addFieldInt32(1,r,32)}static endTime(e){return e.endObject()}static createTime(e,r,n){return t.startTime(e),t.addUnit(e,r),t.addBitWidth(e,n),t.endTime(e)}}});var q6,os,rw=p(()=>{q6=me(Ve(),1);lh();os=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsTimestamp(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,r){return e.setPosition(e.position()+q6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):q.SECOND}timezone(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,r){e.addFieldInt16(0,r,q.SECOND)}static addTimezone(e,r){e.addFieldOffset(1,r,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,r,n){return t.startTimestamp(e),t.addUnit(e,r),t.addTimezone(e,n),t.endTimestamp(e)}}});var V6,Ui,nw=p(()=>{V6=me(Ve(),1);Lb();Ui=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUnion(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,r){return e.setPosition(e.position()+V6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Qe.Sparse}typeIds(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readInt32(this.bb.__vector(this.bb_pos+r)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,r){e.addFieldInt16(0,r,Qe.Sparse)}static addTypeIds(e,r){e.addFieldOffset(1,r,0)}static createTypeIdsVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addInt32(r[n]);return e.endVector()}static startTypeIdsVector(e,r){e.startVector(4,r,4)}static endUnion(e){return e.endObject()}static createUnion(e,r,n){return t.startUnion(e),t.addMode(e,r),t.addTypeIds(e,n),t.endUnion(e)}}});var W6,xh,$6=p(()=>{W6=me(Ve(),1),xh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUtf8(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,r){return e.setPosition(e.position()+W6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return t.startUtf8(e),t.endUtf8(e)}}});var H6,_h,K6=p(()=>{H6=me(Ve(),1),_h=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUtf8View(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8View(e,r){return e.setPosition(e.position()+H6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8View(e){e.startObject(0)}static endUtf8View(e){return e.endObject()}static createUtf8View(e){return t.startUtf8View(e),t.endUtf8View(e)}}});var pe,Wp=p(()=>{(function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.FloatingPoint=3]="FloatingPoint",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct_=13]="Struct_",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Duration=18]="Duration",t[t.LargeBinary=19]="LargeBinary",t[t.LargeUtf8=20]="LargeUtf8",t[t.LargeList=21]="LargeList",t[t.RunEndEncoded=22]="RunEndEncoded",t[t.BinaryView=23]="BinaryView",t[t.Utf8View=24]="Utf8View",t[t.ListView=25]="ListView",t[t.LargeListView=26]="LargeListView"})(pe||(pe={}))});var X6,Nr,iw=p(()=>{X6=me(Ve(),1);$b();xu();Wp();Nr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsField(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,r){return e.setPosition(e.position()+X6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}name(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):pe.NONE}type(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(e,this.bb_pos+r):null}dictionary(e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new xo).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(e,r){let n=this.bb.__offset(this.bb_pos,14);return n?(r||new t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,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)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,r){e.addFieldOffset(0,r,0)}static addNullable(e,r){e.addFieldInt8(1,+r,0)}static addTypeType(e,r){e.addFieldInt8(2,r,pe.NONE)}static addType(e,r){e.addFieldOffset(3,r,0)}static addDictionary(e,r){e.addFieldOffset(4,r,0)}static addChildren(e,r){e.addFieldOffset(5,r,0)}static createChildrenVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startChildrenVector(e,r){e.startVector(4,r,4)}static addCustomMetadata(e,r){e.addFieldOffset(6,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endField(e){return e.endObject()}}});var Y6,En,ow=p(()=>{Y6=me(Ve(),1);Wb();iw();xu();En=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsSchema(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,r){return e.setPosition(e.position()+Y6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Qs.Little}fields(e,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)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,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)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,r){e.addFieldInt16(0,r,Qs.Little)}static addFields(e,r){e.addFieldOffset(1,r,0)}static createFieldsVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startFieldsVector(e,r){e.startVector(4,r,4)}static addCustomMetadata(e,r){e.addFieldOffset(2,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static addFeatures(e,r){e.addFieldOffset(3,r,0)}static createFeaturesVector(e,r){e.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)e.addInt64(r[n]);return e.endVector()}static startFeaturesVector(e,r){e.startVector(8,r,8)}static endSchema(e){return e.endObject()}static createSchema(e,r,n,i,o){return t.startSchema(e),t.addEndianness(e,r),t.addFields(e,n),t.addCustomMetadata(e,i),t.addFeatures(e,o),t.endSchema(e)}}});var ke,$p=p(()=>{(function(t){t[t.NONE=0]="NONE",t[t.Schema=1]="Schema",t[t.DictionaryBatch=2]="DictionaryBatch",t[t.RecordBatch=3]="RecordBatch",t[t.Tensor=4]="Tensor",t[t.SparseTensor=5]="SparseTensor"})(ke||(ke={}))});var x,Ne,Nt=p(()=>{Fp();Lb();Ob();Bb();lh();Cb();$p();(function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Duration=18]="Duration",t[t.LargeBinary=19]="LargeBinary",t[t.LargeUtf8=20]="LargeUtf8",t[t.LargeList=21]="LargeList",t[t.BinaryView=23]="BinaryView",t[t.Utf8View=24]="Utf8View",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth",t[t.DurationSecond=-27]="DurationSecond",t[t.DurationMillisecond=-28]="DurationMillisecond",t[t.DurationMicrosecond=-29]="DurationMicrosecond",t[t.DurationNanosecond=-30]="DurationNanosecond",t[t.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(x||(x={}));(function(t){t[t.OFFSET=0]="OFFSET",t[t.DATA=1]="DATA",t[t.VALIDITY=2]="VALIDITY",t[t.TYPE=3]="TYPE"})(Ne||(Ne={}))});var sw={};Qt(sw,{valueToString:()=>ji});function ji(t){if(t===null)return"null";if(t===void 0)return"undefined";switch(typeof t){case"number":return`${t}`;case"bigint":return`${t}`;case"string":return`"${t}"`}return typeof t[Symbol.toPrimitive]=="function"?t[Symbol.toPrimitive]("string"):ArrayBuffer.isView(t)?t instanceof BigInt64Array||t instanceof BigUint64Array?`[${[...t].map(e=>ji(e))}]`:`[${t}]`:ArrayBuffer.isView(t)?`[${t}]`:JSON.stringify(t,(e,r)=>typeof r=="bigint"?`${r}`:r)}var Sh=p(()=>{});function Le(t){if(typeof t=="bigint"&&(t<Number.MIN_SAFE_INTEGER||t>Number.MAX_SAFE_INTEGER))throw new TypeError(`${t} is not safe to convert to a number.`);return Number(t)}function aw(t,e){return Le(t/e)+Le(t%e)/Le(e)}var So=p(()=>{});var uw={};Qt(uw,{BN:()=>Tc,bigNumToBigInt:()=>J6,bigNumToNumber:()=>lw,bigNumToString:()=>Mu,isArrowBigNumSymbol:()=>Z6});function zi(t,...e){return e.length===0?Object.setPrototypeOf(Re(this.TypedArray,t),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(t,...e),this.constructor.prototype)}function _u(...t){return zi.apply(this,t)}function Su(...t){return zi.apply(this,t)}function Mh(...t){return zi.apply(this,t)}function lw(t,e){let{buffer:r,byteOffset:n,byteLength:i,signed:o}=t,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^aH)*(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 e=="number"&&e>0){let u=BigInt("1".padEnd(e+1,"0")),h=c/u,d=a?-(c%u):c%u,m=Le(h),g=`${d}`.padStart(e,"0");return+`${a&&m===0?"-":""}${m}.${g}`}return Le(c)}function Mu(t){if(t.byteLength===8)return`${new t.BigIntArray(t.buffer,t.byteOffset,1)[0]}`;if(!t.signed)return cw(t);let e=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return cw(t);e=e.slice();let n=1;for(let o=0;o<e.length;o++){let s=e[o],a=~s+n;e[o]=a,n&=s===0?1:0}return`-${cw(e)}`}function J6(t){return t.byteLength===8?new t.BigIntArray(t.buffer,t.byteOffset,1)[0]:Mu(t)}function cw(t){let e="",r=new Uint32Array(2),n=new Uint16Array(t.buffer,t.byteOffset,t.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,e=`${r[0]}${e}`}while(i[0]||i[1]||i[2]||i[3]);return e??"0"}var Z6,sH,aH,Tc,Hp=p(()=>{dr();So();Z6=Symbol.for("isArrowBigNum");zi.prototype[Z6]=!0;zi.prototype.toJSON=function(){return`"${Mu(this)}"`};zi.prototype.valueOf=function(t){return lw(this,t)};zi.prototype.toString=function(){return Mu(this)};zi.prototype[Symbol.toPrimitive]=function(t="default"){switch(t){case"number":return lw(this);case"string":return Mu(this);case"default":return J6(this)}return Mu(this)};Object.setPrototypeOf(_u.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Su.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Mh.prototype,Object.create(Uint32Array.prototype));Object.assign(_u.prototype,zi.prototype,{constructor:_u,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Su.prototype,zi.prototype,{constructor:Su,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Mh.prototype,zi.prototype,{constructor:Mh,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});sH=BigInt(4294967296)*BigInt(4294967296),aH=sH-BigInt(1);Tc=class t{static new(e,r){switch(r){case!0:return new _u(e);case!1:return new Su(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new _u(e)}return e.byteLength===16?new Mh(e):new Su(e)}static signed(e){return new _u(e)}static unsigned(e){return new Su(e)}static decimal(e){return new Mh(e)}constructor(e,r){return t.new(e,r)}}});function ti(t){let e=t;switch(t.typeId){case x.Decimal:return t.bitWidth/32;case x.Interval:return e.unit===Ge.MONTH_DAY_NANO?4:1+e.unit;case x.BinaryView:case x.Utf8View:return 16;case x.FixedSizeList:return e.listSize;case x.FixedSizeBinary:return e.byteWidth;default:return 1}}var Q6,eP,tP,rP,nP,iP,oP,sP,aP,cP,lP,uP,fP,hP,dP,mP,pP,gP,yP,bP,wP,xP,_P,SP,MP,vP,U,$t,Pt,Kn,Xn,Zt,Yn,Zn,Jn,rn,qi,Fr,Vi,nn,Qn,Tn,Ee,Wi,kr,on,$i,Gr,An,sn,aa,ca,Pr,la,ua,fa,ha,Rr,da,Mo,ma,pa,Ur,ga,ya,vh,an,Eh,Th,Ah,Ih,rr,ei,$e,cn,ss,ba,In,Ht,jr,cH,nr,at=p(()=>{So();Nt();vP=Symbol.for("apache-arrow/DataType"),U=class t{static isDataType(e){return(e==null?void 0:e[vP])===!0}static isNull(e){return(e==null?void 0:e.typeId)===x.Null}static isInt(e){return(e==null?void 0:e.typeId)===x.Int}static isFloat(e){return(e==null?void 0:e.typeId)===x.Float}static isBinary(e){return(e==null?void 0:e.typeId)===x.Binary}static isBinaryView(e){return(e==null?void 0:e.typeId)===x.BinaryView}static isLargeBinary(e){return(e==null?void 0:e.typeId)===x.LargeBinary}static isUtf8(e){return(e==null?void 0:e.typeId)===x.Utf8}static isUtf8View(e){return(e==null?void 0:e.typeId)===x.Utf8View}static isLargeUtf8(e){return(e==null?void 0:e.typeId)===x.LargeUtf8}static isBool(e){return(e==null?void 0:e.typeId)===x.Bool}static isDecimal(e){return(e==null?void 0:e.typeId)===x.Decimal}static isDate(e){return(e==null?void 0:e.typeId)===x.Date}static isTime(e){return(e==null?void 0:e.typeId)===x.Time}static isTimestamp(e){return(e==null?void 0:e.typeId)===x.Timestamp}static isInterval(e){return(e==null?void 0:e.typeId)===x.Interval}static isDuration(e){return(e==null?void 0:e.typeId)===x.Duration}static isList(e){return(e==null?void 0:e.typeId)===x.List}static isLargeList(e){return(e==null?void 0:e.typeId)===x.LargeList}static isStruct(e){return(e==null?void 0:e.typeId)===x.Struct}static isUnion(e){return(e==null?void 0:e.typeId)===x.Union}static isFixedSizeBinary(e){return(e==null?void 0:e.typeId)===x.FixedSizeBinary}static isFixedSizeList(e){return(e==null?void 0:e.typeId)===x.FixedSizeList}static isMap(e){return(e==null?void 0:e.typeId)===x.Map}static isDictionary(e){return(e==null?void 0:e.typeId)===x.Dictionary}static isDenseUnion(e){return t.isUnion(e)&&e.mode===Qe.Dense}static isSparseUnion(e){return t.isUnion(e)&&e.mode===Qe.Sparse}constructor(e){this.typeId=e}};Q6=Symbol.toStringTag;U[Q6]=(t=>(t.children=null,t.ArrayType=Array,t.OffsetArrayType=Int32Array,t[vP]=!0,t[Symbol.toStringTag]="DataType"))(U.prototype);$t=class extends U{constructor(){super(x.Null)}toString(){return"Null"}};eP=Symbol.toStringTag;$t[eP]=(t=>t[Symbol.toStringTag]="Null")($t.prototype);Pt=class extends U{constructor(e,r){super(x.Int),this.isSigned=e,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}`}};tP=Symbol.toStringTag;Pt[tP]=(t=>(t.isSigned=null,t.bitWidth=null,t[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}},Zt=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}},qi=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(Zt.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(qi.prototype,"ArrayType",{value:BigUint64Array});Fr=class extends U{constructor(e){super(x.Float),this.precision=e}get ArrayType(){switch(this.precision){case Xe.HALF:return Uint16Array;case Xe.SINGLE:return Float32Array;case Xe.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};rP=Symbol.toStringTag;Fr[rP]=(t=>(t.precision=null,t[Symbol.toStringTag]="Float"))(Fr.prototype);Vi=class extends Fr{constructor(){super(Xe.HALF)}},nn=class extends Fr{constructor(){super(Xe.SINGLE)}},Qn=class extends Fr{constructor(){super(Xe.DOUBLE)}};Object.defineProperty(Vi.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(nn.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Qn.prototype,"ArrayType",{value:Float64Array});Tn=class extends U{constructor(){super(x.Binary)}toString(){return"Binary"}};nP=Symbol.toStringTag;Tn[nP]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Binary"))(Tn.prototype);Ee=class extends U{constructor(){super(x.BinaryView)}toString(){return"BinaryView"}};iP=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[iP]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="BinaryView"))(Ee.prototype);Wi=class extends U{constructor(){super(x.LargeBinary)}toString(){return"LargeBinary"}};oP=Symbol.toStringTag;Wi[oP]=(t=>(t.ArrayType=Uint8Array,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeBinary"))(Wi.prototype);kr=class extends U{constructor(){super(x.Utf8)}toString(){return"Utf8"}};sP=Symbol.toStringTag;kr[sP]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8"))(kr.prototype);on=class extends U{constructor(){super(x.Utf8View)}toString(){return"Utf8View"}};aP=Symbol.toStringTag;on.ELEMENT_WIDTH=Ee.ELEMENT_WIDTH;on.INLINE_CAPACITY=Ee.INLINE_CAPACITY;on[aP]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8View"))(on.prototype);$i=class extends U{constructor(){super(x.LargeUtf8)}toString(){return"LargeUtf8"}};cP=Symbol.toStringTag;$i[cP]=(t=>(t.ArrayType=Uint8Array,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeUtf8"))($i.prototype);Gr=class extends U{constructor(){super(x.Bool)}toString(){return"Bool"}};lP=Symbol.toStringTag;Gr[lP]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Bool"))(Gr.prototype);An=class extends U{constructor(e,r,n=128){super(x.Decimal),this.scale=e,this.precision=r,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};uP=Symbol.toStringTag;An[uP]=(t=>(t.scale=null,t.precision=null,t.ArrayType=Uint32Array,t[Symbol.toStringTag]="Decimal"))(An.prototype);sn=class extends U{constructor(e){super(x.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${st[this.unit]}>`}get ArrayType(){return this.unit===st.DAY?Int32Array:BigInt64Array}};fP=Symbol.toStringTag;sn[fP]=(t=>(t.unit=null,t[Symbol.toStringTag]="Date"))(sn.prototype);aa=class extends sn{constructor(){super(st.DAY)}},ca=class extends sn{constructor(){super(st.MILLISECOND)}},Pr=class extends U{constructor(e,r){super(x.Time),this.unit=e,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`)}};hP=Symbol.toStringTag;Pr[hP]=(t=>(t.unit=null,t.bitWidth=null,t[Symbol.toStringTag]="Time"))(Pr.prototype);la=class extends Pr{constructor(){super(q.SECOND,32)}},ua=class extends Pr{constructor(){super(q.MILLISECOND,32)}},fa=class extends Pr{constructor(){super(q.MICROSECOND,64)}},ha=class extends Pr{constructor(){super(q.NANOSECOND,64)}},Rr=class extends U{constructor(e,r){super(x.Timestamp),this.unit=e,this.timezone=r}toString(){return`Timestamp<${q[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};dP=Symbol.toStringTag;Rr[dP]=(t=>(t.unit=null,t.timezone=null,t.ArrayType=BigInt64Array,t[Symbol.toStringTag]="Timestamp"))(Rr.prototype);da=class extends Rr{constructor(e){super(q.SECOND,e)}},Mo=class extends Rr{constructor(e){super(q.MILLISECOND,e)}},ma=class extends Rr{constructor(e){super(q.MICROSECOND,e)}},pa=class extends Rr{constructor(e){super(q.NANOSECOND,e)}},Ur=class extends U{constructor(e){super(x.Interval),this.unit=e}toString(){return`Interval<${Ge[this.unit]}>`}};mP=Symbol.toStringTag;Ur[mP]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Interval"))(Ur.prototype);ga=class extends Ur{constructor(){super(Ge.DAY_TIME)}},ya=class extends Ur{constructor(){super(Ge.YEAR_MONTH)}},vh=class extends Ur{constructor(){super(Ge.MONTH_DAY_NANO)}},an=class extends U{constructor(e){super(x.Duration),this.unit=e}toString(){return`Duration<${q[this.unit]}>`}};pP=Symbol.toStringTag;an[pP]=(t=>(t.unit=null,t.ArrayType=BigInt64Array,t[Symbol.toStringTag]="Duration"))(an.prototype);Eh=class extends an{constructor(){super(q.SECOND)}},Th=class extends an{constructor(){super(q.MILLISECOND)}},Ah=class extends an{constructor(){super(q.MICROSECOND)}},Ih=class extends an{constructor(){super(q.NANOSECOND)}},rr=class extends U{constructor(e){super(x.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};gP=Symbol.toStringTag;rr[gP]=(t=>(t.children=null,t[Symbol.toStringTag]="List"))(rr.prototype);ei=class extends U{constructor(e){super(x.LargeList),this.children=[e]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};yP=Symbol.toStringTag;ei[yP]=(t=>(t.children=null,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeList"))(ei.prototype);$e=class extends U{constructor(e){super(x.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};bP=Symbol.toStringTag;$e[bP]=(t=>(t.children=null,t[Symbol.toStringTag]="Struct"))($e.prototype);cn=class extends U{constructor(e,r,n){super(x.Union),this.mode=e,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(e=>`${e.type}`).join(" | ")}>`}};wP=Symbol.toStringTag;cn[wP]=(t=>(t.mode=null,t.typeIds=null,t.children=null,t.typeIdToChildIndex=null,t.ArrayType=Int8Array,t[Symbol.toStringTag]="Union"))(cn.prototype);ss=class extends cn{constructor(e,r){super(Qe.Dense,e,r)}},ba=class extends cn{constructor(e,r){super(Qe.Sparse,e,r)}},In=class extends U{constructor(e){super(x.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};xP=Symbol.toStringTag;In[xP]=(t=>(t.byteWidth=null,t.ArrayType=Uint8Array,t[Symbol.toStringTag]="FixedSizeBinary"))(In.prototype);Ht=class extends U{constructor(e,r){super(x.FixedSizeList),this.listSize=e,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}>`}};_P=Symbol.toStringTag;Ht[_P]=(t=>(t.children=null,t.listSize=null,t[Symbol.toStringTag]="FixedSizeList"))(Ht.prototype);jr=class extends U{constructor(e,r=!1){var n,i,o;if(super(x.Map),this.children=[e],this.keysSorted=r,e&&(e.name="entries",!((n=e==null?void 0:e.type)===null||n===void 0)&&n.children)){let s=(i=e==null?void 0:e.type)===null||i===void 0?void 0:i.children[0];s&&(s.name="key");let a=(o=e==null?void 0:e.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(e=>`${e.name}:${e.type}`).join(", ")}}>`}};SP=Symbol.toStringTag;jr[SP]=(t=>(t.children=null,t.keysSorted=null,t[Symbol.toStringTag]="Map_"))(jr.prototype);cH=(t=>()=>++t)(-1),nr=class extends U{constructor(e,r,n,i){super(x.Dictionary),this.indices=r,this.dictionary=e,this.isOrdered=i||!1,this.id=n==null?cH():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}>`}};MP=Symbol.toStringTag;nr[MP]=(t=>(t.id=null,t.indices=null,t.isOrdered=null,t.dictionary=null,t[Symbol.toStringTag]="Dictionary"))(nr.prototype)});function lH(t,e,r=!0){return typeof e=="number"?vu(t,e,r):typeof e=="string"&&e in x?vu(t,x[e],r):e&&e instanceof U?vu(t,TP(e),r):e!=null&&e.type&&e.type instanceof U?vu(t,TP(e.type),r):vu(t,x.NONE,r)}function vu(t,e,r=!0){let n=null;switch(e){case x.Null:n=t.visitNull;break;case x.Bool:n=t.visitBool;break;case x.Int:n=t.visitInt;break;case x.Int8:n=t.visitInt8||t.visitInt;break;case x.Int16:n=t.visitInt16||t.visitInt;break;case x.Int32:n=t.visitInt32||t.visitInt;break;case x.Int64:n=t.visitInt64||t.visitInt;break;case x.Uint8:n=t.visitUint8||t.visitInt;break;case x.Uint16:n=t.visitUint16||t.visitInt;break;case x.Uint32:n=t.visitUint32||t.visitInt;break;case x.Uint64:n=t.visitUint64||t.visitInt;break;case x.Float:n=t.visitFloat;break;case x.Float16:n=t.visitFloat16||t.visitFloat;break;case x.Float32:n=t.visitFloat32||t.visitFloat;break;case x.Float64:n=t.visitFloat64||t.visitFloat;break;case x.Utf8:n=t.visitUtf8;break;case x.LargeUtf8:n=t.visitLargeUtf8;break;case x.Utf8View:n=t.visitUtf8View||t.visitUtf8;break;case x.Binary:n=t.visitBinary;break;case x.LargeBinary:n=t.visitLargeBinary;break;case x.BinaryView:n=t.visitBinaryView||t.visitBinary;break;case x.FixedSizeBinary:n=t.visitFixedSizeBinary;break;case x.Date:n=t.visitDate;break;case x.DateDay:n=t.visitDateDay||t.visitDate;break;case x.DateMillisecond:n=t.visitDateMillisecond||t.visitDate;break;case x.Timestamp:n=t.visitTimestamp;break;case x.TimestampSecond:n=t.visitTimestampSecond||t.visitTimestamp;break;case x.TimestampMillisecond:n=t.visitTimestampMillisecond||t.visitTimestamp;break;case x.TimestampMicrosecond:n=t.visitTimestampMicrosecond||t.visitTimestamp;break;case x.TimestampNanosecond:n=t.visitTimestampNanosecond||t.visitTimestamp;break;case x.Time:n=t.visitTime;break;case x.TimeSecond:n=t.visitTimeSecond||t.visitTime;break;case x.TimeMillisecond:n=t.visitTimeMillisecond||t.visitTime;break;case x.TimeMicrosecond:n=t.visitTimeMicrosecond||t.visitTime;break;case x.TimeNanosecond:n=t.visitTimeNanosecond||t.visitTime;break;case x.Decimal:n=t.visitDecimal;break;case x.List:n=t.visitList;break;case x.LargeList:n=t.visitLargeList;break;case x.Struct:n=t.visitStruct;break;case x.Union:n=t.visitUnion;break;case x.DenseUnion:n=t.visitDenseUnion||t.visitUnion;break;case x.SparseUnion:n=t.visitSparseUnion||t.visitUnion;break;case x.Dictionary:n=t.visitDictionary;break;case x.Interval:n=t.visitInterval;break;case x.IntervalDayTime:n=t.visitIntervalDayTime||t.visitInterval;break;case x.IntervalYearMonth:n=t.visitIntervalYearMonth||t.visitInterval;break;case x.IntervalMonthDayNano:n=t.visitIntervalMonthDayNano||t.visitInterval;break;case x.Duration:n=t.visitDuration;break;case x.DurationSecond:n=t.visitDurationSecond||t.visitDuration;break;case x.DurationMillisecond:n=t.visitDurationMillisecond||t.visitDuration;break;case x.DurationMicrosecond:n=t.visitDurationMicrosecond||t.visitDuration;break;case x.DurationNanosecond:n=t.visitDurationNanosecond||t.visitDuration;break;case x.FixedSizeList:n=t.visitFixedSizeList;break;case x.Map:n=t.visitMap;break}if(typeof n=="function")return n;if(!r)return()=>null;throw new Error(`Unrecognized type '${x[e]}'`)}function TP(t){switch(t.typeId){case x.Null:return x.Null;case x.Int:{let{bitWidth:e,isSigned:r}=t;switch(e){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(t.precision){case Xe.HALF:return x.Float16;case Xe.SINGLE:return x.Float32;case Xe.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(t.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(t.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(t.unit){case st.DAY:return x.DateDay;case st.MILLISECOND:return x.DateMillisecond}return x.Date;case x.Interval:switch(t.unit){case Ge.DAY_TIME:return x.IntervalDayTime;case Ge.YEAR_MONTH:return x.IntervalYearMonth;case Ge.MONTH_DAY_NANO:return x.IntervalMonthDayNano}return x.Interval;case x.Duration:switch(t.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(t.mode){case Qe.Dense:return x.DenseUnion;case Qe.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[t.typeId]}'`)}var ie,Pn=p(()=>{Nt();at();ie=class{visitMany(e,...r){return e.map((n,i)=>this.visit(n,...r.map(o=>o[i])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,r=!0){return lH(this,e,r)}getVisitFnByTypeId(e,r=!0){return vu(this,e,r)}visitNull(e,...r){return null}visitBool(e,...r){return null}visitInt(e,...r){return null}visitFloat(e,...r){return null}visitUtf8(e,...r){return null}visitLargeUtf8(e,...r){return null}visitUtf8View(e,...r){return null}visitBinary(e,...r){return null}visitLargeBinary(e,...r){return null}visitBinaryView(e,...r){return null}visitFixedSizeBinary(e,...r){return null}visitDate(e,...r){return null}visitTimestamp(e,...r){return null}visitTime(e,...r){return null}visitDecimal(e,...r){return null}visitList(e,...r){return null}visitLargeList(e,...r){return null}visitStruct(e,...r){return null}visitUnion(e,...r){return null}visitDictionary(e,...r){return null}visitInterval(e,...r){return null}visitDuration(e,...r){return null}visitFixedSizeList(e,...r){return null}visitMap(e,...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 fw={};Qt(fw,{float64ToUint16:()=>Ph,uint16ToFloat64:()=>Kp});function Kp(t){let e=(t&31744)>>10,r=(t&1023)/1024,n=Math.pow(-1,(t&32768)>>15);switch(e){case 31:return n*(r?Number.NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*Math.pow(2,e-15)*(1+r)}function Ph(t){if(t!==t)return 32256;AP[0]=t;let e=(Eu[1]&2147483648)>>16&65535,r=Eu[1]&2146435072,n=0;return r>=1089470464?Eu[0]>0?r=31744:(r=(r&2080374784)>>16,n=(Eu[1]&1048575)>>10):r<=1056964608?(n=1048576+(Eu[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(Eu[1]&1048575)+512>>10),e|r|n&65535}var AP,Eu,Rh=p(()=>{AP=new Float64Array(1),Eu=new Uint32Array(AP.buffer)});function be(t){return(e,r,n)=>{if(e.setValid(r,n!=null))return t(e,r,n)}}var de,uH,IP,fH,as,hw,PP,hH,Xp,Yp,dw,RP,dH,LP,mH,OP,pH,mw,Zp,Jp,Qp,e0,pw,t0,r0,n0,i0,gw,yw,BP,gH,yH,bH,wH,xH,_H,SH,CP,DP,MH,bw,o0,s0,a0,c0,l0,u0,f0,ww,vH,Lr,ri=p(()=>{zr();Pn();So();es();Rh();Nt();at();de=class extends ie{};uH=(t,e,r)=>{t[e]=Math.floor(r/864e5)},IP=(t,e,r,n)=>{if(r+1<e.length){let i=Le(e[r]),o=Le(e[r+1]);t.set(n.subarray(0,o-i),i)}},fH=({offset:t,values:e},r,n)=>{let i=t+r;n?e[i>>3]|=1<<i%8:e[i>>3]&=~(1<<i%8)},as=({values:t},e,r)=>{t[e]=r},hw=({values:t},e,r)=>{t[e]=r},PP=({values:t},e,r)=>{t[e]=Ph(r)},hH=(t,e,r)=>{switch(t.type.precision){case Xe.HALF:return PP(t,e,r);case Xe.SINGLE:case Xe.DOUBLE:return hw(t,e,r)}},Xp=({values:t},e,r)=>{uH(t,e,r.valueOf())},Yp=({values:t},e,r)=>{t[e]=BigInt(r)},dw=({stride:t,values:e},r,n)=>{e.set(n.subarray(0,t),t*r)},RP=({values:t,valueOffsets:e},r,n)=>IP(t,e,r,n),dH=t=>{let e=t.variadicBuffers;return(!Array.isArray(e)||Object.isFrozen(e))&&(e=Array.from(e),t.variadicBuffers=e),e},LP=(t,e,r)=>{var n,i,o,s;let a=t.values;if(!a)throw new Error("BinaryView data is missing view buffer");let c=Ee.ELEMENT_WIDTH,l=e*c,u=l+c;if(l<0||u>a.length)throw new RangeError(`BinaryView index ${e} 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=dH(t),y=r.slice(),b=g.push(y)-1;h.setInt32(Ee.BUFFER_INDEX_OFFSET,b,!0),h.setInt32(Ee.BUFFER_OFFSET_OFFSET,0,!0)},mH=(t,e,r)=>{let n=r instanceof Uint8Array?r:new Uint8Array(r);LP(t,e,n)},OP=({values:t,valueOffsets:e},r,n)=>IP(t,e,r,qn(n)),pH=(t,e,r)=>{let n=qn(r);LP(t,e,n)},mw=(t,e,r)=>{t.type.unit===st.DAY?Xp(t,e,r):Yp(t,e,r)},Zp=({values:t},e,r)=>{t[e]=BigInt(r/1e3)},Jp=({values:t},e,r)=>{t[e]=BigInt(r)},Qp=({values:t},e,r)=>{t[e]=BigInt(r*1e3)},e0=({values:t},e,r)=>{t[e]=BigInt(r*1e6)},pw=(t,e,r)=>{switch(t.type.unit){case q.SECOND:return Zp(t,e,r);case q.MILLISECOND:return Jp(t,e,r);case q.MICROSECOND:return Qp(t,e,r);case q.NANOSECOND:return e0(t,e,r)}},t0=({values:t},e,r)=>{t[e]=r},r0=({values:t},e,r)=>{t[e]=r},n0=({values:t},e,r)=>{t[e]=r},i0=({values:t},e,r)=>{t[e]=r},gw=(t,e,r)=>{switch(t.type.unit){case q.SECOND:return t0(t,e,r);case q.MILLISECOND:return r0(t,e,r);case q.MICROSECOND:return n0(t,e,r);case q.NANOSECOND:return i0(t,e,r)}},yw=({values:t,stride:e},r,n)=>{t.set(n.subarray(0,e),e*r)},BP=(t,e,r)=>{let n=t.children[0],i=t.valueOffsets,o=Lr.getVisitFn(n),s=Le(i[e]),a=Le(i[e+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))},gH=(t,e,r)=>{let n=t.children[0],{valueOffsets:i}=t,o=Lr.getVisitFn(n),{[e]:s,[e+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},yH=(t,e)=>(r,n,i,o)=>n&&r(n,t,e[o]),bH=(t,e)=>(r,n,i,o)=>n&&r(n,t,e.get(o)),wH=(t,e)=>(r,n,i,o)=>n&&r(n,t,e.get(i.name)),xH=(t,e)=>(r,n,i,o)=>n&&r(n,t,e[i.name]),_H=(t,e,r)=>{let n=t.type.children.map(o=>Lr.getVisitFn(o.type)),i=r instanceof Map?wH(e,r):r instanceof H?bH(e,r):Array.isArray(r)?yH(e,r):xH(e,r);t.type.children.forEach((o,s)=>i(n[s],t.children[s],o,s))},SH=(t,e,r)=>{t.type.mode===Qe.Dense?CP(t,e,r):DP(t,e,r)},CP=(t,e,r)=>{let n=t.type.typeIdToChildIndex[t.typeIds[e]],i=t.children[n];Lr.visit(i,t.valueOffsets[e],r)},DP=(t,e,r)=>{let n=t.type.typeIdToChildIndex[t.typeIds[e]],i=t.children[n];Lr.visit(i,e,r)},MH=(t,e,r)=>{var n;(n=t.dictionary)===null||n===void 0||n.set(t.values[e],r)},bw=(t,e,r)=>{switch(t.type.unit){case Ge.YEAR_MONTH:return s0(t,e,r);case Ge.DAY_TIME:return o0(t,e,r);case Ge.MONTH_DAY_NANO:return a0(t,e,r)}},o0=({values:t},e,r)=>{t.set(r.subarray(0,2),2*e)},s0=({values:t},e,r)=>{t[e]=r[0]*12+r[1]%12},a0=({values:t,stride:e},r,n)=>{t.set(n.subarray(0,e),e*r)},c0=({values:t},e,r)=>{t[e]=r},l0=({values:t},e,r)=>{t[e]=r},u0=({values:t},e,r)=>{t[e]=r},f0=({values:t},e,r)=>{t[e]=r},ww=(t,e,r)=>{switch(t.type.unit){case q.SECOND:return c0(t,e,r);case q.MILLISECOND:return l0(t,e,r);case q.MICROSECOND:return u0(t,e,r);case q.NANOSECOND:return f0(t,e,r)}},vH=(t,e,r)=>{let{stride:n}=t,i=t.children[0],o=Lr.getVisitFn(i);if(Array.isArray(r))for(let s=-1,a=e*n;++s<n;)o(i,a+s,r[s]);else for(let s=-1,a=e*n;++s<n;)o(i,a+s,r.get(s))};de.prototype.visitBool=be(fH);de.prototype.visitInt=be(as);de.prototype.visitInt8=be(as);de.prototype.visitInt16=be(as);de.prototype.visitInt32=be(as);de.prototype.visitInt64=be(as);de.prototype.visitUint8=be(as);de.prototype.visitUint16=be(as);de.prototype.visitUint32=be(as);de.prototype.visitUint64=be(as);de.prototype.visitFloat=be(hH);de.prototype.visitFloat16=be(PP);de.prototype.visitFloat32=be(hw);de.prototype.visitFloat64=be(hw);de.prototype.visitUtf8=be(OP);de.prototype.visitLargeUtf8=be(OP);de.prototype.visitUtf8View=be(pH);de.prototype.visitBinary=be(RP);de.prototype.visitLargeBinary=be(RP);de.prototype.visitBinaryView=be(mH);de.prototype.visitFixedSizeBinary=be(dw);de.prototype.visitDate=be(mw);de.prototype.visitDateDay=be(Xp);de.prototype.visitDateMillisecond=be(Yp);de.prototype.visitTimestamp=be(pw);de.prototype.visitTimestampSecond=be(Zp);de.prototype.visitTimestampMillisecond=be(Jp);de.prototype.visitTimestampMicrosecond=be(Qp);de.prototype.visitTimestampNanosecond=be(e0);de.prototype.visitTime=be(gw);de.prototype.visitTimeSecond=be(t0);de.prototype.visitTimeMillisecond=be(r0);de.prototype.visitTimeMicrosecond=be(n0);de.prototype.visitTimeNanosecond=be(i0);de.prototype.visitDecimal=be(yw);de.prototype.visitList=be(BP);de.prototype.visitLargeList=be(BP);de.prototype.visitStruct=be(_H);de.prototype.visitUnion=be(SH);de.prototype.visitDenseUnion=be(CP);de.prototype.visitSparseUnion=be(DP);de.prototype.visitDictionary=be(MH);de.prototype.visitInterval=be(bw);de.prototype.visitIntervalDayTime=be(o0);de.prototype.visitIntervalYearMonth=be(s0);de.prototype.visitIntervalMonthDayNano=be(a0);de.prototype.visitDuration=be(ww);de.prototype.visitDurationSecond=be(c0);de.prototype.visitDurationMillisecond=be(l0);de.prototype.visitDurationMicrosecond=be(u0);de.prototype.visitDurationNanosecond=be(f0);de.prototype.visitFixedSizeList=be(vH);de.prototype.visitMap=be(gH);Lr=new de});var Hi,Tu,vo,xw,_w,EH,h0=p(()=>{Sh();Ac();ri();Hi=Symbol.for("parent"),Tu=Symbol.for("rowIndex"),vo=class{constructor(e,r){return this[Hi]=e,this[Tu]=r,new Proxy(this,EH)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Tu],r=this[Hi],n=r.type.children,i={};for(let o=-1,s=n.length;++o<s;)i[n[o].name]=ir.visit(r.children[o],e);return i}toString(){return`{${[...this].map(([e,r])=>`${ji(e)}: ${ji(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new xw(this[Hi],this[Tu])}},xw=class{constructor(e,r){this.childIndex=0,this.children=e.children,this.rowIndex=r,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,ir.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(vo.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Hi]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Tu]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});_w=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Hi].type.children.map(r=>r.name)}has(e,r){return e[Hi].type.children.some(n=>n.name===r)}getOwnPropertyDescriptor(e,r){if(e[Hi].type.children.some(n=>n.name===r))return{writable:!0,enumerable:!0,configurable:!0}}get(e,r){if(Reflect.has(e,r))return e[r];let n=e[Hi].type.children.findIndex(i=>i.name===r);if(n!==-1){let i=ir.visit(e[Hi].children[n],e[Tu]);return Reflect.set(e,r,i),i}}set(e,r,n){let i=e[Hi].type.children.findIndex(o=>o.name===r);return i!==-1?(Lr.visit(e[Hi].children[i],e[Tu],n),Reflect.set(e,r,n)):Reflect.has(e,r)||typeof r=="symbol"?Reflect.set(e,r,n):!1}},EH=new _w});function ge(t){return(e,r)=>e.getValid(r)?t(e,r):null}var le,TH,Au,AH,IH,NP,PH,FP,kP,wa,RH,GP,LH,UP,jP,OH,zP,BH,CH,DH,NH,qP,VP,WP,$P,FH,HP,KP,XP,YP,kH,GH,ZP,UH,jH,zH,JP,QP,qH,VH,eR,tR,rR,nR,iR,oR,sR,WH,$H,ir,Ac=p(()=>{Hp();zr();Pn();Lh();h0();So();es();Rh();Nt();le=class extends ie{};TH=(t,e)=>864e5*t[e],Au=16,AH=12,IH=(t,e)=>null,NP=(t,e,r)=>{if(r+1>=e.length)return null;let n=Le(e[r]),i=Le(e[r+1]);return t.subarray(n,i)},PH=({offset:t,values:e},r)=>{let n=t+r;return(e[n>>3]&1<<n%8)!==0},FP=({values:t},e)=>TH(t,e),kP=({values:t},e)=>Le(t[e]),wa=({stride:t,values:e},r)=>e[t*r],RH=({stride:t,values:e},r)=>Kp(e[t*r]),GP=({values:t},e)=>t[e],LH=({stride:t,values:e},r)=>e.subarray(t*r,t*(r+1)),UP=({values:t,valueOffsets:e},r)=>NP(t,e,r),jP=(t,e)=>{var r;let n=t.values;if(!n)throw new Error("BinaryView data is missing view buffer");let i=e*Au,o=i+Au;if(i<0||o>n.length)throw new Error(`BinaryView data buffer is too short: expected ${Au} bytes, got ${Math.max(0,n.length-i)}`);let s=n.subarray(i,o);if(s.length<Au)throw new Error(`BinaryView data buffer is too short: expected ${Au} bytes, got ${s.length}`);let a=new DataView(n.buffer,s.byteOffset,Au),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=AH)return s.subarray(4,4+c);let l=a.getInt32(8,!0),u=a.getInt32(12,!0),h=(r=t.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)},OH=(t,e)=>jP(t,e),zP=({values:t,valueOffsets:e},r)=>{let n=NP(t,e,r);return n!==null?pu(n):null},BH=(t,e)=>{let r=jP(t,e);return pu(r)},CH=({values:t},e)=>t[e],DH=({type:t,values:e},r)=>t.precision!==Xe.HALF?e[r]:Kp(e[r]),NH=(t,e)=>t.type.unit===st.DAY?FP(t,e):kP(t,e),qP=({values:t},e)=>1e3*Le(t[e]),VP=({values:t},e)=>Le(t[e]),WP=({values:t},e)=>aw(t[e],BigInt(1e3)),$P=({values:t},e)=>aw(t[e],BigInt(1e6)),FH=(t,e)=>{switch(t.type.unit){case q.SECOND:return qP(t,e);case q.MILLISECOND:return VP(t,e);case q.MICROSECOND:return WP(t,e);case q.NANOSECOND:return $P(t,e)}},HP=({values:t},e)=>t[e],KP=({values:t},e)=>t[e],XP=({values:t},e)=>t[e],YP=({values:t},e)=>t[e],kH=(t,e)=>{switch(t.type.unit){case q.SECOND:return HP(t,e);case q.MILLISECOND:return KP(t,e);case q.MICROSECOND:return XP(t,e);case q.NANOSECOND:return YP(t,e)}},GH=({values:t,stride:e},r)=>Tc.decimal(t.subarray(e*r,e*(r+1))),ZP=(t,e)=>{let{valueOffsets:r,stride:n,children:i}=t,o=Le(r[e*n]),s=Le(r[e*n+1]),c=i[0].slice(o,s-o);return new H([c])},UH=(t,e)=>{let{valueOffsets:r,children:n}=t,{[e]:i,[e+1]:o}=r,s=n[0];return new xi(s.slice(i,o-i))},jH=(t,e)=>new vo(t,e),zH=(t,e)=>t.type.mode===Qe.Dense?JP(t,e):QP(t,e),JP=(t,e)=>{let r=t.type.typeIdToChildIndex[t.typeIds[e]],n=t.children[r];return ir.visit(n,t.valueOffsets[e])},QP=(t,e)=>{let r=t.type.typeIdToChildIndex[t.typeIds[e]],n=t.children[r];return ir.visit(n,e)},qH=(t,e)=>{var r;return(r=t.dictionary)===null||r===void 0?void 0:r.get(t.values[e])},VH=(t,e)=>t.type.unit===Ge.MONTH_DAY_NANO?rR(t,e):t.type.unit===Ge.DAY_TIME?eR(t,e):tR(t,e),eR=({values:t},e)=>t.subarray(2*e,2*(e+1)),tR=({values:t},e)=>{let r=t[e],n=new Int32Array(2);return n[0]=Math.trunc(r/12),n[1]=Math.trunc(r%12),n},rR=({values:t},e)=>t.subarray(4*e,4*(e+1)),nR=({values:t},e)=>t[e],iR=({values:t},e)=>t[e],oR=({values:t},e)=>t[e],sR=({values:t},e)=>t[e],WH=(t,e)=>{switch(t.type.unit){case q.SECOND:return nR(t,e);case q.MILLISECOND:return iR(t,e);case q.MICROSECOND:return oR(t,e);case q.NANOSECOND:return sR(t,e)}},$H=(t,e)=>{let{stride:r,children:n}=t,o=n[0].slice(e*r,r);return new H([o])};le.prototype.visitNull=ge(IH);le.prototype.visitBool=ge(PH);le.prototype.visitInt=ge(CH);le.prototype.visitInt8=ge(wa);le.prototype.visitInt16=ge(wa);le.prototype.visitInt32=ge(wa);le.prototype.visitInt64=ge(GP);le.prototype.visitUint8=ge(wa);le.prototype.visitUint16=ge(wa);le.prototype.visitUint32=ge(wa);le.prototype.visitUint64=ge(GP);le.prototype.visitFloat=ge(DH);le.prototype.visitFloat16=ge(RH);le.prototype.visitFloat32=ge(wa);le.prototype.visitFloat64=ge(wa);le.prototype.visitUtf8=ge(zP);le.prototype.visitLargeUtf8=ge(zP);le.prototype.visitUtf8View=ge(BH);le.prototype.visitBinary=ge(UP);le.prototype.visitLargeBinary=ge(UP);le.prototype.visitBinaryView=ge(OH);le.prototype.visitFixedSizeBinary=ge(LH);le.prototype.visitDate=ge(NH);le.prototype.visitDateDay=ge(FP);le.prototype.visitDateMillisecond=ge(kP);le.prototype.visitTimestamp=ge(FH);le.prototype.visitTimestampSecond=ge(qP);le.prototype.visitTimestampMillisecond=ge(VP);le.prototype.visitTimestampMicrosecond=ge(WP);le.prototype.visitTimestampNanosecond=ge($P);le.prototype.visitTime=ge(kH);le.prototype.visitTimeSecond=ge(HP);le.prototype.visitTimeMillisecond=ge(KP);le.prototype.visitTimeMicrosecond=ge(XP);le.prototype.visitTimeNanosecond=ge(YP);le.prototype.visitDecimal=ge(GH);le.prototype.visitList=ge(ZP);le.prototype.visitLargeList=ge(ZP);le.prototype.visitStruct=ge(jH);le.prototype.visitUnion=ge(zH);le.prototype.visitDenseUnion=ge(JP);le.prototype.visitSparseUnion=ge(QP);le.prototype.visitDictionary=ge(qH);le.prototype.visitInterval=ge(VH);le.prototype.visitIntervalDayTime=ge(eR);le.prototype.visitIntervalYearMonth=ge(tR);le.prototype.visitIntervalMonthDayNano=ge(rR);le.prototype.visitDuration=ge(WH);le.prototype.visitDurationSecond=ge(nR);le.prototype.visitDurationMillisecond=ge(iR);le.prototype.visitDurationMicrosecond=ge(oR);le.prototype.visitDurationNanosecond=ge(sR);le.prototype.visitFixedSizeList=ge($H);le.prototype.visitMap=ge(UH);ir=new le});var xa,Pu,Iu,Sw,xi,Mw,vw,Lh=p(()=>{zr();Sh();Ac();ri();xa=Symbol.for("keys"),Pu=Symbol.for("vals"),Iu=Symbol.for("kKeysAsStrings"),Sw=Symbol.for("_kKeysAsStrings"),xi=class{constructor(e){return this[xa]=new H([e.children[0]]).memoize(),this[Pu]=e.children[1],new Proxy(this,new vw)}get[Iu](){return this[Sw]||(this[Sw]=Array.from(this[xa].toArray(),String))}[Symbol.iterator](){return new Mw(this[xa],this[Pu])}get size(){return this[xa].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[xa],r=this[Pu],n={};for(let i=-1,o=e.length;++i<o;)n[e.get(i)]=ir.visit(r,i);return n}toString(){return`{${[...this].map(([e,r])=>`${ji(e)}: ${ji(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Mw=class{constructor(e,r){this.keys=e,this.vals=r,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),ir.visit(this.vals,e)]})}},vw=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Iu]}has(e,r){return e[Iu].includes(r)}getOwnPropertyDescriptor(e,r){if(e[Iu].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,r){if(Reflect.has(e,r))return e[r];let n=e[Iu].indexOf(r);if(n!==-1){let i=ir.visit(Reflect.get(e,Pu),n);return Reflect.set(e,r,i),i}}set(e,r,n){let i=e[Iu].indexOf(r);return i!==-1?(Lr.visit(Reflect.get(e,Pu),i,n),Reflect.set(e,r,n)):Reflect.has(e,r)?Reflect.set(e,r,n):!1}};Object.defineProperties(xi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[xa]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Pu]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Sw]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var Ew={};Qt(Ew,{clampRange:()=>Oh,createElementComparator:()=>_a,wrapIndex:()=>Ic});function Oh(t,e,r,n){let{length:i=0}=t,o=typeof e!="number"?0:e,s=typeof r!="number"?i:r;return o<0&&(o=(o%i+i)%i),s<0&&(s=(s%i+i)%i),s<o&&(aR=o,o=s,s=aR),s>i&&(s=i),n?n(t,o,s):[o,s]}function _a(t){if(typeof t!=="object"||t===null)return cR(t)?cR:r=>r===t;if(t instanceof Date){let r=t.valueOf();return n=>n instanceof Date?n.valueOf()===r:!1}return ArrayBuffer.isView(t)?r=>r?Ab(t,r):!1:t instanceof Map?KH(t):Array.isArray(t)?HH(t):t instanceof H?XH(t):YH(t,!0)}function HH(t){let e=[];for(let r=-1,n=t.length;++r<n;)e[r]=_a(t[r]);return d0(e)}function KH(t){let e=-1,r=[];for(let n of t.values())r[++e]=_a(n);return d0(r)}function XH(t){let e=[];for(let r=-1,n=t.length;++r<n;)e[r]=_a(t.get(r));return d0(e)}function YH(t,e=!1){let r=Object.keys(t);if(!e&&r.length===0)return()=>!1;let n=[];for(let i=-1,o=r.length;++i<o;)n[i]=_a(t[r[i]]);return d0(n,r)}function d0(t,e){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return ZH(t,r);case Map:return lR(t,r,r.keys());case xi:case vo:case Object:case void 0:return lR(t,r,e||Object.keys(r))}return r instanceof H?JH(t,r):!1}}function ZH(t,e){let r=t.length;if(e.length!==r)return!1;for(let n=-1;++n<r;)if(!t[n](e[n]))return!1;return!0}function JH(t,e){let r=t.length;if(e.length!==r)return!1;for(let n=-1;++n<r;)if(!t[n](e.get(n)))return!1;return!0}function lR(t,e,r){let n=r[Symbol.iterator](),i=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),o=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),s=0,a=t.length,c=o.next(),l=n.next(),u=i.next();for(;s<a&&!l.done&&!u.done&&!c.done&&!(l.value!==u.value||!t[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 aR,Ic,cR,Ru=p(()=>{zr();Lh();h0();dr();Ic=(t,e)=>t<0?e+t:t,cR=t=>t!==t});var Tw={};Qt(Tw,{BitIterator:()=>Eo,getBit:()=>p0,getBool:()=>Lu,packBools:()=>Rc,popcnt_array:()=>uR,popcnt_bit_range:()=>Bh,popcnt_uint32:()=>m0,setBool:()=>QH,truncateBitmap:()=>Pc});function Lu(t,e,r,n){return(r&1<<n)!==0}function p0(t,e,r,n){return(r&1<<n)>>n}function QH(t,e,r){return r?!!(t[e>>3]|=1<<e%8)||!0:!(t[e>>3]&=~(1<<e%8))&&!1}function Pc(t,e,r){let n=r.byteLength+7&-8;if(t>0||r.byteLength<n){let i=new Uint8Array(n);return i.set(t%8===0?r.subarray(t>>3):Rc(new Eo(r,t,e,null,Lu)).subarray(0,n)),i}return r}function Rc(t){let e=[],r=0,n=0,i=0;for(let s of t)s&&(i|=1<<n),++n===8&&(e[r++]=i,i=n=0);(r===0||n>0)&&(e[r++]=i);let o=new Uint8Array(e.length+7&-8);return o.set(e),o}function Bh(t,e,r){if(r-e<=0)return 0;if(r-e<8){let o=0;for(let s of new Eo(t,e,r-e,t,p0))o+=s;return o}let n=r>>3<<3,i=e+(e%8===0?0:8-e%8);return Bh(t,e,i)+Bh(t,n,r)+uR(t,i>>3,n-i>>3)}function uR(t,e,r){let n=0,i=Math.trunc(e),o=new DataView(t.buffer,t.byteOffset,t.byteLength),s=r===void 0?t.byteLength:i+r;for(;s-i>=4;)n+=m0(o.getUint32(i)),i+=4;for(;s-i>=2;)n+=m0(o.getUint16(i)),i+=2;for(;s-i>=1;)n+=m0(o.getUint8(i)),i+=1;return n}function m0(t){let e=Math.trunc(t);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var Eo,Lc=p(()=>{Eo=class{constructor(e,r,n,i,o){this.bytes=e,this.length=n,this.context=i,this.get=o,this.bit=r%8,this.byteIndex=r>>3,this.byte=e[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(t){return tK.visit(t)}var eK,fR,ce,Aw,tK,_i=p(()=>{zr();Nt();at();Lc();at();Pn();dr();eK=-1,fR=Symbol.for("apache-arrow/Data"),ce=class t{static isData(e){return(e==null?void 0:e[fR])===!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:e}=this;return U.isSparseUnion(e)?this.children.some(r=>r.nullable):U.isDenseUnion(e)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:r,values:n,nullBitmap:i,typeIds:o}=this;return r&&(e+=r.byteLength),n&&(e+=n.byteLength),i&&(e+=i.byteLength),o&&(e+=o.byteLength),e+=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,e)}get nullCount(){if(U.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let e=this._nullCount,r;return e<=eK&&(r=this.nullBitmap)&&(this._nullCount=e=r.length===0?0:this.length-Bh(r,this.offset,this.offset+this.length)),e}constructor(e,r,n,i,o,s=[],a,c=[]){var l;this.type=e,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 t?(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(e),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(e){let{type:r}=this;if(U.isUnion(r)){let n=r,i=this.typeIds[e],o=n.typeIdToChildIndex[i],s=this.children[o],a=this.valueOffsets,c=n.mode===Qe.Dense&&a?Number(a[e]):e;return s.getValid(c)}if(this.nullable&&this.nullCount>0){let n=this.offset+e;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(e,r){let n,{type:i}=this;if(U.isUnion(i)){let o=i,s=this.typeIds[e],a=o.typeIdToChildIndex[s],c=this.children[a],l=this.valueOffsets,u=o.mode===Qe.Dense&&l?Number(l[e]):e;n=c.getValid(u),c.setValid(u,r)}else{let{nullBitmap:o}=this,{offset:s,length:a}=this,c=s+e,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(Pc(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(e=this.type,r=this.offset,n=this.length,i=this._nullCount,o=this,s=this.children,a=this.variadicBuffers){return new t(e,r,n,i,o,s,this.dictionary,a)}slice(e,r){let{stride:n,typeId:i,children:o}=this,s=+(this._nullCount===0)-1,a=i===16?n:1,c=this._sliceBuffers(e,r,n,i);return this.clone(this.type,this.offset+e,r,s,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*e,a*r),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===x.Null)return this.clone(this.type,0,e,0,this.buffers,this.children,this.variadicBuffers);let{length:r,nullCount:n}=this,i=new Uint8Array((e+63&-64)>>3).fill(255,0,r>>3);i[r>>3]=(1<<r-(r&-8))-1,n>0&&i.set(Pc(this.offset,r,this.nullBitmap),0);let o=this.buffers;return o[Ne.VALIDITY]=i,this.clone(this.type,0,e,n+(e-r),o,this.children,this.variadicBuffers)}_sliceBuffers(e,r,n,i){let o,{buffers:s}=this;if((o=s[Ne.TYPE])&&(s[Ne.TYPE]=o.subarray(e,e+r)),U.isBinaryView(this.type)||U.isUtf8View(this.type)){let a=Ee.ELEMENT_WIDTH;(o=s[Ne.DATA])&&(s[Ne.DATA]=o.subarray(e*a,(e+r)*a))}else(o=s[Ne.OFFSET])&&(s[Ne.OFFSET]=o.subarray(e,e+r+1))||(o=s[Ne.DATA])&&(s[Ne.DATA]=i===6?o:o.subarray(n*e,n*(e+r)));return s}_sliceChildren(e,r,n){return e.map(i=>i.slice(r,n))}};ce.prototype.children=Object.freeze([]);ce.prototype[fR]=!0;Object.defineProperty(ce,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===ce&&ce.isData(e)}});Aw=class t extends ie{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:r,["offset"]:n=0,["length"]:i=0}=e;return new ce(r,n,i,i)}visitBool(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length>>3,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new ce(r,n,s,a,[void 0,o,i])}visitInt(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new ce(r,n,s,a,[void 0,o,i])}visitFloat(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new ce(r,n,s,a,[void 0,o,i])}visitUtf8(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.data),o=se(e.nullBitmap),s=vc(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(r,n,a,c,[s,i,o])}visitUtf8View(e){var r;let{["type"]:n,["offset"]:i=0}=e,o=Re(n.ArrayType,e.views),s=se(e.nullBitmap),a=(e.variadicBuffers||[]).map(u=>se(u)),c=(r=e.length)!==null&&r!==void 0?r:Math.trunc(o.length/on.ELEMENT_WIDTH),l=e.nullBitmap?-1:0;return new ce(n,i,c,l,[void 0,o,s],[],void 0,a)}visitLargeUtf8(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.data),o=se(e.nullBitmap),s=ch(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(r,n,a,c,[s,i,o])}visitBinary(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.data),o=se(e.nullBitmap),s=vc(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(r,n,a,c,[s,i,o])}visitBinaryView(e){var r;let{["type"]:n,["offset"]:i=0}=e,o=Re(n.ArrayType,e.views),s=se(e.nullBitmap),a=(e.variadicBuffers||[]).map(u=>se(u)),c=(r=e.length)!==null&&r!==void 0?r:Math.trunc(o.length/Ee.ELEMENT_WIDTH),l=e.nullBitmap?-1:0;return new ce(n,i,c,l,[void 0,o,s],[],void 0,a)}visitLargeBinary(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.data),o=se(e.nullBitmap),s=ch(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(r,n,a,c,[s,i,o])}visitFixedSizeBinary(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new ce(r,n,s,a,[void 0,o,i])}visitDate(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new ce(r,n,s,a,[void 0,o,i])}visitTimestamp(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new ce(r,n,s,a,[void 0,o,i])}visitTime(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new ce(r,n,s,a,[void 0,o,i])}visitDecimal(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new ce(r,n,s,a,[void 0,o,i])}visitList(e){let{["type"]:r,["offset"]:n=0,["child"]:i}=e,o=se(e.nullBitmap),s=vc(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(r,n,a,c,[s,void 0,o],[i])}visitLargeList(e){let{["type"]:r,["offset"]:n=0,["child"]:i}=e,o=se(e.nullBitmap),s=ch(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(r,n,a,c,[s,void 0,o],[i])}visitStruct(e){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=e,o=se(e.nullBitmap),{length:s=i.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=e.nullBitmap?-1:0}=e;return new ce(r,n,s,a,[void 0,void 0,o],i)}visitUnion(e){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=e,o=Re(r.ArrayType,e.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=e;if(U.isSparseUnion(r))return new ce(r,n,s,a,[void 0,void 0,void 0,o],i);let c=vc(e.valueOffsets);return new ce(r,n,s,a,[c,void 0,void 0,o],i)}visitDictionary(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.indices.ArrayType,e.data),{["dictionary"]:s=new H([new t().visit({type:r.dictionary})])}=e,{["length"]:a=o.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(r,n,a,c,[void 0,o,i],[],s)}visitInterval(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new ce(r,n,s,a,[void 0,o,i])}visitDuration(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new ce(r,n,s,a,[void 0,o,i])}visitFixedSizeList(e){let{["type"]:r,["offset"]:n=0,["child"]:i=new t().visit({type:r.valueType})}=e,o=se(e.nullBitmap),{["length"]:s=i.length/ti(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new ce(r,n,s,a,[void 0,void 0,o],[i])}visitMap(e){let{["type"]:r,["offset"]:n=0,["child"]:i=new t().visit({type:r.childType})}=e,o=se(e.nullBitmap),s=vc(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new ce(r,n,a,c,[s,void 0,o],[i])}},tK=new Aw});function hR(t){return t.some(e=>e.nullable)}function g0(t){return t.reduce((e,r)=>e+r.nullCount,0)}function y0(t){return t.reduce((e,r,n)=>(e[n+1]=e[n]+r.length,e),new Uint32Array(t.length+1))}function b0(t,e,r,n){let i=[];for(let o=-1,s=t.length;++o<s;){let a=t[o],c=e[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(t[0].slice(0,0)),i}function Iw(t,e,r,n){let i=0,o=0,s=e.length-1;do{if(i>=s-1)return r<e[s]?n(t,i,r-e[i]):null;o=i+Math.trunc((s-i)*.5),r<e[o]?s=o:i=o}while(i<s)}function Dh(t,e){return t.getValid(e)}function Ou(t){function e(r,n,i){return t(r[n],i)}return function(r){let n=this.data;return Iw(n,this._offsets,r,e)}}function w0(t){let e;function r(n,i,o){return t(n[i],o,e)}return function(n,i){let o=this.data;e=i;let s=Iw(o,this._offsets,n,r);return e=void 0,s}}function x0(t){let e;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=t(h,e,s)))return c+a;s=0,c+=h.length}return-1}return function(n,i){e=n;let o=this.data,s=typeof i!="number"?r(o,0,0):Iw(o,this._offsets,i,r);return e=void 0,s}}var Ch,_0=p(()=>{Ch=class{constructor(e=0,r){this.numChunks=e,this.getChunkIterator=r,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function rK(t,e){return e===null&&t.length>0?0:-1}function nK(t,e){let{nullBitmap:r}=t;if(!r||t.nullCount<=0)return-1;let n=0;for(let i of new Eo(r,t.offset+(e||0),t.length,r,Lu)){if(!i)return n;++n}return-1}function xe(t,e,r){if(e===void 0)return-1;if(e===null)switch(t.typeId){case x.Union:break;case x.Dictionary:break;default:return nK(t,r)}let n=ir.getVisitFn(t),i=_a(e);for(let o=(r||0)-1,s=t.length;++o<s;)if(i(n(t,o)))return o;return-1}function dR(t,e,r){let n=ir.getVisitFn(t),i=_a(e);for(let o=(r||0)-1,s=t.length;++o<s;)if(i(n(t,o)))return o;return-1}var ue,Oc,S0=p(()=>{Nt();Pn();Ac();Lc();Ru();ue=class extends ie{};ue.prototype.visitNull=rK;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=dR;ue.prototype.visitSparseUnion=dR;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;Oc=new ue});function ye(t){let{type:e}=t;if(t.nullCount===0&&t.stride===1&&(U.isInt(e)&&e.bitWidth!==64||U.isTime(e)&&e.bitWidth!==64||U.isFloat(e)&&e.precision!==Xe.HALF))return new Ch(t.data.length,n=>{let i=t.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let r=0;return new Ch(t.data.length,n=>{let o=t.data[n].length,s=t.slice(r,r+o);return r+=o,new Pw(s)})}var fe,Pw,Bu,M0=p(()=>{Pn();Nt();at();_0();fe=class extends ie{};Pw=class{constructor(e){this.vector=e,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;Bu=new fe});function To(t){if(t){if(t instanceof ce)return new H([t]);if(t instanceof H)return new H(t.data);if(t.type instanceof U)return new H([te(t)]);if(Array.isArray(t))return new H(t.flatMap(e=>iK(e)));if(ArrayBuffer.isView(t)){t instanceof DataView&&(t=new Uint8Array(t.buffer));let e={offset:0,length:t.length,nullCount:-1,data:t};if(t instanceof Int8Array)return new H([te(Object.assign(Object.assign({},e),{type:new Kn}))]);if(t instanceof Int16Array)return new H([te(Object.assign(Object.assign({},e),{type:new Xn}))]);if(t instanceof Int32Array)return new H([te(Object.assign(Object.assign({},e),{type:new Zt}))]);if(t instanceof BigInt64Array)return new H([te(Object.assign(Object.assign({},e),{type:new Yn}))]);if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)return new H([te(Object.assign(Object.assign({},e),{type:new Zn}))]);if(t instanceof Uint16Array)return new H([te(Object.assign(Object.assign({},e),{type:new Jn}))]);if(t instanceof Uint32Array)return new H([te(Object.assign(Object.assign({},e),{type:new rn}))]);if(t instanceof BigUint64Array)return new H([te(Object.assign(Object.assign({},e),{type:new qi}))]);if(t instanceof Float32Array)return new H([te(Object.assign(Object.assign({},e),{type:new nn}))]);if(t instanceof Float64Array)return new H([te(Object.assign(Object.assign({},e),{type:new Qn}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function iK(t){return t instanceof ce?[t]:t instanceof H?t.data:To(t).data}var mR,pR,gR,yR,H,v0,zr=p(()=>{Nt();Ru();at();_i();_0();Ac();ri();S0();M0();at();pR=Symbol.for("apache-arrow/Vector"),gR={},yR={},H=class t{static isVector(e){return(e==null?void 0:e[pR])===!0}constructor(e){var r,n,i;let o=e[0]instanceof t?e.flatMap(a=>a.data):e;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}=gR[s.typeId],u=o[0];this.isValid=h=>Dh(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,yR[s.typeId]),this._offsets=y0(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((e,r)=>e+r.byteLength,0)}get nullable(){return hR(this.data)}get nullCount(){return g0(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(e){return!1}get(e){return null}at(e){return this.get(Ic(e,this.length))}set(e,r){}indexOf(e,r){return-1}includes(e,r){return this.indexOf(e,r)>-1}[Symbol.iterator](){return Bu.visit(this)}concat(...e){return new t(this.data.concat(e.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(e,r){return new t(Oh(this,e,r,({data:n,_offsets:i},o,s)=>b0(n,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:e,data:r,length:n,stride:i,ArrayType:o}=this;switch(e.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(e){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new t(this.data.map(({children:r})=>r[e])):null}get isMemoized(){return U.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(U.isDictionary(this.type)){let e=new v0(this.data[0].dictionary),r=this.data.map(n=>{let i=n.clone();return i.dictionary=e,i});return new t(r)}return new v0(this)}unmemoize(){if(U.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),r=this.data.map(n=>{let i=n.clone();return i.dictionary=e,i});return new t(r)}return this}};mR=Symbol.toStringTag;H[mR]=(t=>{t.type=U.prototype,t.data=[],t.length=0,t.stride=1,t.numChildren=0,t._offsets=new Uint32Array([0]),t[Symbol.isConcatSpreadable]=!0,t[pR]=!0;let e=Object.keys(x).map(r=>x[r]).filter(r=>typeof r=="number"&&r!==x.NONE);for(let r of e){let n=ir.getVisitFnByTypeId(r),i=Lr.getVisitFnByTypeId(r),o=Oc.getVisitFnByTypeId(r);gR[r]={get:n,set:i,indexOf:o},yR[r]=Object.create(t,{isValid:{value:Ou(Dh)},get:{value:Ou(ir.getVisitFnByTypeId(r))},set:{value:w0(Lr.getVisitFnByTypeId(r))},indexOf:{value:x0(Oc.getVisitFnByTypeId(r))}})}return"Vector"})(H.prototype);Object.defineProperty(H,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===H&&H.isVector(e)}});v0=class t extends H{constructor(e){super(e.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 t(i.call(this,s,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new H(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function bR(t){if(!t||t.length<=0)return function(i){return!0};let e="",r=t.filter(n=>n===n);return r.length>0&&(e=`
1
+ "use strict";var GN=Object.create;var fg=Object.defineProperty;var UN=Object.getOwnPropertyDescriptor;var jN=Object.getOwnPropertyNames;var zN=Object.getPrototypeOf,qN=Object.prototype.hasOwnProperty;var p=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var ae=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Jt=(t,e)=>{for(var r in e)fg(t,r,{get:e[r],enumerable:!0})},VN=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jN(e))!qN.call(t,i)&&i!==r&&fg(t,i,{get:()=>e[i],enumerable:!(n=UN(e,i))||n.enumerable});return t};var me=(t,e,r)=>(r=t!=null?GN(zN(t)):{},VN(e||!t||!t.__esModule?fg(r,"default",{value:t,enumerable:!0}):r,t));var xf,WN,Ad,$N,HN,hg=p(()=>{xf=globalThis,WN=globalThis.document||{},Ad=globalThis.process||{},$N=globalThis.console,HN=globalThis.navigator||{}});function Id(t){var n,i;if(typeof window<"u"&&((n=window.process)==null?void 0:n.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;let e=typeof navigator<"u"&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}var Pd=p(()=>{});function Ps(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||Id()}var dg=p(()=>{Pd()});var zS=p(()=>{dg();Pd();hg()});var qS=p(()=>{});var mg,Rd=p(()=>{hg();dg();zS();Pd();qS();mg="5.0.0"});function vl(t,e){if(!t)throw new Error(e||"Assertion failed")}var pg=p(()=>{});function Ld(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return vl(Number.isFinite(e)&&e>=0),e}function gg(t){let{logLevel:e,message:r}=t;t.logLevel=Ld(e);let n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break;default:}typeof t.message=="function"&&(t.message=t.message());let i=typeof t.message;return vl(i==="string"||i==="object"),Object.assign(t,{args:n},t.opts)}var Od=p(()=>{pg()});var Rs,qa,_f=p(()=>{Od();Rs=()=>{},qa=class{constructor({level:e=0}={}){this.userData={},this._onceCache=new Set,this._level=e}set level(e){this.setLevel(e)}get level(){return this.getLevel()}setLevel(e){return this._level=e,this}getLevel(){return this._level}warn(e,...r){return this._log("warn",0,e,r,{once:!0})}error(e,...r){return this._log("error",0,e,r)}log(e,r,...n){return this._log("log",e,r,n)}info(e,r,...n){return this._log("info",e,r,n)}once(e,r,...n){return this._log("once",e,r,n,{once:!0})}_log(e,r,n,i,o={}){let s=gg({logLevel:r,message:n,args:this._buildArgs(r,n,i),opts:o});return this._createLogFunction(e,s,o)}_buildArgs(e,r,n){return[e,r,...n]}_createLogFunction(e,r,n){if(!this._shouldLog(r.logLevel))return Rs;let i=this._getOnceTag(n.tag??r.tag??r.message);if((n.once||r.once)&&i!==void 0){if(this._onceCache.has(i))return Rs;this._onceCache.add(i)}return this._emit(e,r)}_shouldLog(e){return this.getLevel()>=Ld(e)}_getOnceTag(e){if(e!==void 0)try{return typeof e=="string"?e:String(e)}catch{return}}}});function XN(t){try{let e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var Sf,yg=p(()=>{Sf=class{constructor(e,r,n="sessionStorage"){this.storage=XN(n),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){let r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}}});function VS(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function bg(t,e=8){let r=Math.max(e-t.length,0);return`${" ".repeat(r)}${t}`}var wg=p(()=>{});function WS(t){return typeof t!="string"?t:(t=t.toUpperCase(),Mf[t]||Mf.WHITE)}function xg(t,e,r){return!Ps&&typeof t=="string"&&(e&&(t=`\x1B[${WS(e)}m${t}\x1B[39m`),r&&(t=`\x1B[${WS(r)+YN}m${t}\x1B[49m`)),t}var Mf,YN,Cd=p(()=>{Rd();(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Mf||(Mf={}));YN=10});function _g(t,e=["constructor"]){let r=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(r),i=t;for(let o of n){let s=i[o];typeof s=="function"&&(e.find(a=>o===a)||(i[o]=s.bind(t)))}}var Sg=p(()=>{});var Bd,ni,vf=p(()=>{Rd();Bd=class{getHighResolutionTimer(){var r,n,i,o,s;let e;if(Ps()&&xf.performance)e=(i=(n=(r=xf)==null?void 0:r.performance)==null?void 0:n.now)==null?void 0:i.call(n);else if("hrtime"in Ad){let a=(s=(o=Ad)==null?void 0:o.hrtime)==null?void 0:s.call(o);e=a[0]*1e3+a[1]/1e6}else e=Date.now();return e}getMemoryUsageMB(){var n,i;let e=(n=xf)==null?void 0:n.performance,r=(i=e==null?void 0:e.memory)==null?void 0:i.usedJSHeapSize;return r==null?null:Math.trunc(r/1024/1024)}},ni=new Bd;globalThis.Probe=Bd;globalThis.probe=ni});function ZN(t,e,r){if(typeof e=="string"){let n=r.time?bg(VS(r.total)):"";e=r.time?`${t}: ${n} ${e}`:`${t}: ${e}`,e=xg(e,r.color,r.background)}return e}function JN(t){for(let e in t)for(let r in t[e])return r||"untitled";return"empty"}var El,Mg,Do,vg=p(()=>{Rd();_f();yg();wg();Cd();Sg();pg();vf();Od();Od();El={debug:Ps()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Mg={enabled:!0,level:0},Do=class extends qa{constructor({id:e}={id:""}){super({level:0}),this.VERSION=mg,this._startTs=ni.getHighResolutionTimer(),this._deltaTs=ni.getHighResolutionTimer(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new Sf(`__probe-${this.id}__`,{[this.id]:Mg}),this.timeStamp(`${this.id} started`),_g(this),Object.seal(this)}isEnabled(){return this._getConfiguration().enabled}getLevel(){return this._getConfiguration().level}getTotal(){return Number((ni.getHighResolutionTimer()-this._startTs).toPrecision(10))}getDelta(){return Number((ni.getHighResolutionTimer()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._updateConfiguration({enabled:e}),this}setLevel(e){return this._updateConfiguration({level:e}),this}get(e){return this._getConfiguration()[e]}set(e,r){this._updateConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){if(!e)throw new Error(r||"Assertion failed")}warn(e,...r){return this._log("warn",0,e,r,{method:El.warn,once:!0})}error(e,...r){return this._log("error",0,e,r,{method:El.error})}deprecated(e,r){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${r}\` instead`)}removed(e,r){return this.error(`\`${e}\` has been removed. Use \`${r}\` instead`)}probe(e,r,...n){let i=ni.getMemoryUsageMB();if(i!==null){let o=`${i}MB `;typeof r=="function"?r=()=>`${o}${r()}`:typeof r=="string"&&(r=`${o}${r}`)}return this._log("log",e,r,n,{method:El.log,time:!0,once:!0})}log(e,r,...n){return this._log("log",e,r,n,{method:El.debug})}info(e,r,...n){return this._log("info",e,r,n,{method:console.info})}once(e,r,...n){return this._log("once",e,r,n,{method:El.debug||El.info,once:!0})}table(e,r,n){return r?this._log("table",e,r,n&&[n]||[],{method:console.table||Rs,tag:JN(r)}):Rs}time(e,r){return this._log("time",e,r,[],{method:console.time?console.time:console.info})}timeEnd(e,r){return this._log("time",e,r,[],{method:console.timeEnd?console.timeEnd:console.info})}timeStamp(e,r){return this._log("time",e,r,[],{method:console.timeStamp||Rs})}group(e,r,n={collapsed:!1}){let i=(n.collapsed?console.groupCollapsed:console.group)||console.info;return this._log("group",e,r,[],{method:i})}groupCollapsed(e,r,n={}){return this.group(e,r,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._log("groupEnd",e,"",[],{method:console.groupEnd||Rs})}withGroup(e,r,n){this.group(e,r)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&super._shouldLog(e)}_emit(e,r){let n=r.method;vl(n),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=ni.getHighResolutionTimer();let i=ZN(this.id,r.message,r);return n.bind(console,i,...r.args)}_getConfiguration(){return this._storage.config[this.id]||this._updateConfiguration(Mg),this._storage.config[this.id]}_updateConfiguration(e){let r=this._storage.config[this.id]||{...Mg};this._storage.setConfiguration({[this.id]:{...r,...e}})}};Do.VERSION=mg});var $S=p(()=>{_f()});var HS=p(()=>{_f()});var KS=p(()=>{vf()});var XS=p(()=>{vf();globalThis.probe||(globalThis.probe=ni)});var YS,Eg=p(()=>{vg();vf();vg();$S();_f();HS();Cd();Cd();wg();Sg();yg();KS();XS();YS=new Do({id:"@probe.gl/log"})});var oM,vF,EF,TF,AF,IF,PF,RF,LF,OF,CF,BF,DF,NF,FF,f,Qi=p(()=>{oM=t=>typeof t<"u"&&t!==null,vF=t=>typeof t=="object",EF=t=>Object.prototype.toString.call(t)==="[object Object]",TF=t=>typeof t=="function",AF=t=>typeof t=="boolean",IF=t=>t instanceof Buffer,PF=t=>{if(oM(t))switch(t.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},RF=t=>t instanceof ArrayBuffer,LF=t=>typeof t=="string"&&t.length>0,OF=t=>typeof t=="number"&&Number.isFinite(t),CF=t=>Number.isInteger(t),BF=(t,e,r)=>t>=e&&t<=r,DF=(t,e)=>e.includes(t),NF=(t,e,r)=>{let n;try{n=String(r).slice(0,100)}catch{}return new Error(`Expected ${e} for ${t} but received ${n} of type ${typeof r}`)},FF=(t,e)=>(e.message=t.message,e),f={defined:oM,object:vF,plainObject:EF,fn:TF,bool:AF,buffer:IF,typedArray:PF,arrayBuffer:RF,string:LF,number:OF,integer:CF,inRange:BF,inArray:DF,invalidParameterError:NF,nativeError:FF}});var cM=ae((KJ,aM)=>{"use strict";var sM=()=>process.platform==="linux",Fd=null,kF=()=>{if(!Fd)if(sM()&&process.report){let t=process.report.excludeNetwork;process.report.excludeNetwork=!0,Fd=process.report.getReport(),process.report.excludeNetwork=t}else Fd={};return Fd};aM.exports={isLinux:sM,getReport:kF}});var uM=ae((XJ,lM)=>{"use strict";var Il=require("fs"),GF="/usr/bin/ldd",UF="/proc/self/exe",kd=2048,jF=t=>{let e=Il.openSync(t,"r"),r=Buffer.alloc(kd),n=Il.readSync(e,r,0,kd,0);return Il.close(e,()=>{}),r.subarray(0,n)},zF=t=>new Promise((e,r)=>{Il.open(t,"r",(n,i)=>{if(n)r(n);else{let o=Buffer.alloc(kd);Il.read(i,o,0,kd,0,(s,a)=>{e(o.subarray(0,a)),Il.close(i,()=>{})})}})});lM.exports={LDD_PATH:GF,SELF_PATH:UF,readFileSync:jF,readFile:zF}});var hM=ae((YJ,fM)=>{"use strict";var qF=t=>{if(t.length<64||t.readUInt32BE(0)!==2135247942||t.readUInt8(4)!==2||t.readUInt8(5)!==1)return null;let e=t.readUInt32LE(32),r=t.readUInt16LE(54),n=t.readUInt16LE(56);for(let i=0;i<n;i++){let o=e+i*r;if(t.readUInt32LE(o)===3){let a=t.readUInt32LE(o+8),c=t.readUInt32LE(o+32);return t.subarray(a,a+c).toString().replace(/\0.*$/g,"")}}return null};fM.exports={interpreterPath:qF}});var Ud=ae((ZJ,RM)=>{"use strict";var mM=require("child_process"),{isLinux:Pl,getReport:pM}=cM(),{LDD_PATH:Gd,SELF_PATH:gM,readFile:Og,readFileSync:Cg}=uM(),{interpreterPath:yM}=hM(),eo,to,ro,bM="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",Ls="",wM=()=>Ls||new Promise(t=>{mM.exec(bM,(e,r)=>{Ls=e?" ":r,t(Ls)})}),xM=()=>{if(!Ls)try{Ls=mM.execSync(bM,{encoding:"utf8"})}catch{Ls=" "}return Ls},Fo="glibc",_M=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Wa="musl",VF=t=>t.includes("libc.musl-")||t.includes("ld-musl-"),SM=()=>{let t=pM();return t.header&&t.header.glibcVersionRuntime?Fo:Array.isArray(t.sharedObjects)&&t.sharedObjects.some(VF)?Wa:null},MM=t=>{let[e,r]=t.split(/[\r\n]+/);return e&&e.includes(Fo)?Fo:r&&r.includes(Wa)?Wa:null},vM=t=>{if(t){if(t.includes("/ld-musl-"))return Wa;if(t.includes("/ld-linux-"))return Fo}return null},EM=t=>(t=t.toString(),t.includes("musl")?Wa:t.includes("GNU C Library")?Fo:null),WF=async()=>{if(to!==void 0)return to;to=null;try{let t=await Og(Gd);to=EM(t)}catch{}return to},$F=()=>{if(to!==void 0)return to;to=null;try{let t=Cg(Gd);to=EM(t)}catch{}return to},HF=async()=>{if(eo!==void 0)return eo;eo=null;try{let t=await Og(gM),e=yM(t);eo=vM(e)}catch{}return eo},KF=()=>{if(eo!==void 0)return eo;eo=null;try{let t=Cg(gM),e=yM(t);eo=vM(e)}catch{}return eo},TM=async()=>{let t=null;if(Pl()&&(t=await HF(),!t&&(t=await WF(),t||(t=SM()),!t))){let e=await wM();t=MM(e)}return t},AM=()=>{let t=null;if(Pl()&&(t=KF(),!t&&(t=$F(),t||(t=SM()),!t))){let e=xM();t=MM(e)}return t},XF=async()=>Pl()&&await TM()!==Fo,YF=()=>Pl()&&AM()!==Fo,ZF=async()=>{if(ro!==void 0)return ro;ro=null;try{let e=(await Og(Gd)).match(_M);e&&(ro=e[1])}catch{}return ro},JF=()=>{if(ro!==void 0)return ro;ro=null;try{let e=Cg(Gd).match(_M);e&&(ro=e[1])}catch{}return ro},IM=()=>{let t=pM();return t.header&&t.header.glibcVersionRuntime?t.header.glibcVersionRuntime:null},dM=t=>t.trim().split(/\s+/)[1],PM=t=>{let[e,r,n]=t.split(/[\r\n]+/);return e&&e.includes(Fo)?dM(e):r&&n&&r.includes(Wa)?dM(n):null},QF=async()=>{let t=null;if(Pl()&&(t=await ZF(),t||(t=IM()),!t)){let e=await wM();t=PM(e)}return t},e7=()=>{let t=null;if(Pl()&&(t=JF(),t||(t=IM()),!t)){let e=xM();t=PM(e)}return t};RM.exports={GLIBC:Fo,MUSL:Wa,family:TM,familySync:AM,isNonGlibcLinux:XF,isNonGlibcLinuxSync:YF,version:QF,versionSync:e7}});var Rl=ae((JJ,LM)=>{"use strict";var t7="2.0.0",r7=Number.MAX_SAFE_INTEGER||9007199254740991,n7=16,i7=250,o7=["major","premajor","minor","preminor","patch","prepatch","prerelease"];LM.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:n7,MAX_SAFE_BUILD_LENGTH:i7,MAX_SAFE_INTEGER:r7,RELEASE_TYPES:o7,SEMVER_SPEC_VERSION:t7,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Af=ae((QJ,OM)=>{"use strict";var s7=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};OM.exports=s7});var Ll=ae((no,CM)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Bg,MAX_SAFE_BUILD_LENGTH:a7,MAX_LENGTH:c7}=Rl(),l7=Af();no=CM.exports={};var u7=no.re=[],f7=no.safeRe=[],Y=no.src=[],h7=no.safeSrc=[],Z=no.t={},d7=0,Dg="[a-zA-Z0-9-]",m7=[["\\s",1],["\\d",c7],[Dg,a7]],p7=t=>{for(let[e,r]of m7)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Pe=(t,e,r)=>{let n=p7(e),i=d7++;l7(t,i,e),Z[t]=i,Y[i]=e,h7[i]=n,u7[i]=new RegExp(e,r?"g":void 0),f7[i]=new RegExp(n,r?"g":void 0)};Pe("NUMERICIDENTIFIER","0|[1-9]\\d*");Pe("NUMERICIDENTIFIERLOOSE","\\d+");Pe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Dg}*`);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",`${Dg}+`);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,${Bg}})(?:\\.(\\d{1,${Bg}}))?(?:\\.(\\d{1,${Bg}}))?`);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);no.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);no.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);no.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 jd=ae((eQ,BM)=>{"use strict";var g7=Object.freeze({loose:!0}),y7=Object.freeze({}),b7=t=>t?typeof t!="object"?g7:t:y7;BM.exports=b7});var Ng=ae((tQ,FM)=>{"use strict";var DM=/^[0-9]+$/,NM=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=DM.test(t),n=DM.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},w7=(t,e)=>NM(e,t);FM.exports={compareIdentifiers:NM,rcompareIdentifiers:w7}});var Mr=ae((rQ,GM)=>{"use strict";var zd=Af(),{MAX_LENGTH:kM,MAX_SAFE_INTEGER:qd}=Rl(),{safeRe:Vd,t:Wd}=Ll(),x7=jd(),{compareIdentifiers:Fg}=Ng(),_7=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;n<r.length;n++)if(Fg(t[n],r[n])!==0)return!1;return!0},kg=class t{constructor(e,r){if(r=x7(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>kM)throw new TypeError(`version is longer than ${kM} characters`);zd("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Vd[Wd.LOOSE]:Vd[Wd.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>qd||this.major<0)throw new TypeError("Invalid major version");if(this.minor>qd||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>qd||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<qd)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(e){if(zd("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(zd("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 Fg(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(zd("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 Fg(n,i)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?Vd[Wd.PRERELEASELOOSE]:Vd[Wd.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){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]),_7(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: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};GM.exports=kg});var Os=ae((nQ,jM)=>{"use strict";var UM=Mr(),S7=(t,e,r=!1)=>{if(t instanceof UM)return t;try{return new UM(t,e)}catch(n){if(!r)return null;throw n}};jM.exports=S7});var qM=ae((iQ,zM)=>{"use strict";var M7=Os(),v7=(t,e)=>{let r=M7(t,e);return r?r.version:null};zM.exports=v7});var WM=ae((oQ,VM)=>{"use strict";var E7=Os(),T7=(t,e)=>{let r=E7(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};VM.exports=T7});var KM=ae((sQ,HM)=>{"use strict";var $M=Mr(),A7=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new $M(t instanceof $M?t.version:t,r).inc(e,n,i).version}catch{return null}};HM.exports=A7});var ZM=ae((aQ,YM)=>{"use strict";var XM=Os(),I7=(t,e)=>{let r=XM(t,null,!0),n=XM(e,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"};YM.exports=I7});var QM=ae((cQ,JM)=>{"use strict";var P7=Mr(),R7=(t,e)=>new P7(t,e).major;JM.exports=R7});var tv=ae((lQ,ev)=>{"use strict";var L7=Mr(),O7=(t,e)=>new L7(t,e).minor;ev.exports=O7});var nv=ae((uQ,rv)=>{"use strict";var C7=Mr(),B7=(t,e)=>new C7(t,e).patch;rv.exports=B7});var ov=ae((fQ,iv)=>{"use strict";var D7=Os(),N7=(t,e)=>{let r=D7(t,e);return r&&r.prerelease.length?r.prerelease:null};iv.exports=N7});var si=ae((hQ,av)=>{"use strict";var sv=Mr(),F7=(t,e,r)=>new sv(t,r).compare(new sv(e,r));av.exports=F7});var lv=ae((dQ,cv)=>{"use strict";var k7=si(),G7=(t,e,r)=>k7(e,t,r);cv.exports=G7});var fv=ae((mQ,uv)=>{"use strict";var U7=si(),j7=(t,e)=>U7(t,e,!0);uv.exports=j7});var $d=ae((pQ,dv)=>{"use strict";var hv=Mr(),z7=(t,e,r)=>{let n=new hv(t,r),i=new hv(e,r);return n.compare(i)||n.compareBuild(i)};dv.exports=z7});var pv=ae((gQ,mv)=>{"use strict";var q7=$d(),V7=(t,e)=>t.sort((r,n)=>q7(r,n,e));mv.exports=V7});var yv=ae((yQ,gv)=>{"use strict";var W7=$d(),$7=(t,e)=>t.sort((r,n)=>W7(n,r,e));gv.exports=$7});var If=ae((bQ,bv)=>{"use strict";var H7=si(),K7=(t,e,r)=>H7(t,e,r)>0;bv.exports=K7});var Hd=ae((wQ,wv)=>{"use strict";var X7=si(),Y7=(t,e,r)=>X7(t,e,r)<0;wv.exports=Y7});var Gg=ae((xQ,xv)=>{"use strict";var Z7=si(),J7=(t,e,r)=>Z7(t,e,r)===0;xv.exports=J7});var Ug=ae((_Q,_v)=>{"use strict";var Q7=si(),e9=(t,e,r)=>Q7(t,e,r)!==0;_v.exports=e9});var Kd=ae((SQ,Sv)=>{"use strict";var t9=si(),r9=(t,e,r)=>t9(t,e,r)>=0;Sv.exports=r9});var Xd=ae((MQ,Mv)=>{"use strict";var n9=si(),i9=(t,e,r)=>n9(t,e,r)<=0;Mv.exports=i9});var jg=ae((vQ,vv)=>{"use strict";var o9=Gg(),s9=Ug(),a9=If(),c9=Kd(),l9=Hd(),u9=Xd(),f9=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return o9(t,r,n);case"!=":return s9(t,r,n);case">":return a9(t,r,n);case">=":return c9(t,r,n);case"<":return l9(t,r,n);case"<=":return u9(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};vv.exports=f9});var Tv=ae((EQ,Ev)=>{"use strict";var h9=Mr(),d9=Os(),{safeRe:Yd,t:Zd}=Ll(),m9=(t,e)=>{if(t instanceof h9)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Yd[Zd.COERCEFULL]:Yd[Zd.COERCE]);else{let c=e.includePrerelease?Yd[Zd.COERCERTLFULL]:Yd[Zd.COERCERTL],l;for(;(l=c.exec(t))&&(!r||r.index+r[0].length!==t.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=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return d9(`${n}.${i}.${o}${s}${a}`,e)};Ev.exports=m9});var Iv=ae((TQ,Av)=>{"use strict";var p9=Os(),g9=Rl(),y9=Mr(),b9=(t,e,r)=>{if(!g9.RELEASE_TYPES.includes(e))return null;let n=w9(t,r);return n&&x9(n,e)},w9=(t,e)=>{let r=t instanceof y9?t.version:t;return p9(r,e)},x9=(t,e)=>{if(_9(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},_9=t=>t.startsWith("pre");Av.exports=b9});var Rv=ae((AQ,Pv)=>{"use strict";var zg=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};Pv.exports=zg});var ai=ae((IQ,Bv)=>{"use strict";var S9=/\s+/g,qg=class t{constructor(e,r){if(r=v9(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Vg)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(S9," "),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=>!Ov(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&&C9(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];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(e){e=e.replace(O9,"");let n=((this.options.includePrerelease&&R9)|(this.options.loose&&L9))+":"+e,i=Lv.get(n);if(i)return i;let o=this.options.loose,s=o?Hr[vr.HYPHENRANGELOOSE]:Hr[vr.HYPHENRANGE];e=e.replace(s,V9(this.options.includePrerelease)),Et("hyphen replace",e),e=e.replace(Hr[vr.COMPARATORTRIM],A9),Et("comparator trim",e),e=e.replace(Hr[vr.TILDETRIM],I9),Et("tilde trim",e),e=e.replace(Hr[vr.CARETTRIM],P9),Et("caret trim",e);let a=e.split(" ").map(h=>B9(h,this.options)).join(" ").split(/\s+/).map(h=>q9(h,this.options));o&&(a=a.filter(h=>(Et("loose invalid filter",h,this.options),!!h.match(Hr[vr.COMPARATORLOOSE])))),Et("range list",a);let c=new Map,l=a.map(h=>new Vg(h,this.options));for(let h of l){if(Ov(h))return[h];c.set(h.value,h)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return Lv.set(n,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Cv(n,r)&&e.set.some(i=>Cv(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new E9(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(W9(this.set[r],e,this.options))return!0;return!1}};Bv.exports=qg;var M9=Rv(),Lv=new M9,v9=jd(),Vg=Pf(),Et=Af(),E9=Mr(),{safeRe:Hr,src:T9,t:vr,comparatorTrimReplace:A9,tildeTrimReplace:I9,caretTrimReplace:P9}=Ll(),{FLAG_INCLUDE_PRERELEASE:R9,FLAG_LOOSE:L9}=Rl(),O9=new RegExp(T9[vr.BUILD],"g"),Ov=t=>t.value==="<0.0.0-0",C9=t=>t.value==="",Cv=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},B9=(t,e)=>(t=t.replace(Hr[vr.BUILD],""),Et("comp",t,e),t=k9(t,e),Et("caret",t),t=N9(t,e),Et("tildes",t),t=U9(t,e),Et("xrange",t),t=z9(t,e),Et("stars",t),t),ir=t=>!t||t.toLowerCase()==="x"||t==="*",D9=(t,e,r)=>ir(t)&&!ir(e)||ir(e)&&r&&!ir(r),N9=(t,e)=>t.trim().split(/\s+/).map(r=>F9(r,e)).join(" "),F9=(t,e)=>{let r=e.loose?Hr[vr.TILDELOOSE]:Hr[vr.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,c)=>{Et("tilde",t,i,o,s,a,c);let l;return ir(o)?l="":ir(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:ir(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})},k9=(t,e)=>t.trim().split(/\s+/).map(r=>G9(r,e)).join(" "),G9=(t,e)=>{Et("caret",t,e);let r=e.loose?Hr[vr.CARETLOOSE]:Hr[vr.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,c)=>{Et("caret",t,i,o,s,a,c);let l;return ir(o)?l="":ir(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:ir(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})},U9=(t,e)=>(Et("replaceXRanges",t,e),t.split(/\s+/).map(r=>j9(r,e)).join(" ")),j9=(t,e)=>{t=t.trim();let r=e.loose?Hr[vr.XRANGELOOSE]:Hr[vr.XRANGE];return t.replace(r,(n,i,o,s,a,c)=>{if(Et("xRange",t,n,i,o,s,a,c),D9(o,s,a))return t;let l=ir(o),u=l||ir(s),h=u||ir(a),d=h;return i==="="&&d&&(i=""),c=e.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})},z9=(t,e)=>(Et("replaceStars",t,e),t.trim().replace(Hr[vr.STAR],"")),q9=(t,e)=>(Et("replaceGTE0",t,e),t.trim().replace(Hr[e.includePrerelease?vr.GTE0PRE:vr.GTE0],"")),V9=t=>(e,r,n,i,o,s,a,c,l,u,h,d)=>(ir(n)?r="":ir(i)?r=`>=${n}.0.0${t?"-0":""}`:ir(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,ir(l)?c="":ir(u)?c=`<${+l+1}.0.0-0`:ir(h)?c=`<${l}.${+u+1}.0-0`:d?c=`<=${l}.${u}.${h}-${d}`:t?c=`<${l}.${u}.${+h+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),W9=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Et(t[n].semver),t[n].semver!==Vg.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Pf=ae((PQ,Uv)=>{"use strict";var Rf=Symbol("SemVer ANY"),Hg=class t{static get ANY(){return Rf}constructor(e,r){if(r=Dv(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),$g("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Rf?this.value="":this.value=this.operator+this.semver.version,$g("comp",this)}parse(e){let r=this.options.loose?Nv[Fv.COMPARATORLOOSE]:Nv[Fv.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new kv(n[2],this.options.loose):this.semver=Rf}toString(){return this.value}test(e){if($g("Comparator.test",e,this.options.loose),this.semver===Rf||e===Rf)return!0;if(typeof e=="string")try{e=new kv(e,this.options)}catch{return!1}return Wg(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Gv(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Gv(this.value,r).test(e.semver):(r=Dv(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Wg(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Wg(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Uv.exports=Hg;var Dv=jd(),{safeRe:Nv,t:Fv}=Ll(),Wg=jg(),$g=Af(),kv=Mr(),Gv=ai()});var Lf=ae((RQ,jv)=>{"use strict";var $9=ai(),H9=(t,e,r)=>{try{e=new $9(e,r)}catch{return!1}return e.test(t)};jv.exports=H9});var qv=ae((LQ,zv)=>{"use strict";var K9=ai(),X9=(t,e)=>new K9(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));zv.exports=X9});var Wv=ae((OQ,Vv)=>{"use strict";var Y9=Mr(),Z9=ai(),J9=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Z9(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new Y9(n,r))}),n};Vv.exports=J9});var Hv=ae((CQ,$v)=>{"use strict";var Q9=Mr(),ek=ai(),tk=(t,e,r)=>{let n=null,i=null,o=null;try{o=new ek(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Q9(n,r))}),n};$v.exports=tk});var Yv=ae((BQ,Xv)=>{"use strict";var Kg=Mr(),rk=ai(),Kv=If(),nk=(t,e)=>{t=new rk(t,e);let r=new Kg("0.0.0");if(t.test(r)||(r=new Kg("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],o=null;i.forEach(s=>{let a=new Kg(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||Kv(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||Kv(r,o))&&(r=o)}return r&&t.test(r)?r:null};Xv.exports=nk});var Jv=ae((DQ,Zv)=>{"use strict";var ik=ai(),ok=(t,e)=>{try{return new ik(t,e).range||"*"}catch{return null}};Zv.exports=ok});var Jd=ae((NQ,r3)=>{"use strict";var sk=Mr(),t3=Pf(),{ANY:ak}=t3,ck=ai(),lk=Lf(),Qv=If(),e3=Hd(),uk=Xd(),fk=Kd(),hk=(t,e,r,n)=>{t=new sk(t,n),e=new ck(e,n);let i,o,s,a,c;switch(r){case">":i=Qv,o=uk,s=e3,a=">",c=">=";break;case"<":i=e3,o=fk,s=Qv,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(lk(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],h=null,d=null;if(u.forEach(m=>{m.semver===ak&&(m=new t3(">=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(t,d.semver))return!1;if(d.operator===c&&s(t,d.semver))return!1}return!0};r3.exports=hk});var i3=ae((FQ,n3)=>{"use strict";var dk=Jd(),mk=(t,e,r)=>dk(t,e,">",r);n3.exports=mk});var s3=ae((kQ,o3)=>{"use strict";var pk=Jd(),gk=(t,e,r)=>pk(t,e,"<",r);o3.exports=gk});var l3=ae((GQ,c3)=>{"use strict";var a3=ai(),yk=(t,e,r)=>(t=new a3(t,r),e=new a3(e,r),t.intersects(e,r));c3.exports=yk});var f3=ae((UQ,u3)=>{"use strict";var bk=Lf(),wk=si();u3.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((u,h)=>wk(u,h,r));for(let u of s)bk(u,e,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 e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var y3=ae((jQ,g3)=>{"use strict";var h3=ai(),Zg=Pf(),{ANY:Xg}=Zg,Yg=Lf(),Jg=si(),xk=(t,e,r={})=>{if(t===e)return!0;t=new h3(t,r),e=new h3(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=Sk(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},_k=[new Zg(">=0.0.0-0")],d3=[new Zg(">=0.0.0")],Sk=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Xg){if(e.length===1&&e[0].semver===Xg)return!0;r.includePrerelease?t=_k:t=d3}if(e.length===1&&e[0].semver===Xg){if(r.includePrerelease)return!0;e=d3}let n=new Set,i,o;for(let m of t)m.operator===">"||m.operator===">="?i=m3(i,m,r):m.operator==="<"||m.operator==="<="?o=p3(o,m,r):n.add(m.semver);if(n.size>1)return null;let s;if(i&&o){if(s=Jg(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&&!Yg(m,String(i),r)||o&&!Yg(m,String(o),r))return null;for(let g of e)if(!Yg(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 e){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=m3(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=p3(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)},m3=(t,e,r)=>{if(!t)return e;let n=Jg(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},p3=(t,e,r)=>{if(!t)return e;let n=Jg(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};g3.exports=xk});var _3=ae((zQ,x3)=>{"use strict";var Qg=Ll(),b3=Rl(),Mk=Mr(),w3=Ng(),vk=Os(),Ek=qM(),Tk=WM(),Ak=KM(),Ik=ZM(),Pk=QM(),Rk=tv(),Lk=nv(),Ok=ov(),Ck=si(),Bk=lv(),Dk=fv(),Nk=$d(),Fk=pv(),kk=yv(),Gk=If(),Uk=Hd(),jk=Gg(),zk=Ug(),qk=Kd(),Vk=Xd(),Wk=jg(),$k=Tv(),Hk=Iv(),Kk=Pf(),Xk=ai(),Yk=Lf(),Zk=qv(),Jk=Wv(),Qk=Hv(),eG=Yv(),tG=Jv(),rG=Jd(),nG=i3(),iG=s3(),oG=l3(),sG=f3(),aG=y3();x3.exports={parse:vk,valid:Ek,clean:Tk,inc:Ak,diff:Ik,major:Pk,minor:Rk,patch:Lk,prerelease:Ok,compare:Ck,rcompare:Bk,compareLoose:Dk,compareBuild:Nk,sort:Fk,rsort:kk,gt:Gk,lt:Uk,eq:jk,neq:zk,gte:qk,lte:Vk,cmp:Wk,coerce:$k,truncate:Hk,Comparator:Kk,Range:Xk,satisfies:Yk,toComparators:Zk,maxSatisfying:Jk,minSatisfying:Qk,minVersion:eG,validRange:tG,outside:rG,gtr:nG,ltr:iG,intersects:oG,simplifyRange:sG,subset:aG,SemVer:Mk,re:Qg.re,src:Qg.src,tokens:Qg.t,SEMVER_SPEC_VERSION:b3.SEMVER_SPEC_VERSION,RELEASE_TYPES:b3.RELEASE_TYPES,compareIdentifiers:w3.compareIdentifiers,rcompareIdentifiers:w3.rcompareIdentifiers}});var ko,Qd=p(()=>{ko={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 Cl,M3,Of,ty,lG,v3,uG,ry,fG,E3,hG,Ol,dG,mG,pG,gG,T3,yG,S3,bG,wG,A3,xG,_G,I3,ey,SG,em,ny=p(()=>{Cl=require("node:child_process"),M3=require("node:crypto"),Of=me(_3(),1),ty=me(Ud(),1);Qd();lG=process.env.npm_package_config_libvips||ko.config.libvips,v3=Of.default.coerce(lG).version,uG=["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"],ry={encoding:"utf8",shell:!0},fG=t=>{t instanceof Error?console.error(`sharp: Installation error: ${t.message}`):console.log(`sharp: ${t}`)},E3=()=>ty.default.isNonGlibcLinuxSync()?ty.default.familySync():"",hG=()=>`${process.platform}${E3()}-${process.arch}`,Ol=()=>{if(T3())return"wasm32";let{npm_config_arch:t,npm_config_platform:e,npm_config_libc:r}=process.env,n=typeof r=="string"?r:E3();return`${e||process.platform}${n}-${t||process.arch}`},dG=()=>{try{return require(`@img/sharp-libvips-dev-${Ol()}/include`)}catch{try{return require("@img/sharp-libvips-dev/include")}catch{}}return""},mG=()=>{try{return require("@img/sharp-libvips-dev/cplusplus")}catch{}return""},pG=()=>{try{return require(`@img/sharp-libvips-dev-${Ol()}/lib`)}catch{try{return require(`@img/sharp-libvips-${Ol()}/lib`)}catch{}}return""},gG=()=>{var t;if(((t=process.release)==null?void 0:t.name)==="node"&&process.versions&&!Of.default.satisfies(process.versions.node,ko.engines.node))return{found:process.versions.node,expected:ko.engines.node}},T3=()=>{let{CC:t}=process.env;return!!(t!=null&&t.endsWith("/emcc"))},yG=()=>process.platform==="darwin"&&process.arch==="x64"?((0,Cl.spawnSync)("sysctl sysctl.proc_translated",ry).stdout||"").trim()==="sysctl.proc_translated: 1":!1,S3=t=>(0,M3.createHash)("sha512").update(t).digest("hex"),bG=()=>{try{let t=S3(`imgsharp-libvips-${Ol()}`),e=Of.default.coerce(ko.optionalDependencies[`@img/sharp-libvips-${Ol()}`],{includePrerelease:!0}).version;return S3(`${t}npm:${e}`).slice(0,10)}catch{}return""},wG=()=>(0,Cl.spawnSync)(`node-gyp rebuild --directory=src ${T3()?"--nodedir=emscripten":""}`,{...ry,stdio:"inherit"}).status,A3=()=>process.platform!=="win32"?((0,Cl.spawnSync)("pkg-config --modversion vips-cpp",{...ry,env:{...process.env,PKG_CONFIG_PATH:I3()}}).stdout||"").trim():"",xG=()=>{try{let t=((0,Cl.spawnSync)("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(t)return`${t}/lib/pkgconfig`}catch{}},_G=()=>{try{let t=((0,Cl.spawnSync)("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(t)return t}catch{}},I3=()=>process.platform!=="win32"?[xG(),_G(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":"):"",ey=(t,e,r)=>(r&&r(`Detected ${e}, skipping search for globally-installed libvips`),t),SG=t=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return ey(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",t);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return ey(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",t);if(yG())return ey(!1,"Rosetta",t);let e=A3();return!!e&&Of.default.gte(e,v3)},em={minimumLibvipsVersion:v3,prebuiltPlatforms:uG,buildPlatformArch:Ol,buildSharpLibvipsIncludeDir:dG,buildSharpLibvipsCPlusPlusDir:mG,buildSharpLibvipsLibDir:pG,isUnsupportedNodeRuntime:gG,runtimePlatformArch:hG,log:fG,yarnLocator:bG,spawnRebuild:wG,globalLibvipsVersion:A3,pkgConfigPath:I3,useGlobalLibvips:SG}});var R3,tm,TG,or,L3,MG,P3,vG,EG,Go,yt,Cs,it,Cf=p(()=>{R3=require("node:module"),tm=me(Ud(),1);ny();Qd();TG={};or=(0,R3.createRequire)(TG.url),{version:L3}=ko,{runtimePlatformArch:MG,isUnsupportedNodeRuntime:P3,prebuiltPlatforms:vG,minimumLibvipsVersion:EG}=em,Go=MG(),Cs=[];try{yt=or(`../src/build/Release/sharp-${Go}-${L3}.node`)}catch(t){Cs.push(t)}if(!yt)try{yt=or(`../src/build/Release/sharp-wasm32-${L3}.node`)}catch(t){Cs.push(t)}if(!yt)try{switch(Go){case"darwin-arm64":yt=or("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":yt=or("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":yt=or("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":yt=or("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":yt=or("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":yt=or("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":yt=or("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":yt=or("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":yt=or("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":yt=or("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":yt=or("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":yt=or("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":yt=or("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":yt=or("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":yt=or("@img/sharp-webcontainers-wasm32/sharp.node");break}if(yt&&["linux-x64","linuxmusl-x64"].includes(Go)&&!yt._isUsingX64V2()){let t=new Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");t.code="Unsupported CPU",Cs.push(t),yt=null}yt&&process.versions.electron&&Go.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(t){Cs.push(t)}if(!yt)try{yt=or("@img/sharp-wasm32/sharp.node")}catch(t){Cs.push(t)}if(!yt){let[t,e,r]=["linux","darwin","win32"].map(o=>Go.startsWith(o)),n=[`Could not load the "sharp" module using the ${Go} runtime`];Cs.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=Cs.map(o=>o.message).join(" ");if(n.push("Possible solutions:"),P3()){let{found:o,expected:s}=P3();n.push("- Please upgrade Node.js:",` Found ${o}`,` Requires ${s}`)}else if(vG.includes(Go)&&!/libstdc\+\+\.so/.test(i)){let[o,s]=Go.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 >= ${EG}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(t&&/(symbol not found|CXXABI_)/i.test(i))try{let{config:o}=or(`@img/sharp-libvips-${Go}/package`),s=`${(0,tm.familySync)()} ${(0,tm.versionSync)()}`,a=`${o.musl?"musl":"glibc"} ${o.musl||o.glibc}`;n.push("- Update your OS:",` Found ${s}`,` Requires ${a}`)}catch{}throw t&&/\/snap\/core[0-9]{2}/.test(i)&&n.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),e&&/Incompatible library version/.test(i)&&n.push("- Update Homebrew:"," brew update && brew upgrade vips"),Cs.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
+ `))}it=yt});function PG(){let t=this.constructor.call(),{debuglog:e,queueListener:r,...n}=this.options;return t.options=structuredClone(n),t.options.debuglog=e,t.options.queueListener=r,this._isStreamInput()&&this._whenStreamInFinished(()=>{this._flattenBufferIn(),t.options.input.buffer=this.options.input.buffer,t.emit("finish")}),t}var O3,rm,AG,IG,$a,io,C3=p(()=>{O3=me(require("node:util"),1),rm=me(require("node:stream"),1);Qi();Cf();AG=O3.default.debuglog("sharp"),IG=t=>{$a.queue.emit("change",t)},$a=function(t,e){if(arguments.length===1&&!f.defined(t))throw new Error("Invalid input");return this instanceof $a?(rm.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),AG(r)},queueListener:IG},this.options.input=this._createInputDescriptor(t,e,{allowStream:!0}),this):new $a(t,e)};Object.setPrototypeOf($a.prototype,rm.default.Duplex.prototype);Object.setPrototypeOf($a,rm.default.Duplex);Object.assign($a.prototype,{clone:PG});io=$a});function B3(t){let e=LG.filter(r=>f.defined(t[r])).map(r=>[r,t[r]]);return e.length?Object.fromEntries(e):void 0}function OG(t,e,r){let n={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(f.string(t))n.file=t;else if(f.buffer(t)){if(t.length===0)throw Error("Input Buffer is empty");n.buffer=t}else if(f.arrayBuffer(t)){if(t.byteLength===0)throw Error("Input bit Array is empty");n.buffer=Buffer.from(t,0,t.byteLength)}else if(f.typedArray(t)){if(t.length===0)throw Error("Input Bit Array is empty");n.buffer=Buffer.from(t.buffer,t.byteOffset,t.byteLength)}else if(f.plainObject(t)&&!f.defined(e))e=t,B3(e)&&(n.buffer=[]);else if(!f.defined(t)&&!f.defined(e)&&f.object(r)&&r.allowStream)n.buffer=[];else if(Array.isArray(t))if(t.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=t.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 '${t}' of type ${typeof t}${f.defined(e)?` when also providing options of type ${typeof e}`:""}`);if(f.object(e)){if(f.defined(e.failOn))if(f.string(e.failOn)&&f.inArray(e.failOn,["none","truncated","error","warning"]))n.failOn=e.failOn;else throw f.invalidParameterError("failOn","one of: none, truncated, error, warning",e.failOn);if(f.defined(e.autoOrient))if(f.bool(e.autoOrient))n.autoOrient=e.autoOrient;else throw f.invalidParameterError("autoOrient","boolean",e.autoOrient);if(f.defined(e.density))if(f.number(e.density)&&f.inRange(e.density,1,1e5))n.density=e.density;else throw f.invalidParameterError("density","number between 1 and 100000",e.density);if(f.defined(e.ignoreIcc))if(f.bool(e.ignoreIcc))n.ignoreIcc=e.ignoreIcc;else throw f.invalidParameterError("ignoreIcc","boolean",e.ignoreIcc);if(f.defined(e.limitInputPixels))if(f.bool(e.limitInputPixels))n.limitInputPixels=e.limitInputPixels?16383**2:0;else if(f.integer(e.limitInputPixels)&&f.inRange(e.limitInputPixels,0,Number.MAX_SAFE_INTEGER))n.limitInputPixels=e.limitInputPixels;else throw f.invalidParameterError("limitInputPixels","positive integer",e.limitInputPixels);if(f.defined(e.limitInputChannels))if(f.bool(e.limitInputChannels))n.limitInputChannels=e.limitInputChannels?5:0;else if(f.integer(e.limitInputChannels)&&f.inRange(e.limitInputChannels,0,Number.MAX_SAFE_INTEGER))n.limitInputChannels=e.limitInputChannels;else throw f.invalidParameterError("limitInputChannels","positive integer",e.limitInputChannels);if(f.defined(e.unlimited))if(f.bool(e.unlimited))n.unlimited=e.unlimited;else throw f.invalidParameterError("unlimited","boolean",e.unlimited);if(f.defined(e.sequentialRead))if(f.bool(e.sequentialRead))n.sequentialRead=e.sequentialRead;else throw f.invalidParameterError("sequentialRead","boolean",e.sequentialRead);if(f.defined(e.raw)){if(f.object(e.raw)&&f.integer(e.raw.width)&&f.inRange(e.raw.width,1,1e8)&&f.integer(e.raw.height)&&f.inRange(e.raw.height,1,1e8)&&f.integer(e.raw.channels)&&f.inRange(e.raw.channels,1,4))switch(n.rawWidth=e.raw.width,n.rawHeight=e.raw.height,n.rawChannels=e.raw.channels,t.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(e.raw.premultiplied))if(f.bool(e.raw.premultiplied))n.rawPremultiplied=e.raw.premultiplied;else throw f.invalidParameterError("raw.premultiplied","boolean",e.raw.premultiplied);if(n.rawPageHeight=0,f.defined(e.raw.pageHeight))if(f.integer(e.raw.pageHeight)&&e.raw.pageHeight>0&&e.raw.pageHeight<=e.raw.height){if(e.raw.height%e.raw.pageHeight!==0)throw new Error(`Expected raw.height ${e.raw.height} to be a multiple of raw.pageHeight ${e.raw.pageHeight}`);n.rawPageHeight=e.raw.pageHeight}else throw f.invalidParameterError("raw.pageHeight","positive integer",e.raw.pageHeight)}if(f.defined(e.animated))if(f.bool(e.animated))n.pages=e.animated?-1:1;else throw f.invalidParameterError("animated","boolean",e.animated);if(f.defined(e.pages))if(f.integer(e.pages)&&f.inRange(e.pages,-1,1e5))n.pages=e.pages;else throw f.invalidParameterError("pages","integer between -1 and 100000",e.pages);if(f.defined(e.page))if(f.integer(e.page)&&f.inRange(e.page,0,1e5))n.page=e.page;else throw f.invalidParameterError("page","integer between 0 and 100000",e.page);if(f.object(e.openSlide)&&f.defined(e.openSlide.level))if(f.integer(e.openSlide.level)&&f.inRange(e.openSlide.level,0,256))n.openSlideLevel=e.openSlide.level;else throw f.invalidParameterError("openSlide.level","integer between 0 and 256",e.openSlide.level);else if(f.defined(e.level))if(f.integer(e.level)&&f.inRange(e.level,0,256))n.openSlideLevel=e.level;else throw f.invalidParameterError("level","integer between 0 and 256",e.level);if(f.object(e.tiff)&&f.defined(e.tiff.subifd))if(f.integer(e.tiff.subifd)&&f.inRange(e.tiff.subifd,-1,1e5))n.tiffSubifd=e.tiff.subifd;else throw f.invalidParameterError("tiff.subifd","integer between -1 and 100000",e.tiff.subifd);else if(f.defined(e.subifd))if(f.integer(e.subifd)&&f.inRange(e.subifd,-1,1e5))n.tiffSubifd=e.subifd;else throw f.invalidParameterError("subifd","integer between -1 and 100000",e.subifd);if(f.object(e.svg)){if(f.defined(e.svg.stylesheet))if(f.string(e.svg.stylesheet))n.svgStylesheet=e.svg.stylesheet;else throw f.invalidParameterError("svg.stylesheet","string",e.svg.stylesheet);if(f.defined(e.svg.highBitdepth))if(f.bool(e.svg.highBitdepth))n.svgHighBitdepth=e.svg.highBitdepth;else throw f.invalidParameterError("svg.highBitdepth","boolean",e.svg.highBitdepth)}if(f.object(e.pdf)&&f.defined(e.pdf.background)?n.pdfBackground=this._getBackgroundColourOption(e.pdf.background):f.defined(e.pdfBackground)&&(n.pdfBackground=this._getBackgroundColourOption(e.pdfBackground)),f.object(e.jp2)&&f.defined(e.jp2.oneshot))if(f.bool(e.jp2.oneshot))n.jp2Oneshot=e.jp2.oneshot;else throw f.invalidParameterError("jp2.oneshot","boolean",e.jp2.oneshot);if(f.defined(e.create))if(f.object(e.create)&&f.integer(e.create.width)&&f.inRange(e.create.width,1,1e8)&&f.integer(e.create.height)&&f.inRange(e.create.height,1,1e8)&&f.integer(e.create.channels)){if(n.createWidth=e.create.width,n.createHeight=e.create.height,n.createChannels=e.create.channels,n.createPageHeight=0,f.defined(e.create.pageHeight))if(f.integer(e.create.pageHeight)&&e.create.pageHeight>0&&e.create.pageHeight<=e.create.height){if(e.create.height%e.create.pageHeight!==0)throw new Error(`Expected create.height ${e.create.height} to be a multiple of create.pageHeight ${e.create.pageHeight}`);n.createPageHeight=e.create.pageHeight}else throw f.invalidParameterError("create.pageHeight","positive integer",e.create.pageHeight);if(f.defined(e.create.noise)){if(!f.object(e.create.noise))throw new Error("Expected noise to be an object");if(e.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(n.createNoiseType=e.create.noise.type,!f.inRange(e.create.channels,1,4))throw f.invalidParameterError("create.channels","number between 1 and 4",e.create.channels);if(n.createNoiseMean=128,f.defined(e.create.noise.mean))if(f.number(e.create.noise.mean)&&f.inRange(e.create.noise.mean,0,1e4))n.createNoiseMean=e.create.noise.mean;else throw f.invalidParameterError("create.noise.mean","number between 0 and 10000",e.create.noise.mean);if(n.createNoiseSigma=30,f.defined(e.create.noise.sigma))if(f.number(e.create.noise.sigma)&&f.inRange(e.create.noise.sigma,0,1e4))n.createNoiseSigma=e.create.noise.sigma;else throw f.invalidParameterError("create.noise.sigma","number between 0 and 10000",e.create.noise.sigma)}else if(f.defined(e.create.background)){if(!f.inRange(e.create.channels,3,4))throw f.invalidParameterError("create.channels","number between 3 and 4",e.create.channels);n.createBackground=this._getBackgroundColourOption(e.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(e.text))if(f.object(e.text)&&f.string(e.text.text)){if(n.textValue=e.text.text,f.defined(e.text.height)&&f.defined(e.text.dpi))throw new Error("Expected only one of dpi or height");if(f.defined(e.text.font))if(f.string(e.text.font))n.textFont=e.text.font;else throw f.invalidParameterError("text.font","string",e.text.font);if(f.defined(e.text.fontfile))if(f.string(e.text.fontfile))n.textFontfile=e.text.fontfile;else throw f.invalidParameterError("text.fontfile","string",e.text.fontfile);if(f.defined(e.text.width))if(f.integer(e.text.width)&&f.inRange(e.text.width,1,1e6))n.textWidth=e.text.width;else throw f.invalidParameterError("text.width","integer between 1 and 1000000",e.text.width);if(f.defined(e.text.height))if(f.integer(e.text.height)&&f.inRange(e.text.height,1,1e6))n.textHeight=e.text.height;else throw f.invalidParameterError("text.height","integer between 1 and 1000000",e.text.height);if(f.defined(e.text.align))if(f.string(e.text.align)&&f.string(this.constructor.align[e.text.align]))n.textAlign=this.constructor.align[e.text.align];else throw f.invalidParameterError("text.align","valid alignment",e.text.align);if(f.defined(e.text.justify))if(f.bool(e.text.justify))n.textJustify=e.text.justify;else throw f.invalidParameterError("text.justify","boolean",e.text.justify);if(f.defined(e.text.dpi))if(f.integer(e.text.dpi)&&f.inRange(e.text.dpi,1,1e6))n.textDpi=e.text.dpi;else throw f.invalidParameterError("text.dpi","integer between 1 and 1000000",e.text.dpi);if(f.defined(e.text.rgba))if(f.bool(e.text.rgba))n.textRgba=e.text.rgba;else throw f.invalidParameterError("text.rgba","bool",e.text.rgba);if(f.defined(e.text.spacing))if(f.integer(e.text.spacing)&&f.inRange(e.text.spacing,-1e6,1e6))n.textSpacing=e.text.spacing;else throw f.invalidParameterError("text.spacing","integer between -1000000 and 1000000",e.text.spacing);if(f.defined(e.text.wrap))if(f.string(e.text.wrap)&&f.inArray(e.text.wrap,["word","char","word-char","none"]))n.textWrap=e.text.wrap;else throw f.invalidParameterError("text.wrap","one of: word, char, word-char, none",e.text.wrap);delete n.buffer}else throw new Error("Expected a valid string to create an image with text.");if(f.defined(e.join))if(f.defined(this.options.join)){if(f.defined(e.join.animated))if(f.bool(e.join.animated))n.joinAnimated=e.join.animated;else throw f.invalidParameterError("join.animated","boolean",e.join.animated);if(f.defined(e.join.across))if(f.integer(e.join.across)&&f.inRange(e.join.across,1,1e6))n.joinAcross=e.join.across;else throw f.invalidParameterError("join.across","integer between 1 and 100000",e.join.across);if(f.defined(e.join.shim))if(f.integer(e.join.shim)&&f.inRange(e.join.shim,0,1e6))n.joinShim=e.join.shim;else throw f.invalidParameterError("join.shim","integer between 0 and 100000",e.join.shim);if(f.defined(e.join.background)&&(n.joinBackground=this._getBackgroundColourOption(e.join.background)),f.defined(e.join.halign))if(f.string(e.join.halign)&&f.string(this.constructor.align[e.join.halign]))n.joinHalign=this.constructor.align[e.join.halign];else throw f.invalidParameterError("join.halign","valid alignment",e.join.halign);if(f.defined(e.join.valign))if(f.string(e.join.valign)&&f.string(this.constructor.align[e.join.valign]))n.joinValign=this.constructor.align[e.join.valign];else throw f.invalidParameterError("join.valign","valid alignment",e.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(f.defined(e))throw new Error(`Invalid input options ${e}`);return n}function CG(t,e,r){Array.isArray(this.options.input.buffer)?f.buffer(t)?(this.options.input.buffer.push(t),r()):r(new Error("Non-Buffer data on Writable Stream")):r(new Error("Unexpected data on Writable Stream"))}function BG(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function DG(){return Array.isArray(this.options.input.buffer)}function NG(t){this.writableFinished?t():this.once("finish",t)}function FG(t){let e=Error();return f.fn(t)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.metadata(this.options,(r,n)=>{r?t(f.nativeError(r,e)):t(null,n)})}):it.metadata(this.options,(r,n)=>{r?t(f.nativeError(r,e)):t(null,n)}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,e)):r(o)})})}):new Promise((r,n)=>{it.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,e)):r(o)})})}function kG(t){let e=Error();return f.fn(t)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.stats(this.options,(r,n)=>{r?t(f.nativeError(r,e)):t(null,n)})}):it.stats(this.options,(r,n)=>{r?t(f.nativeError(r,e)):t(null,n)}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.stats(this.options,(i,o)=>{i?n(f.nativeError(i,e)):r(o)})})}):new Promise((r,n)=>{it.stats(this.options,(i,o)=>{i?n(f.nativeError(i,e)):r(o)})})}var RG,LG,D3,N3=p(()=>{Qi();Cf();RG={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},LG=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"];D3=t=>{Object.assign(t.prototype,{_inputOptionsFromObject:B3,_createInputDescriptor:OG,_write:CG,_flattenBufferIn:BG,_isStreamInput:DG,_whenStreamInFinished:NG,metadata:FG,stats:kG}),t.align=RG}});function oy(t){return t.angle%360!==0||t.rotationAngle!==0}function nm(t){return t.width!==-1||t.height!==-1}function jG(t,e,r){if(nm(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(t))if(f.object(t)&&!f.defined(r))r=t;else if(f.integer(t)&&f.inRange(t,1,1e8))this.options.width=t;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",t);else this.options.width=-1;if(f.defined(e))if(f.integer(e)&&f.inRange(e,1,1e8))this.options.height=e;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",e);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=UG[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:U3[r.position]||G3[r.position]||k3[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(iy[r.kernel]))this.options.kernel=iy[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 oy(this.options)&&nm(this.options)&&(this.options.rotateBefore=!0),this}function zG(t){if(f.integer(t))if(f.inRange(t,1,1e8))this.options.extendTop=t,this.options.extendBottom=t,this.options.extendLeft=t,this.options.extendRight=t;else throw f.invalidParameterError("extend","integer between 1 and 100000000",t);else if(f.object(t)){if(f.defined(t.top))if(f.integer(t.top)&&f.inRange(t.top,0,1e8))this.options.extendTop=t.top;else throw f.invalidParameterError("top","integer between 0 and 100000000",t.top);if(f.defined(t.bottom))if(f.integer(t.bottom)&&f.inRange(t.bottom,0,1e8))this.options.extendBottom=t.bottom;else throw f.invalidParameterError("bottom","integer between 0 and 100000000",t.bottom);if(f.defined(t.left))if(f.integer(t.left)&&f.inRange(t.left,0,1e8))this.options.extendLeft=t.left;else throw f.invalidParameterError("left","integer between 0 and 100000000",t.left);if(f.defined(t.right))if(f.integer(t.right)&&f.inRange(t.right,0,1e8))this.options.extendRight=t.right;else throw f.invalidParameterError("right","integer between 0 and 100000000",t.right);if(this._setBackgroundColourOption("extendBackground",t.background),f.defined(t.extendWith))if(f.string(F3[t.extendWith]))this.options.extendWith=F3[t.extendWith];else throw f.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",t.extendWith)}else throw f.invalidParameterError("extend","integer or object",t);return this}function qG(t){let e=nm(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${e}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(r){let n=t[r];if(f.integer(n)&&f.inRange(n,0,1e8))this.options[r+(r==="left"||r==="top"?"Offset":"")+e]=n;else throw f.invalidParameterError(r,"integer between 0 and 100000000",n)},this),oy(this.options)&&!nm(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function VG(t){if(this.options.trimThreshold=10,f.defined(t))if(f.object(t)){if(f.defined(t.background)&&this._setBackgroundColourOption("trimBackground",t.background),f.defined(t.threshold))if(f.number(t.threshold)&&t.threshold>=0)this.options.trimThreshold=t.threshold;else throw f.invalidParameterError("threshold","positive number",t.threshold);if(f.defined(t.lineArt)&&this._setBooleanOption("trimLineArt",t.lineArt),f.defined(t.margin))if(f.integer(t.margin)&&f.inRange(t.margin,0,1e7))this.options.trimMargin=t.margin;else throw f.invalidParameterError("margin","integer between 0 and 10000000",t.margin)}else throw f.invalidParameterError("trim","object",t);return oy(this.options)&&(this.options.rotateBefore=!0),this}var k3,G3,F3,U3,iy,GG,UG,j3,z3=p(()=>{Qi();k3={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},G3={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},F3={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},U3={entropy:16,attention:17},iy={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},GG={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},UG={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};j3=t=>{Object.assign(t.prototype,{resize:jG,extend:zG,extract:qG,trim:VG}),t.gravity=k3,t.strategy=U3,t.kernel=iy,t.fit=GG,t.position=G3}});function WG(t){if(!Array.isArray(t))throw f.invalidParameterError("images to composite","array",t);return this.options.composite=t.map(e=>{if(!f.object(e))throw f.invalidParameterError("image to composite","object",e);let r=this._inputOptionsFromObject(e),n={input:this._createInputDescriptor(e.input,r,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(f.defined(e.blend))if(f.string(sy[e.blend]))n.blend=sy[e.blend];else throw f.invalidParameterError("blend","valid blend name",e.blend);if(f.defined(e.tile))if(f.bool(e.tile))n.tile=e.tile;else throw f.invalidParameterError("tile","boolean",e.tile);if(f.defined(e.left))if(f.integer(e.left)&&f.inRange(e.left,-1e8,1e8))n.left=e.left;else throw f.invalidParameterError("left","integer between -100000000 and 100000000",e.left);if(f.defined(e.top))if(f.integer(e.top)&&f.inRange(e.top,-1e8,1e8))n.top=e.top;else throw f.invalidParameterError("top","integer between -100000000 and 100000000",e.top);if(f.defined(e.top)!==f.defined(e.left))throw new Error("Expected both left and top to be set");if(n.hasOffset=f.integer(e.top)&&f.integer(e.left),f.defined(e.gravity))if(f.integer(e.gravity)&&f.inRange(e.gravity,0,8))n.gravity=e.gravity;else if(f.string(e.gravity)&&f.integer(this.constructor.gravity[e.gravity]))n.gravity=this.constructor.gravity[e.gravity];else throw f.invalidParameterError("gravity","valid gravity",e.gravity);if(f.defined(e.premultiplied))if(f.bool(e.premultiplied))n.premultiplied=e.premultiplied;else throw f.invalidParameterError("premultiplied","boolean",e.premultiplied);return n}),this}var sy,q3,V3=p(()=>{Qi();sy={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"};q3=t=>{t.prototype.composite=WG,t.blend=sy}});function $G(t,e){if(!f.defined(t))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(t)&&!(t%90))this.options.angle=t;else if(f.number(t))this.options.rotationAngle=t,f.object(e)&&e.background&&this._setBackgroundColourOption("rotationBackground",e.background);else throw f.invalidParameterError("angle","numeric",t);return this}function HG(){return this.options.input.autoOrient=!0,this}function KG(t){return this.options.flip=f.bool(t)?t:!0,this}function XG(t){return this.options.flop=f.bool(t)?t:!0,this}function YG(t,e){let n=Array.isArray(t)&&(t.length===4&&t.every(f.number)||t.length===2&&t.every(i=>Array.isArray(i)&&i.length===2))?t.flat():[];if(n.length===4&&n.every(f.number))this.options.affineMatrix=n;else throw f.invalidParameterError("matrix","1x4 or 2x2 array",t);if(f.defined(e))if(f.object(e)){if(this._setBackgroundColourOption("affineBackground",e.background),f.defined(e.idx))if(f.number(e.idx))this.options.affineIdx=e.idx;else throw f.invalidParameterError("options.idx","number",e.idx);if(f.defined(e.idy))if(f.number(e.idy))this.options.affineIdy=e.idy;else throw f.invalidParameterError("options.idy","number",e.idy);if(f.defined(e.odx))if(f.number(e.odx))this.options.affineOdx=e.odx;else throw f.invalidParameterError("options.odx","number",e.odx);if(f.defined(e.ody))if(f.number(e.ody))this.options.affineOdy=e.ody;else throw f.invalidParameterError("options.ody","number",e.ody);if(f.defined(e.interpolator))if(f.inArray(e.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=e.interpolator;else throw f.invalidParameterError("options.interpolator","valid interpolator name",e.interpolator)}else throw f.invalidParameterError("options","object",e);return this}function ZG(t){if(f.plainObject(t)){if(f.number(t.sigma)&&f.inRange(t.sigma,1e-6,10))this.options.sharpenSigma=t.sigma;else throw f.invalidParameterError("options.sigma","number between 0.000001 and 10",t.sigma);if(f.defined(t.m1))if(f.number(t.m1)&&f.inRange(t.m1,0,1e6))this.options.sharpenM1=t.m1;else throw f.invalidParameterError("options.m1","number between 0 and 1000000",t.m1);if(f.defined(t.m2))if(f.number(t.m2)&&f.inRange(t.m2,0,1e6))this.options.sharpenM2=t.m2;else throw f.invalidParameterError("options.m2","number between 0 and 1000000",t.m2);if(f.defined(t.x1))if(f.number(t.x1)&&f.inRange(t.x1,0,1e6))this.options.sharpenX1=t.x1;else throw f.invalidParameterError("options.x1","number between 0 and 1000000",t.x1);if(f.defined(t.y2))if(f.number(t.y2)&&f.inRange(t.y2,0,1e6))this.options.sharpenY2=t.y2;else throw f.invalidParameterError("options.y2","number between 0 and 1000000",t.y2);if(f.defined(t.y3))if(f.number(t.y3)&&f.inRange(t.y3,0,1e6))this.options.sharpenY3=t.y3;else throw f.invalidParameterError("options.y3","number between 0 and 1000000",t.y3)}else this.options.sharpenSigma=-1;return this}function JG(t){if(!f.defined(t))this.options.medianSize=3;else if(f.integer(t)&&f.inRange(t,1,1e3))this.options.medianSize=t;else throw f.invalidParameterError("size","integer between 1 and 1000",t);return this}function QG(t){let e;if(f.number(t))e=t;else if(f.plainObject(t)){if(!f.number(t.sigma))throw f.invalidParameterError("options.sigma","number between 0.3 and 1000",e);if(e=t.sigma,"precision"in t)if(f.string(W3[t.precision]))this.options.precision=W3[t.precision];else throw f.invalidParameterError("precision","one of: integer, float, approximate",t.precision);if("minAmplitude"in t)if(f.number(t.minAmplitude)&&f.inRange(t.minAmplitude,.001,1))this.options.minAmpl=t.minAmplitude;else throw f.invalidParameterError("minAmplitude","number between 0.001 and 1",t.minAmplitude)}if(!f.defined(t))this.options.blurSigma=-1;else if(f.bool(t))this.options.blurSigma=t?-1:0;else if(f.number(e)&&f.inRange(e,.3,1e3))this.options.blurSigma=e;else throw f.invalidParameterError("sigma","number between 0.3 and 1000",e);return this}function eU(t){if(!f.defined(t))this.options.dilateWidth=1;else if(f.integer(t)&&f.inRange(t,1,65536))this.options.dilateWidth=t;else throw f.invalidParameterError("width","integer between 1 and 65536",t);return this}function tU(t){if(!f.defined(t))this.options.erodeWidth=1;else if(f.integer(t)&&f.inRange(t,1,65536))this.options.erodeWidth=t;else throw f.invalidParameterError("width","integer between 1 and 65536",t);return this}function rU(t){return this.options.flatten=f.bool(t)?t:!0,f.object(t)&&this._setBackgroundColourOption("flattenBackground",t.background),this}function nU(){return this.options.unflatten=!0,this}function iU(t,e){if(!f.defined(t))this.options.gamma=2.2;else if(f.number(t)&&f.inRange(t,1,3))this.options.gamma=t;else throw f.invalidParameterError("gamma","number between 1.0 and 3.0",t);if(!f.defined(e))this.options.gammaOut=this.options.gamma;else if(f.number(e)&&f.inRange(e,1,3))this.options.gammaOut=e;else throw f.invalidParameterError("gammaOut","number between 1.0 and 3.0",e);return this}function oU(t){if(this.options.negate=f.bool(t)?t:!0,f.plainObject(t)&&"alpha"in t)if(f.bool(t.alpha))this.options.negateAlpha=t.alpha;else throw f.invalidParameterError("alpha","should be boolean value",t.alpha);return this}function sU(t){if(f.plainObject(t)){if(f.defined(t.lower))if(f.number(t.lower)&&f.inRange(t.lower,0,99))this.options.normaliseLower=t.lower;else throw f.invalidParameterError("lower","number between 0 and 99",t.lower);if(f.defined(t.upper))if(f.number(t.upper)&&f.inRange(t.upper,1,100))this.options.normaliseUpper=t.upper;else throw f.invalidParameterError("upper","number between 1 and 100",t.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 aU(t){return this.normalise(t)}function cU(t){if(f.plainObject(t)){if(f.integer(t.width)&&f.inRange(t.width,1,65536))this.options.claheWidth=t.width;else throw f.invalidParameterError("width","integer between 1 and 65536",t.width);if(f.integer(t.height)&&f.inRange(t.height,1,65536))this.options.claheHeight=t.height;else throw f.invalidParameterError("height","integer between 1 and 65536",t.height);if(f.defined(t.maxSlope))if(f.integer(t.maxSlope)&&f.inRange(t.maxSlope,0,100))this.options.claheMaxSlope=t.maxSlope;else throw f.invalidParameterError("maxSlope","integer between 0 and 100",t.maxSlope)}else throw f.invalidParameterError("options","plain object",t);return this}function lU(t){if(!f.object(t)||!Array.isArray(t.kernel)||!f.integer(t.width)||!f.integer(t.height)||!f.inRange(t.width,3,1001)||!f.inRange(t.height,3,1001)||t.height*t.width!==t.kernel.length||!t.kernel.every(f.number))throw new Error("Invalid convolution kernel");return f.integer(t.scale)||(t.scale=t.kernel.reduce((e,r)=>e+r,0)),t.scale<1&&(t.scale=1),f.integer(t.offset)||(t.offset=0),this.options.convKernel=t,this}function uU(t,e){if(!f.defined(t))this.options.threshold=128;else if(f.bool(t))this.options.threshold=t?128:0;else if(f.integer(t)&&f.inRange(t,0,255))this.options.threshold=t;else throw f.invalidParameterError("threshold","integer between 0 and 255",t);return!f.object(e)||e.greyscale===!0||e.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function fU(t,e,r){if(this.options.boolean=this._createInputDescriptor(t,r),f.string(e)&&f.inArray(e,["and","or","eor"]))this.options.booleanOp=e;else throw f.invalidParameterError("operator","one of: and, or, eor",e);return this}function hU(t,e){if(!f.defined(t)&&f.number(e)?t=1:f.number(t)&&!f.defined(e)&&(e=0),!f.defined(t))this.options.linearA=[];else if(f.number(t))this.options.linearA=[t];else if(Array.isArray(t)&&f.inRange(t.length,1,1e6)&&t.every(f.number))this.options.linearA=t;else throw f.invalidParameterError("a","number or array of numbers",t);if(!f.defined(e))this.options.linearB=[];else if(f.number(e))this.options.linearB=[e];else if(Array.isArray(e)&&f.inRange(e.length,1,1e6)&&e.every(f.number))this.options.linearB=e;else throw f.invalidParameterError("b","number or array of numbers",e);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 dU(t){if(!Array.isArray(t))throw f.invalidParameterError("inputMatrix","array",t);let e=t.length;if(e!==3&&e!==4)throw f.invalidParameterError("inputMatrix","3x3 or 4x4 array",e);if(!t.every(n=>Array.isArray(n)&&n.length===e))throw f.invalidParameterError("inputMatrix",`array of ${e} arrays of length ${e}`,t);let r=t.flat();if(!r.every(f.number))throw f.invalidParameterError("inputMatrix","array of numbers",r);return this.options.recombMatrix=r,this}function mU(t){if(!f.plainObject(t))throw f.invalidParameterError("options","plain object",t);if("brightness"in t)if(f.number(t.brightness)&&t.brightness>=0)this.options.brightness=t.brightness;else throw f.invalidParameterError("brightness","number above zero",t.brightness);if("saturation"in t)if(f.number(t.saturation)&&t.saturation>=0)this.options.saturation=t.saturation;else throw f.invalidParameterError("saturation","number above zero",t.saturation);if("hue"in t)if(f.integer(t.hue))this.options.hue=t.hue%360;else throw f.invalidParameterError("hue","number",t.hue);if("lightness"in t)if(f.number(t.lightness))this.options.lightness=t.lightness;else throw f.invalidParameterError("lightness","number",t.lightness);return this}var W3,$3,H3=p(()=>{Qi();W3={integer:"integer",float:"float",approximate:"approximate"};$3=t=>{Object.assign(t.prototype,{autoOrient:HG,rotate:$G,flip:KG,flop:XG,affine:YG,sharpen:ZG,erode:tU,dilate:eU,median:JG,blur:QG,flatten:rU,unflatten:nU,gamma:iU,negate:oU,normalise:sU,normalize:aU,clahe:cU,convolve:lU,threshold:uU,boolean:fU,linear:hU,recomb:dU,modulate:mU})}});var Q3=ae((aee,J3)=>{var fy=Object.defineProperty,pU=Object.getOwnPropertyDescriptor,gU=Object.getOwnPropertyNames,yU=Object.prototype.hasOwnProperty,bU=(t,e)=>{for(var r in e)fy(t,r,{get:e[r],enumerable:!0})},wU=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of gU(e))!yU.call(t,i)&&i!==r&&fy(t,i,{get:()=>e[i],enumerable:!(n=pU(e,i))||n.enumerable});return t},xU=t=>wU(fy({},"__esModule",{value:!0}),t),K3={};bU(K3,{default:()=>BU});J3.exports=xU(K3);var ay={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 t in ay)Object.freeze(ay[t]);var oo=Object.freeze(ay),X3=Object.create(null);for(let t in oo)Object.hasOwn(oo,t)&&(X3[oo[t]]=t);var dn={to:{},get:{}};dn.get=function(t){let e=t.slice(0,3).toLowerCase(),r,n;switch(e){case"hsl":{r=dn.get.hsl(t),n="hsl";break}case"hwb":{r=dn.get.hwb(t),n="hwb";break}default:{r=dn.get.rgb(t),n="rgb";break}}return r?{model:n,value:r}:null};dn.get.rgb=function(t){if(!t)return null;let e=/^#([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=t.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=t.match(e)){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=t.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=t.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=t.toLowerCase().match(o))?a[1]==="transparent"?[0,0,0,0]:Object.hasOwn(oo,a[1])?(s=oo[a[1]].slice(),s[3]=1,s):null:null;for(c=0;c<3;c++)s[c]=Bs(s[c],0,255);return s[3]=Bs(s[3],0,1),s};dn.get.hsl=function(t){if(!t)return null;let e=/^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=t.match(e);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,o=Bs(Number.parseFloat(r[2]),0,100),s=Bs(Number.parseFloat(r[3]),0,100),a=Bs(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};dn.get.hwb=function(t){if(!t)return null;let e=/^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=t.match(e);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,o=Bs(Number.parseFloat(r[2]),0,100),s=Bs(Number.parseFloat(r[3]),0,100),a=Bs(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};dn.to.hex=function(...t){return"#"+im(t[0])+im(t[1])+im(t[2])+(t[3]<1?im(Math.round(t[3]*255)):"")};dn.to.rgb=function(...t){return t.length<4||t[3]===1?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"};dn.to.rgb.percent=function(...t){let e=Math.round(t[0]/255*100),r=Math.round(t[1]/255*100),n=Math.round(t[2]/255*100);return t.length<4||t[3]===1?"rgb("+e+"%, "+r+"%, "+n+"%)":"rgba("+e+"%, "+r+"%, "+n+"%, "+t[3]+")"};dn.to.hsl=function(...t){return t.length<4||t[3]===1?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};dn.to.hwb=function(...t){let e="";return t.length>=4&&t[3]!==1&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"};dn.to.keyword=function(...t){return X3[t.slice(0,3)]};function Bs(t,e,r){return Math.min(Math.max(e,t),r)}function im(t){let e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}var Bl=dn,Y3={};for(let t of Object.keys(oo))Y3[oo[t]]=t;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"]}},Ha=X,Uo=(6/29)**3;function Nl(t){let e=t>.0031308?1.055*t**.4166666666666667-.055:t*12.92;return Math.min(Math.max(0,e),1)}function Fl(t){return t>.04045?((t+.055)/1.055)**2.4:t/12.92}for(let t of Object.keys(X)){if(!("channels"in X[t]))throw new Error("missing channels property: "+t);if(!("labels"in X[t]))throw new Error("missing channel labels property: "+t);if(X[t].labels.length!==X[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=X[t];delete X[t].channels,delete X[t].labels,Object.defineProperty(X[t],"channels",{value:e}),Object.defineProperty(X[t],"labels",{value:r})}X.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,c;switch(o){case i:{a=0;break}case e:{a=(r-n)/s;break}case r:{a=2+(n-e)/s;break}case n:{a=4+(e-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(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,c=t[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,e=h(s),r=h(a),n=h(c),l){case s:{i=n-r;break}case a:{i=1/3+e-n;break}case c:{i=2/3+r-e;break}}i<0?i+=1:i>1&&(i-=1)}return[i*360,o*100,l*100]};X.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=X.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};X.rgb.oklab=function(t){let e=Fl(t[0]/255),r=Fl(t[1]/255),n=Fl(t[2]/255),i=Math.cbrt(.4122214708*e+.5363325363*r+.0514459929*n),o=Math.cbrt(.2119034982*e+.6806995451*r+.1073969566*n),s=Math.cbrt(.0883024619*e+.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(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),o=(1-e-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 _U(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}X.rgb.keyword=function(t){let e=Y3[t];if(e)return e;let r=Number.POSITIVE_INFINITY,n;for(let i of Object.keys(oo)){let o=oo[i],s=_U(t,o);s<r&&(r=s,n=i)}return n};X.keyword.rgb=function(t){return[...oo[t]]};X.rgb.xyz=function(t){let e=Fl(t[0]/255),r=Fl(t[1]/255),n=Fl(t[2]/255),i=e*.4124564+r*.3575761+n*.1804375,o=e*.2126729+r*.7151522+n*.072175,s=e*.0193339+r*.119192+n*.9503041;return[i*100,o*100,s*100]};X.rgb.lab=function(t){let e=X.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>Uo?r**(1/3):7.787*r+16/116,n=n>Uo?n**(1/3):7.787*n+16/116,i=i>Uo?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(t){let e=t[0]/360,r=t[1]/100,n=t[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=e+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(t){let e=t[0],r=t[1]/100,n=t[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[e,a*100,s*100]};X.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),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(t){let e=t[0],r=t[1]/100,n=t[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,[e,o*100,s*100]};X.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-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(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o=1-Math.min(1,e*(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(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2404542+r*-1.5371385+n*-.4985314,o=e*-.969266+r*1.8760108+n*.041556,s=e*.0556434+r*-.2040259+n*1.0572252,i=Nl(i),o=Nl(o),s=Nl(s),[i*255,o*255,s*255]};X.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>Uo?e**(1/3):7.787*e+16/116,r=r>Uo?r**(1/3):7.787*r+16/116,n=n>Uo?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(e-r),s=200*(r-n);return[i,o,s]};X.xyz.oklab=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=Math.cbrt(.8189330101*e+.3618667424*r-.1288597137*n),o=Math.cbrt(.0329845436*e+.9293118715*r+.0361456387*n),s=Math.cbrt(.0482003018*e+.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(t){return X.lab.lch(t)};X.oklab.xyz=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=(.999999998*e+.396337792*r+.215803758*n)**3,o=(1.000000008*e-.105561342*r-.063854175*n)**3,s=(1.000000055*e-.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(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=(e+.3963377774*r+.2158037573*n)**3,o=(e-.1055613458*r-.0638541728*n)**3,s=(e-.0894841775*r-1.291485548*n)**3,a=Nl(4.0767416621*i-3.3077115913*o+.2309699292*s),c=Nl(-1.2684380046*i+2.6097574011*o-.3413193965*s),l=Nl(-.0041960863*i-.7034186147*o+1.707614701*s);return[a*255,c*255,l*255]};X.oklch.oklab=function(t){return X.lch.lab(t)};X.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;let a=o**3,c=i**3,l=s**3;return o=a>Uo?a:(o-16/116)/7.787,i=c>Uo?c:(i-16/116)/7.787,s=l>Uo?l:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};X.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[e,s,i]};X.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[e,o,s]};X.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?X.rgb.hsv(t)[2]:e;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(t){return X.rgb.ansi16(X.hsv.rgb(t),t[2])};X.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e>>4===r>>4&&r>>4===n>>4?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};X.ansi16.rgb=function(t){t=t[0];let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(Math.trunc(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};X.ansi256.rgb=function(t){if(t=t[0],t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};X.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r};X.hex.rgb=function(t){let e=t.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!e)return[0,0,0];let r=e[0];e[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(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,c=s<1?o/(1-s):0;return s<=0?a=0:i===e?a=(r-n)/s%6:i===r?a=2+(n-e)/s:a=4+(e-r)/s,a/=6,a%=1,[a*360,s*100,c*100]};X.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};X.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};X.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%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(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};X.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};X.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};X.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};X.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};X.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};X.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};X.gray.hsl=function(t){return[0,0,t[0]]};X.gray.hsv=X.gray.hsl;X.gray.hwb=function(t){return[0,100,t[0]]};X.gray.cmyk=function(t){return[0,0,0,t[0]]};X.gray.lab=function(t){return[t[0],0,0]};X.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".slice(n.length)+n};X.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};function SU(){let t={},e=Object.keys(Ha);for(let{length:r}=e,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function MU(t){let e=SU(),r=[t];for(e[t].distance=0;r.length>0;){let n=r.pop(),i=Object.keys(Ha[n]);for(let{length:o}=i,s=0;s<o;s++){let a=i[s],c=e[a];c.distance===-1&&(c.distance=e[n].distance+1,c.parent=n,r.unshift(a))}}return e}function vU(t,e){return function(r){return e(t(r))}}function EU(t,e){let r=[e[t].parent,t],n=Ha[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=vU(Ha[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}function TU(t){let e=MU(t),r={},n=Object.keys(e);for(let{length:i}=n,o=0;o<i;o++){let s=n[o];e[s].parent!==null&&(r[s]=EU(s,e))}return r}var AU=TU,Dl={},IU=Object.keys(Ha);function PU(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function RU(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=t(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 t&&(e.conversion=t.conversion),e}for(let t of IU){Dl[t]={},Object.defineProperty(Dl[t],"channels",{value:Ha[t].channels}),Object.defineProperty(Dl[t],"labels",{value:Ha[t].labels});let e=AU(t),r=Object.keys(e);for(let n of r){let i=e[n];Dl[t][n]=RU(i),Dl[t][n].raw=PU(i)}}var Ln=Dl,Z3=["keyword","gray","hex"],cy={};for(let t of Object.keys(Ln))cy[[...Ln[t].labels].sort().join("")]=t;var ly={};function br(t,e){if(!(this instanceof br))return new br(t,e);if(e&&e in Z3&&(e=null),e&&!(e in Ln))throw new Error("Unknown model: "+e);let r,n;if(t==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof br)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if(typeof t=="string"){let i=Bl.get(t);if(i===null)throw new Error("Unable to parse color from string: "+t);this.model=i.model,n=Ln[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(t.length>0){this.model=e||"rgb",n=Ln[this.model].channels;let i=Array.prototype.slice.call(t,0,n);this.color=uy(i,n),this.valpha=typeof t[n]=="number"?t[n]:1}else if(typeof t=="number")this.model="rgb",this.color=[t>>16&255,t>>8&255,t&255],this.valpha=1;else{this.valpha=1;let i=Object.keys(t);"alpha"in t&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof t.alpha=="number"?t.alpha:0);let o=i.sort().join("");if(!(o in cy))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=cy[o];let{labels:s}=Ln[this.model],a=[];for(r=0;r<s.length;r++)a.push(t[s[r]]);this.color=uy(a)}if(ly[this.model])for(n=Ln[this.model].channels,r=0;r<n;r++){let i=ly[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(t){let e=this.model in Bl.to?this:this.rgb();e=e.round(typeof t=="number"?t:1);let r=e.valpha===1?e.color:[...e.color,this.valpha];return Bl.to[e.model](...r)},percentString(t){let e=this.rgb().round(typeof t=="number"?t:1),r=e.valpha===1?e.color:[...e.color,this.valpha];return Bl.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let t={},{channels:e}=Ln[this.model],{labels:r}=Ln[this.model];for(let n=0;n<e;n++)t[r[n]]=this.color[n];return this.valpha!==1&&(t.alpha=this.valpha),t},unitArray(){let t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,this.valpha!==1&&t.push(this.valpha),t},unitObject(){let t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,this.valpha!==1&&(t.alpha=this.valpha),t},round(t){return t=Math.max(t||0,0),new br([...this.color.map(OU(t)),this.valpha],this.model)},alpha(t){return t!==void 0?new br([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},red:zt("rgb",0,sr(255)),green:zt("rgb",1,sr(255)),blue:zt("rgb",2,sr(255)),hue:zt(["hsl","hsv","hsl","hwb","hcg"],0,t=>(t%360+360)%360),saturationl:zt("hsl",1,sr(100)),lightness:zt("hsl",2,sr(100)),saturationv:zt("hsv",1,sr(100)),value:zt("hsv",2,sr(100)),chroma:zt("hcg",1,sr(100)),gray:zt("hcg",2,sr(100)),white:zt("hwb",1,sr(100)),wblack:zt("hwb",2,sr(100)),cyan:zt("cmyk",0,sr(100)),magenta:zt("cmyk",1,sr(100)),yellow:zt("cmyk",2,sr(100)),black:zt("cmyk",3,sr(100)),x:zt("xyz",0,sr(95.047)),y:zt("xyz",1,sr(100)),z:zt("xyz",2,sr(108.833)),l:zt("lab",0,sr(100)),a:zt("lab",1),b:zt("lab",2),keyword(t){return t!==void 0?new br(t):Ln[this.model].keyword(this.color)},hex(t){return t!==void 0?new br(t):Bl.to.hex(...this.rgb().round().color)},hexa(t){if(t!==void 0)return new br(t);let e=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r="0"+r),Bl.to.hex(...e)+r},rgbNumber(){let t=this.rgb().color;return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255},luminosity(){let t=this.rgb().color,e=[];for(let[r,n]of t.entries()){let i=n/255;e[r]=i<=.04045?i/12.92:((i+.055)/1.055)**2.4}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast(t){let e=this.luminosity(),r=t.luminosity();return e>r?(e+.05)/(r+.05):(r+.05)/(e+.05)},level(t){let e=this.contrast(t);return e>=7?"AAA":e>=4.5?"AA":""},isDark(){let t=this.rgb().color;return(t[0]*2126+t[1]*7152+t[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let t=this.rgb();for(let e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten(t){let e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){let e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate(t){let e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate(t){let e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten(t){let e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken(t){let e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale(){let t=this.rgb().color,e=t[0]*.3+t[1]*.59+t[2]*.11;return br.rgb(e,e,e)},fade(t){return this.alpha(this.valpha-this.valpha*t)},opaquer(t){return this.alpha(this.valpha+this.valpha*t)},rotate(t){let e=this.hsl(),r=e.color[0];return r=(r+t)%360,r=r<0?360+r:r,e.color[0]=r,e},mix(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);let r=t.rgb(),n=this.rgb(),i=e===void 0?.5:e,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 t of Object.keys(Ln)){if(Z3.includes(t))continue;let{channels:e}=Ln[t];br.prototype[t]=function(...r){return this.model===t?new br(this):r.length>0?new br(r,t):new br([...CU(Ln[this.model][t].raw(this.color)),this.valpha],t)},br[t]=function(...r){let n=r[0];return typeof n=="number"&&(n=uy(r,e)),new br(n,t)}}function LU(t,e){return Number(t.toFixed(e))}function OU(t){return function(e){return LU(e,t)}}function zt(t,e,r){t=Array.isArray(t)?t:[t];for(let n of t)(ly[n]||=[])[e]=r;return t=t[0],function(n){let i;return n!==void 0?(r&&(n=r(n)),i=this[t](),i.color[e]=n,i):(i=this[t]().color[e],r&&(i=r(i)),i)}}function sr(t){return function(e){return Math.max(0,Math.min(t,e))}}function CU(t){return Array.isArray(t)?t:[t]}function uy(t,e){for(let r=0;r<e;r++)typeof t[r]!="number"&&(t[r]=0);return t}var BU=br});var tE=ae((cee,eE)=>{eE.exports=Q3().default});function DU(t){return this._setBackgroundColourOption("tint",t),this}function NU(t){return this.options.greyscale=f.bool(t)?t:!0,this}function FU(t){return this.greyscale(t)}function kU(t){if(!f.string(t))throw f.invalidParameterError("colourspace","string",t);return this.options.colourspacePipeline=t,this}function GU(t){return this.pipelineColourspace(t)}function UU(t){if(!f.string(t))throw f.invalidParameterError("colourspace","string",t);return this.options.colourspace=t,this}function jU(t){return this.toColourspace(t)}function iE(t){if(f.object(t)||f.string(t)&&t.length>=3&&t.length<=200){let e=(0,nE.default)(t),r=e.red(),n=e.green(),i=e.blue(),o=Math.round(e.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",t)}function zU(t,e){f.defined(e)&&(this.options[t]=iE(e))}var nE,rE,oE,sE=p(()=>{nE=me(tE(),1);Qi();rE={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};oE=t=>{Object.assign(t.prototype,{tint:DU,greyscale:NU,grayscale:FU,pipelineColourspace:kU,pipelineColorspace:GU,toColourspace:UU,toColorspace:jU,_getBackgroundColourOption:iE,_setBackgroundColourOption:zU}),t.colourspace=rE,t.colorspace=rE}});function VU(){return this.options.removeAlpha=!0,this}function WU(t){if(f.defined(t))if(f.number(t)&&f.inRange(t,0,1))this.options.ensureAlpha=t;else throw f.invalidParameterError("alpha","number between 0 and 1",t);else this.options.ensureAlpha=1;return this}function $U(t){let e={red:0,green:1,blue:2,alpha:3};if(Object.keys(e).includes(t)&&(t=e[t]),f.integer(t)&&f.inRange(t,0,4))this.options.extractChannel=t;else throw f.invalidParameterError("channel","integer or one of: red, green, blue, alpha",t);return this}function HU(t,e){return Array.isArray(t)?t.forEach(function(r){this.options.joinChannelIn.push(this._createInputDescriptor(r,e))},this):this.options.joinChannelIn.push(this._createInputDescriptor(t,e)),this}function KU(t){if(f.string(t)&&f.inArray(t,["and","or","eor"]))this.options.bandBoolOp=t;else throw f.invalidParameterError("boolOp","one of: and, or, eor",t);return this}var qU,aE,cE=p(()=>{Qi();qU={and:"and",or:"or",eor:"eor"};aE=t=>{Object.assign(t.prototype,{removeAlpha:VU,ensureAlpha:WU,extractChannel:$U,joinChannel:HU,bandbool:KU}),t.bool=qU}});function YU(t,e){let r;if(f.string(t)?f.string(this.options.input.file)&&om.default.resolve(this.options.input.file)===om.default.resolve(t)?r=new Error("Cannot use same file for input and output"):XU.test(om.default.extname(t))&&!this.constructor.format.jp2.output.file&&(r=uE()):r=new Error("Missing output file path"),r)if(f.fn(e))e(r);else return Promise.reject(r);else{this.options.fileOut=t;let n=Error();return this._pipeline(e,n)}return this}function ZU(t,e){f.object(t)?this._setBooleanOption("resolveWithObject",t.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let r=Error();return this._pipeline(f.fn(t)?t:e,r)}function JU(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let t=Error();return this._pipeline(null,t)}function QU(t){if(f.number(t)&&t>0)this.options.withMetadataDensity=t;else throw f.invalidParameterError("density","positive number",t);return this.keepExif()}function ej(){return this.options.keepMetadata|=1,this}function tj(t){if(f.object(t))for(let[e,r]of Object.entries(t))if(f.object(r))for(let[n,i]of Object.entries(r))if(f.string(i))this.options.withExif[`exif-${e.toLowerCase()}-${n}`]=i;else throw f.invalidParameterError(`${e}.${n}`,"string",i);else throw f.invalidParameterError(e,"object",r);else throw f.invalidParameterError("exif","object",t);return this.options.withExifMerge=!1,this.keepExif()}function rj(t){return this.withExif(t),this.options.withExifMerge=!0,this}function nj(){return this.options.keepMetadata|=8,this}function ij(t,e){if(f.string(t))this.options.withIccProfile=t;else throw f.invalidParameterError("icc","string",t);if(this.keepIccProfile(),f.object(e)&&f.defined(e.attach))if(f.bool(e.attach))e.attach||(this.options.keepMetadata&=-9);else throw f.invalidParameterError("attach","boolean",e.attach);return this}function oj(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function sj(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function aj(){return this.options.keepMetadata|=2,this}function cj(t){if(f.string(t)&&t.length>0)this.options.withXmp=t,this.options.keepMetadata|=2;else throw f.invalidParameterError("xmp","non-empty string",t);return this}function lj(){return this.options.keepMetadata|=31,this}function uj(t){if(this.keepMetadata(),this.withIccProfile("srgb"),f.object(t)){if(f.defined(t.orientation))if(f.integer(t.orientation)&&f.inRange(t.orientation,1,8))this.options.withMetadataOrientation=t.orientation;else throw f.invalidParameterError("orientation","integer between 1 and 8",t.orientation);if(f.defined(t.density))if(f.number(t.density)&&t.density>0)this.options.withMetadataDensity=t.density;else throw f.invalidParameterError("density","positive number",t.density);f.defined(t.icc)&&this.withIccProfile(t.icc),f.defined(t.exif)&&this.withExifMerge(t.exif)}return this}function fj(t,e){let r=lE.get((f.object(t)&&f.string(t.id)?t.id:t).toLowerCase());if(!r)throw f.invalidParameterError("format",`one of: ${[...lE.keys()].join(", ")}`,t);return this[r](e)}function hj(t){if(f.object(t)){if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,1,100))this.options.jpegQuality=t.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",t.quality);if(f.defined(t.progressive)&&this._setBooleanOption("jpegProgressive",t.progressive),f.defined(t.chromaSubsampling))if(f.string(t.chromaSubsampling)&&f.inArray(t.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=t.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",t.chromaSubsampling);let e=f.bool(t.optimizeCoding)?t.optimizeCoding:t.optimiseCoding;if(f.defined(e)&&this._setBooleanOption("jpegOptimiseCoding",e),f.defined(t.mozjpeg))if(f.bool(t.mozjpeg))t.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",t.mozjpeg);let r=f.bool(t.trellisQuantization)?t.trellisQuantization:t.trellisQuantisation;f.defined(r)&&this._setBooleanOption("jpegTrellisQuantisation",r),f.defined(t.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",t.overshootDeringing);let n=f.bool(t.optimizeScans)?t.optimizeScans:t.optimiseScans;f.defined(n)&&(this._setBooleanOption("jpegOptimiseScans",n),n&&(this.options.jpegProgressive=!0));let i=f.number(t.quantizationTable)?t.quantizationTable:t.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",t)}function dj(t){if(f.object(t)){if(f.defined(t.progressive)&&this._setBooleanOption("pngProgressive",t.progressive),f.defined(t.compressionLevel))if(f.integer(t.compressionLevel)&&f.inRange(t.compressionLevel,0,9))this.options.pngCompressionLevel=t.compressionLevel;else throw f.invalidParameterError("compressionLevel","integer between 0 and 9",t.compressionLevel);f.defined(t.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",t.adaptiveFiltering);let e=t.colours||t.colors;if(f.defined(e))if(f.integer(e)&&f.inRange(e,2,256))this.options.pngBitdepth=fE(e);else throw f.invalidParameterError("colours","integer between 2 and 256",e);if(f.defined(t.palette)?this._setBooleanOption("pngPalette",t.palette):[t.quality,t.effort,t.colours,t.colors,t.dither].some(f.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,0,100))this.options.pngQuality=t.quality;else throw f.invalidParameterError("quality","integer between 0 and 100",t.quality);if(f.defined(t.effort))if(f.integer(t.effort)&&f.inRange(t.effort,1,10))this.options.pngEffort=t.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",t.effort);if(f.defined(t.dither))if(f.number(t.dither)&&f.inRange(t.dither,0,1))this.options.pngDither=t.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",t.dither)}}return this._updateFormatOut("png",t)}function mj(t){if(f.object(t)){if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,1,100))this.options.webpQuality=t.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",t.quality);if(f.defined(t.alphaQuality))if(f.integer(t.alphaQuality)&&f.inRange(t.alphaQuality,0,100))this.options.webpAlphaQuality=t.alphaQuality;else throw f.invalidParameterError("alphaQuality","integer between 0 and 100",t.alphaQuality);if(f.defined(t.lossless)&&this._setBooleanOption("webpLossless",t.lossless),f.defined(t.nearLossless)&&this._setBooleanOption("webpNearLossless",t.nearLossless),f.defined(t.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",t.smartSubsample),f.defined(t.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",t.smartDeblock),f.defined(t.preset))if(f.string(t.preset)&&f.inArray(t.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=t.preset;else throw f.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",t.preset);if(f.defined(t.effort))if(f.integer(t.effort)&&f.inRange(t.effort,0,6))this.options.webpEffort=t.effort;else throw f.invalidParameterError("effort","integer between 0 and 6",t.effort);f.defined(t.minSize)&&this._setBooleanOption("webpMinSize",t.minSize),f.defined(t.mixed)&&this._setBooleanOption("webpMixed",t.mixed),f.defined(t.exact)&&this._setBooleanOption("webpExact",t.exact)}return hy(t,this.options),this._updateFormatOut("webp",t)}function pj(t){if(f.object(t)){f.defined(t.reuse)&&this._setBooleanOption("gifReuse",t.reuse),f.defined(t.progressive)&&this._setBooleanOption("gifProgressive",t.progressive);let e=t.colours||t.colors;if(f.defined(e))if(f.integer(e)&&f.inRange(e,2,256))this.options.gifBitdepth=fE(e);else throw f.invalidParameterError("colours","integer between 2 and 256",e);if(f.defined(t.effort))if(f.integer(t.effort)&&f.inRange(t.effort,1,10))this.options.gifEffort=t.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",t.effort);if(f.defined(t.dither))if(f.number(t.dither)&&f.inRange(t.dither,0,1))this.options.gifDither=t.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",t.dither);if(f.defined(t.interFrameMaxError))if(f.number(t.interFrameMaxError)&&f.inRange(t.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=t.interFrameMaxError;else throw f.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",t.interFrameMaxError);if(f.defined(t.interPaletteMaxError))if(f.number(t.interPaletteMaxError)&&f.inRange(t.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=t.interPaletteMaxError;else throw f.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",t.interPaletteMaxError);if(f.defined(t.keepDuplicateFrames))if(f.bool(t.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",t.keepDuplicateFrames);else throw f.invalidParameterError("keepDuplicateFrames","boolean",t.keepDuplicateFrames)}return hy(t,this.options),this._updateFormatOut("gif",t)}function gj(t){if(!this.constructor.format.jp2.output.buffer)throw uE();if(f.object(t)){if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,1,100))this.options.jp2Quality=t.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",t.quality);if(f.defined(t.lossless))if(f.bool(t.lossless))this.options.jp2Lossless=t.lossless;else throw f.invalidParameterError("lossless","boolean",t.lossless);if(f.defined(t.tileWidth))if(f.integer(t.tileWidth)&&f.inRange(t.tileWidth,1,32768))this.options.jp2TileWidth=t.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",t.tileWidth);if(f.defined(t.tileHeight))if(f.integer(t.tileHeight)&&f.inRange(t.tileHeight,1,32768))this.options.jp2TileHeight=t.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",t.tileHeight);if(f.defined(t.chromaSubsampling))if(f.string(t.chromaSubsampling)&&f.inArray(t.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=t.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",t.chromaSubsampling)}return this._updateFormatOut("jp2",t)}function hy(t,e){if(f.object(t)&&f.defined(t.loop))if(f.integer(t.loop)&&f.inRange(t.loop,0,65535))e.loop=t.loop;else throw f.invalidParameterError("loop","integer between 0 and 65535",t.loop);if(f.object(t)&&f.defined(t.delay))if(f.integer(t.delay)&&f.inRange(t.delay,0,65535))e.delay=[t.delay];else if(Array.isArray(t.delay)&&f.inRange(t.delay.length,1,1e6)&&t.delay.every(f.integer)&&t.delay.every(r=>f.inRange(r,0,65535)))e.delay=t.delay;else throw f.invalidParameterError("delay","integer or an array of integers between 0 and 65535",t.delay)}function yj(t){if(f.object(t)){if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,1,100))this.options.tiffQuality=t.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",t.quality);if(f.defined(t.bitdepth))if(f.integer(t.bitdepth)&&f.inArray(t.bitdepth,[1,2,4]))this.options.tiffBitdepth=t.bitdepth;else throw f.invalidParameterError("bitdepth","1, 2 or 4",t.bitdepth);if(f.defined(t.tile)&&this._setBooleanOption("tiffTile",t.tile),f.defined(t.tileWidth))if(f.integer(t.tileWidth)&&f.inRange(t.tileWidth,1,32768))this.options.tiffTileWidth=t.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",t.tileWidth);if(f.defined(t.tileHeight))if(f.integer(t.tileHeight)&&f.inRange(t.tileHeight,1,32768))this.options.tiffTileHeight=t.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",t.tileHeight);if(f.defined(t.miniswhite)&&this._setBooleanOption("tiffMiniswhite",t.miniswhite),f.defined(t.pyramid)&&this._setBooleanOption("tiffPyramid",t.pyramid),f.defined(t.xres))if(f.number(t.xres)&&f.inRange(t.xres,.001,1e6))this.options.tiffXres=t.xres;else throw f.invalidParameterError("xres","number between 0.001 and 1000000",t.xres);if(f.defined(t.yres))if(f.number(t.yres)&&f.inRange(t.yres,.001,1e6))this.options.tiffYres=t.yres;else throw f.invalidParameterError("yres","number between 0.001 and 1000000",t.yres);if(f.defined(t.compression))if(f.string(t.compression)&&f.inArray(t.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=t.compression;else throw f.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",t.compression);if(f.defined(t.bigtiff)&&this._setBooleanOption("tiffBigtiff",t.bigtiff),f.defined(t.predictor))if(f.string(t.predictor)&&f.inArray(t.predictor,["none","horizontal","float"]))this.options.tiffPredictor=t.predictor;else throw f.invalidParameterError("predictor","one of: none, horizontal, float",t.predictor);if(f.defined(t.resolutionUnit))if(f.string(t.resolutionUnit)&&f.inArray(t.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=t.resolutionUnit;else throw f.invalidParameterError("resolutionUnit","one of: inch, cm",t.resolutionUnit)}return this._updateFormatOut("tiff",t)}function bj(t){return this.heif({...t,compression:"av1"})}function wj(t){if(f.object(t)){if(f.string(t.compression)&&f.inArray(t.compression,["av1","hevc"]))this.options.heifCompression=t.compression;else throw f.invalidParameterError("compression","one of: av1, hevc",t.compression);if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,1,100))this.options.heifQuality=t.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",t.quality);if(f.defined(t.lossless))if(f.bool(t.lossless))this.options.heifLossless=t.lossless;else throw f.invalidParameterError("lossless","boolean",t.lossless);if(f.defined(t.effort))if(f.integer(t.effort)&&f.inRange(t.effort,0,9))this.options.heifEffort=t.effort;else throw f.invalidParameterError("effort","integer between 0 and 9",t.effort);if(f.defined(t.chromaSubsampling))if(f.string(t.chromaSubsampling)&&f.inArray(t.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=t.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",t.chromaSubsampling);if(f.defined(t.bitdepth))if(f.integer(t.bitdepth)&&f.inArray(t.bitdepth,[8,10,12]))this.options.heifBitdepth=t.bitdepth;else throw f.invalidParameterError("bitdepth","8, 10 or 12",t.bitdepth);if(f.defined(t.tune))if(f.string(t.tune)&&f.inArray(t.tune,["auto","iq","psnr","ssim"]))this.options.heifLossless&&t.tune==="iq"?this.options.heifTune="ssim":this.options.heifTune=t.tune;else throw f.invalidParameterError("tune","one of: auto, iq, psnr, ssim",t.tune)}else throw f.invalidParameterError("options","Object",t);return this._updateFormatOut("heif",t)}function xj(t){if(f.object(t)){if(f.defined(t.quality))if(f.integer(t.quality)&&f.inRange(t.quality,1,100))this.options.jxlDistance=t.quality>=30?.1+(100-t.quality)*.09:53/3e3*t.quality*t.quality-23/20*t.quality+25;else throw f.invalidParameterError("quality","integer between 1 and 100",t.quality);else if(f.defined(t.distance))if(f.number(t.distance)&&f.inRange(t.distance,0,15))this.options.jxlDistance=t.distance;else throw f.invalidParameterError("distance","number between 0.0 and 15.0",t.distance);if(f.defined(t.decodingTier))if(f.integer(t.decodingTier)&&f.inRange(t.decodingTier,0,4))this.options.jxlDecodingTier=t.decodingTier;else throw f.invalidParameterError("decodingTier","integer between 0 and 4",t.decodingTier);if(f.defined(t.lossless))if(f.bool(t.lossless))this.options.jxlLossless=t.lossless;else throw f.invalidParameterError("lossless","boolean",t.lossless);if(f.defined(t.effort))if(f.integer(t.effort)&&f.inRange(t.effort,1,9))this.options.jxlEffort=t.effort;else throw f.invalidParameterError("effort","integer between 1 and 9",t.effort)}return hy(t,this.options),this._updateFormatOut("jxl",t)}function _j(t){if(f.object(t)&&f.defined(t.depth))if(f.string(t.depth)&&f.inArray(t.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=t.depth;else throw f.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",t.depth);return this._updateFormatOut("raw")}function Sj(t){if(f.object(t)){if(f.defined(t.size))if(f.integer(t.size)&&f.inRange(t.size,1,8192))this.options.tileSize=t.size;else throw f.invalidParameterError("size","integer between 1 and 8192",t.size);if(f.defined(t.overlap))if(f.integer(t.overlap)&&f.inRange(t.overlap,0,8192)){if(t.overlap>this.options.tileSize)throw f.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,t.overlap);this.options.tileOverlap=t.overlap}else throw f.invalidParameterError("overlap","integer between 0 and 8192",t.overlap);if(f.defined(t.container))if(f.string(t.container)&&f.inArray(t.container,["fs","zip"]))this.options.tileContainer=t.container;else throw f.invalidParameterError("container","one of: fs, zip",t.container);if(f.defined(t.layout))if(f.string(t.layout)&&f.inArray(t.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=t.layout;else throw f.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",t.layout);if(f.defined(t.angle))if(f.integer(t.angle)&&!(t.angle%90))this.options.tileAngle=t.angle;else throw f.invalidParameterError("angle","positive/negative multiple of 90",t.angle);if(this._setBackgroundColourOption("tileBackground",t.background),f.defined(t.depth))if(f.string(t.depth)&&f.inArray(t.depth,["onepixel","onetile","one"]))this.options.tileDepth=t.depth;else throw f.invalidParameterError("depth","one of: onepixel, onetile, one",t.depth);if(f.defined(t.skipBlanks))if(f.integer(t.skipBlanks)&&f.inRange(t.skipBlanks,-1,65535))this.options.tileSkipBlanks=t.skipBlanks;else throw f.invalidParameterError("skipBlanks","integer between -1 and 255/65535",t.skipBlanks);else f.defined(t.layout)&&t.layout==="google"&&(this.options.tileSkipBlanks=5);let e=f.bool(t.center)?t.center:t.centre;if(f.defined(e)&&this._setBooleanOption("tileCentre",e),f.defined(t.id))if(f.string(t.id))this.options.tileId=t.id;else throw f.invalidParameterError("id","string",t.id);if(f.defined(t.basename))if(f.string(t.basename))this.options.tileBasename=t.basename;else throw f.invalidParameterError("basename","string",t.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 Mj(t){if(!f.plainObject(t))throw f.invalidParameterError("options","object",t);if(f.integer(t.seconds)&&f.inRange(t.seconds,0,3600))this.options.timeoutSeconds=t.seconds;else throw f.invalidParameterError("seconds","integer between 0 and 3600",t.seconds);return this}function vj(t,e){return f.object(e)&&e.force===!1||(this.options.formatOut=t),this}function Ej(t,e){if(f.bool(e))this.options[t]=e;else throw f.invalidParameterError(t,"boolean",e)}function Tj(){if(!this.options.streamOut){this.options.streamOut=!0;let t=Error();this._pipeline(void 0,t)}}function Aj(t,e){return typeof t=="function"?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.pipeline(this.options,(r,n,i)=>{r?t(f.nativeError(r,e)):t(null,n,i)})}):it.pipeline(this.options,(r,n,i)=>{r?t(f.nativeError(r,e)):t(null,n,i)}),this):this.options.streamOut?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.pipeline(this.options,(r,n,i)=>{r?this.emit("error",f.nativeError(r,e)):(this.emit("info",i),this.push(n)),this.push(null),this.on("end",()=>this.emit("close"))})}):it.pipeline(this.options,(r,n,i)=>{r?this.emit("error",f.nativeError(r,e)):(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(),it.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,e)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}):new Promise((r,n)=>{it.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,e)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}var om,lE,XU,uE,fE,hE,dE=p(()=>{om=me(require("node:path"),1);Qi();Cf();lE=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"]]),XU=/\.(jp[2x]|j2[kc])$/i,uE=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),fE=t=>1<<32-Math.clz32(Math.ceil(Math.log2(t))-1);hE=t=>{Object.assign(t.prototype,{toFile:YU,toBuffer:ZU,toUint8Array:JU,withDensity:QU,keepExif:ej,withExif:tj,withExifMerge:rj,keepIccProfile:nj,withIccProfile:ij,keepGainMap:oj,withGainMap:sj,keepXmp:aj,withXmp:cj,keepMetadata:lj,withMetadata:uj,toFormat:fj,jpeg:hj,jp2:gj,png:dj,webp:mj,tiff:yj,avif:bj,heif:wj,jxl:xj,gif:pj,raw:_j,tile:Sj,timeout:Mj,_updateFormatOut:vj,_setBooleanOption:Ej,_read:Tj,_pipeline:Aj})}});function bE(t){if(f.bool(t))return t?it.cache(50,20,100):it.cache(0,0,0);if(f.object(t)){for(let e of["memory","files","items"]){let r=t[e];if(f.defined(r)&&!(f.integer(r)&&r>=0))throw f.invalidParameterError(e,"a positive integer",r)}return it.cache(t.memory,t.files,t.items)}else return it.cache()}function Pj(t){return it.concurrency(f.integer(t)?t:null)}function Lj(){return it.counters()}function Oj(t){return it.simd(f.bool(t)?t:null)}function Cj(t){if(f.object(t))if(Array.isArray(t.operation)&&t.operation.every(f.string))it.block(t.operation,!0);else throw f.invalidParameterError("operation","Array<string>",t.operation);else throw f.invalidParameterError("options","object",t)}function Bj(t){if(f.object(t))if(Array.isArray(t.operation)&&t.operation.every(f.string))it.block(t.operation,!1);else throw f.invalidParameterError("operation","Array<string>",t.operation);else throw f.invalidParameterError("options","object",t)}var pE,gE,yE,Bf,Dj,dy,mE,my,Ds,Ij,kl,Rj,wE,xE=p(()=>{pE=me(require("node:events"),1),gE=require("node:module"),yE=require("node:os"),Bf=me(Ud(),1);Qi();ny();Cf();Qd();Dj={};dy=(0,gE.createRequire)(Dj.url),mE=em.runtimePlatformArch(),my=it.libvipsVersion(),Ds=it.format();Ds.heif.output.alias=["avif","heic"];Ds.jpeg.output.alias=["jpe","jpg"];Ds.tiff.output.alias=["tif"];Ds.jp2.output.alias=["j2c","j2k","jp2","jpx"];Ij={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},kl={vips:my.semver};if(!my.isGlobal)if(my.isWasm)try{kl=dy("@img/sharp-wasm32/versions")}catch{}else try{kl=dy(`@img/sharp-${mE}/versions`)}catch{try{kl=dy(`@img/sharp-libvips-${mE}/versions`)}catch{}}kl.sharp=ko.version;kl.heif&&Ds.heif&&(Ds.heif.input.fileSuffix=[".avif"],Ds.heif.output.alias=["avif"]);bE(!0);!process.env.MALLOC_ARENA_MAX&&Bf.default.familySync()===Bf.default.GLIBC&&!it._isUsingJemalloc()?it.concurrency(1):Bf.default.familySync()===Bf.default.MUSL&&it.concurrency()===1024&&it.concurrency((0,yE.availableParallelism)());Rj=new pE.default.EventEmitter;wE=t=>{t.cache=bE,t.concurrency=Pj,t.counters=Lj,t.simd=Oj,t.format=Ds,t.interpolators=Ij,t.versions=kl,t.queue=Rj,t.block=Cj,t.unblock=Bj}});var _E={};Jt(_E,{default:()=>Nj});var Nj,SE=p(()=>{C3();N3();z3();V3();H3();sE();cE();dE();xE();D3(io);j3(io);q3(io);$3(io);oE(io);aE(io);hE(io);wE(io);Nj=io});async function Ul(t,e,r,n){return n._parse(t,e,r,n)}var DE=p(()=>{"use strict"});function jl(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var NE=p(()=>{"use strict"});var so,Vj,Wj,$j,Hj,xm,FE,Kj,kE=p(()=>{"use strict";so={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Vj=so.self||so.window||so.global||{},Wj=so.window||so.self||so.global||{},$j=so.global||so.self||so.window||{},Hj=so.document||{},xm=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),FE=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Kj=FE&&parseFloat(FE[1])||0});function Yj(){let t=new Do({id:"loaders.gl"});return globalThis.loaders||={},globalThis.loaders.log=t,globalThis.loaders.version=Xj,globalThis.probe||={},globalThis.probe.loaders=t,t}function Nf(){}function Ai(t){var r;let e=(r=t==null?void 0:t.core)==null?void 0:r.log;return e===null?Zj:e||_m}var vy,Xj,_m,Ey,Zj,Ty=p(()=>{"use strict";Eg();vy="5.0.0-beta.11",Xj=vy[0]>="0"&&vy[0]<="9"?`v${vy}`:"";_m=Yj(),Ey=class{log(){return Nf}info(){return Nf}once(){return Nf}warn(){return Nf}error(){return Nf}};Zj=new Ey});function zl(t,e){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(e(a))}catch(c){n(c)}}}try{let a=t(s,o);a==null||a.then(s,o)}catch(a){o(a)}})}var GE=p(()=>{"use strict"});function Ay(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function Iy(t){var r,n;return((n=(r=globalThis.loaders)==null?void 0:r.modules)==null?void 0:n[t])||null}var Py=p(()=>{"use strict"});function Jj(){let t="5.0.0-beta.11";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=t,t}var UE,jE=p(()=>{"use strict";UE=Jj()});function zE(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var qE=p(()=>{"use strict"});var ao,Cte,Bte,Dte,Nte,Ii,Xa,Fte,VE,kte,Ry=p(()=>{"use strict";ao={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Cte=ao.self||ao.window||ao.global||{},Bte=ao.window||ao.self||ao.global||{},Dte=ao.global||ao.self||ao.window||{},Nte=ao.document||{},Ii=typeof process!="object"||String(process)!=="[object process]"||process.browser,Xa=typeof importScripts=="function",Fte=typeof window<"u"&&typeof window.orientation<"u",VE=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),kte=VE&&parseFloat(VE[1])||0});var Ly,WE,$E=p(()=>{Ly=require("worker_threads"),WE=Ly.parentPort});function Ya(t,e=!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),HE(s))n.add(s);else if(ArrayBuffer.isView(s))HE(s.buffer)&&n.add(s.buffer);else if(e&&typeof MessageChannel<"u"&&s instanceof MessageChannel)o(s.port1),o(s.port2);else if(e&&s instanceof Map)for(let[a,c]of s)o(a),o(c);else if(e&&s instanceof Set)for(let a of s)o(a);else if(e)for(let a of Object.keys(s))o(s[a])}}return o(t),r===void 0?Array.from(n):[]}function HE(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}var Oy=p(()=>{});async function ql(){return WE}function Qj(t){if(!t||typeof t!="object")return null;let e="data"in t&&t.type==="message"?t.data:t;return e&&typeof e.source=="string"&&e.source.startsWith("loaders.gl")?e:null}var Sm,qt,Cy=p(()=>{Oy();$E();Sm=new Map,qt=class{static async inWorkerThread(){let e=globalThis.WorkerGlobalScope;return typeof e=="function"&&globalThis instanceof e||!!await ql()}static set onmessage(e){async function r(n){let i=await ql(),{type:o,payload:s}=i?n:n.data;e(o,s)}ql().then(n=>{n?(n.on("message",i=>{r(i)}),n.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=r})}static async addEventListener(e){let r=Sm.get(e);r||(r=i=>{let o=Qj(i);o&&e(o.type,o.payload)},Sm.set(e,r));let n=await ql();n?n.on("message",r):globalThis.addEventListener("message",r)}static async removeEventListener(e){let r=Sm.get(e);if(Sm.delete(e),!r)return;let n=await ql();n?n.off("message",r):globalThis.removeEventListener("message",r)}static async postMessage(e,r,n=!1){let i={source:"loaders.gl",type:e,payload:r},o=n?[]:Ya(r),s=await ql();s?s.postMessage(i,o):globalThis.postMessage(i,o)}}});var Vl,KE=p(()=>{Vl=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(e){return this.enqueue(e)}enqueue(e){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();e instanceof Error?r.reject(e):r.resolve({value:e})}else this._values.push(e)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let e=this._values.shift();return e instanceof Error?Promise.reject(e):Promise.resolve({done:!1,value:e})}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((e,r)=>{this._settlers.push({resolve:e,reject:r})})}}});var Mm,XE=p(()=>{Mm=class{constructor(e){if(typeof SharedArrayBuffer>"u"||!(e instanceof SharedArrayBuffer)||e.byteLength!==16)throw new Error("Expected a 16-byte shared worker control buffer");this.buffer=e,this.values=new Int32Array(e)}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 e=new Error("Shared worker task was cancelled");throw e.name="AbortError",e}}setProgress(e,r=-1){if(!Number.isInteger(e)||e<0||e>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,e),Atomics.store(this.values,2,r),Atomics.add(this.values,3,1)}}});function By(t){if(t!==void 0&&t!=="copy"&&t!=="transfer")throw new Error("Invalid worker output ownership")}var YE=p(()=>{});async function Dy(t,e,r){if(!await qt.inWorkerThread())return;let n={process:rz};qt.onmessage=async(i,o)=>{var d,m,g,y,b;if(i==="cancel"){qo==null||qo.abort(),zo==null||zo.close(),Za==null||Za.close();return}let s=i==="process"||i==="process-in-batches"?new AbortController:void 0;s&&(qo=s);let a=performance.now(),c=i==="process"||i==="process-in-batches"?nz():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 Mm(o.options.sharedState),h.sharedState=l),i){case"preload":await(r==null?void 0:r()),qt.postMessage("done",{});break;case"process":if(u(),By((m=o.options)==null?void 0:m.outputOwnership),!t)throw new Error("Worker does not support atomic processing");let w=await t(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(),By((y=o.options)==null?void 0:y.outputOwnership),!e)throw new Error("Worker does not support batched processing");let _=new Vl,S=new Vl;zo=_,Za=S;try{let M=e(tz(_),o.options||{},h,o.context||{});for await(let v of M)u(),await qt.postMessage("output-batch",{result:v},((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{zo=null,Za=null}break;case"input-batch":if(!zo)throw new Error("Worker has no active batched processing session");zo.push(o.input);break;case"input-done":if(!zo)throw new Error("Worker has no active batched processing session");zo.close();break;case"output-ack":if(!Za)throw new Error("Worker has no active batched processing session");Za.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&&qo===s&&(qo=null)}},await qt.postMessage("ready",{})}async function*tz(t){for(;;){await qt.postMessage("input-request",{});let e=await t.next();if(e.done)return;yield e.value}}function rz(t,e={},r={}){let n=qo==null?void 0:qo.signal;return n==null||n.throwIfAborted(),new Promise((i,o)=>{let s=ez++,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:t,options:e,context:r})}).catch(u=>{a(),o(u)})})}function nz(){let t,e=!1,r=!1,n=()=>{r=!1,t&&(qt.postMessage("progress",{progress:t}),t=void 0)};return{report(i){e||(t&&t.phase!==i.phase&&n(),t={...i},r||(r=!0,setTimeout(n,0)))},finish(i=!1){i&&(t=void 0),n(),e=!0}}}var ez,qo,zo,Za,ZE=p(()=>{XE();KE();Cy();YE();ez=0,qo=null,zo=null,Za=null});var iz,Ny,ere,JE=p(()=>{Cy();ZE();Oy();iz={},Ny=typeof __filename=="string"?__filename.replace(/\\/g,"/"):"",ere=Ny?`file://${Ny.startsWith("/")?"":"/"}${encodeURI(Ny).replace(/#/g,"%23").replace(/\?/g,"%3F")}`:iz.url});function ky(t,e){if(!t.preload)return Promise.resolve();let r=Fy.get(t);return r||(r=Promise.resolve().then(()=>t.preload()).then(()=>{oz.add(t)}),Fy.set(t,r),r.catch(()=>Fy.delete(t))),sz(r,e)}function sz(t,e){return e?new Promise((r,n)=>{let i=()=>{e.removeEventListener("abort",i),n(e.reason)};e.addEventListener("abort",i,{once:!0}),e.aborted&&i(),t.then(o=>{e.removeEventListener("abort",i),r(o)},o=>{e.removeEventListener("abort",i),n(o)})}):t}var Fy,oz,QE=p(()=>{Fy=new WeakMap,oz=new WeakSet});var Gy,vm,e4=p(()=>{Gy=class extends Error{},vm=class{constructor(e){this.options=e,this.nextId=1,this.pending=new Map,this.incoming=new Map}request(e,r,n,i=[]){if(this.failure)return Promise.reject(this.failure.reason);if(n!=null&&n.aborted)return Promise.reject(n.reason);let o=this.nextId++;return new Promise((s,a)=>{let c=()=>{let l=this.pending.get(o);l&&(this.pending.delete(o),l.cleanup(),a(n==null?void 0:n.reason),this.send({source:"math.gl/tasks",kind:"cancel",id:o}))};this.pending.set(o,{resolve:s,reject:a,cleanup:()=>n==null?void 0:n.removeEventListener("abort",c)}),n==null||n.addEventListener("abort",c,{once:!0}),this.send({source:"math.gl/tasks",kind:"request",id:o,operation:e,value:r},i)})}emit(e,r,n=[]){if(this.failure)throw this.failure.reason;this.send({source:"math.gl/tasks",kind:"event",id:0,operation:e,value:r},n)}receive(e){var r,n,i,o,s,a,c,l;if(!(this.failure||(e==null?void 0:e.source)!=="math.gl/tasks")){if(e.kind==="failure"){let u=new Error(((r=e.error)==null?void 0:r.message)??"Task channel failed");this.close(u),(i=(n=this.options).onFailure)==null||i.call(n,u)}else if(e.kind==="result"||e.kind==="error"){let u=this.pending.get(e.id);if(!u)return;if(this.pending.delete(e.id),u.cleanup(),e.kind==="result")u.resolve(e.value);else{let h=new Gy(((o=e.error)==null?void 0:o.message)??"Task request failed");h.name=((s=e.error)==null?void 0:s.name)??"Error",u.reject(h)}}else if(e.kind==="cancel")(a=this.incoming.get(e.id))==null||a.abort(new DOMException("Task request cancelled","AbortError"));else if(e.kind==="event")try{(l=(c=this.options).handleEvent)==null||l.call(c,e.operation,e.value)}catch(u){this.fail(u)}else if(e.kind==="request"){if(this.incoming.has(e.id)){this.fail(new Error("Duplicate task request identifier"));return}let u=new AbortController;this.incoming.set(e.id,u),Promise.resolve().then(()=>(u.signal.throwIfAborted(),this.options.handleRequest(e.operation,e.value,u.signal))).then(h=>{var d,m;!u.signal.aborted&&!this.failure&&this.send({source:"math.gl/tasks",kind:"result",id:e.id,value:h},(m=(d=this.options).getResultTransferList)==null?void 0:m.call(d,h,e.value))}).catch(h=>{!u.signal.aborted&&!this.failure&&this.send({source:"math.gl/tasks",kind:"error",id:e.id,error:{name:h instanceof Error?h.name:"Error",message:h instanceof Error?h.message:String(h)}})}).finally(()=>this.incoming.delete(e.id))}}}close(e=new Error("Task channel closed")){if(!this.failure){this.failure={reason:e};for(let r of this.pending.values())r.cleanup(),r.reject(e);this.pending.clear();for(let r of this.incoming.values())r.abort(e);this.incoming.clear()}}send(e,r=[]){if(!this.failure)try{this.options.send(e,r)}catch(n){this.fail(n)}}fail(e){var r,n;if(!this.failure){this.close(e);try{this.options.send({source:"math.gl/tasks",kind:"failure",id:0,error:{name:e instanceof Error?e.name:"Error",message:e instanceof Error?e.message:String(e)}},[])}catch{}(n=(r=this.options).onFailure)==null||n.call(r,e)}}}});function Wl(t){if(!t||typeof t!="object"||Object.getPrototypeOf(t)!==Object.prototype)throw new TypeError("Task payloads must be plain objects with named fields")}function az(t,e="copy"){if(Wl(t),!["copy","transfer","share"].includes(e))throw new TypeError("Invalid input ownership");let r=Ya(t);if(e==="share"&&r.length)throw new TypeError("Share requires shared storage");return structuredClone(t,{transfer:e==="transfer"?r:[]})}function Uy(t,e={}){let r=e.signal??new AbortController().signal;return{state:t,signal:r,requestHost:async(n,i,o)=>{if(r.throwIfAborted(),!e.requestHost)throw new Error("No host request handler configured");return e.requestHost(n,i,o)},emitHost:(n,i)=>{var o;r.throwIfAborted(),(o=e.emitHost)==null||o.call(e,n,i)},throwIfAborted:()=>{var n;r.throwIfAborted(),(n=e.throwIfAborted)==null||n.call(e)},reportProgress:n=>{var i;return(i=e.reportProgress)==null?void 0:i.call(e,{...n,phase:n.phase??"process",unit:n.unit??"items"})}}}async function zy(t){if(!await qt.inWorkerThread())throw new Error("initializeTaskWorker must run inside a worker");if(t4)throw new Error("A task is already installed in this worker");t4=!0;let e=new jy(t),r,n=new vm({getResultTransferList:(o,s)=>s.outputOwnership==="transfer"?Ya(o):[],send:(o,s)=>{let a=structuredClone(o,{transfer:s});qt.postMessage("task-channel",a).catch(c=>n.fail(c))},handleRequest:async(o,s,a)=>{var u;let c=s,l={signal:a,reportProgress:h=>n.emit("task:progress",{id:c.progressId,progress:h}),requestHost:(h,d,m={})=>{let g={operation:h,payload:az(d,m.inputOwnership),outputOwnership:m.outputOwnership??"copy"};return n.request("task:host-request",g,a,Ya(g))},emitHost:(h,d)=>n.emit("task:host-event",{operation:h,payload:d,id:c.progressId})};switch(o){case"initialize":return e.initialize(c.input,l);case"process":return e.process(c.input,c.options,l);case"stream-open":{if(r)throw new Error("A task stream is already open");async function*h(){for(;;){let d=await n.request("task:next-input",{outputOwnership:"transfer"},a);if(d.done)return;yield d.value}}return r=e.stream(h(),c.options,l)[Symbol.asyncIterator](),{}}case"stream-next":if(!r)throw new Error("No active task stream");return r.next();case"stream-close":try{await((u=r==null?void 0:r.return)==null?void 0:u.call(r))}finally{r=void 0}return{};case"destroy":return e.destroy();default:throw new Error("Unknown task channel operation")}}});await qt.addEventListener((o,s)=>{o==="task-channel"&&n.receive(s)});let i={};return Dy(async(o,s,a)=>{switch(o.operation){case"initialize":return e.initialize(o.input,a);case"destroy":return e.destroy();case"stream-options":return i=o.options,{};case"process":return e.process(o.input,o.options,a);default:throw new Error("Unknown task operation")}},async function*(o,s,a){async function*c(){for await(let l of o)Wl(l),yield l}try{yield*e.stream(c(),i,a)}finally{i={}}},()=>ky(t))}var jy,t4,r4=p(()=>{JE();QE();e4();jy=class{constructor(e){this.task=e,this.initialized=!1}async initialize(e,r={}){var n,i,o;if(this.initialized)throw new Error("Task is already initialized");return Wl(e),await ky(this.task,r.signal),(n=r.signal)==null||n.throwIfAborted(),this.state=await((o=(i=this.task).initialize)==null?void 0:o.call(i,e,Uy(void 0,r))),this.initialized=!0,{}}async destroy(){var e,r;if(this.initialized){this.initialized=!1;let n=this.state;this.state=void 0,this.task.initialize&&await((r=(e=this.task).destroy)==null?void 0:r.call(e,n))}return{}}async process(e,r,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.process)throw new Error("Task has no atomic processor");Wl(e);let i=await this.task.process(e,r,Uy(this.state,n));return Wl(i),i}async*stream(e,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(e,r,Uy(this.state,n)))Wl(i),yield i}};t4=!1});var n4=p(()=>{r4()});var i4=p(()=>{n4()});var o4={};Jt(o4,{BroadcastChannel:()=>Je.BroadcastChannel,MessageChannel:()=>Je.MessageChannel,MessagePort:()=>Je.MessagePort,NodeWorker:()=>lz,SHARE_ENV:()=>Je.SHARE_ENV,Worker:()=>Je.Worker,getEnvironmentData:()=>Je.getEnvironmentData,isInternalThread:()=>uz,isMainThread:()=>Je.isMainThread,isMarkedAsUntransferable:()=>Je.isMarkedAsUntransferable,locks:()=>hz,markAsUncloneable:()=>Je.markAsUncloneable,markAsUntransferable:()=>Je.markAsUntransferable,moveMessagePortToContext:()=>Je.moveMessagePortToContext,parentPort:()=>cz,postMessageToThread:()=>Je.postMessageToThread,receiveMessageOnPort:()=>Je.receiveMessageOnPort,resourceLimits:()=>Je.resourceLimits,setEnvironmentData:()=>Je.setEnvironmentData,structuredClone:()=>dz,threadId:()=>Je.threadId,threadName:()=>fz,workerData:()=>Je.workerData});var On,Je,cz,lz,uz,fz,hz,dz,s4=p(()=>{"use strict";On=me(require("worker_threads"),1),Je=require("worker_threads"),cz=On==null?void 0:On.parentPort,lz=On.Worker,uz=On.isInternalThread,fz=On.threadName,hz=On.locks,dz=On.structuredClone});function a4(t){return{...t,phase:t.phase??"process",unit:t.unit??"items"}}async function c4(){var t;if(typeof self<"u"&&typeof document>"u"&&typeof self.postMessage=="function")return!0;if(typeof process<"u"&&((t=process.versions)!=null&&t.node)){let{isMainThread:e}=await Promise.resolve().then(()=>(s4(),o4));return!e}return!1}var l4,u4=p(()=>{"use strict";i4();l4=zy});function qy(t,e=!0,r){let n=r||new Set;if(t){if(f4(t))n.add(t);else if(f4(t.buffer))n.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(let i in t)qy(t[i],e,n)}}return r===void 0?Array.from(n):[]}function f4(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}var h4=p(()=>{"use strict"});async function Vy(t,e){await c4()&&await l4(mz(t,e))}function mz(t,e){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(!t)throw new Error("Worker does not support atomic processing");return{value:await t(r,n,d4(i),i.state.context)}},...e?{processInBatches:async function*(r,n,i){async function*o(){for await(let s of r)yield s.value}for await(let s of e(o(),n,d4(i),i.state.context))yield{value:s}}}:{}}}function d4(t){let e=0,r=t.state.port;return{signal:t.signal,throwIfAborted:()=>t.throwIfAborted(),reportProgress:n=>t.reportProgress(a4(n)),process:r?(n,i={},o={})=>{t.throwIfAborted();let s=++e;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(t.signal.reason)},h=()=>{r.removeEventListener("message",l),t.signal.removeEventListener("abort",u)};r.addEventListener("message",l),t.signal.addEventListener("abort",u,{once:!0}),r.start();try{let d={identifier:s,input:n,options:i,context:o};r.postMessage(d,qy(d))}catch(d){h(),c(d)}})}:void 0}}var m4=p(()=>{"use strict";u4();h4()});function Ja(t={}){var i,o;let e=t.useLocalLibraries??((i=t.core)==null?void 0:i.useLocalLibraries),r=pz(t.CDN,(o=t.core)==null?void 0:o.CDN),n=t.modules;return{...e!==void 0?{useLocalLibraries:e}:{},...r!==void 0?{CDN:r}:{},...n!==void 0?{modules:n}:{}}}function pz(t,e){if(typeof t=="string"||t===null)return t;if(typeof e=="string"||e===null)return e}async function $l(t,e=null,r={},n=null,i=null){var a,c;let o=t;if(e){let l=n||t,u=(a=r.modules)==null?void 0:a[l];if(u!==void 0&&typeof u!="string")return u;t=$y(t,e,r,n),o=i&&(!(typeof u=="string")||typeof((c=r.modules)==null?void 0:c[i])=="string")?$y(i,e,r,i):t}let s=gz(t,o,Xa);return Wy[s]=Wy[s]||yz(t,o),await Wy[s]}function gz(t,e,r){return r?JSON.stringify([t,e]):t}function $y(t,e,r={},n=null){if(r!=null&&r.core)throw new Error("loadLibrary: options.core must be pre-normalized");n=n||t;let i=r.modules||{};if(typeof i[n]=="string")return i[n];if(!r.useLocalLibraries&&t.startsWith("http"))return t;if(!Ii)return`modules/${e}/dist/libs/${n}`;if(r.CDN){if(typeof r.CDN!="string")throw new Error("loadLibrary: options.CDN must be a string or null");return zE(r.CDN.startsWith("http")),`${r.CDN}/${e}@${UE}/dist/libs/${n}`}return Xa?n.endsWith(".mjs")?`./libs/${n}`:`../src/libs/${n}`:`modules/${e}/src/libs/${n}`}async function yz(t,e){if(t.endsWith("wasm"))return await xz(t);if(!Ii){let{requireFromFile:n}=globalThis.loaders||{};try{let i=await(n==null?void 0:n(t));return i||!t.includes("/dist/libs/")?i:await(n==null?void 0:n(t.replace("/dist/libs/","/src/libs/")))}catch(i){if(t.includes("/dist/libs/"))try{return await(n==null?void 0:n(t.replace("/dist/libs/","/src/libs/")))}catch{}return _m.error(String(i))(),null}}if(Xa)return bz(t,e);let r=await _z(t);return wz(r,t)}async function bz(t,e=t){try{importScripts()}catch{let n=await import(new URL(e,globalThis.location.href).href);return n.default??n}return importScripts(t)}function wz(t,e){let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}async function xz(t){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};if(Ii||!e||t.startsWith("http"))return await(await fetch(t)).arrayBuffer();try{return await e(t)}catch{if(t.includes("/dist/libs/"))return await e(t.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load ArrayBuffer from ${t}`)}}async function _z(t){let{readFileAsText:e}=globalThis.loaders||{};if(Ii||!e||t.startsWith("http"))return await(await fetch(t)).text();try{return await e(t)}catch{if(t.includes("/dist/libs/"))return await e(t.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load text from ${t}`)}}var Wy,p4=p(()=>{"use strict";Ty();Ry();qE();jE();Wy={}});var Qa=p(()=>{"use strict";Ry();m4();p4()});async function Ky(t,e=()=>t){await Vy((r,n,i,o)=>Sz(e(n||{}),r,n,i,o),(r,n,i,o)=>g4(e(n||{}),r,n,i,o))}async function Sz(t,e,r={},n,i={}){let o=await vz({loader:t,arrayBuffer:e,options:r,context:{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:y4(),_parse:b4(n==null?void 0:n.process)}});return t.serializeWorkerResult?t.serializeWorkerResult(o,r,i):o}async function*g4(t,e,r={},n,i={}){if(!t.parseInBatches)throw new Error(`${t.id} loader does not support batched parsing`);let o=x4(t,r),s=t.parseInBatches(e,o,{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:y4(),_parse:b4(n==null?void 0:n.process)});for await(let a of s)yield t.serializeWorkerBatch?t.serializeWorkerBatch(a,r,i):a}function y4(){let t=e=>()=>{throw new Error(`context.coreApi.${e} is unavailable inside worker loaders.`)};return{fetchFile:async(e,r)=>await fetch(e,r),parseSync:t("parseSync"),parse:t("parse"),parseFile:t("parseFile"),parseInBatches:t("parseInBatches"),load:t("load"),loadInBatches:t("loadInBatches")}}function b4(t){return(e,r,n,i)=>{if(!t)throw new Error("Worker not set up to parse on main thread");let o=Mz(r,n,i);return t(e,o.options,{...o.context,...Array.isArray(r)||r&&w4(r)?{_loaderIsArray:Array.isArray(r),_loaderIds:(Array.isArray(r)?r:[r]).map(s=>s.id)}:{}})}}function Mz(t,e,r){return e?{options:e,context:Hy(r)}:Array.isArray(t)||t&&w4(t)?{options:void 0,context:Hy(r)}:t&&!Array.isArray(t)?{options:t}:{options:void 0,context:Hy(r)}}function w4(t){return"id"in t&&"extensions"in t}function Hy(t){if(!t)return;let{fetch:e,loaders:r,coreApi:n,signal:i,reportProgress:o,_parse:s,_parseSync:a,_parseInBatches:c,...l}=t;return JSON.parse(JSON.stringify(l))}async function vz({loader:t,arrayBuffer:e,options:r,context:n}){let i,o;if(t.parse||t.parseSync)i=e,o=t.parse||t.parseSync;else if(t.parseTextSync)i=new TextDecoder().decode(e),o=t.parseTextSync;else throw new Error(`Could not load data with ${t.name} loader`);return r=x4(t,r),await o(i,{...r},n,t)}function x4(t,e){var r;return{...e,modules:{...(r=t.options)==null?void 0:r.modules,...e.modules},core:{...e.core,worker:!1}}}var _4=p(()=>{"use strict";Qa()});function Em(t={}){if(t.coordinateEpoch!==void 0&&!Number.isFinite(t.coordinateEpoch))throw new Error("Spatial reference coordinate epoch must be a finite decimal year");return Object.freeze({crs:S4(t.crs||{state:"absent",provenance:"unknown"}),vertical:t.vertical?S4(t.vertical):void 0,coordinateEpoch:t.coordinateEpoch,coordinateFrame:t.coordinateFrame||"unknown",coordinateOrder:Object.freeze([...t.coordinateOrder||[]]),units:t.units?Object.freeze([...t.units]):void 0})}function wr(t){if(typeof t=="object")return"projjson";let e=t.trim();return/^[A-Z][A-Z0-9_]*\s*[\[(]/i.test(e)?"wkt":/(?:^|\s)\+?proj=/i.test(e)?"proj-string":/^[A-Z][A-Z0-9._-]*(?::[A-Z0-9._-]+)+$/i.test(e)||/^urn:ogc:def:crs:/i.test(e)||/^https?:\/\//i.test(e)||/^[A-Z][A-Z0-9._-]*$/i.test(e)?"identifier":"opaque"}function S4(t){return t.state==="explicit"||t.state==="default"?Object.freeze({...t,definition:M4(t.definition),alternatives:t.alternatives?Object.freeze(t.alternatives.map(e=>Object.freeze({...e,definition:M4(e.definition)}))):void 0}):Object.freeze({...t})}function M4(t){return typeof t=="string"?t:Xy(t)}function Xy(t){return Array.isArray(t)?Object.freeze(t.map(e=>Xy(e))):t&&typeof t=="object"?Object.freeze(Object.fromEntries(Object.entries(t).map(([e,r])=>[e,Xy(r)]))):t}var Hl=p(()=>{});function kf(t,e){let n={type:"wkt-crs",root:new Yy(t).parse()};if(e!=null&&e.strict){let i=A4(n,{profile:e.profile,allowExtensions:!1});if(i.length>0)throw new Am(i)}return n}function A4(t,e){var a;if(!t||t.type!=="wkt-crs"||((a=t.root)==null?void 0:a.type)!=="node")throw new TypeError("validateWKTCRS expects a WKTCRSAst");let r=Dz(t.root.keyword,(e==null?void 0:e.profile)||"auto"),n=Cz[r],i=Bz[r],o=[],s=t.root.keyword.toUpperCase();return n.has(s)||o.push({code:"invalid-root",message:`${t.root.keyword} is not a ${r} root keyword`,path:[],keyword:t.root.keyword}),I4(t.root,[],c=>{let l=c.node.keyword.toUpperCase();!(e!=null&&e.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=Nz(c.node);u&&o.push({code:"invalid-value",message:u,path:c.path,keyword:c.node.keyword})}),o}function Dz(t,e){return e!=="auto"?e:Ff.has(t.toUpperCase())?"wkt1":"wkt2:2019"}function Nz(t){let e=t.keyword.toUpperCase(),r=t.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(e)&&!(r.length>=2&&n(0,"string")&&n(1,"number")))return`${t.keyword} must start with a quoted name and numeric conversion factor`;if(e==="CS"&&!i(2,"enumeration","number"))return`${t.keyword} must contain a coordinate-system type and dimension`;if(e==="BBOX"&&!i(4,"number","number","number","number"))return`${t.keyword} must contain four numeric bounds`;if(["ENSEMBLEACCURACY","EPOCH","COORDEPOCH","FRAMEEPOCH","OPERATIONACCURACY","ORDER"].includes(e)&&!i(1,"number"))return`${t.keyword} must contain one number`;if(["ANCHOR","AREA","CALENDAR","CITATION","REMARK","SCOPE","URI","VERSION"].includes(e)&&!i(1,"string"))return`${t.keyword} must contain one quoted string`;if(["ELLIPSOID","SPHEROID","TRIAXIAL"].includes(e)&&!(r.length>=3&&n(0,"string")&&n(1,"number")&&n(2,"number")))return`${t.keyword} must start with a quoted name and numeric ellipsoid axes`;if(["PARAMETER"].includes(e)&&!(r.length>=2&&n(0,"string")&&n(1,"number")))return`${t.keyword} must start with a quoted name and numeric value`;if(e==="PARAMETERFILE"&&!i(2,"string","string"))return`${t.keyword} must contain a quoted name and file name`;if(["AUTHORITY","ID"].includes(e)&&!(r.length>=2&&n(0,"string")&&n(1,"string","number")))return`${t.keyword} must start with a quoted authority and identifier`;if(["AXIS"].includes(e)&&!(r.length>=2&&n(0,"string")&&n(1,"enumeration")))return`${t.keyword} must start with a quoted name and axis direction`;if(["METHOD","PROJECTION"].includes(e)&&!(r.length>=1&&n(0,"string")))return`${t.keyword} must start with a quoted name`;if(e==="TIMEEXTENT"){let o=s=>n(s,"enumeration","string");if(r.length!==2||!o(0)||!o(1))return`${t.keyword} must contain two date-time or quoted values`}if(e==="VERTICALEXTENT"&&(r.length<2||r.length>3||!n(0,"number")||!n(1,"number")||r.length===3&&!n(2,"node")))return`${t.keyword} must contain two numeric bounds and an optional unit`;if(e==="COORDINATEMETADATA"&&(r.length<1||r.length>2||!n(0,"node")||r.length===2&&(!n(1,"node")||!["EPOCH","COORDEPOCH"].includes(r[1].keyword.toUpperCase()))))return`${t.keyword} must contain a CRS and an optional coordinate epoch`;if(e==="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`${t.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(e)&&!n(0,"string")?`${t.keyword} must start with a quoted name`:null}function I4(t,e,r){r({node:t,path:e});for(let n=0;n<t.values.length;n++){let i=t.values[n];i.type==="node"&&I4(i,[...e,n],r)}}function Fz(t,e){let r=1,n=1;for(let i=0;i<e&&i<t.length;i++)t[i]===`
3
+ `?(r++,n=1):n++;return{line:r,column:n}}var Tm,Am,Ez,Tz,Ff,Zy,Az,Iz,Pz,Rz,v4,E4,T4,Lz,Oz,Cz,Bz,Yy,Jy=p(()=>{Tm=class extends SyntaxError{constructor(e,r,n){let i=Fz(r,n);super(`${e} at ${i.line}:${i.column}`),this.name="WKTCRSSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}},Am=class extends Error{constructor(e){var r;super(((r=e[0])==null?void 0:r.message)||"WKT validation failed"),this.name="WKTCRSValidationError",this.issues=e}},Ez=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?$/,Tz=/^[A-Za-z][A-Za-z0-9_]*/,Ff=new Set(["COMPD_CS","CONCAT_MT","FITTED_CS","GEOCCS","GEOGCS","INVERSE_MT","LOCAL_CS","PARAM_MT","PASSTHROUGH_MT","PROJCS","VERT_CS"]),Zy=new Set([...Ff,"AUTHORITY","AXIS","CONCAT_MT","DATUM","INVERSE_MT","LOCAL_DATUM","PARAMETER","PARAM_MT","PASSTHROUGH_MT","PRIMEM","PROJECTION","SPHEROID","TOWGS84","UNIT","VERT_DATUM"]),Az=new Set(Ff),Iz=new Set([...Zy,"EXTENSION"]),Pz=new Set([...Ff,"COMPDCS","LOCALCS","VERTCS"]),Rz=new Set([...Zy,"COMPDCS","LOCALCS","VDATUM","VERTCS"]),v4=new Set(["BOUNDCRS","COMPOUNDCRS","COORDINATEOPERATION","ENGCRS","ENGINEERINGCRS","GEODCRS","GEODETICCRS","PARAMETRICCRS","PROJCRS","PROJECTEDCRS","TIMECRS","VERTCRS","VERTICALCRS"]),E4=new Set([...v4,"CONCATENATEDOPERATION","COORDINATEMETADATA","DERIVEDPROJCRS","GEOGCRS","GEOGRAPHICCRS","POINTMOTIONOPERATION"]),T4=new Set([...E4,"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"]),Lz=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"]),Oz=new Set([...T4].filter(t=>!Lz.has(t))),Cz={wkt1:Ff,gdal:Az,esri:Pz,"wkt2:2015":v4,"wkt2:2019":E4},Bz={wkt1:Zy,gdal:Iz,esri:Rz,"wkt2:2015":Oz,"wkt2:2019":T4};Yy=class{constructor(e){this.offset=0,this.source=e}parse(){this.skipWhitespace();let e=this.parseNode();return this.skipWhitespace(),this.offset!==this.source.length&&this.fail("Unexpected content after WKT root"),e}parseNode(){let e=this.parseKeyword();return this.parseNodeAfterKeyword(e)}parseNodeAfterKeyword(e){this.skipWhitespace();let r=this.source[this.offset];r!=="["&&r!=="("&&this.fail(`Expected '[' or '(' after ${e}`),this.offset++;let n=r==="["?"bracket":"parenthesis",i=r==="["?"]":")",o=[];if(this.skipWhitespace(),this.source[this.offset]===i)return this.offset++,{type:"node",keyword:e,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:e,delimiter:n,values:o};(s==="]"||s===")")&&this.fail(`Expected '${i}' to close ${e}`),this.fail(`Expected ',' or '${i}' in ${e}`)}this.fail(`Unterminated ${e} 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)):Ez.test(n)?{type:"number",value:Number(n),raw:n}:{type:"enumeration",value:n}}parseKeyword(){let e=this.source.slice(this.offset).match(Tz);return e||this.fail("Expected a WKT keyword"),this.offset+=e[0].length,e[0]}parseString(){this.offset++;let e="";for(;this.offset<this.source.length;){let r=this.source[this.offset++];if(r==='"'){if(this.source[this.offset]==='"'){e+='"',this.offset++;continue}return{type:"string",value:e}}e+=r}this.fail("Unterminated WKT string")}skipWhitespace(){for(;this.offset<this.source.length&&/\s/.test(this.source[this.offset]);)this.offset++}fail(e){throw new Tm(e,this.source,this.offset)}}});function Gf(t){let e=Uz(t);if(e.length===0)throw new Vo("PROJ string is empty",t,0);return{type:"proj-string",parameters:e.map(n=>Gz(n.raw,n.offset,t))}}function Gz(t,e,r){let n=t.startsWith("+")?t.slice(1):t;if(!n)throw new Vo("Expected a parameter after '+'",r,e);let i=n.indexOf("="),o=i<0?n:n.slice(0,i);if(!o||/[\s+=]/.test(o))throw new Vo(`Invalid PROJ parameter name '${o}'`,r,e);if(i<0)return{type:"parameter",name:o};let s=n.slice(i+1),a=jz(s,r,e+i+1);return{type:"parameter",name:o,value:a,rawValue:s}}function Uz(t){let e=[],r=0;for(;r<t.length;){for(;r<t.length&&/\s/.test(t[r]);)r++;if(r>=t.length)break;let n=r,i=null,o=!1;for(;r<t.length;){let s=t[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==="'")&&t[r-1]==="="){i=s,r++;continue}if(/\s/.test(s))break;r++}if(i)throw new Vo("Unterminated quoted PROJ value",t,n);e.push({raw:t.slice(n,r),offset:n})}return e}function jz(t,e,r){if(!t)return"";let n=t[0];if(n!=='"'&&n!=="'"){if((t.includes('"')||t.includes("'"))&&!kz.test(t))throw new Vo("Quote must begin a PROJ parameter value",e,r);return t}if(t[t.length-1]!==n)throw new Vo("Unterminated quoted PROJ value",e,r);let i="";for(let o=1;o<t.length-1;o++){let s=t[o];s==="\\"&&o+1<t.length-1?i+=t[++o]:i+=s}return i}function zz(t,e){let r=1,n=1;for(let i=0;i<e&&i<t.length;i++)t[i]===`
4
+ `?(r++,n=1):n++;return{line:r,column:n}}var Vo,kz,Qy=p(()=>{Vo=class extends SyntaxError{constructor(e,r,n){let i=zz(r,n);super(`${e} at ${i.line}:${i.column}`),this.name="PROJStringSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}};kz=/^[+-]?\d+(?:\.\d*)?d(?:\d+(?:\.\d*)?'(?:\d+(?:\.\d*)?")?)?[NSEW]?$/i});var Uf,P4=p(()=>{Uf={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 R4(t){return JSON.stringify([t.coordinateFrame,t.projection,Object.keys(t.parameters).sort().map(e=>[e,t.parameters[e]]),[t.ellipsoid.semiMajorAxis,t.ellipsoid.semiMinorAxis],t.axis,[t.xUnit.name,t.xUnit.metersPerUnit,t.xUnit.degreesPerUnit],[t.yUnit.name,t.yUnit.metersPerUnit,t.yUnit.degreesPerUnit],[t.zUnit.name,t.zUnit.metersPerUnit,t.zUnit.degreesPerUnit],t.lossy,t.areaOfUse])}var e2=p(()=>{P4()});var t2=p(()=>{Hl();Jy();Qy()});var Im={};Jt(Im,{EPSILON1:()=>qz,EPSILON10:()=>Jz,EPSILON11:()=>Qz,EPSILON12:()=>eq,EPSILON13:()=>tq,EPSILON14:()=>rq,EPSILON15:()=>nq,EPSILON16:()=>iq,EPSILON17:()=>oq,EPSILON18:()=>sq,EPSILON19:()=>aq,EPSILON2:()=>Vz,EPSILON20:()=>cq,EPSILON3:()=>Wz,EPSILON4:()=>$z,EPSILON5:()=>Hz,EPSILON6:()=>Kz,EPSILON7:()=>Xz,EPSILON8:()=>Yz,EPSILON9:()=>Zz,PI:()=>hq,PI_OVER_FOUR:()=>uq,PI_OVER_SIX:()=>fq,PI_OVER_TWO:()=>lq,TWO_PI:()=>dq});var qz,Vz,Wz,$z,Hz,Kz,Xz,Yz,Zz,Jz,Qz,eq,tq,rq,nq,iq,oq,sq,aq,cq,lq,uq,fq,hq,dq,L4=p(()=>{qz=.1,Vz=.01,Wz=.001,$z=1e-4,Hz=1e-5,Kz=1e-6,Xz=1e-7,Yz=1e-8,Zz=1e-9,Jz=1e-10,Qz=1e-11,eq=1e-12,tq=1e-13,rq=1e-14,nq=1e-15,iq=1e-16,oq=1e-17,sq=1e-18,aq=1e-19,cq=1e-20,lq=Math.PI/2,uq=Math.PI/4,fq=Math.PI/6,hq=Math.PI,dq=Math.PI*2});function r2(t,{precision:e=xt.precision}={}){return t=yq(t),`${parseFloat(t.toPrecision(e))}`}function co(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function n2(t){return O4(t)}function i2(t){return C4(t)}function O4(t,e){return B4(t,r=>r*pq,e)}function C4(t,e){return B4(t,r=>r*mq,e)}function Pm(t,e,r){let n=xt.EPSILON;r&&(xt.EPSILON=r);try{if(t===e)return!0;if(co(t)&&co(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!Pm(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=xt.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{xt.EPSILON=n}}function yq(t){return Math.round(t/xt.EPSILON)*xt.EPSILON}function bq(t){return t.clone?t.clone():new Array(t.length)}function B4(t,e,r){if(co(t)){let n=t;r=r||bq(n);for(let i=0;i<r.length&&i<n.length;++i){let o=typeof t=="number"?t:t[i];r[i]=e(o,i,r)}return r}return e(t)}var mq,pq,gq,xt,Kl=p(()=>{mq=1/Math.PI*180,pq=1/180*Math.PI,gq={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...gq}};xt=globalThis.mathgl.config});var Ns,Rm=p(()=>{Kl();Ns=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:co(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toString(){return this.formatString(xt)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+r2(this[n],e);return`${e.printTypes?this.constructor.name:""}[${r}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Pm(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let i=0;i<this.ELEMENTS;++i){let o=e[i],s=typeof r=="number"?r:r[i];this[i]=o+n*(s-o)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(xt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}}});function wq(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function Ht(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function Xl(t,e,r=""){if(xt.debug&&!wq(t,e))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return t}var ec=p(()=>{Kl()});var Yl,o2=p(()=>{Rm();ec();Kl();Yl=class extends Ns{toString(){let e="[";if(xt.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=` ${this[n*this.RANK+r]}`}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=` ${this[r]}`}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=Ht(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(e,r){let n=e*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}}});function Pi(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}var s2=p(()=>{});var Lm,D4=p(()=>{Rm();ec();s2();Lm=class extends Ns{get x(){return this[0]}set x(e){this[0]=Ht(e)}get y(){return this[1]}set y(e){this[1]=Ht(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-e[n];r+=i*i}return Ht(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return Ht(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Pi(e>=0&&e<this.ELEMENTS,"index is out of range"),Ht(this[e])}setComponent(e,r){return Pi(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]+=e[n]*r;return this.check()}}});var Om,ine,N4=p(()=>{Om=typeof Float32Array<"u"?Float32Array:Array,ine=Math.PI/180});function F4(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function k4(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}var Cm=p(()=>{});function G4(t,e,r){let n=e[0],i=e[1],o=r[3]*n+r[7]*i||1;return t[0]=(r[0]*n+r[4]*i)/o,t[1]=(r[1]*n+r[5]*i)/o,t}function Bm(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o||1;return t[0]=(r[0]*n+r[4]*i+r[8]*o)/s,t[1]=(r[1]*n+r[5]*i+r[9]*o)/s,t[2]=(r[2]*n+r[6]*i+r[10]*o)/s,t}function U4(t,e,r){let n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t[2]=e[2],t}function j4(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=r[0]*n+r[3]*i+r[6]*o,t[1]=r[1]*n+r[4]*i+r[7]*o,t[2]=r[2]*n+r[5]*i+r[8]*o,t[3]=e[3],t}var Dm=p(()=>{});function z4(){let t=new Om(3);return Om!==Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function _q(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function a2(t,e,r){let n=new Om(3);return n[0]=t,n[1]=e,n[2]=r,n}function q4(t,e){let r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function c2(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Zl(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[0],a=r[1],c=r[2];return t[0]=i*c-o*a,t[1]=o*s-n*c,t[2]=n*a-i*s,t}function Nm(t,e,r){let n=e[0],i=e[1],o=e[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return s=s||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/s,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,t}function Fm(t,e,r){let n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function V4(t,e,r){let n=r[0],i=r[1],o=r[2],s=r[3],a=e[0],c=e[1],l=e[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,t[0]=a+u+m,t[1]=c+h+g,t[2]=l+d+y,t}function W4(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function $4(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function H4(t,e,r,n){let i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function K4(t,e){let r=t[0],n=t[1],i=t[2],o=e[0],s=e[1],a=e[2],c=Math.sqrt((r*r+n*n+i*i)*(o*o+s*s+a*a)),l=c&&c2(t,e)/c;return Math.acos(Math.min(Math.max(l,-1),1))}var X4,Jl=p(()=>{N4();X4=_q});var l2,km,J,Y4=p(()=>{D4();Kl();ec();Jl();Dm();l2=[0,0,0],J=class t extends Lm{static get ZERO(){return km||(km=new t(0,0,0),Object.freeze(km)),km}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&co(e)?this.copy(e):(xt.debug&&(Ht(e),Ht(r),Ht(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return xt.debug&&(Ht(e.x),Ht(e.y),Ht(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=Ht(e)}angle(e){return K4(this,e)}cross(e){return Zl(this,this,e),this.check()}rotateX({radians:e,origin:r=l2}){return W4(this,this,r,e),this.check()}rotateY({radians:e,origin:r=l2}){return $4(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=l2}){return H4(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Nm(this,this,e),this.check()}transformAsVector(e){return Bm(this,this,e),this.check()}transformByMatrix3(e){return Fm(this,this,e),this.check()}transformByMatrix2(e){return U4(this,this,e),this.check()}transformByQuaternion(e){return V4(this,this,e),this.check()}}});function Z4(t,e){if(t===e){let r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function J4(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=e[6],l=e[7],u=e[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,t[0]=h*g,t[1]=(-u*n+i*l)*g,t[2]=(a*n-i*s)*g,t[3]=d*g,t[4]=(u*r-i*c)*g,t[5]=(-a*r+i*o)*g,t[6]=m*g,t[7]=(-l*r+n*c)*g,t[8]=(s*r-n*o)*g,t):null}function Q4(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],c=t[7],l=t[8];return e*(l*o-s*c)+r*(-l*i+s*a)+n*(c*i-o*a)}function u2(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],h=e[8],d=r[0],m=r[1],g=r[2],y=r[3],b=r[4],w=r[5],_=r[6],S=r[7],M=r[8];return t[0]=d*n+m*s+g*l,t[1]=d*i+m*a+g*u,t[2]=d*o+m*c+g*h,t[3]=y*n+b*s+w*l,t[4]=y*i+b*a+w*u,t[5]=y*o+b*c+w*h,t[6]=_*n+S*s+M*l,t[7]=_*i+S*a+M*u,t[8]=_*o+S*c+M*h,t}function eT(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],h=e[8],d=r[0],m=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=c,t[6]=d*n+m*s+l,t[7]=d*i+m*a+u,t[8]=d*o+m*c+h,t}function tT(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],h=e[8],d=Math.sin(r),m=Math.cos(r);return t[0]=m*n+d*s,t[1]=m*i+d*a,t[2]=m*o+d*c,t[3]=m*s-d*n,t[4]=m*a-d*i,t[5]=m*c-d*o,t[6]=l,t[7]=u,t[8]=h,t}function f2(t,e,r){let n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function rT(t,e){let r=e[0],n=e[1],i=e[2],o=e[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 t[0]=1-h-g,t[3]=u-w,t[6]=d+b,t[1]=u+w,t[4]=1-l-g,t[7]=m-y,t[2]=d-b,t[5]=m+y,t[8]=1-l-h,t}var h2=p(()=>{});function vq(){return Gm||(Gm=new tc([0,0,0,0,0,0,0,0,0]),Object.freeze(Gm)),Gm}function Eq(){return Um||(Um=new tc,Object.freeze(Um)),Um}var Mq,tc,Gm,Um,nT=p(()=>{o2();ec();Dm();h2();Cm();Jl();Mq=Object.freeze([1,0,0,0,1,0,0,0,1]),tc=class extends Yl{static get IDENTITY(){return Eq()}static get ZERO(){return vq()}get ELEMENTS(){return 9}get RANK(){return 3}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(Mq)}fromObject(e){return this.check()}fromQuaternion(e){return rT(this,e),this.check()}fromMatrix4(e){return this.set(e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10])}set(e,r,n,i,o,s,a,c,l){return this[0]=e,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(e,r,n,i,o,s,a,c,l){return this[0]=e,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 Q4(this)}transpose(){return Z4(this,this),this.check()}invert(){return J4(this,this),this.check()}multiplyLeft(e){return u2(this,e,this),this.check()}multiplyRight(e){return u2(this,this,e),this.check()}rotate(e){return tT(this,this,e),this.check()}scale(e){return Array.isArray(e)?f2(this,this,e):f2(this,this,[e,e]),this.check()}translate(e){return eT(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=F4(r||[-0,-0],e,this);break;case 3:n=Fm(r||[-0,-0,-0],e,this);break;case 4:n=j4(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Xl(n,e.length),n}},Um=null});function Tq(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function iT(t,e){if(t===e){let r=e[1],n=e[2],i=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function oT(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=e[4],a=e[5],c=e[6],l=e[7],u=e[8],h=e[9],d=e[10],m=e[11],g=e[12],y=e[13],b=e[14],w=e[15],_=r*a-n*s,S=r*c-i*s,M=r*l-o*s,v=n*c-i*a,C=n*l-o*a,R=i*l-o*c,E=u*y-h*g,U=u*b-d*g,I=u*w-m*g,O=h*b-d*y,A=h*w-m*y,V=d*w-m*b,k=_*V-S*A+M*O+v*I-C*U+R*E;return k?(k=1/k,t[0]=(a*V-c*A+l*O)*k,t[1]=(i*A-n*V-o*O)*k,t[2]=(y*R-b*C+w*v)*k,t[3]=(d*C-h*R-m*v)*k,t[4]=(c*I-s*V-l*U)*k,t[5]=(r*V-i*I+o*U)*k,t[6]=(b*M-g*R-w*S)*k,t[7]=(u*R-d*M+m*S)*k,t[8]=(s*A-a*I+l*E)*k,t[9]=(n*I-r*A-o*E)*k,t[10]=(g*C-y*M+w*_)*k,t[11]=(h*M-u*C-m*_)*k,t[12]=(a*U-s*O-c*E)*k,t[13]=(r*O-n*U+i*E)*k,t[14]=(y*S-g*v-b*_)*k,t[15]=(u*v-h*S+d*_)*k,t):null}function sT(t){let e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],c=t[7],l=t[8],u=t[9],h=t[10],d=t[11],m=t[12],g=t[13],y=t[14],b=t[15],w=e*s-r*o,_=e*a-n*o,S=r*a-n*s,M=l*g-u*m,v=l*y-h*m,C=u*y-h*g,R=e*C-r*v+n*M,E=o*C-s*v+a*M,U=l*S-u*_+h*w,I=m*S-g*_+y*w;return c*R-i*E+b*U-d*I}function d2(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],h=e[8],d=e[9],m=e[10],g=e[11],y=e[12],b=e[13],w=e[14],_=e[15],S=r[0],M=r[1],v=r[2],C=r[3];return t[0]=S*n+M*a+v*h+C*y,t[1]=S*i+M*c+v*d+C*b,t[2]=S*o+M*l+v*m+C*w,t[3]=S*s+M*u+v*g+C*_,S=r[4],M=r[5],v=r[6],C=r[7],t[4]=S*n+M*a+v*h+C*y,t[5]=S*i+M*c+v*d+C*b,t[6]=S*o+M*l+v*m+C*w,t[7]=S*s+M*u+v*g+C*_,S=r[8],M=r[9],v=r[10],C=r[11],t[8]=S*n+M*a+v*h+C*y,t[9]=S*i+M*c+v*d+C*b,t[10]=S*o+M*l+v*m+C*w,t[11]=S*s+M*u+v*g+C*_,S=r[12],M=r[13],v=r[14],C=r[15],t[12]=S*n+M*a+v*h+C*y,t[13]=S*i+M*c+v*d+C*b,t[14]=S*o+M*l+v*m+C*w,t[15]=S*s+M*u+v*g+C*_,t}function aT(t,e,r){let n=r[0],i=r[1],o=r[2],s,a,c,l,u,h,d,m,g,y,b,w;return e===t?(t[12]=e[0]*n+e[4]*i+e[8]*o+e[12],t[13]=e[1]*n+e[5]*i+e[9]*o+e[13],t[14]=e[2]*n+e[6]*i+e[10]*o+e[14],t[15]=e[3]*n+e[7]*i+e[11]*o+e[15]):(s=e[0],a=e[1],c=e[2],l=e[3],u=e[4],h=e[5],d=e[6],m=e[7],g=e[8],y=e[9],b=e[10],w=e[11],t[0]=s,t[1]=a,t[2]=c,t[3]=l,t[4]=u,t[5]=h,t[6]=d,t[7]=m,t[8]=g,t[9]=y,t[10]=b,t[11]=w,t[12]=s*n+u*i+g*o+e[12],t[13]=a*n+h*i+y*o+e[13],t[14]=c*n+d*i+b*o+e[14],t[15]=l*n+m*i+w*o+e[15]),t}function cT(t,e,r){let n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function lT(t,e,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,C,R,E,U,I,O,A,V,k,T;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=e[0],d=e[1],m=e[2],g=e[3],y=e[4],b=e[5],w=e[6],_=e[7],S=e[8],M=e[9],v=e[10],C=e[11],R=i*i*u+c,E=o*i*u+s*l,U=s*i*u-o*l,I=i*o*u-s*l,O=o*o*u+c,A=s*o*u+i*l,V=i*s*u+o*l,k=o*s*u-i*l,T=s*s*u+c,t[0]=h*R+y*E+S*U,t[1]=d*R+b*E+M*U,t[2]=m*R+w*E+v*U,t[3]=g*R+_*E+C*U,t[4]=h*I+y*O+S*A,t[5]=d*I+b*O+M*A,t[6]=m*I+w*O+v*A,t[7]=g*I+_*O+C*A,t[8]=h*V+y*k+S*T,t[9]=d*V+b*k+M*T,t[10]=m*V+w*k+v*T,t[11]=g*V+_*k+C*T,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function uT(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[4],s=e[5],a=e[6],c=e[7],l=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*n,t[5]=s*i+u*n,t[6]=a*i+h*n,t[7]=c*i+d*n,t[8]=l*i-o*n,t[9]=u*i-s*n,t[10]=h*i-a*n,t[11]=d*i-c*n,t}function fT(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],c=e[3],l=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*n,t[1]=s*i-u*n,t[2]=a*i-h*n,t[3]=c*i-d*n,t[8]=o*n+l*i,t[9]=s*n+u*i,t[10]=a*n+h*i,t[11]=c*n+d*i,t}function hT(t,e,r){let n=Math.sin(r),i=Math.cos(r),o=e[0],s=e[1],a=e[2],c=e[3],l=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*n,t[1]=s*i+u*n,t[2]=a*i+h*n,t[3]=c*i+d*n,t[4]=l*i-o*n,t[5]=u*i-s*n,t[6]=h*i-a*n,t[7]=d*i-c*n,t}function dT(t,e){let r=e[0],n=e[1],i=e[2],o=e[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 t[0]=1-h-g,t[1]=u+w,t[2]=d-b,t[3]=0,t[4]=u-w,t[5]=1-l-g,t[6]=m+y,t[7]=0,t[8]=d+b,t[9]=m-y,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function mT(t,e,r,n,i,o,s){let a=1/(r-e),c=1/(i-n),l=1/(o-s);return t[0]=o*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*c,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(i+n)*c,t[10]=(s+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*l,t[15]=0,t}function Aq(t,e,r,n,i){let o=1/Math.tan(e/2);if(t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0){let s=1/(n-i);t[10]=(i+n)*s,t[14]=2*i*n*s}else t[10]=-1,t[14]=-2*n;return t}function Iq(t,e,r,n,i,o,s){let a=1/(e-r),c=1/(n-i),l=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*a,t[13]=(i+n)*c,t[14]=(s+o)*l,t[15]=1,t}function yT(t,e,r,n){let i,o,s,a,c,l,u,h,d,m,g=e[0],y=e[1],b=e[2],w=n[0],_=n[1],S=n[2],M=r[0],v=r[1],C=r[2];return Math.abs(g-M)<1e-6&&Math.abs(y-v)<1e-6&&Math.abs(b-C)<1e-6?Tq(t):(h=g-M,d=y-v,m=b-C,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),t[0]=o,t[1]=c,t[2]=h,t[3]=0,t[4]=s,t[5]=l,t[6]=d,t[7]=0,t[8]=a,t[9]=u,t[10]=m,t[11]=0,t[12]=-(o*g+s*y+a*b),t[13]=-(c*g+l*y+u*b),t[14]=-(h*g+d*y+m*b),t[15]=1,t)}function m2(t){if(t.length!==16||Array.from(t).some(i=>!Number.isFinite(i))||t[3]!==0||t[7]!==0||t[11]!==0||t[15]!==1)throw new RangeError("Expected a finite affine matrix");let e=[Math.hypot(t[0],t[1],t[2]),Math.hypot(t[4],t[5],t[6]),Math.hypot(t[8],t[9],t[10])];if(e.some(i=>i===0||!Number.isFinite(i)))throw new RangeError("Singular transform");let r=Array.from({length:9},(i,o)=>t[Math.floor(o/3)*4+o%3]/e[Math.floor(o/3)]);for(let[i,o]of[[0,3],[0,6],[3,6]])if(Math.abs(r[i]*r[o]+r[i+1]*r[o+1]+r[i+2]*r[o+2])>1e-7)throw new RangeError("Sheared transforms do not have a TRS decomposition");if(r[0]*(r[4]*r[8]-r[5]*r[7])-r[3]*(r[1]*r[8]-r[2]*r[7])+r[6]*(r[1]*r[5]-r[2]*r[4])<0){e[0]=-e[0];for(let i=0;i<3;i++)r[i]=-r[i]}return{rotation:r,scale:e,translation:[t[12],t[13],t[14]]}}var pT,gT,jm=p(()=>{pT=Aq;gT=Iq});function bT(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function wT(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function xT(t){let e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}function _T(t){let e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function ST(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=o*s,t}function MT(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function vT(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=s+n*(r[2]-s),t[3]=a+n*(r[3]-a),t}function ET(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,t}var zm=p(()=>{});function Cq(){return qm||(qm=new mn([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(qm)),qm}function Bq(){return Vm||(Vm=new mn,Object.freeze(Vm)),Vm}function TT(t){if(t>Math.PI*2)throw Error("expected radians")}function Dq(t,e,r,n,i,o){let s=2*o/(r-e),a=2*o/(i-n),c=(r+e)/(r-e),l=(i+n)/(i-n),u=-1,h=-1,d=-2*o;return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=c,t[9]=l,t[10]=u,t[11]=h,t[12]=0,t[13]=0,t[14]=d,t[15]=0,t}var Rq,Lq,p2,g2,Oq,mn,qm,Vm,AT=p(()=>{o2();jm();ec();Dm();jm();Cm();Jl();zm();Rq=45*Math.PI/180,Lq=1,p2=.1,g2=500,Oq=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),mn=class extends Yl{static get IDENTITY(){return Bq()}static get ZERO(){return Cq()}get ELEMENTS(){return 16}get RANK(){return 4}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,i,o,s,a,c,l,u,h,d,m,g,y,b){return this[0]=e,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(e,r,n,i,o,s,a,c,l,u,h,d,m,g,y,b){return this[0]=e,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(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(Oq)}fromObject(e){return this.check()}fromQuaternion(e){return dT(this,e),this.check()}fromMatrix3(e){return this.set(e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1)}frustum(e){let{left:r,right:n,bottom:i,top:o,near:s=p2,far:a=g2}=e;return a===1/0?Dq(this,r,n,i,o,s):mT(this,r,n,i,o,s,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=e;return yT(this,r,n,i),this.check()}ortho(e){let{left:r,right:n,bottom:i,top:o,near:s=p2,far:a=g2}=e;return gT(this,r,n,i,o,s,a),this.check()}orthographic(e){let{fovy:r=Rq,aspect:n=Lq,focalDistance:i=1,near:o=p2,far:s=g2}=e;TT(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(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=e;return TT(r),pT(this,r,n,i,o),this.check()}determinant(){return sT(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){let{rotation:n,scale:i}=m2(this);if(e=e||new Array(16),r)for(let o=0;o<3;o++)r[o]=i[o];for(let o=0;o<16;o++)e[o]=0;for(let o=0;o<9;o++)e[Math.floor(o/3)*4+o%3]=n[o];return e[15]=1,e}getRotationMatrix3(e,r){let{rotation:n,scale:i}=m2(this);if(e=e||new Array(9),r)for(let o=0;o<3;o++)r[o]=i[o];for(let o=0;o<9;o++)e[o]=n[o];return e}transpose(){return iT(this,this),this.check()}invert(){return oT(this,this),this.check()}multiplyLeft(e){return d2(this,e,this),this.check()}multiplyRight(e){return d2(this,this,e),this.check()}rotateX(e){return uT(this,this,e),this.check()}rotateY(e){return fT(this,this,e),this.check()}rotateZ(e){return hT(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return lT(this,this,e,r),this.check()}scale(e){return cT(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return aT(this,this,e),this.check()}transform(e,r){return e.length===4?(r=ET(r||[-0,-0,-0,-0],e,this),Xl(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,i;switch(n){case 2:i=k4(r||[-0,-0],e,this);break;case 3:i=Nm(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Xl(i,e.length),i}transformAsVector(e,r){let n;switch(e.length){case 2:n=G4(r||[-0,-0],e,this);break;case 3:n=Bm(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Xl(n,e.length),n}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}}});function IT(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function y2(t,e,r){r=r*.5;let n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function b2(t,e,r){let n=e[0],i=e[1],o=e[2],s=e[3],a=r[0],c=r[1],l=r[2],u=r[3];return t[0]=n*u+s*a+i*l-o*c,t[1]=i*u+s*c+o*a-n*l,t[2]=o*u+s*l+n*c-i*a,t[3]=s*u-n*a-i*c-o*l,t}function PT(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*a,t[1]=i*c+o*a,t[2]=o*c-i*a,t[3]=s*c-n*a,t}function RT(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c-o*a,t[1]=i*c+s*a,t[2]=o*c+n*a,t[3]=s*c-i*a,t}function LT(t,e,r){r*=.5;let n=e[0],i=e[1],o=e[2],s=e[3],a=Math.sin(r),c=Math.cos(r);return t[0]=n*c+i*a,t[1]=i*c-n*a,t[2]=o*c+s*a,t[3]=s*c-o*a,t}function OT(t,e){let r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function w2(t,e,r,n){let i=e[0],o=e[1],s=e[2],a=e[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),t[0]=g*i+y*c,t[1]=g*o+y*l,t[2]=g*s+y*u,t[3]=g*a+y*h,t}function CT(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-i*a,t[3]=o*a,t}function BT(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function DT(t,e){let r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);let o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(e[i*3+i]-e[o*3+o]-e[s*3+s]+1),t[i]=.5*n,n=.5/n,t[3]=(e[o*3+s]-e[s*3+o])*n,t[o]=(e[o*3+i]+e[i*3+o])*n,t[s]=(e[s*3+i]+e[i*3+s])*n}return t}function qT(t,e,r,n){if(e.length!==4||r.length!==4||[...Array.from(e),...Array.from(r),n].some(d=>!Number.isFinite(d)))throw new RangeError("Expected finite quaternions and step");if(e.length!==4||n<0)throw new RangeError("Expected quaternions and a nonnegative step");let i=Math.max(...Array.from(e,Math.abs)),o=Math.max(...Array.from(r,Math.abs));if(!i||!o)throw new RangeError("Zero quaternion");let s=Array.from(e,d=>d/i),a=Array.from(r,d=>d/o),c=Math.hypot(...s),l=Math.hypot(...a);for(let d=0;d<4;d++)s[d]/=c,a[d]/=l;let u=s.reduce((d,m,g)=>d+m*a[g],0),h=2*Math.acos(Math.min(1,Math.abs(u)));if(t.length<4)throw new RangeError("Result buffer is too short");return w2(t,s,a,h===0?0:Math.min(1,n/h)),t}var NT,FT,kT,GT,UT,jT,Nq,zT,Wm=p(()=>{Jl();zm();NT=bT,FT=wT,kT=MT,GT=vT,UT=xT,jT=_T,Nq=ST,zT=(function(){let t=z4(),e=a2(1,0,0),r=a2(0,1,0);return function(n,i,o){let s=c2(i,o);return s<-.999999?(Zl(t,e,i),X4(t)<1e-6&&Zl(t,r,i),q4(t,t),y2(n,t,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Zl(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+s,Nq(n,n))}})()});var zf,VT=p(()=>{Wm();Rm();ec();Wm();zf=class extends Ns{constructor(e=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,i)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,r,n,i){return this[0]=e,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return DT(this,e),this.check()}fromEuler(e){switch(this.identity(),e.order){case"xyz":return this.rotateX(e.x).rotateY(e.y).rotateZ(e.z);case"yxz":return this.rotateY(e.y).rotateX(e.x).rotateZ(e.z);case"zxy":return this.rotateZ(e.z).rotateX(e.x).rotateY(e.y);case"zyx":return this.rotateZ(e.z).rotateY(e.y).rotateX(e.x);case"yzx":return this.rotateY(e.y).rotateZ(e.z).rotateX(e.x);case"xzy":return this.rotateX(e.x).rotateZ(e.z).rotateY(e.y);default:throw new Error("Unknown Euler angle order")}}fromAxisRotation(e,r){return y2(this,e,r),this.check()}rotateTowards(e,r){return qT(this,this,e,r)}identity(){return IT(this),this.check()}setAxisAngle(e,r){return this.fromAxisRotation(e,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=Ht(e)}get y(){return this[1]}set y(e){this[1]=Ht(e)}get z(){return this[2]}set z(e){this[2]=Ht(e)}get w(){return this[3]}set w(e){this[3]=Ht(e)}len(){return UT(this)}lengthSquared(){return jT(this)}dot(e){return kT(this,e)}rotationTo(e,r){return zT(this,e,r),this.check()}add(e){return NT(this,this,e),this.check()}calculateW(){return OT(this,this),this.check()}conjugate(){return BT(this,this),this.check()}invert(){return CT(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(GT(this,e,r,n),this.check())}multiplyRight(e){return b2(this,this,e),this.check()}multiplyLeft(e){return b2(this,e,this),this.check()}normalize(){let e=this.len(),r=e>0?1/e:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,e===0&&(this[3]=1),this.check()}rotateX(e){return PT(this,this,e),this.check()}rotateY(e){return RT(this,this,e),this.check()}rotateZ(e){return LT(this,this,e),this.check()}scale(e){return FT(this,this,e),this.check()}slerp(e,r,n){let i,o,s;return arguments.length===2?(i=this,o=e,s=r):(i=e,o=r,s=n),w2(this,i,o,s),this.check()}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,r){return this.setAxisAngle(e,r)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}}});function _2(){return{eastX:0,eastY:1,northZ:1,upX:1,upY:0,upZ:0}}function S2(t,e,r){let n=t.x,i=t.y,o=t.z,s=e.x,a=e.y,c=e.z;return o!==0?!1:Fq(r,n,i,s*i-a*n,s,a,c)}function M2(t,e,r,n,i,o){let s=x2(r),a=x2(n),c=x2(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=t.eastX,g=t.eastY,y=t.northZ,b=t.upX,w=t.upY,_=t.upZ,S=-_*g,M=_*m,v=e.x,C=e.y,R=e.z,E=(l===1?m:l===2?S:b)*Math.sign(s),U=(l===1?g:l===2?M:w)*Math.sign(s),I=(l===1?0:l===2?y:_)*Math.sign(s),O=(u===1?m:u===2?S:b)*Math.sign(a),A=(u===1?g:u===2?M:w)*Math.sign(a),V=(u===1?0:u===2?y:_)*Math.sign(a),k=(h===1?m:h===2?S:b)*Math.sign(c),T=(h===1?g:h===2?M:w)*Math.sign(c),B=(h===1?0:h===2?y:_)*Math.sign(c);return!Number.isFinite(E)||!Number.isFinite(U)||!Number.isFinite(I)||!Number.isFinite(O)||!Number.isFinite(A)||!Number.isFinite(V)||!Number.isFinite(k)||!Number.isFinite(T)||!Number.isFinite(B)||!Number.isFinite(v)||!Number.isFinite(C)||!Number.isFinite(R)||o instanceof Float32Array&&(!Number.isFinite(Math.fround(E))||!Number.isFinite(Math.fround(U))||!Number.isFinite(Math.fround(I))||!Number.isFinite(Math.fround(O))||!Number.isFinite(Math.fround(A))||!Number.isFinite(Math.fround(V))||!Number.isFinite(Math.fround(k))||!Number.isFinite(Math.fround(T))||!Number.isFinite(Math.fround(B))||!Number.isFinite(Math.fround(v))||!Number.isFinite(Math.fround(C))||!Number.isFinite(Math.fround(R)))?!1:(o[0]=E,o[1]=U,o[2]=I,o[3]=0,o[4]=O,o[5]=A,o[6]=V,o[7]=0,o[8]=k,o[9]=T,o[10]=B,o[11]=0,o[12]=v,o[13]=C,o[14]=R,o[15]=1,!0)}function x2(t){switch(t){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 Fq(t,e,r,n,i,o,s){return!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)?!1:(t.eastX=e,t.eastY=r,t.northZ=n,t.upX=i,t.upY=o,t.upZ=s,!0)}var WT=p(()=>{});function qf(t,e,r=t){let n=t.x,i=t.y,o=t.z,{semiMajorAxis:s,semiMinorAxis:a,eccentricitySquared:c}=e,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 Ql(r,m,g,y)}function Vf(t,e,r=t){let n=t.x,i=t.y,o=t.z,{semiMajorAxis:s,semiMinorAxis:a,eccentricitySquared:c}=e,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 Ql(r,u===0?0:l,Math.atan2(o,u),h-s);if(u===0)return Ql(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*Hm||c>=.9)return v2(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 M=s/Math.sqrt(1-c*_*_),v=u*w+o*_-M*(1-c*_*_),C=c*M/(M+v);b=1/Math.sqrt(1-C*(2-C)*y*y);let R=y*(1-C)*b,E=g*b;if(Math.abs(E*w-R*_)<=1e-12){if(!Number.isFinite(v))break;return Ql(r,l,Math.atan2(E,Math.abs(R)),v)}w=R,_=E}return v2(n,i,o,u,s,a,r)}function v2(t,e,r,n,i,o,s){let a=Math.atan2(e,t),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+Fs(o,o,g)-l*Fs(i,i,m)-Fs(l,m,l*m))/m:0,b=n*n,w=t*t,_=e*e,S=w+_,M=Number.isFinite(b)&&b>0?(S-b+$m(w,_,S)+Fs(t,t,w)+Fs(e,e,_)-Fs(n,n,b))/(2*n):0,v=i*l,C=n-i,R=C+v,E=M+$m(n,-i,C)+$m(C,v,R)+Fs(i,l,v)+i*y;if(r===0)return R+E<0?!1:Ql(s,a,0,C);let U=Math.abs(h)*c,I=0,O=l+Math.hypot(u,h*c);if(!Number.isFinite(O))return!1;let A=Math.max(U,u-d);A>I&&A<O||(A=O/2);let V=-(R+E)/i,k=Math.sqrt(V*(u+d))/d,T=V>0&&Math.abs(r)/k/i*c<=Hm*V?Math.atan2(Math.sign(r)*k/c,u/d):void 0;for(let B=0;B<1024&&T===void 0;B++){let N=d+A,D=u/N,L=r/A/i,P=L*c,z=i*A,we=R-z,ne=(we+($m(R,-z,we)+E-Fs(i,A,z)))/(i*N)*(D+1),Oe=ne+P*P;if(!Number.isFinite(Oe))return!1;Oe>0?I=A:O=A;let oe=-2*(D*D/N+P*P/A),Se=A-Oe/oe,Ce=Se>I&&Se<O?Se:I+(O-I)/2;if(Math.abs(Oe)<=4*Hm*(Math.abs(ne)+P*P)||O-I<=4*Hm*A){T=Math.atan2(L,D);break}A=Ce}return T!==void 0&&kq(s,a,T,n,r,i,c)}function $m(t,e,r){let n=r-t;return t-(r-n)+(e-n)}function Fs(t,e,r){let n=134217729*t,i=134217729*e;if(!Number.isFinite(n)||!Number.isFinite(i))return 0;let o=n-(n-t),s=i-(i-e),a=t-o,c=e-s;return o*s-r+o*c+a*s+a*c}function kq(t,e,r,n,i,o,s){let a=Math.sin(r),c=Math.cos(r);return Ql(t,e,r,n*c+i*a-o*Math.hypot(c,s*a))}function Ql(t,e,r,n){return!Number.isFinite(e)||!Number.isFinite(r)||!Number.isFinite(n)?!1:(t.x=e,t.y=r,t.z=n,!0)}var Hm,$T=p(()=>{Hm=Number.EPSILON});function Km(){return eu??Uint16Array}var eu,HT=p(()=>{eu=globalThis.Float16Array});var KT=p(()=>{HT()});var XT=p(()=>{KT()});var YT=p(()=>{h2()});var ZT=p(()=>{jm()});var JT=p(()=>{Wm()});var QT=p(()=>{Cm()});var eA=p(()=>{Jl()});var tA=p(()=>{zm()});var Cn=p(()=>{Y4();nT();AT();VT();L4();s2();Kl();WT();$T();XT();YT();ZT();JT();QT();eA();tA()});var Wo,Eie,rA=p(()=>{Wo=6356752314245179e-9,Eie={radii:[6378137,6378137,Wo],radiiSquared:[6378137*6378137,6378137*6378137,Wo*Wo],oneOverRadii:[1/6378137,1/6378137,1/Wo],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Wo*Wo)],maximumRadius:Math.max(6378137,6378137,Wo),centerToleranceSquared:.1}});function E2(t){return t}function $o(t,e=[],r=E2){return"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):"x"in t?(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function nA(t,e=[]){return $o(t,e,xt._cartographicRadians?E2:n2)}function T2(t,e,r,n){let i=xt._cartographicRadians?E2:i2,o=i(t),s=i(e);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 Iie,iA=p(()=>{Cn();Iie=new J});function lo(t,e,r,n,i,o,s){let c=[n,i,o,Math.abs(t),Math.abs(e),Math.abs(r)].map(R=>{let E=R.toString(2),U=E.indexOf(".");return{integer:BigInt("0b"+E.replace(".","")),exponent:U<0?0:U+1-E.length}}),l=Math.min(...c.filter(R=>R.integer!==0n).map(R=>R.exponent)),u=c.map(R=>R.integer<<BigInt(R.exponent-l)),h=u.slice(0,3).map(R=>R*R),d=h.reduce((R,E)=>R<E?R:E),m=h.map(R=>R-d),g=h.map((R,E)=>u[E]*u[E+3]),y=64;if(!g.some((R,E)=>m[E]===0n&&R!==0n)){let R=-1n,E=1n;for(let O=0;O<3;O++){if(m[O]===0n)continue;let A=m[O]*m[O];R=R*A+g[O]*g[O]*E,E*=A}if(R<0n)return!1;if(R===0n)return C(0n,1n);let I=m.filter(O=>O>0n).reduce((O,A)=>O<A?O:A);y=Math.max(64,(2n*(E+R)).toString(2).length-(R*I).toString(2).length+128)}let b=1n<<BigInt(y),w=m.map(R=>R*b),_=g.map(R=>R*b),S=_.map(R=>R*R),M=0n,v=_.reduce((R,E)=>R+E,0n);if(v===0n)return!1;for(let R=0;R<4096;R++){let E=M+v>>1n;if(E===M)return!1;let U=w[0]+E,I=w[1]+E,O=w[2]+E,A=U*U,V=I*I,k=O*O,T=S[0]*V*k+S[1]*A*k+S[2]*A*V-A*V*k;if(T===0n)return C(E,b);if(T>0n?M=E:v=E,M>0n&&v-M<=M>>60n)return C(M+v>>1n,b)}return!1;function C(R,E){let U=h.map((V,k)=>{let T=m[k]*E+R;return T===0n?0:Hq(V*u[k+3]*E,T,l)});if(!U.every(Number.isFinite))return!1;let I=Math.sign(t)*U[0],O=Math.sign(e)*U[1],A=Math.sign(r)*U[2];return s.x=I,s.y=O,s.z=A,!0}}function Hq(t,e,r){if(t===0n)return 0;let n=52-(t.toString(2).length-e.toString(2).length),i=n>=0?t<<BigInt(n):t,o=n>=0?e:e<<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 oA=p(()=>{});function sA(t,e,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=rc(a,a,c),m=l-c,g=u-c,y=h-c,b=Ho(l,-c,m)+rc(n,n,l)-d,w=Ho(u,-c,g)+rc(i,i,u)-d,_=Ho(h,-c,y)+rc(o,o,h)-d,S=n*Math.abs(t),M=i*Math.abs(e),v=o*Math.abs(r);if(c<2**-1022||t!==0&&S<2**-1022||e!==0&&M<2**-1022||r!==0&&v<2**-1022)return lo(t,e,r,n,i,o,s);let C=rc(n,Math.abs(t),S),R=rc(i,Math.abs(e),M),E=rc(o,Math.abs(r),v);if(Math.hypot(m===0?S===0?0:1/0:S/(m+b),g===0?M===0?0:1/0:M/(g+w),y===0?v===0?0:1/0:v/(y+_))<=1+64*Number.EPSILON)return lo(t,e,r,n,i,o,s);if((t!==0?1:0)+(e!==0?1:0)+(r!==0?1:0)==1)return s.x=t===0?t:Math.sign(t)*n,s.y=e===0?e:Math.sign(e)*i,s.z=r===0?r:Math.sign(r)*o,!0;let I=Math.hypot(m===0?S:0,g===0?M:0,y===0?v:0),O=Math.hypot(S,M,v);if(!(O>0)||!Number.isFinite(O))return lo(t,e,r,n,i,o,s);let A=I>0?I:O;for(let V=0;V<512;V++){let k=m+A,T=g+A,B=y+A,N=Ho(m,A,k)+b,D=Ho(g,A,T)+w,L=Ho(y,A,B)+_,P=S/k,z=M/T,we=v/B,_e,ne;P>=z&&P>=we?(_e=A2(S,C,m,b,A,k)*(P+1),ne=(z*(1-D/T))**2+(we*(1-L/B))**2):z>=we?(_e=A2(M,R,g,w,A,T)*(z+1),ne=(P*(1-N/k))**2+(we*(1-L/B))**2):(_e=A2(v,E,y,_,A,B)*(we+1),ne=(P*(1-N/k))**2+(z*(1-D/T))**2);let Oe=-2*(P*P/k+z*z/T+we*we/B),oe=4*Number.EPSILON*(Math.abs(_e)+ne),Se=_e+ne;if(!Number.isFinite(Se))return lo(t,e,r,n,i,o,s);if(Math.abs(Se)<=4*Number.EPSILON*(Math.abs(_e)+ne)||O-I<=4*Number.EPSILON*A){let Ue=oe/Math.abs(Oe);if(!Number.isFinite(Oe)||!(Math.abs(Oe)>0)||Ue>2e-13*A)return lo(t,e,r,n,i,o,s);let Ke=Math.sign(t)*n*(P*(1-N/k)),ft=Math.sign(e)*i*(z*(1-D/T)),ht=Math.sign(r)*o*(we*(1-L/B)),pt=2*Ue*Math.max(Math.abs(Ke/k),Math.abs(ft/T),Math.abs(ht/B));return!Number.isFinite(pt)||pt>2e-13*Math.max(n,i,o)?lo(t,e,r,n,i,o,s):!Number.isFinite(Ke)||!Number.isFinite(ft)||!Number.isFinite(ht)?lo(t,e,r,n,i,o,s):(s.x=Ke,s.y=ft,s.z=ht,!0)}Se>0?I=A:O=A;let Ce=A-Se/Oe,q=Ce>I&&Ce<O?Ce:I+(O-I)/2;if(q===A)return lo(t,e,r,n,i,o,s);A=q}return lo(t,e,r,n,i,o,s)}function A2(t,e,r,n,i,o){let s=t-r,a=Ho(t,-r,s)+e-n,c=s+a,l=Ho(s,a,c),u=c-i;return(u+(Ho(c,-i,u)+l))/o}function Ho(t,e,r){let n=r-t;return t-(r-n)+(e-n)}function rc(t,e,r){let n=134217729*t,i=134217729*e;if(!Number.isFinite(n)||!Number.isFinite(i))return 0;let o=n-(n-t),s=i-(i-e),a=t-o,c=e-s;return o*s-r+o*c+a*s+a*c}var aA=p(()=>{oA()});function cA(t,e,r=[]){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)||!Number.isFinite(i*i+o*o+s*s))return;let{radii:a}=e;if(sA(i,o,s,a.x,a.y,a.z,Xm))return uo(r,Xm.x,Xm.y,Xm.z)}function uo(t,e,r,n){if(co(t))t[0]=e,t[1]=r,t[2]=n;else{let i=t;i.x=e,i.y=r,i.z=n}return t}var Xm,lA=p(()=>{Cn();aA();Xm={x:0,y:0,z:0}});function uA(t,e){if(!Number.isFinite(t)||!Number.isFinite(e)||t<=0||e<=0||e>t)throw new Error("Spheroid requires finite positive axes with semiMinorAxis <= semiMajorAxis")}function Jm(t,e,r,n){let i=Math.max(Math.abs(t),Math.abs(e),Math.abs(r));if(!(i>0)||!Number.isFinite(i))return;let o=t/i,s=e/i,a=r/i,c=Math.hypot(o,s,a);return uo(n,o/c,s/c,a/c)}var pn,Ym,Yq,ci,Zm,Tt,fA=p(()=>{Cn();Cn();rA();iA();lA();pn={x:0,y:0,z:0},Ym=new J,Yq=new J,ci=new J,Zm=new J,Tt=class t{static fromSpheroid(e){let{semiMajorAxis:r,semiMinorAxis:n}=e;return uA(r,n),new t(r,r,n)}constructor(e=0,r=0,n=0){this.centerToleranceSquared=Im.EPSILON1,Pi(Number.isFinite(e)&&e>=0),Pi(Number.isFinite(r)&&r>=0),Pi(Number.isFinite(n)&&n>=0),this.radii=new J(e,r,n),this.radiiSquared=new J(e*e,r*r,n*n),this.radiiToTheFourth=new J(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new J(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new J(e===0?0:1/(e*e),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,r,n),this.maximumRadius=Math.max(e,r,n),n!==0&&(this.squaredXOverSquaredZ=(e/n)**2),e===r&&n>0&&n<=e&&Number.isFinite(this.radiiSquared.x)&&this.radiiSquared.z>0&&(this.spheroidGeometry=Object.freeze({semiMajorAxis:e,semiMinorAxis:n,eccentricitySquared:1-(n/e)**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:e,y:r,z:n}=this.radii;if(e!==r)throw new Error("Spheroid requires equal X/Y radii");return uA(e,n),Object.freeze({semiMajorAxis:e,semiMinorAxis:n})}equals(e){return this===e||!!(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,r=[0,0,0]){let n=nA(e,Zm),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 pn.x=i,pn.y=o,pn.z=s,qf(pn,this.spheroidGeometry)?uo(r,pn.x,pn.y,pn.z):void 0;let a=Yq;this.geodeticSurfaceNormalCartographic(e,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 uo(r,y,b,w)}cartesianToCartographic(e,r=[0,0,0]){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))return;if(this.spheroidGeometry&&Number.isFinite(i*i+o*o+s*s)&&Number.isFinite(this.oneOverRadiiSquared.x)&&Number.isFinite(this.oneOverRadiiSquared.z)){pn.x=i,pn.y=o,pn.z=s;let _=this.spheroidGeometry;if(!(s===0&&_.semiMinorAxis<_.semiMajorAxis&&Math.abs(Math.hypot(i,o)-_.semiMajorAxis*_.eccentricitySquared)<=64*Number.EPSILON*_.semiMajorAxis)&&Vf(pn,_)){let M=i===0&&o===0?Math.atan2(o,i):pn.x;return T2(M,pn.y,pn.z,r)}}if(!(this.minimumRadius>0)||!Number.isFinite(this.maximumRadius*this.maximumRadius)||!Number.isFinite(1/(this.minimumRadius*this.minimumRadius)))return;Zm.set(i,o,s);let a=this.scaleToGeodeticSurface(Zm,ci);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 T2(y,b,w,r)}geocentricSurfaceNormal(e,r=[0,0,0]){$o(e,Ym);let n=Ym;return Jm(n.x,n.y,n.z,r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=$o(e,Zm),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 Jm(c*Math.cos(i),c*Math.sin(i),l,r)}geodeticSurfaceNormal(e,r=[0,0,0]){if(!(this.minimumRadius>0))return;$o(e,Ym);let n=Ym,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 Jm(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 Jm(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(e,r){return cA(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){$o(e,ci);let n=ci,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 uo(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 uo(r,s/l,a/l,c/l)}transformPositionToScaledSpace(e,r=[0,0,0]){$o(e,ci);let n=ci.scale(this.oneOverRadii);return uo(r,n.x,n.y,n.z)}transformPositionFromScaledSpace(e,r=[0,0,0]){$o(e,ci);let n=ci.scale(this.radii);return uo(r,n.x,n.y,n.z)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){if(Pi(this.radii.x===this.radii.y&&this.minimumRadius>0),$o(e,ci),!Number.isFinite(ci.x)||!Number.isFinite(ci.y)||!Number.isFinite(ci.z)||!Number.isFinite(r))return;let i=ci.z*(1-this.squaredXOverSquaredZ);if(Number.isFinite(i)&&!(Math.abs(i)>=this.radii.z-r))return uo(n,0,0,i)}};Tt.WGS84=new Tt(6378137,6378137,Wo)});var Qt,hA=p(()=>{Qt={};Qt.Constants={};Qt.Math={};Qt.Accumulator={};(function(t){"use strict";t.WGS84={a:6378137,f:1/298.257223563},t.version={major:2,minor:2,patch:0},t.version_string="2.2.0"})(Qt.Constants);(function(t){"use strict";t.digits=53,t.epsilon=Math.pow(.5,t.digits-1),t.degree=Math.PI/180,t.sq=function(e){return e*e},t.hypot=function(e,r){return Math.sqrt(e*e+r*r)},t.cbrt=Math.cbrt||function(e){var r=Math.pow(Math.abs(e),.3333333333333333);return e>0?r:e<0?-r:e},t.log1p=Math.log1p||function(e){var r=1+e,n=r-1;return n===0?e:e*Math.log(r)/n},t.atanh=Math.atanh||function(e){var r=Math.abs(e);return r=t.log1p(2*r/(1-r))/2,e>0?r:e<0?-r:e},t.copysign=function(e,r){return Math.abs(e)*(r<0||r===0&&1/r<0?-1:1)},t.sum=function(e,r){var n=e+r,i=n-r,o=n-i,s;return i-=e,o-=r,s=n&&0-(i+o),{s:n,t:s}},t.polyval=function(e,r,n,i){for(var o=e<0?0:r[n++];--e>=0;)o=o*i+r[n++];return o},t.AngRound=function(e){var r=.0625,n=Math.abs(e);return n=n<r?r-(r-n):n,t.copysign(n,e)},t.remainder=function(e,r){return e%=r,e<-r/2?e+r:e<r/2?e:e-r},t.AngNormalize=function(e){var r=t.remainder(e,360);return Math.abs(r)===180?t.copysign(180,e):r},t.LatFix=function(e){return Math.abs(e)>90?NaN:e},t.AngDiff=function(e,r){var n=t.sum(t.remainder(-e,360),t.remainder(r,360)),i,o;return n=t.sum(t.remainder(n.s,360),n.t),i=n.s,o=n.t,(i===0||Math.abs(i)===180)&&(i=t.copysign(i,o===0?r-e:-o)),{d:i,e:o}},t.sincosd=function(e){var r,n,i,o,s,a,c;switch(r=e%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=t.copysign(s,n)):Math.abs(r)===30&&(s=Math.sqrt(.75),o=t.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=t.copysign(a,e)),{s:a,c}},t.sincosde=function(e,r){var n,i,o,s,a,c,l;switch(n=e%360,o=Math.round(n/90),n=t.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=t.copysign(a,i)):Math.abs(n)===30&&(a=Math.sqrt(.75),s=t.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=t.copysign(c,e+r)),{s:c,c:l}},t.atan2d=function(e,r){var n=0,i;switch(Math.abs(e)>Math.abs(r)&&([e,r]=[r,e],n=2),t.copysign(1,r)<0&&(r=-r,++n),i=Math.atan2(e,r)/this.degree,n){case 1:i=t.copysign(180,e)-i;break;case 2:i=90-i;break;case 3:i=-90+i;break;default:break}return i}})(Qt.Math);(function(t,e){"use strict";t.Accumulator=function(r){this.Set(r)},t.Accumulator.prototype.Set=function(r){r||(r=0),r.constructor===t.Accumulator?(this._s=r._s,this._t=r._t):(this._s=r,this._t=0)},t.Accumulator.prototype.Add=function(r){var n=e.sum(r,this._t),i=e.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},t.Accumulator.prototype.Sum=function(r){var n;return r?(n=new t.Accumulator(this),n.Add(r),n._s):this._s},t.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1},t.Accumulator.prototype.Remainder=function(r){this._s=e.remainder(this._s,r),this.Add(0)}})(Qt.Accumulator,Qt.Math);Qt.Geodesic={};Qt.GeodesicLine={};Qt.PolygonArea={};(function(t,e,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,M=31,v=32640,C,R,E,U,I,O,A,V,k;t.tiny_=Math.sqrt(Number.MIN_VALUE/Number.EPSILON),t.nC1_=o,t.nC1p_=o,t.nC2_=o,t.nC3_=o,t.nC4_=o,u=t.nC3_*(t.nC3_-1)/2,h=t.nC4_*(t.nC4_+1)/2,t.CAP_C1=1,t.CAP_C1p=2,t.CAP_C2=4,t.CAP_C3=8,t.CAP_C4=16,t.NONE=0,t.ARC=64,t.LATITUDE=128|S,t.LONGITUDE=256|t.CAP_C3,t.AZIMUTH=512|S,t.DISTANCE=1024|t.CAP_C1,t.STANDARD=t.LATITUDE|t.LONGITUDE|t.AZIMUTH|t.DISTANCE,t.DISTANCE_IN=2048|t.CAP_C1|t.CAP_C1p,t.REDUCEDLENGTH=4096|t.CAP_C1|t.CAP_C2,t.GEODESICSCALE=8192|t.CAP_C1|t.CAP_C2,t.AREA=16384|t.CAP_C4,t.ALL=v|M,t.LONG_UNROLL=32768,t.OUT_MASK=v|t.LONG_UNROLL,t.SinCosSeries=function(T,B,N,D,L){if(L!==void 0){var P=L/2,z=Math.sin(P),we=Math.cos(P);return-2*t.SinCosSeries(!1,N*we-B*z,B*we+N*z,D.map(function(Ce,q){return(q%2?-Ce:Ce)*Math.sin((2*q+1)*P)}))}var _e=D.length,ne=_e-(T?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 T?2*B*N*oe:N*(oe-Se)},C=function(T,B){var N,D=n.sq(T),L=n.sq(B),P=(D+L-1)/6,z,we,_e,ne,Oe,oe,Se,Ce,q,Ue,Ke;return L===0&&P<=0?N=0:(z=D*L/4,we=n.sq(P),_e=P*we,ne=z*(z+2*_e),Oe=P,ne>=0?(oe=z+_e,oe+=oe<0?-Math.sqrt(ne):Math.sqrt(ne),Se=n.cbrt(oe),Oe+=Se+(Se!==0?we/Se:0)):(Ce=Math.atan2(Math.sqrt(-ne),-(z+_e)),Oe+=2*P*Math.cos(Ce/3)),q=Math.sqrt(n.sq(Oe)+L),Ue=Oe<0?L/(q-Oe):Oe+q,Ke=(Ue-L)/(2*q),N=Ue/(Math.sqrt(Ue+n.sq(Ke))+Ke)),N},R=[1,4,64,0,256],t.A1m1f=function(T){var B=Math.floor(s/2),N=n.polyval(B,R,0,n.sq(T))/R[B+1];return(N+T)/(1-T)},E=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],t.C1f=function(T,B){var N=n.sq(T),D=T,L=0,P,z;for(P=1;P<=t.nC1_;++P)z=Math.floor((t.nC1_-P)/2),B[P]=D*n.polyval(z,E,L,N)/E[L+z+1],L+=z+2,D*=T},U=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],t.C1pf=function(T,B){var N=n.sq(T),D=T,L=0,P,z;for(P=1;P<=t.nC1p_;++P)z=Math.floor((t.nC1p_-P)/2),B[P]=D*n.polyval(z,U,L,N)/U[L+z+1],L+=z+2,D*=T},I=[-11,-28,-192,0,256],t.A2m1f=function(T){var B=Math.floor(a/2),N=n.polyval(B,I,0,n.sq(T))/I[B+1];return(N-T)/(1+T)},O=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],t.C2f=function(T,B){var N=n.sq(T),D=T,L=0,P,z;for(P=1;P<=t.nC2_;++P)z=Math.floor((t.nC2_-P)/2),B[P]=D*n.polyval(z,O,L,N)/O[L+z+1],L+=z+2,D*=T},t.Geodesic=function(T,B){if(this.a=T,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],t.Geodesic.prototype.A3coeff=function(){var T=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,T,this._n)/A[T+D+1],T+=D+2},V=[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],t.Geodesic.prototype.C3coeff=function(){var T=0,B=0,N,D,L;for(N=1;N<t.nC3_;++N)for(D=t.nC3_-1;D>=N;--D)L=Math.min(t.nC3_-D-1,D),this._C3x[B++]=n.polyval(L,V,T,this._n)/V[T+L+1],T+=L+2},k=[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],t.Geodesic.prototype.C4coeff=function(){var T=0,B=0,N,D,L;for(N=0;N<t.nC4_;++N)for(D=t.nC4_-1;D>=N;--D)L=t.nC4_-D-1,this._C4x[B++]=n.polyval(L,k,T,this._n)/k[T+L+1],T+=L+2},t.Geodesic.prototype.A3f=function(T){return n.polyval(l-1,this._A3x,0,T)},t.Geodesic.prototype.C3f=function(T,B){var N=1,D=0,L,P;for(L=1;L<t.nC3_;++L)P=t.nC3_-L-1,N*=T,B[L]=N*n.polyval(P,this._C3x,D,T),D+=P+1},t.Geodesic.prototype.C4f=function(T,B){var N=1,D=0,L,P;for(L=0;L<t.nC4_;++L)P=t.nC4_-L-1,B[L]=N*n.polyval(P,this._C4x,D,T),D+=P+1,N*=T},t.Geodesic.prototype.Lengths=function(T,B,N,D,L,P,z,we,_e,ne,Oe,oe,Se){Oe&=t.OUT_MASK;var Ce={},q=0,Ue=0,Ke=0,ft=0,ht,pt,Rt,Zt,gr;if(Oe&(t.DISTANCE|t.REDUCEDLENGTH|t.GEODESICSCALE)&&(Ke=t.A1m1f(T),t.C1f(T,oe),Oe&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(ft=t.A2m1f(T),t.C2f(T,Se),q=Ke-ft,ft=1+ft),Ke=1+Ke),Oe&t.DISTANCE)ht=t.SinCosSeries(!0,P,z,oe)-t.SinCosSeries(!0,N,D,oe),Ce.s12b=Ke*(B+ht),Oe&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(pt=t.SinCosSeries(!0,P,z,Se)-t.SinCosSeries(!0,N,D,Se),Ue=q*B+(Ke*ht-ft*pt));else if(Oe&(t.REDUCEDLENGTH|t.GEODESICSCALE)){for(Rt=1;Rt<=t.nC2_;++Rt)Se[Rt]=Ke*oe[Rt]-ft*Se[Rt];Ue=q*B+(t.SinCosSeries(!0,P,z,Se)-t.SinCosSeries(!0,N,D,Se))}return Oe&t.REDUCEDLENGTH?(Ce.m0=q,Ce.m12b=we*(D*P)-L*(N*z)-D*z*Ue):Ce.m12b=NaN,Oe&t.GEODESICSCALE&&(Zt=D*z+N*P,gr=this._ep2*(_e-ne)*(_e+ne)/(L+we),Ce.M12=Zt+(gr*P-z*Ue)*N/L,Ce.M21=Zt-(gr*N-D*Ue)*P/we),Ce},t.Geodesic.prototype.InverseStart=function(T,B,N,D,L,P,z,we,_e,ne,Oe){var oe={},Se=D*B-L*T,Ce=L*B+D*T,q,Ue,Ke,ft,ht,pt,Rt,Zt,gr,$e,We,He,jt,yr,As,Is,hf,Ji,nt,Wr,Sr,un,Rn;return oe.sig12=-1,q=D*B,q+=L*T,Ue=Ce>=0&&Se<.5&&L*z<.5,Ue?(ft=n.sq(T+D),ft/=ft+n.sq(B+L),oe.dnm=Math.sqrt(1+this._ep2*ft),Ke=z/(this._f1*oe.dnm),ht=Math.sin(Ke),pt=Math.cos(Ke)):(ht=we,pt=_e),oe.salp1=L*ht,oe.calp1=pt>=0?Se+L*T*n.sq(ht)/(1+pt):q-L*T*n.sq(ht)/(1-pt),Zt=n.hypot(oe.salp1,oe.calp1),gr=T*D+B*L*pt,Ue&&Zt<this._etol2?(oe.salp2=B*ht,oe.calp2=Se-B*D*(pt>=0?n.sq(ht)/(1+pt):1-pt),Rt=n.hypot(oe.salp2,oe.calp2),oe.salp2/=Rt,oe.calp2/=Rt,oe.sig12=Math.atan2(Zt,gr)):Math.abs(this._n)>.1||gr>=0||Zt>=6*Math.abs(this._n)*Math.PI*n.sq(B)||(Rn=Math.atan2(-we,-_e),this.f>=0?(yr=n.sq(T)*this._ep2,As=yr/(2*(1+Math.sqrt(1+yr))+yr),He=this.f*B*this.A3f(As)*Math.PI,jt=He*B,$e=Rn/He,We=q/jt):(Is=L*B-D*T,hf=Math.atan2(q,Is),Wr=this.Lengths(this._n,Math.PI+hf,T,-B,N,D,L,P,B,L,t.REDUCEDLENGTH,ne,Oe),Ji=Wr.m12b,nt=Wr.m0,$e=-1+Ji/(B*L*nt*Math.PI),jt=$e<-.01?q/$e:-this.f*n.sq(B)*Math.PI,He=jt/B,We=z/He),We>-y&&$e>-1-_?this.f>=0?(oe.salp1=Math.min(1,-$e),oe.calp1=-Math.sqrt(1-n.sq(oe.salp1))):(oe.calp1=Math.max($e>-y?0:-1,$e),oe.salp1=Math.sqrt(1-n.sq(oe.calp1))):(Sr=C($e,We),un=He*(this.f>=0?-$e*Sr/(1+Sr):-We*(1+Sr)/Sr),ht=Math.sin(un),pt=-Math.cos(un),oe.salp1=L*ht,oe.calp1=q-L*T*n.sq(ht)/(1-pt))),oe.salp1<=0?(oe.salp1=1,oe.calp1=0):(Rt=n.hypot(oe.salp1,oe.calp1),oe.salp1/=Rt,oe.calp1/=Rt),oe},t.Geodesic.prototype.Lambda12=function(T,B,N,D,L,P,z,we,_e,ne,Oe,oe,Se,Ce){var q={},Ue,Ke,ft,ht,pt,Rt,Zt,gr,$e,We,He,jt,yr;return T===0&&we===0&&(we=-t.tiny_),Ke=z*B,ft=n.hypot(we,z*T),q.ssig1=T,ht=Ke*T,q.csig1=pt=we*B,Ue=n.hypot(q.ssig1,q.csig1),q.ssig1/=Ue,q.csig1/=Ue,q.salp2=L!==B?Ke/L:z,q.calp2=L!==B||Math.abs(D)!==-T?Math.sqrt(n.sq(we*B)+(B<-T?(L-B)*(B+L):(T-D)*(T+D)))/L:Math.abs(we),q.ssig2=D,Rt=Ke*D,q.csig2=Zt=q.calp2*L,Ue=n.hypot(q.ssig2,q.csig2),q.ssig2/=Ue,q.csig2/=Ue,q.sig12=Math.atan2(Math.max(0,q.csig1*q.ssig2-q.ssig1*q.csig2),q.csig1*q.csig2+q.ssig1*q.ssig2),gr=Math.max(0,pt*Rt-ht*Zt),$e=pt*Zt+ht*Rt,He=Math.atan2(gr*ne-$e*_e,$e*ne+gr*_e),jt=n.sq(ft)*this._ep2,q.eps=jt/(2*(1+Math.sqrt(1+jt))+jt),this.C3f(q.eps,Ce),We=t.SinCosSeries(!0,q.ssig2,q.csig2,Ce)-t.SinCosSeries(!0,q.ssig1,q.csig1,Ce),q.domg12=-this.f*this.A3f(q.eps)*Ke*(q.sig12+We),q.lam12=He+q.domg12,Oe&&(q.calp2===0?q.dlam12=-2*this._f1*N/T:(yr=this.Lengths(q.eps,q.sig12,q.ssig1,q.csig1,N,q.ssig2,q.csig2,P,B,L,t.REDUCEDLENGTH,oe,Se),q.dlam12=yr.m12b,q.dlam12*=this._f1/(q.calp2*L))),q},t.Geodesic.prototype.Inverse=function(T,B,N,D,L){var P,z;return L||(L=t.STANDARD),L===t.LONG_UNROLL&&(L|=t.STANDARD),L&=t.OUT_MASK,P=this.InverseInt(T,B,N,D,L),z=P.vals,L&t.AZIMUTH&&(z.azi1=n.atan2d(P.salp1,P.calp1),z.azi2=n.atan2d(P.salp2,P.calp2)),z},t.Geodesic.prototype.InverseInt=function(T,B,N,D,L){var P={},z,we,_e,ne,Oe,oe,Se,Ce,q,Ue,Ke,ft,ht,pt,Rt,Zt,gr,$e,We,He,jt,yr,As,Is,hf,Ji,nt,Wr,Sr,un,Rn,bd,wd,Sl,za,df,mf,pf,gf,xd,eg,Ml,tg,_d,rg,ng,ig,kS,og,Sd,sg,Md,GS,yf,US,jS,bf,vd,wf,ag,cg,Ed,Td,lg,ug;if(P.lat1=T=n.LatFix(T),P.lat2=N=n.LatFix(N),T=n.AngRound(T),N=n.AngRound(N),z=n.AngDiff(B,D),we=z.e,z=z.d,L&t.LONG_UNROLL?(P.lon1=B,P.lon2=B+z+we):(P.lon1=n.AngNormalize(B),P.lon2=n.AngNormalize(D)),_e=n.copysign(1,z),z*=_e,we*=_e,Rt=z*n.degree,ne=n.sincosde(z,we),Zt=ne.s,gr=ne.c,we=180-z-we,Oe=Math.abs(T)<Math.abs(N)||isNaN(N)?-1:1,Oe<0&&(_e*=-1,[N,T]=[T,N]),oe=n.copysign(1,-T),T*=oe,N*=oe,ne=n.sincosd(T),Se=this._f1*ne.s,Ce=ne.c,ne=n.hypot(Se,Ce),Se/=ne,Ce/=ne,Ce=Math.max(t.tiny_,Ce),ne=n.sincosd(N),q=this._f1*ne.s,Ue=ne.c,ne=n.hypot(q,Ue),q/=ne,Ue/=ne,Ue=Math.max(t.tiny_,Ue),Ce<-Se?Ue===Ce&&(q=n.copysign(Se,q)):Math.abs(q)===-Se&&(Ue=Ce),ht=Math.sqrt(1+this._ep2*n.sq(Se)),pt=Math.sqrt(1+this._ep2*n.sq(q)),As=new Array(t.nC1_+1),Is=new Array(t.nC2_+1),hf=new Array(t.nC3_),Ji=T===-90||Zt===0,Ji&&(We=gr,He=Zt,jt=1,yr=0,Wr=Se,Sr=We*Ce,un=q,Rn=jt*Ue,$e=Math.atan2(Math.max(0,Sr*un-Wr*Rn),Sr*Rn+Wr*un),nt=this.Lengths(this._n,$e,Wr,Sr,ht,un,Rn,pt,Ce,Ue,L|t.DISTANCE|t.REDUCEDLENGTH,As,Is),Ke=nt.s12b,ft=nt.m12b,L&t.GEODESICSCALE&&(P.M12=nt.M12,P.M21=nt.M21),$e<b||ft>=0?(($e<3*t.tiny_||$e<g&&(Ke<0||ft<0))&&($e=ft=Ke=0),ft*=this._b,Ke*=this._b,P.a12=$e/n.degree):Ji=!1),bf=2,!Ji&&Se===0&&(this.f<=0||we>=this.f*180))We=jt=0,He=yr=1,Ke=this.a*Rt,$e=wd=Rt/this._f1,ft=this._b*Math.sin($e),L&t.GEODESICSCALE&&(P.M12=P.M21=Math.cos($e)),P.a12=z/this._f1;else if(!Ji)if(nt=this.InverseStart(Se,Ce,ht,q,Ue,pt,Rt,Zt,gr,As,Is),$e=nt.sig12,He=nt.salp1,We=nt.calp1,$e>=0)yr=nt.salp2,jt=nt.calp2,Sl=nt.dnm,Ke=$e*this._b*Sl,ft=n.sq(Sl)*this._b*Math.sin($e/Sl),L&t.GEODESICSCALE&&(P.M12=P.M21=Math.cos($e/Sl)),P.a12=$e/n.degree,wd=Rt/(this._f1*Sl);else{for(za=0,df=t.tiny_,mf=1,pf=t.tiny_,gf=-1,xd=!1,eg=!1;nt=this.Lambda12(Se,Ce,ht,q,Ue,pt,He,We,Zt,gr,za<d,As,Is,hf),Ml=nt.lam12,yr=nt.salp2,jt=nt.calp2,$e=nt.sig12,Wr=nt.ssig1,Sr=nt.csig1,un=nt.ssig2,Rn=nt.csig2,bd=nt.eps,wf=nt.domg12,tg=nt.dlam12,!(eg||!(Math.abs(Ml)>=(xd?8:1)*g)||za==m);++za){if(Ml>0&&(za<d||We/He>gf/pf)?(pf=He,gf=We):Ml<0&&(za<d||We/He<mf/df)&&(df=He,mf=We),za<d&&tg>0&&(_d=-Ml/tg,Math.abs(_d)<Math.PI&&(rg=Math.sin(_d),ng=Math.cos(_d),ig=He*ng+We*rg,ig>0))){We=We*ng-He*rg,He=ig,ne=n.hypot(He,We),He/=ne,We/=ne,xd=Math.abs(Ml)<=16*g;continue}He=(df+pf)/2,We=(mf+gf)/2,ne=n.hypot(He,We),He/=ne,We/=ne,xd=!1,eg=Math.abs(df-He)+(mf-We)<w||Math.abs(He-pf)+(We-gf)<w}kS=L|(L&(t.REDUCEDLENGTH|t.GEODESICSCALE)?t.DISTANCE:t.NONE),nt=this.Lengths(bd,$e,Wr,Sr,ht,un,Rn,pt,Ce,Ue,kS,As,Is),Ke=nt.s12b,ft=nt.m12b,L&t.GEODESICSCALE&&(P.M12=nt.M12,P.M21=nt.M21),ft*=this._b,Ke*=this._b,P.a12=$e/n.degree,L&t.AREA&&(lg=Math.sin(wf),ug=Math.cos(wf),bf=Zt*ug-gr*lg,vd=gr*ug+Zt*lg)}return L&t.DISTANCE&&(P.s12=0+Ke),L&t.REDUCEDLENGTH&&(P.m12=0+ft),L&t.AREA&&(og=He*Ce,Sd=n.hypot(We,He*Se),Sd!==0&&og!==0?(Wr=Se,Sr=We*Ce,un=q,Rn=jt*Ue,Md=n.sq(Sd)*this._ep2,bd=Md/(2*(1+Math.sqrt(1+Md))+Md),GS=n.sq(this.a)*Sd*og*this._e2,ne=n.hypot(Wr,Sr),Wr/=ne,Sr/=ne,ne=n.hypot(un,Rn),un/=ne,Rn/=ne,yf=new Array(t.nC4_),this.C4f(bd,yf),US=t.SinCosSeries(!1,Wr,Sr,yf),jS=t.SinCosSeries(!1,un,Rn,yf),P.S12=GS*($e<.01?t.SinCosSeries(!1,Wr,Sr,yf,$e):jS-US)):P.S12=0,!Ji&&bf==2&&(bf=Math.sin(wd),vd=Math.cos(wd)),!Ji&&vd>-.7071&&q-Se<1.75?(wf=1+vd,ag=1+Ce,cg=1+Ue,sg=2*Math.atan2(bf*(Se*cg+q*ag),wf*(Se*q+ag*cg))):(Ed=yr*We-jt*He,Td=jt*We+yr*He,Ed===0&&Td<0&&(Ed=t.tiny_*We,Td=-1),sg=Math.atan2(Ed,Td)),P.S12+=this._c2*sg,P.S12*=Oe*_e*oe,P.S12+=0),Oe<0&&([yr,He]=[He,yr],[jt,We]=[We,jt],L&t.GEODESICSCALE&&([P.M21,P.M12]=[P.M12,P.M21])),He*=Oe*_e,We*=Oe*oe,yr*=Oe*_e,jt*=Oe*oe,{vals:P,salp1:He,calp1:We,salp2:yr,calp2:jt}},t.Geodesic.prototype.GenDirect=function(T,B,N,D,L,P){var z;return P?P===t.LONG_UNROLL&&(P|=t.STANDARD):P=t.STANDARD,D||(P|=t.DISTANCE_IN),z=new e.GeodesicLine(this,T,B,N,P),z.GenPosition(D,L,P)},t.Geodesic.prototype.Direct=function(T,B,N,D,L){return this.GenDirect(T,B,N,!1,D,L)},t.Geodesic.prototype.ArcDirect=function(T,B,N,D,L){return this.GenDirect(T,B,N,!0,D,L)},t.Geodesic.prototype.Line=function(T,B,N,D){return new e.GeodesicLine(this,T,B,N,D)},t.Geodesic.prototype.DirectLine=function(T,B,N,D,L){return this.GenDirectLine(T,B,N,!1,D,L)},t.Geodesic.prototype.ArcDirectLine=function(T,B,N,D,L){return this.GenDirectLine(T,B,N,!0,D,L)},t.Geodesic.prototype.GenDirectLine=function(T,B,N,D,L,P){var z;return P||(P=t.STANDARD|t.DISTANCE_IN),D||(P|=t.DISTANCE_IN),z=new e.GeodesicLine(this,T,B,N,P),z.GenSetDistance(D,L),z},t.Geodesic.prototype.InverseLine=function(T,B,N,D,L){var P,z,we;return L||(L=t.STANDARD|t.DISTANCE_IN),P=this.InverseInt(T,B,N,D,t.ARC),we=n.atan2d(P.salp1,P.calp1),L&(t.OUT_MASK&t.DISTANCE_IN)&&(L|=t.DISTANCE),z=new e.GeodesicLine(this,T,B,we,L,P.salp1,P.calp1),z.SetArc(P.vals.a12),z},t.Geodesic.prototype.Polygon=function(T){return new r.PolygonArea(this,T)},t.WGS84=new t.Geodesic(i.WGS84.a,i.WGS84.f)})(Qt.Geodesic,Qt.GeodesicLine,Qt.PolygonArea,Qt.Math,Qt.Constants);(function(t,e,r){"use strict";e.GeodesicLine=function(n,i,o,s,a,c,l){var u,h,d,m,g,y;a||(a=t.STANDARD|t.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|t.LATITUDE|t.AZIMUTH|t.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(t.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&t.CAP_C1&&(this._A1m1=t.A1m1f(m),this._C1a=new Array(t.nC1_+1),t.C1f(m,this._C1a),this._B11=t.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&t.CAP_C1p&&(this._C1pa=new Array(t.nC1p_+1),t.C1pf(m,this._C1pa)),this.caps&t.CAP_C2&&(this._A2m1=t.A2m1f(m),this._C2a=new Array(t.nC2_+1),t.C2f(m,this._C2a),this._B21=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&t.CAP_C3&&(this._C3a=new Array(t.nC3_),n.C3f(m,this._C3a),this._A3c=-this.f*this._salp0*n.A3f(m),this._B31=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&t.CAP_C4&&(this._C4a=new Array(t.nC4_),n.C4f(m,this._C4a),this._A4=r.sq(this.a)*this._calp0*this._salp0*n._e2,this._B41=t.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=NaN},e.GeodesicLine.prototype.GenPosition=function(n,i,o,s={}){var a,c,l,u,h,d,m,g,y,b,w,_,S,M,v,C,R,E,U,I,O,A,V,k,T,B,N,D,L;return o?o===t.LONG_UNROLL&&(o|=t.STANDARD):o=t.STANDARD,o&=this.caps&t.OUT_MASK,s.lat1=this.lat1,s.azi1=this.azi1,s.lon1=o&t.LONG_UNROLL?this.lon1:r.AngNormalize(this.lon1),n?s.a12=i:s.s12=i,n||this.caps&t.DISTANCE_IN&t.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=-t.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=t.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&(t.DISTANCE|t.REDUCEDLENGTH|t.GEODESICSCALE)&&((n||Math.abs(this.f)>.01)&&(u=t.SinCosSeries(!0,d,m,this._C1a)),h=(1+this._A1m1)*(u-this._B11)),C=this._calp0*d,R=r.hypot(this._salp0,this._calp0*m),R===0&&(R=m=t.tiny_),I=this._salp0,O=this._calp0*m,n&&o&t.DISTANCE&&(s.s12=this._b*((1+this._A1m1)*a+h)),o&t.LONGITUDE&&(E=this._salp0*d,U=m,v=r.copysign(1,this._salp0),_=o&t.LONG_UNROLL?v*(a-(Math.atan2(d,m)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(v*E,U)-Math.atan2(v*this._somg1,this._comg1))):Math.atan2(E*this._comg1-U*this._somg1,U*this._comg1+E*this._somg1),S=_+this._A3c*(a+(t.SinCosSeries(!0,d,m,this._C3a)-this._B31)),M=S/r.degree,s.lon2=o&t.LONG_UNROLL?this.lon1+M:r.AngNormalize(r.AngNormalize(this.lon1)+r.AngNormalize(M))),o&t.LATITUDE&&(s.lat2=r.atan2d(C,this._f1*R)),o&t.AZIMUTH&&(s.azi2=r.atan2d(I,O)),o&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(V=t.SinCosSeries(!0,d,m,this._C2a),k=(1+this._A2m1)*(V-this._B21),T=(this._A1m1-this._A2m1)*a+(h-k),o&t.REDUCEDLENGTH&&(s.m12=this._b*(A*(this._csig1*d)-this._dn1*(this._ssig1*m)-this._csig1*m*T)),o&t.GEODESICSCALE&&(B=this._k2*(d-this._ssig1)*(d+this._ssig1)/(this._dn1+A),s.M12=l+(B*d-m*T)*this._ssig1/this._dn1,s.M21=l-(B*this._ssig1-this._csig1*T)*d/A)),o&t.AREA&&(N=t.SinCosSeries(!1,d,m,this._C4a),this._calp0===0||this._salp0===0?(D=I*this.calp1-O*this.salp1,L=O*this.calp1+I*this.salp1):(D=this._calp0*this._salp0*(l<=0?this._csig1*(1-l)+c*this._ssig1:c*(this._csig1*c/(1+l)+this._ssig1)),L=r.sq(this._salp0)+r.sq(this._calp0)*this._csig1*m),s.S12=this._c2*Math.atan2(D,L)+this._A4*(Math.abs(a)<.01?t.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a,a):N-this._B41)),n||(s.a12=a/r.degree),s):(s.a12=NaN,s)},e.GeodesicLine.prototype.Position=function(n,i){return this.GenPosition(!1,n,i)},e.GeodesicLine.prototype.ArcPosition=function(n,i){return this.GenPosition(!0,n,i)},e.GeodesicLine.prototype.GenSetDistance=function(n,i){n?this.SetArc(i):this.SetDistance(i)},e.GeodesicLine.prototype.SetDistance=function(n){var i;this.s13=n,i=this.GenPosition(!1,this.s13,t.ARC),this.a13=0+i.a12},e.GeodesicLine.prototype.SetArc=function(n){var i;this.a13=n,i=this.GenPosition(!0,this.a13,t.DISTANCE),this.s13=0+i.s12}})(Qt.Geodesic,Qt.GeodesicLine,Qt.Math)});function dA(t){if(!Number.isFinite(t))throw new Error("Nonfinite axis, azimuth, distance or arc")}function mA({semiMajorAxis:t,semiMinorAxis:e}){return dA(t),dA(e),new I2.Geodesic(t,(t-e)/t)}var I2,Wf,pA=p(()=>{hA();I2=Qt.Geodesic;Wf=I2.ALL&~I2.AREA});function bA(t,e,r,n,i,o){let s=yA[e]&&yA[e][r];Pi(s&&(!n||n===s));let a,c,l,u=Jq.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=Zq*Math.min(1,t.maximumRadius),d=Math.abs(u.x)<=h&&Math.abs(u.y)<=h,m=t.radii;if(m.x===m.y&&m.x>0&&m.z>0&&m.z<=m.x&&(!d||u.z!==0)){let{east:I,up:O}=tu;if(d)I.set(0,1,0),O.set(0,0,Math.sign(u.z));else{let A=Math.max(Math.abs(u.x),Math.abs(u.y));I.set(-u.y/A,u.x/A,0).normalize(),t.geodeticSurfaceNormal(u,O)}if(!S2(I,O,gA)||!M2(gA,u,e,r,n,o))throw new Error("Unsupported local frame");return o}if(d){let I=Math.sign(u.z);a=Qq.fromArray(P2[e]),e!=="east"&&e!=="west"&&a.scale(I),c=eV.fromArray(P2[r]),r!=="east"&&r!=="west"&&c.scale(I),l=tV.fromArray(P2[n]),n!=="east"&&n!=="west"&&l.scale(I)}else{let{up:I,east:O,north:A}=tu,V=Math.max(Math.abs(u.x),Math.abs(u.y));O.set(-u.y/V,u.x/V,0).normalize(),t.geodeticSurfaceNormal(u,I),A.copy(I).cross(O);let{down:k,west:T,south:B}=tu;k.copy(I).scale(-1),T.copy(O).scale(-1),B.copy(A).scale(-1),a=tu[e],c=tu[r],l=tu[n]}let g=a.x,y=a.y,b=a.z,w=c.x,_=c.y,S=c.z,M=l.x,v=l.y,C=l.z,R=u.x,E=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]=M,o[9]=v,o[10]=C,o[11]=0,o[12]=R,o[13]=E,o[14]=U,o[15]=1,o}var Zq,Jq,gA,yA,P2,tu,Qq,eV,tV,wA=p(()=>{Cn();Cn();Zq=1e-14,Jq=new J,gA=_2(),yA={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"}},P2={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},tu={east:new J,north:new J,up:new J,west:new J,south:new J,down:new J},Qq=new J,eV=new J,tV=new J});function R2(t,e,r=new mn){return bA(t,"east","north","up",e,r)}var xA=p(()=>{Cn();wA()});var _A=p(()=>{fA();xA()});var SA=p(()=>{});var MA=p(()=>{});function re(t,e,r){if(!Object.prototype.hasOwnProperty.call(t,e))return r;let n=t[e];if(typeof n!="string"||!/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i.test(n))throw new Error(`Invalid numeric PROJ parameter: +${e}`);let i=Number(n);if(!Number.isFinite(i))throw new Error(`Invalid numeric PROJ parameter: +${e}`);return i}function $f(t,e){let r=re(t,e,0);if(Math.abs(r)>=90)throw new Error(`+${e} must be between -90 and 90 degrees`);return r*At}function Kt(t,e=!1){if(e||Math.abs(t)<=Math.PI)return t;let r=2*Math.PI;return((t+Math.PI)%r+r)%r-Math.PI}var At,Vt=p(()=>{At=Math.PI/180});function Lt(t,e){let r=[t[0]*e[0],t[0]*e[1],t[1]*e[0],t[1]*e[1]];return[Math.min(...r),Math.max(...r)]}function Hf([t,e]){let r=[Math.sin(t),Math.sin(e)];for(let[n,i]of[[Math.PI/2,1],[-Math.PI/2,-1]])Math.ceil((t-n)/(2*Math.PI))<=Math.floor((e-n)/(2*Math.PI))&&r.push(i);return[Math.min(...r),Math.max(...r)]}function ct(t,e){let r=n=>Math.max(1,ks(n))*1e-12;if(![...t,...e].every(Number.isFinite))throw new Error("Projection rendering bounds are not finite");return[[t[0]-r(t),e[0]-r(e),0],[t[1]+r(t),e[1]+r(e),0]]}function Lr(t,e,r=!1){let n=t[0][0]-e,i=t[1][0]-e;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 Or(t,e,r,n=!1){let i=Lr(e,r,n),o=[e[0][1],e[1][1],Math.max(e[0][1],Math.min(e[1][1],0))],s=i.flatMap(a=>o.map(c=>t(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 ru(t,e,r,n=!1,i=0){let o=Lr(e,r,n);if(ks(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=[e[0][1],e[1][1],Math.max(e[0][1],Math.min(e[1][1],i))],c=s.flatMap(l=>a.map(u=>t(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 vA(t,e,r,n=!1){let i=Lr(e,r,n),o=[i[0],i[1],Math.max(i[0],Math.min(i[1],0))],s=[e[0][1],e[1][1],Math.max(e[0][1],Math.min(e[1][1],0))],a=o.flatMap(c=>s.map(l=>t(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 nu(t,e,r,n,i,o,s=!1){let a=Fe(Lr(e,r,s),n),c=li(o-t(r,e[0][1])[1],o-t(r,e[1][1])[1]);return ct(Be([i,i],Lt(c,Hf(a))),Be([o,o],Fe(Lt(c,Qm(a)),-1)))}var li,Be,Fe,Qm,ks,Ot=p(()=>{Vt();li=(t,e)=>[Math.min(t,e),Math.max(t,e)],Be=(t,e)=>[t[0]+e[0],t[1]+e[1]],Fe=(t,e)=>li(t[0]*e,t[1]*e);Qm=t=>Hf([t[0]+Math.PI/2,t[1]+Math.PI/2]),ks=t=>Math.max(Math.abs(t[0]),Math.abs(t[1]))});function Q(t,e,r,n){return[[t,e],[r,n]]}function Ri(t){return t>=-180&&t<180?t:((t+180)%360+360)%360-180}function rV(t,e,r,n){if(![t,e,r,n].every(Number.isFinite)||e<-90||n>90||e>n||r-t<-360||r-t>360+1e-10)throw new Error("Invalid geographic coverage");if(r-t>=360-1e-10)return[-180,e,180,n];let i=Ri(r);return[Ri(t),e,i===-180&&r>t?180:i,n]}function L2(t){let e=t[2]-t[0];return e<0?e+360:e}function EA(t){let[e,r,n,i]=t;return e<=n?[t]:[[e,r,180,i],[-180,r,n,i]]}function nV(t,e){let[r,n,i,o]=t,s=Ri(e[0]);return e[1]>=n&&e[1]<=o&&(r<=i?s>=r&&s<=i||s===-180&&i===180:s>=r||s<=i)}function ep(t,e){let r=Math.max(t[1],e[1]),n=Math.min(t[3],e[3]);if(r>n)return[];let i=[];for(let s of EA(t))for(let a of EA(e)){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 TA(t,e){let r=Ri(e[0]),n=Math.max(t[1],Math.min(t[3],e[1]));if(!nV(t,[r,n])){let i=Math.abs(Ri(r-t[0])),o=Math.abs(Ri(r-t[2]));r=i<=o?t[0]:t[2]}return[r,n]}function Gs(t,e=0,r=0){let n=L2(t),i=t[0]*Ko-e,o=i+n*Ko/2,s=Math.round((r-o)/(2*Math.PI))*2*Math.PI;return Q(n===360?r-Math.PI:i+s,t[1]*Ko,n===360?r+Math.PI:i+s+n*Ko,t[3]*Ko)}function Bn(t,e=0){return rV((t[0][0]+e)/Ko,t[0][1]/Ko,(t[1][0]+e)/Ko,t[1][1]/Ko)}function AA(t){if(!t.length)throw new Error("CRS coverage does not intersect the rendering target");return[[0,1,2].map(e=>Math.min(...t.map(r=>r[0][e]))),[0,1,2].map(e=>Math.max(...t.map(r=>r[1][e])))]}var Ko,et=p(()=>{Ko=Math.PI/180});function IA(t,e){if(e)try{let n=t(e);return O2(n)}catch{}let r=t();return O2(r)}function O2(t){var r;let e=t.bounds;if(e.some(n=>n.some(i=>!Number.isFinite(i))))throw new Error("Projection rendering bounds must be finite");return{bounds:e,normalize:(r=t.normalize)==null?void 0:r.bind(t)}}function Us(t,e=0){return r=>{let n=r.x*Math.PI/180-e,i=r.y*Math.PI/180,o={x:n,y:i,z:r.z};t(o),o.x!==n&&(r.x=(o.x+e)*180/Math.PI),o.y!==i&&(r.y=o.y*180/Math.PI)}}function tp(t,e){let r=[];for(let n of t){let i=e(n);i!==null&&r.push(O2(i))}return r.length?r.length===1?r[0]:{bounds:AA(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 nc=p(()=>{et()});function rp(t,e,r=0,n=!1){let i=L2(e),o=i===360?r-180:e[0]+Math.round((r-e[0]-i/2)/360)*360,s=o+i;if(n){t.x=Math.max(o,Math.min(s,t.x)),t.y=Math.max(e[1],Math.min(e[3],t.y));return}let a=TA(e,[t.x,t.y]),c=a[0];a[0]===Ri(t.x)&&t.x>=o&&t.x<=s?c=t.x:(c<o||c>s)&&(c+=Math.round(((o+s)/2-c)/360)*360);let l=c-r;t.x=Math.abs(l)<=180?c:r+Ri(l),t.y=a[1]}function ar(t,e,r=0,n=0,i=!1){let o=(r+n)*180/Math.PI;return{get bounds(){return t(Gs(e,n,r))},normalize(s){rp(s,e,o,i)}}}function iV(t,e,r,n,i){let o=tp(e,s=>ar(t,s,r,n,i));if(!o)throw new Error("CRS coverage does not intersect the rendering target");return o}function De(t,e,r,n=0,i=!1){let o=(e[0][0]+e[1][0])/2,s=Bn(e,n),a=(o+n)*180/Math.PI;return{...t,longitudeOrigin:o,getRenderingProfile(c){if(!c)return{bounds:r(e),normalize(l){rp(l,s,a,i)}};try{let l=ar(r,c,o,n,i);return{bounds:l.bounds,normalize:l.normalize}}catch{return iV(r,ep(c,s),o,n,i)}}}}var lt=p(()=>{et();nc()});function PA(){return{x:0,y:0,z:0}}var js,np=p(()=>{js=class{constructor(){this.point=PA(),this.points=[this.point],this.active=0}get depth(){return this.active}acquire(){var e;let r=this.active++;return(e=this.points)[r]||(e[r]=PA()),this.points[r]}release(e){this.active>0&&this.points[this.active-1]===e&&this.active--}}});function ui(t,e){let r=new js,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,t)},inverse(i,o){return n(i,o,e)},forwardInPlace:t,inverseInPlace:e}}function Xo(t,e,r=!1){let n=e?t.inverseInPlace:t.forwardInPlace;if(n)return n.bind(t);if(r){let o=e?t.inverse3D:t.forward3D;return s=>{let a=o.call(t,[s.x,s.y,s.z]);s.x=a[0],s.y=a[1],s.z=a[2]}}let i=e?t.inverse:t.forward;return o=>{let s=i.call(t,o.x,o.y);o.x=s[0],o.y=s[1]}}var ic=p(()=>{np()});function zs(t,e,r=0){let n=re(t,e,r);if(e!=="lon_0"&&Math.abs(n)>90)throw new Error("Latitude parameter must be between -90 and 90 degrees: +"+e);return n*At}function Li(t,e){let r=Object.prototype.hasOwnProperty.call(t,e);if(r&&t[e]!==void 0)throw new Error("Expected a flag without a value: +"+e);return r}function xr({semiMajorAxis:t,eccentricitySquared:e,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:t,b:t*Math.sqrt(1-e),es:e,e:Math.sqrt(e),ep2:e/(1-e),sphere:e===0,over:Li(r,"over"),long0:zs(r,"lon_0"),lat0:zs(r,"lat_0"),lat1:zs(r,"lat_1"),lat2:zs(r,"lat_2",re(r,"lat_1",0)),lat_ts:zs(r,"lat_ts",NaN),x0:re(r,"x_0",0),y0:re(r,"y_0",0),k0:i}}function iu(t,e){if(!Object.prototype.hasOwnProperty.call(e,"lat_1"))throw new Error("Conic projections require +lat_1");if(Math.abs(t.lat1+t.lat2)<1e-10||Math.abs(t.lat1)>=Math.PI/2||Math.abs(t.lat2)>=Math.PI/2)throw new Error("Conic standard parallels must not be opposite or at a pole")}function cr(t,e,r,n,i=ui){let o=(s,a)=>{let c=s(e,a);if(!c||typeof c!="object"||!Number.isFinite(c.x)||!Number.isFinite(c.y))throw new Error(t+": 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 qs(t,e){let r=Xo(e,!1);return ui(n=>{let i=n.x,o=n.y,s=Math.atan2(Math.sin(i-t.long0),Math.cos(i-t.long0)),a=Math.abs(Math.abs(t.lat0)-Math.PI/2)<1e-10;if(Math.abs(o+t.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)},Xo(e,!0))}var Er,Yo,Dn=p(()=>{ic();Vt();Er=["lon_0","lat_0","x_0","y_0"],Yo=["k","k_0"]});function Oi(t,e){return{...ui(t,e),createForwardFlat(r){return this.forwardInPlace===t?RA(t,!1,r):void 0},createInverseFlat(r){return this.inverseInPlace===e?RA(e,!0,r):void 0}}}function RA(t,e,{inputScale:r,outputScale:n}){let i=new js;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),e&&t(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,e||t(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 ou=p(()=>{ic();np()});function oc(t){var e=Math.exp(t);return e=(e-1/e)/2,e}var ip=p(()=>{});function er(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),n=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}var sc=p(()=>{});function LA(t){var e=1+t,r=e-1;return r===0?t:t*Math.log(e)/r}var OA=p(()=>{});function CA(t){var e=Math.abs(t);return e=LA(e*(1+e/(er(1,e)+1))),t<0?-e:e}var BA=p(()=>{sc();OA()});function op(t,e){for(var r=2*Math.cos(2*e),n=t.length-1,i=t[n],o=0,s;--n>=0;)s=-o+r*i+t[n],o=i,i=s;return e+s*Math.sin(2*e)}var DA=p(()=>{});function NA(t,e){for(var r=2*Math.cos(e),n=t.length-1,i=t[n],o=0,s;--n>=0;)s=-o+r*i+t[n],o=i,i=s;return Math.sin(e)*s}var FA=p(()=>{});function Kf(t){var e=Math.exp(t);return e=(e+1/e)/2,e}var C2=p(()=>{});function B2(t,e,r,n){for(var i=Math.sin(e),o=Math.cos(e),s=oc(r),a=Kf(r),c=2*o*a,l=-2*i*s,u=t.length-1,h=t[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+t[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 kA=p(()=>{ip();C2()});var F,tt,Vs,GA,D2,N2,Xf,Ct=p(()=>{F=Math.PI/2,tt=Math.PI/4,Vs=Math.PI*2,GA=3.14159265359,D2=Math.PI/180,N2=180/Math.PI,Xf=Math.PI/(180*3600)});function Ws(t){return t<0?-1:1}var Yf=p(()=>{});function G(t,e){return e||Math.abs(t)<=GA?t:t-Ws(t)*Vs}var _t=p(()=>{Ct();Yf()});function oV(t){t.x0=t.x0!==void 0?t.x0:0,t.y0=t.y0!==void 0?t.y0:0,t.long0=t.long0!==void 0?t.long0:0,t.lat0=t.lat0!==void 0?t.lat0:0,t.k0=t.k0!==void 0?t.k0:1,t.cgb=[],t.cbg=[],t.utg=[],t.gtu=[];var e=t.es/(1+Math.sqrt(1-t.es)),r=e/(2-e),n=r;t.cgb[0]=r*(2+r*(-2/3+r*(-2+r*(116/45+r*(26/45+r*(-2854/675)))))),t.cbg[0]=r*(-2+r*(2/3+r*(4/3+r*(-82/45+r*(32/45+r*(4642/4725)))))),n=n*r,t.cgb[1]=n*(7/3+r*(-8/5+r*(-227/45+r*(2704/315+r*(2323/945))))),t.cbg[1]=n*(5/3+r*(-16/15+r*(-13/9+r*(904/315+r*(-1522/945))))),n=n*r,t.cgb[2]=n*(56/15+r*(-136/35+r*(-1262/105+r*(73814/2835)))),t.cbg[2]=n*(-26/15+r*(34/21+r*(8/5+r*(-12686/2835)))),n=n*r,t.cgb[3]=n*(4279/630+r*(-332/35+r*(-399572/14175))),t.cbg[3]=n*(1237/630+r*(-12/5+r*(-24832/14175))),n=n*r,t.cgb[4]=n*(4174/315+r*(-144838/6237)),t.cbg[4]=n*(-734/315+r*(109598/31185)),n=n*r,t.cgb[5]=n*(601676/22275),t.cbg[5]=n*(444337/155925),n=Math.pow(r,2),t.Qn=t.k0/(1+r)*(1+n*(1/4+n*(1/64+n/256))),t.utg[0]=r*(-.5+r*(2/3+r*(-37/96+r*(1/360+r*(81/512+r*(-96199/604800)))))),t.gtu[0]=r*(.5+r*(-2/3+r*(5/16+r*(41/180+r*(-127/288+r*(7891/37800)))))),t.utg[1]=n*(-1/48+r*(-1/15+r*(437/1440+r*(-46/105+r*(1118711/3870720))))),t.gtu[1]=n*(13/48+r*(-3/5+r*(557/1440+r*(281/630+r*(-1983433/1935360))))),n=n*r,t.utg[2]=n*(-17/480+r*(37/840+r*(209/4480+r*(-5569/90720)))),t.gtu[2]=n*(61/240+r*(-103/140+r*(15061/26880+r*(167603/181440)))),n=n*r,t.utg[3]=n*(-4397/161280+r*(11/504+r*(830251/7257600))),t.gtu[3]=n*(49561/161280+r*(-179/168+r*(6601661/7257600))),n=n*r,t.utg[4]=n*(-4583/161280+r*(108847/3991680)),t.gtu[4]=n*(34729/80640+r*(-3418889/1995840)),n=n*r,t.utg[5]=n*(-20648693/638668800),t.gtu[5]=n*(212378941/319334400);var i=op(t.cbg,t.lat0);t.Zb=-t.Qn*(i+NA(t.gtu,2*i))}function UA(t,e){var r=G(e.x-t.long0,t.over),n=e.y;n=op(t.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,er(i,o*a)),r=CA(Math.tan(r)),B2(t.gtu,2*n,2*r,e),n=n+e.x,r=r+e.y;var c,l;return Math.abs(r)<=2.623395162778?(c=t.a*(t.Qn*r)+t.x0,l=t.a*(t.Qn*n+t.Zb)+t.y0):(c=1/0,l=1/0),e.x=c,e.y=l,e}function jA(t,e){var r=(e.x-t.x0)*(1/t.a),n=(e.y-t.y0)*(1/t.a);n=(n-t.Zb)/t.Qn,r=r/t.Qn;var i,o;if(Math.abs(r)<=2.623395162778){B2(t.utg,2*n,2*r,e),n=n+e.x,r=r+e.y,r=Math.atan(oc(r));var s=Math.sin(n),a=Math.cos(n),c=Math.sin(r),l=Math.cos(r);n=Math.atan2(s*l,er(c,l*a)),r=Math.atan2(c,l*a),i=G(r+t.long0,t.over),o=op(t.cgb,n)}else i=1/0,o=1/0;return e.x=i,e.y=o,e}function zA(t){let e={...t,cgb:[],cbg:[],utg:[],gtu:[],Qn:0,Zb:0};return oV(e),e}var qA=p(()=>{ip();sc();BA();DA();FA();kA();_t()});function fo(t){var e=[];e[0]=sV-t*(aV+t*(VA+t*(WA+t*$A))),e[1]=t*(cV-t*(VA+t*(WA+t*$A)));var r=t*t;return e[2]=r*(lV-t*(uV+t*fV)),r*=t,e[3]=r*(hV-t*dV),e[4]=r*t*mV,e}var sV,aV,VA,WA,$A,cV,lV,uV,fV,hV,dV,mV,su=p(()=>{sV=1,aV=.25,VA=.046875,WA=.01953125,$A=.01068115234375,cV=.75,lV=.46875,uV=.013020833333333334,fV=.007120768229166667,hV=.3645833333333333,dV=.005696614583333333,mV=.3076171875});function _r(t,e,r,n){return r*=e,e*=e,n[0]*t-r*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var ac=p(()=>{});function ho(t,e,r){for(var n=1/(1-e),i=t,o=pV;o;--o){var s=Math.sin(i),a=1-e*s*s;if(a=(_r(i,s,Math.cos(i),r)-t)*(a*Math.sqrt(a))*n,i-=a,Math.abs(a)<1e-10)return i}return i}var pV,au=p(()=>{ac();pV=20});function gV(t){t.x0=t.x0!==void 0?t.x0:0,t.y0=t.y0!==void 0?t.y0:0,t.long0=t.long0!==void 0?t.long0:0,t.lat0=t.lat0!==void 0?t.lat0:0,t.es&&(t.en=fo(t.es),t.ml0=_r(t.lat0,Math.sin(t.lat0),Math.cos(t.lat0),t.en))}function HA(t,e){var r=e.x,n=e.y,i=G(r-t.long0,t.over),o,s,a,c=Math.sin(n),l=Math.cos(n);if(t.es){var h=l*i,d=Math.pow(h,2),m=t.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-t.es*Math.pow(c,2),h=h/Math.sqrt(o);var _=_r(n,c,l,t.en);s=t.a*(t.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)))))+t.x0,a=t.a*(t.k0*(_-t.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))))))+t.y0}else{var u=l*Math.sin(i);if(Math.abs(Math.abs(u)-1)<1e-10)return 93;if(s=.5*t.a*t.k0*Math.log((1+u)/(1-u))+t.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=t.a*t.k0*(a-t.lat0)+t.y0}return e.x=s,e.y=a,e}function KA(t,e){var r,n,i,o,s=(e.x-t.x0)*(1/t.a),a=(e.y-t.y0)*(1/t.a);if(t.es)if(r=t.ml0+a/t.k0,n=ho(r,t.es,t.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=t.ep2*Math.pow(m,2),b=Math.pow(y,2),w=Math.pow(g,2),_=Math.pow(w,2);r=1-t.es*Math.pow(d,2);var S=s*Math.sqrt(r)/t.k0,M=Math.pow(S,2);r=r*g,i=n-r*M/(1-t.es)*.5*(1-M/12*(5+3*w-9*y*w+y-4*b-M/30*(61+90*w-252*y*w+45*_+46*y-M/56*(1385+3633*w+4095*_+1574*_*w)))),o=G(t.long0+S*(1-M/6*(1+2*w+y-M/20*(5+28*w+24*_+8*y*w+6*y-M/42*(61+662*w+1320*_+720*_*w))))/m,t.over)}else i=F*Ws(a),o=0;else{var c=Math.exp(s/t.k0),l=.5*(c-1/c),u=t.lat0+a/t.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=G(Math.atan2(l,h)+t.long0,t.over)}return e.x=o,e.y=i,e}function XA(t){let e={...t,en:[],ml0:0};return gV(e),e}var YA=p(()=>{su();ac();au();_t();Ct();Yf()});function sp(t){let e=xr(t),r=n=>De(n,Q(e.long0-Math.PI/6,-Math.PI/2,e.long0+Math.PI/6,Math.PI/2),i=>ru(n.forward,i,e.long0,e.over),e.primeMeridian,e.over);if(Li(t.parameters,"approx"))return r({...cr("tmerc +approx",XA(e),HA,KA,Oi)});if(e.sphere)throw new Error("Spherical transverse Mercator requires +approx");return r({...cr("etmerc",zA(e),UA,jA,Oi)})}var F2,k2,G2=p(()=>{ou();Ot();et();lt();Dn();qA();YA();F2={name:"tmerc",aliases:["Fast_Transverse_Mercator","Fast Transverse Mercator","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger"],parameters:[...Er,...Yo,"approx"],flags:["approx"],create:sp},k2={name:"etmerc",aliases:["Extended_Transverse_Mercator","Extended Transverse Mercator"],parameters:[...Er,...Yo,"approx"],flags:["approx"],create:sp}});var U2,ZA=p(()=>{Ot();et();lt();Vt();Dn();G2();U2={name:"utm",aliases:["Universal Transverse Mercator System"],parameters:["zone","south","approx"],flags:["south","approx"],create(t){let e=re(t.parameters,"zone",NaN);if(!Number.isInteger(e)||e<1||e>60)throw new Error("UTM requires an integer +zone from 1 to 60");let r=Li(t.parameters,"south"),n=sp({...t,parameters:{...t.parameters,lat_0:"0",lon_0:String(6*e-183),x_0:"500000",y_0:r?"10000000":"0",k_0:"0.9996"}}),i=(6*e-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=>ru(n.forward,o,i),t.primeMeridian??0,Object.prototype.hasOwnProperty.call(t.parameters,"over"))}}});function z2(t,e){return[Math.cos(e)*Math.cos(t),Math.cos(e)*Math.sin(t),Math.sin(e)]}function ap(t,e,r,n,i){let o=Math.hypot(t,e);if(!o||Math.abs(r)>o+1e-14)return[];let s=Math.atan2(e,t),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 $s(t,e,r,n=!0){let[[i,o],[s,a]]=e,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=z2(y,b);if(r&&j2(l,w)<u-1e-13)return;let _=j2(t,w);(n?_>h:_<h)&&(h=_,d=[y,b])},g=[i,s,...ap(-t[1],t[0],0,i,s)];for(let y of g){let b=t[0]*Math.cos(y)+t[1]*Math.sin(y);for(let w of[o,a,...ap(t[2],-b,0,o,a)])m(y,w)}if(r){let[y,,b]=l;for(let M of[o,a])for(let v of ap(y*Math.cos(M),0,u-b*Math.sin(M),i,s))m(v,M);for(let M of[i,s])for(let v of ap(y*Math.cos(M),b,u,o,a))m(M,v);let w=j2(t,l),_=t.map((M,v)=>M-w*l[v]),S=Math.hypot(..._);if(S<=1e-14&&(_=[-l[2],0,l[0]],S=1),S>1e-14)for(let M of[-1,1]){let v=l.map((C,R)=>C*u+M*_[R]*Math.sin(r.distance)/S);m(Math.atan2(v[1],v[0]),Math.atan2(v[2],Math.hypot(v[0],v[1])))}}if(!Number.isFinite(h))throw new Error("CRS coverage does not intersect the rendering domain");return{value:h,point:d}}function dt(t,e,r){return[$s(t,e,r,!1).value,$s(t,e,r).value]}function Hs(t,e,r,n,i){let o=dt(t,n,i),s=dt(e,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=t.map((y,b)=>y-d*e[b]);$s(m,n,i,c).value-d*r>0?l=d:u=d}return c?u:l})}var j2,cc=p(()=>{Vt();j2=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2]});function yV(t,e,r,n=Math.PI){let i=[-180,-90,180,90],o=(s,a)=>{let c=Gs(s,t.primeMeridian,t.long0),l=Q(c[0][0]-t.long0,c[0][1],c[1][0]-t.long0,c[1][1]),u=[Math.cos(t.lat0),0,Math.sin(t.lat0)],h=a?$s(u,l,void 0,!1).value:-1,m=!a||h<=Math.cos(n)+1e-13?{latitude:t.lat0,distance:e}:void 0,g=ar(()=>r(l,m),s,t.long0,t.primeMeridian),y=Math.abs(Math.cos(t.lat0))<1e-12,b=(Math.PI/2-e)*180/Math.PI,w=m&&!y&&Us(_=>{let S=z2(_.x-t.long0,_.y);if(S[0]*Math.cos(t.lat0)+S[2]*Math.sin(t.lat0)>=Math.cos(m.distance)-1e-14)return;if(Math.hypot(S[0]+u[0],S[1],S[2]+u[2])<1e-12){let v=t.lat0+m.distance,C=(l[0][0]+l[1][0])/2,R=C+Kt((Math.cos(v)<0?Math.PI:0)-C),E=Math.atan2(Math.sin(v),Math.abs(Math.cos(v)));if(R>=l[0][0]&&R<=l[1][0]&&E>=l[0][1]&&E<=l[1][1]){_.x=R+t.long0,_.y=E;return}}let M=$s(S,l,m);[_.x,_.y]=[M.point[0]+t.long0,M.point[1]]},t.primeMeridian);return{get bounds(){return r(l,m)},normalize(_){g.normalize(_),m&&y?_.y=t.lat0>0?Math.max(b,_.y):Math.min(-b,_.y):w==null||w(_);let S=(t.long0+t.primeMeridian)*180/Math.PI,M=_.x-S;Math.abs(M)>180&&(_.x=S+Ri(M))}}};return s=>o(s??i,!!s)}function gn(t,e,r,n,i=Math.PI){return{...t,longitudeOrigin:e.long0,getRenderingProfile:yV(e,r,n,i)}}var Ks=p(()=>{et();lt();cc();Vt();nc()});function cp(t,e,r,n){let i=[-Math.sin(t.lat0),0,Math.cos(t.lat0)],o=[Math.cos(t.lat0),0,Math.sin(t.lat0)],s=[0,1,0],a=n==="stere"?1:0,c=u=>n==="ortho"?dt(u,e,r):Hs(u,o,a,e,r),l=t.a*(n==="stere"?2*t.k0:1);return ct(Be([t.x0,t.x0],Fe(c(s),l)),Be([t.y0,t.y0],Fe(c(i),l)))}function JA(t,e,r){let n=Math.sin(t.lat0),i=Math.cos(t.lat0),o=dt([0,0,1],e,r);if(Math.abs(n)<1e-15&&(!r||Math.abs(r.distance-Math.PI/2)<1e-15)){let h=m=>{let g=$s([0,1,0],e,r,m);return g.value/Math.sqrt(1-t.es*Math.sin(g.point[1])**2)},d=m=>(1-t.es)*m/Math.sqrt(1-t.es*m*m);return ct(Be([t.x0,t.x0],Fe([h(!1),h(!0)],t.a*t.k0)),Be([t.y0,t.y0],Fe([d(o[0]),d(o[1])],t.a*t.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=li(1/Math.sqrt(1-t.es*s),1/Math.sqrt(1-t.es*a)),l=t.a*t.k0,u=t.es*n*i/Math.sqrt(1-t.es*n*n);return ct(Be([t.x0,t.x0],Fe(Lt(dt([0,1,0],e,r),c),l)),Be([t.y0+l*u,t.y0+l*u],Fe(Lt(dt([-n,0,(1-t.es)*i],e,r),c),l)))}function QA(t,e,r){let n=dt([Math.cos(t.lat0),0,Math.sin(t.lat0)],e,r)[0],i=t.a/Math.sqrt(1-t.es)*Math.acos(Math.max(-1,Math.min(1,n)));return ct([t.x0-i,t.x0+i],[t.y0-i,t.y0+i])}function e8(t,e,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-t.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)],t.a*b)};return ct(Be([t.x0,t.x0],g([0,1,0],e)),Be([t.y0,t.y0],g(h,r)))}function lp(t,e,r,n,i,o,s=1,a=t.e*Math.atanh(t.e)){let c=Q(i[0][0]*s,e(i[0][1]),i[1][0]*s,e(i[1][1])),l=2*a+Math.PI*Math.abs(s-1),u=o&&s===1?Math.min(o.distance+l,Math.PI-(1-t.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=Hs([0,1,0],d,1,y,h),w=Hs(m,d,1,y,h);return ct(Be([t.x0,t.x0],Fe(b,n)),Be([t.y0,t.y0],Fe(w,n)))}function t8(t,e,r,n,i,o){let s=[Math.cos(t.lat0),0,Math.sin(t.lat0)],a=[-Math.sin(t.lat0),0,Math.cos(t.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=Hs(g,y,h*e,i,o),w=Hs(m,y,h*e,i,o);return ct(Be([t.x0,t.x0],Fe(b,t.a*(e-1)*h)),Be([t.y0,t.y0],Fe(w,t.a*(e-1))))}function r8(t,e,r){let n=dt([Math.cos(t.lat0),0,Math.sin(t.lat0)],e,r)[0],i=Math.acos(Math.max(-1,Math.min(1,n))),o=1-t.es,s=t.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([t.x0-c,t.x0+c],[t.y0-c,t.y0+c])}var Xs=p(()=>{et();cc();Ot()});function Ci(t,e,r,n,i,o,s){let a=i*r/s,c=n*e-o*r*t/s,l=n*t+o*r*e/s;return Math.atan2(l,Math.hypot(a,c))}var Zf=p(()=>{});function yn(t,e,r){var n=t*e;return r/Math.sqrt(1-n*n)}var cu=p(()=>{});function Kr(t,e,r){let n=Math.cos(e);return Math.exp(t*Math.atanh(t*r))*(r>0?n/(1+r):(1-r)/n)}var Jf=p(()=>{});function lc(t,e){for(var r=.5*t,n,i,o=F-2*Math.atan(e),s=0;s<=15;s++)if(n=t*Math.sin(o),i=F-2*Math.atan(e*Math.pow((1-n)/(1+n),r))-o,o+=i,Math.abs(i)<=1e-10)return o;return-9999}var up=p(()=>{Ct()});function n8(t,e,r){return e*=r,Math.tan(.5*(F+t))*Math.pow((1-e)/(1+e),.5*r)}function bV(t){t.x0=t.x0||0,t.y0=t.y0||0,t.lat0=t.lat0||0,t.long0=t.long0||0,t.coslat0=Math.cos(t.lat0),t.sinlat0=Math.sin(t.lat0),t.sphere?!Number.isNaN(t.lat_ts)&&Math.abs(t.coslat0)<=1e-10&&(t.k0=.5*(1+Ws(t.lat0)*Math.sin(t.lat_ts))):(Math.abs(t.coslat0)<=1e-10&&(t.lat0>0?t.con=1:t.con=-1),t.cons=Math.sqrt(Math.pow(1+t.e,1+t.e)*Math.pow(1-t.e,1-t.e)),!Number.isNaN(t.lat_ts)&&Math.abs(t.coslat0)<=1e-10&&Math.abs(Math.cos(t.lat_ts))>1e-10&&(t.k0=.5*t.cons*yn(t.e,Math.sin(t.lat_ts),Math.cos(t.lat_ts))/Kr(t.e,t.con*t.lat_ts,t.con*Math.sin(t.lat_ts))),t.ms1=yn(t.e,t.sinlat0,t.coslat0),t.X0=2*Math.atan(n8(t.lat0,t.sinlat0,t.e))-F,t.cosX0=Math.cos(t.X0),t.sinX0=Math.sin(t.X0))}function i8(t,e){var r=e.x,n=e.y,i=Math.sin(n),o=Math.cos(n),s,a,c,l,u,h,d=G(r-t.long0,t.over);if(Math.abs(Math.abs(r-t.long0)-Math.PI)<=1e-10&&Math.abs(n+t.lat0)<=1e-10)return e.x=NaN,e.y=NaN,e;if(t.sphere&&Math.abs(t.coslat0)<=1e-10){let m=t.lat0>0?1:-1,g=2*t.a*t.k0*Math.tan(Math.PI/4-m*n/2);return e.x=t.x0+g*Math.sin(d),e.y=t.y0-m*g*Math.cos(d),e}return t.sphere?(s=2*t.k0/(1+t.sinlat0*i+t.coslat0*o*Math.cos(d)),e.x=t.a*s*o*Math.sin(d)+t.x0,e.y=t.a*s*(t.coslat0*i-t.sinlat0*o*Math.cos(d))+t.y0,e):(a=2*Math.atan(n8(n,i,t.e))-F,l=Math.cos(a),c=Math.sin(a),Math.abs(t.coslat0)<=1e-10?(u=Kr(t.e,n*t.con,t.con*i),h=2*t.a*t.k0*u/t.cons,e.x=t.x0+h*Math.sin(r-t.long0),e.y=t.y0-t.con*h*Math.cos(r-t.long0),e):(Math.abs(t.sinlat0)<1e-10?(s=2*t.a*t.k0/(1+l*Math.cos(d)),e.y=s*c+t.y0):(s=2*t.a*t.k0*t.ms1/(t.cosX0*(1+t.sinX0*c+t.cosX0*l*Math.cos(d))),e.y=s*(t.cosX0*c-t.sinX0*l*Math.cos(d))+t.y0),e.x=s*l*Math.sin(d)+t.x0,e))}function o8(t,e){e.x-=t.x0,e.y-=t.y0;var r,n,i,o,s,a=Math.sqrt(e.x*e.x+e.y*e.y);if(t.sphere){var c=2*Math.atan(a/(2*t.a*t.k0));return r=t.long0,n=t.lat0,a<=1e-10?(e.x=r,e.y=n,e):(n=Ci(t.sinlat0,t.coslat0,Math.sin(c),Math.cos(c),e.x,e.y,a),Math.abs(t.coslat0)<1e-10?t.lat0>0?r=G(t.long0+Math.atan2(e.x,-1*e.y),t.over):r=G(t.long0+Math.atan2(e.x,e.y),t.over):r=G(t.long0+Math.atan2(e.x*Math.sin(c),a*t.coslat0*Math.cos(c)-e.y*t.sinlat0*Math.sin(c)),t.over),e.x=r,e.y=n,e)}else if(Math.abs(t.coslat0)<=1e-10){if(a<=1e-10)return n=t.lat0,r=t.long0,e.x=r,e.y=n,e;e.x*=t.con,e.y*=t.con,i=a*t.cons/(2*t.a*t.k0),n=t.con*lc(t.e,i),r=t.con*G(t.con*t.long0+Math.atan2(e.x,-1*e.y),t.over)}else o=2*Math.atan(a*t.cosX0/(2*t.a*t.k0*t.ms1)),r=t.long0,a<=1e-10?s=t.X0:(s=Ci(t.sinX0,t.cosX0,Math.sin(o),Math.cos(o),e.x,e.y,a),r=G(t.long0+Math.atan2(e.x*Math.sin(o),a*t.cosX0*Math.cos(o)-e.y*t.sinX0*Math.sin(o)),t.over)),n=-1*lc(t.e,Math.tan(.5*(F+s)));return e.x=r,e.y=n,e}function s8(t){let e={...t,coslat0:0,sinlat0:0,con:0,cons:0,ms1:0,X0:0,cosX0:0,sinX0:0};return bV(e),e}var a8=p(()=>{Zf();Ct();Yf();cu();Jf();up();_t()});var q2,c8=p(()=>{Ks();Xs();Dn();a8();q2={name:"stere",aliases:["Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],parameters:[...Er,...Yo,"lat_ts"],create(t){let e=xr(t),r=s8(e),n=qs(e,cr("stere",r,i8,o8));return gn(n,e,150*Math.PI/180,(i,o)=>r.sphere?cp(r,i,o,"stere"):lp(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 Qf=p(()=>{_A();SA();MA()});var fi=p(()=>{"use strict";DE();NE();kE();Ty();GE();Py();Py();_4()});function l8(t){return!SV(t,"ftyp",4)||(t[8]&96)===0?null:wV(t)}function wV(t){switch(xV(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function xV(t,e,r){return String.fromCharCode(...t.slice(e,r))}function _V(t){return[...t].map(e=>e.charCodeAt(0))}function SV(t,e,r=0){let n=_V(e);for(let i=0;i<n.length;++i)if(n[i]!==t[i+r])return!1;return!0}var u8=p(()=>{"use strict"});function fp(t){let e=th(t);return vV(e)||AV(e)||EV(e)||TV(e)||MV(e)}function MV(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=l8(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function vV(t){let e=th(t);return e.byteLength>=33&&e.getUint32(0,Nn)===2303741511&&e.getUint32(4,Nn)===218765834&&e.getUint32(8,Nn)===13&&e.getUint32(12,Nn)===1229472850?{mimeType:"image/png",width:e.getUint32(16,Nn),height:e.getUint32(20,Nn)}:null}function EV(t){let e=th(t);return e.byteLength>=10&&e.getUint32(0,Nn)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,eh),height:e.getUint16(8,eh)}:null}function TV(t){let e=th(t);return e.byteLength>=14&&e.getUint16(0,Nn)===16973&&e.getUint32(2,eh)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,eh),height:e.getUint32(22,eh)}:null}function AV(t){let e=th(t);if(!(e.byteLength>=3&&e.getUint16(0,Nn)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=IV(),o=2;for(;o+9<e.byteLength;){let s=e.getUint16(o,Nn);if(i.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,Nn),width:e.getUint16(o+7,Nn)};if(!n.has(s))return null;o+=2,o+=e.getUint16(o,Nn)}return null}function IV(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function th(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}var Nn,eh,V2=p(()=>{"use strict";u8();Nn=!1,eh=!0});var PV,RV,LV,f8,h8=p(()=>{"use strict";V2();PV=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],RV=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],LV={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:RV,extensions:PV,tests:[t=>!!fp(new DataView(t))]},f8={...LV,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var lu,hp=p(()=>{"use strict";lu="5.0.0-beta.11"});function uu(t){if(!t)return!1;if(OV.test(t))return!0;for(let e=t.indexOf(".svg");e>=0;e=t.indexOf(".svg",e+4)){let r=t[e+4];if(r===void 0||r==="?"||r==="#")return!0}return!1}function d8(t,e){if(uu(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return W2(t,e)}function W2(t,e){if(uu(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}var OV,dp=p(()=>{"use strict";OV=/^data:image\/svg\+xml/});async function m8(t,e){let r=d8(t,e),n=self.URL||self.webkitURL,i=typeof r!="string"&&n.createObjectURL(r);try{return await CV(i||r)}finally{i&&n.revokeObjectURL(i)}}async function CV(t){let e=new Image;return e.src=t,await new Promise((r,n)=>{try{e.onload=()=>r(e),e.onerror=i=>{let o=i instanceof Error?i.message:"error";n(new Error(o))}}catch(i){n(i)}})}var p8=p(()=>{"use strict";dp()});async function y8(t,e,r){let n;uu(r)?n=await m8(t,r):n=W2(t,r);let i=e&&e.imagebitmap;return await w8(n,i,Ai(e))}async function b8(t,e){let r=e&&e.imagebitmap;return await w8(t,r,Ai(e))}async function w8(t,e=null,r=Ai()){if((BV(e)||!g8)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(n){r.warn(String(n))(),g8=!1}return await createImageBitmap(t)}function BV(t){if(!t)return!0;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}var g8,x8=p(()=>{"use strict";fi();dp();p8();g8=!0});async function _8(t,e){var s,a;let{mimeType:r}=fp(t)||{},n=(s=globalThis.loaders)==null?void 0:s.parseImageNode;jl(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(t,r);return i(o)}var S8=p(()=>{"use strict";fi();V2()});async function $2(t,e,r){var i;e=e||{},E8(e);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!xm||n)return await _8(t,e);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(M8);return await y8(t,e,r==null?void 0:r.url)}async function v8(t,e,r){var i;e=e||{},E8(e);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!xm||n||uu(r==null?void 0:r.url)||t.type.startsWith("image/svg+xml"))return await $2(await t.arrayBuffer(),e,r);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(M8);return await b8(t,e)}function E8(t){var r;let e=(r=t.image)==null?void 0:r.type;if(e&&e!=="imagebitmap")throw new Error(DV)}var DV,M8,T8=p(()=>{"use strict";fi();x8();dp();S8();DV="@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 A8={};Jt(A8,{ImageLoaderWithParser:()=>FV});var Dae,NV,FV,I8=p(()=>{"use strict";T8();H2();({preload:Dae,...NV}=Zo),FV={...NV,parse:$2,parseBlob:v8}});async function GV(){let{ImageLoaderWithParser:t}=await Promise.resolve().then(()=>(I8(),A8));return t}var kV,Zo,H2=p(()=>{"use strict";hp();h8();kV={image:{}};Zo={dataType:null,batchType:null,...f8,version:lu,options:kV,preload:GV}});function R8(t){let e=qV(t);if(!e)throw new Error("Not an image");return e}function mp(t){switch(R8(t)){case"data":return t;case"imagebitmap":return UV(t)?jV(t):P8(t);case"image":return P8(t);default:throw new Error("getImageData")}}function UV(t){var r;let e=(r=globalThis.loaders)==null?void 0:r.isImageBitmapNode;return!!(e!=null&&e(t))}function jV(t){var r;let e=(r=globalThis.loaders)==null?void 0:r.getImageBitmapDataNode;if(!e)throw new Error("getImageData");return e(t)}function P8(t){let e=zV(t.width,t.height),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height)}function zV(t,e){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(t,e);if(typeof document<"u"){let r=document.createElement("canvas");return r.width=t,r.height=e,r}throw new Error("getImageData")}function qV(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var L8=p(()=>{"use strict"});var O8,C8,K2=p(()=>{"use strict";O8={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]},C8={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 D8(t){if(!pp){t=t||WV()||void 0,pp=new Set;for(let e of VV)for(let r in B8)if(t&&t.getExtension(`${e}${r}`))for(let n of B8[r])pp.add(n)}return pp}function WV(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var VV,B8,pp,N8=p(()=>{"use strict";VV=["","WEBKIT_","MOZ_"],B8={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"]},pp=null});function k8(t=D8(),e,r={}){let n=new Set(t);if(!e)return HV(n);if(e.isHDR){let i=F8(e);return r.astcHDR&&(i==="astc-4x4"||i==="astc-6x6")&&gp(n,i.slice(5))?i==="astc-4x4"?"astc-hdr-4x4":"astc-hdr-6x6":n.has("bc6h-rgb-ufloat")?"bc6h":"rgba16f"}if(e.codec==="xubc7")return Y2(n)?"bc7":"rgba32";if(e.codec.startsWith("xuastc-ldr-")||e.codec.startsWith("astc-ldr-")){let i=F8(e);return i&&gp(n,i.slice(5))?i:X2(n,e,["bc7","bc","etc2","atc"])}return e.codec==="uastc-ldr-4x4"?gp(n,"4x4")?"astc-4x4":X2(n,e,["bc7","bc","etc2","etc1","pvrtc","atc"]):X2(n,e,["etc2","etc1","bc7","bc","pvrtc","atc"])}function HV(t){return gp(t,"4x4")?"astc-4x4":Y2(t)?"bc7":G8(t)?{alpha:"bc3",noAlpha:"bc1"}:U8(t)?"etc2":t.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:j8(t)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:z8(t)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function X2(t,e,r){for(let n of r)switch(n){case"bc7":if(Y2(t))return"bc7";break;case"bc":if(G8(t))return e.hasAlpha?"bc3":"bc1";break;case"etc2":if(U8(t))return"etc2";break;case"etc1":if(!e.hasAlpha&&t.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(j8(t))return e.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(z8(t))return e.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return e.hasAlpha?"rgba32":"rgb565"}function F8(t){let e=`${t.blockWidth}x${t.blockHeight}`;return $V.includes(e)?`astc-${e}`:null}function gp(t,e){return fu(t,[`astc-${e}-unorm`,`astc-${e}-unorm-srgb`])}function Y2(t){return fu(t,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function G8(t){return fu(t,["bc1-rgb-unorm-webgl","bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb"])}function U8(t){return fu(t,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function j8(t){return fu(t,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function z8(t){return fu(t,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function fu(t,e){return e.some(r=>t.has(r))}var $V,q8=p(()=>{"use strict";N8();$V=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function $8(t){Ay(t.modules);let e=Iy("basis");return e||(W8||=KV(t),await W8)}async function KV(t){let e=null,r=null;return[e,r]=await Promise.all([await $l(V8.TRANSCODER,"images",t,null,"basis_transcoder.mjs"),await $l(V8.TRANSCODER_WASM,"images",t)]),e=e||globalThis.BASIS,await XV(e,r)}function XV(t,e){let r={};return e&&(r.wasmBinary=e),zl(()=>t(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 V8,W8,H8=p(()=>{"use strict";fi();Qa();V8={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function wp(t){if(t!==void 0)return wI[t]}function xI(t){if(t!==void 0)return dW[t]}var wI,dW,lb=p(()=>{"use strict";wI={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"},dW=Object.fromEntries(Object.entries(wI).map(([t,e])=>[e,Number(t)]))});function hu(t,e){let r=new Array(e.mipMapLevels),n=e.textureFormat||wp(e.internalFormat),i=e.internalFormat||xI(e.textureFormat),o=e.width,s=e.height,a=0;for(let c=0;c<e.mipMapLevels;++c){let l=pW(e,o,s,t,c),h={shape:"texture-level",compressed:!0,data:mW(t,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 mW(t,e,r,n){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+r,n)}function pW(t,e,r,n,i){return Array.isArray(n)?t.sizeFunction(n[i]):t.sizeFunction(e,r)}var xp=p(()=>{"use strict";lb()});function yW(t){return gW[t]}function _I(t){return wp(yW(t))}var gW,SI=p(()=>{"use strict";lb();gW={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 Ys(t){if(t.byteLength<ub.byteLength)return!1;let e=new Uint8Array(t,0,ub.byteLength);return ub.every((r,n)=>e[n]===r)}function vI(t){let e=mb(t);if(e.pixelDepth>0)throw new Error("CompressedTextureLoader does not support 3D KTX2 textures");if(e.supercompressionScheme!==bW)throw new Error(`KTX2 supercompression scheme ${e.supercompressionScheme} requires BasisLoader`);if(e.vkFormat===0)throw new Error("KTX2 vkFormat is undefined; decode this texture with BasisLoader");let r=_I(e.vkFormat);if(!r)throw new Error(`Unsupported KTX2 Vulkan format ${e.vkFormat}`);return hu(e.levels,{mipMapLevels:e.levelCount,width:e.pixelWidth,height:Math.max(1,e.pixelHeight),sizeFunction:n=>n.uncompressedByteLength,textureFormat:r})}function mb(t){if(!Ys(t))throw new Error("Invalid KTX2 identifier");if(t.byteLength<fb)throw new Error("Truncated KTX2 header");let e=new DataView(t),r=Math.max(1,e.getUint32(40,!0)),n=wW(r,MI,"KTX2 level index");db(fb,n,t.byteLength,"KTX2 level index");let i={vkFormat:e.getUint32(12,!0),pixelWidth:e.getUint32(20,!0),pixelHeight:e.getUint32(24,!0),pixelDepth:e.getUint32(28,!0),layerCount:e.getUint32(32,!0),faceCount:e.getUint32(36,!0),levelCount:r,supercompressionScheme:e.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}`);hb(e.getUint32(48,!0),e.getUint32(52,!0),t.byteLength,"KTX2 data format descriptor"),hb(e.getUint32(56,!0),e.getUint32(60,!0),t.byteLength,"KTX2 key/value data"),hb(rh(e,64,"KTX2 supercompression global data offset"),rh(e,72,"KTX2 supercompression global data length"),t.byteLength,"KTX2 supercompression global data");for(let o=0;o<r;o++){let s=fb+o*MI,a=rh(e,s,`KTX2 level ${o} offset`),c=rh(e,s+8,`KTX2 level ${o} length`),l=rh(e,s+16,`KTX2 level ${o} uncompressed length`);db(a,c,t.byteLength,`KTX2 level ${o}`),i.levels.push({levelData:new Uint8Array(t,a,c),uncompressedByteLength:l})}return i}function rh(t,e,r){let n=t.getUint32(e,!0),o=t.getUint32(e+4,!0)*4294967296+n;if(!Number.isSafeInteger(o))throw new Error(`${r} exceeds JavaScript's safe integer range`);return o}function wW(t,e,r){let n=t*e;if(!Number.isSafeInteger(n))throw new Error(`${r} size exceeds JavaScript's safe integer range`);return n}function hb(t,e,r,n){e>0&&db(t,e,r,n)}function db(t,e,r,n){if(!Number.isSafeInteger(t)||!Number.isSafeInteger(e)||t<0||e<0)throw new Error(`${n} has an invalid byte range`);let i=t+e;if(!Number.isSafeInteger(i)||i>r)throw new Error(`${n} is outside the KTX2 container`)}var ub,fb,MI,bW,_p=p(()=>{"use strict";xp();SI();ub=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10]),fb=80,MI=24,bW=0});async function _W(t){let e=EI,r;EI=new Promise(n=>{r=n}),await e;try{return await t()}finally{r()}}async function Sp(t,e={}){return await _W(async()=>{var o;let r=await $8(Ja({core:e==null?void 0:e.core,modules:e==null?void 0:e.modules})),n=((o=e.basis)==null?void 0:o.containerFormat)||"auto";if(n==="ktx2"||n==="auto"&&Ys(t)){if(!r.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return MW(r,t,e)}return SW(r,t,e)})}function SW(t,e,r){let n=new t.BasisFile(new Uint8Array(e));try{let i=II(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(AI(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 MW(t,e,r){let n=new t.KTX2File(new Uint8Array(e));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=II(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(AI(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 AI(t,e,r,n,i,o,s){let a=EW(i,e);vW(e,pb(i,e));let c=o(a.basisFormat),l=AW(c,a.dataType);if(!s(l,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${pb(i,e)}`);let u=e.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:e.hasAlpha}}function vW(t,e){let r=e==="bc6h"||e==="rgba16f"||e==="rgb9e5"||e.startsWith("astc-hdr-");if(t.isHDR!==r)throw new Error(`Basis source codec ${t.codec} cannot be transcoded to ${e}`);if(t.codec==="xubc7"&&e!=="bc7"&&e!=="rgba32")throw new Error(`Basis source codec ${t.codec} cannot be transcoded to ${e}`)}function EW(t,e){let r=pb(t,e),n=TI[r];if(!n)throw new Error(`Unknown Basis format ${r}`);return n}function pb(t,e){var n,i,o;let r=((n=t.basis)==null?void 0:n.format)||"auto";return r==="auto"&&(r=k8((i=t.basis)==null?void 0:i.supportedTextureFormats,e,(o=t.basis)==null?void 0:o.supportedTextureFeatures)),typeof r=="object"&&(r=e.hasAlpha?r.alpha:r.noAlpha),r.toLowerCase()}function II(t,e){let r=t.getBasisTexFormat(),n=TW[r];if(!n)throw new Error(`Unsupported Basis source texture format ${r}`);return{codec:n,isHDR:!!t.isHDR(),isSRGB:e?!!t.isSRGB():!1,hasAlpha:!!t.getHasAlpha(),blockWidth:t.getBlockWidth(),blockHeight:t.getBlockHeight()}}function AW(t,e){return e==="uint16"?new Uint16Array(t/Uint16Array.BYTES_PER_ELEMENT):e==="uint32"?new Uint32Array(t/Uint32Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function Tr(t,e,r){return{basisFormat:t,compressed:!0,format:e,textureFormat:r}}function du(t,e,r,n,i){return{basisFormat:t,compressed:!1,format:e,textureFormat:r,srgbFormat:n,srgbTextureFormat:i}}function wn(t,e,r,n){return{...Tr(t,e,`astc-${n}-unorm`),srgbFormat:r,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var bn,TI,yce,EI,TW,gb=p(()=>{"use strict";Qa();q8();H8();_p();bn={"4x4":wn(10,37808,37840,"4x4"),"5x4":wn(28,37809,37841,"5x4"),"5x5":wn(29,37810,37842,"5x5"),"6x5":wn(30,37811,37843,"6x5"),"6x6":wn(31,37812,37844,"6x6"),"8x5":wn(32,37813,37845,"8x5"),"8x6":wn(33,37814,37846,"8x6"),"8x8":wn(36,37815,37847,"8x8"),"10x5":wn(34,37816,37848,"10x5"),"10x6":wn(35,37817,37849,"10x6"),"10x8":wn(37,37818,37850,"10x8"),"10x10":wn(38,37819,37851,"10x10"),"12x10":wn(39,37820,37852,"12x10"),"12x12":wn(40,37821,37853,"12x12")},TI={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":bn["4x4"],"astc-5x4":bn["5x4"],"astc-5x5":bn["5x5"],"astc-6x5":bn["6x5"],"astc-6x6":bn["6x6"],"astc-8x5":bn["8x5"],"astc-8x6":bn["8x6"],"astc-8x8":bn["8x8"],"astc-10x5":bn["10x5"],"astc-10x6":bn["10x6"],"astc-10x8":bn["10x8"],"astc-10x10":bn["10x10"],"astc-12x10":bn["12x10"],"astc-12x12":bn["12x12"],"atc-rgb":Tr(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":Tr(12,34798,"atc-rgbai-unorm-webgl"),rgba32:du(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:du(14,36194,"rgb565unorm-webgl"),bgr565:du(15,36194,"rgb565unorm-webgl"),rgba4444:du(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:{...du(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...du(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":Tr(27,37812,"astc-6x6-unorm")},yce=Object.freeze(Object.keys(TI)),EI=Promise.resolve();TW={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 PI={};Jt(PI,{BasisLoaderWithParser:()=>LW,BasisWorkerLoaderWithParser:()=>RW});var Sce,IW,Mce,PW,RW,LW,RI=p(()=>{"use strict";gb();Mp();Mp();({preload:Sce,...IW}=mo),{preload:Mce,...PW}=mo,RW={...IW},LW={...PW,parse:Sp}});async function OW(){let{BasisLoaderWithParser:t}=await Promise.resolve().then(()=>(RI(),PI));return t}var mo,Mp=p(()=>{"use strict";K2();hp();mo={...O8,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:lu,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:OW}});function LI(t){return new Uint32Array(t,0,Fn.HEADER_LENGTH)[Fn.MAGIC_NUMBER_INDEX]===Fn.MAGIC_NUMBER}function OI(t){let e=new Int32Array(t,0,Fn.HEADER_LENGTH),r=e[Fn.HEADER_PF_FOURCC_INDEX];jl(!!(e[Fn.HEADER_PF_FLAGS_INDEX]&Fn.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=kW(r),i=CW[n],o=FW[n];jl(i&&o,`DDS: Unknown pixel format ${r}`);let s=1;e[Fn.HEADER_FLAGS_INDEX]&Fn.DDSD_MIPMAPCOUNT&&(s=Math.max(1,e[Fn.MIPMAPCOUNT_INDEX]));let a=e[Fn.HEADER_WIDTH_INDEX],c=e[Fn.HEADER_HEIGHT_INDEX],l=e[Fn.HEADER_SIZE_INDEX]+4,u=new Uint8Array(t,l);return hu(u,{mipMapLevels:s,width:a,height:c,sizeFunction:o,textureFormat:i})}function CI(t,e){return(t+3>>2)*(e+3>>2)*8}function vp(t,e){return(t+3>>2)*(e+3>>2)*16}function kW(t){return String.fromCharCode(t&255,t>>8&255,t>>16&255,t>>24&255)}var Fn,CW,BW,DW,NW,FW,BI=p(()=>{"use strict";fi();xp();Fn={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},CW={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"},BW=CI,DW=vp,NW=vp,FW={DXT1:CI,DXT3:vp,DXT5:vp,"ATC ":BW,ATCA:DW,ATCI:NW}});function FI(t){let r=new Uint32Array(t,0,hi.HEADER_LENGTH)[hi.MAGIC_NUMBER_INDEX];return r===hi.MAGIC_NUMBER||r===hi.MAGIC_NUMBER_EXTRA}function kI(t){let e=new Uint32Array(t,0,hi.HEADER_LENGTH),r=e[hi.PIXEL_FORMAT_INDEX],n=e[hi.COLOUR_SPACE_INDEX],i=GW[r]||[],o=i.length>1&&n?i[1]:i[0],s=UW[r],a=e[hi.MIPMAPCOUNT_INDEX],c=e[hi.WIDTH_INDEX],l=e[hi.HEIGHT_INDEX],u=hi.HEADER_SIZE+e[hi.METADATA_SIZE_INDEX],h=new Uint8Array(t,u);return hu(h,{mipMapLevels:a,width:c,height:l,sizeFunction:s,textureFormat:o})}function DI(t,e){return t=Math.max(t,16),e=Math.max(e,8),t*e/4}function NI(t,e){return t=Math.max(t,8),e=Math.max(e,8),t*e/2}function nh(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function ih(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function jW(t,e){return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16}function zW(t,e){return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16}function qW(t,e){return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16}function VW(t,e){return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16}function WW(t,e){return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16}function $W(t,e){return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16}function HW(t,e){return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16}function KW(t,e){return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16}function XW(t,e){return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16}function YW(t,e){return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16}function ZW(t,e){return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16}function JW(t,e){return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16}function QW(t,e){return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16}var hi,GW,UW,GI=p(()=>{"use strict";xp();hi={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},GW={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"]},UW={0:DI,1:DI,2:NI,3:NI,6:nh,7:nh,9:ih,11:ih,22:nh,23:ih,24:nh,25:nh,26:ih,27:ih,28:jW,29:zW,30:qW,31:VW,32:WW,33:$W,34:HW,35:KW,36:XW,37:YW,38:ZW,39:JW,40:QW}});function yb(t){if(Ys(t))return vI(t);if(LI(t))return OI(t);if(FI(t))return kI(t);throw new Error("Texture container format not recognized")}var UI=p(()=>{"use strict";_p();BI();GI()});var jI={};Jt(jI,{CompressedTextureLoaderWithParser:()=>n$,CompressedTextureWorkerLoaderWithParser:()=>r$});var jce,e$,zce,t$,r$,n$,zI=p(()=>{"use strict";UI();gb();_p();Ep();Ep();({preload:jce,...e$}=Jo),{preload:zce,...t$}=Jo,r$={...e$},n$={...t$,parse:async(t,e)=>{var r,n;if(e={...e},(r=e==null?void 0:e["compressed-texture"])!=null&&r.useBasis||Ys(t)){let i=Ys(t)?mb(t):null;return!((n=e==null?void 0:e["compressed-texture"])!=null&&n.useBasis||(i==null?void 0:i.supercompressionScheme)!==0||(i==null?void 0:i.vkFormat)===0)?yb(t):(e.basis={...e.basis,containerFormat:"ktx2"},(await Sp(t,e))[0])}return yb(t)}}});async function i$(){let{CompressedTextureLoaderWithParser:t}=await Promise.resolve().then(()=>(zI(),jI));return t}var Jo,Ep=p(()=>{"use strict";K2();hp();Jo={...C8,dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"images",version:lu,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:i$}});var oh=p(()=>{"use strict";H2();L8();Mp();Ep()});var qI=p(()=>{"use strict"});function o$(t,e="float32"){return t instanceof Date?"date-millisecond":typeof t=="number"?e:typeof t=="boolean"?"bool":typeof t=="string"?"utf8":"null"}function VI(t){let e=bb(t);return e!=="null"?{type:e,nullable:!1}:t.length>0?(e=o$(t[0]),{type:e,nullable:!0}):{type:"null",nullable:!0}}function bb(t){if(typeof Float16Array<"u"&&t instanceof Float16Array)return"float16";switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case BigInt64Array:return"int64";case BigUint64Array:return"uint64";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}var wb=p(()=>{"use strict"});function $I(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function $(t,e,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(t,e||[])).next())})}function WI(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Me(t){return this instanceof Me?(this.v=t,this):new Me(t)}function Xr(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),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 mu(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Me(t[i](s)),done:!1}:o?o(s):s}:o}}function kn(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof WI=="function"?WI(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,c){s=t[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 HI,pu,s$,Gn,Qo=p(()=>{HI=new TextDecoder("utf-8"),pu=HI.decode.bind(HI),s$=new TextEncoder,Gn=t=>s$.encode(t)});var a$,KI,lr,Yr,Un,jn,xn,Tp,Ap,Ip,Pp,Rp,XI,sh,YI,Lp,ZI,es=p(()=>{a$=t=>typeof t=="number",KI=t=>typeof t=="boolean",lr=t=>typeof t=="function",Yr=t=>t!=null&&Object(t)===t,Un=t=>Yr(t)&&lr(t.then),jn=t=>Yr(t)&&lr(t[Symbol.iterator]),xn=t=>Yr(t)&&lr(t[Symbol.asyncIterator]),Tp=t=>Yr(t)&&Yr(t.schema),Ap=t=>Yr(t)&&"done"in t&&"value"in t,Ip=t=>Yr(t)&&lr(t.stat)&&a$(t.fd),Pp=t=>Yr(t)&&sh(t.body),Rp=t=>"_getDOMStream"in t&&"_getNodeStream"in t,XI=t=>Yr(t)&&lr(t.abort)&&lr(t.getWriter)&&!Rp(t),sh=t=>Yr(t)&&lr(t.cancel)&&lr(t.getReader)&&!Rp(t),YI=t=>Yr(t)&&lr(t.end)&&lr(t.write)&&KI(t.writable)&&!Rp(t),Lp=t=>Yr(t)&&lr(t.read)&&lr(t.pipe)&&KI(t.readable)&&!Rp(t),ZI=t=>Yr(t)&&lr(t.clear)&&lr(t.bytes)&&lr(t.position)&&lr(t.setPosition)&&lr(t.capacity)&&lr(t.getBufferIdentifier)&&lr(t.createLong)});var Eb={};Jt(Eb,{compareArrayLike:()=>vb,joinUint8Arrays:()=>zn,memcpy:()=>ah,rebaseValueOffsets:()=>Op,toArrayBufferView:()=>Re,toArrayBufferViewAsyncIterator:()=>Bi,toArrayBufferViewIterator:()=>po,toBigInt64Array:()=>ch,toBigUint64Array:()=>d$,toFloat32Array:()=>m$,toFloat32ArrayAsyncIterator:()=>R$,toFloat32ArrayIterator:()=>S$,toFloat64Array:()=>p$,toFloat64ArrayAsyncIterator:()=>L$,toFloat64ArrayIterator:()=>M$,toInt16Array:()=>u$,toInt16ArrayAsyncIterator:()=>T$,toInt16ArrayIterator:()=>b$,toInt32Array:()=>uc,toInt32ArrayAsyncIterator:()=>A$,toInt32ArrayIterator:()=>w$,toInt8Array:()=>l$,toInt8ArrayAsyncIterator:()=>E$,toInt8ArrayIterator:()=>y$,toUint16Array:()=>f$,toUint16ArrayAsyncIterator:()=>I$,toUint16ArrayIterator:()=>x$,toUint32Array:()=>h$,toUint32ArrayAsyncIterator:()=>P$,toUint32ArrayIterator:()=>_$,toUint8Array:()=>se,toUint8ArrayAsyncIterator:()=>Mb,toUint8ArrayIterator:()=>Sb,toUint8ClampedArray:()=>g$,toUint8ClampedArrayAsyncIterator:()=>O$,toUint8ClampedArrayIterator:()=>v$});function c$(t){let e=t[0]?[t[0]]:[],r,n,i,o;for(let s,a,c=0,l=0,u=t.length;++c<u;){if(s=e[l],a=t[c],!s||!a||s.buffer!==a.buffer||a.byteOffset<s.byteOffset){a&&(e[++l]=a);continue}if({byteOffset:r,byteLength:i}=s,{byteOffset:n,byteLength:o}=a,r+i<n||n+o<r){a&&(e[++l]=a);continue}e[l]=new Uint8Array(s.buffer,r,n-r+o)}return e}function ah(t,e,r=0,n=e.byteLength){let i=t.byteLength,o=new Uint8Array(t.buffer,t.byteOffset,i),s=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,i));return o.set(s,r),t}function zn(t,e){let r=c$(t),n=r.reduce((u,h)=>u+h.byteLength,0),i,o,s,a=0,c=-1,l=Math.min(e||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?ah(s,o,a):s=o;break}ah(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(t,e){let r=Ap(e)?e.value:e;return r instanceof t?t===Uint8Array?new t(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=Gn(r)),r instanceof ArrayBuffer?new t(r):r instanceof _b?new t(r):ZI(r)?Re(t,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new t(0):new t(r.buffer,r.byteOffset,r.byteLength/t.BYTES_PER_ELEMENT):t.from(r)):new t(0)}function*po(t,e){let r=function*(i){yield i},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof _b?r(e):jn(e)?e:r(e);return yield*xb((function*(i){let o=null;do o=i.next(yield Re(t,o));while(!o.done)})(n[Symbol.iterator]())),new t}function Bi(t,e){return Xr(this,arguments,function*(){if(Un(e))return yield Me(yield Me(yield*mu(kn(Bi(t,yield Me(e))))));let n=function(s){return Xr(this,arguments,function*(){yield yield Me(yield Me(s))})},i=function(s){return Xr(this,arguments,function*(){yield Me(yield*mu(kn(xb((function*(a){let c=null;do c=a.next(yield c==null?void 0:c.value);while(!c.done)})(s[Symbol.iterator]())))))})},o=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof _b?n(e):jn(e)?i(e):xn(e)?e:n(e);return yield Me(yield*mu(kn(xb((function(s){return Xr(this,arguments,function*(){let a=null;do a=yield Me(s.next(yield yield Me(Re(t,a))));while(!a.done)})})(o[Symbol.asyncIterator]()))))),yield Me(new t)})}function Op(t,e,r){if(t!==0){r=r.slice(0,e);let n=typeof r[0]=="bigint"?BigInt(t):t;for(let i=-1,o=r.length;++i<o;)r[i]+=n}return r.subarray(0,e)}function vb(t,e){let r=0,n=t.length;if(n!==e.length)return!1;if(n>0)do if(t[r]!==e[r])return!1;while(++r<n);return!0}var _b,l$,u$,uc,ch,se,f$,h$,d$,m$,p$,g$,xb,y$,b$,w$,Sb,x$,_$,S$,M$,v$,E$,T$,A$,Mb,I$,P$,R$,L$,O$,ur=p(()=>{Ar();Qo();es();_b=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;l$=t=>Re(Int8Array,t),u$=t=>Re(Int16Array,t),uc=t=>Re(Int32Array,t),ch=t=>Re(BigInt64Array,t),se=t=>Re(Uint8Array,t),f$=t=>Re(Uint16Array,t),h$=t=>Re(Uint32Array,t),d$=t=>Re(BigUint64Array,t),m$=t=>Re(Float32Array,t),p$=t=>Re(Float64Array,t),g$=t=>Re(Uint8ClampedArray,t),xb=t=>(t.next(),t);y$=t=>po(Int8Array,t),b$=t=>po(Int16Array,t),w$=t=>po(Int32Array,t),Sb=t=>po(Uint8Array,t),x$=t=>po(Uint16Array,t),_$=t=>po(Uint32Array,t),S$=t=>po(Float32Array,t),M$=t=>po(Float64Array,t),v$=t=>po(Uint8ClampedArray,t);E$=t=>Bi(Int8Array,t),T$=t=>Bi(Int16Array,t),A$=t=>Bi(Int32Array,t),Mb=t=>Bi(Uint8Array,t),I$=t=>Bi(Uint16Array,t),P$=t=>Bi(Uint32Array,t),R$=t=>Bi(Float32Array,t),L$=t=>Bi(Float64Array,t),O$=t=>Bi(Uint8ClampedArray,t)});function*C$(t){let e,r=!1,n=[],i,o,s,a=0;function c(){return o==="peek"?zn(n,s)[0]:([i,n,a]=zn(n,s),i)}({cmd:o,size:s}=(yield null)||{cmd:"read",size:0});let l=Sb(t)[Symbol.iterator]();try{do if({done:e,value:i}=Number.isNaN(s-a)?l.next():l.next(s-a),!e&&i.byteLength>0&&(n.push(i),a+=i.byteLength),e||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!e)}catch(u){r=!0,typeof l.throw=="function"&&l.throw(u)}finally{r===!1&&typeof l.return=="function"&&l.return(null)}return null}function B$(t){return Xr(this,arguments,function*(){let r,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?zn(i,a)[0]:([o,i,c]=zn(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=Mb(t)[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 D$(t){return Xr(this,arguments,function*(){let r=!1,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?zn(i,a)[0]:([o,i,c]=zn(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=new Ab(t);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()):t.locked&&u.releaseLock()}return yield Me(null)})}function N$(t){return Xr(this,arguments,function*(){let r=[],n="error",i=!1,o=null,s,a,c=0,l=[],u;function h(){return s==="peek"?zn(l,a)[0]:([u,l,c]=zn(l,a),u)}if({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0},t.isTTY)return yield yield Me(new Uint8Array(0)),yield Me(null);try{r[0]=Tb(t,"end"),r[1]=Tb(t,"error");do{if(r[2]=Tb(t,"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(t.read(a-c)),u.byteLength<a-c&&(u=se(t.read()))):u=se(t.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)t.off(w,_);try{let w=t.destroy;w&&w.call(t,g),g=void 0}catch(w){g=w||g}finally{g!=null?b(g):y()}})}})}var fr,Cp,Ab,Tb,gu=p(()=>{Ar();ur();fr={fromIterable(t){return Cp(C$(t))},fromAsyncIterable(t){return Cp(B$(t))},fromDOMStream(t){return Cp(D$(t))},fromNodeStream(t){return Cp(N$(t))},toDOMStream(t,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(t,e){throw new Error('"toNodeStream" not available in this environment')}},Cp=t=>(t.next(),t);Ab=class{constructor(e){this.source=e,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(e){return $(this,void 0,void 0,function*(){let{reader:r,source:n}=this;r&&(yield r.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return $(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=yield this.reader.read();return!r.done&&(r.value=se(r)),r})}},Tb=(t,e)=>{let r=i=>n([e,i]),n;return[e,r,new Promise(i=>(n=i)&&t.once(e,r))]}});var ot,Bp=p(()=>{(function(t){t[t.V1=0]="V1",t[t.V2=1]="V2",t[t.V3=2]="V3",t[t.V4=3]="V4",t[t.V5=4]="V5"})(ot||(ot={}))});var Ze,Ib=p(()=>{(function(t){t[t.Sparse=0]="Sparse",t[t.Dense=1]="Dense"})(Ze||(Ze={}))});var rt,Pb=p(()=>{(function(t){t[t.HALF=0]="HALF",t[t.SINGLE=1]="SINGLE",t[t.DOUBLE=2]="DOUBLE"})(rt||(rt={}))});var ut,Rb=p(()=>{(function(t){t[t.DAY=0]="DAY",t[t.MILLISECOND=1]="MILLISECOND"})(ut||(ut={}))});var W,lh=p(()=>{(function(t){t[t.SECOND=0]="SECOND",t[t.MILLISECOND=1]="MILLISECOND",t[t.MICROSECOND=2]="MICROSECOND",t[t.NANOSECOND=3]="NANOSECOND"})(W||(W={}))});var qe,Lb=p(()=>{(function(t){t[t.YEAR_MONTH=0]="YEAR_MONTH",t[t.DAY_TIME=1]="DAY_TIME",t[t.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(qe||(qe={}))});var Dp=ae(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.SIZE_PREFIX_LENGTH=go.FILE_IDENTIFIER_LENGTH=go.SIZEOF_INT=go.SIZEOF_SHORT=void 0;go.SIZEOF_SHORT=2;go.SIZEOF_INT=4;go.FILE_IDENTIFIER_LENGTH=4;go.SIZE_PREFIX_LENGTH=4});var Ob=ae(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.isLittleEndian=di.float64=di.float32=di.int32=void 0;di.int32=new Int32Array(2);di.float32=new Float32Array(di.int32.buffer);di.float64=new Float64Array(di.int32.buffer);di.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var Cb=ae(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.Encoding=void 0;var JI;(function(t){t[t.UTF8_BYTES=1]="UTF8_BYTES",t[t.UTF16_STRING=2]="UTF16_STRING"})(JI||(Np.Encoding=JI={}))});var Db=ae(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.ByteBuffer=void 0;var yo=Dp(),F$=Cb(),_n=Ob(),Bb=class t{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new t(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return _n.int32[0]=this.readInt32(e),_n.float32[0]}readFloat64(e){return _n.int32[_n.isLittleEndian?0:1]=this.readInt32(e),_n.int32[_n.isLittleEndian?1:0]=this.readInt32(e+4),_n.float64[0]}writeInt8(e,r){this.bytes_[e]=r}writeUint8(e,r){this.bytes_[e]=r}writeInt16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeUint16(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8}writeInt32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeUint32(e,r){this.bytes_[e]=r,this.bytes_[e+1]=r>>8,this.bytes_[e+2]=r>>16,this.bytes_[e+3]=r>>24}writeInt64(e,r){this.writeInt32(e,Number(BigInt.asIntN(32,r))),this.writeInt32(e+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(e,r){this.writeUint32(e,Number(BigInt.asUintN(32,r))),this.writeUint32(e+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(e,r){_n.float32[0]=r,this.writeInt32(e,_n.int32[0])}writeFloat64(e,r){_n.float64[0]=r,this.writeInt32(e,_n.int32[_n.isLittleEndian?0:1]),this.writeInt32(e+4,_n.int32[_n.isLittleEndian?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+yo.SIZEOF_INT+yo.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let r=0;r<yo.FILE_IDENTIFIER_LENGTH;r++)e+=String.fromCharCode(this.readInt8(this.position_+yo.SIZEOF_INT+r));return e}__offset(e,r){let n=e-this.readInt32(e);return r<this.readInt16(n)?this.readInt16(n+r):0}__union(e,r){return e.bb_pos=r+this.readInt32(r),e.bb=this,e}__string(e,r){e+=this.readInt32(e);let n=this.readInt32(e);e+=yo.SIZEOF_INT;let i=this.bytes_.subarray(e,e+n);return r===F$.Encoding.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(e,r){return typeof e=="string"?this.__string(r):this.__union(e,r)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+yo.SIZEOF_INT}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=yo.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+yo.FILE_IDENTIFIER_LENGTH);for(let r=0;r<yo.FILE_IDENTIFIER_LENGTH;r++)if(e.charCodeAt(r)!=this.readInt8(this.position()+yo.SIZEOF_INT+r))return!1;return!0}createScalarList(e,r){let n=[];for(let i=0;i<r;++i){let o=e(i);o!==null&&n.push(o)}return n}createObjList(e,r){let n=[];for(let i=0;i<r;++i){let o=e(i);o!==null&&n.push(o.unpack())}return n}};Fp.ByteBuffer=Bb});var e6=ae(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});kp.Builder=void 0;var QI=Db(),qn=Dp(),Nb=class t{constructor(e){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;e?r=e:r=1024,this.bb=QI.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(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,r){e>this.minalign&&(this.minalign=e);let n=~(this.bb.capacity()-this.space+r)+1&e-1;for(;this.space<n+e+r;){let i=this.bb.capacity();this.bb=t.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)}pad(e){for(let r=0;r<e;r++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,r,n){(this.force_defaults||r!=n)&&(this.addInt8(r),this.slot(e))}addFieldInt16(e,r,n){(this.force_defaults||r!=n)&&(this.addInt16(r),this.slot(e))}addFieldInt32(e,r,n){(this.force_defaults||r!=n)&&(this.addInt32(r),this.slot(e))}addFieldInt64(e,r,n){(this.force_defaults||r!==n)&&(this.addInt64(r),this.slot(e))}addFieldFloat32(e,r,n){(this.force_defaults||r!=n)&&(this.addFloat32(r),this.slot(e))}addFieldFloat64(e,r,n){(this.force_defaults||r!=n)&&(this.addFloat64(r),this.slot(e))}addFieldOffset(e,r,n){(this.force_defaults||r!=n)&&(this.addOffset(r),this.slot(e))}addFieldStruct(e,r,n){r!=n&&(this.nested(r),this.slot(e))}nested(e){if(e!=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(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let r=e.capacity();if(r&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=r<<1,i=QI.ByteBuffer.allocate(n);return i.setPosition(n-r),i.bytes().set(e.bytes(),n-r),i}addOffset(e){this.prep(qn.SIZEOF_INT,0),this.writeInt32(this.offset()-e+qn.SIZEOF_INT)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let r=0;r<e;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 e=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?e-this.vtable[r]:0);let i=2;this.addInt16(e-this.object_start);let o=(n+i)*qn.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=qn.SIZEOF_SHORT;l<o;l+=qn.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()-e,this.bb.writeInt32(this.space,s-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,r,n){let i=n?qn.SIZE_PREFIX_LENGTH:0;if(r){let o=r;if(this.prep(this.minalign,qn.SIZEOF_INT+qn.FILE_IDENTIFIER_LENGTH+i),o.length!=qn.FILE_IDENTIFIER_LENGTH)throw new TypeError("FlatBuffers: file identifier must be length "+qn.FILE_IDENTIFIER_LENGTH);for(let s=qn.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,qn.SIZEOF_INT+i),this.addOffset(e),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,r){this.finish(e,r,!0)}requiredField(e,r){let n=this.bb.capacity()-e,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(e,r,n){this.notNested(),this.vector_num_elems=r,this.prep(qn.SIZEOF_INT,e*r),this.prep(n,e*r)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let r=this.createString(e);return this.string_maps.set(e,r),r}createString(e){if(e==null)return 0;let r;return e instanceof Uint8Array?r=e:r=this.text_encoder.encode(e),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(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let r=[];for(let n=0;n<e.length;++n){let i=e[n];if(i!==null)r.push(this.createObjectOffset(i));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return r}createStructOffsetList(e,r){return r(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}};kp.Builder=Nb});var Ve=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 Gp=Dp();Object.defineProperty(It,"FILE_IDENTIFIER_LENGTH",{enumerable:!0,get:function(){return Gp.FILE_IDENTIFIER_LENGTH}});Object.defineProperty(It,"SIZEOF_INT",{enumerable:!0,get:function(){return Gp.SIZEOF_INT}});Object.defineProperty(It,"SIZEOF_SHORT",{enumerable:!0,get:function(){return Gp.SIZEOF_SHORT}});Object.defineProperty(It,"SIZE_PREFIX_LENGTH",{enumerable:!0,get:function(){return Gp.SIZE_PREFIX_LENGTH}});var Up=Ob();Object.defineProperty(It,"float32",{enumerable:!0,get:function(){return Up.float32}});Object.defineProperty(It,"float64",{enumerable:!0,get:function(){return Up.float64}});Object.defineProperty(It,"int32",{enumerable:!0,get:function(){return Up.int32}});Object.defineProperty(It,"isLittleEndian",{enumerable:!0,get:function(){return Up.isLittleEndian}});var k$=e6();Object.defineProperty(It,"Builder",{enumerable:!0,get:function(){return k$.Builder}});var G$=Db();Object.defineProperty(It,"ByteBuffer",{enumerable:!0,get:function(){return G$.ByteBuffer}});var U$=Cb();Object.defineProperty(It,"Encoding",{enumerable:!0,get:function(){return U$.Encoding}})});var fc,Fb=p(()=>{(function(t){t[t.BUFFER=0]="BUFFER"})(fc||(fc={}))});var Ir,yu=p(()=>{(function(t){t[t.LZ4_FRAME=0]="LZ4_FRAME",t[t.ZSTD=1]="ZSTD"})(Ir||(Ir={}))});var t6,ts,kb=p(()=>{t6=me(Ve(),1);Fb();yu();ts=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBodyCompression(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,r){return e.setPosition(e.position()+t6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):Ir.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):fc.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,r){e.addFieldInt8(0,r,Ir.LZ4_FRAME)}static addMethod(e,r){e.addFieldInt8(1,r,fc.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,r,n){return t.startBodyCompression(e),t.addCodec(e,r),t.addMethod(e,n),t.endBodyCompression(e)}}});var bu,Gb=p(()=>{bu=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,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(e,r,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(r??0)),e.offset()}}});var wu,Ub=p(()=>{wu=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,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(e,r,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(r??0)),e.offset()}}});var r6,Cr,jb=p(()=>{r6=me(Ve(),1);kb();Gb();Ub();Cr=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsRecordBatch(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,r){return e.setPosition(e.position()+r6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new wu).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new bu).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let r=this.bb.__offset(this.bb_pos,10);return r?(e||new ts).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}variadicBufferCounts(e){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+e*8):BigInt(0)}variadicBufferCountsLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startRecordBatch(e){e.startObject(5)}static addLength(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addNodes(e,r){e.addFieldOffset(1,r,0)}static startNodesVector(e,r){e.startVector(16,r,8)}static addBuffers(e,r){e.addFieldOffset(2,r,0)}static startBuffersVector(e,r){e.startVector(16,r,8)}static addCompression(e,r){e.addFieldOffset(3,r,0)}static addVariadicBufferCounts(e,r){e.addFieldOffset(4,r,0)}static createVariadicBufferCountsVector(e,r){e.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)e.addInt64(r[n]);return e.endVector()}static startVariadicBufferCountsVector(e,r){e.startVector(8,r,8)}static endRecordBatch(e){return e.endObject()}}});var n6,rs,i6=p(()=>{n6=me(Ve(),1);jb();rs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDictionaryBatch(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,r){return e.setPosition(e.position()+n6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Cr).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addData(e,r){e.addFieldOffset(1,r,0)}static addIsDelta(e,r){e.addFieldInt8(2,+r,0)}static endDictionaryBatch(e){return e.endObject()}}});var Zs,zb=p(()=>{(function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"})(Zs||(Zs={}))});var uh,o6=p(()=>{(function(t){t[t.DenseArray=0]="DenseArray"})(uh||(uh={}))});var s6,Di,jp=p(()=>{s6=me(Ve(),1),Di=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsInt(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,r){return e.setPosition(e.position()+s6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,r){e.addFieldInt32(0,r,0)}static addIsSigned(e,r){e.addFieldInt8(1,+r,0)}static endInt(e){return e.endObject()}static createInt(e,r,n){return t.startInt(e),t.addBitWidth(e,r),t.addIsSigned(e,n),t.endInt(e)}}});var a6,bo,qb=p(()=>{a6=me(Ve(),1);o6();jp();bo=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDictionaryEncoding(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,r){return e.setPosition(e.position()+a6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Di).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):uh.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,r){e.addFieldInt64(0,r,BigInt("0"))}static addIndexType(e,r){e.addFieldOffset(1,r,0)}static addIsOrdered(e,r){e.addFieldInt8(2,+r,0)}static addDictionaryKind(e,r){e.addFieldInt16(3,r,uh.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}});var c6,Bt,xu=p(()=>{c6=me(Ve(),1),Bt=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsKeyValue(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,r){return e.setPosition(e.position()+c6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}key(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}value(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,r){e.addFieldOffset(0,r,0)}static addValue(e,r){e.addFieldOffset(1,r,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,r,n){return t.startKeyValue(e),t.addKey(e,r),t.addValue(e,n),t.endKeyValue(e)}}});var l6,fh,u6=p(()=>{l6=me(Ve(),1),fh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,r){return e.setPosition(e.position()+l6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return t.startBinary(e),t.endBinary(e)}}});var f6,hh,h6=p(()=>{f6=me(Ve(),1),hh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBinaryView(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinaryView(e,r){return e.setPosition(e.position()+f6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBinaryView(e){e.startObject(0)}static endBinaryView(e){return e.endObject()}static createBinaryView(e){return t.startBinaryView(e),t.endBinaryView(e)}}});var d6,dh,m6=p(()=>{d6=me(Ve(),1),dh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsBool(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,r){return e.setPosition(e.position()+d6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return t.startBool(e),t.endBool(e)}}});var p6,Js,Vb=p(()=>{p6=me(Ve(),1);Rb();Js=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDate(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,r){return e.setPosition(e.position()+p6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ut.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,ut.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,r){return t.startDate(e),t.addUnit(e,r),t.endDate(e)}}});var g6,wo,Wb=p(()=>{g6=me(Ve(),1),wo=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDecimal(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,r){return e.setPosition(e.position()+g6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,r){e.addFieldInt32(0,r,0)}static addScale(e,r){e.addFieldInt32(1,r,0)}static addBitWidth(e,r){e.addFieldInt32(2,r,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,r,n,i){return t.startDecimal(e),t.addPrecision(e,r),t.addScale(e,n),t.addBitWidth(e,i),t.endDecimal(e)}}});var y6,Qs,$b=p(()=>{y6=me(Ve(),1);lh();Qs=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsDuration(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,r){return e.setPosition(e.position()+y6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):W.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,W.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,r){return t.startDuration(e),t.addUnit(e,r),t.endDuration(e)}}});var b6,ea,Hb=p(()=>{b6=me(Ve(),1),ea=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFixedSizeBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,r){return e.setPosition(e.position()+b6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,r){e.addFieldInt32(0,r,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,r){return t.startFixedSizeBinary(e),t.addByteWidth(e,r),t.endFixedSizeBinary(e)}}});var w6,ta,Kb=p(()=>{w6=me(Ve(),1),ta=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFixedSizeList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,r){return e.setPosition(e.position()+w6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,r){e.addFieldInt32(0,r,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,r){return t.startFixedSizeList(e),t.addListSize(e,r),t.endFixedSizeList(e)}}});var x6,ra,Xb=p(()=>{x6=me(Ve(),1);Pb();ra=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFloatingPoint(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,r){return e.setPosition(e.position()+x6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):rt.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,r){e.addFieldInt16(0,r,rt.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,r){return t.startFloatingPoint(e),t.addPrecision(e,r),t.endFloatingPoint(e)}}});var _6,na,Yb=p(()=>{_6=me(Ve(),1);Lb();na=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsInterval(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,r){return e.setPosition(e.position()+_6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):qe.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,r){e.addFieldInt16(0,r,qe.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,r){return t.startInterval(e),t.addUnit(e,r),t.endInterval(e)}}});var S6,mh,M6=p(()=>{S6=me(Ve(),1),mh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeBinary(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,r){return e.setPosition(e.position()+S6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return t.startLargeBinary(e),t.endLargeBinary(e)}}});var v6,ph,E6=p(()=>{v6=me(Ve(),1),ph=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,r){return e.setPosition(e.position()+v6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return t.startLargeList(e),t.endLargeList(e)}}});var T6,gh,A6=p(()=>{T6=me(Ve(),1),gh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsLargeUtf8(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,r){return e.setPosition(e.position()+T6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return t.startLargeUtf8(e),t.endLargeUtf8(e)}}});var I6,yh,P6=p(()=>{I6=me(Ve(),1),yh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsList(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,r){return e.setPosition(e.position()+I6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return t.startList(e),t.endList(e)}}});var R6,ia,Zb=p(()=>{R6=me(Ve(),1),ia=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsMap(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,r){return e.setPosition(e.position()+R6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,r){e.addFieldInt8(0,+r,0)}static endMap(e){return e.endObject()}static createMap(e,r){return t.startMap(e),t.addKeysSorted(e,r),t.endMap(e)}}});var L6,bh,O6=p(()=>{L6=me(Ve(),1),bh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsNull(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,r){return e.setPosition(e.position()+L6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return t.startNull(e),t.endNull(e)}}});var C6,wh,B6=p(()=>{C6=me(Ve(),1),wh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsStruct_(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,r){return e.setPosition(e.position()+C6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return t.startStruct_(e),t.endStruct_(e)}}});var D6,ns,Jb=p(()=>{D6=me(Ve(),1);lh();ns=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsTime(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,r){return e.setPosition(e.position()+D6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):W.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,r){e.addFieldInt16(0,r,W.MILLISECOND)}static addBitWidth(e,r){e.addFieldInt32(1,r,32)}static endTime(e){return e.endObject()}static createTime(e,r,n){return t.startTime(e),t.addUnit(e,r),t.addBitWidth(e,n),t.endTime(e)}}});var N6,is,Qb=p(()=>{N6=me(Ve(),1);lh();is=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsTimestamp(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,r){return e.setPosition(e.position()+N6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):W.SECOND}timezone(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,r){e.addFieldInt16(0,r,W.SECOND)}static addTimezone(e,r){e.addFieldOffset(1,r,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,r,n){return t.startTimestamp(e),t.addUnit(e,r),t.addTimezone(e,n),t.endTimestamp(e)}}});var F6,Ni,ew=p(()=>{F6=me(Ve(),1);Ib();Ni=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUnion(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,r){return e.setPosition(e.position()+F6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ze.Sparse}typeIds(e){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readInt32(this.bb.__vector(this.bb_pos+r)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,r){e.addFieldInt16(0,r,Ze.Sparse)}static addTypeIds(e,r){e.addFieldOffset(1,r,0)}static createTypeIdsVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addInt32(r[n]);return e.endVector()}static startTypeIdsVector(e,r){e.startVector(4,r,4)}static endUnion(e){return e.endObject()}static createUnion(e,r,n){return t.startUnion(e),t.addMode(e,r),t.addTypeIds(e,n),t.endUnion(e)}}});var k6,xh,G6=p(()=>{k6=me(Ve(),1),xh=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUtf8(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,r){return e.setPosition(e.position()+k6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return t.startUtf8(e),t.endUtf8(e)}}});var U6,_h,j6=p(()=>{U6=me(Ve(),1),_h=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsUtf8View(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8View(e,r){return e.setPosition(e.position()+U6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8View(e){e.startObject(0)}static endUtf8View(e){return e.endObject()}static createUtf8View(e){return t.startUtf8View(e),t.endUtf8View(e)}}});var pe,zp=p(()=>{(function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.FloatingPoint=3]="FloatingPoint",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct_=13]="Struct_",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Duration=18]="Duration",t[t.LargeBinary=19]="LargeBinary",t[t.LargeUtf8=20]="LargeUtf8",t[t.LargeList=21]="LargeList",t[t.RunEndEncoded=22]="RunEndEncoded",t[t.BinaryView=23]="BinaryView",t[t.Utf8View=24]="Utf8View",t[t.ListView=25]="ListView",t[t.LargeListView=26]="LargeListView"})(pe||(pe={}))});var z6,Br,tw=p(()=>{z6=me(Ve(),1);qb();xu();zp();Br=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsField(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,r){return e.setPosition(e.position()+z6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}name(e){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):pe.NONE}type(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(e,this.bb_pos+r):null}dictionary(e){let r=this.bb.__offset(this.bb_pos,12);return r?(e||new bo).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(e,r){let n=this.bb.__offset(this.bb_pos,14);return n?(r||new t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,r){let n=this.bb.__offset(this.bb_pos,16);return n?(r||new Bt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,r){e.addFieldOffset(0,r,0)}static addNullable(e,r){e.addFieldInt8(1,+r,0)}static addTypeType(e,r){e.addFieldInt8(2,r,pe.NONE)}static addType(e,r){e.addFieldOffset(3,r,0)}static addDictionary(e,r){e.addFieldOffset(4,r,0)}static addChildren(e,r){e.addFieldOffset(5,r,0)}static createChildrenVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startChildrenVector(e,r){e.startVector(4,r,4)}static addCustomMetadata(e,r){e.addFieldOffset(6,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endField(e){return e.endObject()}}});var q6,Sn,rw=p(()=>{q6=me(Ve(),1);zb();tw();xu();Sn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsSchema(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,r){return e.setPosition(e.position()+q6.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Zs.Little}fields(e,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new Br).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Bt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,r){e.addFieldInt16(0,r,Zs.Little)}static addFields(e,r){e.addFieldOffset(1,r,0)}static createFieldsVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startFieldsVector(e,r){e.startVector(4,r,4)}static addCustomMetadata(e,r){e.addFieldOffset(2,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static addFeatures(e,r){e.addFieldOffset(3,r,0)}static createFeaturesVector(e,r){e.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)e.addInt64(r[n]);return e.endVector()}static startFeaturesVector(e,r){e.startVector(8,r,8)}static endSchema(e){return e.endObject()}static createSchema(e,r,n,i,o){return t.startSchema(e),t.addEndianness(e,r),t.addFields(e,n),t.addCustomMetadata(e,i),t.addFeatures(e,o),t.endSchema(e)}}});var ke,qp=p(()=>{(function(t){t[t.NONE=0]="NONE",t[t.Schema=1]="Schema",t[t.DictionaryBatch=2]="DictionaryBatch",t[t.RecordBatch=3]="RecordBatch",t[t.Tensor=4]="Tensor",t[t.SparseTensor=5]="SparseTensor"})(ke||(ke={}))});var x,Ne,Dt=p(()=>{Bp();Ib();Pb();Rb();lh();Lb();qp();(function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Duration=18]="Duration",t[t.LargeBinary=19]="LargeBinary",t[t.LargeUtf8=20]="LargeUtf8",t[t.LargeList=21]="LargeList",t[t.BinaryView=23]="BinaryView",t[t.Utf8View=24]="Utf8View",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth",t[t.DurationSecond=-27]="DurationSecond",t[t.DurationMillisecond=-28]="DurationMillisecond",t[t.DurationMicrosecond=-29]="DurationMicrosecond",t[t.DurationNanosecond=-30]="DurationNanosecond",t[t.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(x||(x={}));(function(t){t[t.OFFSET=0]="OFFSET",t[t.DATA=1]="DATA",t[t.VALIDITY=2]="VALIDITY",t[t.TYPE=3]="TYPE"})(Ne||(Ne={}))});var nw={};Jt(nw,{valueToString:()=>Fi});function Fi(t){if(t===null)return"null";if(t===void 0)return"undefined";switch(typeof t){case"number":return`${t}`;case"bigint":return`${t}`;case"string":return`"${t}"`}return typeof t[Symbol.toPrimitive]=="function"?t[Symbol.toPrimitive]("string"):ArrayBuffer.isView(t)?t instanceof BigInt64Array||t instanceof BigUint64Array?`[${[...t].map(e=>Fi(e))}]`:`[${t}]`:ArrayBuffer.isView(t)?`[${t}]`:JSON.stringify(t,(e,r)=>typeof r=="bigint"?`${r}`:r)}var Sh=p(()=>{});function Le(t){if(typeof t=="bigint"&&(t<Number.MIN_SAFE_INTEGER||t>Number.MAX_SAFE_INTEGER))throw new TypeError(`${t} is not safe to convert to a number.`);return Number(t)}function iw(t,e){return Le(t/e)+Le(t%e)/Le(e)}var xo=p(()=>{});var aw={};Jt(aw,{BN:()=>hc,bigNumToBigInt:()=>W6,bigNumToNumber:()=>sw,bigNumToString:()=>Mu,isArrowBigNumSymbol:()=>V6});function ki(t,...e){return e.length===0?Object.setPrototypeOf(Re(this.TypedArray,t),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(t,...e),this.constructor.prototype)}function _u(...t){return ki.apply(this,t)}function Su(...t){return ki.apply(this,t)}function Mh(...t){return ki.apply(this,t)}function sw(t,e){let{buffer:r,byteOffset:n,byteLength:i,signed:o}=t,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^z$)*(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 e=="number"&&e>0){let u=BigInt("1".padEnd(e+1,"0")),h=c/u,d=a?-(c%u):c%u,m=Le(h),g=`${d}`.padStart(e,"0");return+`${a&&m===0?"-":""}${m}.${g}`}return Le(c)}function Mu(t){if(t.byteLength===8)return`${new t.BigIntArray(t.buffer,t.byteOffset,1)[0]}`;if(!t.signed)return ow(t);let e=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return ow(t);e=e.slice();let n=1;for(let o=0;o<e.length;o++){let s=e[o],a=~s+n;e[o]=a,n&=s===0?1:0}return`-${ow(e)}`}function W6(t){return t.byteLength===8?new t.BigIntArray(t.buffer,t.byteOffset,1)[0]:Mu(t)}function ow(t){let e="",r=new Uint32Array(2),n=new Uint16Array(t.buffer,t.byteOffset,t.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,e=`${r[0]}${e}`}while(i[0]||i[1]||i[2]||i[3]);return e??"0"}var V6,j$,z$,hc,Vp=p(()=>{ur();xo();V6=Symbol.for("isArrowBigNum");ki.prototype[V6]=!0;ki.prototype.toJSON=function(){return`"${Mu(this)}"`};ki.prototype.valueOf=function(t){return sw(this,t)};ki.prototype.toString=function(){return Mu(this)};ki.prototype[Symbol.toPrimitive]=function(t="default"){switch(t){case"number":return sw(this);case"string":return Mu(this);case"default":return W6(this)}return Mu(this)};Object.setPrototypeOf(_u.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Su.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Mh.prototype,Object.create(Uint32Array.prototype));Object.assign(_u.prototype,ki.prototype,{constructor:_u,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Su.prototype,ki.prototype,{constructor:Su,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Mh.prototype,ki.prototype,{constructor:Mh,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});j$=BigInt(4294967296)*BigInt(4294967296),z$=j$-BigInt(1);hc=class t{static new(e,r){switch(r){case!0:return new _u(e);case!1:return new Su(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new _u(e)}return e.byteLength===16?new Mh(e):new Su(e)}static signed(e){return new _u(e)}static unsigned(e){return new Su(e)}static decimal(e){return new Mh(e)}constructor(e,r){return t.new(e,r)}}});function Xn(t){let e=t;switch(t.typeId){case x.Decimal:return t.bitWidth/32;case x.Interval:return e.unit===qe.MONTH_DAY_NANO?4:1+e.unit;case x.BinaryView:case x.Utf8View:return 16;case x.FixedSizeList:return e.listSize;case x.FixedSizeBinary:return e.byteWidth;default:return 1}}var $6,H6,K6,X6,Y6,Z6,J6,Q6,e5,t5,r5,n5,i5,o5,s5,a5,c5,l5,u5,f5,h5,d5,m5,p5,g5,y5,j,Xt,Wt,Gi,Ui,hr,mi,ji,zi,Vn,_o,Zr,So,Mn,pi,Wn,Ee,qi,Jr,Qr,Vi,en,$n,vn,dc,mc,Dr,pc,gc,yc,bc,Nr,wc,os,xc,_c,tn,Sc,Mc,vh,rn,Eh,Th,Ah,Ih,dr,Hn,Qe,nn,vc,Ec,Kn,Yt,on,q$,mr,st=p(()=>{xo();Dt();y5=Symbol.for("apache-arrow/DataType"),j=class t{static isDataType(e){return(e==null?void 0:e[y5])===!0}static isNull(e){return(e==null?void 0:e.typeId)===x.Null}static isInt(e){return(e==null?void 0:e.typeId)===x.Int}static isFloat(e){return(e==null?void 0:e.typeId)===x.Float}static isBinary(e){return(e==null?void 0:e.typeId)===x.Binary}static isBinaryView(e){return(e==null?void 0:e.typeId)===x.BinaryView}static isLargeBinary(e){return(e==null?void 0:e.typeId)===x.LargeBinary}static isUtf8(e){return(e==null?void 0:e.typeId)===x.Utf8}static isUtf8View(e){return(e==null?void 0:e.typeId)===x.Utf8View}static isLargeUtf8(e){return(e==null?void 0:e.typeId)===x.LargeUtf8}static isBool(e){return(e==null?void 0:e.typeId)===x.Bool}static isDecimal(e){return(e==null?void 0:e.typeId)===x.Decimal}static isDate(e){return(e==null?void 0:e.typeId)===x.Date}static isTime(e){return(e==null?void 0:e.typeId)===x.Time}static isTimestamp(e){return(e==null?void 0:e.typeId)===x.Timestamp}static isInterval(e){return(e==null?void 0:e.typeId)===x.Interval}static isDuration(e){return(e==null?void 0:e.typeId)===x.Duration}static isList(e){return(e==null?void 0:e.typeId)===x.List}static isLargeList(e){return(e==null?void 0:e.typeId)===x.LargeList}static isStruct(e){return(e==null?void 0:e.typeId)===x.Struct}static isUnion(e){return(e==null?void 0:e.typeId)===x.Union}static isFixedSizeBinary(e){return(e==null?void 0:e.typeId)===x.FixedSizeBinary}static isFixedSizeList(e){return(e==null?void 0:e.typeId)===x.FixedSizeList}static isMap(e){return(e==null?void 0:e.typeId)===x.Map}static isDictionary(e){return(e==null?void 0:e.typeId)===x.Dictionary}static isDenseUnion(e){return t.isUnion(e)&&e.mode===Ze.Dense}static isSparseUnion(e){return t.isUnion(e)&&e.mode===Ze.Sparse}constructor(e){this.typeId=e}};$6=Symbol.toStringTag;j[$6]=(t=>(t.children=null,t.ArrayType=Array,t.OffsetArrayType=Int32Array,t[y5]=!0,t[Symbol.toStringTag]="DataType"))(j.prototype);Xt=class extends j{constructor(){super(x.Null)}toString(){return"Null"}};H6=Symbol.toStringTag;Xt[H6]=(t=>t[Symbol.toStringTag]="Null")(Xt.prototype);Wt=class extends j{constructor(e,r){super(x.Int),this.isSigned=e,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}`}};K6=Symbol.toStringTag;Wt[K6]=(t=>(t.isSigned=null,t.bitWidth=null,t[Symbol.toStringTag]="Int"))(Wt.prototype);Gi=class extends Wt{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Ui=class extends Wt{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},hr=class extends Wt{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},mi=class extends Wt{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},ji=class extends Wt{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},zi=class extends Wt{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Vn=class extends Wt{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},_o=class extends Wt{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Gi.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Ui.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(hr.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(mi.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(ji.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(zi.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Vn.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(_o.prototype,"ArrayType",{value:BigUint64Array});Zr=class extends j{constructor(e){super(x.Float),this.precision=e}get ArrayType(){switch(this.precision){case rt.HALF:return Uint16Array;case rt.SINGLE:return Float32Array;case rt.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};X6=Symbol.toStringTag;Zr[X6]=(t=>(t.precision=null,t[Symbol.toStringTag]="Float"))(Zr.prototype);So=class extends Zr{constructor(){super(rt.HALF)}},Mn=class extends Zr{constructor(){super(rt.SINGLE)}},pi=class extends Zr{constructor(){super(rt.DOUBLE)}};Object.defineProperty(So.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Mn.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(pi.prototype,"ArrayType",{value:Float64Array});Wn=class extends j{constructor(){super(x.Binary)}toString(){return"Binary"}};Y6=Symbol.toStringTag;Wn[Y6]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Binary"))(Wn.prototype);Ee=class extends j{constructor(){super(x.BinaryView)}toString(){return"BinaryView"}};Z6=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[Z6]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="BinaryView"))(Ee.prototype);qi=class extends j{constructor(){super(x.LargeBinary)}toString(){return"LargeBinary"}};J6=Symbol.toStringTag;qi[J6]=(t=>(t.ArrayType=Uint8Array,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeBinary"))(qi.prototype);Jr=class extends j{constructor(){super(x.Utf8)}toString(){return"Utf8"}};Q6=Symbol.toStringTag;Jr[Q6]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8"))(Jr.prototype);Qr=class extends j{constructor(){super(x.Utf8View)}toString(){return"Utf8View"}};e5=Symbol.toStringTag;Qr.ELEMENT_WIDTH=Ee.ELEMENT_WIDTH;Qr.INLINE_CAPACITY=Ee.INLINE_CAPACITY;Qr[e5]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8View"))(Qr.prototype);Vi=class extends j{constructor(){super(x.LargeUtf8)}toString(){return"LargeUtf8"}};t5=Symbol.toStringTag;Vi[t5]=(t=>(t.ArrayType=Uint8Array,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeUtf8"))(Vi.prototype);en=class extends j{constructor(){super(x.Bool)}toString(){return"Bool"}};r5=Symbol.toStringTag;en[r5]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Bool"))(en.prototype);$n=class extends j{constructor(e,r,n=128){super(x.Decimal),this.scale=e,this.precision=r,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};n5=Symbol.toStringTag;$n[n5]=(t=>(t.scale=null,t.precision=null,t.ArrayType=Uint32Array,t[Symbol.toStringTag]="Decimal"))($n.prototype);vn=class extends j{constructor(e){super(x.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${ut[this.unit]}>`}get ArrayType(){return this.unit===ut.DAY?Int32Array:BigInt64Array}};i5=Symbol.toStringTag;vn[i5]=(t=>(t.unit=null,t[Symbol.toStringTag]="Date"))(vn.prototype);dc=class extends vn{constructor(){super(ut.DAY)}},mc=class extends vn{constructor(){super(ut.MILLISECOND)}},Dr=class extends j{constructor(e,r){super(x.Time),this.unit=e,this.bitWidth=r}toString(){return`Time${this.bitWidth}<${W[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};o5=Symbol.toStringTag;Dr[o5]=(t=>(t.unit=null,t.bitWidth=null,t[Symbol.toStringTag]="Time"))(Dr.prototype);pc=class extends Dr{constructor(){super(W.SECOND,32)}},gc=class extends Dr{constructor(){super(W.MILLISECOND,32)}},yc=class extends Dr{constructor(){super(W.MICROSECOND,64)}},bc=class extends Dr{constructor(){super(W.NANOSECOND,64)}},Nr=class extends j{constructor(e,r){super(x.Timestamp),this.unit=e,this.timezone=r}toString(){return`Timestamp<${W[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};s5=Symbol.toStringTag;Nr[s5]=(t=>(t.unit=null,t.timezone=null,t.ArrayType=BigInt64Array,t[Symbol.toStringTag]="Timestamp"))(Nr.prototype);wc=class extends Nr{constructor(e){super(W.SECOND,e)}},os=class extends Nr{constructor(e){super(W.MILLISECOND,e)}},xc=class extends Nr{constructor(e){super(W.MICROSECOND,e)}},_c=class extends Nr{constructor(e){super(W.NANOSECOND,e)}},tn=class extends j{constructor(e){super(x.Interval),this.unit=e}toString(){return`Interval<${qe[this.unit]}>`}};a5=Symbol.toStringTag;tn[a5]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Interval"))(tn.prototype);Sc=class extends tn{constructor(){super(qe.DAY_TIME)}},Mc=class extends tn{constructor(){super(qe.YEAR_MONTH)}},vh=class extends tn{constructor(){super(qe.MONTH_DAY_NANO)}},rn=class extends j{constructor(e){super(x.Duration),this.unit=e}toString(){return`Duration<${W[this.unit]}>`}};c5=Symbol.toStringTag;rn[c5]=(t=>(t.unit=null,t.ArrayType=BigInt64Array,t[Symbol.toStringTag]="Duration"))(rn.prototype);Eh=class extends rn{constructor(){super(W.SECOND)}},Th=class extends rn{constructor(){super(W.MILLISECOND)}},Ah=class extends rn{constructor(){super(W.MICROSECOND)}},Ih=class extends rn{constructor(){super(W.NANOSECOND)}},dr=class extends j{constructor(e){super(x.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};l5=Symbol.toStringTag;dr[l5]=(t=>(t.children=null,t[Symbol.toStringTag]="List"))(dr.prototype);Hn=class extends j{constructor(e){super(x.LargeList),this.children=[e]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};u5=Symbol.toStringTag;Hn[u5]=(t=>(t.children=null,t.OffsetArrayType=BigInt64Array,t[Symbol.toStringTag]="LargeList"))(Hn.prototype);Qe=class extends j{constructor(e){super(x.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};f5=Symbol.toStringTag;Qe[f5]=(t=>(t.children=null,t[Symbol.toStringTag]="Struct"))(Qe.prototype);nn=class extends j{constructor(e,r,n){super(x.Union),this.mode=e,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(e=>`${e.type}`).join(" | ")}>`}};h5=Symbol.toStringTag;nn[h5]=(t=>(t.mode=null,t.typeIds=null,t.children=null,t.typeIdToChildIndex=null,t.ArrayType=Int8Array,t[Symbol.toStringTag]="Union"))(nn.prototype);vc=class extends nn{constructor(e,r){super(Ze.Dense,e,r)}},Ec=class extends nn{constructor(e,r){super(Ze.Sparse,e,r)}},Kn=class extends j{constructor(e){super(x.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};d5=Symbol.toStringTag;Kn[d5]=(t=>(t.byteWidth=null,t.ArrayType=Uint8Array,t[Symbol.toStringTag]="FixedSizeBinary"))(Kn.prototype);Yt=class extends j{constructor(e,r){super(x.FixedSizeList),this.listSize=e,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}>`}};m5=Symbol.toStringTag;Yt[m5]=(t=>(t.children=null,t.listSize=null,t[Symbol.toStringTag]="FixedSizeList"))(Yt.prototype);on=class extends j{constructor(e,r=!1){var n,i,o;if(super(x.Map),this.children=[e],this.keysSorted=r,e&&(e.name="entries",!((n=e==null?void 0:e.type)===null||n===void 0)&&n.children)){let s=(i=e==null?void 0:e.type)===null||i===void 0?void 0:i.children[0];s&&(s.name="key");let a=(o=e==null?void 0:e.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(e=>`${e.name}:${e.type}`).join(", ")}}>`}};p5=Symbol.toStringTag;on[p5]=(t=>(t.children=null,t.keysSorted=null,t[Symbol.toStringTag]="Map_"))(on.prototype);q$=(t=>()=>++t)(-1),mr=class extends j{constructor(e,r,n,i){super(x.Dictionary),this.indices=r,this.dictionary=e,this.isOrdered=i||!1,this.id=n==null?q$():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}>`}};g5=Symbol.toStringTag;mr[g5]=(t=>(t.id=null,t.indices=null,t.isOrdered=null,t.dictionary=null,t[Symbol.toStringTag]="Dictionary"))(mr.prototype)});function V$(t,e,r=!0){return typeof e=="number"?vu(t,e,r):typeof e=="string"&&e in x?vu(t,x[e],r):e&&e instanceof j?vu(t,w5(e),r):e!=null&&e.type&&e.type instanceof j?vu(t,w5(e.type),r):vu(t,x.NONE,r)}function vu(t,e,r=!0){let n=null;switch(e){case x.Null:n=t.visitNull;break;case x.Bool:n=t.visitBool;break;case x.Int:n=t.visitInt;break;case x.Int8:n=t.visitInt8||t.visitInt;break;case x.Int16:n=t.visitInt16||t.visitInt;break;case x.Int32:n=t.visitInt32||t.visitInt;break;case x.Int64:n=t.visitInt64||t.visitInt;break;case x.Uint8:n=t.visitUint8||t.visitInt;break;case x.Uint16:n=t.visitUint16||t.visitInt;break;case x.Uint32:n=t.visitUint32||t.visitInt;break;case x.Uint64:n=t.visitUint64||t.visitInt;break;case x.Float:n=t.visitFloat;break;case x.Float16:n=t.visitFloat16||t.visitFloat;break;case x.Float32:n=t.visitFloat32||t.visitFloat;break;case x.Float64:n=t.visitFloat64||t.visitFloat;break;case x.Utf8:n=t.visitUtf8;break;case x.LargeUtf8:n=t.visitLargeUtf8;break;case x.Utf8View:n=t.visitUtf8View||t.visitUtf8;break;case x.Binary:n=t.visitBinary;break;case x.LargeBinary:n=t.visitLargeBinary;break;case x.BinaryView:n=t.visitBinaryView||t.visitBinary;break;case x.FixedSizeBinary:n=t.visitFixedSizeBinary;break;case x.Date:n=t.visitDate;break;case x.DateDay:n=t.visitDateDay||t.visitDate;break;case x.DateMillisecond:n=t.visitDateMillisecond||t.visitDate;break;case x.Timestamp:n=t.visitTimestamp;break;case x.TimestampSecond:n=t.visitTimestampSecond||t.visitTimestamp;break;case x.TimestampMillisecond:n=t.visitTimestampMillisecond||t.visitTimestamp;break;case x.TimestampMicrosecond:n=t.visitTimestampMicrosecond||t.visitTimestamp;break;case x.TimestampNanosecond:n=t.visitTimestampNanosecond||t.visitTimestamp;break;case x.Time:n=t.visitTime;break;case x.TimeSecond:n=t.visitTimeSecond||t.visitTime;break;case x.TimeMillisecond:n=t.visitTimeMillisecond||t.visitTime;break;case x.TimeMicrosecond:n=t.visitTimeMicrosecond||t.visitTime;break;case x.TimeNanosecond:n=t.visitTimeNanosecond||t.visitTime;break;case x.Decimal:n=t.visitDecimal;break;case x.List:n=t.visitList;break;case x.LargeList:n=t.visitLargeList;break;case x.Struct:n=t.visitStruct;break;case x.Union:n=t.visitUnion;break;case x.DenseUnion:n=t.visitDenseUnion||t.visitUnion;break;case x.SparseUnion:n=t.visitSparseUnion||t.visitUnion;break;case x.Dictionary:n=t.visitDictionary;break;case x.Interval:n=t.visitInterval;break;case x.IntervalDayTime:n=t.visitIntervalDayTime||t.visitInterval;break;case x.IntervalYearMonth:n=t.visitIntervalYearMonth||t.visitInterval;break;case x.IntervalMonthDayNano:n=t.visitIntervalMonthDayNano||t.visitInterval;break;case x.Duration:n=t.visitDuration;break;case x.DurationSecond:n=t.visitDurationSecond||t.visitDuration;break;case x.DurationMillisecond:n=t.visitDurationMillisecond||t.visitDuration;break;case x.DurationMicrosecond:n=t.visitDurationMicrosecond||t.visitDuration;break;case x.DurationNanosecond:n=t.visitDurationNanosecond||t.visitDuration;break;case x.FixedSizeList:n=t.visitFixedSizeList;break;case x.Map:n=t.visitMap;break}if(typeof n=="function")return n;if(!r)return()=>null;throw new Error(`Unrecognized type '${x[e]}'`)}function w5(t){switch(t.typeId){case x.Null:return x.Null;case x.Int:{let{bitWidth:e,isSigned:r}=t;switch(e){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(t.precision){case rt.HALF:return x.Float16;case rt.SINGLE:return x.Float32;case rt.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(t.unit){case W.SECOND:return x.TimeSecond;case W.MILLISECOND:return x.TimeMillisecond;case W.MICROSECOND:return x.TimeMicrosecond;case W.NANOSECOND:return x.TimeNanosecond}return x.Time;case x.Timestamp:switch(t.unit){case W.SECOND:return x.TimestampSecond;case W.MILLISECOND:return x.TimestampMillisecond;case W.MICROSECOND:return x.TimestampMicrosecond;case W.NANOSECOND:return x.TimestampNanosecond}return x.Timestamp;case x.Date:switch(t.unit){case ut.DAY:return x.DateDay;case ut.MILLISECOND:return x.DateMillisecond}return x.Date;case x.Interval:switch(t.unit){case qe.DAY_TIME:return x.IntervalDayTime;case qe.YEAR_MONTH:return x.IntervalYearMonth;case qe.MONTH_DAY_NANO:return x.IntervalMonthDayNano}return x.Interval;case x.Duration:switch(t.unit){case W.SECOND:return x.DurationSecond;case W.MILLISECOND:return x.DurationMillisecond;case W.MICROSECOND:return x.DurationMicrosecond;case W.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(t.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[t.typeId]}'`)}var ie,En=p(()=>{Dt();st();ie=class{visitMany(e,...r){return e.map((n,i)=>this.visit(n,...r.map(o=>o[i])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,r=!0){return V$(this,e,r)}getVisitFnByTypeId(e,r=!0){return vu(this,e,r)}visitNull(e,...r){return null}visitBool(e,...r){return null}visitInt(e,...r){return null}visitFloat(e,...r){return null}visitUtf8(e,...r){return null}visitLargeUtf8(e,...r){return null}visitUtf8View(e,...r){return null}visitBinary(e,...r){return null}visitLargeBinary(e,...r){return null}visitBinaryView(e,...r){return null}visitFixedSizeBinary(e,...r){return null}visitDate(e,...r){return null}visitTimestamp(e,...r){return null}visitTime(e,...r){return null}visitDecimal(e,...r){return null}visitList(e,...r){return null}visitLargeList(e,...r){return null}visitStruct(e,...r){return null}visitUnion(e,...r){return null}visitDictionary(e,...r){return null}visitInterval(e,...r){return null}visitDuration(e,...r){return null}visitFixedSizeList(e,...r){return null}visitMap(e,...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 cw={};Jt(cw,{float64ToUint16:()=>Ph,uint16ToFloat64:()=>Wp});function Wp(t){let e=(t&31744)>>10,r=(t&1023)/1024,n=Math.pow(-1,(t&32768)>>15);switch(e){case 31:return n*(r?Number.NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*Math.pow(2,e-15)*(1+r)}function Ph(t){if(t!==t)return 32256;x5[0]=t;let e=(Eu[1]&2147483648)>>16&65535,r=Eu[1]&2146435072,n=0;return r>=1089470464?Eu[0]>0?r=31744:(r=(r&2080374784)>>16,n=(Eu[1]&1048575)>>10):r<=1056964608?(n=1048576+(Eu[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(Eu[1]&1048575)+512>>10),e|r|n&65535}var x5,Eu,Rh=p(()=>{x5=new Float64Array(1),Eu=new Uint32Array(x5.buffer)});function be(t){return(e,r,n)=>{if(e.setValid(r,n!=null))return t(e,r,n)}}var he,W$,_5,$$,ss,lw,S5,H$,$p,Hp,uw,M5,K$,v5,X$,E5,Y$,fw,Kp,Xp,Yp,Zp,hw,Jp,Qp,e0,t0,dw,mw,T5,Z$,J$,Q$,eH,tH,rH,nH,A5,I5,iH,pw,r0,n0,i0,o0,s0,a0,c0,gw,oH,Pr,Yn=p(()=>{Fr();En();xo();Qo();Rh();Dt();st();he=class extends ie{};W$=(t,e,r)=>{t[e]=Math.floor(r/864e5)},_5=(t,e,r,n)=>{if(r+1<e.length){let i=Le(e[r]),o=Le(e[r+1]);t.set(n.subarray(0,o-i),i)}},$$=({offset:t,values:e},r,n)=>{let i=t+r;n?e[i>>3]|=1<<i%8:e[i>>3]&=~(1<<i%8)},ss=({values:t},e,r)=>{t[e]=r},lw=({values:t},e,r)=>{t[e]=r},S5=({values:t},e,r)=>{t[e]=Ph(r)},H$=(t,e,r)=>{switch(t.type.precision){case rt.HALF:return S5(t,e,r);case rt.SINGLE:case rt.DOUBLE:return lw(t,e,r)}},$p=({values:t},e,r)=>{W$(t,e,r.valueOf())},Hp=({values:t},e,r)=>{t[e]=BigInt(r)},uw=({stride:t,values:e},r,n)=>{e.set(n.subarray(0,t),t*r)},M5=({values:t,valueOffsets:e},r,n)=>_5(t,e,r,n),K$=t=>{let e=t.variadicBuffers;return(!Array.isArray(e)||Object.isFrozen(e))&&(e=Array.from(e),t.variadicBuffers=e),e},v5=(t,e,r)=>{var n,i,o,s;let a=t.values;if(!a)throw new Error("BinaryView data is missing view buffer");let c=Ee.ELEMENT_WIDTH,l=e*c,u=l+c;if(l<0||u>a.length)throw new RangeError(`BinaryView index ${e} 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=K$(t),y=r.slice(),b=g.push(y)-1;h.setInt32(Ee.BUFFER_INDEX_OFFSET,b,!0),h.setInt32(Ee.BUFFER_OFFSET_OFFSET,0,!0)},X$=(t,e,r)=>{let n=r instanceof Uint8Array?r:new Uint8Array(r);v5(t,e,n)},E5=({values:t,valueOffsets:e},r,n)=>_5(t,e,r,Gn(n)),Y$=(t,e,r)=>{let n=Gn(r);v5(t,e,n)},fw=(t,e,r)=>{t.type.unit===ut.DAY?$p(t,e,r):Hp(t,e,r)},Kp=({values:t},e,r)=>{t[e]=BigInt(r/1e3)},Xp=({values:t},e,r)=>{t[e]=BigInt(r)},Yp=({values:t},e,r)=>{t[e]=BigInt(r*1e3)},Zp=({values:t},e,r)=>{t[e]=BigInt(r*1e6)},hw=(t,e,r)=>{switch(t.type.unit){case W.SECOND:return Kp(t,e,r);case W.MILLISECOND:return Xp(t,e,r);case W.MICROSECOND:return Yp(t,e,r);case W.NANOSECOND:return Zp(t,e,r)}},Jp=({values:t},e,r)=>{t[e]=r},Qp=({values:t},e,r)=>{t[e]=r},e0=({values:t},e,r)=>{t[e]=r},t0=({values:t},e,r)=>{t[e]=r},dw=(t,e,r)=>{switch(t.type.unit){case W.SECOND:return Jp(t,e,r);case W.MILLISECOND:return Qp(t,e,r);case W.MICROSECOND:return e0(t,e,r);case W.NANOSECOND:return t0(t,e,r)}},mw=({values:t,stride:e},r,n)=>{t.set(n.subarray(0,e),e*r)},T5=(t,e,r)=>{let n=t.children[0],i=t.valueOffsets,o=Pr.getVisitFn(n),s=Le(i[e]),a=Le(i[e+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))},Z$=(t,e,r)=>{let n=t.children[0],{valueOffsets:i}=t,o=Pr.getVisitFn(n),{[e]:s,[e+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},J$=(t,e)=>(r,n,i,o)=>n&&r(n,t,e[o]),Q$=(t,e)=>(r,n,i,o)=>n&&r(n,t,e.get(o)),eH=(t,e)=>(r,n,i,o)=>n&&r(n,t,e.get(i.name)),tH=(t,e)=>(r,n,i,o)=>n&&r(n,t,e[i.name]),rH=(t,e,r)=>{let n=t.type.children.map(o=>Pr.getVisitFn(o.type)),i=r instanceof Map?eH(e,r):r instanceof H?Q$(e,r):Array.isArray(r)?J$(e,r):tH(e,r);t.type.children.forEach((o,s)=>i(n[s],t.children[s],o,s))},nH=(t,e,r)=>{t.type.mode===Ze.Dense?A5(t,e,r):I5(t,e,r)},A5=(t,e,r)=>{let n=t.type.typeIdToChildIndex[t.typeIds[e]],i=t.children[n];Pr.visit(i,t.valueOffsets[e],r)},I5=(t,e,r)=>{let n=t.type.typeIdToChildIndex[t.typeIds[e]],i=t.children[n];Pr.visit(i,e,r)},iH=(t,e,r)=>{var n;(n=t.dictionary)===null||n===void 0||n.set(t.values[e],r)},pw=(t,e,r)=>{switch(t.type.unit){case qe.YEAR_MONTH:return n0(t,e,r);case qe.DAY_TIME:return r0(t,e,r);case qe.MONTH_DAY_NANO:return i0(t,e,r)}},r0=({values:t},e,r)=>{t.set(r.subarray(0,2),2*e)},n0=({values:t},e,r)=>{t[e]=r[0]*12+r[1]%12},i0=({values:t,stride:e},r,n)=>{t.set(n.subarray(0,e),e*r)},o0=({values:t},e,r)=>{t[e]=r},s0=({values:t},e,r)=>{t[e]=r},a0=({values:t},e,r)=>{t[e]=r},c0=({values:t},e,r)=>{t[e]=r},gw=(t,e,r)=>{switch(t.type.unit){case W.SECOND:return o0(t,e,r);case W.MILLISECOND:return s0(t,e,r);case W.MICROSECOND:return a0(t,e,r);case W.NANOSECOND:return c0(t,e,r)}},oH=(t,e,r)=>{let{stride:n}=t,i=t.children[0],o=Pr.getVisitFn(i);if(Array.isArray(r))for(let s=-1,a=e*n;++s<n;)o(i,a+s,r[s]);else for(let s=-1,a=e*n;++s<n;)o(i,a+s,r.get(s))};he.prototype.visitBool=be($$);he.prototype.visitInt=be(ss);he.prototype.visitInt8=be(ss);he.prototype.visitInt16=be(ss);he.prototype.visitInt32=be(ss);he.prototype.visitInt64=be(ss);he.prototype.visitUint8=be(ss);he.prototype.visitUint16=be(ss);he.prototype.visitUint32=be(ss);he.prototype.visitUint64=be(ss);he.prototype.visitFloat=be(H$);he.prototype.visitFloat16=be(S5);he.prototype.visitFloat32=be(lw);he.prototype.visitFloat64=be(lw);he.prototype.visitUtf8=be(E5);he.prototype.visitLargeUtf8=be(E5);he.prototype.visitUtf8View=be(Y$);he.prototype.visitBinary=be(M5);he.prototype.visitLargeBinary=be(M5);he.prototype.visitBinaryView=be(X$);he.prototype.visitFixedSizeBinary=be(uw);he.prototype.visitDate=be(fw);he.prototype.visitDateDay=be($p);he.prototype.visitDateMillisecond=be(Hp);he.prototype.visitTimestamp=be(hw);he.prototype.visitTimestampSecond=be(Kp);he.prototype.visitTimestampMillisecond=be(Xp);he.prototype.visitTimestampMicrosecond=be(Yp);he.prototype.visitTimestampNanosecond=be(Zp);he.prototype.visitTime=be(dw);he.prototype.visitTimeSecond=be(Jp);he.prototype.visitTimeMillisecond=be(Qp);he.prototype.visitTimeMicrosecond=be(e0);he.prototype.visitTimeNanosecond=be(t0);he.prototype.visitDecimal=be(mw);he.prototype.visitList=be(T5);he.prototype.visitLargeList=be(T5);he.prototype.visitStruct=be(rH);he.prototype.visitUnion=be(nH);he.prototype.visitDenseUnion=be(A5);he.prototype.visitSparseUnion=be(I5);he.prototype.visitDictionary=be(iH);he.prototype.visitInterval=be(pw);he.prototype.visitIntervalDayTime=be(r0);he.prototype.visitIntervalYearMonth=be(n0);he.prototype.visitIntervalMonthDayNano=be(i0);he.prototype.visitDuration=be(gw);he.prototype.visitDurationSecond=be(o0);he.prototype.visitDurationMillisecond=be(s0);he.prototype.visitDurationMicrosecond=be(a0);he.prototype.visitDurationNanosecond=be(c0);he.prototype.visitFixedSizeList=be(oH);he.prototype.visitMap=be(Z$);Pr=new he});var Wi,Tu,Mo,yw,bw,sH,l0=p(()=>{Sh();Tc();Yn();Wi=Symbol.for("parent"),Tu=Symbol.for("rowIndex"),Mo=class{constructor(e,r){return this[Wi]=e,this[Tu]=r,new Proxy(this,sH)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Tu],r=this[Wi],n=r.type.children,i={};for(let o=-1,s=n.length;++o<s;)i[n[o].name]=tr.visit(r.children[o],e);return i}toString(){return`{${[...this].map(([e,r])=>`${Fi(e)}: ${Fi(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new yw(this[Wi],this[Tu])}},yw=class{constructor(e,r){this.childIndex=0,this.children=e.children,this.rowIndex=r,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,tr.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(Mo.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Wi]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Tu]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});bw=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Wi].type.children.map(r=>r.name)}has(e,r){return e[Wi].type.children.some(n=>n.name===r)}getOwnPropertyDescriptor(e,r){if(e[Wi].type.children.some(n=>n.name===r))return{writable:!0,enumerable:!0,configurable:!0}}get(e,r){if(Reflect.has(e,r))return e[r];let n=e[Wi].type.children.findIndex(i=>i.name===r);if(n!==-1){let i=tr.visit(e[Wi].children[n],e[Tu]);return Reflect.set(e,r,i),i}}set(e,r,n){let i=e[Wi].type.children.findIndex(o=>o.name===r);return i!==-1?(Pr.visit(e[Wi].children[i],e[Tu],n),Reflect.set(e,r,n)):Reflect.has(e,r)||typeof r=="symbol"?Reflect.set(e,r,n):!1}},sH=new bw});function ge(t){return(e,r)=>e.getValid(r)?t(e,r):null}var ce,aH,Au,cH,lH,P5,uH,R5,L5,oa,fH,O5,hH,C5,B5,dH,D5,mH,pH,gH,yH,N5,F5,k5,G5,bH,U5,j5,z5,q5,wH,xH,V5,_H,SH,MH,W5,$5,vH,EH,H5,K5,X5,Y5,Z5,J5,Q5,TH,AH,tr,Tc=p(()=>{Vp();Fr();En();Lh();l0();xo();Qo();Rh();Dt();ce=class extends ie{};aH=(t,e)=>864e5*t[e],Au=16,cH=12,lH=(t,e)=>null,P5=(t,e,r)=>{if(r+1>=e.length)return null;let n=Le(e[r]),i=Le(e[r+1]);return t.subarray(n,i)},uH=({offset:t,values:e},r)=>{let n=t+r;return(e[n>>3]&1<<n%8)!==0},R5=({values:t},e)=>aH(t,e),L5=({values:t},e)=>Le(t[e]),oa=({stride:t,values:e},r)=>e[t*r],fH=({stride:t,values:e},r)=>Wp(e[t*r]),O5=({values:t},e)=>t[e],hH=({stride:t,values:e},r)=>e.subarray(t*r,t*(r+1)),C5=({values:t,valueOffsets:e},r)=>P5(t,e,r),B5=(t,e)=>{var r;let n=t.values;if(!n)throw new Error("BinaryView data is missing view buffer");let i=e*Au,o=i+Au;if(i<0||o>n.length)throw new Error(`BinaryView data buffer is too short: expected ${Au} bytes, got ${Math.max(0,n.length-i)}`);let s=n.subarray(i,o);if(s.length<Au)throw new Error(`BinaryView data buffer is too short: expected ${Au} bytes, got ${s.length}`);let a=new DataView(n.buffer,s.byteOffset,Au),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=cH)return s.subarray(4,4+c);let l=a.getInt32(8,!0),u=a.getInt32(12,!0),h=(r=t.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)},dH=(t,e)=>B5(t,e),D5=({values:t,valueOffsets:e},r)=>{let n=P5(t,e,r);return n!==null?pu(n):null},mH=(t,e)=>{let r=B5(t,e);return pu(r)},pH=({values:t},e)=>t[e],gH=({type:t,values:e},r)=>t.precision!==rt.HALF?e[r]:Wp(e[r]),yH=(t,e)=>t.type.unit===ut.DAY?R5(t,e):L5(t,e),N5=({values:t},e)=>1e3*Le(t[e]),F5=({values:t},e)=>Le(t[e]),k5=({values:t},e)=>iw(t[e],BigInt(1e3)),G5=({values:t},e)=>iw(t[e],BigInt(1e6)),bH=(t,e)=>{switch(t.type.unit){case W.SECOND:return N5(t,e);case W.MILLISECOND:return F5(t,e);case W.MICROSECOND:return k5(t,e);case W.NANOSECOND:return G5(t,e)}},U5=({values:t},e)=>t[e],j5=({values:t},e)=>t[e],z5=({values:t},e)=>t[e],q5=({values:t},e)=>t[e],wH=(t,e)=>{switch(t.type.unit){case W.SECOND:return U5(t,e);case W.MILLISECOND:return j5(t,e);case W.MICROSECOND:return z5(t,e);case W.NANOSECOND:return q5(t,e)}},xH=({values:t,stride:e},r)=>hc.decimal(t.subarray(e*r,e*(r+1))),V5=(t,e)=>{let{valueOffsets:r,stride:n,children:i}=t,o=Le(r[e*n]),s=Le(r[e*n+1]),c=i[0].slice(o,s-o);return new H([c])},_H=(t,e)=>{let{valueOffsets:r,children:n}=t,{[e]:i,[e+1]:o}=r,s=n[0];return new gi(s.slice(i,o-i))},SH=(t,e)=>new Mo(t,e),MH=(t,e)=>t.type.mode===Ze.Dense?W5(t,e):$5(t,e),W5=(t,e)=>{let r=t.type.typeIdToChildIndex[t.typeIds[e]],n=t.children[r];return tr.visit(n,t.valueOffsets[e])},$5=(t,e)=>{let r=t.type.typeIdToChildIndex[t.typeIds[e]],n=t.children[r];return tr.visit(n,e)},vH=(t,e)=>{var r;return(r=t.dictionary)===null||r===void 0?void 0:r.get(t.values[e])},EH=(t,e)=>t.type.unit===qe.MONTH_DAY_NANO?X5(t,e):t.type.unit===qe.DAY_TIME?H5(t,e):K5(t,e),H5=({values:t},e)=>t.subarray(2*e,2*(e+1)),K5=({values:t},e)=>{let r=t[e],n=new Int32Array(2);return n[0]=Math.trunc(r/12),n[1]=Math.trunc(r%12),n},X5=({values:t},e)=>t.subarray(4*e,4*(e+1)),Y5=({values:t},e)=>t[e],Z5=({values:t},e)=>t[e],J5=({values:t},e)=>t[e],Q5=({values:t},e)=>t[e],TH=(t,e)=>{switch(t.type.unit){case W.SECOND:return Y5(t,e);case W.MILLISECOND:return Z5(t,e);case W.MICROSECOND:return J5(t,e);case W.NANOSECOND:return Q5(t,e)}},AH=(t,e)=>{let{stride:r,children:n}=t,o=n[0].slice(e*r,r);return new H([o])};ce.prototype.visitNull=ge(lH);ce.prototype.visitBool=ge(uH);ce.prototype.visitInt=ge(pH);ce.prototype.visitInt8=ge(oa);ce.prototype.visitInt16=ge(oa);ce.prototype.visitInt32=ge(oa);ce.prototype.visitInt64=ge(O5);ce.prototype.visitUint8=ge(oa);ce.prototype.visitUint16=ge(oa);ce.prototype.visitUint32=ge(oa);ce.prototype.visitUint64=ge(O5);ce.prototype.visitFloat=ge(gH);ce.prototype.visitFloat16=ge(fH);ce.prototype.visitFloat32=ge(oa);ce.prototype.visitFloat64=ge(oa);ce.prototype.visitUtf8=ge(D5);ce.prototype.visitLargeUtf8=ge(D5);ce.prototype.visitUtf8View=ge(mH);ce.prototype.visitBinary=ge(C5);ce.prototype.visitLargeBinary=ge(C5);ce.prototype.visitBinaryView=ge(dH);ce.prototype.visitFixedSizeBinary=ge(hH);ce.prototype.visitDate=ge(yH);ce.prototype.visitDateDay=ge(R5);ce.prototype.visitDateMillisecond=ge(L5);ce.prototype.visitTimestamp=ge(bH);ce.prototype.visitTimestampSecond=ge(N5);ce.prototype.visitTimestampMillisecond=ge(F5);ce.prototype.visitTimestampMicrosecond=ge(k5);ce.prototype.visitTimestampNanosecond=ge(G5);ce.prototype.visitTime=ge(wH);ce.prototype.visitTimeSecond=ge(U5);ce.prototype.visitTimeMillisecond=ge(j5);ce.prototype.visitTimeMicrosecond=ge(z5);ce.prototype.visitTimeNanosecond=ge(q5);ce.prototype.visitDecimal=ge(xH);ce.prototype.visitList=ge(V5);ce.prototype.visitLargeList=ge(V5);ce.prototype.visitStruct=ge(SH);ce.prototype.visitUnion=ge(MH);ce.prototype.visitDenseUnion=ge(W5);ce.prototype.visitSparseUnion=ge($5);ce.prototype.visitDictionary=ge(vH);ce.prototype.visitInterval=ge(EH);ce.prototype.visitIntervalDayTime=ge(H5);ce.prototype.visitIntervalYearMonth=ge(K5);ce.prototype.visitIntervalMonthDayNano=ge(X5);ce.prototype.visitDuration=ge(TH);ce.prototype.visitDurationSecond=ge(Y5);ce.prototype.visitDurationMillisecond=ge(Z5);ce.prototype.visitDurationMicrosecond=ge(J5);ce.prototype.visitDurationNanosecond=ge(Q5);ce.prototype.visitFixedSizeList=ge(AH);ce.prototype.visitMap=ge(_H);tr=new ce});var sa,Pu,Iu,ww,gi,xw,_w,Lh=p(()=>{Fr();Sh();Tc();Yn();sa=Symbol.for("keys"),Pu=Symbol.for("vals"),Iu=Symbol.for("kKeysAsStrings"),ww=Symbol.for("_kKeysAsStrings"),gi=class{constructor(e){return this[sa]=new H([e.children[0]]).memoize(),this[Pu]=e.children[1],new Proxy(this,new _w)}get[Iu](){return this[ww]||(this[ww]=Array.from(this[sa].toArray(),String))}[Symbol.iterator](){return new xw(this[sa],this[Pu])}get size(){return this[sa].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[sa],r=this[Pu],n={};for(let i=-1,o=e.length;++i<o;)n[e.get(i)]=tr.visit(r,i);return n}toString(){return`{${[...this].map(([e,r])=>`${Fi(e)}: ${Fi(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},xw=class{constructor(e,r){this.keys=e,this.vals=r,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),tr.visit(this.vals,e)]})}},_w=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Iu]}has(e,r){return e[Iu].includes(r)}getOwnPropertyDescriptor(e,r){if(e[Iu].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,r){if(Reflect.has(e,r))return e[r];let n=e[Iu].indexOf(r);if(n!==-1){let i=tr.visit(Reflect.get(e,Pu),n);return Reflect.set(e,r,i),i}}set(e,r,n){let i=e[Iu].indexOf(r);return i!==-1?(Pr.visit(Reflect.get(e,Pu),i,n),Reflect.set(e,r,n)):Reflect.has(e,r)?Reflect.set(e,r,n):!1}};Object.defineProperties(gi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[sa]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Pu]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ww]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var Sw={};Jt(Sw,{clampRange:()=>Oh,createElementComparator:()=>aa,wrapIndex:()=>Ac});function Oh(t,e,r,n){let{length:i=0}=t,o=typeof e!="number"?0:e,s=typeof r!="number"?i:r;return o<0&&(o=(o%i+i)%i),s<0&&(s=(s%i+i)%i),s<o&&(eP=o,o=s,s=eP),s>i&&(s=i),n?n(t,o,s):[o,s]}function aa(t){if(typeof t!=="object"||t===null)return tP(t)?tP:r=>r===t;if(t instanceof Date){let r=t.valueOf();return n=>n instanceof Date?n.valueOf()===r:!1}return ArrayBuffer.isView(t)?r=>r?vb(t,r):!1:t instanceof Map?PH(t):Array.isArray(t)?IH(t):t instanceof H?RH(t):LH(t,!0)}function IH(t){let e=[];for(let r=-1,n=t.length;++r<n;)e[r]=aa(t[r]);return u0(e)}function PH(t){let e=-1,r=[];for(let n of t.values())r[++e]=aa(n);return u0(r)}function RH(t){let e=[];for(let r=-1,n=t.length;++r<n;)e[r]=aa(t.get(r));return u0(e)}function LH(t,e=!1){let r=Object.keys(t);if(!e&&r.length===0)return()=>!1;let n=[];for(let i=-1,o=r.length;++i<o;)n[i]=aa(t[r[i]]);return u0(n,r)}function u0(t,e){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return OH(t,r);case Map:return rP(t,r,r.keys());case gi:case Mo:case Object:case void 0:return rP(t,r,e||Object.keys(r))}return r instanceof H?CH(t,r):!1}}function OH(t,e){let r=t.length;if(e.length!==r)return!1;for(let n=-1;++n<r;)if(!t[n](e[n]))return!1;return!0}function CH(t,e){let r=t.length;if(e.length!==r)return!1;for(let n=-1;++n<r;)if(!t[n](e.get(n)))return!1;return!0}function rP(t,e,r){let n=r[Symbol.iterator](),i=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),o=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),s=0,a=t.length,c=o.next(),l=n.next(),u=i.next();for(;s<a&&!l.done&&!u.done&&!c.done&&!(l.value!==u.value||!t[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 eP,Ac,tP,Ru=p(()=>{Fr();Lh();l0();ur();Ac=(t,e)=>t<0?e+t:t,tP=t=>t!==t});var Mw={};Jt(Mw,{BitIterator:()=>vo,getBit:()=>h0,getBool:()=>Lu,packBools:()=>Pc,popcnt_array:()=>nP,popcnt_bit_range:()=>Ch,popcnt_uint32:()=>f0,setBool:()=>BH,truncateBitmap:()=>Ic});function Lu(t,e,r,n){return(r&1<<n)!==0}function h0(t,e,r,n){return(r&1<<n)>>n}function BH(t,e,r){return r?!!(t[e>>3]|=1<<e%8)||!0:!(t[e>>3]&=~(1<<e%8))&&!1}function Ic(t,e,r){let n=r.byteLength+7&-8;if(t>0||r.byteLength<n){let i=new Uint8Array(n);return i.set(t%8===0?r.subarray(t>>3):Pc(new vo(r,t,e,null,Lu)).subarray(0,n)),i}return r}function Pc(t){let e=[],r=0,n=0,i=0;for(let s of t)s&&(i|=1<<n),++n===8&&(e[r++]=i,i=n=0);(r===0||n>0)&&(e[r++]=i);let o=new Uint8Array(e.length+7&-8);return o.set(e),o}function Ch(t,e,r){if(r-e<=0)return 0;if(r-e<8){let o=0;for(let s of new vo(t,e,r-e,t,h0))o+=s;return o}let n=r>>3<<3,i=e+(e%8===0?0:8-e%8);return Ch(t,e,i)+Ch(t,n,r)+nP(t,i>>3,n-i>>3)}function nP(t,e,r){let n=0,i=Math.trunc(e),o=new DataView(t.buffer,t.byteOffset,t.byteLength),s=r===void 0?t.byteLength:i+r;for(;s-i>=4;)n+=f0(o.getUint32(i)),i+=4;for(;s-i>=2;)n+=f0(o.getUint16(i)),i+=2;for(;s-i>=1;)n+=f0(o.getUint8(i)),i+=1;return n}function f0(t){let e=Math.trunc(t);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var vo,Rc=p(()=>{vo=class{constructor(e,r,n,i,o){this.bytes=e,this.length=n,this.context=i,this.get=o,this.bit=r%8,this.byteIndex=r>>3,this.byte=e[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(t){return NH.visit(t)}var DH,iP,de,vw,NH,yi=p(()=>{Fr();Dt();st();Rc();st();En();ur();DH=-1,iP=Symbol.for("apache-arrow/Data"),de=class t{static isData(e){return(e==null?void 0:e[iP])===!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:e}=this;return j.isSparseUnion(e)?this.children.some(r=>r.nullable):j.isDenseUnion(e)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:r,values:n,nullBitmap:i,typeIds:o}=this;return r&&(e+=r.byteLength),n&&(e+=n.byteLength),i&&(e+=i.byteLength),o&&(e+=o.byteLength),e+=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,e)}get nullCount(){if(j.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let e=this._nullCount,r;return e<=DH&&(r=this.nullBitmap)&&(this._nullCount=e=r.length===0?0:this.length-Ch(r,this.offset,this.offset+this.length)),e}constructor(e,r,n,i,o,s=[],a,c=[]){var l;this.type=e,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 t?(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=Xn(e),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(e){let{type:r}=this;if(j.isUnion(r)){let n=r,i=this.typeIds[e],o=n.typeIdToChildIndex[i],s=this.children[o],a=this.valueOffsets,c=n.mode===Ze.Dense&&a?Number(a[e]):e;return s.getValid(c)}if(this.nullable&&this.nullCount>0){let n=this.offset+e;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(e,r){let n,{type:i}=this;if(j.isUnion(i)){let o=i,s=this.typeIds[e],a=o.typeIdToChildIndex[s],c=this.children[a],l=this.valueOffsets,u=o.mode===Ze.Dense&&l?Number(l[e]):e;n=c.getValid(u),c.setValid(u,r)}else{let{nullBitmap:o}=this,{offset:s,length:a}=this,c=s+e,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(Ic(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(e=this.type,r=this.offset,n=this.length,i=this._nullCount,o=this,s=this.children,a=this.variadicBuffers){return new t(e,r,n,i,o,s,this.dictionary,a)}slice(e,r){let{stride:n,typeId:i,children:o}=this,s=+(this._nullCount===0)-1,a=i===16?n:1,c=this._sliceBuffers(e,r,n,i);return this.clone(this.type,this.offset+e,r,s,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*e,a*r),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===x.Null)return this.clone(this.type,0,e,0,this.buffers,this.children,this.variadicBuffers);let{length:r,nullCount:n}=this,i=new Uint8Array((e+63&-64)>>3).fill(255,0,r>>3);i[r>>3]=(1<<r-(r&-8))-1,n>0&&i.set(Ic(this.offset,r,this.nullBitmap),0);let o=this.buffers;return o[Ne.VALIDITY]=i,this.clone(this.type,0,e,n+(e-r),o,this.children,this.variadicBuffers)}_sliceBuffers(e,r,n,i){let o,{buffers:s}=this;if((o=s[Ne.TYPE])&&(s[Ne.TYPE]=o.subarray(e,e+r)),j.isBinaryView(this.type)||j.isUtf8View(this.type)){let a=Ee.ELEMENT_WIDTH;(o=s[Ne.DATA])&&(s[Ne.DATA]=o.subarray(e*a,(e+r)*a))}else(o=s[Ne.OFFSET])&&(s[Ne.OFFSET]=o.subarray(e,e+r+1))||(o=s[Ne.DATA])&&(s[Ne.DATA]=i===6?o:o.subarray(n*e,n*(e+r)));return s}_sliceChildren(e,r,n){return e.map(i=>i.slice(r,n))}};de.prototype.children=Object.freeze([]);de.prototype[iP]=!0;Object.defineProperty(de,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===de&&de.isData(e)}});vw=class t extends ie{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:r,["offset"]:n=0,["length"]:i=0}=e;return new de(r,n,i,i)}visitBool(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length>>3,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new de(r,n,s,a,[void 0,o,i])}visitInt(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new de(r,n,s,a,[void 0,o,i])}visitFloat(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new de(r,n,s,a,[void 0,o,i])}visitUtf8(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.data),o=se(e.nullBitmap),s=uc(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new de(r,n,a,c,[s,i,o])}visitUtf8View(e){var r;let{["type"]:n,["offset"]:i=0}=e,o=Re(n.ArrayType,e.views),s=se(e.nullBitmap),a=(e.variadicBuffers||[]).map(u=>se(u)),c=(r=e.length)!==null&&r!==void 0?r:Math.trunc(o.length/Qr.ELEMENT_WIDTH),l=e.nullBitmap?-1:0;return new de(n,i,c,l,[void 0,o,s],[],void 0,a)}visitLargeUtf8(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.data),o=se(e.nullBitmap),s=ch(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new de(r,n,a,c,[s,i,o])}visitBinary(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.data),o=se(e.nullBitmap),s=uc(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new de(r,n,a,c,[s,i,o])}visitBinaryView(e){var r;let{["type"]:n,["offset"]:i=0}=e,o=Re(n.ArrayType,e.views),s=se(e.nullBitmap),a=(e.variadicBuffers||[]).map(u=>se(u)),c=(r=e.length)!==null&&r!==void 0?r:Math.trunc(o.length/Ee.ELEMENT_WIDTH),l=e.nullBitmap?-1:0;return new de(n,i,c,l,[void 0,o,s],[],void 0,a)}visitLargeBinary(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.data),o=se(e.nullBitmap),s=ch(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new de(r,n,a,c,[s,i,o])}visitFixedSizeBinary(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length/Xn(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new de(r,n,s,a,[void 0,o,i])}visitDate(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length/Xn(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new de(r,n,s,a,[void 0,o,i])}visitTimestamp(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length/Xn(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new de(r,n,s,a,[void 0,o,i])}visitTime(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length/Xn(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new de(r,n,s,a,[void 0,o,i])}visitDecimal(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length/Xn(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new de(r,n,s,a,[void 0,o,i])}visitList(e){let{["type"]:r,["offset"]:n=0,["child"]:i}=e,o=se(e.nullBitmap),s=uc(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new de(r,n,a,c,[s,void 0,o],[i])}visitLargeList(e){let{["type"]:r,["offset"]:n=0,["child"]:i}=e,o=se(e.nullBitmap),s=ch(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new de(r,n,a,c,[s,void 0,o],[i])}visitStruct(e){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=e,o=se(e.nullBitmap),{length:s=i.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=e.nullBitmap?-1:0}=e;return new de(r,n,s,a,[void 0,void 0,o],i)}visitUnion(e){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=e,o=Re(r.ArrayType,e.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=e;if(j.isSparseUnion(r))return new de(r,n,s,a,[void 0,void 0,void 0,o],i);let c=uc(e.valueOffsets);return new de(r,n,s,a,[c,void 0,void 0,o],i)}visitDictionary(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.indices.ArrayType,e.data),{["dictionary"]:s=new H([new t().visit({type:r.dictionary})])}=e,{["length"]:a=o.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new de(r,n,a,c,[void 0,o,i],[],s)}visitInterval(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length/Xn(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new de(r,n,s,a,[void 0,o,i])}visitDuration(e){let{["type"]:r,["offset"]:n=0}=e,i=se(e.nullBitmap),o=Re(r.ArrayType,e.data),{["length"]:s=o.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new de(r,n,s,a,[void 0,o,i])}visitFixedSizeList(e){let{["type"]:r,["offset"]:n=0,["child"]:i=new t().visit({type:r.valueType})}=e,o=se(e.nullBitmap),{["length"]:s=i.length/Xn(r),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new de(r,n,s,a,[void 0,void 0,o],[i])}visitMap(e){let{["type"]:r,["offset"]:n=0,["child"]:i=new t().visit({type:r.childType})}=e,o=se(e.nullBitmap),s=uc(e.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new de(r,n,a,c,[s,void 0,o],[i])}},NH=new vw});function oP(t){return t.some(e=>e.nullable)}function d0(t){return t.reduce((e,r)=>e+r.nullCount,0)}function m0(t){return t.reduce((e,r,n)=>(e[n+1]=e[n]+r.length,e),new Uint32Array(t.length+1))}function p0(t,e,r,n){let i=[];for(let o=-1,s=t.length;++o<s;){let a=t[o],c=e[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(t[0].slice(0,0)),i}function Ew(t,e,r,n){let i=0,o=0,s=e.length-1;do{if(i>=s-1)return r<e[s]?n(t,i,r-e[i]):null;o=i+Math.trunc((s-i)*.5),r<e[o]?s=o:i=o}while(i<s)}function Dh(t,e){return t.getValid(e)}function Ou(t){function e(r,n,i){return t(r[n],i)}return function(r){let n=this.data;return Ew(n,this._offsets,r,e)}}function g0(t){let e;function r(n,i,o){return t(n[i],o,e)}return function(n,i){let o=this.data;e=i;let s=Ew(o,this._offsets,n,r);return e=void 0,s}}function y0(t){let e;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=t(h,e,s)))return c+a;s=0,c+=h.length}return-1}return function(n,i){e=n;let o=this.data,s=typeof i!="number"?r(o,0,0):Ew(o,this._offsets,i,r);return e=void 0,s}}var Bh,b0=p(()=>{Bh=class{constructor(e=0,r){this.numChunks=e,this.getChunkIterator=r,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function FH(t,e){return e===null&&t.length>0?0:-1}function kH(t,e){let{nullBitmap:r}=t;if(!r||t.nullCount<=0)return-1;let n=0;for(let i of new vo(r,t.offset+(e||0),t.length,r,Lu)){if(!i)return n;++n}return-1}function xe(t,e,r){if(e===void 0)return-1;if(e===null)switch(t.typeId){case x.Union:break;case x.Dictionary:break;default:return kH(t,r)}let n=tr.getVisitFn(t),i=aa(e);for(let o=(r||0)-1,s=t.length;++o<s;)if(i(n(t,o)))return o;return-1}function sP(t,e,r){let n=tr.getVisitFn(t),i=aa(e);for(let o=(r||0)-1,s=t.length;++o<s;)if(i(n(t,o)))return o;return-1}var le,Lc,w0=p(()=>{Dt();En();Tc();Rc();Ru();le=class extends ie{};le.prototype.visitNull=FH;le.prototype.visitBool=xe;le.prototype.visitInt=xe;le.prototype.visitInt8=xe;le.prototype.visitInt16=xe;le.prototype.visitInt32=xe;le.prototype.visitInt64=xe;le.prototype.visitUint8=xe;le.prototype.visitUint16=xe;le.prototype.visitUint32=xe;le.prototype.visitUint64=xe;le.prototype.visitFloat=xe;le.prototype.visitFloat16=xe;le.prototype.visitFloat32=xe;le.prototype.visitFloat64=xe;le.prototype.visitUtf8=xe;le.prototype.visitLargeUtf8=xe;le.prototype.visitUtf8View=xe;le.prototype.visitBinary=xe;le.prototype.visitLargeBinary=xe;le.prototype.visitBinaryView=xe;le.prototype.visitFixedSizeBinary=xe;le.prototype.visitDate=xe;le.prototype.visitDateDay=xe;le.prototype.visitDateMillisecond=xe;le.prototype.visitTimestamp=xe;le.prototype.visitTimestampSecond=xe;le.prototype.visitTimestampMillisecond=xe;le.prototype.visitTimestampMicrosecond=xe;le.prototype.visitTimestampNanosecond=xe;le.prototype.visitTime=xe;le.prototype.visitTimeSecond=xe;le.prototype.visitTimeMillisecond=xe;le.prototype.visitTimeMicrosecond=xe;le.prototype.visitTimeNanosecond=xe;le.prototype.visitDecimal=xe;le.prototype.visitList=xe;le.prototype.visitLargeList=xe;le.prototype.visitStruct=xe;le.prototype.visitUnion=xe;le.prototype.visitDenseUnion=sP;le.prototype.visitSparseUnion=sP;le.prototype.visitDictionary=xe;le.prototype.visitInterval=xe;le.prototype.visitIntervalDayTime=xe;le.prototype.visitIntervalYearMonth=xe;le.prototype.visitIntervalMonthDayNano=xe;le.prototype.visitDuration=xe;le.prototype.visitDurationSecond=xe;le.prototype.visitDurationMillisecond=xe;le.prototype.visitDurationMicrosecond=xe;le.prototype.visitDurationNanosecond=xe;le.prototype.visitFixedSizeList=xe;le.prototype.visitMap=xe;Lc=new le});function ye(t){let{type:e}=t;if(t.nullCount===0&&t.stride===1&&(j.isInt(e)&&e.bitWidth!==64||j.isTime(e)&&e.bitWidth!==64||j.isFloat(e)&&e.precision!==rt.HALF))return new Bh(t.data.length,n=>{let i=t.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let r=0;return new Bh(t.data.length,n=>{let o=t.data[n].length,s=t.slice(r,r+o);return r+=o,new Tw(s)})}var ue,Tw,Cu,x0=p(()=>{En();Dt();st();b0();ue=class extends ie{};Tw=class{constructor(e){this.vector=e,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};ue.prototype.visitNull=ye;ue.prototype.visitBool=ye;ue.prototype.visitInt=ye;ue.prototype.visitInt8=ye;ue.prototype.visitInt16=ye;ue.prototype.visitInt32=ye;ue.prototype.visitInt64=ye;ue.prototype.visitUint8=ye;ue.prototype.visitUint16=ye;ue.prototype.visitUint32=ye;ue.prototype.visitUint64=ye;ue.prototype.visitFloat=ye;ue.prototype.visitFloat16=ye;ue.prototype.visitFloat32=ye;ue.prototype.visitFloat64=ye;ue.prototype.visitUtf8=ye;ue.prototype.visitLargeUtf8=ye;ue.prototype.visitUtf8View=ye;ue.prototype.visitBinary=ye;ue.prototype.visitLargeBinary=ye;ue.prototype.visitBinaryView=ye;ue.prototype.visitFixedSizeBinary=ye;ue.prototype.visitDate=ye;ue.prototype.visitDateDay=ye;ue.prototype.visitDateMillisecond=ye;ue.prototype.visitTimestamp=ye;ue.prototype.visitTimestampSecond=ye;ue.prototype.visitTimestampMillisecond=ye;ue.prototype.visitTimestampMicrosecond=ye;ue.prototype.visitTimestampNanosecond=ye;ue.prototype.visitTime=ye;ue.prototype.visitTimeSecond=ye;ue.prototype.visitTimeMillisecond=ye;ue.prototype.visitTimeMicrosecond=ye;ue.prototype.visitTimeNanosecond=ye;ue.prototype.visitDecimal=ye;ue.prototype.visitList=ye;ue.prototype.visitLargeList=ye;ue.prototype.visitStruct=ye;ue.prototype.visitUnion=ye;ue.prototype.visitDenseUnion=ye;ue.prototype.visitSparseUnion=ye;ue.prototype.visitDictionary=ye;ue.prototype.visitInterval=ye;ue.prototype.visitIntervalDayTime=ye;ue.prototype.visitIntervalYearMonth=ye;ue.prototype.visitIntervalMonthDayNano=ye;ue.prototype.visitDuration=ye;ue.prototype.visitDurationSecond=ye;ue.prototype.visitDurationMillisecond=ye;ue.prototype.visitDurationMicrosecond=ye;ue.prototype.visitDurationNanosecond=ye;ue.prototype.visitFixedSizeList=ye;ue.prototype.visitMap=ye;Cu=new ue});function Eo(t){if(t){if(t instanceof de)return new H([t]);if(t instanceof H)return new H(t.data);if(t.type instanceof j)return new H([te(t)]);if(Array.isArray(t))return new H(t.flatMap(e=>GH(e)));if(ArrayBuffer.isView(t)){t instanceof DataView&&(t=new Uint8Array(t.buffer));let e={offset:0,length:t.length,nullCount:-1,data:t};if(t instanceof Int8Array)return new H([te(Object.assign(Object.assign({},e),{type:new Gi}))]);if(t instanceof Int16Array)return new H([te(Object.assign(Object.assign({},e),{type:new Ui}))]);if(t instanceof Int32Array)return new H([te(Object.assign(Object.assign({},e),{type:new hr}))]);if(t instanceof BigInt64Array)return new H([te(Object.assign(Object.assign({},e),{type:new mi}))]);if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)return new H([te(Object.assign(Object.assign({},e),{type:new ji}))]);if(t instanceof Uint16Array)return new H([te(Object.assign(Object.assign({},e),{type:new zi}))]);if(t instanceof Uint32Array)return new H([te(Object.assign(Object.assign({},e),{type:new Vn}))]);if(t instanceof BigUint64Array)return new H([te(Object.assign(Object.assign({},e),{type:new _o}))]);if(t instanceof Float32Array)return new H([te(Object.assign(Object.assign({},e),{type:new Mn}))]);if(t instanceof Float64Array)return new H([te(Object.assign(Object.assign({},e),{type:new pi}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function GH(t){return t instanceof de?[t]:t instanceof H?t.data:Eo(t).data}var aP,cP,lP,uP,H,_0,Fr=p(()=>{Dt();Ru();st();yi();b0();Tc();Yn();w0();x0();st();cP=Symbol.for("apache-arrow/Vector"),lP={},uP={},H=class t{static isVector(e){return(e==null?void 0:e[cP])===!0}constructor(e){var r,n,i;let o=e[0]instanceof t?e.flatMap(a=>a.data):e;if(o.length===0||o.some(a=>!(a instanceof de)))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}=lP[s.typeId],u=o[0];this.isValid=h=>Dh(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,uP[s.typeId]),this._offsets=m0(o);break}this.data=o,this.type=s,this.stride=Xn(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((e,r)=>e+r.byteLength,0)}get nullable(){return oP(this.data)}get nullCount(){return d0(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(e){return!1}get(e){return null}at(e){return this.get(Ac(e,this.length))}set(e,r){}indexOf(e,r){return-1}includes(e,r){return this.indexOf(e,r)>-1}[Symbol.iterator](){return Cu.visit(this)}concat(...e){return new t(this.data.concat(e.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(e,r){return new t(Oh(this,e,r,({data:n,_offsets:i},o,s)=>p0(n,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:e,data:r,length:n,stride:i,ArrayType:o}=this;switch(e.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(e){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new t(this.data.map(({children:r})=>r[e])):null}get isMemoized(){return j.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(j.isDictionary(this.type)){let e=new _0(this.data[0].dictionary),r=this.data.map(n=>{let i=n.clone();return i.dictionary=e,i});return new t(r)}return new _0(this)}unmemoize(){if(j.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),r=this.data.map(n=>{let i=n.clone();return i.dictionary=e,i});return new t(r)}return this}};aP=Symbol.toStringTag;H[aP]=(t=>{t.type=j.prototype,t.data=[],t.length=0,t.stride=1,t.numChildren=0,t._offsets=new Uint32Array([0]),t[Symbol.isConcatSpreadable]=!0,t[cP]=!0;let e=Object.keys(x).map(r=>x[r]).filter(r=>typeof r=="number"&&r!==x.NONE);for(let r of e){let n=tr.getVisitFnByTypeId(r),i=Pr.getVisitFnByTypeId(r),o=Lc.getVisitFnByTypeId(r);lP[r]={get:n,set:i,indexOf:o},uP[r]=Object.create(t,{isValid:{value:Ou(Dh)},get:{value:Ou(tr.getVisitFnByTypeId(r))},set:{value:g0(Pr.getVisitFnByTypeId(r))},indexOf:{value:y0(Lc.getVisitFnByTypeId(r))}})}return"Vector"})(H.prototype);Object.defineProperty(H,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===H&&H.isVector(e)}});_0=class t extends H{constructor(e){super(e.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 t(i.call(this,s,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new H(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function fP(t){if(!t||t.length<=0)return function(i){return!0};let e="",r=t.filter(n=>n===n);return r.length>0&&(e=`
5
5
  switch (x) {${r.map(n=>`
6
- case ${oK(n)}:`).join("")}
6
+ case ${UH(n)}:`).join("")}
7
7
  return false;
8
8
  }`),t.length!==r.length&&(e=`if (x !== x) return false;
9
9
  ${e}`),new Function("x",`${e}
10
- return true;`)}function oK(t){return typeof t!="bigint"?ji(t):`${ji(t)}n`}var wR=p(()=>{Sh()});function Rw(t,e){let r=Math.ceil(t)*e-1;return(r-r%64+64||64)/e}function xR(t,e=0){return t.length>=e?t.subarray(0,e):ah(new t.constructor(e),t,0)}var Rn,cs,Cu,Sa,Ki=p(()=>{dr();Rn=class{constructor(e,r=0,n=1){this.length=Math.ceil(r/n),this.buffer=new e(this.length),this.stride=n,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e}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(e,r){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let r=this.stride,n=this.length*r,i=this.buffer.length;n>=i&&this._resize(i===0?Rw(n*1,this.BYTES_PER_ELEMENT):Rw(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=Rw(e*this.stride,this.BYTES_PER_ELEMENT);let r=xR(this.buffer,e);return this.clear(),r}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=xR(this.buffer,e)}},cs=class extends Rn{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,r){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=r,this}},Cu=class extends cs{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,r){let{buffer:n}=this.reserve(e-this.length+1),i=e>>3,o=e%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()}},Sa=class extends cs{constructor(e){super(e.OffsetArrayType,1,1)}append(e){return this.set(this.length-1,e)}set(e,r){let n=this.length-1,i=this.reserve(e-n+1).buffer;return n<e++&&n>=0&&i.fill(i[n],n,e),i[e]=i[e-1]+r,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(e+1)}}});var ct,or,qr,bt=p(()=>{zr();_i();Lh();at();wR();Ki();ct=class{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}constructor({type:e,nullValues:r}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=r,this.stride=ti(e),this._nulls=new Cu,r&&r.length>0&&(this._isValid=bR(r))}toVector(){return new H([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0,{_offsets:r,_values:n,_nulls:i,_typeIds:o,children:s}=this;return r&&(e+=r.byteLength),n&&(e+=n.byteLength),i&&(e+=i.byteLength),o&&(e+=o.byteLength),s.reduce((a,c)=>a+c.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((r,n)=>r+n.reservedByteLength,e)}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(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,r){return this.setValid(e,this.isValid(r))&&this.setValue(e,r),this}setValue(e,r){this._setValue(this,e,r)}setValid(e,r){return this.length=this._nulls.set(e,+r).length,r}addChild(e,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(e){return this.children[e]||null}flush(){let e,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))?e=u==null?void 0:u.flush(l.last()):e=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:e,typeIds:r,nullBitmap:n,valueOffsets:i})}finish(){this.finished=!0;for(let e of this.children)e.finish();return this}clear(){var e,r,n,i;this.length=0,(e=this._nulls)===null||e===void 0||e.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(e){super(e),this._values=new cs(this.ArrayType,0,this.stride)}setValue(e,r){let n=this._values;return n.reserve(e-n.length+1),super.setValue(e,r)}},qr=class extends ct{constructor(e){super(e),this._pendingLength=0,this._offsets=new Sa(e.type)}setValue(e,r){let n=this._pending||(this._pending=new Map),i=n.get(e);i&&(this._pendingLength-=i.length),this._pendingLength+=r instanceof xi?r[xa].length:r.length,n.set(e,r)}setValid(e,r){return super.setValid(e,r)?!0:((this._pending||(this._pending=new Map)).set(e,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 e=this._pending,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,r),this}}});var Bc,Lw=p(()=>{Bc=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,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(e,r,n,i){return e.prep(8,24),e.writeInt64(BigInt(i??0)),e.pad(4),e.writeInt32(n),e.writeInt64(BigInt(r??0)),e.offset()}}});var _R,ni,SR=p(()=>{_R=me(Ve(),1);Lw();xu();Fp();ow();ni=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFooter(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,r){return e.setPosition(e.position()+_R.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ot.V1}schema(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new En).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}dictionaries(e,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Bc).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,r){let n=this.bb.__offset(this.bb_pos,10);return n?(r||new Bc).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,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)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,r){e.addFieldInt16(0,r,ot.V1)}static addSchema(e,r){e.addFieldOffset(1,r,0)}static addDictionaries(e,r){e.addFieldOffset(2,r,0)}static startDictionariesVector(e,r){e.startVector(24,r,8)}static addRecordBatches(e,r){e.addFieldOffset(3,r,0)}static startRecordBatchesVector(e,r){e.startVector(24,r,8)}static addCustomMetadata(e,r){e.addFieldOffset(4,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,r){e.finish(r)}static finishSizePrefixedFooterBuffer(e,r){e.finish(r,void 0,!0)}}});function E0(t,e){return new Map([...t||new Map,...e||new Map])}function Ow(t,e=new Map){for(let r=-1,n=t.length;++r<n;){let o=t[r].type;if(U.isDictionary(o)){if(!e.has(o.id))e.set(o.id,o.dictionary);else if(e.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&&Ow(o.children,e)}return e}var MR,vR,ve,ee,Vr=p(()=>{Nt();at();MR=Symbol.for("apache-arrow/Schema"),vR=Symbol.for("apache-arrow/Field"),ve=class t{static isSchema(e){return(e==null?void 0:e[MR])===!0}constructor(e=[],r,n,i=ot.V5){this.fields=e||[],this.metadata=r||new Map,n||(n=Ow(this.fields)),this.dictionaries=n,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,r)=>`${r}: ${e}`).join(", ")} }>`}select(e){let r=new Set(e),n=this.fields.filter(i=>r.has(i.name));return new t(n,this.metadata)}selectAt(e){let r=e.map(n=>this.fields[n]).filter(Boolean);return new t(r,this.metadata)}assign(...e){let r=e[0]instanceof t?e[0]:Array.isArray(e[0])?new t(e[0]):new t(e),n=[...this.fields],i=E0(E0(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:E0(E0(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),s=Ow(o,new Map);return new t([...n,...o],i,new Map([...this.dictionaries,...s]))}};ve.prototype.fields=null;ve.prototype.metadata=null;ve.prototype.dictionaries=null;ve.prototype[MR]=!0;Object.defineProperty(ve,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===ve&&ve.isSchema(e)}});ee=class t{static isField(e){return(e==null?void 0:e[vR])===!0}static new(...e){let[r,n,i,o]=e;return e[0]&&typeof e[0]=="object"&&({name:r}=e[0],n===void 0&&(n=e[0].type),i===void 0&&(i=e[0].nullable),o===void 0&&(o=e[0].metadata)),new t(`${r}`,n,i,o)}constructor(e,r,n=!1,i){this.name=e,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(...e){let[r,n,i,o]=e;return!e[0]||typeof e[0]!="object"?[r=this.name,n=this.type,i=this.nullable,o=this.metadata]=e:{name:r=this.name,type:n=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=e[0],t.new(r,n,i,o)}};ee.prototype.type=null;ee.prototype.name=null;ee.prototype.nullable=null;ee.prototype.metadata=null;ee.prototype[vR]=!0;Object.defineProperty(ee,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===ee&&ee.isField(e)}})});var T0,sK,aK,ls,Bw,Xi,Cw=p(()=>{Lw();SR();T0=me(Ve(),1);Vr();Nt();dr();So();sK=T0.Builder,aK=T0.ByteBuffer,ls=class{static decode(e){e=new aK(se(e));let r=ni.getRootAsFooter(e),n=ve.decode(r.schema(),new Map,r.version());return new Bw(n,r)}static encode(e){let r=new sK,n=ve.encode(r,e.schema);ni.startRecordBatchesVector(r,e.numRecordBatches);for(let s of[...e.recordBatches()].slice().reverse())Xi.encode(r,s);let i=r.endVector();ni.startDictionariesVector(r,e.numDictionaries);for(let s of[...e.dictionaryBatches()].slice().reverse())Xi.encode(r,s);let o=r.endVector();return ni.startFooter(r),ni.addSchema(r,n),ni.addVersion(r,ot.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(e,r=ot.V5,n,i){this.schema=e,this.version=r,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let e,r=-1,n=this.numRecordBatches;++r<n;)(e=this.getRecordBatch(r))&&(yield e)}*dictionaryBatches(){for(let e,r=-1,n=this.numDictionaries;++r<n;)(e=this.getDictionaryBatch(r))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}},Bw=class extends ls{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(e,r){super(e,r.version()),this._footer=r}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let r=this._footer.recordBatches(e);if(r)return Xi.decode(r)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let r=this._footer.dictionaries(e);if(r)return Xi.decode(r)}return null}},Xi=class t{static decode(e){return new t(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,r){let{metaDataLength:n}=r,i=BigInt(r.offset),o=BigInt(r.bodyLength);return Bc.createBlock(e,i,n,o)}constructor(e,r,n){this.metaDataLength=e,this.offset=Le(n),this.bodyLength=Le(r)}}});var ER,ii,TR=p(()=>{ER=me(Ve(),1);xu();$p();Fp();ii=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsMessage(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,r){return e.setPosition(e.position()+ER.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ot.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):ke.NONE}header(e){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__union(e,this.bb_pos+r):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,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)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,r){e.addFieldInt16(0,r,ot.V1)}static addHeaderType(e,r){e.addFieldInt8(1,r,ke.NONE)}static addHeader(e,r){e.addFieldOffset(2,r,0)}static addBodyLength(e,r){e.addFieldInt64(3,r,BigInt("0"))}static addCustomMetadata(e,r){e.addFieldOffset(4,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,r){e.finish(r)}static finishSizePrefixedMessageBuffer(e,r){e.finish(r,void 0,!0)}static createMessage(e,r,n,i,o,s){return t.startMessage(e),t.addVersion(e,r),t.addHeaderType(e,n),t.addHeader(e,i),t.addBodyLength(e,o),t.addCustomMetadata(e,s),t.endMessage(e)}}});var Dw,A0,AR=p(()=>{Pn();G6();Vp();Jb();y6();w6();R6();_6();$6();K6();C6();Kb();Hb();tw();rw();Qb();Xb();N6();O6();j6();nw();$b();Yb();Zb();ew();Dw=class extends ie{visit(e,r){return e==null||r==null?void 0:super.visit(e,r)}visitNull(e,r){return bh.startNull(r),bh.endNull(r)}visitInt(e,r){return Gi.startInt(r),Gi.addBitWidth(r,e.bitWidth),Gi.addIsSigned(r,e.isSigned),Gi.endInt(r)}visitFloat(e,r){return ia.startFloatingPoint(r),ia.addPrecision(r,e.precision),ia.endFloatingPoint(r)}visitBinary(e,r){return fh.startBinary(r),fh.endBinary(r)}visitBinaryView(e,r){return hh.startBinaryView(r),hh.endBinaryView(r)}visitLargeBinary(e,r){return mh.startLargeBinary(r),mh.endLargeBinary(r)}visitBool(e,r){return dh.startBool(r),dh.endBool(r)}visitUtf8(e,r){return xh.startUtf8(r),xh.endUtf8(r)}visitUtf8View(e,r){return _h.startUtf8View(r),_h.endUtf8View(r)}visitLargeUtf8(e,r){return gh.startLargeUtf8(r),gh.endLargeUtf8(r)}visitDecimal(e,r){return _o.startDecimal(r),_o.addScale(r,e.scale),_o.addPrecision(r,e.precision),_o.addBitWidth(r,e.bitWidth),_o.endDecimal(r)}visitDate(e,r){return ea.startDate(r),ea.addUnit(r,e.unit),ea.endDate(r)}visitTime(e,r){return is.startTime(r),is.addUnit(r,e.unit),is.addBitWidth(r,e.bitWidth),is.endTime(r)}visitTimestamp(e,r){let n=e.timezone&&r.createString(e.timezone)||void 0;return os.startTimestamp(r),os.addUnit(r,e.unit),n!==void 0&&os.addTimezone(r,n),os.endTimestamp(r)}visitInterval(e,r){return oa.startInterval(r),oa.addUnit(r,e.unit),oa.endInterval(r)}visitDuration(e,r){return ta.startDuration(r),ta.addUnit(r,e.unit),ta.endDuration(r)}visitList(e,r){return yh.startList(r),yh.endList(r)}visitLargeList(e,r){return ph.startLargeList(r),ph.endLargeList(r)}visitStruct(e,r){return wh.startStruct_(r),wh.endStruct_(r)}visitUnion(e,r){Ui.startTypeIdsVector(r,e.typeIds.length);let n=Ui.createTypeIdsVector(r,e.typeIds);return Ui.startUnion(r),Ui.addMode(r,e.mode),Ui.addTypeIds(r,n),Ui.endUnion(r)}visitDictionary(e,r){let n=this.visit(e.indices,r);return xo.startDictionaryEncoding(r),xo.addId(r,BigInt(e.id)),xo.addIsOrdered(r,e.isOrdered),n!==void 0&&xo.addIndexType(r,n),xo.endDictionaryEncoding(r)}visitFixedSizeBinary(e,r){return ra.startFixedSizeBinary(r),ra.addByteWidth(r,e.byteWidth),ra.endFixedSizeBinary(r)}visitFixedSizeList(e,r){return na.startFixedSizeList(r),na.addListSize(r,e.listSize),na.endFixedSizeList(r)}visitMap(e,r){return sa.startMap(r),sa.addKeysSorted(r,e.keysSorted),sa.endMap(r)}},A0=new Dw});function LR(t,e=new Map){return new ve(cK(t,e),I0(t.metadata),e)}function Nw(t){return new sr(t.count,BR(t.columns),CR(t.columns),null,DR(t.columns))}function OR(t){return new Wr(Nw(t.data),t.id,t.isDelta)}function cK(t,e){return(t.fields||[]).filter(Boolean).map(r=>ee.fromJSON(r,e))}function IR(t,e){return(t.children||[]).filter(Boolean).map(r=>ee.fromJSON(r,e))}function BR(t){return(t||[]).reduce((e,r)=>[...e,new Si(r.count,lK(r.VALIDITY)),...BR(r.children)],[])}function CR(t,e=[]){for(let r=-1,n=(t||[]).length;++r<n;){let i=t[r];if(i.VALIDITY&&e.push(new Kt(e.length,i.VALIDITY.length)),i.TYPE_ID&&e.push(new Kt(e.length,i.TYPE_ID.length)),i.OFFSET&&e.push(new Kt(e.length,i.OFFSET.length)),i.DATA&&e.push(new Kt(e.length,i.DATA.length)),i.VIEWS&&e.push(new Kt(e.length,i.VIEWS.length)),i.VARIADIC_DATA_BUFFERS)for(let o of i.VARIADIC_DATA_BUFFERS)e.push(new Kt(e.length,o.length));e=CR(i.children,e)}return e}function lK(t){return(t||[]).reduce((e,r)=>e+ +(r===0),0)}function DR(t){return(t||[]).reduce((e,r)=>[...e,...r.VARIADIC_DATA_BUFFERS?[r.VARIADIC_DATA_BUFFERS.length]:[],...DR(r.children)],[])}function NR(t,e){let r,n,i,o,s,a;return!e||!(o=t.dictionary)?(s=RR(t,IR(t,e)),i=new ee(t.name,s,t.nullable,I0(t.metadata))):e.has(r=o.id)?(n=(n=o.indexType)?PR(n):new Zt,a=new nr(e.get(r),n,r,o.isOrdered),i=new ee(t.name,a,t.nullable,I0(t.metadata))):(n=(n=o.indexType)?PR(n):new Zt,e.set(r,s=RR(t,IR(t,e))),a=new nr(s,n,r,o.isOrdered),i=new ee(t.name,a,t.nullable,I0(t.metadata))),i||null}function I0(t=[]){return new Map(t.map(({key:e,value:r})=>[e,r]))}function PR(t){return new Pt(t.isSigned,t.bitWidth)}function RR(t,e){let r=t.type.name;switch(r){case"NONE":return new $t;case"null":return new $t;case"binary":return new Tn;case"largebinary":return new Wi;case"binaryview":return new Ee;case"utf8":return new kr;case"largeutf8":return new $i;case"utf8view":return new on;case"bool":return new Gr;case"list":return new rr((e||[])[0]);case"largelist":return new ei((e||[])[0]);case"struct":return new $e(e||[]);case"struct_":return new $e(e||[])}switch(r){case"int":{let n=t.type;return new Pt(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=t.type;return new Fr(Xe[n.precision])}case"decimal":{let n=t.type;return new An(n.scale,n.precision,n.bitWidth)}case"date":{let n=t.type;return new sn(st[n.unit])}case"time":{let n=t.type;return new Pr(q[n.unit],n.bitWidth)}case"timestamp":{let n=t.type;return new Rr(q[n.unit],n.timezone)}case"interval":{let n=t.type;return new Ur(Ge[n.unit])}case"duration":{let n=t.type;return new an(q[n.unit])}case"union":{let n=t.type,[i,...o]=(n.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new cn(Qe[s],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=t.type;return new In(n.byteWidth)}case"fixedsizelist":{let n=t.type;return new Ht(n.listSize,(e||[])[0])}case"map":{let n=t.type;return new jr((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}var FR=p(()=>{Vr();at();Ma();Nt()});function hK(t,e){return(()=>{switch(e){case ke.Schema:return ve.fromJSON(t);case ke.RecordBatch:return sr.fromJSON(t);case ke.DictionaryBatch:return Wr.fromJSON(t)}throw new Error(`Unrecognized Message type: { name: ${ke[e]}, type: ${e} }`)})}function dK(t,e){return(()=>{switch(e){case ke.Schema:return ve.decode(t.header(new En),new Map,t.version());case ke.RecordBatch:return sr.decode(t.header(new Dr),t.version());case ke.DictionaryBatch:return Wr.decode(t.header(new ns),t.version())}throw new Error(`Unrecognized Message type: { name: ${ke[e]}, type: ${e} }`)})}function mK(t,e=new Map,r=ot.V5){let n=SK(t,e);return new ve(n,P0(t),e,r)}function pK(t,e=ot.V5){return new sr(t.length(),wK(t),xK(t,e),jR(t.compression()),_K(t))}function gK(t,e=ot.V5){return new Wr(sr.decode(t.data(),e),t.id(),t.isDelta())}function yK(t){return new Kt(t.offset(),t.length())}function bK(t){return new Si(t.length(),t.nullCount())}function wK(t){let e=[];for(let r,n=-1,i=-1,o=t.nodesLength();++n<o;)(r=t.nodes(n))&&(e[++i]=Si.decode(r));return e}function xK(t,e){let r=[];for(let n,i=-1,o=-1,s=t.buffersLength();++i<s;)(n=t.buffers(i))&&(e<ot.V4&&(n.bb_pos+=8*(i+1)),r[++o]=Kt.decode(n));return r}function _K(t){let e=[],r=Math.trunc(t.variadicBufferCountsLength());for(let n=0;n<r;++n)e.push(Le(t.variadicBufferCounts(n)));return e}function SK(t,e){let r=[];for(let n,i=-1,o=-1,s=t.fieldsLength();++i<s;)(n=t.fields(i))&&(r[++o]=ee.decode(n,e));return r}function kR(t,e){let r=[];for(let n,i=-1,o=-1,s=t.childrenLength();++i<s;)(n=t.children(i))&&(r[++o]=ee.decode(n,e));return r}function MK(t,e){let r,n,i,o,s,a;return!e||!(a=t.dictionary())?(i=UR(t,kR(t,e)),n=new ee(t.name(),i,t.nullable(),P0(t))):e.has(r=Le(a.id()))?(o=(o=a.indexType())?GR(o):new Zt,s=new nr(e.get(r),o,r,a.isOrdered()),n=new ee(t.name(),s,t.nullable(),P0(t))):(o=(o=a.indexType())?GR(o):new Zt,e.set(r,i=UR(t,kR(t,e))),s=new nr(i,o,r,a.isOrdered()),n=new ee(t.name(),s,t.nullable(),P0(t))),n||null}function P0(t){let e=new Map;if(t)for(let r,n,i=-1,o=Math.trunc(t.customMetadataLength());++i<o;)(r=t.customMetadata(i))&&(n=r.key())!=null&&e.set(n,r.value());return e}function vK(t){let e=new Map;for(let r,n,i=-1,o=Math.trunc(t.customMetadataLength());++i<o;)(r=t.customMetadata(i))&&(n=r.key())!=null&&e.set(n,r.value());return e}function GR(t){return new Pt(t.isSigned(),t.bitWidth())}function UR(t,e){let r=t.typeType();switch(r){case pe.NONE:return new $t;case pe.Null:return new $t;case pe.Binary:return new Tn;case pe.LargeBinary:return new Wi;case pe.BinaryView:return new Ee;case pe.Utf8:return new kr;case pe.LargeUtf8:return new $i;case pe.Utf8View:return new on;case pe.Bool:return new Gr;case pe.List:return new rr((e||[])[0]);case pe.LargeList:return new ei((e||[])[0]);case pe.Struct_:return new $e(e||[])}switch(r){case pe.Int:{let n=t.type(new Gi);return new Pt(n.isSigned(),n.bitWidth())}case pe.FloatingPoint:{let n=t.type(new ia);return new Fr(n.precision())}case pe.Decimal:{let n=t.type(new _o);return new An(n.scale(),n.precision(),n.bitWidth())}case pe.Date:{let n=t.type(new ea);return new sn(n.unit())}case pe.Time:{let n=t.type(new is);return new Pr(n.unit(),n.bitWidth())}case pe.Timestamp:{let n=t.type(new os);return new Rr(n.unit(),n.timezone())}case pe.Interval:{let n=t.type(new oa);return new Ur(n.unit())}case pe.Duration:{let n=t.type(new ta);return new an(n.unit())}case pe.Union:{let n=t.type(new Ui);return new cn(n.mode(),n.typeIdsArray()||[],e||[])}case pe.FixedSizeBinary:{let n=t.type(new ra);return new In(n.byteWidth())}case pe.FixedSizeList:{let n=t.type(new na);return new Ht(n.listSize(),(e||[])[0])}case pe.Map:{let n=t.type(new sa);return new jr((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${pe[r]}" (${r})`)}function jR(t){return t?new Cc(t.codec(),t.method()):null}function EK(t,e){let r=e.fields.map(o=>ee.encode(t,o));En.startFieldsVector(t,r.length);let n=En.createFieldsVector(t,r),i=e.metadata&&e.metadata.size>0?En.createCustomMetadataVector(t,[...e.metadata].map(([o,s])=>{let a=t.createString(`${o}`),c=t.createString(`${s}`);return Dt.startKeyValue(t),Dt.addKey(t,a),Dt.addValue(t,c),Dt.endKeyValue(t)})):-1;return En.startSchema(t),En.addFields(t,n),En.addEndianness(t,LK?Qs.Little:Qs.Big),i!==-1&&En.addCustomMetadata(t,i),En.endSchema(t)}function TK(t,e){let r=-1,n=-1,i=-1,o=e.type,s=e.typeId;U.isDictionary(o)?(s=o.dictionary.typeId,i=A0.visit(o,t),n=A0.visit(o.dictionary,t)):n=A0.visit(o,t);let a=(o.children||[]).map(u=>ee.encode(t,u)),c=Nr.createChildrenVector(t,a),l=e.metadata&&e.metadata.size>0?Nr.createCustomMetadataVector(t,[...e.metadata].map(([u,h])=>{let d=t.createString(`${u}`),m=t.createString(`${h}`);return Dt.startKeyValue(t),Dt.addKey(t,d),Dt.addValue(t,m),Dt.endKeyValue(t)})):-1;return e.name&&(r=t.createString(e.name)),Nr.startField(t),Nr.addType(t,n),Nr.addTypeType(t,s),Nr.addChildren(t,c),Nr.addNullable(t,!!e.nullable),r!==-1&&Nr.addName(t,r),i!==-1&&Nr.addDictionary(t,i),l!==-1&&Nr.addCustomMetadata(t,l),Nr.endField(t)}function AK(t,e){let r=e.nodes||[],n=e.buffers||[],i=e.variadicBufferCounts||[];Dr.startNodesVector(t,r.length);for(let l of r.slice().reverse())Si.encode(t,l);let o=t.endVector();Dr.startBuffersVector(t,n.length);for(let l of n.slice().reverse())Kt.encode(t,l);let s=t.endVector(),a=null;e.compression!==null&&(a=zR(t,e.compression));let c=-1;return i.length>0&&(c=Dr.createVariadicBufferCountsVector(t,i.map(BigInt))),Dr.startRecordBatch(t),Dr.addLength(t,BigInt(e.length)),Dr.addNodes(t,o),Dr.addBuffers(t,s),e.compression!==null&&a&&Dr.addCompression(t,a),c!==-1&&Dr.addVariadicBufferCounts(t,c),Dr.endRecordBatch(t)}function zR(t,e){return rs.startBodyCompression(t),rs.addCodec(t,e.type),rs.addMethod(t,e.method),rs.endBodyCompression(t)}function IK(t,e){let r=sr.encode(t,e.data);return ns.startDictionaryBatch(t),ns.addId(t,BigInt(e.id)),ns.addIsDelta(t,e.isDelta),ns.addData(t,r),ns.endDictionaryBatch(t)}function PK(t,e){return wu.createFieldNode(t,BigInt(e.length),BigInt(e.nullCount))}function RK(t,e){return bu.createBuffer(t,BigInt(e.offset),BigInt(e.length))}var R0,uK,fK,$r,sr,Wr,Kt,Si,Cc,LK,Ma=p(()=>{R0=me(Ve(),1);ow();Vp();Vb();f6();zb();iw();qb();Wp();xu();Wb();Jb();Kb();Hb();tw();rw();Qb();Xb();nw();Yb();Zb();ew();TR();jb();Ub();Vr();dr();So();Nt();AR();FR();at();uK=R0.Builder,fK=R0.ByteBuffer,$r=class t{static fromJSON(e,r){let n=new t(0,ot.V5,r);return n._createHeader=hK(e,r),n}static decode(e){e=new fK(se(e));let r=ii.getRootAsMessage(e),n=r.bodyLength(),i=r.version(),o=r.headerType(),s=vK(r),a=new t(n,i,o,void 0,s);return a._createHeader=dK(r,o),a}static encode(e){let r=new uK,n=-1;e.isSchema()?n=ve.encode(r,e.header()):e.isRecordBatch()?n=sr.encode(r,e.header()):e.isDictionaryBatch()&&(n=Wr.encode(r,e.header()));let i=e.metadata&&e.metadata.size>0?ii.createCustomMetadataVector(r,[...e.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,ot.V5),ii.addHeader(r,n),ii.addHeaderType(r,e.headerType),ii.addBodyLength(r,BigInt(e.bodyLength)),i!==-1&&ii.addCustomMetadata(r,i),ii.finishMessageBuffer(r,ii.endMessage(r)),r.asUint8Array()}static from(e,r=0){if(e instanceof ve)return new t(0,ot.V5,ke.Schema,e);if(e instanceof sr)return new t(r,ot.V5,ke.RecordBatch,e,e.metadata);if(e instanceof Wr)return new t(r,ot.V5,ke.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}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===ke.Schema}isRecordBatch(){return this.headerType===ke.RecordBatch}isDictionaryBatch(){return this.headerType===ke.DictionaryBatch}constructor(e,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(e),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(e,r,n,i,o=[],s){this._nodes=r,this._buffers=n,this._length=Le(e),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(e,r,n=!1){this._data=e,this._isDelta=n,this._id=Le(r)}},Kt=class{constructor(e,r){this.offset=Le(e),this.length=Le(r)}},Si=class{constructor(e,r){this.length=Le(e),this.nullCount=Le(r)}},Cc=class{constructor(e,r=Ec.BUFFER){this.type=e,this.method=r}};ee.encode=TK;ee.decode=MK;ee.fromJSON=NR;ve.encode=EK;ve.decode=mK;ve.fromJSON=LR;sr.encode=AK;sr.decode=pK;sr.fromJSON=Nw;Wr.encode=IK;Wr.decode=gK;Wr.fromJSON=OR;Si.encode=PK;Si.decode=bK;Kt.encode=RK;Kt.decode=yK;Cc.encode=zR;Cc.decode=jR;LK=(()=>{let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),new Int16Array(t)[0]===256})()});var St,Nh,Dc,L0,Fh=p(()=>{Ar();gu();St=Object.freeze({done:!0,value:void 0}),Nh=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Dc=class{tee(){return this._getDOMStream().tee()}pipe(e,r){return this._getNodeStream().pipe(e,r)}pipeTo(e,r){return this._getDOMStream().pipeTo(e,r)}pipeThrough(e,r){return this._getDOMStream().pipeThrough(e,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},L0=class extends Dc{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return $(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(St);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return mr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return mr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return $(this,void 0,void 0,function*(){return yield this.abort(e),St})}return(e){return $(this,void 0,void 0,function*(){return yield this.close(),St})}read(e){return $(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return $(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){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,Mi,Hr,Fw,us,Ao=p(()=>{Ar();gu();es();Fh();dr();ts();Ln=class extends L0{write(e){if((e=se(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?pu(this.toUint8Array(!0)):this.toUint8Array(!1).then(pu)}toUint8Array(e=!1){return e?$n(this._values)[0]:$(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 $n(s,a)[0]})}},Mi=class{constructor(e){e&&(this.source=new Fw(mr.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Hr=class t{constructor(e){e instanceof t?this.source=e.source:e instanceof Ln?this.source=new us(mr.fromAsyncIterable(e)):Cp(e)?this.source=new us(mr.fromNodeStream(e)):sh(e)?this.source=new us(mr.fromDOMStream(e)):Op(e)?this.source=new us(mr.fromDOMStream(e.body)):Wn(e)?this.source=new us(mr.fromIterable(e)):Vn(e)?this.source=new us(mr.fromAsyncIterable(e)):Mn(e)&&(this.source=new us(mr.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Fw=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,r="read"){return this.source.next({cmd:r,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||St)}return(e){return Object.create(this.source.return&&this.source.return(e)||St)}},us=class{constructor(e){this.source=e,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}cancel(e){return $(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return $(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return $(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return $(this,arguments,void 0,function*(r,n="read"){return yield this.source.next({cmd:n,size:r})})}throw(e){return $(this,void 0,void 0,function*(){let r=this.source.throw&&(yield this.source.throw(e))||St;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}return(e){return $(this,void 0,void 0,function*(){let r=this.source.return&&(yield this.source.return(e))||St;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}}});var kh,va,kw=p(()=>{Ar();Ao();dr();kh=class extends Mi{constructor(e,r){super(),this.position=0,this.buffer=se(e),this.size=r===void 0?this.buffer.byteLength:r}readInt32(e){let{buffer:r,byteOffset:n}=this.readAt(e,4);return new DataView(r,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){let{buffer:r,size:n,position:i}=this;return r&&i<n?(typeof e!="number"&&(e=Number.POSITIVE_INFINITY),this.position=Math.min(n,i+Math.min(n-i,e)),r.subarray(i,this.position)):null}readAt(e,r){let n=this.buffer,i=Math.min(this.size,e+r);return n?n.subarray(e,i):new Uint8Array(r)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}},va=class extends Hr{constructor(e,r){super(),this.position=0,this._handle=e,typeof r=="number"?this.size=r:this._pending=$(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending})}readInt32(e){return $(this,void 0,void 0,function*(){let{buffer:r,byteOffset:n}=yield this.readAt(e,4);return new DataView(r,n).getInt32(0,!0)})}seek(e){return $(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return $(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n,position:i}=this;if(r&&i<n){typeof e!="number"&&(e=Number.POSITIVE_INFINITY);let o=i,s=0,a=0,c=Math.min(n,o+Math.min(n-o,e)),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(e,r){return $(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&e+r<i){let o=Math.min(i,e+r),s=new Uint8Array(o-e);return(yield n.read(s,0,r,e)).buffer}return new Uint8Array(r)})}close(){return $(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return $(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return $(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}}});var Uw={};Qt(Uw,{BaseInt64:()=>Gh,Int128:()=>Uh,Int64:()=>fs,Uint64:()=>Ft});function Du(t){return t<0&&(t=4294967295+t+1),`0x${t.toString(16)}`}var Nu,Gw,Gh,Ft,fs,Uh,jw=p(()=>{Nu=8,Gw=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Gh=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let r=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.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(e){let r=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],r<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=r}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return`${Du(this.buffer[1])} ${Du(this.buffer[0])}`}},Ft=class t extends Gh{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,r=new Uint32Array(2)){return t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(2)){return t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(2)){let n=e.length,i=new t(r);for(let o=0;o<n;){let s=Nu<n-o?Nu:n-o,a=new t(new Uint32Array([Number.parseInt(e.slice(o,o+s),10),0])),c=new t(new Uint32Array([Gw[s],0]));i.times(c),i.plus(a),o+=s}return i}static convertArray(e){let r=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)t.from(e[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(e,r){return new t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new t(new Uint32Array(e.buffer)).plus(r)}},fs=class t extends Gh{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){let r=this.buffer[1]<<0,n=e.buffer[1]<<0;return r<n||r===n&&this.buffer[0]<e.buffer[0]}static from(e,r=new Uint32Array(2)){return t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(2)){return t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(2)){let n=e.startsWith("-"),i=e.length,o=new t(r);for(let s=n?1:0;s<i;){let a=Nu<i-s?Nu:i-s,c=new t(new Uint32Array([Number.parseInt(e.slice(s,s+a),10),0])),l=new t(new Uint32Array([Gw[a],0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(e){let r=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)t.from(e[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(e,r){return new t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new t(new Uint32Array(e.buffer)).plus(r)}},Uh=class t{constructor(e){this.buffer=e}high(){return new fs(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new fs(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(e){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([e.buffer[3],0])),a=new Ft(new Uint32Array([e.buffer[2],0])),c=new Ft(new Uint32Array([e.buffer[1],0])),l=new Ft(new Uint32Array([e.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(e){let r=new Uint32Array(4);return r[3]=this.buffer[3]+e.buffer[3]>>>0,r[2]=this.buffer[2]+e.buffer[2]>>>0,r[1]=this.buffer[1]+e.buffer[1]>>>0,r[0]=this.buffer[0]+e.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`${Du(this.buffer[3])} ${Du(this.buffer[2])} ${Du(this.buffer[1])} ${Du(this.buffer[0])}`}static multiply(e,r){return new t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new t(new Uint32Array(e.buffer)).plus(r)}static from(e,r=new Uint32Array(4)){return t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(4)){return t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(4)){let n=e.startsWith("-"),i=e.length,o=new t(r);for(let s=n?1:0;s<i;){let a=Nu<i-s?Nu:i-s,c=new t(new Uint32Array([Number.parseInt(e.slice(s,s+a),10),0,0,0])),l=new t(new Uint32Array([Gw[a],0,0,0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(e){let r=new Uint32Array(e.length*4);for(let n=-1,i=e.length;++n<i;)t.from(e[n],new Uint32Array(r.buffer,r.byteOffset+16*n,4));return r}}});var $w={};Qt($w,{toIntervalDayTimeInt32Array:()=>zw,toIntervalDayTimeObjects:()=>Vw,toIntervalMonthDayNanoInt32Array:()=>qw,toIntervalMonthDayNanoObjects:()=>Ww});function zw(t){var e,r;let n=t.length,i=new Int32Array(n*2);for(let o=0,s=0;o<n;o++){let a=t[o];i[s++]=(e=a.days)!==null&&e!==void 0?e:0,i[s++]=(r=a.milliseconds)!==null&&r!==void 0?r:0}return i}function qw(t){var e,r;let n=t.length,i=new Int32Array(n*4);for(let o=0,s=0;o<n;o++){let a=t[o];i[s++]=(e=a.months)!==null&&e!==void 0?e: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 Vw(t){let e=t.length,r=new Array(e/2);for(let n=0,i=0;n<e;n+=2)r[i++]={days:t[n],milliseconds:t[n+1]};return r}function Ww(t,e){let r=t.length,n=new Array(r/4);for(let i=0,o=0;i<r;i+=4){let s=BigInt(t[i+3])<<BigInt(32)|BigInt(t[i+2]>>>0);n[o++]={months:t[i],days:t[i+1],nanoseconds:e?`${s}`:s}}return n}var O0=p(()=>{});function VR(t){let e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)e[r>>1]=Number.parseInt(t.slice(r,r+2),16);return e}function OK(t){return VR(t.join(""))}function WR(t,e){let r=new Uint8Array(t.length*16),n=new DataView(r.buffer);for(let[i,o]of t.entries()){let s=i*16,a=o.SIZE;if(n.setInt32(s,a,!0),o.INLINED!==void 0){let c=e(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 BK(t){return WR(t,e=>{let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n>>1]=Number.parseInt(e.slice(n,n+2),16);return r})}function CK(t){return WR(t,e=>new TextEncoder().encode(e))}var Fu,B0,C0,$R=p(()=>{_i();Vr();at();Pn();Lc();es();jw();Nt();dr();O0();Fu=class extends ie{constructor(e,r,n,i,o=ot.V5,s=[]){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.variadicBufferIndex=-1,this.bytes=e,this.nodes=r,this.buffers=n,this.dictionaries=i,this.metadataVersion=o,this.variadicBufferCounts=s}visit(e){return super.visit(e instanceof ee?e.type:e)}visitNull(e,{length:r}=this.nextFieldNode()){return te({type:e,length:r})}visitBool(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitInt(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFloat(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitUtf8(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeUtf8(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitUtf8View(e,{length:r,nullCount:n}=this.nextFieldNode()){let i=this.readNullBitmap(e,n),o=this.readData(e),s=this.readVariadicBuffers(this.nextVariadicBufferCount());return te({type:e,length:r,nullCount:n,nullBitmap:i,views:o,variadicBuffers:s})}visitBinary(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeBinary(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitBinaryView(e,{length:r,nullCount:n}=this.nextFieldNode()){let i=this.readNullBitmap(e,n),o=this.readData(e),s=this.readVariadicBuffers(this.nextVariadicBufferCount());return te({type:e,length:r,nullCount:n,nullBitmap:i,views:o,variadicBuffers:s})}visitFixedSizeBinary(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDate(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTimestamp(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTime(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDecimal(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitList(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitLargeList(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitStruct(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),children:this.visitMany(e.children)})}visitUnion(e,{length:r,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<ot.V5&&this.readNullBitmap(e,n),e.mode===Qe.Sparse?this.visitSparseUnion(e,{length:r,nullCount:n}):this.visitDenseUnion(e,{length:r,nullCount:n})}visitDenseUnion(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,typeIds:this.readTypeIds(e),valueOffsets:this.readOffsets(e),children:this.visitMany(e.children)})}visitSparseUnion(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,typeIds:this.readTypeIds(e),children:this.visitMany(e.children)})}visitDictionary(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e.indices),dictionary:this.readDictionary(e)})}visitInterval(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDuration(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFixedSizeList(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),child:this.visit(e.children[0])})}visitMap(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,r,n=this.nextBufferRange()){return r>0&&this.readData(e,n)||new Uint8Array(0)}readOffsets(e,r){return this.readData(e,r)}readTypeIds(e,r){return this.readData(e,r)}readData(e,{length:r,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+r)}readVariadicBuffers(e){return Array.from({length:e},()=>this.readData(null))}nextVariadicBufferCount(){var e;return(e=this.variadicBufferCounts[++this.variadicBufferIndex])!==null&&e!==void 0?e:0}readDictionary(e){return this.dictionaries.get(e.id)}},B0=class extends Fu{constructor(e,r,n,i,o,s=[]){super(new Uint8Array(0),r,n,i,o,s),this.sources=e}readNullBitmap(e,r,{offset:n}=this.nextBufferRange()){return r<=0?new Uint8Array(0):Rc(this.sources[n])}readOffsets(e,{offset:r}=this.nextBufferRange()){return Re(Uint8Array,Re(e.OffsetArrayType,this.sources[r]))}readTypeIds(e,{offset:r}=this.nextBufferRange()){return Re(Uint8Array,Re(e.ArrayType,this.sources[r]))}readData(e,{offset:r}=this.nextBufferRange()){let{sources:n}=this;if(U.isTimestamp(e))return Re(Uint8Array,fs.convertArray(n[r]));if((U.isInt(e)||U.isTime(e))&&e.bitWidth===64||U.isDuration(e))return Re(Uint8Array,fs.convertArray(n[r]));if(U.isDate(e)&&e.unit===st.MILLISECOND)return Re(Uint8Array,fs.convertArray(n[r]));if(U.isDecimal(e))return Re(Uint8Array,Uh.convertArray(n[r]));if(U.isBinary(e)||U.isLargeBinary(e)||U.isFixedSizeBinary(e))return OK(n[r]);if(U.isBinaryView(e))return BK(n[r]);if(U.isUtf8View(e))return CK(n[r]);if(U.isBool(e))return Rc(n[r]);if(U.isUtf8(e)||U.isLargeUtf8(e))return qn(n[r].join(""));if(U.isInterval(e))switch(e.unit){case Ge.DAY_TIME:return zw(n[r]);case Ge.MONTH_DAY_NANO:return qw(n[r]);default:break}return Re(Uint8Array,Re(e.ArrayType,n[r].map(i=>+i)))}readVariadicBuffers(e){let r=[];for(let n=0;n<e;n++){let{offset:i}=this.nextBufferRange(),o=this.sources[i];r.push(VR(o))}return r}};C0=class extends Fu{constructor(e,r,n,i,o,s=[]){super(new Uint8Array(0),r,n,i,o,s),this.bodyChunks=e}readData(e,r=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}});var hs,D0=p(()=>{Ki();bt();dr();hs=class extends qr{constructor(e){super(e),this._values=new Rn(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,se(r))}_flushPending(e,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of e)if(a===void 0)n.set(s,0);else{let c=a.length;i.set(a,o),n.set(s,c),o+=c}}}});var ds,N0=p(()=>{dr();Ki();bt();ds=class extends qr{constructor(e){super(e),this._values=new Rn(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,se(r))}_flushPending(e,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of e)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 Nc,Hw=p(()=>{Ki();bt();Nc=class extends ct{constructor(e){super(e),this._values=new Cu}setValue(e,r){this._values.set(e,+r)}}});var Io,Ea,Ta,Kw=p(()=>{bt();ri();Io=class extends or{};Io.prototype._setValue=mw;Ea=class extends Io{};Ea.prototype._setValue=Xp;Ta=class extends Io{};Ta.prototype._setValue=Yp});var Aa,Xw=p(()=>{bt();ri();Aa=class extends or{};Aa.prototype._setValue=yw});var Fc,Yw=p(()=>{at();bt();ku();Fc=class extends ct{constructor({type:e,nullValues:r,dictionaryHashFunction:n}){super({type:new nr(e.dictionary,e.indices,e.id,e.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(e){return this.indices.isValid(e)}setValid(e,r){let n=this.indices;return r=n.setValid(e,r),this.length=n.length,r}setValue(e,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(e,o)}flush(){let e=this.type,r=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(e);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(e){return typeof e=="string"?e:`${e}`}}});var Ia,Zw=p(()=>{bt();ri();Ia=class extends or{};Ia.prototype._setValue=dw});var kc,Jw=p(()=>{Vr();bt();at();kc=class extends ct{setValue(e,r){let[n]=this.children,i=e*this.stride;for(let o=-1,s=this.stride;++o<s;)n.set(i+o,r[o])}setValid(e,r){return super.setValid(e,r)||this.children[0].setValid((e+1)*this.stride-1,!1),r}addChild(e,r="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(e);return this.type=new Ht(this.type.listSize,new ee(r,e.type,!0)),n}}});var Po,Gc,Uc,jc,Qw=p(()=>{Rh();bt();Po=class extends or{setValue(e,r){this._values.set(e,r)}},Gc=class extends Po{setValue(e,r){super.setValue(e,Ph(r))}},Uc=class extends Po{},jc=class extends Po{}});var Yi,Pa,Ra,La,ex=p(()=>{bt();ri();Yi=class extends or{};Yi.prototype._setValue=bw;Pa=class extends Yi{};Pa.prototype._setValue=o0;Ra=class extends Yi{};Ra.prototype._setValue=s0;La=class extends Yi{};La.prototype._setValue=a0});var vi,Oa,Ba,Ca,Da,tx=p(()=>{bt();ri();vi=class extends or{};vi.prototype._setValue=ww;Oa=class extends vi{};Oa.prototype._setValue=c0;Ba=class extends vi{};Ba.prototype._setValue=l0;Ca=class extends vi{};Ca.prototype._setValue=u0;Da=class extends vi{};Da.prototype._setValue=f0});var ln,zc,qc,Vc,Wc,$c,Hc,Kc,Xc,rx=p(()=>{bt();ln=class extends or{setValue(e,r){this._values.set(e,r)}},zc=class extends ln{},qc=class extends ln{},Vc=class extends ln{},Wc=class extends ln{},$c=class extends ln{},Hc=class extends ln{},Kc=class extends ln{},Xc=class extends ln{}});var Yc,nx=p(()=>{Vr();at();Ki();bt();Yc=class extends qr{constructor(e){super(e),this._offsets=new Sa(e.type)}addChild(e,r="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new rr(new ee(r,e.type,!0)),this.numChildren-1}_flushPending(e){let r=this._offsets,[n]=this.children;for(let[i,o]of e)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,ix=p(()=>{Vr();at();Ki();So();bt();Zc=class extends qr{constructor(e){super(e),this._offsets=new Sa(e.type)}addChild(e,r="0"){if(this.numChildren>0)throw new Error("LargeListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new ei(new ee(r,e.type,!0)),this.numChildren-1}_flushPending(e){let r=this._offsets,[n]=this.children;for(let[i,o]of e)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,ox=p(()=>{Vr();at();bt();Jc=class extends qr{set(e,r){return super.set(e,r)}setValue(e,r){let n=r instanceof Map?r:new Map(Object.entries(r)),i=this._pending||(this._pending=new Map),o=i.get(e);o&&(this._pendingLength-=o.size),this._pendingLength+=n.size,i.set(e,n)}addChild(e,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new jr(new ee(r,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let r=this._offsets,[n]=this.children;for(let[i,o]of e)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 Qc,sx=p(()=>{bt();Qc=class extends ct{setValue(e,r){}setValid(e,r){return this.length=Math.max(e+1,this.length),r}}});var el,ax=p(()=>{Vr();bt();at();el=class extends ct{setValue(e,r){let{children:n,type:i}=this;switch(Array.isArray(r)||r.constructor){case!0:return i.children.forEach((o,s)=>n[s].set(e,r[s]));case Map:return i.children.forEach((o,s)=>n[s].set(e,r.get(o.name)));default:return i.children.forEach((o,s)=>n[s].set(e,r[o.name]))}}setValid(e,r){return super.setValid(e,r)||this.children.forEach(n=>n.setValid(e,r)),r}addChild(e,r=`${this.numChildren}`){let n=this.children.push(e);return this.type=new $e([...this.type.children,new ee(r,e.type,!0)]),n}}});var Ei,Na,Fa,ka,Ga,cx=p(()=>{bt();ri();Ei=class extends or{};Ei.prototype._setValue=pw;Na=class extends Ei{};Na.prototype._setValue=Zp;Fa=class extends Ei{};Fa.prototype._setValue=Jp;ka=class extends Ei{};ka.prototype._setValue=Qp;Ga=class extends Ei{};Ga.prototype._setValue=e0});var Ti,Ua,ja,za,qa,lx=p(()=>{bt();ri();Ti=class extends or{};Ti.prototype._setValue=gw;Ua=class extends Ti{};Ua.prototype._setValue=t0;ja=class extends Ti{};ja.prototype._setValue=r0;za=class extends Ti{};za.prototype._setValue=n0;qa=class extends Ti{};qa.prototype._setValue=i0});var ms,tl,rl,ux=p(()=>{Vr();Ki();bt();at();ms=class extends ct{constructor(e){super(e),this._typeIds=new cs(Int8Array,0,1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,r){return this.set(this.length,e,r)}set(e,r,n){return n===void 0&&(n=this._valueToChildTypeId(this,r,e)),this.setValue(e,r,n),this}setValue(e,r,n){this._typeIds.set(e,n);let i=this.type.typeIdToChildIndex[n],o=this.children[i];o==null||o.set(e,r),this.length=Math.max(e+1,this.length)}addChild(e,r=`${this.children.length}`){let n=this.children.push(e),{type:{children:i,mode:o,typeIds:s}}=this,a=[...i,new ee(r,e.type)];return this.type=new cn(o,[...s,n],a),n}_valueToChildTypeId(e,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.")}},tl=class extends ms{},rl=class extends ms{constructor(e){super(e),this._offsets=new cs(Int32Array)}setValue(e,r,n){let i=this._typeIds.set(e,n).buffer[e],o=this.getChildAt(this.type.typeIdToChildIndex[i]),s=this._offsets.set(e,o.length).buffer[e];o==null||o.set(s,r),this.length=Math.max(e+1,this.length)}}});var Va,fx=p(()=>{es();D0();Ki();bt();Va=class extends qr{constructor(e){super(e),this._values=new Rn(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,qn(r))}_flushPending(e,r){}};Va.prototype._flushPending=hs.prototype._flushPending});var Wa,hx=p(()=>{es();Ki();bt();N0();Wa=class extends qr{constructor(e){super(e),this._values=new Rn(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,qn(r))}_flushPending(e,r){}};Wa.prototype._flushPending=ds.prototype._flushPending});var ps,F0=p(()=>{at();bt();Ki();dr();_i();ps=class extends ct{constructor(e){super(e),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new Rn(Uint8Array)}get byteLength(){let e=0;this._views&&(e+=this._views.byteLength),this._nulls&&(e+=this._nulls.byteLength);for(let r of this._variadicBuffers)e+=r.byteLength;return this._currentBuffer&&(e+=this._currentBuffer.byteLength),e}setValue(e,r){return this.writeBinaryValue(e,this.encodeValue(r))}writeBinaryValue(e,r){let n=r.length,i=(e+1)*Ee.ELEMENT_WIDTH,o=this._views.length;i>o&&this._views.reserve(i-o);let s=this._views.buffer,a=e*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(e){return se(e)}setValid(e,r){let n=(e+1)*Ee.ELEMENT_WIDTH,i=this._views.length;n>i&&this._views.reserve(n-i);let o=super.setValid(e,r);if(!o){let s=this._views.buffer,a=e*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:e,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:e,length:r,nullCount:n,nullBitmap:a,views:s,variadicBuffers:c})}finish(){return this.finished=!0,this}}});var nl,dx=p(()=>{F0();es();nl=class extends ps{constructor(e){super(e)}setValue(e,r){return this.writeBinaryValue(e,qn(r))}}});var mx,HR,KR=p(()=>{Pn();D0();N0();Hw();Kw();Xw();Yw();Zw();Jw();Qw();ex();tx();rx();nx();ix();ox();sx();ax();cx();lx();ux();fx();hx();F0();dx();mx=class extends ie{visitNull(){return Qc}visitBool(){return Nc}visitInt(){return ln}visitInt8(){return zc}visitInt16(){return qc}visitInt32(){return Vc}visitInt64(){return Wc}visitUint8(){return $c}visitUint16(){return Hc}visitUint32(){return Kc}visitUint64(){return Xc}visitFloat(){return Po}visitFloat16(){return Gc}visitFloat32(){return Uc}visitFloat64(){return jc}visitUtf8(){return Va}visitLargeUtf8(){return Wa}visitBinary(){return hs}visitLargeBinary(){return ds}visitFixedSizeBinary(){return Ia}visitDate(){return Io}visitDateDay(){return Ea}visitDateMillisecond(){return Ta}visitTimestamp(){return Ei}visitTimestampSecond(){return Na}visitTimestampMillisecond(){return Fa}visitTimestampMicrosecond(){return ka}visitTimestampNanosecond(){return Ga}visitTime(){return Ti}visitTimeSecond(){return Ua}visitTimeMillisecond(){return ja}visitTimeMicrosecond(){return za}visitTimeNanosecond(){return qa}visitDecimal(){return Aa}visitList(){return Yc}visitLargeList(){return Zc}visitStruct(){return el}visitUnion(){return ms}visitDenseUnion(){return rl}visitSparseUnion(){return tl}visitDictionary(){return Fc}visitInterval(){return Yi}visitIntervalDayTime(){return Pa}visitIntervalYearMonth(){return Ra}visitIntervalMonthDayNano(){return La}visitDuration(){return vi}visitDurationSecond(){return Oa}visitDurationMillisecond(){return Ba}visitDurationMicrosecond(){return Ca}visitDurationNanosecond(){return Da}visitFixedSizeList(){return kc}visitMap(){return Jc}visitBinaryView(){return ps}visitUtf8View(){return nl}},HR=new mx});function un(t,e){return e instanceof t.constructor}function gs(t,e){return t===e||un(t,e)}function ys(t,e){return t===e||un(t,e)&&t.bitWidth===e.bitWidth&&t.isSigned===e.isSigned}function k0(t,e){return t===e||un(t,e)&&t.precision===e.precision}function DK(t,e){return t===e||un(t,e)&&t.byteWidth===e.byteWidth}function px(t,e){return t===e||un(t,e)&&t.unit===e.unit}function jh(t,e){return t===e||un(t,e)&&t.unit===e.unit&&t.timezone===e.timezone}function zh(t,e){return t===e||un(t,e)&&t.unit===e.unit&&t.bitWidth===e.bitWidth}function XR(t,e){return t===e||un(t,e)&&t.children.length===e.children.length&&Ro.compareManyFields(t.children,e.children)}function NK(t,e){return t===e||un(t,e)&&t.children.length===e.children.length&&Ro.compareManyFields(t.children,e.children)}function gx(t,e){return t===e||un(t,e)&&t.mode===e.mode&&t.typeIds.every((r,n)=>r===e.typeIds[n])&&Ro.compareManyFields(t.children,e.children)}function FK(t,e){return t===e||un(t,e)&&t.id===e.id&&t.isOrdered===e.isOrdered&&Ro.visit(t.indices,e.indices)&&Ro.visit(t.dictionary,e.dictionary)}function G0(t,e){return t===e||un(t,e)&&t.unit===e.unit}function qh(t,e){return t===e||un(t,e)&&t.unit===e.unit}function kK(t,e){return t===e||un(t,e)&&t.listSize===e.listSize&&t.children.length===e.children.length&&Ro.compareManyFields(t.children,e.children)}function GK(t,e){return t===e||un(t,e)&&t.keysSorted===e.keysSorted&&t.children.length===e.children.length&&Ro.compareManyFields(t.children,e.children)}function il(t,e){return Ro.compareSchemas(t,e)}function YR(t,e){return Ro.compareFields(t,e)}function U0(t,e){return Ro.visit(t,e)}var he,Ro,Vh=p(()=>{Pn();he=class extends ie{compareSchemas(e,r){return e===r||r instanceof e.constructor&&this.compareManyFields(e.fields,r.fields)}compareManyFields(e,r){return e===r||Array.isArray(e)&&Array.isArray(r)&&e.length===r.length&&e.every((n,i)=>this.compareFields(n,r[i]))}compareFields(e,r){return e===r||r instanceof e.constructor&&e.name===r.name&&e.nullable===r.nullable&&this.visit(e.type,r.type)}};he.prototype.visitNull=gs;he.prototype.visitBool=gs;he.prototype.visitInt=ys;he.prototype.visitInt8=ys;he.prototype.visitInt16=ys;he.prototype.visitInt32=ys;he.prototype.visitInt64=ys;he.prototype.visitUint8=ys;he.prototype.visitUint16=ys;he.prototype.visitUint32=ys;he.prototype.visitUint64=ys;he.prototype.visitFloat=k0;he.prototype.visitFloat16=k0;he.prototype.visitFloat32=k0;he.prototype.visitFloat64=k0;he.prototype.visitUtf8=gs;he.prototype.visitLargeUtf8=gs;he.prototype.visitUtf8View=gs;he.prototype.visitBinary=gs;he.prototype.visitLargeBinary=gs;he.prototype.visitBinaryView=gs;he.prototype.visitFixedSizeBinary=DK;he.prototype.visitDate=px;he.prototype.visitDateDay=px;he.prototype.visitDateMillisecond=px;he.prototype.visitTimestamp=jh;he.prototype.visitTimestampSecond=jh;he.prototype.visitTimestampMillisecond=jh;he.prototype.visitTimestampMicrosecond=jh;he.prototype.visitTimestampNanosecond=jh;he.prototype.visitTime=zh;he.prototype.visitTimeSecond=zh;he.prototype.visitTimeMillisecond=zh;he.prototype.visitTimeMicrosecond=zh;he.prototype.visitTimeNanosecond=zh;he.prototype.visitDecimal=gs;he.prototype.visitList=XR;he.prototype.visitLargeList=XR;he.prototype.visitStruct=NK;he.prototype.visitUnion=gx;he.prototype.visitDenseUnion=gx;he.prototype.visitSparseUnion=gx;he.prototype.visitDictionary=FK;he.prototype.visitInterval=G0;he.prototype.visitIntervalDayTime=G0;he.prototype.visitIntervalYearMonth=G0;he.prototype.visitIntervalMonthDayNano=G0;he.prototype.visitDuration=qh;he.prototype.visitDurationSecond=qh;he.prototype.visitDurationMillisecond=qh;he.prototype.visitDurationMicrosecond=qh;he.prototype.visitDurationNanosecond=qh;he.prototype.visitFixedSizeList=kK;he.prototype.visitMap=GK;Ro=new he});function oi(t){let e=t.type,r=new(HR.getVisitFn(e)())(t);if(e.children&&e.children.length>0){let n=t.children||[],i={nullValues:t.nullValues},o=Array.isArray(n)?((s,a)=>n[a]||i):(({name:s})=>n[s]||i);for(let[s,a]of e.children.entries()){let{type:c}=a,l=o(a,s);r.children.push(oi(Object.assign(Object.assign({},l),{type:c})))}}return r}function Gu(t,e){if(t instanceof ce||t instanceof H||t.type instanceof U||ArrayBuffer.isView(t))return To(t);let r={type:e??j0(t),nullValues:[null]},n=[...z0(r)(t)],i=n.length===1?n[0]:n.reduce((o,s)=>o.concat(s));return U.isDictionary(i.type)?i.memoize():i}function yx(t){let e=Gu(t),r=new Ue(new ve(e.type.children),e.data[0]);return new qe(r)}function j0(t){if(t.length===0)return new $t;let e=0,r=0,n=0,i=0,o=0,s=0,a=0,c=0;for(let l of t){if(l==null){++e;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+e===t.length)return new Qn;if(o+e===t.length)return new nr(new kr,new Zt);if(s+e===t.length)return new Yn;if(a+e===t.length)return new Gr;if(c+e===t.length)return new Mo;if(r+e===t.length){let l=t,u=j0(l[l.findIndex(h=>h!=null)]);if(l.every(h=>h==null||U0(u,j0(h))))return new rr(new ee("",u,!0))}else if(n+e===t.length){let l=new Map;for(let u of t)for(let h of Object.keys(u))!l.has(h)&&u[h]!=null&&l.set(h,new ee(h,j0([u[h]]),!0));return new $e([...l.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function z0(t){let{["queueingStrategy"]:e="count"}=t,{["highWaterMark"]:r=e!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=t,n=e!=="bytes"?"length":"byteLength";return function*(i){let o=0,s=oi(t);for(let a of i)s.append(a)[n]>=r&&++o&&(yield s.toVector());(s.finish().length>0||o===0)&&(yield s.toVector())}}function bx(t){let{["queueingStrategy"]:e="count"}=t,{["highWaterMark"]:r=e!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=t,n=e!=="bytes"?"length":"byteLength";return function(i){return en(this,arguments,function*(){var o,s,a,c;let l=0,u=oi(t);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 ku=p(()=>{Ar();Vr();at();_i();zr();KR();ol();bs();Vh()});function q0(t,e){return UK(t,e.map(r=>r.data.concat()))}function UK(t,e){let r=[...t.fields],n=[],i={numBatches:e.reduce((h,d)=>Math.max(h,d.length),0)},o=0,s=0,a=-1,c=e.length,l,u=[];for(;i.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,a=-1;++a<c;)u[a]=l=e[a].shift(),s=Math.min(s,l?l.length:s);Number.isFinite(s)&&(u=jK(r,s,u,e,i),s>0&&(n[o++]=te({type:new $e(r),length:s,nullCount:0,children:u.slice()})))}return[t=t.assign(r),n.map(h=>new Ue(t,h))]}function jK(t,e,r,n,i){var o;let s=(e+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>=e)u===e?r[a]=l:(r[a]=l.slice(0,e),i.numBatches=Math.max(i.numBatches,n[a].unshift(l.slice(e,u-e))));else{let h=t[a];t[a]=h.clone({nullable:!0}),r[a]=(o=l==null?void 0:l._changeLengthAndBackfillNullBitmap(e))!==null&&o!==void 0?o:te({type:h.type,length:e,nullCount:e,nullBitmap:new Uint8Array(s)})}}return r}var ZR=p(()=>{_i();at();bs()});function wx(t){let e={},r=Object.entries(t);for(let[n,i]of r)e[n]=To(i);return new qe(e)}function xx(t){let e={},r=Object.entries(t);for(let[n,i]of r)e[n]=Gu(i);return new qe(e)}var JR,QR,qe,ol=p(()=>{Nt();_i();ku();zr();Vr();at();Vh();ZR();_0();Ac();ri();S0();M0();Ru();bs();QR=Symbol.for("apache-arrow/Table"),qe=class t{static isTable(e){return(e==null?void 0:e[QR])===!0}constructor(...e){var r,n;if(e.length===0)return this.batches=[],this.schema=new ve([]),this._offsets=[0],this;let i,o;e[0]instanceof ve&&(i=e.shift()),e.at(-1)instanceof Uint32Array&&(o=e.pop());let s=c=>{if(c){if(c instanceof Ue)return[c];if(c instanceof t)return c.batches;if(c instanceof ce){if(c.type instanceof $e)return[new Ue(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 H([c[m]])),h=i??new ve(l.map((m,g)=>new ee(String(m),u[g].type,u[g].nullable))),[,d]=q0(h,u);return d.length===0?[new Ue(c)]:d}}}return[]},a=e.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 Ue))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!il(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??y0(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,r)=>e+r.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=g0(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(Ic(e,this.numRows))}set(e,r){}indexOf(e,r){return-1}[Symbol.iterator](){return this.batches.length>0?Bu.visit(new H(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
10
+ return true;`)}function UH(t){return typeof t!="bigint"?Fi(t):`${Fi(t)}n`}var hP=p(()=>{Sh()});function Aw(t,e){let r=Math.ceil(t)*e-1;return(r-r%64+64||64)/e}function dP(t,e=0){return t.length>=e?t.subarray(0,e):ah(new t.constructor(e),t,0)}var Tn,as,Bu,ca,$i=p(()=>{ur();Tn=class{constructor(e,r=0,n=1){this.length=Math.ceil(r/n),this.buffer=new e(this.length),this.stride=n,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e}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(e,r){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let r=this.stride,n=this.length*r,i=this.buffer.length;n>=i&&this._resize(i===0?Aw(n*1,this.BYTES_PER_ELEMENT):Aw(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=Aw(e*this.stride,this.BYTES_PER_ELEMENT);let r=dP(this.buffer,e);return this.clear(),r}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=dP(this.buffer,e)}},as=class extends Tn{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,r){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=r,this}},Bu=class extends as{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,r){let{buffer:n}=this.reserve(e-this.length+1),i=e>>3,o=e%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()}},ca=class extends as{constructor(e){super(e.OffsetArrayType,1,1)}append(e){return this.set(this.length-1,e)}set(e,r){let n=this.length-1,i=this.reserve(e-n+1).buffer;return n<e++&&n>=0&&i.fill(i[n],n,e),i[e]=i[e-1]+r,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(e+1)}}});var at,rr,kr,bt=p(()=>{Fr();yi();Lh();st();hP();$i();at=class{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}constructor({type:e,nullValues:r}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=r,this.stride=Xn(e),this._nulls=new Bu,r&&r.length>0&&(this._isValid=fP(r))}toVector(){return new H([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0,{_offsets:r,_values:n,_nulls:i,_typeIds:o,children:s}=this;return r&&(e+=r.byteLength),n&&(e+=n.byteLength),i&&(e+=i.byteLength),o&&(e+=o.byteLength),s.reduce((a,c)=>a+c.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((r,n)=>r+n.reservedByteLength,e)}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(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,r){return this.setValid(e,this.isValid(r))&&this.setValue(e,r),this}setValue(e,r){this._setValue(this,e,r)}setValid(e,r){return this.length=this._nulls.set(e,+r).length,r}addChild(e,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(e){return this.children[e]||null}flush(){let e,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))?e=u==null?void 0:u.flush(l.last()):e=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:e,typeIds:r,nullBitmap:n,valueOffsets:i})}finish(){this.finished=!0;for(let e of this.children)e.finish();return this}clear(){var e,r,n,i;this.length=0,(e=this._nulls)===null||e===void 0||e.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(e){super(e),this._values=new as(this.ArrayType,0,this.stride)}setValue(e,r){let n=this._values;return n.reserve(e-n.length+1),super.setValue(e,r)}},kr=class extends at{constructor(e){super(e),this._pendingLength=0,this._offsets=new ca(e.type)}setValue(e,r){let n=this._pending||(this._pending=new Map),i=n.get(e);i&&(this._pendingLength-=i.length),this._pendingLength+=r instanceof gi?r[sa].length:r.length,n.set(e,r)}setValid(e,r){return super.setValid(e,r)?!0:((this._pending||(this._pending=new Map)).set(e,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 e=this._pending,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,r),this}}});var Oc,Iw=p(()=>{Oc=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,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(e,r,n,i){return e.prep(8,24),e.writeInt64(BigInt(i??0)),e.pad(4),e.writeInt32(n),e.writeInt64(BigInt(r??0)),e.offset()}}});var mP,Zn,pP=p(()=>{mP=me(Ve(),1);Iw();xu();Bp();rw();Zn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsFooter(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,r){return e.setPosition(e.position()+mP.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ot.V1}schema(e){let r=this.bb.__offset(this.bb_pos,6);return r?(e||new Sn).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}dictionaries(e,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Oc).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,r){let n=this.bb.__offset(this.bb_pos,10);return n?(r||new Oc).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Bt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,r){e.addFieldInt16(0,r,ot.V1)}static addSchema(e,r){e.addFieldOffset(1,r,0)}static addDictionaries(e,r){e.addFieldOffset(2,r,0)}static startDictionariesVector(e,r){e.startVector(24,r,8)}static addRecordBatches(e,r){e.addFieldOffset(3,r,0)}static startRecordBatchesVector(e,r){e.startVector(24,r,8)}static addCustomMetadata(e,r){e.addFieldOffset(4,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,r){e.finish(r)}static finishSizePrefixedFooterBuffer(e,r){e.finish(r,void 0,!0)}}});function S0(t,e){return new Map([...t||new Map,...e||new Map])}function Pw(t,e=new Map){for(let r=-1,n=t.length;++r<n;){let o=t[r].type;if(j.isDictionary(o)){if(!e.has(o.id))e.set(o.id,o.dictionary);else if(e.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&&Pw(o.children,e)}return e}var gP,yP,ve,ee,Gr=p(()=>{Dt();st();gP=Symbol.for("apache-arrow/Schema"),yP=Symbol.for("apache-arrow/Field"),ve=class t{static isSchema(e){return(e==null?void 0:e[gP])===!0}constructor(e=[],r,n,i=ot.V5){this.fields=e||[],this.metadata=r||new Map,n||(n=Pw(this.fields)),this.dictionaries=n,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,r)=>`${r}: ${e}`).join(", ")} }>`}select(e){let r=new Set(e),n=this.fields.filter(i=>r.has(i.name));return new t(n,this.metadata)}selectAt(e){let r=e.map(n=>this.fields[n]).filter(Boolean);return new t(r,this.metadata)}assign(...e){let r=e[0]instanceof t?e[0]:Array.isArray(e[0])?new t(e[0]):new t(e),n=[...this.fields],i=S0(S0(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:S0(S0(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),s=Pw(o,new Map);return new t([...n,...o],i,new Map([...this.dictionaries,...s]))}};ve.prototype.fields=null;ve.prototype.metadata=null;ve.prototype.dictionaries=null;ve.prototype[gP]=!0;Object.defineProperty(ve,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===ve&&ve.isSchema(e)}});ee=class t{static isField(e){return(e==null?void 0:e[yP])===!0}static new(...e){let[r,n,i,o]=e;return e[0]&&typeof e[0]=="object"&&({name:r}=e[0],n===void 0&&(n=e[0].type),i===void 0&&(i=e[0].nullable),o===void 0&&(o=e[0].metadata)),new t(`${r}`,n,i,o)}constructor(e,r,n=!1,i){this.name=e,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(...e){let[r,n,i,o]=e;return!e[0]||typeof e[0]!="object"?[r=this.name,n=this.type,i=this.nullable,o=this.metadata]=e:{name:r=this.name,type:n=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=e[0],t.new(r,n,i,o)}};ee.prototype.type=null;ee.prototype.name=null;ee.prototype.nullable=null;ee.prototype.metadata=null;ee.prototype[yP]=!0;Object.defineProperty(ee,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===ee&&ee.isField(e)}})});var M0,jH,zH,cs,Rw,Hi,Lw=p(()=>{Iw();pP();M0=me(Ve(),1);Gr();Dt();ur();xo();jH=M0.Builder,zH=M0.ByteBuffer,cs=class{static decode(e){e=new zH(se(e));let r=Zn.getRootAsFooter(e),n=ve.decode(r.schema(),new Map,r.version());return new Rw(n,r)}static encode(e){let r=new jH,n=ve.encode(r,e.schema);Zn.startRecordBatchesVector(r,e.numRecordBatches);for(let s of[...e.recordBatches()].slice().reverse())Hi.encode(r,s);let i=r.endVector();Zn.startDictionariesVector(r,e.numDictionaries);for(let s of[...e.dictionaryBatches()].slice().reverse())Hi.encode(r,s);let o=r.endVector();return Zn.startFooter(r),Zn.addSchema(r,n),Zn.addVersion(r,ot.V5),Zn.addRecordBatches(r,i),Zn.addDictionaries(r,o),Zn.finishFooterBuffer(r,Zn.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,r=ot.V5,n,i){this.schema=e,this.version=r,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let e,r=-1,n=this.numRecordBatches;++r<n;)(e=this.getRecordBatch(r))&&(yield e)}*dictionaryBatches(){for(let e,r=-1,n=this.numDictionaries;++r<n;)(e=this.getDictionaryBatch(r))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}},Rw=class extends cs{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(e,r){super(e,r.version()),this._footer=r}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let r=this._footer.recordBatches(e);if(r)return Hi.decode(r)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let r=this._footer.dictionaries(e);if(r)return Hi.decode(r)}return null}},Hi=class t{static decode(e){return new t(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,r){let{metaDataLength:n}=r,i=BigInt(r.offset),o=BigInt(r.bodyLength);return Oc.createBlock(e,i,n,o)}constructor(e,r,n){this.metaDataLength=e,this.offset=Le(n),this.bodyLength=Le(r)}}});var bP,Jn,wP=p(()=>{bP=me(Ve(),1);xu();qp();Bp();Jn=class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,r){return this.bb_pos=e,this.bb=r,this}static getRootAsMessage(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,r){return e.setPosition(e.position()+bP.SIZE_PREFIX_LENGTH),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ot.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):ke.NONE}header(e){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__union(e,this.bb_pos+r):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Bt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,r){e.addFieldInt16(0,r,ot.V1)}static addHeaderType(e,r){e.addFieldInt8(1,r,ke.NONE)}static addHeader(e,r){e.addFieldOffset(2,r,0)}static addBodyLength(e,r){e.addFieldInt64(3,r,BigInt("0"))}static addCustomMetadata(e,r){e.addFieldOffset(4,r,0)}static createCustomMetadataVector(e,r){e.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)e.addOffset(r[n]);return e.endVector()}static startCustomMetadataVector(e,r){e.startVector(4,r,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,r){e.finish(r)}static finishSizePrefixedMessageBuffer(e,r){e.finish(r,void 0,!0)}static createMessage(e,r,n,i,o,s){return t.startMessage(e),t.addVersion(e,r),t.addHeaderType(e,n),t.addHeader(e,i),t.addBodyLength(e,o),t.addCustomMetadata(e,s),t.endMessage(e)}}});var Ow,v0,xP=p(()=>{En();O6();jp();Xb();u6();h6();M6();m6();G6();j6();A6();Wb();Vb();Jb();Qb();Yb();$b();P6();E6();B6();ew();qb();Hb();Kb();Zb();Ow=class extends ie{visit(e,r){return e==null||r==null?void 0:super.visit(e,r)}visitNull(e,r){return bh.startNull(r),bh.endNull(r)}visitInt(e,r){return Di.startInt(r),Di.addBitWidth(r,e.bitWidth),Di.addIsSigned(r,e.isSigned),Di.endInt(r)}visitFloat(e,r){return ra.startFloatingPoint(r),ra.addPrecision(r,e.precision),ra.endFloatingPoint(r)}visitBinary(e,r){return fh.startBinary(r),fh.endBinary(r)}visitBinaryView(e,r){return hh.startBinaryView(r),hh.endBinaryView(r)}visitLargeBinary(e,r){return mh.startLargeBinary(r),mh.endLargeBinary(r)}visitBool(e,r){return dh.startBool(r),dh.endBool(r)}visitUtf8(e,r){return xh.startUtf8(r),xh.endUtf8(r)}visitUtf8View(e,r){return _h.startUtf8View(r),_h.endUtf8View(r)}visitLargeUtf8(e,r){return gh.startLargeUtf8(r),gh.endLargeUtf8(r)}visitDecimal(e,r){return wo.startDecimal(r),wo.addScale(r,e.scale),wo.addPrecision(r,e.precision),wo.addBitWidth(r,e.bitWidth),wo.endDecimal(r)}visitDate(e,r){return Js.startDate(r),Js.addUnit(r,e.unit),Js.endDate(r)}visitTime(e,r){return ns.startTime(r),ns.addUnit(r,e.unit),ns.addBitWidth(r,e.bitWidth),ns.endTime(r)}visitTimestamp(e,r){let n=e.timezone&&r.createString(e.timezone)||void 0;return is.startTimestamp(r),is.addUnit(r,e.unit),n!==void 0&&is.addTimezone(r,n),is.endTimestamp(r)}visitInterval(e,r){return na.startInterval(r),na.addUnit(r,e.unit),na.endInterval(r)}visitDuration(e,r){return Qs.startDuration(r),Qs.addUnit(r,e.unit),Qs.endDuration(r)}visitList(e,r){return yh.startList(r),yh.endList(r)}visitLargeList(e,r){return ph.startLargeList(r),ph.endLargeList(r)}visitStruct(e,r){return wh.startStruct_(r),wh.endStruct_(r)}visitUnion(e,r){Ni.startTypeIdsVector(r,e.typeIds.length);let n=Ni.createTypeIdsVector(r,e.typeIds);return Ni.startUnion(r),Ni.addMode(r,e.mode),Ni.addTypeIds(r,n),Ni.endUnion(r)}visitDictionary(e,r){let n=this.visit(e.indices,r);return bo.startDictionaryEncoding(r),bo.addId(r,BigInt(e.id)),bo.addIsOrdered(r,e.isOrdered),n!==void 0&&bo.addIndexType(r,n),bo.endDictionaryEncoding(r)}visitFixedSizeBinary(e,r){return ea.startFixedSizeBinary(r),ea.addByteWidth(r,e.byteWidth),ea.endFixedSizeBinary(r)}visitFixedSizeList(e,r){return ta.startFixedSizeList(r),ta.addListSize(r,e.listSize),ta.endFixedSizeList(r)}visitMap(e,r){return ia.startMap(r),ia.addKeysSorted(r,e.keysSorted),ia.endMap(r)}},v0=new Ow});function vP(t,e=new Map){return new ve(qH(t,e),E0(t.metadata),e)}function Cw(t){return new nr(t.count,TP(t.columns),AP(t.columns),null,IP(t.columns))}function EP(t){return new Ur(Cw(t.data),t.id,t.isDelta)}function qH(t,e){return(t.fields||[]).filter(Boolean).map(r=>ee.fromJSON(r,e))}function _P(t,e){return(t.children||[]).filter(Boolean).map(r=>ee.fromJSON(r,e))}function TP(t){return(t||[]).reduce((e,r)=>[...e,new bi(r.count,VH(r.VALIDITY)),...TP(r.children)],[])}function AP(t,e=[]){for(let r=-1,n=(t||[]).length;++r<n;){let i=t[r];if(i.VALIDITY&&e.push(new $t(e.length,i.VALIDITY.length)),i.TYPE_ID&&e.push(new $t(e.length,i.TYPE_ID.length)),i.OFFSET&&e.push(new $t(e.length,i.OFFSET.length)),i.DATA&&e.push(new $t(e.length,i.DATA.length)),i.VIEWS&&e.push(new $t(e.length,i.VIEWS.length)),i.VARIADIC_DATA_BUFFERS)for(let o of i.VARIADIC_DATA_BUFFERS)e.push(new $t(e.length,o.length));e=AP(i.children,e)}return e}function VH(t){return(t||[]).reduce((e,r)=>e+ +(r===0),0)}function IP(t){return(t||[]).reduce((e,r)=>[...e,...r.VARIADIC_DATA_BUFFERS?[r.VARIADIC_DATA_BUFFERS.length]:[],...IP(r.children)],[])}function PP(t,e){let r,n,i,o,s,a;return!e||!(o=t.dictionary)?(s=MP(t,_P(t,e)),i=new ee(t.name,s,t.nullable,E0(t.metadata))):e.has(r=o.id)?(n=(n=o.indexType)?SP(n):new hr,a=new mr(e.get(r),n,r,o.isOrdered),i=new ee(t.name,a,t.nullable,E0(t.metadata))):(n=(n=o.indexType)?SP(n):new hr,e.set(r,s=MP(t,_P(t,e))),a=new mr(s,n,r,o.isOrdered),i=new ee(t.name,a,t.nullable,E0(t.metadata))),i||null}function E0(t=[]){return new Map(t.map(({key:e,value:r})=>[e,r]))}function SP(t){return new Wt(t.isSigned,t.bitWidth)}function MP(t,e){let r=t.type.name;switch(r){case"NONE":return new Xt;case"null":return new Xt;case"binary":return new Wn;case"largebinary":return new qi;case"binaryview":return new Ee;case"utf8":return new Jr;case"largeutf8":return new Vi;case"utf8view":return new Qr;case"bool":return new en;case"list":return new dr((e||[])[0]);case"largelist":return new Hn((e||[])[0]);case"struct":return new Qe(e||[]);case"struct_":return new Qe(e||[])}switch(r){case"int":{let n=t.type;return new Wt(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=t.type;return new Zr(rt[n.precision])}case"decimal":{let n=t.type;return new $n(n.scale,n.precision,n.bitWidth)}case"date":{let n=t.type;return new vn(ut[n.unit])}case"time":{let n=t.type;return new Dr(W[n.unit],n.bitWidth)}case"timestamp":{let n=t.type;return new Nr(W[n.unit],n.timezone)}case"interval":{let n=t.type;return new tn(qe[n.unit])}case"duration":{let n=t.type;return new rn(W[n.unit])}case"union":{let n=t.type,[i,...o]=(n.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new nn(Ze[s],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=t.type;return new Kn(n.byteWidth)}case"fixedsizelist":{let n=t.type;return new Yt(n.listSize,(e||[])[0])}case"map":{let n=t.type;return new on((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}var RP=p(()=>{Gr();st();la();Dt()});function HH(t,e){return(()=>{switch(e){case ke.Schema:return ve.fromJSON(t);case ke.RecordBatch:return nr.fromJSON(t);case ke.DictionaryBatch:return Ur.fromJSON(t)}throw new Error(`Unrecognized Message type: { name: ${ke[e]}, type: ${e} }`)})}function KH(t,e){return(()=>{switch(e){case ke.Schema:return ve.decode(t.header(new Sn),new Map,t.version());case ke.RecordBatch:return nr.decode(t.header(new Cr),t.version());case ke.DictionaryBatch:return Ur.decode(t.header(new rs),t.version())}throw new Error(`Unrecognized Message type: { name: ${ke[e]}, type: ${e} }`)})}function XH(t,e=new Map,r=ot.V5){let n=nK(t,e);return new ve(n,T0(t),e,r)}function YH(t,e=ot.V5){return new nr(t.length(),eK(t),tK(t,e),BP(t.compression()),rK(t))}function ZH(t,e=ot.V5){return new Ur(nr.decode(t.data(),e),t.id(),t.isDelta())}function JH(t){return new $t(t.offset(),t.length())}function QH(t){return new bi(t.length(),t.nullCount())}function eK(t){let e=[];for(let r,n=-1,i=-1,o=t.nodesLength();++n<o;)(r=t.nodes(n))&&(e[++i]=bi.decode(r));return e}function tK(t,e){let r=[];for(let n,i=-1,o=-1,s=t.buffersLength();++i<s;)(n=t.buffers(i))&&(e<ot.V4&&(n.bb_pos+=8*(i+1)),r[++o]=$t.decode(n));return r}function rK(t){let e=[],r=Math.trunc(t.variadicBufferCountsLength());for(let n=0;n<r;++n)e.push(Le(t.variadicBufferCounts(n)));return e}function nK(t,e){let r=[];for(let n,i=-1,o=-1,s=t.fieldsLength();++i<s;)(n=t.fields(i))&&(r[++o]=ee.decode(n,e));return r}function LP(t,e){let r=[];for(let n,i=-1,o=-1,s=t.childrenLength();++i<s;)(n=t.children(i))&&(r[++o]=ee.decode(n,e));return r}function iK(t,e){let r,n,i,o,s,a;return!e||!(a=t.dictionary())?(i=CP(t,LP(t,e)),n=new ee(t.name(),i,t.nullable(),T0(t))):e.has(r=Le(a.id()))?(o=(o=a.indexType())?OP(o):new hr,s=new mr(e.get(r),o,r,a.isOrdered()),n=new ee(t.name(),s,t.nullable(),T0(t))):(o=(o=a.indexType())?OP(o):new hr,e.set(r,i=CP(t,LP(t,e))),s=new mr(i,o,r,a.isOrdered()),n=new ee(t.name(),s,t.nullable(),T0(t))),n||null}function T0(t){let e=new Map;if(t)for(let r,n,i=-1,o=Math.trunc(t.customMetadataLength());++i<o;)(r=t.customMetadata(i))&&(n=r.key())!=null&&e.set(n,r.value());return e}function oK(t){let e=new Map;for(let r,n,i=-1,o=Math.trunc(t.customMetadataLength());++i<o;)(r=t.customMetadata(i))&&(n=r.key())!=null&&e.set(n,r.value());return e}function OP(t){return new Wt(t.isSigned(),t.bitWidth())}function CP(t,e){let r=t.typeType();switch(r){case pe.NONE:return new Xt;case pe.Null:return new Xt;case pe.Binary:return new Wn;case pe.LargeBinary:return new qi;case pe.BinaryView:return new Ee;case pe.Utf8:return new Jr;case pe.LargeUtf8:return new Vi;case pe.Utf8View:return new Qr;case pe.Bool:return new en;case pe.List:return new dr((e||[])[0]);case pe.LargeList:return new Hn((e||[])[0]);case pe.Struct_:return new Qe(e||[])}switch(r){case pe.Int:{let n=t.type(new Di);return new Wt(n.isSigned(),n.bitWidth())}case pe.FloatingPoint:{let n=t.type(new ra);return new Zr(n.precision())}case pe.Decimal:{let n=t.type(new wo);return new $n(n.scale(),n.precision(),n.bitWidth())}case pe.Date:{let n=t.type(new Js);return new vn(n.unit())}case pe.Time:{let n=t.type(new ns);return new Dr(n.unit(),n.bitWidth())}case pe.Timestamp:{let n=t.type(new is);return new Nr(n.unit(),n.timezone())}case pe.Interval:{let n=t.type(new na);return new tn(n.unit())}case pe.Duration:{let n=t.type(new Qs);return new rn(n.unit())}case pe.Union:{let n=t.type(new Ni);return new nn(n.mode(),n.typeIdsArray()||[],e||[])}case pe.FixedSizeBinary:{let n=t.type(new ea);return new Kn(n.byteWidth())}case pe.FixedSizeList:{let n=t.type(new ta);return new Yt(n.listSize(),(e||[])[0])}case pe.Map:{let n=t.type(new ia);return new on((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${pe[r]}" (${r})`)}function BP(t){return t?new Cc(t.codec(),t.method()):null}function sK(t,e){let r=e.fields.map(o=>ee.encode(t,o));Sn.startFieldsVector(t,r.length);let n=Sn.createFieldsVector(t,r),i=e.metadata&&e.metadata.size>0?Sn.createCustomMetadataVector(t,[...e.metadata].map(([o,s])=>{let a=t.createString(`${o}`),c=t.createString(`${s}`);return Bt.startKeyValue(t),Bt.addKey(t,a),Bt.addValue(t,c),Bt.endKeyValue(t)})):-1;return Sn.startSchema(t),Sn.addFields(t,n),Sn.addEndianness(t,hK?Zs.Little:Zs.Big),i!==-1&&Sn.addCustomMetadata(t,i),Sn.endSchema(t)}function aK(t,e){let r=-1,n=-1,i=-1,o=e.type,s=e.typeId;j.isDictionary(o)?(s=o.dictionary.typeId,i=v0.visit(o,t),n=v0.visit(o.dictionary,t)):n=v0.visit(o,t);let a=(o.children||[]).map(u=>ee.encode(t,u)),c=Br.createChildrenVector(t,a),l=e.metadata&&e.metadata.size>0?Br.createCustomMetadataVector(t,[...e.metadata].map(([u,h])=>{let d=t.createString(`${u}`),m=t.createString(`${h}`);return Bt.startKeyValue(t),Bt.addKey(t,d),Bt.addValue(t,m),Bt.endKeyValue(t)})):-1;return e.name&&(r=t.createString(e.name)),Br.startField(t),Br.addType(t,n),Br.addTypeType(t,s),Br.addChildren(t,c),Br.addNullable(t,!!e.nullable),r!==-1&&Br.addName(t,r),i!==-1&&Br.addDictionary(t,i),l!==-1&&Br.addCustomMetadata(t,l),Br.endField(t)}function cK(t,e){let r=e.nodes||[],n=e.buffers||[],i=e.variadicBufferCounts||[];Cr.startNodesVector(t,r.length);for(let l of r.slice().reverse())bi.encode(t,l);let o=t.endVector();Cr.startBuffersVector(t,n.length);for(let l of n.slice().reverse())$t.encode(t,l);let s=t.endVector(),a=null;e.compression!==null&&(a=DP(t,e.compression));let c=-1;return i.length>0&&(c=Cr.createVariadicBufferCountsVector(t,i.map(BigInt))),Cr.startRecordBatch(t),Cr.addLength(t,BigInt(e.length)),Cr.addNodes(t,o),Cr.addBuffers(t,s),e.compression!==null&&a&&Cr.addCompression(t,a),c!==-1&&Cr.addVariadicBufferCounts(t,c),Cr.endRecordBatch(t)}function DP(t,e){return ts.startBodyCompression(t),ts.addCodec(t,e.type),ts.addMethod(t,e.method),ts.endBodyCompression(t)}function lK(t,e){let r=nr.encode(t,e.data);return rs.startDictionaryBatch(t),rs.addId(t,BigInt(e.id)),rs.addIsDelta(t,e.isDelta),rs.addData(t,r),rs.endDictionaryBatch(t)}function uK(t,e){return wu.createFieldNode(t,BigInt(e.length),BigInt(e.nullCount))}function fK(t,e){return bu.createBuffer(t,BigInt(e.offset),BigInt(e.length))}var A0,WH,$H,jr,nr,Ur,$t,bi,Cc,hK,la=p(()=>{A0=me(Ve(),1);rw();jp();jb();i6();Gb();tw();Ub();zp();xu();zb();Xb();Wb();Vb();Jb();Qb();Yb();$b();ew();Hb();Kb();Zb();wP();kb();Fb();Gr();ur();xo();Dt();xP();RP();st();WH=A0.Builder,$H=A0.ByteBuffer,jr=class t{static fromJSON(e,r){let n=new t(0,ot.V5,r);return n._createHeader=HH(e,r),n}static decode(e){e=new $H(se(e));let r=Jn.getRootAsMessage(e),n=r.bodyLength(),i=r.version(),o=r.headerType(),s=oK(r),a=new t(n,i,o,void 0,s);return a._createHeader=KH(r,o),a}static encode(e){let r=new WH,n=-1;e.isSchema()?n=ve.encode(r,e.header()):e.isRecordBatch()?n=nr.encode(r,e.header()):e.isDictionaryBatch()&&(n=Ur.encode(r,e.header()));let i=e.metadata&&e.metadata.size>0?Jn.createCustomMetadataVector(r,[...e.metadata].map(([o,s])=>{let a=r.createString(`${o}`),c=r.createString(`${s}`);return Bt.startKeyValue(r),Bt.addKey(r,a),Bt.addValue(r,c),Bt.endKeyValue(r)})):-1;return Jn.startMessage(r),Jn.addVersion(r,ot.V5),Jn.addHeader(r,n),Jn.addHeaderType(r,e.headerType),Jn.addBodyLength(r,BigInt(e.bodyLength)),i!==-1&&Jn.addCustomMetadata(r,i),Jn.finishMessageBuffer(r,Jn.endMessage(r)),r.asUint8Array()}static from(e,r=0){if(e instanceof ve)return new t(0,ot.V5,ke.Schema,e);if(e instanceof nr)return new t(r,ot.V5,ke.RecordBatch,e,e.metadata);if(e instanceof Ur)return new t(r,ot.V5,ke.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}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===ke.Schema}isRecordBatch(){return this.headerType===ke.RecordBatch}isDictionaryBatch(){return this.headerType===ke.DictionaryBatch}constructor(e,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(e),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(e,r,n,i,o=[],s){this._nodes=r,this._buffers=n,this._length=Le(e),this._compression=i,this._variadicBufferCounts=o,this._metadata=s||new Map}},Ur=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(e,r,n=!1){this._data=e,this._isDelta=n,this._id=Le(r)}},$t=class{constructor(e,r){this.offset=Le(e),this.length=Le(r)}},bi=class{constructor(e,r){this.length=Le(e),this.nullCount=Le(r)}},Cc=class{constructor(e,r=fc.BUFFER){this.type=e,this.method=r}};ee.encode=aK;ee.decode=iK;ee.fromJSON=PP;ve.encode=sK;ve.decode=XH;ve.fromJSON=vP;nr.encode=cK;nr.decode=YH;nr.fromJSON=Cw;Ur.encode=lK;Ur.decode=ZH;Ur.fromJSON=EP;bi.encode=uK;bi.decode=QH;$t.encode=fK;$t.decode=JH;Cc.encode=DP;Cc.decode=BP;hK=(()=>{let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),new Int16Array(t)[0]===256})()});var St,Nh,Bc,I0,Fh=p(()=>{Ar();gu();St=Object.freeze({done:!0,value:void 0}),Nh=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Bc=class{tee(){return this._getDOMStream().tee()}pipe(e,r){return this._getNodeStream().pipe(e,r)}pipeTo(e,r){return this._getDOMStream().pipeTo(e,r)}pipeThrough(e,r){return this._getDOMStream().pipeThrough(e,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},I0=class extends Bc{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return $(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(St);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return fr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return fr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return $(this,void 0,void 0,function*(){return yield this.abort(e),St})}return(e){return $(this,void 0,void 0,function*(){return yield this.close(),St})}read(e){return $(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return $(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){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 An,wi,zr,Bw,ls,To=p(()=>{Ar();gu();Qo();Fh();ur();es();An=class extends I0{write(e){if((e=se(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?pu(this.toUint8Array(!0)):this.toUint8Array(!1).then(pu)}toUint8Array(e=!1){return e?zn(this._values)[0]:$(this,void 0,void 0,function*(){var r,n,i,o;let s=[],a=0;try{for(var c=!0,l=kn(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 zn(s,a)[0]})}},wi=class{constructor(e){e&&(this.source=new Bw(fr.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},zr=class t{constructor(e){e instanceof t?this.source=e.source:e instanceof An?this.source=new ls(fr.fromAsyncIterable(e)):Lp(e)?this.source=new ls(fr.fromNodeStream(e)):sh(e)?this.source=new ls(fr.fromDOMStream(e)):Pp(e)?this.source=new ls(fr.fromDOMStream(e.body)):jn(e)?this.source=new ls(fr.fromIterable(e)):Un(e)?this.source=new ls(fr.fromAsyncIterable(e)):xn(e)&&(this.source=new ls(fr.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Bw=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,r="read"){return this.source.next({cmd:r,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||St)}return(e){return Object.create(this.source.return&&this.source.return(e)||St)}},ls=class{constructor(e){this.source=e,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}cancel(e){return $(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return $(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return $(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return $(this,arguments,void 0,function*(r,n="read"){return yield this.source.next({cmd:n,size:r})})}throw(e){return $(this,void 0,void 0,function*(){let r=this.source.throw&&(yield this.source.throw(e))||St;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}return(e){return $(this,void 0,void 0,function*(){let r=this.source.return&&(yield this.source.return(e))||St;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}}});var kh,ua,Dw=p(()=>{Ar();To();ur();kh=class extends wi{constructor(e,r){super(),this.position=0,this.buffer=se(e),this.size=r===void 0?this.buffer.byteLength:r}readInt32(e){let{buffer:r,byteOffset:n}=this.readAt(e,4);return new DataView(r,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){let{buffer:r,size:n,position:i}=this;return r&&i<n?(typeof e!="number"&&(e=Number.POSITIVE_INFINITY),this.position=Math.min(n,i+Math.min(n-i,e)),r.subarray(i,this.position)):null}readAt(e,r){let n=this.buffer,i=Math.min(this.size,e+r);return n?n.subarray(e,i):new Uint8Array(r)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}},ua=class extends zr{constructor(e,r){super(),this.position=0,this._handle=e,typeof r=="number"?this.size=r:this._pending=$(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending})}readInt32(e){return $(this,void 0,void 0,function*(){let{buffer:r,byteOffset:n}=yield this.readAt(e,4);return new DataView(r,n).getInt32(0,!0)})}seek(e){return $(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return $(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n,position:i}=this;if(r&&i<n){typeof e!="number"&&(e=Number.POSITIVE_INFINITY);let o=i,s=0,a=0,c=Math.min(n,o+Math.min(n-o,e)),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(e,r){return $(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&e+r<i){let o=Math.min(i,e+r),s=new Uint8Array(o-e);return(yield n.read(s,0,r,e)).buffer}return new Uint8Array(r)})}close(){return $(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return $(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return $(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}}});var Fw={};Jt(Fw,{BaseInt64:()=>Gh,Int128:()=>Uh,Int64:()=>us,Uint64:()=>Nt});function Du(t){return t<0&&(t=4294967295+t+1),`0x${t.toString(16)}`}var Nu,Nw,Gh,Nt,us,Uh,kw=p(()=>{Nu=8,Nw=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Gh=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let r=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.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(e){let r=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],r<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=r}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return`${Du(this.buffer[1])} ${Du(this.buffer[0])}`}},Nt=class t extends Gh{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,r=new Uint32Array(2)){return t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(2)){return t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(2)){let n=e.length,i=new t(r);for(let o=0;o<n;){let s=Nu<n-o?Nu:n-o,a=new t(new Uint32Array([Number.parseInt(e.slice(o,o+s),10),0])),c=new t(new Uint32Array([Nw[s],0]));i.times(c),i.plus(a),o+=s}return i}static convertArray(e){let r=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)t.from(e[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(e,r){return new t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new t(new Uint32Array(e.buffer)).plus(r)}},us=class t extends Gh{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){let r=this.buffer[1]<<0,n=e.buffer[1]<<0;return r<n||r===n&&this.buffer[0]<e.buffer[0]}static from(e,r=new Uint32Array(2)){return t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(2)){return t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(2)){let n=e.startsWith("-"),i=e.length,o=new t(r);for(let s=n?1:0;s<i;){let a=Nu<i-s?Nu:i-s,c=new t(new Uint32Array([Number.parseInt(e.slice(s,s+a),10),0])),l=new t(new Uint32Array([Nw[a],0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(e){let r=new Uint32Array(e.length*2);for(let n=-1,i=e.length;++n<i;)t.from(e[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(e,r){return new t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new t(new Uint32Array(e.buffer)).plus(r)}},Uh=class t{constructor(e){this.buffer=e}high(){return new us(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new us(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(e){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([e.buffer[3],0])),a=new Nt(new Uint32Array([e.buffer[2],0])),c=new Nt(new Uint32Array([e.buffer[1],0])),l=new Nt(new Uint32Array([e.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(e){let r=new Uint32Array(4);return r[3]=this.buffer[3]+e.buffer[3]>>>0,r[2]=this.buffer[2]+e.buffer[2]>>>0,r[1]=this.buffer[1]+e.buffer[1]>>>0,r[0]=this.buffer[0]+e.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`${Du(this.buffer[3])} ${Du(this.buffer[2])} ${Du(this.buffer[1])} ${Du(this.buffer[0])}`}static multiply(e,r){return new t(new Uint32Array(e.buffer)).times(r)}static add(e,r){return new t(new Uint32Array(e.buffer)).plus(r)}static from(e,r=new Uint32Array(4)){return t.fromString(typeof e=="string"?e:e.toString(),r)}static fromNumber(e,r=new Uint32Array(4)){return t.fromString(e.toString(),r)}static fromString(e,r=new Uint32Array(4)){let n=e.startsWith("-"),i=e.length,o=new t(r);for(let s=n?1:0;s<i;){let a=Nu<i-s?Nu:i-s,c=new t(new Uint32Array([Number.parseInt(e.slice(s,s+a),10),0,0,0])),l=new t(new Uint32Array([Nw[a],0,0,0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(e){let r=new Uint32Array(e.length*4);for(let n=-1,i=e.length;++n<i;)t.from(e[n],new Uint32Array(r.buffer,r.byteOffset+16*n,4));return r}}});var qw={};Jt(qw,{toIntervalDayTimeInt32Array:()=>Gw,toIntervalDayTimeObjects:()=>jw,toIntervalMonthDayNanoInt32Array:()=>Uw,toIntervalMonthDayNanoObjects:()=>zw});function Gw(t){var e,r;let n=t.length,i=new Int32Array(n*2);for(let o=0,s=0;o<n;o++){let a=t[o];i[s++]=(e=a.days)!==null&&e!==void 0?e:0,i[s++]=(r=a.milliseconds)!==null&&r!==void 0?r:0}return i}function Uw(t){var e,r;let n=t.length,i=new Int32Array(n*4);for(let o=0,s=0;o<n;o++){let a=t[o];i[s++]=(e=a.months)!==null&&e!==void 0?e: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 jw(t){let e=t.length,r=new Array(e/2);for(let n=0,i=0;n<e;n+=2)r[i++]={days:t[n],milliseconds:t[n+1]};return r}function zw(t,e){let r=t.length,n=new Array(r/4);for(let i=0,o=0;i<r;i+=4){let s=BigInt(t[i+3])<<BigInt(32)|BigInt(t[i+2]>>>0);n[o++]={months:t[i],days:t[i+1],nanoseconds:e?`${s}`:s}}return n}var P0=p(()=>{});function FP(t){let e=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)e[r>>1]=Number.parseInt(t.slice(r,r+2),16);return e}function dK(t){return FP(t.join(""))}function kP(t,e){let r=new Uint8Array(t.length*16),n=new DataView(r.buffer);for(let[i,o]of t.entries()){let s=i*16,a=o.SIZE;if(n.setInt32(s,a,!0),o.INLINED!==void 0){let c=e(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 mK(t){return kP(t,e=>{let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n>>1]=Number.parseInt(e.slice(n,n+2),16);return r})}function pK(t){return kP(t,e=>new TextEncoder().encode(e))}var Fu,R0,L0,GP=p(()=>{yi();Gr();st();En();Rc();Qo();kw();Dt();ur();P0();Fu=class extends ie{constructor(e,r,n,i,o=ot.V5,s=[]){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.variadicBufferIndex=-1,this.bytes=e,this.nodes=r,this.buffers=n,this.dictionaries=i,this.metadataVersion=o,this.variadicBufferCounts=s}visit(e){return super.visit(e instanceof ee?e.type:e)}visitNull(e,{length:r}=this.nextFieldNode()){return te({type:e,length:r})}visitBool(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitInt(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFloat(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitUtf8(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeUtf8(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitUtf8View(e,{length:r,nullCount:n}=this.nextFieldNode()){let i=this.readNullBitmap(e,n),o=this.readData(e),s=this.readVariadicBuffers(this.nextVariadicBufferCount());return te({type:e,length:r,nullCount:n,nullBitmap:i,views:o,variadicBuffers:s})}visitBinary(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeBinary(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitBinaryView(e,{length:r,nullCount:n}=this.nextFieldNode()){let i=this.readNullBitmap(e,n),o=this.readData(e),s=this.readVariadicBuffers(this.nextVariadicBufferCount());return te({type:e,length:r,nullCount:n,nullBitmap:i,views:o,variadicBuffers:s})}visitFixedSizeBinary(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDate(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTimestamp(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTime(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDecimal(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitList(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitLargeList(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitStruct(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),children:this.visitMany(e.children)})}visitUnion(e,{length:r,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<ot.V5&&this.readNullBitmap(e,n),e.mode===Ze.Sparse?this.visitSparseUnion(e,{length:r,nullCount:n}):this.visitDenseUnion(e,{length:r,nullCount:n})}visitDenseUnion(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,typeIds:this.readTypeIds(e),valueOffsets:this.readOffsets(e),children:this.visitMany(e.children)})}visitSparseUnion(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,typeIds:this.readTypeIds(e),children:this.visitMany(e.children)})}visitDictionary(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e.indices),dictionary:this.readDictionary(e)})}visitInterval(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDuration(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFixedSizeList(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),child:this.visit(e.children[0])})}visitMap(e,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:e,length:r,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,r,n=this.nextBufferRange()){return r>0&&this.readData(e,n)||new Uint8Array(0)}readOffsets(e,r){return this.readData(e,r)}readTypeIds(e,r){return this.readData(e,r)}readData(e,{length:r,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+r)}readVariadicBuffers(e){return Array.from({length:e},()=>this.readData(null))}nextVariadicBufferCount(){var e;return(e=this.variadicBufferCounts[++this.variadicBufferIndex])!==null&&e!==void 0?e:0}readDictionary(e){return this.dictionaries.get(e.id)}},R0=class extends Fu{constructor(e,r,n,i,o,s=[]){super(new Uint8Array(0),r,n,i,o,s),this.sources=e}readNullBitmap(e,r,{offset:n}=this.nextBufferRange()){return r<=0?new Uint8Array(0):Pc(this.sources[n])}readOffsets(e,{offset:r}=this.nextBufferRange()){return Re(Uint8Array,Re(e.OffsetArrayType,this.sources[r]))}readTypeIds(e,{offset:r}=this.nextBufferRange()){return Re(Uint8Array,Re(e.ArrayType,this.sources[r]))}readData(e,{offset:r}=this.nextBufferRange()){let{sources:n}=this;if(j.isTimestamp(e))return Re(Uint8Array,us.convertArray(n[r]));if((j.isInt(e)||j.isTime(e))&&e.bitWidth===64||j.isDuration(e))return Re(Uint8Array,us.convertArray(n[r]));if(j.isDate(e)&&e.unit===ut.MILLISECOND)return Re(Uint8Array,us.convertArray(n[r]));if(j.isDecimal(e))return Re(Uint8Array,Uh.convertArray(n[r]));if(j.isBinary(e)||j.isLargeBinary(e)||j.isFixedSizeBinary(e))return dK(n[r]);if(j.isBinaryView(e))return mK(n[r]);if(j.isUtf8View(e))return pK(n[r]);if(j.isBool(e))return Pc(n[r]);if(j.isUtf8(e)||j.isLargeUtf8(e))return Gn(n[r].join(""));if(j.isInterval(e))switch(e.unit){case qe.DAY_TIME:return Gw(n[r]);case qe.MONTH_DAY_NANO:return Uw(n[r]);default:break}return Re(Uint8Array,Re(e.ArrayType,n[r].map(i=>+i)))}readVariadicBuffers(e){let r=[];for(let n=0;n<e;n++){let{offset:i}=this.nextBufferRange(),o=this.sources[i];r.push(FP(o))}return r}};L0=class extends Fu{constructor(e,r,n,i,o,s=[]){super(new Uint8Array(0),r,n,i,o,s),this.bodyChunks=e}readData(e,r=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}});var fs,O0=p(()=>{$i();bt();ur();fs=class extends kr{constructor(e){super(e),this._values=new Tn(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,se(r))}_flushPending(e,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of e)if(a===void 0)n.set(s,0);else{let c=a.length;i.set(a,o),n.set(s,c),o+=c}}}});var hs,C0=p(()=>{ur();$i();bt();hs=class extends kr{constructor(e){super(e),this._values=new Tn(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,se(r))}_flushPending(e,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of e)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 Dc,Vw=p(()=>{$i();bt();Dc=class extends at{constructor(e){super(e),this._values=new Bu}setValue(e,r){this._values.set(e,+r)}}});var Ao,fa,ha,Ww=p(()=>{bt();Yn();Ao=class extends rr{};Ao.prototype._setValue=fw;fa=class extends Ao{};fa.prototype._setValue=$p;ha=class extends Ao{};ha.prototype._setValue=Hp});var da,$w=p(()=>{bt();Yn();da=class extends rr{};da.prototype._setValue=mw});var Nc,Hw=p(()=>{st();bt();ku();Nc=class extends at{constructor({type:e,nullValues:r,dictionaryHashFunction:n}){super({type:new mr(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Qn({type:this.type.indices,nullValues:r}),this.dictionary=Qn({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(e){return this.indices.isValid(e)}setValid(e,r){let n=this.indices;return r=n.setValid(e,r),this.length=n.length,r}setValue(e,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(e,o)}flush(){let e=this.type,r=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(e);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(e){return typeof e=="string"?e:`${e}`}}});var ma,Kw=p(()=>{bt();Yn();ma=class extends rr{};ma.prototype._setValue=uw});var Fc,Xw=p(()=>{Gr();bt();st();Fc=class extends at{setValue(e,r){let[n]=this.children,i=e*this.stride;for(let o=-1,s=this.stride;++o<s;)n.set(i+o,r[o])}setValid(e,r){return super.setValid(e,r)||this.children[0].setValid((e+1)*this.stride-1,!1),r}addChild(e,r="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(e);return this.type=new Yt(this.type.listSize,new ee(r,e.type,!0)),n}}});var Io,kc,Gc,Uc,Yw=p(()=>{Rh();bt();Io=class extends rr{setValue(e,r){this._values.set(e,r)}},kc=class extends Io{setValue(e,r){super.setValue(e,Ph(r))}},Gc=class extends Io{},Uc=class extends Io{}});var Ki,pa,ga,ya,Zw=p(()=>{bt();Yn();Ki=class extends rr{};Ki.prototype._setValue=pw;pa=class extends Ki{};pa.prototype._setValue=r0;ga=class extends Ki{};ga.prototype._setValue=n0;ya=class extends Ki{};ya.prototype._setValue=i0});var xi,ba,wa,xa,_a,Jw=p(()=>{bt();Yn();xi=class extends rr{};xi.prototype._setValue=gw;ba=class extends xi{};ba.prototype._setValue=o0;wa=class extends xi{};wa.prototype._setValue=s0;xa=class extends xi{};xa.prototype._setValue=a0;_a=class extends xi{};_a.prototype._setValue=c0});var sn,jc,zc,qc,Vc,Wc,$c,Hc,Kc,Qw=p(()=>{bt();sn=class extends rr{setValue(e,r){this._values.set(e,r)}},jc=class extends sn{},zc=class extends sn{},qc=class extends sn{},Vc=class extends sn{},Wc=class extends sn{},$c=class extends sn{},Hc=class extends sn{},Kc=class extends sn{}});var Xc,ex=p(()=>{Gr();st();$i();bt();Xc=class extends kr{constructor(e){super(e),this._offsets=new ca(e.type)}addChild(e,r="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new dr(new ee(r,e.type,!0)),this.numChildren-1}_flushPending(e){let r=this._offsets,[n]=this.children;for(let[i,o]of e)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 Yc,tx=p(()=>{Gr();st();$i();xo();bt();Yc=class extends kr{constructor(e){super(e),this._offsets=new ca(e.type)}addChild(e,r="0"){if(this.numChildren>0)throw new Error("LargeListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new Hn(new ee(r,e.type,!0)),this.numChildren-1}_flushPending(e){let r=this._offsets,[n]=this.children;for(let[i,o]of e)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 Zc,rx=p(()=>{Gr();st();bt();Zc=class extends kr{set(e,r){return super.set(e,r)}setValue(e,r){let n=r instanceof Map?r:new Map(Object.entries(r)),i=this._pending||(this._pending=new Map),o=i.get(e);o&&(this._pendingLength-=o.size),this._pendingLength+=n.size,i.set(e,n)}addChild(e,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new on(new ee(r,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let r=this._offsets,[n]=this.children;for(let[i,o]of e)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 Jc,nx=p(()=>{bt();Jc=class extends at{setValue(e,r){}setValid(e,r){return this.length=Math.max(e+1,this.length),r}}});var Qc,ix=p(()=>{Gr();bt();st();Qc=class extends at{setValue(e,r){let{children:n,type:i}=this;switch(Array.isArray(r)||r.constructor){case!0:return i.children.forEach((o,s)=>n[s].set(e,r[s]));case Map:return i.children.forEach((o,s)=>n[s].set(e,r.get(o.name)));default:return i.children.forEach((o,s)=>n[s].set(e,r[o.name]))}}setValid(e,r){return super.setValid(e,r)||this.children.forEach(n=>n.setValid(e,r)),r}addChild(e,r=`${this.numChildren}`){let n=this.children.push(e);return this.type=new Qe([...this.type.children,new ee(r,e.type,!0)]),n}}});var _i,Sa,Ma,va,Ea,ox=p(()=>{bt();Yn();_i=class extends rr{};_i.prototype._setValue=hw;Sa=class extends _i{};Sa.prototype._setValue=Kp;Ma=class extends _i{};Ma.prototype._setValue=Xp;va=class extends _i{};va.prototype._setValue=Yp;Ea=class extends _i{};Ea.prototype._setValue=Zp});var Si,Ta,Aa,Ia,Pa,sx=p(()=>{bt();Yn();Si=class extends rr{};Si.prototype._setValue=dw;Ta=class extends Si{};Ta.prototype._setValue=Jp;Aa=class extends Si{};Aa.prototype._setValue=Qp;Ia=class extends Si{};Ia.prototype._setValue=e0;Pa=class extends Si{};Pa.prototype._setValue=t0});var ds,el,tl,ax=p(()=>{Gr();$i();bt();st();ds=class extends at{constructor(e){super(e),this._typeIds=new as(Int8Array,0,1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,r){return this.set(this.length,e,r)}set(e,r,n){return n===void 0&&(n=this._valueToChildTypeId(this,r,e)),this.setValue(e,r,n),this}setValue(e,r,n){this._typeIds.set(e,n);let i=this.type.typeIdToChildIndex[n],o=this.children[i];o==null||o.set(e,r),this.length=Math.max(e+1,this.length)}addChild(e,r=`${this.children.length}`){let n=this.children.push(e),{type:{children:i,mode:o,typeIds:s}}=this,a=[...i,new ee(r,e.type)];return this.type=new nn(o,[...s,n],a),n}_valueToChildTypeId(e,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.")}},el=class extends ds{},tl=class extends ds{constructor(e){super(e),this._offsets=new as(Int32Array)}setValue(e,r,n){let i=this._typeIds.set(e,n).buffer[e],o=this.getChildAt(this.type.typeIdToChildIndex[i]),s=this._offsets.set(e,o.length).buffer[e];o==null||o.set(s,r),this.length=Math.max(e+1,this.length)}}});var Ra,cx=p(()=>{Qo();O0();$i();bt();Ra=class extends kr{constructor(e){super(e),this._values=new Tn(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,Gn(r))}_flushPending(e,r){}};Ra.prototype._flushPending=fs.prototype._flushPending});var La,lx=p(()=>{Qo();$i();bt();C0();La=class extends kr{constructor(e){super(e),this._values=new Tn(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,r){return super.setValue(e,Gn(r))}_flushPending(e,r){}};La.prototype._flushPending=hs.prototype._flushPending});var ms,B0=p(()=>{st();bt();$i();ur();yi();ms=class extends at{constructor(e){super(e),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new Tn(Uint8Array)}get byteLength(){let e=0;this._views&&(e+=this._views.byteLength),this._nulls&&(e+=this._nulls.byteLength);for(let r of this._variadicBuffers)e+=r.byteLength;return this._currentBuffer&&(e+=this._currentBuffer.byteLength),e}setValue(e,r){return this.writeBinaryValue(e,this.encodeValue(r))}writeBinaryValue(e,r){let n=r.length,i=(e+1)*Ee.ELEMENT_WIDTH,o=this._views.length;i>o&&this._views.reserve(i-o);let s=this._views.buffer,a=e*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 Tn(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(e){return se(e)}setValid(e,r){let n=(e+1)*Ee.ELEMENT_WIDTH,i=this._views.length;n>i&&this._views.reserve(n-i);let o=super.setValid(e,r);if(!o){let s=this._views.buffer,a=e*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:e,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:e,length:r,nullCount:n,nullBitmap:a,views:s,variadicBuffers:c})}finish(){return this.finished=!0,this}}});var rl,ux=p(()=>{B0();Qo();rl=class extends ms{constructor(e){super(e)}setValue(e,r){return this.writeBinaryValue(e,Gn(r))}}});var fx,UP,jP=p(()=>{En();O0();C0();Vw();Ww();$w();Hw();Kw();Xw();Yw();Zw();Jw();Qw();ex();tx();rx();nx();ix();ox();sx();ax();cx();lx();B0();ux();fx=class extends ie{visitNull(){return Jc}visitBool(){return Dc}visitInt(){return sn}visitInt8(){return jc}visitInt16(){return zc}visitInt32(){return qc}visitInt64(){return Vc}visitUint8(){return Wc}visitUint16(){return $c}visitUint32(){return Hc}visitUint64(){return Kc}visitFloat(){return Io}visitFloat16(){return kc}visitFloat32(){return Gc}visitFloat64(){return Uc}visitUtf8(){return Ra}visitLargeUtf8(){return La}visitBinary(){return fs}visitLargeBinary(){return hs}visitFixedSizeBinary(){return ma}visitDate(){return Ao}visitDateDay(){return fa}visitDateMillisecond(){return ha}visitTimestamp(){return _i}visitTimestampSecond(){return Sa}visitTimestampMillisecond(){return Ma}visitTimestampMicrosecond(){return va}visitTimestampNanosecond(){return Ea}visitTime(){return Si}visitTimeSecond(){return Ta}visitTimeMillisecond(){return Aa}visitTimeMicrosecond(){return Ia}visitTimeNanosecond(){return Pa}visitDecimal(){return da}visitList(){return Xc}visitLargeList(){return Yc}visitStruct(){return Qc}visitUnion(){return ds}visitDenseUnion(){return tl}visitSparseUnion(){return el}visitDictionary(){return Nc}visitInterval(){return Ki}visitIntervalDayTime(){return pa}visitIntervalYearMonth(){return ga}visitIntervalMonthDayNano(){return ya}visitDuration(){return xi}visitDurationSecond(){return ba}visitDurationMillisecond(){return wa}visitDurationMicrosecond(){return xa}visitDurationNanosecond(){return _a}visitFixedSizeList(){return Fc}visitMap(){return Zc}visitBinaryView(){return ms}visitUtf8View(){return rl}},UP=new fx});function an(t,e){return e instanceof t.constructor}function ps(t,e){return t===e||an(t,e)}function gs(t,e){return t===e||an(t,e)&&t.bitWidth===e.bitWidth&&t.isSigned===e.isSigned}function D0(t,e){return t===e||an(t,e)&&t.precision===e.precision}function gK(t,e){return t===e||an(t,e)&&t.byteWidth===e.byteWidth}function hx(t,e){return t===e||an(t,e)&&t.unit===e.unit}function jh(t,e){return t===e||an(t,e)&&t.unit===e.unit&&t.timezone===e.timezone}function zh(t,e){return t===e||an(t,e)&&t.unit===e.unit&&t.bitWidth===e.bitWidth}function zP(t,e){return t===e||an(t,e)&&t.children.length===e.children.length&&Po.compareManyFields(t.children,e.children)}function yK(t,e){return t===e||an(t,e)&&t.children.length===e.children.length&&Po.compareManyFields(t.children,e.children)}function dx(t,e){return t===e||an(t,e)&&t.mode===e.mode&&t.typeIds.every((r,n)=>r===e.typeIds[n])&&Po.compareManyFields(t.children,e.children)}function bK(t,e){return t===e||an(t,e)&&t.id===e.id&&t.isOrdered===e.isOrdered&&Po.visit(t.indices,e.indices)&&Po.visit(t.dictionary,e.dictionary)}function N0(t,e){return t===e||an(t,e)&&t.unit===e.unit}function qh(t,e){return t===e||an(t,e)&&t.unit===e.unit}function wK(t,e){return t===e||an(t,e)&&t.listSize===e.listSize&&t.children.length===e.children.length&&Po.compareManyFields(t.children,e.children)}function xK(t,e){return t===e||an(t,e)&&t.keysSorted===e.keysSorted&&t.children.length===e.children.length&&Po.compareManyFields(t.children,e.children)}function nl(t,e){return Po.compareSchemas(t,e)}function qP(t,e){return Po.compareFields(t,e)}function F0(t,e){return Po.visit(t,e)}var fe,Po,Vh=p(()=>{En();fe=class extends ie{compareSchemas(e,r){return e===r||r instanceof e.constructor&&this.compareManyFields(e.fields,r.fields)}compareManyFields(e,r){return e===r||Array.isArray(e)&&Array.isArray(r)&&e.length===r.length&&e.every((n,i)=>this.compareFields(n,r[i]))}compareFields(e,r){return e===r||r instanceof e.constructor&&e.name===r.name&&e.nullable===r.nullable&&this.visit(e.type,r.type)}};fe.prototype.visitNull=ps;fe.prototype.visitBool=ps;fe.prototype.visitInt=gs;fe.prototype.visitInt8=gs;fe.prototype.visitInt16=gs;fe.prototype.visitInt32=gs;fe.prototype.visitInt64=gs;fe.prototype.visitUint8=gs;fe.prototype.visitUint16=gs;fe.prototype.visitUint32=gs;fe.prototype.visitUint64=gs;fe.prototype.visitFloat=D0;fe.prototype.visitFloat16=D0;fe.prototype.visitFloat32=D0;fe.prototype.visitFloat64=D0;fe.prototype.visitUtf8=ps;fe.prototype.visitLargeUtf8=ps;fe.prototype.visitUtf8View=ps;fe.prototype.visitBinary=ps;fe.prototype.visitLargeBinary=ps;fe.prototype.visitBinaryView=ps;fe.prototype.visitFixedSizeBinary=gK;fe.prototype.visitDate=hx;fe.prototype.visitDateDay=hx;fe.prototype.visitDateMillisecond=hx;fe.prototype.visitTimestamp=jh;fe.prototype.visitTimestampSecond=jh;fe.prototype.visitTimestampMillisecond=jh;fe.prototype.visitTimestampMicrosecond=jh;fe.prototype.visitTimestampNanosecond=jh;fe.prototype.visitTime=zh;fe.prototype.visitTimeSecond=zh;fe.prototype.visitTimeMillisecond=zh;fe.prototype.visitTimeMicrosecond=zh;fe.prototype.visitTimeNanosecond=zh;fe.prototype.visitDecimal=ps;fe.prototype.visitList=zP;fe.prototype.visitLargeList=zP;fe.prototype.visitStruct=yK;fe.prototype.visitUnion=dx;fe.prototype.visitDenseUnion=dx;fe.prototype.visitSparseUnion=dx;fe.prototype.visitDictionary=bK;fe.prototype.visitInterval=N0;fe.prototype.visitIntervalDayTime=N0;fe.prototype.visitIntervalYearMonth=N0;fe.prototype.visitIntervalMonthDayNano=N0;fe.prototype.visitDuration=qh;fe.prototype.visitDurationSecond=qh;fe.prototype.visitDurationMillisecond=qh;fe.prototype.visitDurationMicrosecond=qh;fe.prototype.visitDurationNanosecond=qh;fe.prototype.visitFixedSizeList=wK;fe.prototype.visitMap=xK;Po=new fe});function Qn(t){let e=t.type,r=new(UP.getVisitFn(e)())(t);if(e.children&&e.children.length>0){let n=t.children||[],i={nullValues:t.nullValues},o=Array.isArray(n)?((s,a)=>n[a]||i):(({name:s})=>n[s]||i);for(let[s,a]of e.children.entries()){let{type:c}=a,l=o(a,s);r.children.push(Qn(Object.assign(Object.assign({},l),{type:c})))}}return r}function Gu(t,e){if(t instanceof de||t instanceof H||t.type instanceof j||ArrayBuffer.isView(t))return Eo(t);let r={type:e??k0(t),nullValues:[null]},n=[...G0(r)(t)],i=n.length===1?n[0]:n.reduce((o,s)=>o.concat(s));return j.isDictionary(i.type)?i.memoize():i}function mx(t){let e=Gu(t),r=new ze(new ve(e.type.children),e.data[0]);return new je(r)}function k0(t){if(t.length===0)return new Xt;let e=0,r=0,n=0,i=0,o=0,s=0,a=0,c=0;for(let l of t){if(l==null){++e;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+e===t.length)return new pi;if(o+e===t.length)return new mr(new Jr,new hr);if(s+e===t.length)return new mi;if(a+e===t.length)return new en;if(c+e===t.length)return new os;if(r+e===t.length){let l=t,u=k0(l[l.findIndex(h=>h!=null)]);if(l.every(h=>h==null||F0(u,k0(h))))return new dr(new ee("",u,!0))}else if(n+e===t.length){let l=new Map;for(let u of t)for(let h of Object.keys(u))!l.has(h)&&u[h]!=null&&l.set(h,new ee(h,k0([u[h]]),!0));return new Qe([...l.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function G0(t){let{["queueingStrategy"]:e="count"}=t,{["highWaterMark"]:r=e!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=t,n=e!=="bytes"?"length":"byteLength";return function*(i){let o=0,s=Qn(t);for(let a of i)s.append(a)[n]>=r&&++o&&(yield s.toVector());(s.finish().length>0||o===0)&&(yield s.toVector())}}function px(t){let{["queueingStrategy"]:e="count"}=t,{["highWaterMark"]:r=e!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=t,n=e!=="bytes"?"length":"byteLength";return function(i){return Xr(this,arguments,function*(){var o,s,a,c;let l=0,u=Qn(t);try{for(var h=!0,d=kn(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 ku=p(()=>{Ar();Gr();st();yi();Fr();jP();il();ys();Vh()});function U0(t,e){return _K(t,e.map(r=>r.data.concat()))}function _K(t,e){let r=[...t.fields],n=[],i={numBatches:e.reduce((h,d)=>Math.max(h,d.length),0)},o=0,s=0,a=-1,c=e.length,l,u=[];for(;i.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,a=-1;++a<c;)u[a]=l=e[a].shift(),s=Math.min(s,l?l.length:s);Number.isFinite(s)&&(u=SK(r,s,u,e,i),s>0&&(n[o++]=te({type:new Qe(r),length:s,nullCount:0,children:u.slice()})))}return[t=t.assign(r),n.map(h=>new ze(t,h))]}function SK(t,e,r,n,i){var o;let s=(e+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>=e)u===e?r[a]=l:(r[a]=l.slice(0,e),i.numBatches=Math.max(i.numBatches,n[a].unshift(l.slice(e,u-e))));else{let h=t[a];t[a]=h.clone({nullable:!0}),r[a]=(o=l==null?void 0:l._changeLengthAndBackfillNullBitmap(e))!==null&&o!==void 0?o:te({type:h.type,length:e,nullCount:e,nullBitmap:new Uint8Array(s)})}}return r}var VP=p(()=>{yi();st();ys()});function gx(t){let e={},r=Object.entries(t);for(let[n,i]of r)e[n]=Eo(i);return new je(e)}function yx(t){let e={},r=Object.entries(t);for(let[n,i]of r)e[n]=Gu(i);return new je(e)}var WP,$P,je,il=p(()=>{Dt();yi();ku();Fr();Gr();st();Vh();VP();b0();Tc();Yn();w0();x0();Ru();ys();$P=Symbol.for("apache-arrow/Table"),je=class t{static isTable(e){return(e==null?void 0:e[$P])===!0}constructor(...e){var r,n;if(e.length===0)return this.batches=[],this.schema=new ve([]),this._offsets=[0],this;let i,o;e[0]instanceof ve&&(i=e.shift()),e.at(-1)instanceof Uint32Array&&(o=e.pop());let s=c=>{if(c){if(c instanceof ze)return[c];if(c instanceof t)return c.batches;if(c instanceof de){if(c.type instanceof Qe)return[new ze(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 H([c[m]])),h=i??new ve(l.map((m,g)=>new ee(String(m),u[g].type,u[g].nullable))),[,d]=U0(h,u);return d.length===0?[new ze(c)]:d}}}return[]},a=e.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 ze))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!nl(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??m0(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,r)=>e+r.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=d0(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(Ac(e,this.numRows))}set(e,r){}indexOf(e,r){return-1}[Symbol.iterator](){return this.batches.length>0?Cu.visit(new H(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
11
11
  ${this.toArray().join(`,
12
12
  `)}
13
- ]`}concat(...e){let r=this.schema,n=this.data.concat(e.flatMap(({data:i})=>i));return new t(r,n.map(i=>new Ue(r,i)))}slice(e,r){let n=this.schema;[e,r]=Oh({length:this.numRows},e,r);let i=b0(this.data,this._offsets,e,r);return new t(n,i.map(o=>new Ue(n,o)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){let r=this.data.map(n=>n.children[e]);if(r.length===0){let{type:n}=this.schema.fields[e],i=te({type:n,length:0,nullCount:0});r.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new H(r)}return null}setChild(e,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===e),r)}setChildAt(e,r){let n=this.schema,i=[...this.batches];if(e>-1&&e<this.numCols){r||(r=new H([te({type:new $t,length:this.numRows})]));let o=n.fields.slice(),s=o[e].clone({type:r.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[o[e],a[e]]=[s,r],[n,i]=q0(n,a)}return new t(n,i)}select(e){let r=this.schema.fields.reduce((n,i,o)=>n.set(i.name,o),new Map);return this.selectAt(e.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(e){let r=this.schema.selectAt(e),n=this.batches.map(i=>i.selectAt(e));return new t(r,n)}assign(e){let r=this.schema.fields,[n,i]=e.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(e.schema),s=[...r.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):e.getChildAt(c)),...n.map(a=>e.getChildAt(a))].filter(Boolean);return new t(...q0(o,s))}};JR=Symbol.toStringTag;qe[JR]=(t=>(t.schema=null,t.batches=[],t._offsets=new Uint32Array([0]),t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,t[QR]=!0,t.isValid=Ou(Dh),t.get=Ou(ir.getVisitFn(x.Struct)),t.set=w0(Lr.getVisitFn(x.Struct)),t.indexOf=x0(Oc.getVisitFn(x.Struct)),"Table"))(qe.prototype);Object.defineProperty(qe,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===qe&&qe.isTable(e)}})});function e5(t,e,r=e.reduce((n,i)=>Math.max(n,i.length),0)){var n;let i=[...t.fields],o=[...e],s=(r+63&-64)>>3;for(let[a,c]of t.fields.entries()){let l=e[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[t.assign(i),te({type:new $e(i),length:r,children:o})]}function n5(t,e,r=new Map){var n,i;if(((n=t==null?void 0:t.length)!==null&&n!==void 0?n:0)>0&&(t==null?void 0:t.length)===(e==null?void 0:e.length))for(let o=-1,s=t.length;++o<s;){let{type:a}=t[o],c=e[o];for(let l of[c,...((i=c==null?void 0:c.dictionary)===null||i===void 0?void 0:i.data)||[]])n5(a.children,l==null?void 0:l.children,r);if(U.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 t5,r5,Ue,sl,bs=p(()=>{_i();ol();zr();Vr();at();Ru();Ac();ri();S0();M0();r5=Symbol.for("apache-arrow/RecordBatch"),Ue=class t{static isRecordBatch(e){return(e==null?void 0:e[r5])===!0}constructor(...e){switch(e.length){case 3:case 2:{if([this.schema]=e,!(this.schema instanceof ve))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=te({nullCount:0,type:new $e(this.schema.fields),children:this.schema.fields.map(r=>te({type:r.type,nullCount:0}))}),this._metadata=new Map]=e,!(this.data instanceof ce))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=e5(this.schema,this.data.children,this.data.length);break}case 1:{let[r]=e,{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 $e(n),length:o,children:i,nullCount:0});[this.schema,this.data]=e5(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=n5(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(e){return this.data.getValid(e)}get(e){return ir.visit(this.data,e)}at(e){return this.get(Ic(e,this.numRows))}set(e,r){return Lr.visit(this.data,e,r)}indexOf(e,r){return Oc.visit(this.data,e,r)}[Symbol.iterator](){return Bu.visit(new H([this.data]))}toArray(){return[...this]}concat(...e){return new qe(this.schema,[this,...e])}slice(e,r){let[n]=new H([this.data]).slice(e,r).data;return new t(this.schema,n,this._metadata)}getChild(e){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new H([this.data.children[e]]):null}setChild(e,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===e),r)}setChildAt(e,r){let n=this.schema,i=this.data;if(e>-1&&e<this.numCols){r||(r=new H([te({type:new $t,length:this.numRows})]));let o=n.fields.slice(),s=i.children.slice(),a=o[e].clone({type:r.type});[o[e],s[e]]=[a,r.data[0]],n=new ve(o,new Map(this.schema.metadata)),i=te({type:new $e(o),length:i.length,children:s})}return new t(n,i,this._metadata)}select(e){let r=this.schema.select(e),n=new $e(r.fields),i=[];for(let o of e){let s=this.schema.fields.findIndex(a=>a.name===o);~s&&(i[s]=this.data.children[s])}return new t(r,te({type:n,length:this.numRows,children:i}),this._metadata)}selectAt(e){let r=this.schema.selectAt(e),n=e.map(o=>this.data.children[o]).filter(Boolean),i=te({type:new $e(r.fields),length:this.numRows,children:n});return new t(r,i,this._metadata)}};t5=Symbol.toStringTag;Ue[t5]=(t=>(t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,t[r5]=!0,"RecordBatch"))(Ue.prototype);Object.defineProperty(Ue,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===Ue&&Ue.isRecordBatch(e)}});sl=class extends Ue{constructor(e,r){let n=e.fields.map(o=>te({type:o.type})),i=te({type:new $e(e.fields),length:0,nullCount:0,children:n});super(e,i,r||new Map)}}});function W0(t,e=0){for(let r=-1,n=Uu.length;++r<n;)if(Uu[r]!==t[e+r])return!1;return!0}var Sx,Mx,vx,i5,o5,$a,al,cl,V0,_x,Uu,ju,Ex,s5,$0=p(()=>{Ar();Nt();Sx=me(Ve(),1);Ma();ts();kw();dr();Ao();Fh();Mx=t=>`Expected ${ke[t]} Message in stream, but was null or length 0.`,vx=t=>`Header pointer of flatbuffer-encoded ${ke[t]} Message is null or length 0.`,i5=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,o5=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`,$a=class{constructor(e){this.source=e instanceof Mi?e:new Mi(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?St:e.value===-1&&(e=this.readMetadataLength()).done?St:(e=this.readMetadata(e.value)).done?St:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let r;if((r=this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Mx(e));return r.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let r=se(this.source.read(e));if(r.byteLength<e)throw new Error(o5(e,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(e=!1){let r=ke.Schema,n=this.readMessage(r),i=n==null?void 0:n.header();if(e&&!i)throw new Error(vx(r));return i}readMetadataLength(){let e=this.source.read(V0),r=e&&new Sx.ByteBuffer(e),n=(r==null?void 0:r.readInt32(0))||0;return{done:n===0,value:n}}readMetadata(e){let r=this.source.read(e);if(!r)return St;if(r.byteLength<e)throw new Error(i5(e,r.byteLength));return{done:!1,value:$r.decode(r)}}},al=class{constructor(e,r){this.source=e instanceof Hr?e:Lp(e)?new va(e,r):new Hr(e)}[Symbol.asyncIterator](){return this}next(){return $(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done?St:e.value===-1&&(e=yield this.readMetadataLength()).done?St:(e=yield this.readMetadata(e.value)).done?St:e})}throw(e){return $(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return $(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return $(this,void 0,void 0,function*(){let r;if((r=yield this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Mx(e));return r.value})}readMessageBody(e){return $(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let r=se(yield this.source.read(e));if(r.byteLength<e)throw new Error(o5(e,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()})}readSchema(){return $(this,arguments,void 0,function*(e=!1){let r=ke.Schema,n=yield this.readMessage(r),i=n==null?void 0:n.header();if(e&&!i)throw new Error(vx(r));return i})}readMetadataLength(){return $(this,void 0,void 0,function*(){let e=yield this.source.read(V0),r=e&&new Sx.ByteBuffer(e),n=(r==null?void 0:r.readInt32(0))||0;return{done:n===0,value:n}})}readMetadata(e){return $(this,void 0,void 0,function*(){let r=yield this.source.read(e);if(!r)return St;if(r.byteLength<e)throw new Error(i5(e,r.byteLength));return{done:!1,value:$r.decode(r)}})}},cl=class extends $a{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof Nh?e:new Nh(e)}next(){let{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:$r.fromJSON(e.schema,ke.Schema)};if(this._dictionaryIndex<e.dictionaries.length){let r=e.dictionaries[this._dictionaryIndex++];return this._body=r.data.columns,{done:!1,value:$r.fromJSON(r,ke.DictionaryBatch)}}if(this._batchIndex<e.batches.length){let r=e.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:$r.fromJSON(r,ke.RecordBatch)}}return this._body=[],St}readMessageBody(e){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(e){let r;if((r=this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(Mx(e));return r.value}readSchema(){let e=ke.Schema,r=this.readMessage(e),n=r==null?void 0:r.header();if(!r||!n)throw new Error(vx(e));return n}},V0=4,_x="ARROW1",Uu=new Uint8Array(_x.length);for(let t=0;t<_x.length;t+=1)Uu[t]=_x.codePointAt(t);ju=Uu.length,Ex=ju+V0,s5=ju*2+V0});var Tx,Ax,a5,c5=p(()=>{yu();Tx=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(e){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=e.encode(r);return this._isValidCompressed(n)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)&&this._hasValidVersion(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.LZ4_FRAME_MAGIC.every((r,n)=>e[n]===r)}_hasValidVersion(e){return(e[4]&192)>>6===1}},Ax=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(e){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=e.encode(r);return this._isValidCompressed(n)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.ZSTD_MAGIC.every((r,n)=>e[n]===r)}},a5={[Ir.LZ4_FRAME]:new Tx,[Ir.ZSTD]:new Ax}});var Ix,Ha,H0=p(()=>{yu();c5();Ix=class{constructor(){this.registry={}}set(e,r){if(r!=null&&r.encode&&typeof r.encode=="function"&&!a5[e].isValidCodecEncode(r))throw new Error(`Encoder for ${Ir[e]} is not valid.`);this.registry[e]=r}get(e){var r;return((r=this.registry)===null||r===void 0?void 0:r[e])||null}},Ha=new Ix});function d5(t,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:t.autoDestroy}function*l5(t){let e=pr.from(t);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function u5(t){return en(this,arguments,function*(){let r=yield Me(pr.from(t));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 qK(t){return new Zi(new Rx(t))}function VK(t){let e=t.peek(ju+7&-8);return e&&e.byteLength>=4?W0(e)?new xs(new X0(t.read())):new Zi(new qu(t)):new Zi(new qu((function*(){})()))}function WK(t){return $(this,void 0,void 0,function*(){let e=yield t.peek(ju+7&-8);return e&&e.byteLength>=4?W0(e)?new xs(new X0(yield t.read())):new ws(new Vu(t)):new ws(new Vu((function(){return en(this,arguments,function*(){})})()))})}function $K(t){return $(this,void 0,void 0,function*(){let{size:e}=yield t.stat(),r=new va(t,e);return e>=s5&&W0(yield r.readAt(0,ju+7&-8))?new zu(new Px(r)):new ws(new Vu(r))})}var h5,pr,Zi,ws,xs,zu,K0,qu,Vu,X0,Px,Rx,ll=p(()=>{Ar();_i();zr();at();Nt();Cw();gu();Ma();Ao();kw();$R();bs();Fh();$0();ts();H0();So();h5=me(Ve(),1),pr=class t extends Dc{constructor(e){super(),this._impl=e}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(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let r=this._impl.open(e);return Vn(r)?r.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):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(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,r){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof t?e:Pp(e)?qK(e):Lp(e)?$K(e):Vn(e)?$(this,void 0,void 0,function*(){return yield t.from(yield e)}):Op(e)||sh(e)||Cp(e)||Mn(e)?WK(new Hr(e)):VK(new Mi(e))}static readAll(e){return e instanceof t?e.isSync()?l5(e):u5(e):Pp(e)||ArrayBuffer.isView(e)||Wn(e)||Rp(e)?l5(e):u5(e)}},Zi=class extends pr{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return en(this,arguments,function*(){yield Me(yield*mu(zn(this[Symbol.iterator]())))})}},ws=class extends pr{constructor(e){super(e),this._impl=e}readAll(){return $(this,void 0,void 0,function*(){var e,r,n,i;let o=new Array;try{for(var s=!0,a=zn(this),c;c=yield a.next(),e=c.done,!e;s=!0){i=c.value,s=!1;let l=i;o.push(l)}}catch(l){r={error:l}}finally{try{!s&&!e&&(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]()}},xs=class extends Zi{constructor(e){super(e),this._impl=e}},zu=class extends ws{constructor(e){super(e),this._impl=e}},K0=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,r,n){let i;if(e.compression!=null){let s=Ha.get(e.compression.type);if(s!=null&&s.decode&&typeof s.decode=="function"){let{decommpressedBody:a,buffers:c}=this._decompressBuffers(e,r,s);i=this._loadCompressedVectors(e,a,this.schema.fields),e=new sr(e.length,e.nodes,c,null)}else throw new Error("Record batch is compressed but codec not found")}else i=this._loadVectors(e,r,this.schema.fields);let o=te({type:new $e(this.schema.fields),length:e.length,children:i});return new Ue(this.schema,o,n)}_loadDictionaryBatch(e,r){let{id:n,isDelta:i}=e,{dictionaries:o,schema:s}=this,a=o.get(n),c=s.dictionaries.get(n),l;if(e.data.compression!=null){let u=Ha.get(e.data.compression.type);if(u!=null&&u.decode&&typeof u.decode=="function"){let{decommpressedBody:h,buffers:d}=this._decompressBuffers(e.data,r,u);l=this._loadCompressedVectors(e.data,h,[c]),e=new Wr(new sr(e.data.length,e.data.nodes,d,null,e.data.variadicBufferCounts),n,i)}else throw new Error("Dictionary batch is compressed but codec not found")}else l=this._loadVectors(e.data,r,[c]);return(a&&i?a.concat(new H(l)):new H(l)).memoize()}_loadVectors(e,r,n){return new Fu(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_loadCompressedVectors(e,r,n){return new C0(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_decompressBuffers(e,r,n){let i=[],o=[],s=0;for(let{offset:a,length:c}of e.buffers){if(c===0){i.push(new Uint8Array(0)),o.push(new Kt(s,0));continue}let l=new h5.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 Kt(s,d.length)),s+=d.length}return{decommpressedBody:i,buffers:o}}},qu=class extends K0{constructor(e,r){super(r),this._reader=Pp(e)?new cl(this._handle=e):new $a(this._handle=e)}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(e){return this.closed||(this.autoDestroy=d5(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):St}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):St}next(){if(this.closed)return St;let e,{_reader:r}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=r.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=r.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new sl(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Vu=class extends K0{constructor(e,r){super(r),this._reader=new al(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return $(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return $(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=d5(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return $(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):St})}return(e){return $(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):St})}next(){return $(this,void 0,void 0,function*(){if(this.closed)return St;let e,{_reader:r}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=yield r.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=yield r.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new sl(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return $(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},X0=class extends qu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,r){super(e instanceof kh?e:new kh(e),r)}isSync(){return!0}isFile(){return!0}open(e){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(e)}readRecordBatch(e){var r;if(this.closed)return null;this._footer||this.open();let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(e);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(ke.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(e){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(e);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(ke.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:e}=this,r=e.size-Ex,n=e.readInt32(r),i=e.readAt(r-n,n);return ls.decode(i)}_readNextMessageAndValidate(e){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(e)}return null}},Px=class extends Vu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,...r){let n=typeof r[0]!="number"?r.shift():void 0,i=r[0]instanceof Map?r.shift():void 0;super(e instanceof va?e:new va(e,n),i)}isFile(){return!0}isAsync(){return!0}open(e){let r=Object.create(null,{open:{get:()=>super.open}});return $(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,e)})}readRecordBatch(e){return $(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(e);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(ke.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(e){return $(this,void 0,void 0,function*(){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(e);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(ke.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 $(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let r=e.size-Ex,n=yield e.readInt32(r),i=yield e.readAt(r-n,n);return ls.decode(i)})}_readNextMessageAndValidate(e){return $(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(e)}return null})}},Rx=class extends qu{constructor(e,r){super(e,r)}_loadVectors(e,r,n){return new B0(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}}});function si(t){let e=t.byteLength+7&-8;return this.buffers.push(t),this.bufferRegions.push(new Kt(this._byteLength,e)),this._byteLength+=e,this}function HK(t){var e;let{type:r,length:n,typeIds:i,valueOffsets:o}=t;if(si.call(this,i),r.mode===Qe.Sparse)return Lx.call(this,t);if(r.mode===Qe.Dense){if(t.offset<=0)return si.call(this,o),Lx.call(this,t);{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]=((e=c[l])!==null&&e!==void 0?e:0)+1);si.call(this,s),this.visitMany(t.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 KK(t){let e;return t.nullCount>=t.length?si.call(this,new Uint8Array(t.length+7>>3)):(e=t.values)instanceof Uint8Array?si.call(this,Pc(t.offset,t.length,e)):si.call(this,Rc(t.values))}function _s(t){return si.call(this,t.values.subarray(0,t.length*t.stride))}function Y0(t){let{length:e,values:r,valueOffsets:n}=t,i=Le(n[0]),o=Le(n[e]),s=Math.min(o-i,r.byteLength-i);return si.call(this,Dp(-i,e+1,n)),si.call(this,r.subarray(i,i+s)),this}function m5(t){let{offset:e,length:r,stride:n,values:i,variadicBuffers:o=[]}=t;if(!i)throw new Error("BinaryView data is missing view buffer");let s=e*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 Z0(t){let{length:e,valueOffsets:r}=t;if(r){let n=Le(r[0]),i=Le(r[e]);return si.call(this,Dp(-n,e+1,r)),this.visit(t.children[0].slice(n,i-n))}return this.visit(t.children[0])}function Lx(t){return this.visitMany(t.type.children.map((e,r)=>t.children[r]).filter(Boolean))[0]}var Mt,p5=p(()=>{zr();Pn();Nt();bs();dr();Lc();Ma();at();So();Mt=class t extends ie{static assemble(...e){let r=i=>i.flatMap(o=>Array.isArray(o)?r(o):o instanceof Ue?o.data.children:o.data),n=new t;return n.visitMany(r(e)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[],this._variadicBufferCounts=[]}visit(e){if(e instanceof H)return this.visitMany(e.data),this;let{type:r}=e;if(!U.isDictionary(r)){let{length:n}=e;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(U.isUnion(r))this.nodes.push(new Si(n,0));else{let{nullCount:i}=e;U.isNull(r)||si.call(this,i<=0?new Uint8Array(0):Pc(e.offset,n,e.nullBitmap)),this.nodes.push(new Si(n,i))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.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=KK;Mt.prototype.visitInt=_s;Mt.prototype.visitFloat=_s;Mt.prototype.visitUtf8=Y0;Mt.prototype.visitLargeUtf8=Y0;Mt.prototype.visitUtf8View=m5;Mt.prototype.visitBinary=Y0;Mt.prototype.visitLargeBinary=Y0;Mt.prototype.visitBinaryView=m5;Mt.prototype.visitFixedSizeBinary=_s;Mt.prototype.visitDate=_s;Mt.prototype.visitTimestamp=_s;Mt.prototype.visitTime=_s;Mt.prototype.visitDecimal=_s;Mt.prototype.visitList=Z0;Mt.prototype.visitLargeList=Z0;Mt.prototype.visitStruct=Lx;Mt.prototype.visitUnion=HK;Mt.prototype.visitInterval=_s;Mt.prototype.visitDuration=_s;Mt.prototype.visitFixedSizeList=Z0;Mt.prototype.visitMap=Z0});var J0,g5=p(()=>{Pn();Wp();Nt();J0=class extends ie{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:pe[e].toLowerCase()}}visitInt({typeId:e,bitWidth:r,isSigned:n}){return{name:pe[e].toLowerCase(),bitWidth:r,isSigned:n}}visitFloat({typeId:e,precision:r}){return{name:pe[e].toLowerCase(),precision:Xe[r]}}visitBinary({typeId:e}){return{name:pe[e].toLowerCase()}}visitLargeBinary({typeId:e}){return{name:pe[e].toLowerCase()}}visitBinaryView({typeId:e}){return{name:pe[e].toLowerCase()}}visitBool({typeId:e}){return{name:pe[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:pe[e].toLowerCase()}}visitLargeUtf8({typeId:e}){return{name:pe[e].toLowerCase()}}visitUtf8View({typeId:e}){return{name:pe[e].toLowerCase()}}visitDecimal({typeId:e,scale:r,precision:n,bitWidth:i}){return{name:pe[e].toLowerCase(),scale:r,precision:n,bitWidth:i}}visitDate({typeId:e,unit:r}){return{name:pe[e].toLowerCase(),unit:st[r]}}visitTime({typeId:e,unit:r,bitWidth:n}){return{name:pe[e].toLowerCase(),unit:q[r],bitWidth:n}}visitTimestamp({typeId:e,timezone:r,unit:n}){return{name:pe[e].toLowerCase(),unit:q[n],timezone:r}}visitInterval({typeId:e,unit:r}){return{name:pe[e].toLowerCase(),unit:Ge[r]}}visitDuration({typeId:e,unit:r}){return{name:pe[e].toLocaleLowerCase(),unit:q[r]}}visitList({typeId:e}){return{name:pe[e].toLowerCase()}}visitLargeList({typeId:e}){return{name:pe[e].toLowerCase()}}visitStruct({typeId:e}){return{name:pe[e].toLowerCase()}}visitUnion({typeId:e,mode:r,typeIds:n}){return{name:pe[e].toLowerCase(),mode:Qe[r].toUpperCase(),typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:r}){return{name:pe[e].toLowerCase(),byteWidth:r}}visitFixedSizeList({typeId:e,listSize:r}){return{name:pe[e].toLowerCase(),listSize:r}}visitMap({typeId:e,keysSorted:r}){return{name:pe[e].toLowerCase(),keysSorted:r}}}});function*Ox(t){for(let e of t)yield e.reduce((r,n)=>`${r}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*Ss(t,e){let r=new Uint32Array(t.buffer,t.byteOffset,t.byteLength/Uint32Array.BYTES_PER_ELEMENT);for(let n=-1,i=r.length/e;++n<i;)yield`${Tc.new(r.subarray((n+0)*e,(n+1)*e),!1)}`}function y5(t,e){let n=t.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:e(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(t.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 Wh,b5=p(()=>{Hp();zr();Pn();Nt();Nt();Lc();O0();at();Wh=class t extends ie{static assemble(...e){let r=new t;return e.map(({schema:n,data:i})=>r.visitMany(n.fields,i.children))}visit({name:e},r){let{length:n}=r,{offset:i,nullCount:o,nullBitmap:s}=r,a=U.isDictionary(r.type)?r.type.indices:r.type,c=Object.assign([],r.buffers,{[Ne.VALIDITY]:void 0});return Object.assign({name:e,count:n,VALIDITY:U.isNull(a)||U.isUnion(a)?void 0:o<=0?Array.from({length:n},()=>1):[...new Eo(s,i,n,null,p0)]},super.visit(r.clone(a,i,n,0,c)))}visitNull(){return{}}visitBool({values:e,offset:r,length:n}){return{DATA:[...new Eo(e,r,n,null,Lu)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[...Ss(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...new H([e])],OFFSET:[...e.valueOffsets]}}visitLargeUtf8(e){return{DATA:[...new H([e])],OFFSET:[...Ss(e.valueOffsets,2)]}}visitBinary(e){return{DATA:[...Ox(new H([e]))],OFFSET:[...e.valueOffsets]}}visitLargeBinary(e){return{DATA:[...Ox(new H([e]))],OFFSET:[...Ss(e.valueOffsets,2)]}}visitBinaryView(e){return y5(e,r=>Array.from(r).map(n=>("0"+(n&255).toString(16)).slice(-2)).join("").toUpperCase())}visitUtf8View(e){return y5(e,r=>Array.from(r).map(n=>String.fromCodePoint(n)).join(""))}visitFixedSizeBinary(e){return{DATA:[...Ox(new H([e]))]}}visitDate(e){return{DATA:e.type.unit===st.DAY?[...e.values]:[...Ss(e.values,2)]}}visitTimestamp(e){return{DATA:[...Ss(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<q.MICROSECOND?[...e.values]:[...Ss(e.values,2)]}}visitDecimal(e){return{DATA:[...Ss(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}visitLargeList(e){return{OFFSET:[...Ss(e.valueOffsets,2)],children:this.visitMany(e.type.children,e.children)}}visitStruct(e){return{children:this.visitMany(e.type.children,e.children)}}visitUnion(e){return{TYPE_ID:[...e.typeIds],OFFSET:e.type.mode===Qe.Dense?[...e.valueOffsets]:void 0,children:this.visitMany(e.type.children,e.children)}}visitInterval(e){switch(e.type.unit){case Ge.YEAR_MONTH:return{DATA:[...e.values]};case Ge.DAY_TIME:return{DATA:Vw(e.values)};case Ge.MONTH_DAY_NANO:return{DATA:Ww(e.values,!0)}}}visitDuration(e){return{DATA:[...Ss(e.values,2)]}}visitFixedSizeList(e){return{children:this.visitMany(e.type.children,e.children)}}visitMap(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}}});function Bx(t,e){let r=e;e instanceof qe&&(r=e.batches,t.reset(void 0,e.schema));for(let n of r)t.write(n);return t.finish()}function Cx(t,e){return $(this,void 0,void 0,function*(){var r,n,i,o,s,a,c;try{for(r=!0,n=zn(e);i=yield n.next(),o=i.done,!o;r=!0){c=i.value,r=!1;let l=c;t.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 t.finish()})}function x5({name:t,type:e,nullable:r}){let n=new J0;return{name:t,nullable:r,type:n.visit(e),children:(e.children||[]).map(i=>x5(i)),dictionary:U.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function XK(t,e,r=!1){let[n]=Wh.assemble(new Ue({[e]:t}));return JSON.stringify({id:e,isDelta:r,data:{count:t.length,columns:n}},null,2)}function YK(t){let[e]=Wh.assemble(t);return JSON.stringify({count:t.numRows,columns:e},null,2)}var w5,Ai,Ms,vs,$h,Hh=p(()=>{Ar();ol();$0();zr();at();Ma();Ma();Cw();Nt();Vh();Ao();p5();g5();b5();dr();bs();Fh();ts();yu();H0();w5=me(Ve(),1),Ai=class extends Dc{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,r){throw new Error('"throughDOM" not available in this environment')}constructor(e){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(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1,e.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(e.compressionType))this._compression=new Cc(e.compressionType);else{let r=Object.values(Ir).filter(n=>typeof n=="string");throw new Error(`Unsupported compressionType: ${e.compressionType} Available types: ${r.join(", ")}`)}}else this._compression=null}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return Vn(e)?e.then(r=>this.writeAll(r)):Mn(e)?Cx(this,e):Bx(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,r=null){return e===this._sink||e instanceof Ln?this._sink=e:(this._sink=new Ln,e&&r6(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&n6(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!r||!il(r,this._schema))&&(r==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(e){let r=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof qe&&!(r=e.schema))return this.finish()&&void 0;if(e instanceof Ue&&!(r=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!il(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}e instanceof Ue?e instanceof sl||this._writeRecordBatch(e):e instanceof qe?this.writeAll(e.batches):Wn(e)&&this.writeAll(e)}_writeMessage(e,r=8){let n=r-1,i=$r.encode(e),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+n&~n,c=a-o-s;return e.headerType===ke.RecordBatch?this._recordBatchBlocks.push(new Xi(a,e.bodyLength,this._position)):e.headerType===ke.DictionaryBatch&&this._dictionaryBlocks.push(new Xi(a,e.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(e){if(this._started){let r=se(e);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(e){return this._writeMessage($r.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Uu)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=this._assembleRecordBatch(e),a=new sr(e.numRows,n,i,this._compression,s,e.metadata),c=$r.from(a,r);return this._writeDictionaries(e)._writeMessage(c)._writeBodyBuffers(o)}_assembleRecordBatch(e){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=Mt.assemble(e);return this._compression!=null&&({byteLength:r,bufferRegions:i,buffers:o}=this._compressBodyBuffers(o)),{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}}_compressBodyBuffers(e){let r=Ha.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 e){let c=se(a);if(c.length===0){i.push(new Uint8Array(0),new Uint8Array(0)),o.push(new Kt(n,0));continue}let l=r.encode(c),u=l.length<c.length,h=u?l:c,d=u?h.length:-1,m=new w5.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 Kt(n,y)),n+=y}let s=(n+7&-8)-n;return n+=s,{byteLength:n,bufferRegions:o,buffers:i}}_writeDictionaryBatch(e,r,n=!1){let{byteLength:i,nodes:o,bufferRegions:s,buffers:a,variadicBufferCounts:c}=this._assembleRecordBatch(new H([e])),l=new sr(e.length,o,s,this._compression,c),u=new Wr(l,r,n),h=$r.from(u,i);return this._writeMessage(h)._writeBodyBuffers(a)}_writeBodyBuffers(e){let r=this._compression!=null?2:1,n=new Array(r);for(let i=0;i<e.length;i+=r){let o=0;for(let a=-1;++a<r;)n[a]=e[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(e){var r,n;for(let[i,o]of e.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}},Ms=class t extends Ai{static writeAll(e,r){let n=new t(r);return Vn(e)?e.then(i=>n.writeAll(i)):Mn(e)?Cx(n,e):Bx(n,e)}},vs=class t extends Ai{static writeAll(e,r){let n=new t(r);return Vn(e)?e.then(i=>n.writeAll(i)):Mn(e)?Cx(n,e):Bx(n,e)}constructor(e){super(e),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,r,n=!1){if(!n&&this._seenDictionaries.has(r))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(e,r,n)}_writeFooter(e){let r=ls.encode(new ls(e,ot.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}},$h=class t extends Ai{static writeAll(e){return new t().writeAll(e)}constructor(){super(),this._autoDestroy=!0,this._recordBatches=[],this._recordBatchesWithDictionaries=[]}_writeMessage(){return this}_writeFooter(e){return this}_writeSchema(e){return this._write(`{
14
- "schema": ${JSON.stringify({fields:e.fields.map(r=>x5(r))},null,2)}`)}_writeDictionaries(e){return e.dictionaries.size>0&&this._recordBatchesWithDictionaries.push(e),this}_writeDictionaryBatch(e,r,n=!1){return this._write(this._dictionaryBlocks.length===0?" ":`,
15
- `),this._write(XK(e,r,n)),this._dictionaryBlocks.push(new Xi(0,0,0)),this}_writeRecordBatch(e){return this._writeDictionaries(e),this._recordBatches.push(e),this}close(){if(this._recordBatchesWithDictionaries.length>0){this._write(`,
13
+ ]`}concat(...e){let r=this.schema,n=this.data.concat(e.flatMap(({data:i})=>i));return new t(r,n.map(i=>new ze(r,i)))}slice(e,r){let n=this.schema;[e,r]=Oh({length:this.numRows},e,r);let i=p0(this.data,this._offsets,e,r);return new t(n,i.map(o=>new ze(n,o)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){let r=this.data.map(n=>n.children[e]);if(r.length===0){let{type:n}=this.schema.fields[e],i=te({type:n,length:0,nullCount:0});r.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new H(r)}return null}setChild(e,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===e),r)}setChildAt(e,r){let n=this.schema,i=[...this.batches];if(e>-1&&e<this.numCols){r||(r=new H([te({type:new Xt,length:this.numRows})]));let o=n.fields.slice(),s=o[e].clone({type:r.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[o[e],a[e]]=[s,r],[n,i]=U0(n,a)}return new t(n,i)}select(e){let r=this.schema.fields.reduce((n,i,o)=>n.set(i.name,o),new Map);return this.selectAt(e.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(e){let r=this.schema.selectAt(e),n=this.batches.map(i=>i.selectAt(e));return new t(r,n)}assign(e){let r=this.schema.fields,[n,i]=e.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(e.schema),s=[...r.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):e.getChildAt(c)),...n.map(a=>e.getChildAt(a))].filter(Boolean);return new t(...U0(o,s))}};WP=Symbol.toStringTag;je[WP]=(t=>(t.schema=null,t.batches=[],t._offsets=new Uint32Array([0]),t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,t[$P]=!0,t.isValid=Ou(Dh),t.get=Ou(tr.getVisitFn(x.Struct)),t.set=g0(Pr.getVisitFn(x.Struct)),t.indexOf=y0(Lc.getVisitFn(x.Struct)),"Table"))(je.prototype);Object.defineProperty(je,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===je&&je.isTable(e)}})});function HP(t,e,r=e.reduce((n,i)=>Math.max(n,i.length),0)){var n;let i=[...t.fields],o=[...e],s=(r+63&-64)>>3;for(let[a,c]of t.fields.entries()){let l=e[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[t.assign(i),te({type:new Qe(i),length:r,children:o})]}function YP(t,e,r=new Map){var n,i;if(((n=t==null?void 0:t.length)!==null&&n!==void 0?n:0)>0&&(t==null?void 0:t.length)===(e==null?void 0:e.length))for(let o=-1,s=t.length;++o<s;){let{type:a}=t[o],c=e[o];for(let l of[c,...((i=c==null?void 0:c.dictionary)===null||i===void 0?void 0:i.data)||[]])YP(a.children,l==null?void 0:l.children,r);if(j.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 KP,XP,ze,ol,ys=p(()=>{yi();il();Fr();Gr();st();Ru();Tc();Yn();w0();x0();XP=Symbol.for("apache-arrow/RecordBatch"),ze=class t{static isRecordBatch(e){return(e==null?void 0:e[XP])===!0}constructor(...e){switch(e.length){case 3:case 2:{if([this.schema]=e,!(this.schema instanceof ve))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=te({nullCount:0,type:new Qe(this.schema.fields),children:this.schema.fields.map(r=>te({type:r.type,nullCount:0}))}),this._metadata=new Map]=e,!(this.data instanceof de))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=HP(this.schema,this.data.children,this.data.length);break}case 1:{let[r]=e,{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 Qe(n),length:o,children:i,nullCount:0});[this.schema,this.data]=HP(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=YP(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(e){return this.data.getValid(e)}get(e){return tr.visit(this.data,e)}at(e){return this.get(Ac(e,this.numRows))}set(e,r){return Pr.visit(this.data,e,r)}indexOf(e,r){return Lc.visit(this.data,e,r)}[Symbol.iterator](){return Cu.visit(new H([this.data]))}toArray(){return[...this]}concat(...e){return new je(this.schema,[this,...e])}slice(e,r){let[n]=new H([this.data]).slice(e,r).data;return new t(this.schema,n,this._metadata)}getChild(e){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new H([this.data.children[e]]):null}setChild(e,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===e),r)}setChildAt(e,r){let n=this.schema,i=this.data;if(e>-1&&e<this.numCols){r||(r=new H([te({type:new Xt,length:this.numRows})]));let o=n.fields.slice(),s=i.children.slice(),a=o[e].clone({type:r.type});[o[e],s[e]]=[a,r.data[0]],n=new ve(o,new Map(this.schema.metadata)),i=te({type:new Qe(o),length:i.length,children:s})}return new t(n,i,this._metadata)}select(e){let r=this.schema.select(e),n=new Qe(r.fields),i=[];for(let o of e){let s=this.schema.fields.findIndex(a=>a.name===o);~s&&(i[s]=this.data.children[s])}return new t(r,te({type:n,length:this.numRows,children:i}),this._metadata)}selectAt(e){let r=this.schema.selectAt(e),n=e.map(o=>this.data.children[o]).filter(Boolean),i=te({type:new Qe(r.fields),length:this.numRows,children:n});return new t(r,i,this._metadata)}};KP=Symbol.toStringTag;ze[KP]=(t=>(t._nullCount=-1,t[Symbol.isConcatSpreadable]=!0,t[XP]=!0,"RecordBatch"))(ze.prototype);Object.defineProperty(ze,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===ze&&ze.isRecordBatch(e)}});ol=class extends ze{constructor(e,r){let n=e.fields.map(o=>te({type:o.type})),i=te({type:new Qe(e.fields),length:0,nullCount:0,children:n});super(e,i,r||new Map)}}});function z0(t,e=0){for(let r=-1,n=Uu.length;++r<n;)if(Uu[r]!==t[e+r])return!1;return!0}var wx,xx,_x,ZP,JP,Oa,sl,al,j0,bx,Uu,ju,Sx,QP,q0=p(()=>{Ar();Dt();wx=me(Ve(),1);la();es();Dw();ur();To();Fh();xx=t=>`Expected ${ke[t]} Message in stream, but was null or length 0.`,_x=t=>`Header pointer of flatbuffer-encoded ${ke[t]} Message is null or length 0.`,ZP=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,JP=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`,Oa=class{constructor(e){this.source=e instanceof wi?e:new wi(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?St:e.value===-1&&(e=this.readMetadataLength()).done?St:(e=this.readMetadata(e.value)).done?St:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let r;if((r=this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(xx(e));return r.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let r=se(this.source.read(e));if(r.byteLength<e)throw new Error(JP(e,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(e=!1){let r=ke.Schema,n=this.readMessage(r),i=n==null?void 0:n.header();if(e&&!i)throw new Error(_x(r));return i}readMetadataLength(){let e=this.source.read(j0),r=e&&new wx.ByteBuffer(e),n=(r==null?void 0:r.readInt32(0))||0;return{done:n===0,value:n}}readMetadata(e){let r=this.source.read(e);if(!r)return St;if(r.byteLength<e)throw new Error(ZP(e,r.byteLength));return{done:!1,value:jr.decode(r)}}},sl=class{constructor(e,r){this.source=e instanceof zr?e:Ip(e)?new ua(e,r):new zr(e)}[Symbol.asyncIterator](){return this}next(){return $(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done?St:e.value===-1&&(e=yield this.readMetadataLength()).done?St:(e=yield this.readMetadata(e.value)).done?St:e})}throw(e){return $(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return $(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return $(this,void 0,void 0,function*(){let r;if((r=yield this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(xx(e));return r.value})}readMessageBody(e){return $(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let r=se(yield this.source.read(e));if(r.byteLength<e)throw new Error(JP(e,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()})}readSchema(){return $(this,arguments,void 0,function*(e=!1){let r=ke.Schema,n=yield this.readMessage(r),i=n==null?void 0:n.header();if(e&&!i)throw new Error(_x(r));return i})}readMetadataLength(){return $(this,void 0,void 0,function*(){let e=yield this.source.read(j0),r=e&&new wx.ByteBuffer(e),n=(r==null?void 0:r.readInt32(0))||0;return{done:n===0,value:n}})}readMetadata(e){return $(this,void 0,void 0,function*(){let r=yield this.source.read(e);if(!r)return St;if(r.byteLength<e)throw new Error(ZP(e,r.byteLength));return{done:!1,value:jr.decode(r)}})}},al=class extends Oa{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof Nh?e:new Nh(e)}next(){let{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:jr.fromJSON(e.schema,ke.Schema)};if(this._dictionaryIndex<e.dictionaries.length){let r=e.dictionaries[this._dictionaryIndex++];return this._body=r.data.columns,{done:!1,value:jr.fromJSON(r,ke.DictionaryBatch)}}if(this._batchIndex<e.batches.length){let r=e.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:jr.fromJSON(r,ke.RecordBatch)}}return this._body=[],St}readMessageBody(e){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(e){let r;if((r=this.next()).done)return null;if(e!=null&&r.value.headerType!==e)throw new Error(xx(e));return r.value}readSchema(){let e=ke.Schema,r=this.readMessage(e),n=r==null?void 0:r.header();if(!r||!n)throw new Error(_x(e));return n}},j0=4,bx="ARROW1",Uu=new Uint8Array(bx.length);for(let t=0;t<bx.length;t+=1)Uu[t]=bx.codePointAt(t);ju=Uu.length,Sx=ju+j0,QP=ju*2+j0});var Mx,vx,eR,tR=p(()=>{yu();Mx=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(e){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=e.encode(r);return this._isValidCompressed(n)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)&&this._hasValidVersion(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.LZ4_FRAME_MAGIC.every((r,n)=>e[n]===r)}_hasValidVersion(e){return(e[4]&192)>>6===1}},vx=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(e){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=e.encode(r);return this._isValidCompressed(n)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.ZSTD_MAGIC.every((r,n)=>e[n]===r)}},eR={[Ir.LZ4_FRAME]:new Mx,[Ir.ZSTD]:new vx}});var Ex,Ca,V0=p(()=>{yu();tR();Ex=class{constructor(){this.registry={}}set(e,r){if(r!=null&&r.encode&&typeof r.encode=="function"&&!eR[e].isValidCodecEncode(r))throw new Error(`Encoder for ${Ir[e]} is not valid.`);this.registry[e]=r}get(e){var r;return((r=this.registry)===null||r===void 0?void 0:r[e])||null}},Ca=new Ex});function sR(t,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:t.autoDestroy}function*rR(t){let e=pr.from(t);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function nR(t){return Xr(this,arguments,function*(){let r=yield Me(pr.from(t));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 vK(t){return new Xi(new Ax(t))}function EK(t){let e=t.peek(ju+7&-8);return e&&e.byteLength>=4?z0(e)?new ws(new $0(t.read())):new Xi(new qu(t)):new Xi(new qu((function*(){})()))}function TK(t){return $(this,void 0,void 0,function*(){let e=yield t.peek(ju+7&-8);return e&&e.byteLength>=4?z0(e)?new ws(new $0(yield t.read())):new bs(new Vu(t)):new bs(new Vu((function(){return Xr(this,arguments,function*(){})})()))})}function AK(t){return $(this,void 0,void 0,function*(){let{size:e}=yield t.stat(),r=new ua(t,e);return e>=QP&&z0(yield r.readAt(0,ju+7&-8))?new zu(new Tx(r)):new bs(new Vu(r))})}var oR,pr,Xi,bs,ws,zu,W0,qu,Vu,$0,Tx,Ax,cl=p(()=>{Ar();yi();Fr();st();Dt();Lw();gu();la();To();Dw();GP();ys();Fh();q0();es();V0();xo();oR=me(Ve(),1),pr=class t extends Bc{constructor(e){super(),this._impl=e}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(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let r=this._impl.open(e);return Un(r)?r.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return fr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return fr.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,r){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof t?e:Tp(e)?vK(e):Ip(e)?AK(e):Un(e)?$(this,void 0,void 0,function*(){return yield t.from(yield e)}):Pp(e)||sh(e)||Lp(e)||xn(e)?TK(new zr(e)):EK(new wi(e))}static readAll(e){return e instanceof t?e.isSync()?rR(e):nR(e):Tp(e)||ArrayBuffer.isView(e)||jn(e)||Ap(e)?rR(e):nR(e)}},Xi=class extends pr{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Xr(this,arguments,function*(){yield Me(yield*mu(kn(this[Symbol.iterator]())))})}},bs=class extends pr{constructor(e){super(e),this._impl=e}readAll(){return $(this,void 0,void 0,function*(){var e,r,n,i;let o=new Array;try{for(var s=!0,a=kn(this),c;c=yield a.next(),e=c.done,!e;s=!0){i=c.value,s=!1;let l=i;o.push(l)}}catch(l){r={error:l}}finally{try{!s&&!e&&(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]()}},ws=class extends Xi{constructor(e){super(e),this._impl=e}},zu=class extends bs{constructor(e){super(e),this._impl=e}},W0=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,r,n){let i;if(e.compression!=null){let s=Ca.get(e.compression.type);if(s!=null&&s.decode&&typeof s.decode=="function"){let{decommpressedBody:a,buffers:c}=this._decompressBuffers(e,r,s);i=this._loadCompressedVectors(e,a,this.schema.fields),e=new nr(e.length,e.nodes,c,null)}else throw new Error("Record batch is compressed but codec not found")}else i=this._loadVectors(e,r,this.schema.fields);let o=te({type:new Qe(this.schema.fields),length:e.length,children:i});return new ze(this.schema,o,n)}_loadDictionaryBatch(e,r){let{id:n,isDelta:i}=e,{dictionaries:o,schema:s}=this,a=o.get(n),c=s.dictionaries.get(n),l;if(e.data.compression!=null){let u=Ca.get(e.data.compression.type);if(u!=null&&u.decode&&typeof u.decode=="function"){let{decommpressedBody:h,buffers:d}=this._decompressBuffers(e.data,r,u);l=this._loadCompressedVectors(e.data,h,[c]),e=new Ur(new nr(e.data.length,e.data.nodes,d,null,e.data.variadicBufferCounts),n,i)}else throw new Error("Dictionary batch is compressed but codec not found")}else l=this._loadVectors(e.data,r,[c]);return(a&&i?a.concat(new H(l)):new H(l)).memoize()}_loadVectors(e,r,n){return new Fu(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_loadCompressedVectors(e,r,n){return new L0(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_decompressBuffers(e,r,n){let i=[],o=[],s=0;for(let{offset:a,length:c}of e.buffers){if(c===0){i.push(new Uint8Array(0)),o.push(new $t(s,0));continue}let l=new oR.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}}},qu=class extends W0{constructor(e,r){super(r),this._reader=Tp(e)?new al(this._handle=e):new Oa(this._handle=e)}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(e){return this.closed||(this.autoDestroy=sR(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):St}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):St}next(){if(this.closed)return St;let e,{_reader:r}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=r.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=r.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ol(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Vu=class extends W0{constructor(e,r){super(r),this._reader=new sl(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return $(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return $(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=sR(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return $(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):St})}return(e){return $(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):St})}next(){return $(this,void 0,void 0,function*(){if(this.closed)return St;let e,{_reader:r}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),i=yield r.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),i=yield r.readMessageBody(e.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ol(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return $(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},$0=class extends qu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,r){super(e instanceof kh?e:new kh(e),r)}isSync(){return!0}isFile(){return!0}open(e){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(e)}readRecordBatch(e){var r;if(this.closed)return null;this._footer||this.open();let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(e);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(ke.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(e){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(e);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(ke.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:e}=this,r=e.size-Sx,n=e.readInt32(r),i=e.readAt(r-n,n);return cs.decode(i)}_readNextMessageAndValidate(e){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(e)}return null}},Tx=class extends Vu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,...r){let n=typeof r[0]!="number"?r.shift():void 0,i=r[0]instanceof Map?r.shift():void 0;super(e instanceof ua?e:new ua(e,n),i)}isFile(){return!0}isAsync(){return!0}open(e){let r=Object.create(null,{open:{get:()=>super.open}});return $(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,e)})}readRecordBatch(e){return $(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(e);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(ke.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(e){return $(this,void 0,void 0,function*(){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(e);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(ke.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 $(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let r=e.size-Sx,n=yield e.readInt32(r),i=yield e.readAt(r-n,n);return cs.decode(i)})}_readNextMessageAndValidate(e){return $(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(e)}return null})}},Ax=class extends qu{constructor(e,r){super(e,r)}_loadVectors(e,r,n){return new R0(r,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}}});function ei(t){let e=t.byteLength+7&-8;return this.buffers.push(t),this.bufferRegions.push(new $t(this._byteLength,e)),this._byteLength+=e,this}function IK(t){var e;let{type:r,length:n,typeIds:i,valueOffsets:o}=t;if(ei.call(this,i),r.mode===Ze.Sparse)return Ix.call(this,t);if(r.mode===Ze.Dense){if(t.offset<=0)return ei.call(this,o),Ix.call(this,t);{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]=((e=c[l])!==null&&e!==void 0?e:0)+1);ei.call(this,s),this.visitMany(t.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 PK(t){let e;return t.nullCount>=t.length?ei.call(this,new Uint8Array(t.length+7>>3)):(e=t.values)instanceof Uint8Array?ei.call(this,Ic(t.offset,t.length,e)):ei.call(this,Pc(t.values))}function xs(t){return ei.call(this,t.values.subarray(0,t.length*t.stride))}function H0(t){let{length:e,values:r,valueOffsets:n}=t,i=Le(n[0]),o=Le(n[e]),s=Math.min(o-i,r.byteLength-i);return ei.call(this,Op(-i,e+1,n)),ei.call(this,r.subarray(i,i+s)),this}function aR(t){let{offset:e,length:r,stride:n,values:i,variadicBuffers:o=[]}=t;if(!i)throw new Error("BinaryView data is missing view buffer");let s=e*n,a=s+r*n;ei.call(this,i.subarray(s,a));for(let c of o)ei.call(this,c);return this._variadicBufferCounts.push(o.length),this}function K0(t){let{length:e,valueOffsets:r}=t;if(r){let n=Le(r[0]),i=Le(r[e]);return ei.call(this,Op(-n,e+1,r)),this.visit(t.children[0].slice(n,i-n))}return this.visit(t.children[0])}function Ix(t){return this.visitMany(t.type.children.map((e,r)=>t.children[r]).filter(Boolean))[0]}var Mt,cR=p(()=>{Fr();En();Dt();ys();ur();Rc();la();st();xo();Mt=class t extends ie{static assemble(...e){let r=i=>i.flatMap(o=>Array.isArray(o)?r(o):o instanceof ze?o.data.children:o.data),n=new t;return n.visitMany(r(e)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[],this._variadicBufferCounts=[]}visit(e){if(e instanceof H)return this.visitMany(e.data),this;let{type:r}=e;if(!j.isDictionary(r)){let{length:n}=e;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(j.isUnion(r))this.nodes.push(new bi(n,0));else{let{nullCount:i}=e;j.isNull(r)||ei.call(this,i<=0?new Uint8Array(0):Ic(e.offset,n,e.nullBitmap)),this.nodes.push(new bi(n,i))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.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=PK;Mt.prototype.visitInt=xs;Mt.prototype.visitFloat=xs;Mt.prototype.visitUtf8=H0;Mt.prototype.visitLargeUtf8=H0;Mt.prototype.visitUtf8View=aR;Mt.prototype.visitBinary=H0;Mt.prototype.visitLargeBinary=H0;Mt.prototype.visitBinaryView=aR;Mt.prototype.visitFixedSizeBinary=xs;Mt.prototype.visitDate=xs;Mt.prototype.visitTimestamp=xs;Mt.prototype.visitTime=xs;Mt.prototype.visitDecimal=xs;Mt.prototype.visitList=K0;Mt.prototype.visitLargeList=K0;Mt.prototype.visitStruct=Ix;Mt.prototype.visitUnion=IK;Mt.prototype.visitInterval=xs;Mt.prototype.visitDuration=xs;Mt.prototype.visitFixedSizeList=K0;Mt.prototype.visitMap=K0});var X0,lR=p(()=>{En();zp();Dt();X0=class extends ie{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:pe[e].toLowerCase()}}visitInt({typeId:e,bitWidth:r,isSigned:n}){return{name:pe[e].toLowerCase(),bitWidth:r,isSigned:n}}visitFloat({typeId:e,precision:r}){return{name:pe[e].toLowerCase(),precision:rt[r]}}visitBinary({typeId:e}){return{name:pe[e].toLowerCase()}}visitLargeBinary({typeId:e}){return{name:pe[e].toLowerCase()}}visitBinaryView({typeId:e}){return{name:pe[e].toLowerCase()}}visitBool({typeId:e}){return{name:pe[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:pe[e].toLowerCase()}}visitLargeUtf8({typeId:e}){return{name:pe[e].toLowerCase()}}visitUtf8View({typeId:e}){return{name:pe[e].toLowerCase()}}visitDecimal({typeId:e,scale:r,precision:n,bitWidth:i}){return{name:pe[e].toLowerCase(),scale:r,precision:n,bitWidth:i}}visitDate({typeId:e,unit:r}){return{name:pe[e].toLowerCase(),unit:ut[r]}}visitTime({typeId:e,unit:r,bitWidth:n}){return{name:pe[e].toLowerCase(),unit:W[r],bitWidth:n}}visitTimestamp({typeId:e,timezone:r,unit:n}){return{name:pe[e].toLowerCase(),unit:W[n],timezone:r}}visitInterval({typeId:e,unit:r}){return{name:pe[e].toLowerCase(),unit:qe[r]}}visitDuration({typeId:e,unit:r}){return{name:pe[e].toLocaleLowerCase(),unit:W[r]}}visitList({typeId:e}){return{name:pe[e].toLowerCase()}}visitLargeList({typeId:e}){return{name:pe[e].toLowerCase()}}visitStruct({typeId:e}){return{name:pe[e].toLowerCase()}}visitUnion({typeId:e,mode:r,typeIds:n}){return{name:pe[e].toLowerCase(),mode:Ze[r].toUpperCase(),typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:r}){return{name:pe[e].toLowerCase(),byteWidth:r}}visitFixedSizeList({typeId:e,listSize:r}){return{name:pe[e].toLowerCase(),listSize:r}}visitMap({typeId:e,keysSorted:r}){return{name:pe[e].toLowerCase(),keysSorted:r}}}});function*Px(t){for(let e of t)yield e.reduce((r,n)=>`${r}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*_s(t,e){let r=new Uint32Array(t.buffer,t.byteOffset,t.byteLength/Uint32Array.BYTES_PER_ELEMENT);for(let n=-1,i=r.length/e;++n<i;)yield`${hc.new(r.subarray((n+0)*e,(n+1)*e),!1)}`}function uR(t,e){let n=t.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:e(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(t.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 Wh,fR=p(()=>{Vp();Fr();En();Dt();Dt();Rc();P0();st();Wh=class t extends ie{static assemble(...e){let r=new t;return e.map(({schema:n,data:i})=>r.visitMany(n.fields,i.children))}visit({name:e},r){let{length:n}=r,{offset:i,nullCount:o,nullBitmap:s}=r,a=j.isDictionary(r.type)?r.type.indices:r.type,c=Object.assign([],r.buffers,{[Ne.VALIDITY]:void 0});return Object.assign({name:e,count:n,VALIDITY:j.isNull(a)||j.isUnion(a)?void 0:o<=0?Array.from({length:n},()=>1):[...new vo(s,i,n,null,h0)]},super.visit(r.clone(a,i,n,0,c)))}visitNull(){return{}}visitBool({values:e,offset:r,length:n}){return{DATA:[...new vo(e,r,n,null,Lu)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[..._s(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...new H([e])],OFFSET:[...e.valueOffsets]}}visitLargeUtf8(e){return{DATA:[...new H([e])],OFFSET:[..._s(e.valueOffsets,2)]}}visitBinary(e){return{DATA:[...Px(new H([e]))],OFFSET:[...e.valueOffsets]}}visitLargeBinary(e){return{DATA:[...Px(new H([e]))],OFFSET:[..._s(e.valueOffsets,2)]}}visitBinaryView(e){return uR(e,r=>Array.from(r).map(n=>("0"+(n&255).toString(16)).slice(-2)).join("").toUpperCase())}visitUtf8View(e){return uR(e,r=>Array.from(r).map(n=>String.fromCodePoint(n)).join(""))}visitFixedSizeBinary(e){return{DATA:[...Px(new H([e]))]}}visitDate(e){return{DATA:e.type.unit===ut.DAY?[...e.values]:[..._s(e.values,2)]}}visitTimestamp(e){return{DATA:[..._s(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<W.MICROSECOND?[...e.values]:[..._s(e.values,2)]}}visitDecimal(e){return{DATA:[..._s(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}visitLargeList(e){return{OFFSET:[..._s(e.valueOffsets,2)],children:this.visitMany(e.type.children,e.children)}}visitStruct(e){return{children:this.visitMany(e.type.children,e.children)}}visitUnion(e){return{TYPE_ID:[...e.typeIds],OFFSET:e.type.mode===Ze.Dense?[...e.valueOffsets]:void 0,children:this.visitMany(e.type.children,e.children)}}visitInterval(e){switch(e.type.unit){case qe.YEAR_MONTH:return{DATA:[...e.values]};case qe.DAY_TIME:return{DATA:jw(e.values)};case qe.MONTH_DAY_NANO:return{DATA:zw(e.values,!0)}}}visitDuration(e){return{DATA:[..._s(e.values,2)]}}visitFixedSizeList(e){return{children:this.visitMany(e.type.children,e.children)}}visitMap(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}}});function Rx(t,e){let r=e;e instanceof je&&(r=e.batches,t.reset(void 0,e.schema));for(let n of r)t.write(n);return t.finish()}function Lx(t,e){return $(this,void 0,void 0,function*(){var r,n,i,o,s,a,c;try{for(r=!0,n=kn(e);i=yield n.next(),o=i.done,!o;r=!0){c=i.value,r=!1;let l=c;t.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 t.finish()})}function dR({name:t,type:e,nullable:r}){let n=new X0;return{name:t,nullable:r,type:n.visit(e),children:(e.children||[]).map(i=>dR(i)),dictionary:j.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function RK(t,e,r=!1){let[n]=Wh.assemble(new ze({[e]:t}));return JSON.stringify({id:e,isDelta:r,data:{count:t.length,columns:n}},null,2)}function LK(t){let[e]=Wh.assemble(t);return JSON.stringify({count:t.numRows,columns:e},null,2)}var hR,Mi,Ss,Ms,$h,Hh=p(()=>{Ar();il();q0();Fr();st();la();la();Lw();Dt();Vh();To();cR();lR();fR();ur();ys();Fh();es();yu();V0();hR=me(Ve(),1),Mi=class extends Bc{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,r){throw new Error('"throughDOM" not available in this environment')}constructor(e){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new An,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Yr(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1,e.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(e.compressionType))this._compression=new Cc(e.compressionType);else{let r=Object.values(Ir).filter(n=>typeof n=="string");throw new Error(`Unsupported compressionType: ${e.compressionType} Available types: ${r.join(", ")}`)}}else this._compression=null}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return Un(e)?e.then(r=>this.writeAll(r)):xn(e)?Lx(this,e):Rx(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,r=null){return e===this._sink||e instanceof An?this._sink=e:(this._sink=new An,e&&XI(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&YI(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!r||!nl(r,this._schema))&&(r==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(e){let r=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof je&&!(r=e.schema))return this.finish()&&void 0;if(e instanceof ze&&!(r=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!nl(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}e instanceof ze?e instanceof ol||this._writeRecordBatch(e):e instanceof je?this.writeAll(e.batches):jn(e)&&this.writeAll(e)}_writeMessage(e,r=8){let n=r-1,i=jr.encode(e),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+n&~n,c=a-o-s;return e.headerType===ke.RecordBatch?this._recordBatchBlocks.push(new Hi(a,e.bodyLength,this._position)):e.headerType===ke.DictionaryBatch&&this._dictionaryBlocks.push(new Hi(a,e.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(e){if(this._started){let r=se(e);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(e){return this._writeMessage(jr.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Uu)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=this._assembleRecordBatch(e),a=new nr(e.numRows,n,i,this._compression,s,e.metadata),c=jr.from(a,r);return this._writeDictionaries(e)._writeMessage(c)._writeBodyBuffers(o)}_assembleRecordBatch(e){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=Mt.assemble(e);return this._compression!=null&&({byteLength:r,bufferRegions:i,buffers:o}=this._compressBodyBuffers(o)),{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}}_compressBodyBuffers(e){let r=Ca.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 e){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 hR.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(e,r,n=!1){let{byteLength:i,nodes:o,bufferRegions:s,buffers:a,variadicBufferCounts:c}=this._assembleRecordBatch(new H([e])),l=new nr(e.length,o,s,this._compression,c),u=new Ur(l,r,n),h=jr.from(u,i);return this._writeMessage(h)._writeBodyBuffers(a)}_writeBodyBuffers(e){let r=this._compression!=null?2:1,n=new Array(r);for(let i=0;i<e.length;i+=r){let o=0;for(let a=-1;++a<r;)n[a]=e[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(e){var r,n;for(let[i,o]of e.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}},Ss=class t extends Mi{static writeAll(e,r){let n=new t(r);return Un(e)?e.then(i=>n.writeAll(i)):xn(e)?Lx(n,e):Rx(n,e)}},Ms=class t extends Mi{static writeAll(e,r){let n=new t(r);return Un(e)?e.then(i=>n.writeAll(i)):xn(e)?Lx(n,e):Rx(n,e)}constructor(e){super(e),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,r,n=!1){if(!n&&this._seenDictionaries.has(r))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(e,r,n)}_writeFooter(e){let r=cs.encode(new cs(e,ot.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}},$h=class t extends Mi{static writeAll(e){return new t().writeAll(e)}constructor(){super(),this._autoDestroy=!0,this._recordBatches=[],this._recordBatchesWithDictionaries=[]}_writeMessage(){return this}_writeFooter(e){return this}_writeSchema(e){return this._write(`{
14
+ "schema": ${JSON.stringify({fields:e.fields.map(r=>dR(r))},null,2)}`)}_writeDictionaries(e){return e.dictionaries.size>0&&this._recordBatchesWithDictionaries.push(e),this}_writeDictionaryBatch(e,r,n=!1){return this._write(this._dictionaryBlocks.length===0?" ":`,
15
+ `),this._write(RK(e,r,n)),this._dictionaryBlocks.push(new Hi(0,0,0)),this}_writeRecordBatch(e){return this._writeDictionaries(e),this._recordBatches.push(e),this}close(){if(this._recordBatchesWithDictionaries.length>0){this._write(`,
16
16
  "dictionaries": [
17
17
  `);for(let e of this._recordBatchesWithDictionaries)super._writeDictionaries(e);this._write(`
18
18
  ]`)}if(this._recordBatches.length>0){for(let e=-1,r=this._recordBatches.length;++e<r;)this._write(e===0?`,
19
19
  "batches": [
20
20
  `:`,
21
- `),this._write(YK(this._recordBatches[e])),this._recordBatchBlocks.push(new Xi(0,0,0));this._write(`
21
+ `),this._write(LK(this._recordBatches[e])),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 _5(t,e){if(Mn(t))return new Nx(t[Symbol.asyncIterator](),e);if(Wn(t))return new Dx(t[Symbol.iterator](),e);throw new Error("toNodeStream() must be called with an Iterable or AsyncIterable")}var Fx,Dx,Nx,S5=p(()=>{Ar();Fx=require("node:stream");ts();Dx=class extends Fx.Readable{constructor(e,r){super(r),this._iterator=e,this._pulling=!1,this._bytesMode=!r||!r.objectMode}_read(e){let r=this._iterator;r&&!this._pulling&&(this._pulling=!0)&&(this._pulling=this._pull(e,r))}_destroy(e,r){let n=this._iterator,i;n&&(i=e!=null&&n.throw||n.return),i==null||i.call(n,e),r&&r(null)}_pull(e,r){let n=this._bytesMode,i=null;for(;this.readable&&!(i=r.next(n?e:null)).done&&(e!=null&&(e-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(i.value)||e<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&r.return&&r.return(),!this.readable}},Nx=class extends Fx.Readable{constructor(e,r){super(r),this._iterator=e,this._pulling=!1,this._bytesMode=!r||!r.objectMode}_read(e){let r=this._iterator;r&&!this._pulling&&(this._pulling=!0)&&$(this,void 0,void 0,function*(){return this._pulling=yield this._pull(e,r)})}_destroy(e,r){let n=this._iterator,i;n&&(i=e!=null&&n.throw||n.return),i!=null&&i.call(n,e).then(()=>r&&r(null))||r&&r(null)}_pull(e,r){return $(this,void 0,void 0,function*(){let n=this._bytesMode,i=null;for(;this.readable&&!(i=yield r.next(n?e:null)).done&&(e!=null&&(e-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(i.value)||e<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&r.return&&r.return(),!this.readable})}}});function v5(t){return new kx(oi(t),t)}var M5,kx,ZK,JK,E5=p(()=>{M5=require("node:stream");ku();kx=class extends M5.Duplex{constructor(e,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=e,this._desiredSize=o,this._getSize=n!=="bytes"?ZK:JK}_read(e){this._maybeFlush(this._builder,this._desiredSize=e)}_final(e){this._maybeFlush(this._builder.finish(),this._desiredSize),e&&e()}_write(e,r,n){let i=this._maybeFlush(this._builder.append(e),this._desiredSize);return n&&n(),i}_destroy(e,r){this._builder.clear(),r&&r(e)}_maybeFlush(e,r){return this._getSize(e)>=r&&++this._numChunks&&this.push(e.toVector()),e.finished?((e.length>0||this._numChunks===0)&&++this._numChunks&&this.push(e.toVector()),!this._finished&&(this._finished=!0)&&this.push(null),!1):this._getSize(e)<this.writableHighWaterMark}},ZK=t=>t.length,JK=t=>t.byteLength});function A5(t){return new Gx(t)}var T5,Gx,I5=p(()=>{Ar();T5=require("node:stream");Ao();ll();Gx=class extends T5.Duplex{constructor(e){super(Object.assign(Object.assign({allowHalfOpen:!1},e),{readableObjectMode:!0,writableObjectMode:!1})),this._pulling=!1,this._autoDestroy=!0,this._reader=null,this._pulling=!1,this._asyncQueue=new Ln,this._autoDestroy=e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:!0}_final(e){let r=this._asyncQueue;r==null||r.close(),e&&e()}_write(e,r,n){let i=this._asyncQueue;return i==null||i.write(e),n&&n(),!0}_read(e){let r=this._asyncQueue;r&&!this._pulling&&(this._pulling=!0)&&$(this,void 0,void 0,function*(){this._reader||(this._reader=yield this._open(r)),this._pulling=yield this._pull(e,this._reader)})}_destroy(e,r){let n=this._asyncQueue;n&&(e?n.abort(e):n.close()),r(this._asyncQueue=this._reader=null)}_open(e){return $(this,void 0,void 0,function*(){return yield(yield pr.from(e)).open({autoDestroy:this._autoDestroy})})}_pull(e,r){return $(this,void 0,void 0,function*(){let n=null;for(;this.readable&&!(n=yield r.next()).done&&!(!this.push(n.value)||e!=null&&--e<=0););return(!this.readable||n!=null&&n.done&&(r.autoDestroy||(yield r.reset().open()).closed))&&(this.push(null),yield r.cancel()),!this.readable})}}});function R5(t){return new Ux(new this(t))}var P5,Ux,L5=p(()=>{Ar();P5=require("node:stream");Ao();Ux=class extends P5.Duplex{constructor(e,r){super(Object.assign(Object.assign({allowHalfOpen:!1},r),{writableObjectMode:!0,readableObjectMode:!1})),this._pulling=!1,this._writer=e,this._reader=new Hr(e)}_final(e){let r=this._writer;r==null||r.close(),e&&e()}_write(e,r,n){let i=this._writer;return i==null||i.write(e),n&&n(),!0}_read(e){let r=this._reader;r&&!this._pulling&&(this._pulling=!0)&&$(this,void 0,void 0,function*(){return this._pulling=yield this._pull(e,r)})}_destroy(e,r){let n=this._writer;n&&(e?n.abort(e):n.close()),r(this._reader=this._writer=null)}_pull(e,r){return $(this,void 0,void 0,function*(){let n=null;for(;this.readable&&!(n=yield r.next(e||null)).done&&(e!=null&&n.value&&(e-=n.value.byteLength),!(!this.push(n.value)||e<=0)););return(n!=null&&n.done||!this.readable)&&(this.push(null),yield r.cancel()),!this.readable})}}});function O5(t,e){if(Mn(t))return eX(t,e);if(Wn(t))return QK(t,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function QK(t,e){let r=null,n=(e==null?void 0:e.type)==="bytes"||!1,i=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(s){o(s,r||(r=t[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},e));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 eX(t,e){let r=null,n=(e==null?void 0:e.type)==="bytes"||!1,i=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(s){return $(this,void 0,void 0,function*(){yield o(s,r||(r=t[Symbol.asyncIterator]()))})},pull(s){return $(this,void 0,void 0,function*(){r?yield o(s,r):s.close()})},cancel(){return $(this,void 0,void 0,function*(){r!=null&&r.return&&(yield r.return()),r=null})}}),Object.assign({highWaterMark:n?i:void 0},e));function o(s,a){return $(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 B5=p(()=>{Ar();dr();ts()});function N5(t){return new jx(t)}var jx,C5,D5,F5=p(()=>{Ar();ku();jx=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=e,o=QI(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=oi(o),this._getSize=i!=="bytes"?C5:D5;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"?C5:D5}),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(e){let r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-r}_maybeFlush(e,r){r!=null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(e,r){this._bufferedSize=0,this._controller=null,r==null?e.close():e.enqueue(r)}},C5=t=>{var e;return(e=t==null?void 0:t.length)!==null&&e!==void 0?e:0},D5=t=>{var e;return(e=t==null?void 0:t.byteLength)!==null&&e!==void 0?e:0}});function Q0(t,e){let r=new Ln,n=null,i=new ReadableStream({cancel(){return $(this,void 0,void 0,function*(){yield r.close()})},start(a){return $(this,void 0,void 0,function*(){yield s(a,n||(n=yield o()))})},pull(a){return $(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)},t)),readable:i};function o(){return $(this,void 0,void 0,function*(){return yield(yield pr.from(r)).open(e)})}function s(a,c){return $(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 k5=p(()=>{Ar();Ao();ll()});function e1(t,e){let r=new this(t),n=new Hr(r),i=new ReadableStream({cancel(){return $(this,void 0,void 0,function*(){yield n.cancel()})},pull(s){return $(this,void 0,void 0,function*(){yield o(s)})},start(s){return $(this,void 0,void 0,function*(){yield o(s)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(r,t),readable:i};function o(s){return $(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 G5=p(()=>{Ar();Ao()});function Ka(t){let e=pr.from(t);return Vn(e)?e.then(r=>Ka(r)):e.isAsync()?e.readAll().then(r=>new qe(r)):new qe(e.readAll())}function ul(t,e="stream",r=null){let n={compressionType:r};return(e==="stream"?Ms:vs).writeAll(t,n).toUint8Array(!0)}var U5=p(()=>{ol();ts();ll();Hh()});var zx={};Qt(zx,{isArrowData:()=>i1,isArrowDataType:()=>n1,isArrowField:()=>r1,isArrowRecordBatch:()=>s1,isArrowSchema:()=>t1,isArrowTable:()=>a1,isArrowVector:()=>o1});function t1(t){return ve.isSchema(t)}function r1(t){return ee.isField(t)}function n1(t){return U.isDataType(t)}function i1(t){return ce.isData(t)}function o1(t){return H.isVector(t)}function s1(t){return Ue.isRecordBatch(t)}function a1(t){return qe.isTable(t)}var qx=p(()=>{Vr();at();_i();zr();bs();ol()});var j5,Vx=p(()=>{$p();yu();Nt();_i();at();ol();zr();Pn();Vr();Lh();h0();bt();ku();Hw();sx();Kw();Xw();Yw();Zw();Qw();rx();lx();cx();ex();tx();fx();dx();hx();D0();F0();N0();nx();ix();Jw();ox();ax();ux();Ao();ll();Hh();U5();H0();$0();Ma();bs();qx();Hp();jw();Lc();Rh();dr();Ru();Sh();O0();qx();Vh();j5=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},uw),Uw),Tw),fw),Ib),Ew),sw),$w),zx),{compareSchemas:il,compareFields:YR,compareTypes:U0})});var z5=p(()=>{gu();bt();ll();Hh();B5();F5();k5();G5();Vx();Vx();mr.toDOMStream=O5;ct.throughDOM=N5;pr.throughDOM=Q0;xs.throughDOM=Q0;Zi.throughDOM=Q0;Ai.throughDOM=e1;vs.throughDOM=e1;Ms.throughDOM=e1});var Lo={};Qt(Lo,{AsyncByteQueue:()=>Ln,AsyncByteStream:()=>Hr,AsyncMessageReader:()=>al,AsyncRecordBatchFileReader:()=>zu,AsyncRecordBatchStreamReader:()=>ws,Binary:()=>Tn,BinaryBuilder:()=>hs,BinaryView:()=>Ee,BinaryViewBuilder:()=>ps,Bool:()=>Gr,BoolBuilder:()=>Nc,BufferType:()=>Ne,Builder:()=>ct,ByteStream:()=>Mi,CompressionType:()=>Ir,Data:()=>ce,DataType:()=>U,DateBuilder:()=>Io,DateDay:()=>aa,DateDayBuilder:()=>Ea,DateMillisecond:()=>ca,DateMillisecondBuilder:()=>Ta,DateUnit:()=>st,Date_:()=>sn,Decimal:()=>An,DecimalBuilder:()=>Aa,DenseUnion:()=>ss,DenseUnionBuilder:()=>rl,Dictionary:()=>nr,DictionaryBuilder:()=>Fc,Duration:()=>an,DurationBuilder:()=>vi,DurationMicrosecond:()=>Ah,DurationMicrosecondBuilder:()=>Ca,DurationMillisecond:()=>Th,DurationMillisecondBuilder:()=>Ba,DurationNanosecond:()=>Ih,DurationNanosecondBuilder:()=>Da,DurationSecond:()=>Eh,DurationSecondBuilder:()=>Oa,Field:()=>ee,FixedSizeBinary:()=>In,FixedSizeBinaryBuilder:()=>Ia,FixedSizeList:()=>Ht,FixedSizeListBuilder:()=>kc,Float:()=>Fr,Float16:()=>Vi,Float16Builder:()=>Gc,Float32:()=>nn,Float32Builder:()=>Uc,Float64:()=>Qn,Float64Builder:()=>jc,FloatBuilder:()=>Po,Int:()=>Pt,Int16:()=>Xn,Int16Builder:()=>qc,Int32:()=>Zt,Int32Builder:()=>Vc,Int64:()=>Yn,Int64Builder:()=>Wc,Int8:()=>Kn,Int8Builder:()=>zc,IntBuilder:()=>ln,Interval:()=>Ur,IntervalBuilder:()=>Yi,IntervalDayTime:()=>ga,IntervalDayTimeBuilder:()=>Pa,IntervalMonthDayNano:()=>vh,IntervalMonthDayNanoBuilder:()=>La,IntervalUnit:()=>Ge,IntervalYearMonth:()=>ya,IntervalYearMonthBuilder:()=>Ra,JSONMessageReader:()=>cl,LargeBinary:()=>Wi,LargeBinaryBuilder:()=>ds,LargeList:()=>ei,LargeListBuilder:()=>Zc,LargeUtf8:()=>$i,LargeUtf8Builder:()=>Wa,List:()=>rr,ListBuilder:()=>Yc,MapBuilder:()=>Jc,MapRow:()=>xi,Map_:()=>jr,Message:()=>$r,MessageHeader:()=>ke,MessageReader:()=>$a,MetadataVersion:()=>ot,Null:()=>$t,NullBuilder:()=>Qc,Precision:()=>Xe,RecordBatch:()=>Ue,RecordBatchFileReader:()=>xs,RecordBatchFileWriter:()=>vs,RecordBatchJSONWriter:()=>$h,RecordBatchReader:()=>pr,RecordBatchStreamReader:()=>Zi,RecordBatchStreamWriter:()=>Ms,RecordBatchWriter:()=>Ai,Schema:()=>ve,SparseUnion:()=>ba,SparseUnionBuilder:()=>tl,Struct:()=>$e,StructBuilder:()=>el,StructRow:()=>vo,Table:()=>qe,Time:()=>Pr,TimeBuilder:()=>Ti,TimeMicrosecond:()=>fa,TimeMicrosecondBuilder:()=>za,TimeMillisecond:()=>ua,TimeMillisecondBuilder:()=>ja,TimeNanosecond:()=>ha,TimeNanosecondBuilder:()=>qa,TimeSecond:()=>la,TimeSecondBuilder:()=>Ua,TimeUnit:()=>q,Timestamp:()=>Rr,TimestampBuilder:()=>Ei,TimestampMicrosecond:()=>ma,TimestampMicrosecondBuilder:()=>ka,TimestampMillisecond:()=>Mo,TimestampMillisecondBuilder:()=>Fa,TimestampNanosecond:()=>pa,TimestampNanosecondBuilder:()=>Ga,TimestampSecond:()=>da,TimestampSecondBuilder:()=>Na,Type:()=>x,Uint16:()=>Jn,Uint16Builder:()=>Hc,Uint32:()=>rn,Uint32Builder:()=>Kc,Uint64:()=>qi,Uint64Builder:()=>Xc,Uint8:()=>Zn,Uint8Builder:()=>$c,Union:()=>cn,UnionBuilder:()=>ms,UnionMode:()=>Qe,Utf8:()=>kr,Utf8Builder:()=>Va,Utf8View:()=>on,Utf8ViewBuilder:()=>nl,Vector:()=>H,Visitor:()=>ie,builderThroughAsyncIterable:()=>bx,builderThroughIterable:()=>z0,compressionRegistry:()=>Ha,isArrowData:()=>i1,isArrowDataType:()=>n1,isArrowField:()=>r1,isArrowRecordBatch:()=>s1,isArrowSchema:()=>t1,isArrowTable:()=>a1,isArrowVector:()=>o1,makeBuilder:()=>oi,makeData:()=>te,makeTable:()=>wx,makeVector:()=>To,tableFromArrays:()=>xx,tableFromIPC:()=>Ka,tableFromJSON:()=>yx,tableToIPC:()=>ul,util:()=>j5,vectorFromArray:()=>Gu});var Oo=p(()=>{gu();bt();ll();Hh();S5();E5();I5();L5();z5();mr.toNodeStream=_5;ct.throughNode=v5;pr.throughNode=A5;Ai.throughNode=R5});var c1=p(()=>{});var l1=p(()=>{});function Wu(t){return t.variadicBuffers??[]}function Kh(t,e,r,n,i,o,s,a){return Reflect.construct(ce,[t,e,r,n,i,o,s,a])}var u1=p(()=>{Oo()});function Xh(t){return t.metadata}function Yh(t,e,r){if("metadata"in Ue.prototype){let i=Ue;return Object.assign(new i(t,e,r),{data:e})}let n=Object.assign(new Ue(t,e),{data:e});return r===void 0?n:Object.assign(n,{metadata:r})}var f1=p(()=>{Oo()});function $x(t,e={}){let r=new Set,n=new Set;for(let o of e.retain??[]){let s=q5(o)?o.batches.map(a=>a.data):W5(o)?o.data:[V5(o)?o.data:o];for(let a of s)Wx(a,r,n)}let i={...e,copies:new WeakMap,retainedBuffers:r};return q5(t)?tX(t,i):V5(t)?$5(t,i):W5(t)?H5(t,i):h1(t,i)}function q5(t){return"batches"in t}function V5(t){return"schema"in t&&"data"in t&&!Array.isArray(t.data)}function W5(t){return"data"in t&&Array.isArray(t.data)}function tX(t,e){let r=t.batches.map(n=>$5(n,e));return new qe(t.schema,r)}function $5(t,e){let r=h1(t.data,e);return Yh(t.schema,r,Xh(t))}function h1(t,e){let r=t.children.map(o=>h1(o,e)),n=t.dictionary?H5(t.dictionary,e):void 0,i={[Ne.OFFSET]:Zh(t.buffers[Ne.OFFSET],e),[Ne.DATA]:Zh(t.buffers[Ne.DATA],e),[Ne.VALIDITY]:Zh(t.buffers[Ne.VALIDITY],e),[Ne.TYPE]:Zh(t.buffers[Ne.TYPE],e)};return Kh(t.type,t.offset,t.length,t._nullCount,i,r,n,Wu(t).map(o=>Zh(o,e)))}function H5(t,e){return new H(t.data.map(r=>h1(r,e)))}function Wx(t,e,r){var n;if(!r.has(t)){r.add(t);for(let i of[...Object.values(t.buffers),...Wu(t)])K5(i)&&e.add(i.buffer);for(let i of t.children)Wx(i,e,r);for(let i of((n=t.dictionary)==null?void 0:n.data)??[])Wx(i,e,r)}}function Zh(t,e){if(!K5(t))return t;let r=t.byteOffset!==0||t.byteLength!==t.buffer.byteLength;if(!e.retainedBuffers.has(t.buffer)&&e.copy!=="all"&&(e.copy==="none"||!r))return t;let n=e.copies.get(t);return n||(n=t instanceof Uint8Array?new Uint8Array(t):t.slice(),e.copies.set(t,n)),n}function K5(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var d1=p(()=>{Oo();f1();u1()});var Hx=p(()=>{u1();d1()});var Kx=p(()=>{c1()});var Xx=p(()=>{c1();l1();Hx();Kx()});var Z5=p(()=>{c1();Xx()});var J5=p(()=>{l1()});function Jx(t,e){let r=$x(t,e);return{transport:"arrow-js",version:1,schema:ul(new qe(r.schema,[])),metadataVersion:r.schema.metadataVersion,batches:r.batches.map(n=>{let i=Xh(n);return{...Yx(n.data),...i!==void 0?{metadata:[...i]}:{}}})}}function Qx(t){if(t.transport!=="arrow-js"||t.version!==1)throw new Error("Unsupported Arrow column-buffer transport protocol.");let e=Ka(t.schema).schema,r=new ve(e.fields,e.metadata,e.dictionaries,t.metadataVersion),n=new $e(r.fields),i=t.batches.map(o=>{let s=Zx(o,n);return Yh(r,s,o.metadata&&new Map(o.metadata))});return new qe(r,i)}function Yx(t){var e;return{offset:t.offset,length:t.length,nullCount:t.nullCount,buffers:{[Ne.OFFSET]:t.buffers[Ne.OFFSET],[Ne.DATA]:t.buffers[Ne.DATA],[Ne.VALIDITY]:t.buffers[Ne.VALIDITY],[Ne.TYPE]:t.buffers[Ne.TYPE]},children:t.children.map(r=>Yx(r)),variadicBuffers:Wu(t),dictionary:(e=t.dictionary)==null?void 0:e.data.map(r=>Yx(r))}}function Zx(t,e){let r=t.children.map((i,o)=>Zx(i,e.children[o].type)),n=t.dictionary&&U.isDictionary(e)?new H(t.dictionary.map(i=>Zx(i,e.dictionary))):void 0;return Kh(e,t.offset,t.length,t.nullCount,t.buffers,r,n,t.variadicBuffers)}function Q5(t,e){return Jx(new qe(t.schema,[t]),e)}function eL(t){if(t.batches.length!==1)throw new Error("Arrow record batch transport requires exactly one batch.");return Qx(t).batches[0]}var tL=p(()=>{Oo();f1();u1();d1()});var rL=p(()=>{});var nL=p(()=>{Xx();Kx();Z5();l1();J5();d1();tL();rL();Hx();f1()});var iL=p(()=>{nL()});function sX(t){if(aL(t))return{...t.metadata,shape:"arrow-table",data:e_(t)};if(cL(t)){let{arrowBatchMetadata:e,data:r,...n}=t;return{...n,data:e_(t)}}throw new Error("Workers require Arrow column transport")}function aX(t,e={copy:"all"}){let r=t instanceof Ue;if(!r&&!(t instanceof qe))throw new Error("Workers require Arrow table output");return{transport:r?"arrow-record-batch":"arrow-table-columns",columns:r?{data:Q5(t,e)}:lL(t,e)}}function cX(t){let e=t;if((e==null?void 0:e.transport)!=="arrow-table-columns"&&(e==null?void 0:e.transport)!=="arrow-record-batch"||!t_(e.columns))throw new Error("Workers require Arrow column transport");if(e.transport==="arrow-record-batch"&&!e.columns.arrowBatchMetadata)return eL(e.columns.data);let r=e_(e.columns);return e.transport==="arrow-record-batch"?r.batches[0]:r}function oL(t,e){var a;let r=e,n=((a=r==null?void 0:r.core)==null?void 0:a.workerTransferBufferCopy)??(r==null?void 0:r.workerTransferBufferCopy);if(t instanceof qe||t instanceof Ue)return aX(t,{copy:n??"all"});if(!lX(t))return t;let{data:i,shape:o,...s}=t;return{transport:"arrow-column-envelope",metadata:structuredClone(s),...lL(i,n?{copy:n}:void 0)}}function sL(t){let e=t==null?void 0:t.transport;return e==="arrow-table-columns"||e==="arrow-record-batch"?cX(t):aL(t)||cL(t)?sX(t):t}function lX(t){let e=t;return!!(e&&e.shape==="arrow-table"&&e.data&&typeof e.data=="object"&&"batches"in e.data)}function t_(t){var r;let e=t;return((r=e==null?void 0:e.data)==null?void 0:r.transport)==="arrow-js"&&Array.isArray(e.data.batches)}function aL(t){return(t==null?void 0:t.transport)==="arrow-column-envelope"&&t_(t)}function cL(t){return(t==null?void 0:t.shape)==="arrow-table"&&t_(t)}function lL(t,e){return{arrowBatchMetadata:fX(t),data:uX(t,e)}}function uX(t,e){let r=Jx(t,e);if(t.numCols===0)for(let[n,i]of t.batches.entries())r.batches[n].length=i.numRows;return r}function fX(t){return t.batches.map(e=>({schema:ul(new qe(e.schema,[])),metadata:Array.from(e.metadata)}))}function e_(t){let{arrowBatchMetadata:e,data:r}=t,n=Qx(r),i=n.batches.map((o,s)=>{let a=e==null?void 0:e[s],c=a?new Ue(Ka(a.schema).schema,o.data,new Map(a.metadata)):o,l=r.batches[s].length;return c.numCols===0&&c.numRows!==l&&Object.defineProperty(c,"data",{value:new ce(new $e([]),0,l,0,void 0,[])}),c});return new qe(n.schema,i)}var uL=p(()=>{"use strict";Oo();iL()});function hX(t,e="float32"){return t instanceof Date?"date-millisecond":typeof t=="number"?e:typeof t=="boolean"?"bool":typeof t=="string"?"utf8":"null"}function fL(t){let e=r_(t);return e!=="null"?{type:e,nullable:!1}:t.length>0?(e=hX(t[0]),{type:e,nullable:!0}):{type:"null",nullable:!0}}function r_(t){if(typeof Float16Array<"u"&&t instanceof Float16Array)return"float16";switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case BigInt64Array:return"int64";case BigUint64Array:return"uint64";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}var n_=p(()=>{"use strict"});function pL(t){return{fields:t.fields.map(e=>fl(e)),metadata:gL(t.metadata)}}function gL(t){return Object.fromEntries(t)}function i_(t){return t?new Map(Object.entries(t)):new Map}function fl(t){return{name:t.name,type:yL(t.type),nullable:t.nullable,metadata:gL(t.metadata)}}function Es(t,e){return new ee(t.name,m1(t.type,e),t.nullable,i_(t.metadata))}function yL(t){if(hL(t,"BinaryView"))return"binary-view";if(hL(t,"Utf8View"))return"utf8-view";if(dX(t,"LargeList"))return{type:"large-list",children:[fl(t.valueField)]};switch(t.constructor){case $t:return"null";case Tn:return"binary";case In:return{type:"fixed-size-binary",byteWidth:t.byteWidth};case Gr:return"bool";case Pt:let e=t;return`${e.isSigned?"":"u"}int${e.bitWidth}`;case Kn:return"int8";case Xn:return"int16";case Zt:return"int32";case Yn:return"int64";case Zn:return"uint8";case Jn:return"uint16";case rn:return"uint32";case qi:return"uint64";case Fr:switch(t.precision){case Xe.HALF:return"float16";case Xe.SINGLE:return"float32";case Xe.DOUBLE:return"float64";default:return"float16"}case Vi:return"float16";case nn:return"float32";case Qn:return"float64";case kr:return"utf8";case An:let n=t;return{type:"decimal",bitWidth:n.bitWidth,precision:n.precision,scale:n.scale};case sn:return t.unit===st.DAY?"date-day":"date-millisecond";case aa:return"date-day";case ca:return"date-millisecond";case Pr:switch(t.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 ua:return"time-millisecond";case la:return"time-second";case fa:return"time-microsecond";case ha:return"time-nanosecond";case Rr:switch(t.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 da:return"timestamp-second";case Mo:return"timestamp-millisecond";case ma:return"timestamp-microsecond";case pa:return"timestamp-nanosecond";case Ur:switch(t.unit){case Ge.DAY_TIME:return"interval-daytime";case Ge.YEAR_MONTH:return"interval-yearmonth";default:return"interval-daytime"}case ga:return"interval-daytime";case ya:return"interval-yearmonth";case jr:let c=t;return{type:"map",keysSorted:c.keysSorted,children:c.children.map(y=>fl(y))};case rr:let u=t.valueField;return{type:"list",children:[fl(u)]};case Ht:let h=t;return{type:"fixed-size-list",listSize:h.listSize,children:[fl(h.children[0])]};case $e:return{type:"struct",children:t.children.map(y=>fl(y))};case ba:case ss:let m=t;return{type:m instanceof ss?"dense-union":"sparse-union",typeIds:m.typeIds,children:m.children.map(y=>fl(y)),typeIdToChildIndex:{...m.typeIdToChildIndex}};case nr:let g=t;return{type:"dictionary",id:g.id,indices:mX(g.indices),dictionary:yL(g.dictionary),isOrdered:g.isOrdered};default:throw new Error(`arrow type not supported: ${t.constructor.name}`)}}function m1(t,e){if(typeof t=="object")switch(t.type){case"decimal":return new An(t.scale,t.precision,t.bitWidth);case"map":{let r=t.children.map(n=>Es(n,e));return new jr(r[0],t.keysSorted)}case"list":{let r=Es(t.children[0],e);return new rr(r)}case"large-list":{let r=Es(t.children[0],e),n=Jh("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=Es(t.children[0],e);return new Ht(t.listSize,r)}case"fixed-size-binary":return new In(t.byteWidth);case"struct":{let r=t.children.map(n=>Es(n,e));return new $e(r)}case"sparse-union":case"dense-union":{let r=t.children.map(n=>Es(n,e));return t.type==="dense-union"?new ss(t.typeIds,r):new ba(t.typeIds,r)}case"dictionary":return new nr(m1(t.dictionary,e),gX(t.indices),t.id,t.isOrdered);default:throw new Error("array type not supported")}switch(t){case"null":return new $t;case"binary":return dL("BinaryView",new Tn,e);case"binary-view":return mL("BinaryView");case"bool":return new Gr;case"int8":return new Kn;case"int16":return new Xn;case"int32":return new Zt;case"int64":return new Yn;case"uint8":return new Zn;case"uint16":return new Jn;case"uint32":return new rn;case"uint64":return new qi;case"float16":return new Vi;case"float32":return new nn;case"float64":return new Qn;case"utf8":return dL("Utf8View",new kr,e);case"utf8-view":return mL("Utf8View");case"date-day":return new aa;case"date-millisecond":return new ca;case"time-second":return new la;case"time-millisecond":return new ua;case"time-microsecond":return new fa;case"time-nanosecond":return new ha;case"timestamp-second":return new da;case"timestamp-millisecond":return new Mo;case"timestamp-microsecond":return new ma;case"timestamp-nanosecond":return new pa;case"interval-daytime":return new ga;case"interval-yearmonth":return new ya;default:throw new Error("array type not supported")}}function Jh(t){return Lo[t]}function hL(t,e){let r=Jh(e);if(r&&t instanceof r)return!0;let n=U,i=e==="BinaryView"?n.isBinaryView:n.isUtf8View;return!!(i!=null&&i(t))}function dX(t,e){let r=Jh(e);return!!(r&&t instanceof r)}function dL(t,e,r){let n=(r==null?void 0:r.viewTypes)||"never";if(n==="never")return e;let i=Jh(t);if(i)return new i;if(n==="require")throw new Error(`${t} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return e}function mL(t){let e=Jh(t);if(!e)throw new Error(`${t} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return new e}function mX(t){if(t instanceof Pt){let r=`${t.isSigned?"int":"uint"}${t.bitWidth}`;if(pX(r))return r}switch(t.constructor){case Kn:return"int8";case Xn:return"int16";case Zt:return"int32";case Zn:return"uint8";case Jn:return"uint16";case rn:return"uint32";default:throw new Error(`arrow dictionary index type not supported: ${t.constructor.name}`)}}function pX(t){return["int8","int16","int32","uint8","uint16","uint32"].includes(t)}function gX(t){switch(t){case"int8":return new Kn;case"int16":return new Xn;case"int32":return new Zt;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: ${t}`)}}var o_=p(()=>{"use strict";Oo()});function p1(t){let e=t==null?void 0:t.POSITION;if(!e||!("value"in e)||!e.value.length)return null;let r=1/0,n=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0,c=e.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 bL=p(()=>{"use strict"});var wL=p(()=>{"use strict";bL()});function xL(t){let e=Zm();return new e(t)}function hl(t){return!!(eu&&t instanceof eu)}function _L(t,e,r){hl(t)?t[e]=r:t[e]=SL(r)}function Qh(t){return hl(t)?new Uint16Array(t.buffer,t.byteOffset,t.length):t}function s_(t,e){let r=xL(t.length);for(let n=0;n<t.length;n++)_L(r,n,t[n]/e);return r}function SL(t){if(!Number.isFinite(t))return t===1/0?31744:t===-1/0?64512:32256;let e=t<0||Object.is(t,-0)?32768:0,r=Math.abs(t);if(r===0)return e;if(r>=65520)return e|31744;if(r>=65504)return e|31743;let n=Math.floor(Math.log2(r));if(n<-14)return e|Math.round(r/2**-24);let i=n+15,o=Math.round((r/2**n-1)*1024);return o===1024?e|i+1<<10:e|i<<10|o}var ML=p(()=>{"use strict";Fn()});var g1,a_,vL=p(()=>{"use strict";Oo();g1=new ve([new ee("POSITION",new Ht(3,new ee("value",new nn,!1)),!1)]),a_=new ve([...g1.fields,new ee("indices",new rr(new ee("item",new rn,!1)),!0)])});var ed=p(()=>{"use strict";ML();vL()});function c_(t,e,r){let n=yX(t,e,r);return new H([n])}function yX(t,e,r){let n=bX(t,e,r),i=n.children[0].type,o=r==="float16"&&hl(t)?Qh(t):t,s={[Ne.DATA]:o},a=new ce(i,0,o.length,0,s);return new ce(n,0,o.length/e,0,void 0,[a])}function bX(t,e,r){let n=r||fL(t).type,i=m1(n);return new Ht(e,new ee("value",i,!1))}var EL=p(()=>{"use strict";ed();Oo();n_();o_()});function l_(t,e){var r;return AL(t.attributes,{schema:t.schema,topology:t.topology,mode:t.mode,boundingBox:(r=t.header)==null?void 0:r.boundingBox,indices:_X(t)?t.indices:void 0})}function AL(t,e={}){var c,l,u;let r=[],n={},i=xX(t);for(let h of i){let d=t[h],{value:m,size:g=1}=d,y=wX(m,g,d.componentType);if(n[h]=y,r.push(SX(e.schema,h,y,d.componentType)),h==="POSITION"&&((l=(c=e.indices)==null?void 0:c.value)!=null&&l.length)){let b=a_.fields.find(w=>w.name==="indices");n.indices=vX(e.indices.value,y.length,b.type),r.push(b)}}let o=new ve(r,EX(e)),s=((u=n[i[0]])==null?void 0:u.length)===0?new qe(o):new qe(o,n);return{shape:"arrow-table",schema:pL(s.schema),data:s,topology:e.topology||"point-list",indices:e.indices}}function wX(t,e,r){if(r==="float16"){let n=hl(t)?Qh(t):t;if(e===1){let i=new ce(new Vi,0,n.length,0,{[Ne.DATA]:n});return new H([i])}return c_(t,e,r)}return e===1?To(t):c_(t,e)}function xX(t){let e=Object.keys(t),r=TL.filter(i=>i in t),n=e.filter(i=>!TL.includes(i));return[...r,...n]}function _X(t){var e,r;return!!((r=(e=t.indices)==null?void 0:e.value)!=null&&r.length)}function SX(t,e,r,n){if(e==="POSITION"&&MX(r)){let o=g1.fields[0],s=t==null?void 0:t.fields.find(c=>c.name===e);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=t==null?void 0:t.fields.find(o=>o.name===e);if(n==="float16"){let o=new Map(Object.entries((i==null?void 0:i.metadata)||{}));return o.set("componentType","float16"),new ee(e,r.type,!1,o)}if(i&&i.type.toString()!==r.type.toString()){let o=Es(i);return new ee(e,r.type,o.nullable,o.metadata)}return i?Es(i):new ee(e,r.type,!1)}function MX(t){return t.type instanceof Ht&&t.type.listSize===3&&t.type.children[0].type instanceof nn}function vX(t,e,r){let n=r,i=t instanceof Uint32Array?t:Uint32Array.from(t),o=new Int32Array(e+1);e>0&&o.fill(i.length,1);let s=new Uint8Array(Math.ceil(e/8));e>0&&(s[0]=1);let a=new ce(n.children[0].type,0,i.length,0,{[Ne.DATA]:i}),c=new ce(n,0,e,Math.max(0,e-1),{[Ne.OFFSET]:o,[Ne.VALIDITY]:s},[a]);return new H([c])}function EX(t){var r;let e={...(r=t.schema)==null?void 0:r.metadata};return t.topology&&(e.topology||=t.topology),Number.isFinite(t.mode)&&(e.mode||=String(t.mode)),t.boundingBox&&(e.boundingBox||=JSON.stringify(t.boundingBox)),i_(e)}var TL,IL=p(()=>{"use strict";ed();ed();Oo();EL();o_();TL=["POSITION"]});function u_(t,e,r){let n=e.componentType||r_(e.value),i=r||y1(e),o=e.size===1?n:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]};return{name:t,type:o,nullable:!1,metadata:i}}function y1(t){let e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),t.componentType&&(e.componentType=t.componentType),t.transform&&(e["loaders.gl.transform"]=JSON.stringify(t.transform)),e}var PL=p(()=>{"use strict";n_()});var b1=p(()=>{"use strict";wL();IL();PL()});var RL,LL=p(()=>{"use strict";RL="5.0.0-beta.10"});var OL,BL=p(()=>{"use strict";OL={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var CL,DL=p(()=>{"use strict";CL={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow",decoderProfile:"full"}});async function td(t,e=null,r={},n=null,i=null){var o;if(Oi&&r.useLocalLibraries&&!r.CDN&&n&&((o=r.modules)==null?void 0:o[n])===void 0){let s=lc?"./libs":`modules/${e}/dist/libs`;r={...r,modules:{[n]:`${s}/${n}`,...i?{[i]:`${s}/${i}`}:{},...r.modules}}}return await $l(t,e,r,n,i)}var NL=p(()=>{"use strict";dc()});var TX,AX,rd,FL,kt,nd,kL=p(()=>{"use strict";TX="1.5.7",AX="8786740086a9f4d83f44aa83badfbea4dce7a1b5",rd=`https://www.gstatic.com/draco/versioned/decoders/${TX}`,FL=`https://cdn.jsdelivr.net/gh/google/draco@${AX}/javascript`,kt={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"},nd={[kt.DECODER]:`${rd}/${kt.DECODER}`,[kt.DECODER_WASM]:`${rd}/${kt.DECODER_WASM}`,[kt.GLTF_DECODER]:`${rd}/${kt.GLTF_DECODER}`,[kt.GLTF_DECODER_WASM]:`${rd}/${kt.GLTF_DECODER_WASM}`,[kt.FALLBACK_DECODER]:`${rd}/${kt.FALLBACK_DECODER}`,[kt.ENCODER]:`${FL}/${kt.ENCODER}`,[kt.ENCODER_WASM]:`${FL}/${kt.ENCODER_WASM}`}});async function w1(t={},e,r="full"){let n=LX(t);return n?await f_(n):await IX(t,e==="js"?"javascript":e,r)}async function IX(t={},e,r="full"){let n=BX(`${e}:${r}`,t),i=GL.get(n);return i||(i=PX(t,e,r),GL.set(n,i)),await i}async function f_(t){let e=OX(t),r=UL.get(e);return r||(r=zl(()=>e.createDecoderModule({}),n=>({draco:n})),UL.set(e,r)),await r}async function PX(t,e,r){try{return await zL(t,e,r)}catch(n){if(e==="javascript")throw n;try{return await zL(t,"javascript","full")}catch(i){throw new AggregateError([n,i],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function zL(t,e,r){let n=jL.then(()=>RX(t,e,r));return jL=n.then(()=>{},()=>{}),await n}async function RX(t,e,r){if(e==="javascript"){let s;try{s=await td(nd[kt.FALLBACK_DECODER],"scene",t,kt.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(Oi||t.useLocalLibraries)throw c;s=await td(nd[kt.FALLBACK_DECODER],"scene",{...t,useLocalLibraries:!0},kt.FALLBACK_DECODER,"draco_decoder.mjs")}let a=WL(s,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await VL(a)}let n,i;try{[n,i]=await qL(t,r)}catch(s){if(Oi||t.useLocalLibraries)throw s;[n,i]=await qL({...t,useLocalLibraries:!0},r)}let o=WL(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await VL(o,i)}async function qL(t,e){let r=e==="gltf"?kt.GLTF_DECODER:kt.DECODER,n=e==="gltf"?kt.GLTF_DECODER_WASM:kt.DECODER_WASM;return await Promise.all([td(nd[r],"scene",t,r,e==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),td(nd[n],"scene",t,n)])}function VL(t,e){if(typeof t!="function")throw new Error("Draco module initializer could not be loaded");return zl(r=>t({...e?{wasmBinary:e}:{},onModuleLoaded:r}),r=>({draco:r}))}function WL(t,e){if(typeof t=="function")return t;if(t&&typeof t=="object"){let r=t,n=r[e]||r.default;return typeof n=="function"?n:void 0}}function LX(t){var r;let e=(r=t.modules)==null?void 0:r.draco3d;if(e){if(typeof e!="object"&&typeof e!="function")throw new Error("Invalid draco3d module");return e}}function OX(t){let e=t;if(typeof(e==null?void 0:e.createDecoderModule)!="function")throw new Error("Invalid draco3d decoder module");return e}function BX(t,e){let r=Object.entries(e.modules||{}).filter(([n])=>n!=="draco3d").map(([n,i])=>`${n}:${String(i)}`).sort().join("|");return[t,e.useLocalLibraries?"local":"remote",e.CDN||"",r].join("|")}var GL,UL,jL,x1=p(()=>{"use strict";yi();NL();kL();GL=new Map,UL=new WeakMap;jL=Promise.resolve()});function HL(t,e,r){let n=KL(e.metadata),i=[],o=CX(e.attributes);for(let s in t){let a=t[s],c=$L(s,a,o[s]);i.push(c)}if(r){let s=$L("indices",r);i.push(s)}return{fields:i,metadata:n}}function CX(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function $L(t,e,r){let n={...y1(e),...r?KL(r.metadata):{}};return u_(t,e,n)}function KL(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var XL=p(()=>{"use strict";b1()});function kX(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function GX(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function UX(t){let e=t.size(),r=new Uint32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function jX(t,e){if(!Object.prototype.hasOwnProperty.call(e,t))return t;let r=/^(.*)_([0-9]+)$/.exec(t),n=r?r[1]:t,i=r?BigInt(r[2])+1n:1n;for(;Object.prototype.hasOwnProperty.call(e,`${n}_${i}`);)i++;return`${n}_${i}`}function zX(t){var e;if(t.quantization_transform){let{quantization_bits:r,min_values:n,range:i}=t.quantization_transform;if(r!==void 0&&n&&i!==void 0)return{type:"quantization",bits:r,origin:Array.from(n),range:i}}if(((e=t.octahedron_transform)==null?void 0:e.quantization_bits)!==void 0)return{type:"octahedron",bits:t.octahedron_transform.quantization_bits}}function qX(t){if(t.includeAttributes&&t.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function VX(t,e){for(let r of t.includeAttributes||t.excludeAttributes||[])if(!e.includes(r))throw new Error(`DracoLoader: selected attribute "${r}" does not exist`)}function WX(t){var a;let e=p1(t);if(!e)throw new Error("Decoded mesh is missing positions");let r=t.POSITION;if(((a=r==null?void 0:r.transform)==null?void 0:a.type)!=="quantization")return e;let{bits:n,origin:i,range:o}=r.transform,s=o/(2**n-1);return e.map(c=>c.map((l,u)=>i[u]+l*s))}var YL,DX,NX,FX,id,ZL=p(()=>{"use strict";yi();b1();XL();YL={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},DX={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},NX=2,FX=4,id=class{constructor(e,r=Li()){this.logger=r;this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}logger;draco;decoder;metadataQuerier;destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,r={}){qX(r);let n=ArrayBuffer.isView(e)?new Int8Array(e.buffer,e.byteOffset,e.byteLength):new Int8Array(e);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=WX(c.attributes),u=HL(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(e,r,n){let i=this._getTopLevelMetadata(e),o=this._getDracoAttributes(e,n);return{geometry_type:r,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:i,attributes:o}}_getDracoAttributes(e,r){let n={};for(let i=0;i<e.num_attributes();i++){let o=this.decoder.GetAttribute(e,i),s=this._getAttributeMetadata(e,i);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:i,metadata:s};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(o,r);c&&(n[o.unique_id()].octahedron_transform=c)}return n}_getMeshData(e,r,n){let i=this._getMeshAttributes(r,e,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");return e instanceof this.draco.Mesh?n.topology==="triangle-strip"?{topology:"triangle-strip",mode:5,attributes:i,indices:{value:this._getTriangleStripIndices(e),size:1}}:{topology:"triangle-list",mode:4,attributes:i,indices:{value:this._getTriangleListIndices(e),size:1}}:{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(e,r,n){let i={},o={},a=Object.values(e.attributes).sort((c,l)=>c.attribute_index-l.attribute_index).map(c=>{let l=this._deduceAttributeName(c,n),u=jX(l,o);return o[u]=!0,c.name=u,{attributeName:u,loaderAttribute:c}});VX(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:zX(l)}}}return i}_shouldExtractAttribute(e,r,n){var i,o;if(r.attribute_type===this.draco.POSITION){if((i=n.excludeAttributes)!=null&&i.includes(e))throw new Error(`DracoLoader: position attribute "${e}" cannot be excluded`);return!0}return n.includeAttributes&&!n.includeAttributes.includes(e)?!1:!((o=n.excludeAttributes)!=null&&o.includes(e))}_getTriangleListIndices(e){let n=e.num_faces()*3,i=e.num_points()<=65536,o=n*(i?NX:FX),s=this.draco._malloc(o);try{if(i){if(!this.decoder.GetTrianglesUInt16Array(e,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(e,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(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),UX(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=DX[r.data_type];if(!n)return this.logger.warn(`DRACO: Unsupported attribute type ${r.data_type}`)(),null;let i=r.num_components,s=e.num_points()*i,a=s*n.BYTES_PER_ELEMENT,c=kX(this.draco,n),l,u=this.draco._malloc(a);try{let h=this.decoder.GetAttribute(e,r.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(e,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(e,r){let n=e.unique_id;for(let[s,a]of Object.entries(r.extraAttributes||{}))if(a===n)return s;let i=r.attributeNameEntry||"name";if(e.metadata[i]){let s=e.metadata[i].string;return s==="COLOR"?"COLOR_0":s==="TEX_COORD"?"TEXCOORD_0":s}let o=e.attribute_type;for(let s in YL)if(this.draco[s]===o)return YL[s];return`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let r=this.decoder.GetMetadata(e);return this._getDracoMetadata(r)}_getAttributeMetadata(e,r){let n=this.decoder.GetAttributeMetadata(e,r);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(e);for(let i=0;i<n;i++){let o=this.metadataQuerier.GetEntryName(e,i);r[o]=this._getDracoMetadataField(e,o)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let i=GX(n);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=e,i=[...r,...n];for(let o of i)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,i=e.attribute_type();if(n.map(s=>this.draco[s]).includes(i)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:Float32Array.from({length:e.num_components()},(a,c)=>s.min_value(c))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,i=e.attribute_type();if(n.map(s=>this.draco[s]).includes(i)){let s=new this.draco.AttributeOctahedronTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}}});async function $u(t,e,r,n){var a,c;let i=(n==null?void 0:n.reportProgress)||(e==null?void 0:e.onProgress);i==null||i({phase:"decode",completed:0,total:1,unit:"tasks"});let{draco:o}=await r();(a=(e==null?void 0:e.signal)||(n==null?void 0:n.signal))==null||a.throwIfAborted();let s=new id(o,Li(e));try{let l=s.parseSync(t,e==null?void 0:e.draco);return i==null||i({phase:"decode",completed:1,total:1,unit:"tasks"}),((c=e==null?void 0:e.draco)==null?void 0:c.shape)==="arrow"?l_(l).data:l}finally{s.destroy()}}var _1=p(()=>{"use strict";yi();b1();ZL()});var bxe,$X,HX,JL=p(()=>{"use strict";dc();x1();_1();od();({preload:bxe,...$X}=Ii),HX={...$X,parse:async(t,e,r)=>await $u(t,e,async()=>{var n;return await w1(hc({core:e==null?void 0:e.core,modules:e==null?void 0:e.modules}),"wasm",(n=e==null?void 0:e.draco)==null?void 0:n.decoderProfile)},r)}});var QL={};Qt(QL,{DracoWASMLoaderWithParser:()=>HX});var eO=p(()=>{"use strict";JL()});var Exe,KX,XX,tO=p(()=>{"use strict";dc();x1();_1();od();({preload:Exe,...KX}=Ii),XX={...KX,parse:async(t,e,r)=>await $u(t,e,async()=>await w1(hc({core:e==null?void 0:e.core,modules:e==null?void 0:e.modules}),"js"),r)}});var rO={};Qt(rO,{DracoJavaScriptLoaderWithParser:()=>XX});var nO=p(()=>{"use strict";tO()});function JX(t){var r;let e=(r=t==null?void 0:t.modules)==null?void 0:r.draco3d;if(!e)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return e}var Lxe,YX,ZX,iO=p(()=>{"use strict";x1();_1();od();({preload:Lxe,...YX}=Ii),ZX={...YX,parse:async(t,e,r)=>await $u(t,e,async()=>await f_(JX(e)),r)}});var oO={};Qt(oO,{Draco3DLoaderWithParser:()=>ZX});var sO=p(()=>{"use strict";iO()});async function QX(t,e){var n;let r=e;switch(eY(r)){case"wasm":{let{DracoWASMLoaderWithParser:i}=await Promise.resolve().then(()=>(eO(),QL));return i}case"javascript":{let{DracoJavaScriptLoaderWithParser:i}=await Promise.resolve().then(()=>(nO(),rO));return i}case"draco3d":{let{Draco3DLoaderWithParser:i}=await Promise.resolve().then(()=>(sO(),oO));return i}default:throw new Error(`DracoLoader: unsupported backend "${(n=r==null?void 0:r.draco)==null?void 0:n.backend}"`)}}function eY(t){var e;return(e=t==null?void 0:t.draco)!=null&&e.backend?t.draco.backend==="js"?"javascript":t.draco.backend:Ii.options.draco.backend}var Ii,od=p(()=>{"use strict";uL();LL();BL();DL();Ii={defaultShape:"arrow",supportsNativeArrow:!0,dataType:null,batchType:null,...OL,version:RL,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:oL,deserializeWorkerResult:sL,options:{draco:CL},preload:QX}});var h_=p(()=>{"use strict";ZI();od()});function sd(t){let e=t.trim().toUpperCase(),r=e.match(/(?:\/DEF\/CRS\/|URN:OGC:DEF:CRS:)([A-Z0-9_-]+)(?:\/|::)(?:[^/:]*[/:])?([A-Z0-9_.-]+)$/);return r?`${r[1]}:${r[2]}`:e}var Hu,S1,d_=p(()=>{"use strict";Hu="EPSG:4326",S1="EPSG:4978"});function Bo(t){var r,n;if(typeof t=="string"){let i=wr(t);return i==="wkt"?rY(t):i==="proj-string"?nY(t):tY(t)||"projected"}let e=t;return e.type==="BoundCRS"&&e.source_crs?Bo(e.source_crs):e.type==="CompoundCRS"&&((r=e.components)!=null&&r[0])?Bo(e.components[0]):String(e.type).includes("Projected")?"projected":String(e.type).includes("Geographic")?"geographic":String(e.type).includes("Geodetic")?((n=e.coordinate_system)==null?void 0:n.subtype)==="Cartesian"?"geocentric":"geographic":"unknown"}function tY(t){if(typeof t!="string")return;let e=sd(t);if(e===S1)return"geocentric";if(e===Hu||e==="OGC:CRS84")return"geographic";let r=/^EPSG:(\d+)$/.exec(e);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 rY(t){let e;try{e=kf(t).root}catch{return"unknown"}switch(e.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=e.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 nY(t){var e;try{let r=(e=Gf(t).parameters.find(n=>n.name.toLowerCase()==="proj"))==null?void 0:e.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 m_=p(()=>{"use strict";r2();d_()});function M1(t,e={}){let r=e.sourceCrs!==void 0,n=e.sourceCrs||t.sourceCrs,i=e.outputCoordinates||"auto",o=e.targetCrs||(i==="ecef"?"EPSG:4978":void 0),s=e.targetHeightReference||"native",a=t.verticalUnitScale??1,c=t.elevationUnitScale??1,l=t.elevationOffset||0,u=t.elevationMode==="onTheGround"||t.elevationMode==="relativeToGround"||t.elevationMode==="relativeToScene",h=t.elevationMode==="relativeToScene"?!!e.sceneElevationProvider:!u||!!e.terrainElevationProvider,d=a!==1||c!==1||t.elevationMode!==void 0&&(u||t.elevationMode==="absoluteHeight"&&l!==0),m=s!=="native"&&s!==t.heightReference,g=!!o||s!=="native"||i!=="auto"||d,y=i!=="target-crs"||!!o,b=!m||(t.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":t.provenance||"unknown",M=r&&n?Bo(n):t.coordinateFrame,v=r?"explicit":t.sourceCrsState||(n?S==="format-default"?"default":"explicit":"absent"),B=Im({crs:n?{state:v==="default"?"default":"explicit",definition:n,representation:!r&&t.sourceCrsRepresentation||wr(n),provenance:S,alternatives:r?void 0:t.sourceCrsAlternatives}:{state:v==="unknown"?"unknown":"absent",provenance:S},vertical:t.verticalCrs?{state:"explicit",definition:t.verticalCrs,representation:wr(t.verticalCrs),provenance:t.provenance||"metadata"}:void 0,coordinateEpoch:e.coordinateEpoch??t.coordinateEpoch,coordinateFrame:M,coordinateOrder:oY(t.axisOrder),units:r?void 0:t.units}),R=p_(B.crs),E=B.vertical?p_(B.vertical):void 0,j=o?iY(o):void 0;return Object.freeze({...B,sourceCrs:R,verticalCrs:E,verticalUnitScale:a,coordinateEpoch:e.coordinateEpoch??t.coordinateEpoch,heightReference:t.heightReference||"unknown",elevationMode:t.elevationMode,elevationOffset:t.elevationOffset,elevationUnit:t.elevationUnit,elevationUnitScale:c,coordinateFrame:M||"unknown",axisOrder:t.axisOrder||"unknown",provenance:S,targetCrs:j,targetHeightReference:s,outputCoordinates:i,status:g?_?"transformable":"unresolved":"native",warnings:Object.freeze([...t.warnings||[]])})}function p_(t){return t.state==="explicit"||t.state==="default"?t.definition:void 0}function iY(t){let e=Im({crs:{state:"explicit",definition:t,representation:wr(t),provenance:"caller-override"}}),r=p_(e.crs);if(!r)throw new Error("Failed to normalize a known target CRS definition");return r}function oY(t){switch(t){case"xy":return["x","y"];case"yx":return["y","x"];case"xyz":return["x","y","z"];default:return[]}}function aO(t){if(t.status!=="transformable"&&t.status!=="transformed")throw new Error("Only a transformable spatial reference can be marked as transformed");return Object.freeze({...t,status:"transformed"})}var cO=p(()=>{"use strict";r2();m_()});function lO(t){if(!t)return;let e=t.trim().toLowerCase().replaceAll("_","-"),r=aY[e]||e;return sY[r]}var sY,aY,uO=p(()=>{"use strict";sY=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}),aY=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 fO(t){return{input:new Float64Array(t),output:new Float64Array(t)}}function ad(t){return t instanceof Float32Array||t instanceof Float64Array}function hO(t){return typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function g_(t,e,r,n,i,o){return(t.buffer===n.buffer||hO(t.buffer)&&hO(n.buffer))&&e<o&&i<r}function v1(t,e,r,n){return t<e+n?0:Math.floor((t-e-n)/r)+1}var E1,dO=p(()=>{E1=class{constructor(e){var o,s;this.depth=0;let r=e.dimension??2,n=e.inputOffset??0,i=e.outputOffset??0;if(!Number.isSafeInteger(r)||r<2||!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(i)||i<0||e.inputStride!==void 0&&(!Number.isSafeInteger(e.inputStride)||e.inputStride<1)||e.outputStride!==void 0&&(!Number.isSafeInteger(e.outputStride)||e.outputStride<1)||typeof((o=e.projection)==null?void 0:o.projectToSync)!="function"||typeof((s=e.projection)==null?void 0:s.unprojectToSync)!="function")throw new Error("Invalid projection buffer transform or layout");this.dimension=r,this.projection=e.projection,this.inputOffset=n,this.outputOffset=i,this.inputStride=e.inputStride,this.outputStride=e.outputStride,this.scratch=[fO(r)]}projectFlatTo(e,r,n,i=0,o){return this.flat(e,r,n,i,!1,o)}unprojectFlatTo(e,r,n,i=0,o){return this.flat(e,r,n,i,!0,o)}projectColumnsTo(e,r,n,i=0,o){return this.columns(e,r,n,i,!1,o)}unprojectColumnsTo(e,r,n,i=0,o){return this.columns(e,r,n,i,!0,o)}range(e,r,n){let i=r??Math.max(0,e-n);if(!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(i)||i<0||!Number.isSafeInteger(n+i)||n+i>e)throw new Error("Invalid projection buffer record range");return i}epochStorage(e,r,n){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e))throw new Error("Coordinate epoch must be finite")}else if(!ad(e)||e.length<r+n)throw new Error("Epoch buffer requires one value per addressed record")}}aliases(e,r,n,i,o,s,a){if(!i)return;let c=e.byteOffset+(this.inputOffset+n*o)*e.BYTES_PER_ELEMENT,l=c+((i-1)*o+a)*e.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=e.buffer===r.buffer&&e.constructor===r.constructor&&c===u&&o===s;if(g_(e,c,l,r,u,h)&&!d)throw new Error("Projection input/output ranges overlap without an exact in-place mapping")}epochAlias(e,r,n,i,o,s){if(typeof e!="object"||!e||!i)return;let a=e.byteOffset+n*e.BYTES_PER_ELEMENT,c=a+i*e.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(g_(e,a,c,r,l,u))throw new Error("Epoch and output buffers must not overlap")}acquire(){var e;let r=this.depth++;return(e=this.scratch)[r]||(e[r]=fO(this.dimension)),this.scratch[r]}transform(e,r,n){if(n!==void 0&&!Number.isFinite(n))throw new Error("Coordinate epoch must be finite");r?this.projection.unprojectToSync(e.input,e.output,n):this.projection.projectToSync(e.input,e.output,n)}floatRange(e,r){for(let n=0;n<this.dimension;n++){let i=e[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(e,r,n,i,o,s){if(!ad(e)||!ad(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(v1(e.length,this.inputOffset,a,this.dimension),n,i);if(i+l>v1(r.length,this.outputOffset,c,this.dimension))throw new Error("Projection output buffer is too short");this.epochStorage(s,i,l),this.aliases(e,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]=e[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(e,r,n,i,o,s){if(e.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(!ad(e[d])||!ad(r[d]))throw new Error("Projection columns require floating typed arrays");l=Math.min(l,v1(e[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>v1(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(e[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(g_(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]=e[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 mO(){return{bounds:[[-1,-1,0],[1,1,0]]}}var pO=p(()=>{});function b_(){let t=globalThis;return t[y_]||(t[y_]=new WeakMap),t[y_]}function gO(t){var e;return"create"in t?t:(e=b_().get(t))==null?void 0:e.implementation}function yO(t){if("create"in t)return Promise.resolve(t);let e=b_().get(t);if(e||(e={load:()=>t.preload()},b_().set(t,e)),e.implementation)return Promise.resolve(e.implementation);let r=e;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"||![t.name,...t.aliases||[]].every(s=>o.has(i(s))))throw new Error("Loaded projection does not match descriptor: "+t.name);return r.implementation=n,n}).catch(n=>{throw r.pending=void 0,n})),r.pending}var y_,bO=p(()=>{y_=Symbol.for("@math.gl/projection/projection-implementations")});function dl(t,e,r){if(!(Array.isArray(t)||t instanceof Float32Array||t instanceof Float64Array))throw new Error("Scalar input requires a number array, Float32Array or Float64Array");if(!(Array.isArray(e)||e instanceof Float32Array||e instanceof Float64Array)||e.length<r)throw new Error("Scalar output requires a preallocated number array, Float32Array or Float64Array with sufficient capacity");if(t===e||Array.isArray(t)||Array.isArray(e))return;let n=t,i=e,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 cd(t,e,r,n){if(e instanceof Float32Array){if(Math.abs(r.x)>T1||Math.abs(r.y)>T1||n>=3&&Math.abs(r.z)>T1)throw new Error("Projected coordinate exceeds Float32 range");for(let i=3;i<t.length;i++){let o=t[i];if(Number.isFinite(o)&&Math.abs(o)>T1)throw new Error("Trailing ordinate exceeds Float32 range")}}for(let i=3;i<t.length;i++)e[i]=t[i];return e[0]=r.x,e[1]=r.y,n>=3&&(e[2]=r.z),e}var T1,w_=p(()=>{T1=34028234663852886e22});function je(t){throw new ai("missing-transform-stage",t)}var wO,xO,ai,Xa=p(()=>{xO=Symbol.for("@math.gl/projection/TypeScriptCRSError"),ai=class t extends Error{static[(wO=xO,Symbol.hasInstance)](e){return this!==t?Function.prototype[Symbol.hasInstance].call(this,e):e instanceof Error&&e[xO]===!0}constructor(e,r){super(r),this.reason=e,this[wO]=!0,this.name="TypeScriptCRSError"}}});function ld(t,e){if(typeof t=="string"||"type"in t)return{definition:t,lossy:!1};let r=t,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&&je("Coordinate epochs require a time-dependent transformation"),n!=null&&n.vertical&&n.vertical.state!=="absent"&&(e.mode!=="horizontal"&&je("A separately declared vertical CRS requires explicit horizontal extraction"),o=!0),{definition:i.definition,spatialReference:n,lossy:o}}function _O(t,e){var o;if(!e)return t;if(e.coordinateFrame!=="unknown"&&e.coordinateFrame!==t.kind)throw new Error("SpatialReference coordinate frame disagrees with its CRS");let r=e.coordinateOrder,n=t.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"))&&je("Unsupported SpatialReference coordinate order"),(r.length>4||r.length>3&&!["m","measure"].includes(r[3]))&&je("Unsupported fourth coordinate component")),(o=e.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(e.units.length,3);a++){let c=(i||"enu")[a]==="u",l=t.kind==="geocentric"?t.toMeter:c?t.verticalUnit:t.kind==="geographic"?t.angularUnit:t.toMeter;(Math.abs((s[e.units[a]]??NaN)-l)>1e-12||s[e.units[a]]===void 0)&&je("SpatialReference units disagree with its CRS")}}return Object.freeze({...t,storedAxis:i})}var x_=p(()=>{Xa()});function Ku(t){var i;if(!((i=t.datumCatalogs)!=null&&i.length))return __;let e=vO.get(t);if((e==null?void 0:e.catalogs)===t.datumCatalogs)return e.definitions;let r=Object.assign(Object.create(null),__),n=new Map(Object.entries(__).map(([o,s])=>[ml(o),{definition:s,owner:-1}]));return t.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=ml(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}}),vO.set(t,{catalogs:t.datumCatalogs,definitions:r}),r}var SO,MO,__,vO,ml,A1=p(()=>{SO={towgs84:"0,0,0",ellipse:"WGS84"},MO={towgs84:"0,0,0",ellipse:"GRS80"},__={wgs84:SO,WGS84:SO,nad83:MO,North_American_Datum_1983:MO},vO=new WeakMap,ml=t=>t.toLowerCase().replace(/[\s_-]/g,"")});var cY,EO,TO=p(()=>{cY={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)"}},EO=cY});var On,AO,IO=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;AO=On});function S_(t,e){let r=Object.keys(t).find(n=>RO(n)===RO(e));return r===void 0?void 0:t[r]}function LO(t){if(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(t)){let r=Number(t);if(Number.isFinite(r))return r}if(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?r$/i.test(t)){let r=Number(t.slice(0,-1))/At;if(Number.isFinite(r))return r}let e=/^([+-]?)(\d+(?:\.\d*)?)(?:d(?:(\d+(?:\.\d*)?)'(?:(\d+(?:\.\d*)?)")?)?)?([NSEW])?$/i.exec(t);if(e&&(/d/i.test(t)||e[5])){let r=Number(e[3]||0),n=Number(e[4]||0);if(r<60&&n<60){let i=e[1]==="-"?-1:1,o=/[SW]/i.test(e[5]||"")?-1:1,s=i*o*(Number(e[2])+r/60+n/3600);if(Number.isFinite(s))return s}}throw new Error("Invalid angular parameter: "+t)}function M_(t,e={}){let r=t,n=e.aliases||{},i=new Set;for(;typeof r=="string"&&(Co(n,r)||Co(PO,r));){if(i.has(r))throw new Error("Circular CRS alias: "+r);i.add(r),r=Co(n,r)?n[r]:PO[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 Ts(t,e={}){var j;let r=Ku(e),n=ld(t,e),i=M_(n.definition,e),o;if(wr(i)==="proj-string"&&typeof i=="string"){let I=Object.create(null);for(let O of Gf(i).parameters){if(Co(I,O.name))throw new Error("Duplicate PROJ parameter: +"+O.name);I[O.name]=O.value}o={parameters:I}}else{let I=(j=e.parsers)==null?void 0:j.find(O=>O.canParse(i));if(!I){let O=["wkt","projjson"].includes(wr(i));throw new ai(O?"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=I.parse(i,e)}let s={...o.parameters};for(let I 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[I]!==void 0&&(s[I]=String(LO(s[I])));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"?S_(r,h):void 0;h&&h!=="none"&&!d&&je("Unknown datum: "+h+"; register a datumCatalogs plugin");let m=BO(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(I=>{let O=I.startsWith("@"),A=O?I.slice(1):I;if(!A||/\s/.test(A))throw new Error("Invalid datum grid name");return Object.freeze({name:A,optional:O})}),b=s.towgs84??(d==null?void 0:d.towgs84),w;if(b!==void 0&&(w=b.split(",").map(I=>re({value:I},"value",NaN)),![3,7].includes(w.length)||w.some(I=>!Number.isFinite(I))||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"?BO({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 M=o.angularUnit??At;if(u==="geographic"&&(s.units&&s.units!=="degrees"||Co(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 v=OO(s,"units","to_meter"),B=o.verticalUnit??OO(s,"vunits","vto_meter");if(!(B>0)||!Number.isFinite(B))throw new Error("Invalid vertical unit");if(!(M>0)||!Number.isFinite(M))throw new Error("Invalid angular unit");let R=s.pm,E=R===void 0?0:(S_(AO,R)??LO(R))*At;return _O(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:M,toMeter:v,verticalUnit:B,primeMeridian:E,axis:S,longitudeWrap:s.lon_wrap===void 0?void 0:Number(s.lon_wrap)*At,lossy:!!(o.lossy||n.lossy)}),n.spatialReference)}function OO(t,e,r){let n=t[e],i=Uf;if(e==="vunits"&&n==="degrees")throw new Error("Height requires linear units");if(n&&!["m","degrees"].includes(n)&&!Co(i,n))throw new Error("Unsupported units: "+n);let o=re(t,r,n&&i[n]?i[n].metersPerUnit:1);if(!(o>0))throw new Error("+"+r+" must be positive");return o}function BO(t,e){let r=e||t.ellps||"WGS84",n=S_(EO,r);if(!n)throw new Error("Unsupported ellipsoid: "+r);let i=re(t,"a",n.a),o=re(t,"f",NaN),s=re(t,"rf",Number.isNaN(o)?n.rf||0:o===0?0:1/o),a=re(t,"b",s?i*(1-1/s):Co(t,"f")||Co(t,"rf")||Co(t,"a")?i:n.b||i),c=re(t,"R",0);if(i<=0||a<=0||a>i||s<0||s>0&&s<=1||Co(t,"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 PO,I1,CO,Co,RO,Xu=p(()=>{Hl();e2();x_();Wt();A1();TO();IO();t2();Xa();PO={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"},I1=["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"],CO=["no_defs","over"],Co=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),RO=t=>t.toLowerCase().replace(/[\s_-]/g,"")});function L1(t,e){if(Math.abs(t.y)>Math.PI/2)throw new Error("Latitude outside geocentric domain");if(!qf(t,e))throw new Error("Geocentric coordinate must be finite")}function O1(t,e){let r=t.x,n=t.y,i=t.z,{semiMajorAxis:o,semiMinorAxis:s,eccentricitySquared:a}=e;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");t.x=0,t.y=Math.sign(i)*Math.PI/2,t.z=Math.abs(i)-s;return}if(!Vf(t,e))throw Number.isFinite(Math.hypot(r,n,i))?new Error("Geocentric inverse did not converge"):new Error("Geocentric radius must be finite")}function DO(t,e){let r=t[0],n=t[1],i=t[2],o=(t[3]||0)*v_,s=(t[4]||0)*v_,a=(t[5]||0)*v_,c=1+(t[6]||0)/1e6;return e?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 R1(t){var e;return!!((e=t.towgs84)!=null&&e.some(r=>r!==0))}function T_(t,e){if(!(!t.towgs84||!e.towgs84)){if(t.grids||e.grids){if(t.grids&&e.grids&&t.ellipsoid.semiMajorAxis===e.ellipsoid.semiMajorAxis&&t.ellipsoid.eccentricitySquared===e.ellipsoid.eccentricitySquared&&t.grids.length===e.grids.length&&t.grids.every((n,i)=>n.name===e.grids[i].name&&n.optional===e.grids[i].optional&&n.grid===e.grids[i].grid))return;let r=T_(t.grids?P1:t,e.grids?P1:e);return n=>{t.grids&&NO(n,t,!1),r==null||r(n),e.grids&&NO(n,e,!0)}}if(R1(t)||R1(e)){let r=E_(t,P1),n=E_(P1,e);return i=>{r==null||r(i),n==null||n(i)}}return E_(t,e)}}function E_(t,e){if(!t.towgs84||!e.towgs84)return;let r=t.ellipsoid,n=e.ellipsoid,i=!0;for(let a=0;a<7;a++)(t.towgs84[a]||0)!==(e.towgs84[a]||0)&&(i=!1);if(r.semiMajorAxis===n.semiMajorAxis&&Math.abs(r.eccentricitySquared-n.eccentricitySquared)<=5e-11&&i)return;let o=R1(t)?DO(t.towgs84,!1):void 0,s=R1(e)?DO(e.towgs84,!0):void 0;return a=>{L1(a,r),o==null||o(a),s==null||s(a),O1(a,n)}}function NO(t,e,r){for(let n of e.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(t,r);else{let o=n.grid.shift(t.x,t.y,r);o&&(t.x=o[0],t.y=o[1],i=!0)}if(i){if(!Number.isFinite(t.x)||!Number.isFinite(t.y)||Math.abs(t.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: "+e.grids.map(n=>n.name).join(","))}function FO(t,e){let r={x:t[0],y:t[1],z:t[2]};return L1(r,e),[r.x,r.y,r.z]}function kO(t,e){let r={x:t[0],y:t[1],z:t[2]};return O1(r,e),[r.x,r.y,r.z]}var v_,P1,A_=p(()=>{Fn();v_=Math.PI/(180*3600),P1={ellipsoid:{semiMajorAxis:6378137,semiMinorAxis:6356752314245179e-9,eccentricitySquared:.0066943799901413165},towgs84:[0,0,0]}});function Ya(t,e=0){let r=re(t,"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,e)}var ud=p(()=>{Wt();ut();Bt()});function GO(t,e={}){if(t===void 0)return;let r=[];for(let n of t.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(e,o)?e[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||je("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 UO=p(()=>{Xa()});function I_(t){let e=Object.freeze({...t.ellipsoid});return Object.freeze({kind:t.kind,projection:t.projection,parameters:Object.freeze(Object.fromEntries(Object.entries(t.parameters).map(([r,n])=>[r,n??null]))),ellipsoid:e,datum:Object.freeze({ellipsoid:Object.freeze({...t.datum.ellipsoid}),towgs84:t.datum.towgs84&&Object.freeze([...t.datum.towgs84]),grids:t.datum.grids&&Object.freeze(t.datum.grids.map(r=>Object.freeze({name:r.name,optional:r.optional,loaded:!!r.grid})))}),angularUnit:t.angularUnit,toMeter:t.toMeter,verticalUnit:t.verticalUnit,primeMeridian:t.primeMeridian,axis:t.axis,storedAxis:t.storedAxis,longitudeWrap:t.longitudeWrap,areaOfUse:t.areaOfUse&&Object.freeze([...t.areaOfUse]),lossy:t.lossy,algorithm:t.algorithm&&Object.freeze({...t.algorithm})})}function jO(t,e,r,n){let i=[];return t.algorithm||i.push("source-algorithm"),e.algorithm||i.push("target-algorithm"),(t.datum.grids||e.datum.grids||t.parameters.geoidgrids||e.parameters.geoidgrids)&&i.push("grid-resource"),Object.freeze({version:1,source:t,target:e,forward:r,inverse:n,lossy:t.lossy||e.lossy,complete:i.length===0,opaqueReasons:Object.freeze(i)})}var zO=p(()=>{});function qO(t){let e=HO(t.projections||[]),r=new Set;for(let n of[t.from??"WGS84",t.to??"WGS84"]){let i=Ts(n,t);if(["geographic","identity"].includes(i.kind))continue;let o=e.get(C1(i.projection));if(!o)throw new ai("missing-plugin","Projection plugin is not registered: "+i.projection);r.add(o)}return[...r]}function HO(t){let e=new Map;for(let r of t)for(let n of new Set([r.name,...r.aliases||[]].map(C1))){if(!n||["longlat","latlong","latlon","lonlat","identity"].includes(n)||e.has(n))throw new Error("Duplicate or reserved projection plugin: "+n);e.set(n,r)}return e}function VO(t,e,r){var g;let n=Ts(t,r),i=e.get(C1(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([...I1,...(i==null?void 0:i.parameters)||[]]);for(let y of Object.keys(n.parameters)){if(!o.has(y))throw new ai("missing-transform-stage","Unsupported PROJ parameter: +"+y);let b=CO.includes(y)||((g=i==null?void 0:i.flags)==null?void 0:g.includes(y));if(b&&n.parameters[y]!==void 0)throw new Error("Expected a flag without a value: +"+y);if(!b&&!n.parameters[y])throw new Error("PROJ parameter requires a value: +"+y)}if(n.parameters.type&&n.parameters.type!=="crs")throw new Error("Only +type=crs is supported");let s=C1(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(y=>y.name==="null"))??-1,u=c==null?void 0:c.slice(0,l<0?void 0:l+1).map(y=>{let b=Object.prototype.hasOwnProperty.call(r.datumGrids||{},y.name)?r.datumGrids[y.name]:void 0;if(b&&typeof b.shift!="function")throw new Error("Invalid prepared datum grid: "+y.name);return Object.freeze({...y,grid:b})});for(let y of u||[]){if(y.name==="null")break;!y.optional&&!y.grid&&je("Required datum grid is not registered: "+y.name)}let h=u?Object.freeze({...n.datum,grids:Object.freeze(u)}):n.datum,d=GO(n.parameters.geoidgrids,r.verticalGrids);d&&(n.kind==="geocentric"||n.kind==="identity"||n.lossy)&&je("Vertical grids require a non-lossy geographic or projected CRS");let m=i?i.semantics:{id:"@math.gl/geospatial/"+n.kind,version:1};return{...n,datum:h,implementation:a,verticalGrid:d,algorithm:m}}function P_(t){return Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.z)}function WO(t,e){if(t==="enu")return;let r=[0,0,0],n=[0,0,0];for(let i=0;i<3;i++){let o=t[i],s="ew".includes(o)?0:"ns".includes(o)?1:2;r[e?i:s]=e?s:i,n[e?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 $O(t,e,r){var B,R,E,j;let n=t.storedAxis||(r?t.axis:"enu"),i=e.storedAxis||(r?e.axis:"enu"),o=WO(n,!1),s=WO(i,!0),a=t.implementation&&Yo(t.implementation,!0,t.kind==="geocentric"),c=e.implementation&&Yo(e.implementation,!1,e.kind==="geocentric"),l=T_(t.datum,e.datum),u=t.lossy||e.lossy,h=t.kind==="geocentric",d=t.kind==="geographic"?t.angularUnit:t.toMeter,m=e.kind==="geographic"?e.angularUnit:e.toMeter,g=h?1:t.verticalUnit,y=e.kind==="geocentric"?m:e.verticalUnit,b=t.primeMeridian,w=e.primeMeridian,_=e.kind==="geographic"?e.longitudeWrap:void 0,S;if(!l&&!t.verticalGrid&&!e.verticalGrid&&!u&&!o&&!s&&!b&&!w&&t.verticalUnit===1&&e.verticalUnit===1&&_===void 0){let I=Object.freeze({inputScale:d,outputScale:m});t.kind==="geographic"&&e.kind==="projected"&&(S=(R=(B=e.implementation)==null?void 0:B.createForwardFlat)==null?void 0:R.call(B,I)),t.kind==="projected"&&e.kind==="geographic"&&(S=(j=(E=t.implementation)==null?void 0:E.createInverseFlat)==null?void 0:j.call(E,I))}let M=!!(t.verticalGrid||e.verticalGrid)||t.kind==="geocentric"||/[ud]/.test(n.slice(0,2))||/[ud]/.test(i.slice(0,2)),v=[];return o&&v.push("input-axis"),u&&v.push("discard-height"),d!==1&&v.push("input-scale"),a&&v.push("source-inverse"),g!==1&&v.push("input-height-scale"),v.push("geographic-domain-check"),b&&v.push("source-prime-meridian"),t.verticalGrid&&v.push("source-vertical-grid"),l&&v.push("datum"),e.verticalGrid&&v.push("target-vertical-grid"),w&&v.push("target-prime-meridian"),_!==void 0&&v.push("longitude-wrap"),c&&v.push("target-forward"),m!==1&&v.push("output-scale"),y!==1&&v.push("output-height-scale"),u&&v.push("restore-height"),s&&v.push("output-axis"),{description:Object.freeze({inputAxis:n,outputAxis:i,requiresInputZ:M,geocentricOutput:e.kind==="geocentric",stages:Object.freeze(v)}),flat:S,requiresInputZ:M,geocentricOutput:e.kind==="geocentric",run(I){if(!P_(I))throw new Error("Coordinates must contain finite x, y and optional z values");o==null||o(I);let O=I.z;if(u&&(I.z=0),d!==1&&(I.x*=d,I.y*=d,h&&(I.z*=d)),a==null||a(I),g!==1&&(I.z*=g),Math.abs(I.y)>Math.PI/2||!P_(I))throw new Error("Coordinate is outside the geographic domain");if(I.x+=b,t.verticalGrid&&(I.z+=t.verticalGrid(I.x,I.y)),l==null||l(I),e.verticalGrid&&(I.z-=e.verticalGrid(I.x,I.y)),I.x-=w,_!==void 0&&(I.x=_+Yt(I.x-_)),c==null||c(I),m!==1&&(I.x/=m,I.y/=m),y!==1&&(I.z/=y),u&&(I.z=O),s==null||s(I),!P_(I))throw new Error("Projection produced non-finite coordinates")}}}function Yu(t,e,r,n){if(t.length<2)throw new Error("Coordinates must contain finite x, y and optional z values");if(t.length<3&&e.requiresInputZ)throw new Error("This transform requires three ordinates");let i=Math.max(t.length,e.geocentricOutput?3:2),o=r.acquire();try{if(o.x=t[0],o.y=t[1],o.z=t.length>=3?t[2]:0,e.run(o),n)return cd(t,n,o,i);let s=t.slice();return s[0]=o.x,s[1]=o.y,(t.length>=3||e.geocentricOutput)&&(s[2]=o.z),s}finally{r.release(o)}}function B1(t,e,r,n){if(!(t instanceof Float32Array||t instanceof Float64Array))throw new Error("In-place projection requires a Float32Array or Float64Array");if(!Number.isSafeInteger(e)||e<2||t.length%e!==0)throw new Error("Dimension must be an integer >= 2 and divide the typed array length");if(e<3&&(r.requiresInputZ||r.geocentricOutput))throw new Error("This transform requires a dimension of at least 3");if(r.flat)return r.flat(t,e),t;let i=n.acquire();try{let o=t instanceof Float32Array;for(let s=0;s<t.length;s+=e){if(i.x=t[s],i.y=t[s+1],i.z=e>=3?t[s+2]:0,r.run(i),o&&(Math.abs(i.x)>34028234663852886e22||Math.abs(i.y)>34028234663852886e22||e>=3&&Math.abs(i.z)>34028234663852886e22))throw new Error("Projected coordinate exceeds Float32 range");t[s]=i.x,t[s+1]=i.y,e>=3&&(t[s+2]=i.z)}return t}finally{n.release(i)}}var fd,C1,KO=p(()=>{yc();pO();bO();bc();sp();w_();Xu();Xa();A_();Wt();ud();UO();zO();fd=class t{static async create(e={}){let r=await Promise.all(qO(e).map(yO));return new t({...e,projections:r})}get targetProfile(){return this.getTargetRenderingProfile(this.targetCoverage)}getTargetRenderingProfile(e){return this.targetRenderingProfile&&NA(this.targetRenderingProfile,e)}get description(){var e,r;return((r=(e=this.deferred)==null?void 0:e.implementation)==null?void 0:r.description)??this.resolvedDescription}constructor(e={}){var i,o,s;this.coordinateScratch=new qs,this.targetLongitudeOrigin=0;let r=e.projections||[],n=HO(r);if(r.some(a=>!("create"in a))){let a=Ts(e.from??"WGS84",e),c=Ts(e.to??"WGS84",e);this.lossy=a.lossy||c.lossy,this.deferred={options:{...e,projections:[...r]}}}else{let a=e,c=n,l=VO(a.from??"WGS84",c,a),u=VO(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"?Ya(u.parameters,u.primeMeridian):u.kind==="identity"?mO: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")&&je("Horizontal extraction cannot supply ellipsoidal height for geocentric coordinates"),this.lossy&&(l.verticalGrid||u.verticalGrid)&&je("Horizontal extraction cannot be combined with vertical grids"),this.forwardTransform=$O(l,u,!!e.enforceAxis),this.inverseTransform=$O(u,l,!!e.enforceAxis),this.resolvedDescription=jO(I_(l),I_(u),this.forwardTransform.description,this.inverseTransform.description)}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 e=this.deferred;return e?e.implementation?Promise.resolve(e.implementation):(e.pending||(e.pending=t.create(e.options).then(r=>(e.implementation=r,r)).catch(r=>{throw e.pending=void 0,r})),e.pending):Promise.resolve(this)}loadSync(){let e=this.deferred;if(!e)return this;if(!e.implementation){let r=qO(e.options).map(n=>{let i=gO(n);if(!i)throw new Error("Projection is not preloaded: "+n.name+". Call preload() first.");return i});e.implementation=new t({...e.options,projections:r})}return e.implementation}projectSync(e){return this.deferred?this.loadSync().project(e):Yu(e,this.forwardTransform,this.coordinateScratch)}unprojectSync(e){return this.deferred?this.loadSync().unproject(e):Yu(e,this.inverseTransform,this.coordinateScratch)}projectFlatSync(e,r=2){return this.deferred?this.loadSync().projectFlat(e,r):B1(e,r,this.forwardTransform,this.coordinateScratch)}unprojectFlatSync(e,r=2){return this.deferred?this.loadSync().unprojectFlat(e,r):B1(e,r,this.inverseTransform,this.coordinateScratch)}async preload(){await this.load()}project(e){return this.deferred?this.projectLoaded(e,!1):Yu(e,this.forwardTransform,this.coordinateScratch)}unproject(e){return this.deferred?this.projectLoaded(e,!0):Yu(e,this.inverseTransform,this.coordinateScratch)}projectTo(e,r){return this.deferred?this.projectToLoaded(e,r,!1):this.projectToSync(e,r)}unprojectTo(e,r){return this.deferred?this.projectToLoaded(e,r,!0):this.unprojectToSync(e,r)}projectToSync(e,r){return this.deferred?this.loadSync().projectTo(e,r):(dl(e,r,Math.max(e.length,this.forwardTransform.geocentricOutput?3:2)),Yu(e,this.forwardTransform,this.coordinateScratch,r))}unprojectToSync(e,r){return this.deferred?this.loadSync().unprojectTo(e,r):(dl(e,r,Math.max(e.length,this.inverseTransform.geocentricOutput?3:2)),Yu(e,this.inverseTransform,this.coordinateScratch,r))}projectToLoaded(e,r,n){dl(e,r,e.length);let i=e.slice();return this.load().then(o=>n?o.unprojectTo(i,r):o.projectTo(i,r))}projectLoaded(e,r){let n=e.slice();return this.load().then(i=>r?i.unproject(n):i.project(n))}projectFlat(e,r=2){return this.deferred?this.load().then(i=>i.projectFlat(e,r)):B1(e,r,this.forwardTransform,this.coordinateScratch)}unprojectFlat(e,r=2){return this.deferred?this.load().then(i=>i.unprojectFlat(e,r)):B1(e,r,this.inverseTransform,this.coordinateScratch)}};C1=t=>t.toLowerCase().replace(/[\s_-]/g,"")});var D1,XO=p(()=>{D1=class{constructor(e){this.sample=e,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(e,r,n=1e-6){if(!this.difference(e,this.coarse)||!this.difference(e/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(e,r){let[n,i,o,s]=this.samples;if(!this.sample(-2*e,n)||!this.sample(-e,i)||!this.sample(e,o)||!this.sample(2*e,s))return!1;for(let a=0;a<3;a++)if(r[a]=(n[a]-s[a]+8*(o[a]-i[a]))/(12*e),!Number.isFinite(r[a]))return!1;return!0}}});function R_(t){if(t.length!==3||t.some(e=>!Number.isFinite(e)||e<=0))throw new Error("Invalid CRS rendering scale");return t}function ZO(t,e,r,n){if(t.kind==="geocentric")return R_([t.toMeter,t.toMeter,t.toMeter]);if(t.kind==="identity")return R_([...r].map(g=>/[ud]/.test(g)?t.verticalUnit:t.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 D1((g,y)=>{for(let _=0;_<3;_++)o[_]=i[_];o[l]+=g,e.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;e.unprojectTo(i,s);let b=s[1]*hd,w=YO.semiMajorAxis,_=YO.eccentricitySquared,S=1-_*Math.sin(b)**2;if(u=w*Math.cos(b)/Math.sqrt(S)*hd,h=w*(1-_)/S**1.5*hd,!(u>w*hd*1e-8)||!(h>0))return null;let M=((s[0]-n+180)%360+360)%360-180;if((t.kind==="geographic"?t.longitudeWrap!==void 0:!Object.prototype.hasOwnProperty.call(t.parameters,"over"))&&Math.abs(M)+2/u>=180||Math.abs(s[1])+2/h>=90)return null;for(l=0;l<3;l++){let B=r[l],R=/[ud]/.test(B)?t.verticalUnit:t.kind==="geographic"?(/[ew]/.test(B)?u:h)*t.angularUnit/hd:t.toMeter;if(!m.evaluate(1/R,R))return null;for(let E=0;E<3;E++)c[l][E]=m.result[E]}if(y=c.map(B=>Math.hypot(...B)),t.kind==="projected"){let B=c[r.search(/[ew]/)],R=c[r.search(/[ns]/)],E=Math.abs(B[0]*R[1]-B[1]*R[0])/t.toMeter**2;y[r.search(/[ud]/)]=t.verticalUnit*Math.sqrt(E)}}catch{return null}finally{d=!1}return R_(y)}}var hd,YO,JO=p(()=>{XO();Xu();hd=Math.PI/180,YO=Ts("WGS84").ellipsoid});async function nB(t,e,r,n={},i=!1,o){let s=typeof e=="string"?e:JSON.parse(JSON.stringify(e)),a={enforceAxis:r.enforceAxis,mode:r.mode,...n,converters:n.converters&&[...n.converters]},c=o?await o(s,{...r,...a}):s,l=Ts(c,{...r,...a}),u=await t.createProjectionAsync({...a,from:"WGS84",to:c}),h=l.storedAxis||(a.enforceAxis?l.axis:"enu"),d=rB(l.kind==="geographic"?l.angularUnit:l.toMeter,l.kind==="geographic"),m=rB(l.verticalUnit,!1),g=[...h].map(E=>l.kind!=="geocentric"&&/[ud]/.test(E)?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=hY(y,l,h),_=fY(y.normalize),S=ZO(l,u,h,b),M=[...new Set(["WGS84",...a.converters||[]])];if(M.some(E=>typeof E!="string"||!E.trim()))throw new Error("Converter source CRS must be a nonempty string");let v=await Promise.all(M.map(async E=>{if(E==="WGS84")return[E,eB(u,_)];let[j,I]=await Promise.all([t.createProjectionAsync({...a,from:E,to:c}),t.createProjectionAsync({...a,from:"WGS84",to:E})]);return[E,eB(j,uY(I,_))]})),B=Object.assign(Object.create(null),Object.fromEntries(v)),R={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{...R,signature:i&&typeof c=="string"&&!a.enforceAxis&&!l.lossy?c:DT(R),renderingBounds:w,renderingScale:S,getRenderingScale:E=>typeof S=="function"?S(E):S,converter:B}}function eB(t,e){return{from:tB(t.project.bind(t),t.projectTo.bind(t)),to:tB(t.unproject.bind(t),t.unprojectTo.bind(t)),normalize:e}}function uY(t,e){function r(n,i){i!==void 0&&dl(n,i,n.length);let o=t.unproject(Array.from(n)),[s,a,c]=o;return e(o,o),o[0]===s&&o[1]===a&&o[2]===c?i===void 0?Array.from(n):cd(n,i,{x:n[0],y:n[1],z:n[2]??0},n.length):i===void 0?t.project(o):t.projectTo(o,i)}return r}function tB(t,e){function r(n,i){return i===void 0?t(Array.isArray(n)?n:Array.from(n)):e(n,i)}return r}function fY(t){function e(r,n){let i=n??new Array(r.length);dl(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 t==null||t(c),cd(r,i,c,r.length)}return e}function hY(t,e,r){let n=e.kind==="geographic"?e.angularUnit:e.toMeter,i=[n,n,e.kind==="geocentric"?e.toMeter:e.verticalUnit],o=t.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 rB(t,e){let r=e?QO:lY,n=Object.keys(r).find(i=>r[i]===t)||"custom";return e?{name:n,degreesPerUnit:t/QO.degrees}:{name:n,metersPerUnit:t}}var QO,lY,iB=p(()=>{Xu();JO();w_();t2();QO={degrees:Math.PI/180,radians:1,gradians:Math.PI/200},lY={...Object.fromEntries(Object.values(Uf).map(t=>[t.name,t.metersPerUnit]))}});function oB(t){return{...t,projections:t.projections&&[...t.projections],parsers:t.parsers&&[...t.parsers],datumCatalogs:t.datumCatalogs&&[...t.datumCatalogs],aliases:t.aliases&&JSON.parse(JSON.stringify(t.aliases)),datumGrids:t.datumGrids&&{...t.datumGrids},verticalGrids:t.verticalGrids&&{...t.verticalGrids}}}function dd(t){return!!(t.projections||t.parsers||t.datumCatalogs||t.aliases||t.datumGrids||t.verticalGrids||t.resolver)}var L_=p(()=>{});async function aB(t){let e={...t,from:sB(t.from??"WGS84"),to:sB(t.to??"WGS84")},[r,n]=await Promise.all([N1(e.from,e),N1(e.to,e)]);return{...e,from:r,to:n}}async function N1(t,e){var u;let r=ld(t,e),n=M_(r.definition,e),i=typeof t=="string"||"type"in t?void 0:"crs"in t?t.crs:t,o=n===r.definition&&i?i.representation:wr(n);if(o!=="identifier"||(u=e.parsers)!=null&&u.some(h=>h.canParse(n)))return t;let s=await e.resolver.resolve({state:"explicit",provenance:(i==null?void 0:i.provenance)??"unknown",definition:n,representation:o}),a=ld(s.input,e).definition;if(!i)return a;let c=t,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 sB(t){return typeof t=="string"?t:JSON.parse(JSON.stringify(t))}var cB=p(()=>{Hl();Xu();x_()});var F1,lB=p(()=>{iB();L_();cB();KO();L_();F1=class{constructor(e={}){this.options=oB(e),this.useDefinitionSignature=!dd(e)}getCRS(e,r={}){return nB(this,e,this.options,r,this.useDefinitionSignature,this.options.resolver?N1:void 0)}createProjection(e={}){return new fd({...this.options,...e})}async createProjectionAsync(e={}){let r={...this.options,...e};return fd.create(r.resolver?await aB(r):r)}}});var uB=p(()=>{});var O_,fB=p(()=>{ou();Wt();tt();ut();Bt();O_={name:"merc",semantics:{id:"@math.gl/geospatial/merc",version:1},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:t,eccentricitySquared:e,parameters:r,primeMeridian:n=0}){let i=Math.sqrt(e),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=$f(r,"lat_ts");l=Math.cos(g)/Math.sqrt(1-e*Math.sin(g)**2)}if(l<=0)throw new Error("Mercator scale must be positive");let u=t*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,kn(Q(s-Math.PI,-h,s+Math.PI,h),n),s,n,o).normalize}},...Ni(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*Yt(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=Yt(s+(y-a)/u,o),g.y=_+0;return}for(let S=0;S<30;S++){let M=Math.atan(Math.sinh(w+i*Math.atanh(i*Math.sin(_))));if(Math.abs(M-_)<1e-13){g.x=Yt(s+(y-a)/u,o),g.y=M;return}_=M}throw new Error("Mercator inverse did not converge")})}}}});var B_,hB=p(()=>{bc();Wt();tt();ut();Bt();B_={name:"eqc",semantics:{id:"@math.gl/geospatial/eqc",version:1},aliases:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical"],parameters:["lon_0","lat_0","lat_ts","x_0","y_0"],create({semiMajorAxis:t,parameters:e,primeMeridian:r=0}){let n=Object.prototype.hasOwnProperty.call(e,"over"),i=re(e,"lon_0",0)*At,o=$f(e,"lat_0"),s=Math.cos($f(e,"lat_ts")),a=re(e,"x_0",0),c=re(e,"y_0",0),l=t*Math.abs(s)*Math.PI;return{longitudeOrigin:i,getRenderingProfile(u){if(u)return ur(d=>lt(Ce([a,a],Fe(Br(d,i,n),t*s)),[c+t*(d[0][1]-o),c+t*(d[1][1]-o)]),u,i,r,n);let h=[[a-l,c+t*(-Math.PI/2-o),0],[a+l,c+t*(Math.PI/2-o),0]];return{bounds:h,normalize:ur(()=>h,kn(Q(i-Math.PI,-(Math.PI/2),i+Math.PI,Math.PI/2),r),i,r,n).normalize}},...gi(u=>{u.x=a+t*s*Yt(u.x-i,n),u.y=c+t*(u.y-o)},u=>{u.x=Yt(i+(u.x-a)/(t*s),n),u.y=o+(u.y-c)/t})}}}});function dY(t){if(t.k0||(t.k0=1),t.x0=t.x0||0,t.y0=t.y0||0,t.long0=t.long0||0,!(Math.abs(t.lat1+t.lat2)<1e-10)){var e=t.b/t.a;t.e=Math.sqrt(1-e*e);var r=Math.sin(t.lat1),n=Math.cos(t.lat1),i=xn(t.e,r,n),o=Qr(t.e,t.lat1,r),s=Math.sin(t.lat2),a=Math.cos(t.lat2),c=xn(t.e,s,a),l=Qr(t.e,t.lat2,s),u=Qr(t.e,t.lat0,Math.sin(t.lat0));Math.abs(t.lat1-t.lat2)>1e-10?t.ns=Math.log(i/c)/Math.log(o/l):t.ns=r,Number.isNaN(t.ns)&&(t.ns=r),t.f0=i/(t.ns*Math.pow(o,t.ns)),t.rh=Math.abs(Math.abs(t.lat0)-F)<1e-10?0:t.a*t.f0*Math.pow(u,t.ns)}}function dB(t,e){var r=e.x,n=e.y,i=Math.abs(Math.abs(n)-F),o,s;if(i>1e-10)o=t.sphere?1/Math.tan(Math.PI/4+n/2):Qr(t.e,n,Math.sin(n)),s=t.a*t.f0*Math.pow(o,t.ns);else{if(i=n*t.ns,i<=0)return null;s=0}var a=t.ns*G(r-t.long0,t.over);return e.x=t.k0*(s*Math.sin(a))+t.x0,e.y=t.k0*(t.rh-s*Math.cos(a))+t.y0,e}function mB(t,e){var r,n,i,o,s,a=(e.x-t.x0)/t.k0,c=t.rh-(e.y-t.y0)/t.k0;t.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||t.ns>0){if(n=1/t.ns,i=Math.pow(r/(t.a*t.f0),n),o=Mc(t.e,i),o===-9999)return null}else o=-F;return s=G(l/t.ns+t.long0,t.over),e.x=s,e.y=o,e}function pB(t){let e={...t,ns:0,f0:0,rh:0};return dY(e),e}var gB=p(()=>{cu();Jf();_t();dp();Ct()});var C_,yB=p(()=>{Bt();tt();ut();ou();Gn();gB();C_={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,...Zo,"lat_1","lat_2"],create(t){let e=xr(t);iu(e,t.parameters);let r=pB(e),n=fr("lcc",r,dB,mB),i={...Ni(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(e.long0-Math.PI,r.ns>0?-Math.PI/3:-Math.PI/2,e.long0+Math.PI,r.ns>0?Math.PI/2:Math.PI/3),o=>nu(i.forward,o,e.long0,r.ns,r.x0,r.y0+r.k0*r.rh,e.over),e.primeMeridian,e.over)}}});function fn(t,e){var r;return t>1e-7?(r=t*e,(1-t*t)*(e/(1-r*r)-.5/t*Math.log((1-r)/(1+r)))):2*e}var md=p(()=>{});function k1(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));let n=4*Number.EPSILON*r;if(Math.abs(e)>r+n)return NaN;if(Math.abs(Math.abs(e)-r)<=n)return e<0?-1*F:F;for(var i=Math.asin(.5*e),o,s,a,c,l=0;l<30;l++)if(s=Math.sin(i),a=Math.cos(i),c=t*s,o=Math.pow(1-c*c,2)/(2*a)*(e/(1-t*t)-s/(1-c*c)+.5/t*Math.log((1-c)/(1+c))),i+=o,Math.abs(o)<=1e-10)return i;return NaN}var D_=p(()=>{Ct()});function mY(t){Math.abs(t.lat1+t.lat2)<1e-10||(t.temp=t.b/t.a,t.es=1-Math.pow(t.temp,2),t.e3=Math.sqrt(t.es),t.sin_po=Math.sin(t.lat1),t.cos_po=Math.cos(t.lat1),t.t1=t.sin_po,t.con=t.sin_po,t.ms1=xn(t.e3,t.sin_po,t.cos_po),t.qs1=fn(t.e3,t.sin_po),t.sin_po=Math.sin(t.lat2),t.cos_po=Math.cos(t.lat2),t.t2=t.sin_po,t.ms2=xn(t.e3,t.sin_po,t.cos_po),t.qs2=fn(t.e3,t.sin_po),t.sin_po=Math.sin(t.lat0),t.cos_po=Math.cos(t.lat0),t.t3=t.sin_po,t.qs0=fn(t.e3,t.sin_po),Math.abs(t.lat1-t.lat2)>1e-10?t.ns0=(t.ms1*t.ms1-t.ms2*t.ms2)/(t.qs2-t.qs1):t.ns0=t.con,t.c=t.ms1*t.ms1+t.ns0*t.qs1,t.rh=t.a*Math.sqrt(t.c-t.ns0*t.qs0)/t.ns0)}function bB(t,e){var r=e.x,n=e.y;t.sin_phi=Math.sin(n),t.cos_phi=Math.cos(n);var i=fn(t.e3,t.sin_phi),o=t.a*Math.sqrt(t.c-t.ns0*i)/t.ns0,s=t.ns0*G(r-t.long0,t.over),a=o*Math.sin(s)+t.x0,c=t.rh-o*Math.cos(s)+t.y0;return e.x=a,e.y=c,e}function wB(t,e){var r,n,i,o,s,a;if(e.x-=t.x0,e.y=t.rh-e.y+t.y0,t.ns0>=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),i=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),i=-1),o=0,r!==0&&(o=Math.atan2(i*e.x,i*e.y)),i=r*t.ns0/t.a,t.sphere){let c=(t.c-i*i)/(2*t.ns0);if(Math.abs(c)>1+8*Number.EPSILON)return null;a=Math.asin(Math.max(-1,Math.min(1,c)))}else{n=(t.c-i*i)/t.ns0;let c=fn(t.e3,1);a=Math.abs(Math.abs(n)-c)<=16*Number.EPSILON*c?Math.sign(n)*Math.PI/2:k1(t.e3,n)}return s=G(o/t.ns0+t.long0,t.over),e.x=s,e.y=a,e}function xB(t){let e={...t,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 mY(e),e}var _B=p(()=>{cu();md();_t();D_()});var N_,SB=p(()=>{ou();Bt();tt();ut();Gn();_B();N_={name:"aea",aliases:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers"],parameters:[...Er,"lat_1","lat_2"],create(t){let e=xr(t);iu(e,t.parameters);let r=xB(e),n={...fr("aea",r,bB,wB,Ni)};return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>nu(n.forward,i,e.long0,r.ns0,r.x0,r.y0+r.rh,e.over),e.primeMeridian,e.over)}}});function As(t){return Math.abs(t)<=F?t:t-Hs(t)*Math.PI}var pd=p(()=>{Ct();Yf()});function pY(t){Math.abs(t.lat1+t.lat2)<1e-10||(t.temp=t.b/t.a,t.es=1-Math.pow(t.temp,2),t.e=Math.sqrt(t.es),t.en=mo(t.es),t.sin_phi=Math.sin(t.lat1),t.cos_phi=Math.cos(t.lat1),t.ms1=xn(t.e,t.sin_phi,t.cos_phi),t.ml1=_r(t.lat1,Math.sin(t.lat1),Math.cos(t.lat1),t.en),Math.abs(t.lat1-t.lat2)<1e-10?t.ns=t.sin_phi:(t.sin_phi=Math.sin(t.lat2),t.cos_phi=Math.cos(t.lat2),t.ms2=xn(t.e,t.sin_phi,t.cos_phi),t.ml2=_r(t.lat2,Math.sin(t.lat2),Math.cos(t.lat2),t.en),t.ns=(t.ms1-t.ms2)/(t.ml2-t.ml1)),t.g=t.ml1+t.ms1/t.ns,t.ml0=_r(t.lat0,Math.sin(t.lat0),Math.cos(t.lat0),t.en),t.rh=t.a*(t.g-t.ml0))}function MB(t,e){var r=e.x,n=e.y,i;if(t.sphere)i=t.a*(t.g-n);else{var o=_r(n,Math.sin(n),Math.cos(n),t.en);i=t.a*(t.g-o)}var s=t.ns*G(r-t.long0,t.over),a=t.x0+i*Math.sin(s),c=t.y0+t.rh-i*Math.cos(s);return e.x=a,e.y=c,e}function vB(t,e){e.x-=t.x0,e.y=t.rh-e.y+t.y0;var r,n,i,o;t.ns>=0?(n=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(n=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1);var s=0;if(n!==0&&(s=Math.atan2(r*e.x,r*e.y)),t.sphere)return o=G(t.long0+s/t.ns,t.over),i=As(t.g-n/t.a),e.x=o,e.y=i,e;var a=t.g-n/t.a;return i=po(a,t.es,t.en),o=G(t.long0+s/t.ns,t.over),e.x=o,e.y=i,e}function EB(t){let e={...t,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 pY(e),e}var TB=p(()=>{su();_c();au();cu();_t();pd()});var F_,AB=p(()=>{ou();Bt();tt();ut();Gn();TB();F_={name:"eqdc",aliases:["Equidistant_Conic"],parameters:[...Er,"lat_1","lat_2"],create(t){let e=xr(t);iu(e,t.parameters);let r=EB(e),n=fr("eqdc",r,MB,vB,Ni);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>nu(n.forward,i,e.long0,r.ns,r.x0,r.y0+r.rh,e.over),e.primeMeridian,e.over)}}});function Za(t,e){let r=Math.abs(Math.sin(e)),n=Math.cos(e),i=n*n/(1+r);if(t===0)return 2*i;let o=t*t;return i*(1+o*r)/(1-o*r*r)+(1-o)/t*Math.atanh(t*i/(1-o*r))}function k_(t,e,r){if(r===0||t===0)return r;let n=Za(t,r)/e;return Math.atan2(Math.sign(r)*(1-n),Math.sqrt(n*(2-n)))}function G_(t,e,r){if(t===0||r===0||Math.abs(r)===Math.PI/2)return r;let n=Math.abs(Math.sin(r)),i=Math.cos(r),o=e*i*i/(1+n),s=Math.abs(r),a=t*t,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(t,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 U_=p(()=>{});function gY(t){var e=Math.abs(t.lat0);if(Math.abs(e-F)<1e-10?t.mode=t.lat0<0?Ji:Do:Math.abs(e)<1e-10?t.mode=Pi:t.mode=hn,t.es>0){var r;switch(t.qp=fn(t.e,1),t.mmf=.5/(1-t.es),t.mode){case Do:t.dd=1;break;case Ji:t.dd=1;break;case Pi:t.rq=Math.sqrt(.5*t.qp),t.dd=1/t.rq,t.xmf=1,t.ymf=.5*t.qp;break;case hn:t.rq=Math.sqrt(.5*t.qp),r=Math.sin(t.lat0),t.sinb1=fn(t.e,r)/t.qp,t.cosb1=Math.sqrt(1-t.sinb1*t.sinb1),t.dd=Math.cos(t.lat0)/(Math.sqrt(1-t.es*r*r)*t.rq*t.cosb1),t.xmf=t.rq,t.ymf=t.xmf/t.dd,t.xmf*=t.dd;break}}else t.mode===hn&&(t.sinph0=Math.sin(t.lat0),t.cosph0=Math.cos(t.lat0))}function IB(t,e){var r,n,i,o,s,a,c,l,u,h,d=e.x,m=e.y;if(d=G(d-t.long0,t.over),t.sphere){if(s=Math.sin(m),h=Math.cos(m),i=Math.cos(d),t.mode===hn||t.mode===Pi){if(n=t.mode===Pi?1+h*i:1+t.sinph0*s+t.cosph0*h*i,n<=1e-10)return null;n=Math.sqrt(2/n),r=n*h*Math.sin(d),n*=t.mode===Pi?s:t.cosph0*s-t.sinph0*h*i}else if(t.mode===Do||t.mode===Ji){if(t.mode===Do&&(i=-i),Math.abs(m+t.lat0)<1e-10)return null;n=rt-m*.5,n=2*(t.mode===Ji?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(t.e,s),t.mode===hn||t.mode===Pi){c=a/t.qp;let g=Za(t.e,m)/t.qp;l=Math.sqrt(g*(2-g))}switch(t.mode){case hn:u=1+t.sinb1*c+t.cosb1*l*i;break;case Pi:u=1+l*i;break;case Do:u=F+m,a=m>=0?Za(t.e,m):2*t.qp-Za(t.e,m);break;case Ji:u=m-F,a=m<=0?Za(t.e,m):2*t.qp-Za(t.e,m);break}if(Math.abs(u)<1e-10)return null;switch(t.mode){case hn:case Pi:u=Math.sqrt(2/u),t.mode===hn?n=t.ymf*u*(t.cosb1*c-t.sinb1*l*i):(u=Math.sqrt(2/(1+l*i)),n=u*c*t.ymf),r=t.xmf*u*l*o;break;case Do:case Ji:a>=0?(u=Math.sqrt(a),r=u*o,n=i*(t.mode===Ji?u:-u)):r=n=0;break}}return e.x=t.a*r+t.x0,e.y=t.a*n+t.y0,e}function PB(t,e){e.x-=t.x0,e.y-=t.y0;var r=e.x/t.a,n=e.y/t.a,i,o,s,a,c,l,u;if(t.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)),(t.mode===hn||t.mode===Pi)&&(m=Math.sin(o),h=Math.cos(o)),t.mode){case Pi:o=Math.abs(d)<=1e-10?0:Fi(0,1,m,h,r,n,d),r*=m,n=h*d;break;case hn:o=Math.abs(d)<=1e-10?t.lat0:Fi(t.sinph0,t.cosph0,m,h,r,n,d),r*=m*t.cosph0,n=(h-Math.sin(o)*t.sinph0)*d;break;case Do:n=-n,o=F-o;break;case Ji:o-=F;break}i=n===0&&(t.mode===Pi||t.mode===hn)?0:Math.atan2(r,n)}else{if(u=0,t.mode===hn||t.mode===Pi){if(r/=t.dd,n*=t.dd,l=Math.sqrt(r*r+n*n),l<1e-10)return e.x=t.long0,e.y=t.lat0,e;let g=.5*l/t.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=Fi(t.mode===hn?t.sinb1:0,t.mode===hn?t.cosb1:1,a,s,r,n,l);o=G_(t.e,t.qp,y),r*=a,t.mode===hn?(u=s*t.sinb1+n*a*t.cosb1/l,c=t.qp*u,n=l*t.cosb1*s-n*t.sinb1*a):(u=n*a/l,c=t.qp*u,n=l*s)}else if(t.mode===Do||t.mode===Ji){if(t.mode===Do&&(n=-n),c=r*r+n*n,!c)return e.x=t.long0,e.y=t.lat0,e;u=1-c/t.qp,t.mode===Ji&&(u=-u)}if(i=Math.atan2(r,n),Math.abs(u)>1+8*Number.EPSILON)return null;if(t.mode===Do||t.mode===Ji){let g=Math.max(0,Math.min(2,c/t.qp)),y=Math.atan2(u,Math.sqrt(g*(2-g)));o=G_(t.e,t.qp,y)}}return e.x=G(t.long0+i,t.over),e.y=o,e}function RB(t){let e={...t,mode:0,qp:0,mmf:0,dd:0,rq:0,xmf:0,ymf:0,sinb1:0,cosb1:0,sinph0:0,cosph0:0};return gY(e),e}var Ji,Do,Pi,hn,LB=p(()=>{Ct();md();_t();U_();Zf();Ji=1,Do=2,Pi=3,hn=4});var j_,OB=p(()=>{U_();Ys();Zs();Gn();LB();j_={name:"laea",aliases:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area"],parameters:Er,create(t){let e=xr(t),r=RB(e);return wn(Ws(e,fr("laea",r,IB,PB)),e,Math.PI*179/180,(n,i)=>c8(e,e.sphere?1:r.xmf||Math.sqrt(r.qp/2),e.sphere?1:r.ymf||Math.sqrt(r.qp/2),n,i,e.sphere?e.lat0:k_(e.e,r.qp,e.lat0),e.sphere?o=>o:o=>k_(e.e,r.qp,o)))}}});function G1(t,e){return Math.pow((1-t)/(1+t),e)}var BB=p(()=>{});function bY(t){var e=Math.sin(t.lat0),r=Math.cos(t.lat0);r*=r,t.rc=Math.sqrt(1-t.es)/(1-t.es*e*e),t.C=Math.sqrt(1+t.es*r*r/(1-t.es)),t.phic0=Math.asin(e/t.C),t.ratexp=.5*t.C*t.e,t.K=Math.tan(.5*t.phic0+rt)/(Math.pow(Math.tan(.5*t.lat0+rt),t.C)*G1(t.e*e,t.ratexp))}function CB(t,e){var r=e.x,n=e.y;return e.y=2*Math.atan(t.K*Math.pow(Math.tan(.5*n+rt),t.C)*G1(t.e*Math.sin(n),t.ratexp))-F,e.x=t.C*r,e}function DB(t,e){for(var r=1e-14,n=e.x/t.C,i=e.y,o=Math.pow(Math.tan(.5*i+rt)/t.K,1/t.C),s=yY;s>0&&(i=2*Math.atan(o*G1(t.e*Math.sin(e.y),-.5*t.e))-F,!(Math.abs(i-e.y)<r));--s)e.y=i;return s?(e.x=n,e.y=i,e):null}function NB(t){let e={...t,rc:0,C:0,phic0:0,ratexp:0,K:0};return bY(e),e}var yY,FB=p(()=>{BB();Ct();yY=20});function wY(t){t.rc&&(t.sinc0=Math.sin(t.phic0),t.cosc0=Math.cos(t.phic0),t.R2=2*t.rc)}function kB(t,e){var r,n,i,o;return e.x=G(e.x-t.long0,t.over),CB(t,e),r=Math.sin(e.y),n=Math.cos(e.y),i=Math.cos(e.x),o=t.k0*t.R2/(1+t.sinc0*r+t.cosc0*n*i),e.x=o*n*Math.sin(e.x),e.y=o*(t.cosc0*r-t.sinc0*n*i),e.x=t.a*e.x+t.x0,e.y=t.a*e.y+t.y0,e}function GB(t,e){var r,n,i,o,s;if(e.x=(e.x-t.x0)/t.a,e.y=(e.y-t.y0)/t.a,e.x/=t.k0,e.y/=t.k0,s=tr(e.x,e.y),s){var a=2*Math.atan2(s,t.R2);r=Math.sin(a),n=Math.cos(a),o=Fi(t.sinc0,t.cosc0,r,n,e.x,e.y,s),i=Math.atan2(e.x*r,s*t.cosc0*n-e.y*t.sinc0*r)}else o=t.phic0,i=0;if(e.x=i,e.y=o,!DB(t,e))throw new Error("Oblique stereographic inverse did not converge");return e.x=G(e.x+t.long0,t.over),e}function UB(t){let e={...NB(t),sinc0:0,cosc0:0,R2:0};return wY(e),e}var jB=p(()=>{Zf();FB();_t();xc()});var z_,zB=p(()=>{Ys();Zs();Gn();jB();z_={name:"sterea",aliases:["Stereographic_North_Pole","Oblique_Stereographic","Oblique Stereographic Alternative","Double_Stereographic"],parameters:[...Er,...Zo],create(t){let e=xr(t);if(Math.abs(e.lat0)===Math.PI/2)throw new Error("sterea requires a non-polar origin; use stere at the poles");let r=UB(e);return wn(Ws(e,fr("sterea",r,kB,GB)),e,Math.PI*150/180,(n,i)=>hp(e,o=>2*Math.atan(r.K*Math.pow(Math.tan(Math.PI/4+o/2),r.C)*Math.pow((1-e.e*Math.sin(o))/(1+e.e*Math.sin(o)),r.ratexp))-Math.PI/2,r.phic0,e.a*e.k0*r.R2,n,i,r.C,Math.abs(Math.log(r.C))+Math.abs(Math.log(r.K))+r.C*e.e*Math.atanh(e.e)))}}});function q_(t,e){let r=1-t*Math.sin(e)**2;return(1-t)/(r*Math.sqrt(r))}function U1(t,e,r,n){return q_(t,e-r*n)+q_(t,e+r*n)}function ci(t,e,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*U1(e,a,i,.1834346424956498)+.3137066458778873*U1(e,a,i,.525532409916329)+.2223810344533745*U1(e,a,i,.7966664774136267)+.1012285362903763*U1(e,a,i,.9602898564975363))}return t*o}function V_(t,e,r){let n=Math.PI/2,i=ci(t,e,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(t,e,0,a)-r;if(Math.abs(l)<=8*Number.EPSILON*t)return a;l>0?s=a:o=a;let u=a-l/(t*q_(e,a));a=u>o&&u<s?u:(o+s)/2}return NaN}var W_=p(()=>{});function qB(t,e,r,n,i,o,s){let a=n-e,c=Math.atan((1-o)*Math.tan(t)),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,B,R,E,j,I,O,A,W,k;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}M=u*d+h*m*_,v=Math.atan2(S,M),B=h*m*w/S,R=1-B*B,E=R!==0?M-2*u*d/R:0,j=o/16*R*(4+o*(4-3*R)),y=g,g=a+(1-j)*o*B*(v+j*S*(E+j*M*(-1+2*E*E)))}while(Math.abs(g-y)>1e-12&&--b>0);if(b===0){s.x=NaN,s.y=NaN;return}I=R*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),O=1+I/16384*(4096+I*(-768+I*(320-175*I))),A=I/1024*(256+I*(-128+I*(74-47*I))),W=A*S*(E+A/4*(M*(-1+2*E*E)-A/6*E*(-3+4*S*S)*(-3+4*E*E))),k=i*(1-o)*O*(v-W);let T=Math.atan2(m*w,h*d-u*m*_);s.x=T,s.y=k}function VB(t,e,r,n,i,o,s){let a=Math.atan((1-o)*Math.tan(t)),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,M=100,v,B,R,E;do v=Math.cos(2*d+_),B=Math.sin(_),R=Math.cos(_),E=w*B*(v+w/4*(R*(-1+2*v*v)-w/6*v*(-3+4*B*B)*(-3+4*v*v))),S=_,_=n/(i*(1-o)*b)+E;while(Math.abs(_-S)>1e-12&&--M>0);if(M===0){s.x=NaN,s.y=NaN;return}let j=c*B-l*R*h,I=Math.atan2(c*R+l*B*h,(1-o)*Math.sqrt(m*m+j*j)),O=Math.atan2(B*u,l*R-c*B*h),A=o/16*g*(4+o*(4-3*g)),W=O-(1-A)*o*m*(_+A*B*(v+A*R*(-1+2*v*v))),k=e+W;s.x=k,s.y=I}var WB=p(()=>{});function xY(t){t.sin_p12=Math.sin(t.lat0),t.cos_p12=Math.cos(t.lat0),t.x0=t.x0||0,t.y0=t.y0||0,t.long0=t.long0||0,t.f=t.es/(1+Math.sqrt(1-t.es))}function $B(t,e){var r=e.x,n=e.y,i=Math.sin(e.y),o=Math.cos(e.y),s=G(r-t.long0,t.over),a,c,l,u,h;if(t.sphere)return Math.abs(t.sin_p12-1)<=1e-10?(e.x=t.x0+t.a*(F-n)*Math.sin(s),e.y=t.y0-t.a*(F-n)*Math.cos(s),e):Math.abs(t.sin_p12+1)<=1e-10?(e.x=t.x0+t.a*(F+n)*Math.sin(s),e.y=t.y0+t.a*(F+n)*Math.cos(s),e):(u=t.sin_p12*i+t.cos_p12*o*Math.cos(s),c=Math.acos(u),l=c?c/Math.sin(c):1,e.x=t.x0+t.a*l*o*Math.sin(s),e.y=t.y0+t.a*l*(t.cos_p12*i-t.sin_p12*o*Math.cos(s)),e);if(Math.abs(t.sin_p12-1)<=1e-10)return a=ci(t.a,t.es,n,F),e.x=t.x0+a*Math.sin(s),e.y=t.y0-a*Math.cos(s),e;if(Math.abs(t.sin_p12+1)<=1e-10)return a=ci(t.a,t.es,-F,n),e.x=t.x0+a*Math.sin(s),e.y=t.y0+a*Math.cos(s),e;{if(Math.abs(s)<1e-10&&Math.abs(n-t.lat0)<1e-10)return e.x=t.x0,e.y=t.y0,e;qB(t.lat0,t.long0,n,r,t.a,t.f,e),h=e.x;let d=e.y;return e.x=t.x0+d*Math.sin(h),e.y=t.y0+d*Math.cos(h),e}}function HB(t,e){e.x-=t.x0,e.y-=t.y0;var r,n,i,o,s,a,c,l,u,h,d;if(t.sphere){if(r=Math.sqrt(e.x*e.x+e.y*e.y),r>2*F*t.a)return null;if(n=r/t.a,i=Math.sin(n),o=Math.cos(n),s=t.long0,Math.abs(r)<=1e-10)a=t.lat0;else if(a=Fi(t.sin_p12,t.cos_p12,i,o,e.x,e.y,r),c=Math.abs(t.lat0)-F,Math.abs(c)<=1e-10)if(t.lat0>=0){if(!Number.isFinite(a))return null;s=G(t.long0+Math.atan2(e.x,-e.y),t.over)}else s=G(t.long0-Math.atan2(-e.x,e.y),t.over);else s=G(t.long0+Math.atan2(e.x*i,r*t.cos_p12*o-e.y*t.sin_p12*i),t.over);return e.x=s,e.y=a,e}else return Math.abs(t.sin_p12-1)<=1e-10?(l=ci(t.a,t.es,0,F),r=Math.sqrt(e.x*e.x+e.y*e.y),u=l-r,a=V_(t.a,t.es,u),Number.isFinite(a)?(s=G(t.long0+Math.atan2(e.x,-1*e.y),t.over),e.x=s,e.y=a,e):null):Math.abs(t.sin_p12+1)<=1e-10?(l=ci(t.a,t.es,0,F),r=Math.sqrt(e.x*e.x+e.y*e.y),u=r-l,a=V_(t.a,t.es,u),Number.isFinite(a)?(s=G(t.long0+Math.atan2(e.x,e.y),t.over),e.x=s,e.y=a,e):null):(h=Math.atan2(e.x,e.y),d=Math.sqrt(e.x*e.x+e.y*e.y),VB(t.lat0,t.long0,h,d,t.a,t.f,e),e)}function KB(t){let e={...t,sin_p12:0,cos_p12:0,f:0};return xY(e),e}var XB=p(()=>{Zf();_t();Ct();W_();WB()});var $_,YB=p(()=>{Ys();Zs();Gn();XB();$_={name:"aeqd",aliases:["Azimuthal_Equidistant"],parameters:Er,create(t){let e=xr(t),r=KB(e);return wn(Ws(e,fr("aeqd",r,$B,HB)),e,Math.PI*179/180,(n,i)=>a8(e,n,i))}}});var H_,ZB=p(()=>{ud();A_();H_={name:"geocent",aliases:["Geocentric","geocentric","Geocent"],parameters:[],create({semiMajorAxis:t,semiMinorAxis:e,eccentricitySquared:r,primeMeridian:n=0}){let i={semiMajorAxis:t,eccentricitySquared:r,semiMinorAxis:e??t*Math.sqrt(1-r)};return{getRenderingProfile:()=>({bounds:[[-t,-t,-i.semiMinorAxis],[t,t,i.semiMinorAxis]],normalize:Ya({},n)().normalize}),forward(){throw new Error("Geocentric projection requires the 3D pipeline")},inverse(){throw new Error("Geocentric projection requires the 3D pipeline")},forwardInPlace:o=>L1(o,i),inverseInPlace:o=>O1(o,i),forward3D:o=>FO(o,i),inverse3D:o=>kO(o,i)}}}});function JB(t,e,r){let n=Us(Br(r,t.long0,t.over)),i=t.a/Math.sqrt(1-t.es),o=pi(e(t.long0,r[0][1])[1],e(t.long0,r[1][1])[1]),s=Math.max(Math.abs(t.a*(t.es?t.am1:t.cphi1)+t.y0-o[0]),Math.abs(t.a*(t.es?t.am1:t.cphi1)+t.y0-o[1])),a=Math.min(s,i*n),c=Math.min(2*s,i*n);return lt([t.x0-a,t.x0+a],[o[0]-c,o[1]+c])}function QB(t,e,r){let n=Us(Br(r,t.long0,t.over)),i=t.a/Math.sqrt(1-t.es),o=i*n*n/4,s=pi(e(t.long0,r[0][1])[1],e(t.long0,r[1][1])[1]);return t.sphere&&(r[0][1]-t.lat0<-Math.PI/2||r[1][1]-t.lat0>Math.PI/2)&&(s=[t.y0-t.a*Math.PI/2,t.y0+t.a*Math.PI/2]),lt([t.x0-i*n,t.x0+i*n],[s[0]-o,s[1]+o])}function eC(t,e,r){let n=Us(Br(r,t.long0,t.over));if(t.sphere&&n>Math.PI/2)throw new Error("Unsupported Cassini rendering coverage");let i=t.a/Math.sqrt(1-t.es),o=t.es/(1-t.es),s=t.sphere?t.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=t.sphere?t.a*n:i*(n*n/4+(6+6*o)*n**4/24),c=pi(e(t.long0,r[0][1])[1],e(t.long0,r[1][1])[1]);return lt([t.x0-s,t.x0+s],[c[0]-a,c[1]+a])}function K_(t,e){return e[0]<=0&&e[1]>=0?[-1/0,1/0]:Ot(t,pi(1/e[0],1/e[1]))}function tC(t,e){let r=l=>{let u=t.alpha*(Math.asinh(Math.tan(l))-t.e*Math.atanh(t.e*Math.sin(l)))+t.K;return Math.asin(Math.tanh(u))},n=Q((e[0][0]-t.long0)*t.alpha,r(e[0][1]),(e[1][0]-t.long0)*t.alpha,r(e[1][1])),i=dt([-Math.sin(t.b0),0,Math.cos(t.b0)],n);if(Us(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(t.b0),0,Math.sin(t.b0)],n),a=K_(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([t.x0,t.x0],Fe(a,t.R)),Ce([t.y0,t.y0],Fe(c,t.R)))}function rC(t,e){let r=g=>Math.log(t.E)-t.B*Math.log(Qr(t.e,g,Math.sin(g))),n=pi(r(e[0][1]),r(e[1][1])),i=Fe([e[0][0]-t.lam0,e[1][0]-t.lam0],t.B),o=Q(i[0],Math.asin(Math.tanh(n[0])),i[1],Math.asin(Math.tanh(n[1]))),s=dt([0,-t.cosgam,t.singam],o),a=Fe(pi(-Math.atanh(s[0]),-Math.atanh(s[1])),t.ArB),c=Ce(Fe([Math.sinh(n[0]),Math.sinh(n[1])],t.cosgam),Fe(Hf(i),t.singam)),l=rp(i),u=l[0]>0?K_(c,l).map(Math.atan):[-Math.PI,Math.PI],h=Fe(u,t.ArB),d,m;return t.no_rot?(d=h,m=a):(h=Ce(h,[-t.u_0,-t.u_0]),d=Ce(Fe(a,t.cosrot),Fe(h,t.sinrot)),m=Ce(Fe(h,t.cosrot),Fe(a,-t.sinrot))),lt(Ce([t.x0,t.x0],Fe(d,t.a)),Ce([t.y0,t.y0],Fe(m,t.a)))}function nC(t,e){let r=m=>2*(Math.atan(t.k*Math.pow(Math.tan(m/2+t.s45),t.alfa)/Math.pow((1+t.e*Math.sin(m))/(1-t.e*Math.sin(m)),t.alfa*t.e/2))-t.s45),n=Fe(Br(e,t.long0,t.over),-t.alfa),i=Q(n[0],r(e[0][1]),n[1],r(e[1][1])),o=dt([Math.sin(t.ad),0,Math.cos(t.ad)],i),s=[Math.sqrt(Math.max(Number.EPSILON,1-Us(o)**2)),1],a=dt([0,1,0],i),c=K_(a,s),l=Fe(c.map(m=>Math.asin(Math.max(-1,Math.min(1,m)))),t.n),u=m=>t.ro0*Math.pow(Math.tan(t.s0/2+t.s45)/Math.tan(Math.asin(m)/2+t.s45),t.n),h=pi(u(o[0]),u(o[1])),d=t.czech?1:-1;return lt(Ce([t.x0,t.x0],Fe(Ot(h,Hf(l)),d)),Ce([t.y0,t.y0],Fe(Ot(h,rp(l)),d)))}function iC(t,e){let r=Fe([e[0][1]-t.lat0,e[1][1]-t.lat0],1e-5/Xf),n=Br(e,t.long0,t.over),i=[0,0];for(let l=10;l>=1;l--)i=Ce([t.A[l],t.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,[t.B_re[l],t.B_re[l]]),s=Ce(h,[t.B_im[l],t.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([t.x0,t.x0],Fe(c,t.a)),Ce([t.y0,t.y0],Fe(a,t.a)))}var Ja=p(()=>{tt();Sc();Bt();Jf();Ct()});function Ae(t){let e=xr(t);return{...e,x0:0,y0:0,lat_ts:Number.isNaN(e.lat_ts)?0:e.lat_ts}}function Gt(t,e){return{...t,x0:re(e.parameters,"x_0",0),y0:re(e.parameters,"y_0",0)}}function Ie(t,e,r,n,i,o){let s=fr(t,r,n,i),a=re(e.parameters,"x_0",0),c=re(e.parameters,"y_0",0);return gi(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 Qa(t,e=0,r=!1){return(n,i)=>{let o=Math.sin(t.lat0)*Math.sin(i)+Math.cos(t.lat0)*Math.cos(i)*Math.cos(n-t.long0);if(r?o<e-1e-14:o<=e+1e-14)throw new Error("Coordinate is outside the visible projection horizon")}}var Ut=p(()=>{bc();Gn();Wt()});function _Y(t){var e;if(t.phi1=t.lat1,Math.abs(t.phi1)<gd)throw new Error;t.es?(t.en=mo(t.es),t.am1=Math.sin(t.phi1),e=Math.cos(t.phi1),t.m1=_r(t.phi1,t.am1,e,t.en),t.am1=e/(Math.sqrt(1-t.es*t.am1*t.am1)*t.am1)):Math.abs(t.phi1)+gd>=F?t.cphi1=0:t.cphi1=1/Math.tan(t.phi1)}function SY(t,e){var r=G(e.x-(t.long0||0),t.over),n=e.y,i,o,s;return o=Math.sin(n),s=Math.cos(n),i=t.am1+t.m1-_r(n,o,s,t.en),o=s*r/(i*Math.sqrt(1-t.es*o*o)),e.x=i*Math.sin(o),e.y=t.am1-i*Math.cos(o),e.x=t.a*e.x+(t.x0||0),e.y=t.a*e.y+(t.y0||0),e}function MY(t,e){e.x=(e.x-(t.x0||0))/t.a,e.y=(e.y-(t.y0||0))/t.a;var r,n,i,o;if(e.y=t.am1-e.y,n=tr(e.x,e.y),t.phi1<0&&(n=-n),o=po(t.am1+t.m1-n,t.es,t.en),r=Math.abs(o),r<F)r=Math.sin(o),i=n*Math.atan2(Math.sign(t.phi1)*e.x,Math.sign(t.phi1)*e.y)*Math.sqrt(1-t.es*r*r)/Math.cos(o);else if(Math.abs(r-F)<=gd)i=0;else throw new Error;return e.x=G(i+(t.long0||0),t.over),e.y=As(o),e}function vY(t,e){var r=G(e.x-(t.long0||0),t.over),n=e.y,i,o;return o=t.cphi1+t.phi1-n,Math.abs(o)>gd?(i=r*Math.cos(n)/o,e.x=o*Math.sin(i),e.y=t.cphi1-o*Math.cos(i)):e.x=e.y=0,e.x=t.a*e.x+(t.x0||0),e.y=t.a*e.y+(t.y0||0),e}function EY(t,e){e.x=(e.x-(t.x0||0))/t.a,e.y=(e.y-(t.y0||0))/t.a;var r,n;e.y=t.cphi1-e.y;var i=tr(e.x,e.y);if(t.phi1<0&&(i=-i),n=t.cphi1+t.phi1-i,Math.abs(n)>F)throw new Error;return Math.abs(Math.abs(n)-F)<=gd?r=0:r=i*Math.atan2(Math.sign(t.phi1)*e.x,Math.sign(t.phi1)*e.y)/Math.cos(n),e.x=G(r+(t.long0||0),t.over),e.y=As(n),e}function oC(t,e){return t.es?SY(t,e):vY(t,e)}function sC(t,e){return t.es?MY(t,e):EY(t,e)}function aC(t,e={}){let r={...t,phi1:0,en:[],m1:0,am1:0,cphi1:0,...e};return _Y(r),r}var gd,cC=p(()=>{pd();_t();xc();su();au();_c();Ct();gd=1e-10});var X_,lC=p(()=>{Ja();tt();ut();Ut();cC();X_={name:"bonne",aliases:["Bonne (Werner lat_1=90)"],parameters:["lon_0","x_0","y_0","lat_1"],create(t){let e=Ae(t);if(!Object.prototype.hasOwnProperty.call(t.parameters,"lat_1")||Math.abs(e.lat1)<1e-10)throw new Error("Bonne requires a nonzero lat_1");let r=aC(e),n=Ie("bonne",t,r,oC,sC);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>JB(Gt(r,t),n.forward,i),e.primeMeridian,e.over)}}});function Zu(t,e,r){var n=e*r;return t/Math.sqrt(1-n*n)}var Y_=p(()=>{});function TY(t){t.sphere||(t.en=mo(t.es),t.ml0=t.a*_r(t.lat0,Math.sin(t.lat0),Math.cos(t.lat0),t.en))}function J_(t,e){var r,n,i=e.x,o=e.y;if(i=G(i-t.long0,t.over),t.sphere)r=t.a*Math.asin(Math.cos(o)*Math.sin(i)),n=t.a*(Math.atan2(Math.tan(o),Math.cos(i))-t.lat0);else{var s=Math.sin(o),a=Math.cos(o),c=Zu(t.a,t.e,s),l=Math.tan(o)*Math.tan(o),u=i*Math.cos(o),h=u*u,d=t.es*a*a/(1-t.es),m=t.a*_r(o,s,a,t.en);r=c*u*(1-h*l*(1/6+(8-l+8*d)*h/120)),n=m-t.ml0+c*s/a*h*(.5+(5-l+6*d)*h/24)}return e.x=r+t.x0,e.y=n+t.y0,e}function uC(t,e){e.x-=t.x0,e.y-=t.y0;var r=e.x/t.a,n=e.y/t.a,i,o;if(t.sphere){var s=n+t.lat0;i=Math.asin(Math.sin(s)*Math.cos(r)),o=Math.atan2(Math.tan(r),Math.cos(s))}else{var a=t.ml0/t.a+n,c=po(a,t.es,t.en);if(Math.abs(Math.abs(c)-F)<=1e-10)return e.x=t.long0,e.y=Math.sign(c)*F,e;var l=Zu(t.a,t.e,Math.sin(c)),u=l*l*l/t.a/t.a*(1-t.es),h=Math.pow(Math.tan(c),2),d=r*t.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(!t.sphere){let g=e.x+t.x0,y=e.y+t.y0,b=t.scratch,w=!1;for(let _=0;_<12;_++){Z_(t,o,i);let S=b.x-g,M=b.y-y;if(Math.max(Math.abs(S),Math.abs(M))<1e-7){w=!0;break}let v=1e-7,B=i>F-v?-v:v,R=b.x,E=b.y;Z_(t,o+v,i);let j=(b.x-R)/v,I=(b.y-E)/v;Z_(t,o,i+B);let O=(b.x-R)/B,A=(b.y-E)/B,W=j*A-O*I;if(!Number.isFinite(W)||Math.abs(W)<1e-12||(o-=(A*S-O*M)/W,i-=(j*M-I*S)/W,!Number.isFinite(o)||Math.abs(i)>F))break}if(!w)throw new Error("Cassini inverse did not converge")}return e.x=G(o+t.long0,t.over),e.y=As(i),e}function Z_(t,e,r){t.scratch.x=e+t.long0,t.scratch.y=r,J_(t,t.scratch)}function fC(t,e={}){let r={...t,en:[],scratch:{x:0,y:0},ml0:0,...e};return TY(r),r}var hC=p(()=>{su();_c();au();Y_();_t();pd();Ct()});var Q_,dC=p(()=>{Ja();tt();ut();Ut();hC();Q_={name:"cass",aliases:["Cassini","Cassini_Soldner"],parameters:["lon_0","x_0","y_0","lat_0"],create(t){let e=Ae(t),r=fC(e),n=Ie("cass",t,r,J_,uC);return De(n,Q(e.long0-Math.PI/6,-Math.PI/2+1e-8,e.long0+Math.PI/6,Math.PI/2-1e-8),i=>eC(Gt(e,t),n.forward,i),e.primeMeridian,e.over)}}});function AY(t){t.sphere||(t.k0=xn(t.e,Math.sin(t.lat_ts),Math.cos(t.lat_ts)))}function mC(t,e){var r=e.x,n=e.y,i,o,s=G(r-t.long0,t.over);if(t.sphere)i=t.x0+t.a*s*Math.cos(t.lat_ts),o=t.y0+t.a*Math.sin(n)/Math.cos(t.lat_ts);else{var a=fn(t.e,Math.sin(n));i=t.x0+t.a*t.k0*s,o=t.y0+t.a*a*.5/t.k0}return e.x=i,e.y=o,e}function pC(t,e){e.x-=t.x0,e.y-=t.y0;var r,n;return t.sphere?(r=G(t.long0+e.x/t.a/Math.cos(t.lat_ts),t.over),n=Math.asin(e.y/t.a*Math.cos(t.lat_ts))):(n=k1(t.e,2*e.y*t.k0/t.a),r=G(t.long0+e.x/(t.a*t.k0),t.over)),e.x=r,e.y=n,e}function gC(t,e={}){let r={...t,...e};return AY(r),r}var yC=p(()=>{_t();md();cu();D_()});var eS,bC=p(()=>{Bt();tt();ut();Ut();yC();eS={name:"cea",aliases:[],parameters:["lon_0","x_0","y_0","lat_ts"],create(t){let e=Ae(t);if(Math.abs(e.lat_ts)>=Math.PI/2)throw new Error("CEA standard parallel must be away from the poles");let r=gC(e),n=Ie("cea",t,r,mC,pC);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function pl(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}var j1=p(()=>{});function PY(t){t.long0=t.long0||0,t.sphere?(t.n=1,t.m=0,t.es=0,t.C_y=Math.sqrt((t.m+1)/t.n),t.C_x=t.C_y/(t.m+1)):t.en=mo(t.es)}function z1(t,e){var r,n,i=e.x,o=e.y;if(i=G(i-t.long0,t.over),t.sphere){if(!t.m)o=t.n!==1?Math.asin(t.n*Math.sin(o)):o;else for(var s=t.n*Math.sin(o),a=IY;a;--a){var c=(t.m*o+Math.sin(o)-s)/(t.m+Math.cos(o));if(o-=c,Math.abs(c)<1e-10)break}r=t.a*t.C_x*i*(t.m+Math.cos(o)),n=t.a*t.C_y*o}else{var l=Math.sin(o),u=Math.cos(o);n=t.a*_r(o,l,u,t.en),r=t.a*i*u/Math.sqrt(1-t.es*l*l)}return e.x=r,e.y=n,e}function q1(t,e){var r,n,i,o;if(e.x-=t.x0,i=e.x/t.a,e.y-=t.y0,r=e.y/t.a,t.sphere){if(r/=t.C_y,i=i/(t.C_x*(t.m+Math.cos(r))),t.m){let s=(t.m*r+Math.sin(r))/t.n;if(Math.abs(s)>1+8*Number.EPSILON)return null;r=pl(s)}else t.n!==1&&(r=pl(Math.sin(r)/t.n));i=G(i+t.long0,t.over),r=As(r)}else r=po(e.y/t.a,t.es,t.en),o=Math.abs(r),o<F?(o=Math.sin(r),n=t.long0+e.x*Math.sqrt(1-t.es*o*o)/(t.a*Math.cos(r)),i=G(n,t.over)):o-1e-10<F&&(i=t.long0);return e.x=i,e.y=r,e}function wC(t,e={}){let r={...t,en:[],n:0,m:0,C_y:0,C_x:0,...e};return PY(r),r}var IY,tS=p(()=>{_t();pd();su();_c();au();Ct();j1();IY=20});function RY(t){t.sphere=!0,t.b=t.a,t.m=1,t.n=2.5707963267948966,t.es=0,t.C_y=Math.sqrt((t.m+1)/t.n),t.C_x=t.C_y/(t.m+1)}function SC(t,e={}){let r={...t,m:0,n:0,C_y:0,C_x:0,en:[],...e};return RY(r),r}var xC,_C,MC=p(()=>{tS();xC=z1,_C=q1});var rS,vC=p(()=>{Bt();tt();ut();Ut();MC();rS={name:"eck6",aliases:["Eckert_VI"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=SC(e),n=Ie("eck6",t,r,xC,_C);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function nS(t){var e,r=[];return r[0]=t*LY,e=t*t,r[0]+=e*OY,r[1]=e*CY,e*=t,r[0]+=e*BY,r[1]+=e*DY,r[2]=e*NY,r}var LY,OY,BY,CY,DY,NY,EC=p(()=>{LY=.3333333333333333,OY=.17222222222222222,BY=.10257936507936508,CY=.06388888888888888,DY=.0664021164021164,NY=.016415012942191543});function iS(t,e){var r=t+t;return t+e[0]*Math.sin(r)+e[1]*Math.sin(r+r)+e[2]*Math.sin(r+r+r)}var TC=p(()=>{});function FY(t){t.long0=t.long0!==void 0?t.long0:0,t.x0=t.x0!==void 0?t.x0:0,t.y0=t.y0!==void 0?t.y0:0,t.es!==0&&(t.apa=nS(t.es),t.qp=fn(t.e,1),t.rqda=Math.sqrt(.5*t.qp))}function AC(t,e){var r=G(e.x-t.long0,t.over),n=e.y,i=Math.sin(n);t.es!==0&&(i=fn(t.e,i)/t.qp);var o=Math.asin(V1*i),s=o*o,a=s*s*s;return e.x=r*Math.cos(o)/(V1*(Ju+3*Qu*s+a*(7*ef+9*tf*s))),e.y=o*(Ju+Qu*s+a*(ef+tf*s)),t.es!==0&&(e.x*=t.rqda,e.y*=t.rqda),e.x=t.a*e.x+t.x0,e.y=t.a*e.y+t.y0,e}function IC(t,e){e.x=(e.x-t.x0)/t.a,e.y=(e.y-t.y0)/t.a,t.es!==0&&(e.x/=t.rqda,e.y/=t.rqda);let r=Math.PI/3,n=r*r,i=r*(Ju+Qu*n+n**3*(ef+tf*n));if(Math.abs(e.y)>i+8*Number.EPSILON*i)return null;var o=1e-9,s=12,a=e.y,c,l,u,h,d,m;for(m=0;m<s&&(c=a*a,l=c*c*c,u=a*(Ju+Qu*c+l*(ef+tf*c))-e.y,h=Ju+3*Qu*c+l*(7*ef+9*tf*c),a-=d=u/h,!(Math.abs(d)<o));++m);c=a*a,l=c*c*c,e.x=V1*e.x*(Ju+3*Qu*c+l*(7*ef+9*tf*c))/Math.cos(a);let g=Math.sin(a)/V1,y=8*Number.EPSILON;return Math.abs(g)>1+y?null:(e.y=Math.abs(g)>=1-y?Math.sign(g)*Math.PI/2:Math.asin(g),t.es!==0&&(e.y=iS(e.y,t.apa)),e.x=G(e.x+t.long0,t.over),e)}function PC(t,e={}){let r={...t,apa:[],qp:0,rqda:0,...e};return FY(r),r}var Ju,Qu,ef,tf,V1,RC=p(()=>{_t();md();EC();TC();Ju=1.340264,Qu=-.081106,ef=893e-6,tf=.003796,V1=Math.sqrt(3)/2});var oS,LC=p(()=>{Wt();Ut();RC();tt();ut();Bt();oS={name:"eqearth",aliases:["Equal Earth","Equal_Earth"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=t.primeMeridian??0,n=PC(e),i=Ie("eqearth",t,n,AC,IC),o=Math.sqrt(t.eccentricitySquared),s=t.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(t.parameters,"x_0",0),d=re(t.parameters,"y_0",0),m=s*a*(1.340264-.081106*c+l*(893e-6+.003796*c));return{...i,longitudeOrigin:e.long0,getRenderingProfile(g){if(g)return ur(b=>Cr(i.forward,b,e.long0,e.over),g,e.long0,r,e.over);let y=[[h-u,d-m,0],[h+u,d+m,0]];return{bounds:y,normalize:ur(()=>y,kn(Q(e.long0-Math.PI,-(Math.PI/2),e.long0+Math.PI,Math.PI/2),r),e.long0,r,e.over).normalize}}}}}});function kY(t){t.x0=t.x0||0,t.y0=t.y0||0,t.lat0=t.lat0||0,t.long0=t.long0||0}function OC(t,e){var r=e.x,n=e.y,i=G(r-t.long0,t.over),o=t.x0+t.a*i*Math.cos(t.lat0),s=t.y0+t.a*n;return t.t1=o,t.t2=Math.cos(t.lat0),e.x=o,e.y=s,e}function BC(t,e){e.x-=t.x0,e.y-=t.y0;var r=e.y/t.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=G(t.long0+e.x/(t.a*Math.cos(t.lat0)),t.over);return e.x=n,e.y=r,e}function CC(t,e={}){let r={...t,t2:0,t1:0,...e};return kY(r),r}var DC=p(()=>{_t()});var sS,NC=p(()=>{Bt();tt();ut();Ut();DC();sS={name:"equi",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(t){let e=Ae(t);if(Math.abs(e.lat0)>=Math.PI/2)throw new Error("Equirectangular standard parallel must be away from the poles");let r=CC(e),n=Ie("equi",t,r,OC,BC);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function FC(t,e,r=!1){let n=1+e/t.a,i=n/(1+1e-10),o=h=>Math.acos(Math.min(1,Math.sqrt(1-t.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-t.es))))},a=e*Math.asin(1/n),c=e*Math.atan(Math.sqrt((1-t.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]-t.long0,-g),b=Math.min(h[1][0]-t.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 M=Q(y,_,b,S),v=kn(Q(y+t.long0,_,b+t.long0,S),t.primeMeridian),B=(t.long0+t.primeMeridian)*180/Math.PI,R=zs(E=>{let j=Math.max(y,Math.min(b,Yt(E.x-t.long0))),I=s(j),O=Math.max(Math.max(_,-I),Math.min(Math.min(S,I),E.y));j!==E.x-t.long0&&(E.x=j+t.long0),E.y=O},t.primeMeridian);return{get bounds(){if(!d)return lt([t.x0-a,t.x0+a],[t.y0-c,t.y0+c]);let E=dt([0,0,1],M),j=[1,1/Math.sqrt(1-t.es*Math.max(E[0]**2,E[1]**2))],I=Ot(dt([1,0,0],M),j),O=Ot(dt([0,1,0],M),j),A=Ot(E,[1-t.es,(1-t.es)*j[1]]),W=[n-Math.min(1,I[1]),n-Math.max(1/n,I[0])],k=(T,C,N,D)=>{let L=C[0]<=0&&C[1]>=0?0:Math.min(Math.abs(C[0]),Math.abs(C[1])),P=D?[Math.hypot(W[0],L),Math.hypot(W[1],Math.max(Math.abs(C[0]),Math.abs(C[1])))]:W,z=T.flatMap(we=>P.map(_e=>e*Math.atan(we/_e)));return[Math.max(-N,Math.min(...z)),Math.min(N,Math.max(...z))]};return lt(Ce([t.x0,t.x0],k(O,A,a,r)),Ce([t.y0,t.y0],k(A,O,c,!r)))},normalize(E){op(E,v,B),R(E)}}},u=kn(Q(t.long0-o(0),-s(0),t.long0+o(0),s(0)),t.primeMeridian);return h=>{let d=h?np(h,u):[u],m=ip(d,g=>l(js(g,t.primeMeridian,t.long0),!!h));if(!m)throw new Error("CRS coverage does not intersect the satellite limb");return m}}var kC=p(()=>{tt();yc();ut();Wt();Sc();Bt()});function GY(t){if(t.flip_axis=t.sweep==="x"?1:0,t.h=Number(t.h),t.radius_g_1=t.h/t.a,t.radius_g_1<=0||t.radius_g_1>1e10)throw new Error;if(t.radius_g=1+t.radius_g_1,t.C=t.radius_g*t.radius_g-1,t.es!==0){var e=1-t.es,r=1/e;t.radius_p=Math.sqrt(e),t.radius_p2=e,t.radius_p_inv2=r,t.shape="ellipse"}else t.radius_p=1,t.radius_p2=1,t.radius_p_inv2=1,t.shape="sphere"}function GC(t,e){var r=e.x,n=e.y,i,o,s,a;if(r=r-t.long0,t.shape==="ellipse"){n=Math.atan(t.radius_p2*Math.tan(n));var c=t.radius_p/tr(t.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),(t.radius_g-o)*o-s*s-a*a*t.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;i=t.radius_g-o,t.flip_axis?(e.x=t.radius_g_1*Math.atan(s/tr(a,i)),e.y=t.radius_g_1*Math.atan(a/i)):(e.x=t.radius_g_1*Math.atan(s/i),e.y=t.radius_g_1*Math.atan(a/tr(s,i)))}else t.shape==="sphere"&&(i=Math.cos(n),o=Math.cos(r)*i,s=Math.sin(r)*i,a=Math.sin(n),i=t.radius_g-o,t.flip_axis?(e.x=t.radius_g_1*Math.atan(s/tr(a,i)),e.y=t.radius_g_1*Math.atan(a/i)):(e.x=t.radius_g_1*Math.atan(s/i),e.y=t.radius_g_1*Math.atan(a/tr(s,i))));return e.x=e.x*t.a,e.y=e.y*t.a,e}function UC(t,e){var r=-1,n=0,i=0,o,s,a,c;if(e.x=e.x/t.a,e.y=e.y/t.a,t.shape==="ellipse"){t.flip_axis?(i=Math.tan(e.y/t.radius_g_1),n=Math.tan(e.x/t.radius_g_1)*tr(1,i)):(n=Math.tan(e.x/t.radius_g_1),i=Math.tan(e.y/t.radius_g_1)*tr(1,n));var l=i/t.radius_p;if(o=n*n+l*l+r*r,s=2*t.radius_g*r,a=s*s-4*o*t.C,a<0)return e.x=Number.NaN,e.y=Number.NaN,e;c=(-s-Math.sqrt(a))/(2*o),r=t.radius_g+c*r,n*=c,i*=c,e.x=Math.atan2(n,r),e.y=Math.atan(i*Math.cos(e.x)/r),e.y=Math.atan(t.radius_p_inv2*Math.tan(e.y))}else if(t.shape==="sphere"){if(t.flip_axis?(i=Math.tan(e.y/t.radius_g_1),n=Math.tan(e.x/t.radius_g_1)*Math.sqrt(1+i*i)):(n=Math.tan(e.x/t.radius_g_1),i=Math.tan(e.y/t.radius_g_1)*Math.sqrt(1+n*n)),o=n*n+i*i+r*r,s=2*t.radius_g*r,a=s*s-4*o*t.C,a<0)return e.x=Number.NaN,e.y=Number.NaN,e;c=(-s-Math.sqrt(a))/(2*o),r=t.radius_g+c*r,n*=c,i*=c,e.x=Math.atan2(n,r),e.y=Math.atan(i*Math.cos(e.x)/r)}return e.x=e.x+t.long0,e}function jC(t,e={}){let r={...t,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:"",...e};return GY(r),r}var zC=p(()=>{xc()});var aS,qC=p(()=>{kC();Ut();zC();Wt();aS={name:"geos",aliases:["Geostationary Satellite View","Geostationary_Satellite"],parameters:["lon_0","x_0","y_0","h","sweep"],create(t){let e=Ae(t),r=re(t.parameters,"h",NaN);if(!Number.isFinite(r)||r<=0)throw new Error("Geostationary projection requires positive h");let n=t.parameters.sweep||"y";if(!["x","y"].includes(n))throw new Error("Geostationary sweep must be x or y");let i=jC(e,{h:r,sweep:n});return{...Ie("geos",t,i,GC,UC,e.sphere?Qa({...e,lat0:0},1/(1+r/e.a),!0):void 0),longitudeOrigin:e.long0,getRenderingProfile:FC(Gt(e,t),r,n==="x")}}}});function VC(t){return{engine:wA({semiMajorAxis:1,semiMinorAxis:Math.sqrt(1-t.es)}),latitude:t.lat0*gl}}function WC(t,e,r){let n=e.engine.Inverse(e.latitude,0,r.y*gl,G(r.x-t.long0,t.over)*gl,Wf);if(!(n.M12>0))throw new Error("Coordinate is outside the ellipsoidal gnomonic horizon");let i=t.a*n.m12/n.M12,o=n.azi1/gl;return r.x=t.x0+i*Math.sin(o),r.y=t.y0+i*Math.cos(o),r}function $C(t,e,r){let n=(r.x-t.x0)/t.a,i=(r.y-t.y0)/t.a,o=Math.hypot(n,i);if(o===0)return r.x=t.long0,r.y=t.lat0,r;let s=e.engine.Line(e.latitude,0,Math.atan2(n,i)*gl,Wf),a=o<=1,c=a?o:1/o,l=Math.atan(o);for(let u=0;u<20;u++){let h=s.Position(l,Wf),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,Wf);if(!(m.M12>0))break;return r.x=G(t.long0+m.lon2/gl,t.over),r.y=m.lat2/gl,r}}throw new Error("Ellipsoidal gnomonic inverse did not converge")}var gl,HC=p(()=>{xA();_t();gl=180/Math.PI});function UY(t){t.sphere||(t.ellipsoid=VC(t)),t.sin_p14=Math.sin(t.lat0),t.cos_p14=Math.cos(t.lat0),t.infinity_dist=1e3*t.a,t.rc=1}function KC(t,e){if(t.ellipsoid)return WC(t,t.ellipsoid,e);var r,n,i,o,s,a,c,l,u=e.x,h=e.y;return i=G(u-t.long0,t.over),r=Math.sin(h),n=Math.cos(h),o=Math.cos(i),a=t.sin_p14*r+t.cos_p14*n*o,s=1,a>0||Math.abs(a)<=1e-10?(c=t.x0+t.a*s*n*Math.sin(i)/a,l=t.y0+t.a*s*(t.cos_p14*r-t.sin_p14*n*o)/a):(c=t.x0+t.infinity_dist*n*Math.sin(i),l=t.y0+t.infinity_dist*(t.cos_p14*r-t.sin_p14*n*o)),e.x=c,e.y=l,e}function XC(t,e){if(t.ellipsoid)return $C(t,t.ellipsoid,e);var r,n,i,o,s,a;return e.x=(e.x-t.x0)/t.a,e.y=(e.y-t.y0)/t.a,e.x/=t.k0,e.y/=t.k0,r=Math.sqrt(e.x*e.x+e.y*e.y),r?(o=Math.atan2(r,t.rc),n=Math.sin(o),i=Math.cos(o),a=pl(i*t.sin_p14+e.y*n*t.cos_p14/r),s=Math.atan2(e.x*n,r*t.cos_p14*i-e.y*t.sin_p14*n),s=G(t.long0+s,t.over)):(a=t.lat0,s=t.long0),e.x=s,e.y=a,e}function YC(t,e={}){let r={...t,sin_p14:0,cos_p14:0,infinity_dist:0,rc:0,phic0:0,...e};return UY(r),r}var ZC=p(()=>{HC();_t();j1()});var cS,JC=p(()=>{Ys();Zs();Ut();ZC();cS={name:"gnom",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(t){let e=Ae(t),r=YC(e);return wn(Ie("gnom",t,r,KC,XC,e.sphere?Qa(e):void 0),e,Math.min(Math.PI*80/180,(1-e.es)*Math.PI*.45),(n,i)=>e.sphere?fp(Gt(e,t),n,i,"gnom"):u8(Gt(e,t),n,i),(1-e.es)*Math.PI/2)}}});function lS(t,e){return 2*Math.atan(t*Math.exp(e))-F}var QC=p(()=>{Ct()});function W1(t,e){var r=lS(1,e),n=0,i=0;let o=0;do{if(++o>50)throw new Error("Isometric latitude inverse did not converge");n=r,i=t*Math.sin(n),r=lS(Math.exp(t*Math.log((1+i)/(1-i))/2),e)}while(Math.abs(r-n)>1e-12);return r}var uS=p(()=>{QC()});function rf(t,e,r){if(Math.abs(e)>F)return Number.NaN;if(e===F)return Number.POSITIVE_INFINITY;if(e===-1*F)return Number.NEGATIVE_INFINITY;var n=t*r;return Math.log(Math.tan((F+e)/2))+t*Math.log((1-n)/(1+n))/2}var eD=p(()=>{Ct()});function jY(t){t.k0||(t.k0=1);var e=t.b/t.a;t.e=Math.sqrt(1-e*e),t.lc=t.long0,t.rs=Math.sqrt(1+t.e*t.e*Math.pow(Math.cos(t.lat0),4)/(1-t.e*t.e));var r=Math.sin(t.lat0),n=Math.asin(r/t.rs),i=Math.sin(n);t.cp=rf(0,n,i)-t.rs*rf(t.e,t.lat0,r),t.n2=t.k0*t.a*Math.sqrt(1-t.e*t.e)/(1-t.e*t.e*r*r),t.xs=t.x0,t.ys=t.y0-t.n2*n}function tD(t,e){var r=e.x,n=e.y,i=t.rs*(r-t.lc),o=t.cp+t.rs*rf(t.e,n,Math.sin(n)),s=Math.asin(Math.sin(i)/Kf(o)),a=rf(0,s,Math.sin(s));return e.x=t.xs+t.n2*a,e.y=t.ys+t.n2*Math.atan(wc(o)/Math.cos(i)),e}function rD(t,e){var r=e.x,n=e.y,i=Math.atan(wc((r-t.xs)/t.n2)/Math.cos((n-t.ys)/t.n2)),o=Math.asin(Math.sin((n-t.ys)/t.n2)/Kf((r-t.xs)/t.n2)),s=rf(0,o,Math.sin(o));return e.x=t.lc+i/t.rs,e.y=W1(t.e,(s-t.cp)/t.rs),e}function nD(t,e={}){let r={...t,lc:0,rs:0,cp:0,n2:0,xs:0,ys:0,...e};return jY(r),r}var iD=p(()=>{eD();ap();k2();uS()});var fS,oD=p(()=>{Bt();uS();tt();ut();Ut();iD();fS={name:"gstmerc",aliases:["gstmerg"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(t){let e=Ae(t),r=nD(e),n=Ie("gstmerc",t,r,tD,rD);return De(n,Q(e.long0-Math.PI/6,-Math.PI/3,e.long0+Math.PI/6,Math.PI/3),i=>ru(n.forward,i,e.long0,e.over,W1(r.e,-r.cp/r.rs)),e.primeMeridian,e.over)}}});function zY(t){t.a=6377397155e-3,t.es=.006674372230614,t.e=Math.sqrt(t.es),t.s45=Math.PI/4,t.s90=2*t.s45,t.fi0=t.lat0,t.e2=t.es,t.e=Math.sqrt(t.e2),t.alfa=Math.sqrt(1+t.e2*Math.pow(Math.cos(t.fi0),4)/(1-t.e2)),t.uq=1.04216856380474,t.u0=Math.asin(Math.sin(t.fi0)/t.alfa),t.g=Math.pow((1+t.e*Math.sin(t.fi0))/(1-t.e*Math.sin(t.fi0)),t.alfa*t.e/2),t.k=Math.tan(t.u0/2+t.s45)/Math.pow(Math.tan(t.fi0/2+t.s45),t.alfa)*t.g,t.k1=t.k0,t.n0=t.a*Math.sqrt(1-t.e2)/(1-t.e2*Math.pow(Math.sin(t.fi0),2)),t.s0=1.37008346281555,t.n=Math.sin(t.s0),t.ro0=t.k1*t.n0/Math.tan(t.s0),t.ad=t.s90-t.uq}function sD(t,e){var r,n,i,o,s,a,c,l=e.x,u=e.y,h=G(l-t.long0,t.over);return r=Math.pow((1+t.e*Math.sin(u))/(1-t.e*Math.sin(u)),t.alfa*t.e/2),n=2*(Math.atan(t.k*Math.pow(Math.tan(u/2+t.s45),t.alfa)/r)-t.s45),i=-h*t.alfa,o=Math.asin(Math.cos(t.ad)*Math.sin(n)+Math.sin(t.ad)*Math.cos(n)*Math.cos(i)),s=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(o)),a=t.n*s,c=t.ro0*Math.pow(Math.tan(t.s0/2+t.s45),t.n)/Math.pow(Math.tan(o/2+t.s45),t.n),e.y=c*Math.cos(a)/1,e.x=c*Math.sin(a)/1,t.czech||(e.y*=-1,e.x*=-1),e}function aD(t,e){var r,n,i,o,s,a,c,l,u=e.x;e.x=e.y,e.y=u,t.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),s=Math.atan2(e.y,e.x),o=s/Math.sin(t.s0),i=2*(Math.atan(Math.pow(t.ro0/a,1/t.n)*Math.tan(t.s0/2+t.s45))-t.s45),r=Math.asin(Math.cos(t.ad)*Math.sin(i)-Math.sin(t.ad)*Math.cos(i)*Math.cos(o)),n=Math.asin(Math.cos(i)*Math.sin(o)/Math.cos(r)),e.x=t.long0-n/t.alfa,c=r,l=0;var h=0;do e.y=2*(Math.atan(Math.pow(t.k,-1/t.alfa)*Math.pow(Math.tan(r/2+t.s45),1/t.alfa)*Math.pow((1+t.e*Math.sin(c))/(1-t.e*Math.sin(c)),t.e/2))-t.s45),Math.abs(c-e.y)<1e-10&&(l=1),c=e.y,h+=1;while(l===0&&h<15);return h>=15?null:e}function cD(t,e={}){let r={...t,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,...e};return zY(r),r}var lD=p(()=>{_t()});var hS,uD=p(()=>{Ja();tt();ut();Ut();lD();Wt();Gn();hS={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(t){let e=re(t.parameters,"alpha",30.28813972222222),r=re(t.parameters,"lat_ts",78.5);if(![30.28813972222222,30.28813975277778].some(s=>Math.abs(e-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(t);n.lat0=Vs(t.parameters,"lat_0",49.5),n.long0=Vs(t.parameters,"lon_0",24.83333333333333),n.k0=re(t.parameters,"k_0",re(t.parameters,"k",.9999));let i=cD(n,{czech:Di(t.parameters,"czech")}),o=Ie("krovak",t,i,sD,aD);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=>nC(Gt(i,t),s),n.primeMeridian,n.over)}}});function fD(t,e){var r=e.x,n=e.y,i=G(r-t.long0,t.over),o=t.x0+t.a*i,s=t.y0+t.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return e.x=o,e.y=s,e}function hD(t,e){e.x-=t.x0,e.y-=t.y0;var r=G(t.long0+e.x/t.a,t.over),n=2.5*(Math.atan(Math.exp(.8*e.y/t.a))-Math.PI/4);return e.x=r,e.y=n,e}function dD(t,e={}){let r={...t,...e};return r}var mD=p(()=>{_t()});var dS,pD=p(()=>{Bt();tt();ut();Ut();mD();dS={name:"mill",aliases:["Miller_Cylindrical"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=dD(e),n=Ie("mill",t,r,fD,hD);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function qY(t){t.x0=t.x0!==void 0?t.x0:0,t.y0=t.y0!==void 0?t.y0:0,t.long0=t.long0!==void 0?t.long0:0}function gD(t,e){var r=e.x,n=e.y,i=G(r-t.long0,t.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=wD(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*t.a*i*Math.sin(c/2)+t.x0,d=Math.sign(n)*Math.SQRT2*t.a*Math.cos(c/2)+t.y0;return e.x=h,e.y=d,e}function yD(t,e){let r=e.x-t.x0,n=(e.y-t.y0)/(Math.SQRT2*t.a);if(Math.abs(n)>1+8*Number.EPSILON)return null;let i=r/(2*Math.SQRT2*t.a),o=i*i+n*n;if(!t.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(!t.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*t.a)return null;let c=a===0?0:Math.PI*i/a;var l=G(t.long0+c,t.over),u=Math.sign(n)*(Math.PI/2-2*Math.asin(Math.sqrt(wD(s)/(2*Math.PI))));return e.x=l,e.y=u,e}function bD(t,e={}){let r={...t,...e};return qY(r),r}function wD(t){if(t>.5)return t-Math.sin(t);let e=t*t;return t*e*(1/6+e*(-1/120+e*(1/5040+e*(-1/362880+e*(1/39916800+e*(-1/6227020800+e/1307674368e3))))))}var xD=p(()=>{_t()});var mS,_D=p(()=>{Bt();tt();ut();Ut();xD();mS={name:"moll",aliases:["Mollweide"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=bD(e),n=Ie("moll",t,r,gD,yD);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function VY(t){t.A=[],t.A[1]=.6399175073,t.A[2]=-.1358797613,t.A[3]=.063294409,t.A[4]=-.02526853,t.A[5]=.0117879,t.A[6]=-.0055161,t.A[7]=.0026906,t.A[8]=-.001333,t.A[9]=67e-5,t.A[10]=-34e-5,t.B_re=[],t.B_im=[],t.B_re[1]=.7557853228,t.B_im[1]=0,t.B_re[2]=.249204646,t.B_im[2]=.003371507,t.B_re[3]=-.001541739,t.B_im[3]=.04105856,t.B_re[4]=-.10162907,t.B_im[4]=.01727609,t.B_re[5]=-.26623489,t.B_im[5]=-.36249218,t.B_re[6]=-.6870983,t.B_im[6]=-1.1651967,t.C_re=[],t.C_im=[],t.C_re[1]=1.3231270439,t.C_im[1]=0,t.C_re[2]=-.577245789,t.C_im[2]=-.007809598,t.C_re[3]=.508307513,t.C_im[3]=-.112208952,t.C_re[4]=-.15094762,t.C_im[4]=.18200602,t.C_re[5]=1.01418179,t.C_im[5]=1.64497696,t.C_re[6]=1.9660549,t.C_im[6]=2.5127645,t.D=[],t.D[1]=1.5627014243,t.D[2]=.5185406398,t.D[3]=-.03333098,t.D[4]=-.1052906,t.D[5]=-.0368594,t.D[6]=.007317,t.D[7]=.0122,t.D[8]=.00394,t.D[9]=-.0013}function SD(t,e){var r,n=e.x,i=e.y,o=i-t.lat0,s=n-t.long0,a=o/Xf*1e-5,c=s,l=1,u=0;for(r=1;r<=10;r++)l=l*a,u=u+t.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+t.B_re[r]*m-t.B_im[r]*g,_=_+t.B_im[r]*m+t.B_re[r]*g;return e.x=_*t.a+t.x0,e.y=w*t.a+t.y0,e}function MD(t,e){var r,n=e.x,i=e.y,o=n-t.x0,s=i-t.y0,a=s/t.a,c=o/t.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+t.C_re[r]*l-t.C_im[r]*u,g=g+t.C_im[r]*l+t.C_re[r]*u;for(var y=0;y<t.iterations;y++){var b=m,w=g,_,S,M=a,v=c;for(r=2;r<=6;r++)_=b*m-w*g,S=w*m+b*g,b=_,w=S,M=M+(r-1)*(t.B_re[r]*b-t.B_im[r]*w),v=v+(r-1)*(t.B_im[r]*b+t.B_re[r]*w);b=1,w=0;var B=t.B_re[1],R=t.B_im[1];for(r=2;r<=6;r++)_=b*m-w*g,S=w*m+b*g,b=_,w=S,B=B+r*(t.B_re[r]*b-t.B_im[r]*w),R=R+r*(t.B_im[r]*b+t.B_re[r]*w);var E=B*B+R*R;m=(M*B+v*R)/E,g=(v*B-M*R)/E}var j=m,I=g,O=1,A=0;for(r=1;r<=9;r++)O=O*j,A=A+t.D[r]*O;var W=t.lat0+A*Xf*1e5,k=t.long0+I;return e.x=k,e.y=W,e}function vD(t,e={}){let r={...t,A:[],B_re:[],B_im:[],C_re:[],C_im:[],D:[],iterations:1,...e};return VY(r),r}var ED=p(()=>{Ct()});var pS,TD=p(()=>{Ja();tt();ut();Ut();ED();Wt();pS={name:"nzmg",aliases:["New_Zealand_Map_Grid"],parameters:["lon_0","x_0","y_0","lat_0","iterations"],create(t){let e=Ae(t),r=re(t.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(t.parameters,"lat_0")||!Object.prototype.hasOwnProperty.call(t.parameters,"lon_0"))throw new Error("NZMG requires lat_0 and lon_0");let n=vD(e,{iterations:r}),i=Ie("nzmg",t,n,SD,MD);return De(i,Q(e.long0-Math.PI/22.5,Math.max(-Math.PI/2,e.lat0-Math.PI/22.5),e.long0+Math.PI/22.5,Math.min(Math.PI/2,e.lat0+Math.PI/22.5)),o=>iC(Gt(n,t),o),e.primeMeridian,e.over)}}});function WY(t){return t.no_uoff||t.no_off||["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(t.projName.toLowerCase().replace(/[ _-]/g,""))}function $Y(t){var e,r,n,i,o,s,a,c,l,u,h=0,d,m=0,g=0,y=0,b=0,w=0,_=0;t.k0||(t.k0=1),t.no_off=WY(t),t.no_rot=t.no_rot;var S=!1;Number.isFinite(t.alpha)&&(S=!0);var M=!1;if(Number.isFinite(t.rectified_grid_angle)&&(M=!0),S&&(_=t.alpha),M&&(h=t.rectified_grid_angle,S||(_=0,S=!0)),S||M)m=t.longc;else if(g=t.long1,b=t.lat1,y=t.long2,w=t.lat2,Math.abs(b-w)<=nf||Math.abs(b)<=nf||Math.abs(Math.abs(b)-F)<=nf||Math.abs(Math.abs(t.lat0)-F)<=nf||Math.abs(Math.abs(w)-F)<=nf)throw new Error;var v=1-t.es;if(r=Math.sqrt(v),Math.abs(t.lat0)>1e-10?(c=Math.sin(t.lat0),n=Math.cos(t.lat0),e=1-t.es*c*c,t.B=n*n,t.B=Math.sqrt(1+t.es*t.B*t.B/v),t.A=t.B*t.k0*r/e,i=t.B*r/(n*Math.sqrt(e)),o=i*i-1,o<=0?o=0:(o=Math.sqrt(o),t.lat0<0&&(o=-o)),t.E=o+=i,t.E*=Math.pow(Qr(t.e,t.lat0,c),t.B)):(t.B=1/r,t.A=t.k0,t.E=i=o=1),S||M){S?(d=Math.asin(Math.sin(_)/i),M||(h=_)):(d=h,_=Math.asin(i*Math.sin(d)));let B=.5*(o-1/o)*Math.tan(d);i>1&&Math.abs(Math.cos(_))<=8*Number.EPSILON?B=Math.sign(t.lat0)*Math.sign(Math.sin(_)):Math.abs(B)>1&&Math.abs(B)<=1+8*Number.EPSILON&&(B=Math.sign(B)),t.lam0=m-Math.asin(B)/t.B}else s=Math.pow(Qr(t.e,b,Math.sin(b)),t.B),a=Math.pow(Qr(t.e,w,Math.sin(w)),t.B),o=t.E/s,l=(a-s)/(a+s),u=t.E*t.E,u=(u-a*s)/(u+a*s),e=g-y,e<-Math.PI?y-=$s:e>Math.PI&&(y+=$s),t.lam0=G(.5*(g+y)-Math.atan(u*Math.tan(.5*t.B*(g-y))/l)/t.B,t.over),d=Math.atan(2*Math.sin(t.B*G(g-t.lam0,t.over))/(o-1/o)),h=_=Math.asin(i*Math.sin(d));t.singam=Math.sin(d),t.cosgam=Math.cos(d),t.sinrot=Math.sin(h),t.cosrot=Math.cos(h),t.rB=1/t.B,t.ArB=t.A*t.rB,t.BrA=1/t.ArB,t.no_off?t.u_0=0:(t.u_0=Math.abs(t.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(_))),t.lat0<0&&(t.u_0=-t.u_0)),o=.5*d,t.v_pole_n=t.ArB*Math.log(Math.tan(rt-o)),t.v_pole_s=t.ArB*Math.log(Math.tan(rt+o))}function AD(t,e){var r=e,n,i,o,s,a,c,l,u;if(e.x=e.x-t.lam0,Math.abs(Math.abs(e.y)-F)>1e-10){if(a=t.E/Math.pow(Qr(t.e,e.y,Math.sin(e.y)),t.B),c=1/a,n=.5*(a-c),i=.5*(a+c),s=Math.sin(t.B*e.x),o=(n*t.singam-s*t.cosgam)/i,Math.abs(Math.abs(o)-1)<1e-10)throw new Error;u=.5*t.ArB*Math.log((1-o)/(1+o)),c=Math.cos(t.B*e.x),Math.abs(c)<nf?l=t.A*e.x:l=t.ArB*Math.atan2(n*t.cosgam+s*t.singam,c)}else u=e.y>0?t.v_pole_n:t.v_pole_s,l=t.ArB*e.y;return t.no_rot?(r.x=l,r.y=u):(l-=t.u_0,r.x=u*t.cosrot+l*t.sinrot,r.y=l*t.cosrot-u*t.sinrot),r.x=t.a*r.x+t.x0,r.y=t.a*r.y+t.y0,r}function ID(t,e){var r,n,i,o,s,a,c,l=e;if(e.x=(e.x-t.x0)*(1/t.a),e.y=(e.y-t.y0)*(1/t.a),t.no_rot?(n=e.y,r=e.x):(n=e.x*t.cosrot-e.y*t.sinrot,r=e.y*t.cosrot+e.x*t.sinrot+t.u_0),i=Math.exp(-t.BrA*n),o=.5*(i-1/i),s=.5*(i+1/i),a=Math.sin(t.BrA*r),c=(a*t.cosgam+o*t.singam)/s,Math.abs(Math.abs(c)-1)<1e-10)l.x=0,l.y=c<0?-F:F;else{if(l.y=t.E/Math.sqrt((1+c)/(1-c)),l.y=Mc(t.e,Math.pow(l.y,1/t.B)),l.y===1/0)throw new Error;l.x=-t.rB*Math.atan2(o*t.cosgam-a*t.singam,Math.cos(t.BrA*r))}return l.x+=t.lam0,l}function PD(t,e={}){let r={...t,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:"",...e};return $Y(r),r}var nf,RD=p(()=>{Jf();_t();dp();Ct();nf=1e-7});var gS,LD=p(()=>{Ja();tt();ut();Ut();RD();Wt();Gn();gS={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(t){let e=Ae(t);if(Math.abs(e.lat0)>=Math.PI/2)throw new Error("Oblique Mercator origin must be away from the poles");let n=Object.prototype.hasOwnProperty.call(t.parameters,"alpha")||Object.prototype.hasOwnProperty.call(t.parameters,"gamma")?["lonc"]:["lon_1","lat_1","lon_2","lat_2"];for(let s of n)if(!Object.prototype.hasOwnProperty.call(t.parameters,s))throw new Error("Oblique Mercator requires "+s);let i=PD(e,{projName:t.parameters.proj||"omerc",alpha:re(t.parameters,"alpha",NaN)*Math.PI/180,rectified_grid_angle:re(t.parameters,"gamma",NaN)*Math.PI/180,longc:re(t.parameters,"lonc",0)*Math.PI/180,long1:re(t.parameters,"lon_1",0)*Math.PI/180,long2:re(t.parameters,"lon_2",0)*Math.PI/180,no_off:Di(t.parameters,"no_off"),no_uoff:Di(t.parameters,"no_uoff"),no_rot:Di(t.parameters,"no_rot")}),o=Ie("omerc",t,i,AD,ID);return De(o,Q(i.lam0-Math.PI/18,Math.max(-Math.PI/2+1e-8,e.lat0-Math.PI/18),i.lam0+Math.PI/18,Math.min(Math.PI/2-1e-8,e.lat0+Math.PI/18)),s=>rC(Gt(i,t),s),e.primeMeridian,e.over)}}});function OD(t){let e=Math.sin(t.lat0),r=Math.cos(t.lat0),n=1/Math.sqrt(1-t.es*e*e);return{...t,sin0:e,cos0:r,originY:-t.es*n*e*r}}function BD(t,e){let r=G(e.x-t.long0,t.over),n=Math.sin(e.y),i=Math.cos(e.y),o=1/Math.sqrt(1-t.es*n*n);return e.x=t.x0+t.a*t.k0*o*i*Math.sin(r),e.y=t.y0+t.a*t.k0*(o*((1-t.es)*n*t.cos0-i*Math.cos(r)*t.sin0)-t.originY),e}function CD(t,e){let r=(e.x-t.x0)/(t.a*t.k0),n=(e.y-t.y0)/(t.a*t.k0)+t.originY,i=1-t.es,o=t.cos0*t.cos0+t.sin0*t.sin0/i,s=n*t.sin0*t.cos0*t.es/i,a=r*r+n*n*(t.sin0*t.sin0+t.cos0*t.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*t.cos0-n*t.sin0,h=l*t.sin0+n*t.cos0;return e.x=G(t.long0+Math.atan2(r,u),t.over),e.y=Math.atan2(h,i*Math.hypot(u,r)),e}var DD=p(()=>{_t()});var yS,ND=p(()=>{Ys();Zs();Ut();DD();yS={name:"ortho",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(t){let e=Ae(t),r=OD(e);return wn(Ie("ortho",t,r,BD,CD,Qa(e,0,!0)),e,Math.PI/2,(n,i)=>s8(Gt(e,t),n,i),Math.PI/2)}}});function HY(t){t.meridianPole=ci(t.a,t.es,0,Math.PI/2),t.poleRadius=t.a/Math.sqrt(1-t.es),t.ml0=ci(t.a,t.es,0,t.lat0)}function GD(t,e){var r=e.x,n=e.y,i,o,s,a=G(r-t.long0,t.over);if(s=a*Math.sin(n),t.sphere)n===0?(i=t.a*a,o=-1*t.a*t.lat0):(i=t.a*Math.sin(s)/Math.tan(n),o=t.a*(n-t.lat0+2*Math.sin(s/2)**2/Math.tan(n)));else if(n===0)i=t.a*a,o=-1*t.ml0;else{var c=Zu(t.a,t.e,Math.sin(n))/Math.tan(n);i=c*Math.sin(s),o=ci(t.a,t.es,t.lat0,n)+c*(2*Math.sin(s/2)**2)}return e.x=i+t.x0,e.y=o+t.y0,e}function UD(t,e){var r,n,i,o,s,a,c,l,u;i=e.x-t.x0,o=e.y-t.y0;let h=o+(t.sphere?t.a*t.lat0:t.ml0),d=h<0?-1:1,g=(t.sphere?t.a*Math.PI/2:t.meridianPole)-d*h,y=Math.hypot(i,g);if(y/t.a<1e-6)return e.x=G(t.long0+Math.atan2(i,g),t.over),e.y=d*(Math.PI/2-y/t.poleRadius),e;if(t.sphere)if(Math.abs(o+t.a*t.lat0)<=1e-10)r=G(i/t.a+t.long0,t.over),n=0;else{a=t.lat0+o/t.a,c=i*i/t.a/t.a+a*a,l=a;var b;for(s=FD;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=kD(t,n===void 0?l:n,i,o),n===void 0)return null;l=n,r=G(t.long0+Math.asin(i*Math.tan(l)/t.a)/Math.sin(n),t.over)}else if(Math.abs(o+t.ml0)<=1e-10)n=0,r=G(t.long0+i/t.a,t.over);else{a=(t.ml0+o)/t.a,c=i*i/t.a/t.a+a*a,l=a;var w,_,S,M,v;for(s=FD;s;--s)if(v=t.e*Math.sin(l),w=Math.sqrt(1-v*v)*Math.tan(l),_=ci(t.a,t.es,0,l),S=(1-t.es)/Math.pow(1-v*v,1.5),M=_/t.a,u=(a*(w*M+1)-M-.5*w*(M*M+c))/(t.es*Math.sin(2*l)*(M*M+c-2*a*M)/(4*w)+(a-M)*(w*S-2/Math.sin(2*l))-S),l-=u,Math.abs(u)<=1e-14){n=l;break}if(n=kD(t,n===void 0?l:n,i,o),n===void 0)return null;l=n,w=Math.sqrt(1-t.es*Math.pow(Math.sin(n),2))*Math.tan(n),r=G(t.long0+Math.asin(i*w/t.a)/Math.sin(n),t.over)}return e.x=r,e.y=n,e}function jD(t,e={}){let r={...t,ml0:0,meridianPole:0,poleRadius:0,...e};return HY(r),r}function kD(t,e,r,n){for(let i=0;i<8;i++){if(!Number.isFinite(e)||Math.abs(e)>=Math.PI/2)return;let o=Math.sin(e),s=Math.cos(e),a=1-t.es*o*o,c=t.sphere?t.a:Zu(t.a,t.e,o),l=c/Math.tan(e),u=Math.asin(r/l),h=l*Math.sin(u),d=2*Math.sin(u/2)**2,m=t.sphere?t.a*(e-t.lat0):ci(t.a,t.es,t.lat0,e),g=l*d,b=m+g-n;if(Math.abs(h-r)<=64*Number.EPSILON*Math.max(t.a,Math.abs(r))&&Math.abs(b)<=64*Number.EPSILON*Math.max(Math.abs(n),Math.abs(m),Math.abs(g),t.a*Math.max(Math.abs(e),Math.abs(t.lat0))))return e;let w=t.sphere?t.a:t.a*(1-t.es)/Math.pow(a,1.5),_=c*((t.sphere?0:t.es*s*s/a)-1/(o*o)),S=w+_*(-d/Math.cos(u)),M=b/S;if(!Number.isFinite(M)||Math.abs(M)>1e-6)return;e-=M}}var FD,zD=p(()=>{_t();Y_();W_();FD=20});var bS,qD=p(()=>{Ja();tt();ut();Ut();zD();bS={name:"poly",aliases:["Polyconic","American_Polyconic"],parameters:["lon_0","x_0","y_0","lat_0"],create(t){let e=Ae(t),r=jD(e),n=Ie("poly",t,r,GD,UD);return De(n,Q(e.long0-Math.PI/6,Math.max(-Math.PI/2+1e-8,e.lat0-Math.PI/2+1e-8),e.long0+Math.PI/6,Math.min(Math.PI/2-1e-8,e.lat0+Math.PI/2-1e-8)),i=>QB(Gt(e,t),n.forward,i),e.primeMeridian,e.over)}}});function KY(t){t.x0=t.x0||0,t.y0=t.y0||0,t.lat0=t.lat0||0,t.long0=t.long0||0,t.lat_ts=t.lat_ts||0,t.lat0>=F-rt/2?t.face=jt.TOP:t.lat0<=-(F-rt/2)?t.face=jt.BOTTOM:Math.abs(t.long0)<=rt?t.face=jt.FRONT:Math.abs(t.long0)<=F+rt?t.face=t.long0>0?jt.RIGHT:jt.LEFT:t.face=jt.BACK,t.es!==0&&(t.one_minus_f=1-(t.a-t.b)/t.a,t.one_minus_f_squared=t.one_minus_f*t.one_minus_f)}function VD(t,e){var r=e,n,i,o,s,a,c,l=0;if(e.x-=t.long0,t.es!==0?n=Math.atan(t.one_minus_f_squared*Math.tan(e.y)):n=e.y,i=e.x,t.face===jt.TOP)s=F-n,i>=rt&&i<=F+rt?(l=mt.AREA_0,o=i-F):i>F+rt||i<=-(F+rt)?(l=mt.AREA_1,o=i>0?i-Math.PI:i+Math.PI):i>-(F+rt)&&i<=-rt?(l=mt.AREA_2,o=i+F):(l=mt.AREA_3,o=i);else if(t.face===jt.BOTTOM)s=F+n,i>=rt&&i<=F+rt?(l=mt.AREA_0,o=-i+F):i<rt&&i>=-rt?(l=mt.AREA_1,o=-i):i<-rt&&i>=-(F+rt)?(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;t.face===jt.RIGHT?i=of(i,+F):t.face===jt.BACK?i=of(i,+Math.PI):t.face===jt.LEFT&&(i=of(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,t.face===jt.FRONT?(s=Math.atan2(Math.hypot(h,d),u),o=$1(s,d,h)):t.face===jt.RIGHT?(s=Math.atan2(Math.hypot(u,d),h),o=$1(s,d,-u)):t.face===jt.BACK?(s=Math.atan2(Math.hypot(h,d),-u),o=$1(s,d,-h)):t.face===jt.LEFT?(s=Math.atan2(Math.hypot(u,d),-h),o=$1(s,d,u)):s=o=0,Math.abs(o)<=rt?l=mt.AREA_0:o>rt&&o<=F+rt?(l=mt.AREA_1,o-=F):o>F+rt||o<=-(F+rt)?(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(rt))-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*t.a+t.x0,r.y=r.y*t.a+t.y0,e}function WD(t,e){var r=0,n=0,i,o,s,a,c,l,u,h,d=0;e.x=(e.x-t.x0)/t.a,e.y=(e.y-t.y0)/t.a,i=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?d=mt.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(d=mt.AREA_1,i-=F):e.x<0&&-e.x>=Math.abs(e.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(e.x,e.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),t.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(t.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),t.face===jt.RIGHT?(h=g,g=-y,y=h):t.face===jt.BACK?(g=-g,y=-y):t.face===jt.LEFT&&(h=g,g=y,y=-h),n=Math.atan2(b,Math.hypot(g,y)),r=Math.atan2(y,g),t.face===jt.RIGHT?r=of(r,-F):t.face===jt.BACK?r=of(r,-Math.PI):t.face===jt.LEFT&&(r=of(r,+F))}return t.es!==0&&(n=Math.atan2(Math.sin(n),t.one_minus_f_squared*Math.cos(n))),r+=t.long0,e.x=r,e.y=n,e}function $1(t,e,r){return t===0?0:Math.atan2(e,r)}function of(t,e){var r=t+e;return r<-Math.PI?r+=$s:r>+Math.PI&&(r-=$s),r}function $D(t,e={}){let r={...t,face:0,one_minus_f:0,one_minus_f_squared:0,...e};return KY(r),r}var jt,mt,HD=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 wS,KD=p(()=>{yc();ud();Ut();Wt();HD();tt();ut();Sc();Bt();wS={name:"qsc",aliases:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube"],parameters:["lon_0","x_0","y_0","lat_0"],create(t){let e=Ae(t),r=t.primeMeridian??0,n=$D(e),i=Ie("qsc",t,n,VD,WD),o=re(t.parameters,"x_0",0),s=re(t.parameters,"y_0",0);return{...i,longitudeOrigin:e.long0,getRenderingProfile(a){if(a)return ur(h=>{let d=w=>e.es?Math.atan((1-e.es)*Math.tan(w)):w,m=Q(h[0][0]-e.long0,d(h[0][1]),h[1][0]-e.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=e.a*Math.sqrt((1-y)/(.5*(1-Math.SQRT1_2)));return lt([o-b,o+b],[s-b,s+b])},a,e.long0,r);let c=[[o-e.a,s-e.a,0],[o+e.a,s+e.a,0]],l=Ya(t.parameters,r)().normalize,u=zs(h=>{let[d,m]=i.forward(h.x,h.y);Math.abs(d-o)<=e.a&&Math.abs(m-s)<=e.a||([h.x,h.y]=i.inverse(o+Math.max(-e.a,Math.min(e.a,d-o)),s+Math.max(-e.a,Math.min(e.a,m-s))))},r);return{bounds:c,normalize(h){l(h),u(h)}}}}}}});function ZY(t,e,r,n,i){for(var o=r;i;--i){var s=(H1(t,o)-e)/YY(t,o);if(o-=s,Math.abs(s)<n)break}return o}function JY(t){t.x0=t.x0||0,t.y0=t.y0||0,t.long0=t.long0||0,t.es=0}function JD(t,e){var r=G(e.x-t.long0,t.over),n=Math.abs(e.y),i=Math.floor(n*ZD+1e-15);i<0?i=0:i>=yl&&(i=yl),n=j2*(n-XY*i);var o=H1(sf[i],n)*r,s=H1(ec[i],n);return e.y<0&&(s=-s),e.x=o*t.a*XD+t.x0,e.y=s*t.a*YD+t.y0,e}function QD(t,e){var r=e.y,n=e;n.x=(n.x-t.x0)/(t.a*XD),n.y=Math.abs(r-t.y0)/(t.a*YD);for(let a=0;a<=yl;a++)if(Math.abs(n.y-ec[a][0])<=8*Number.EPSILON)return n.x=G(n.x/sf[a][0]+t.long0,t.over),n.y=(r<t.y0?-1:1)*a*5*U2,n;if(n.y>=1)n.x/=sf[yl][0],n.y=r<0?-F:F;else{var i=Math.floor(n.y*yl);for(i<0?i=0:i>=yl&&(i=yl-1);;)if(ec[i][0]>n.y)--i;else if(ec[i+1][0]<=n.y)++i;else break;var o=ec[i],s=5*(n.y-o[0])/(ec[i+1][0]-o[0]);s=ZY(o,n.y,s,1e-10,100),n.x/=H1(sf[i],s),n.y=(5*i+s)*U2,r<0&&(n.y=-n.y)}return n.x=G(n.x+t.long0,t.over),n}function eN(t,e={}){let r={...t,...e};return JY(r),r}var sf,ec,XD,YD,ZD,XY,yl,H1,YY,tN=p(()=>{Ct();_t();sf=[[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]],ec=[[-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]];sf=sf.map(t=>t.map(Math.fround));ec=ec.map(t=>t.map(Math.fround));XD=.8487,YD=1.3523,ZD=j2/5,XY=1/ZD,yl=18,H1=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},YY=function(t,e){return t[1]+e*(2*t[2]+e*3*t[3])}});var xS,rN=p(()=>{Bt();tt();ut();Ut();tN();xS={name:"robin",aliases:["Robinson"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=eN(e),n=Ie("robin",t,r,JD,QD);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});var _S,nN=p(()=>{Bt();tt();ut();Ut();tS();_S={name:"sinu",aliases:["Sinusoidal"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=wC(e),n=Ie("sinu",t,r,z1,q1);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function QY(t){t.k0||(t.k0=1);var e=t.lat0;t.lambda0=t.long0;var r=Math.sin(e),n=t.a,i=t.rf,o=1/i,s=2*o-Math.pow(o,2);t.e=Math.sqrt(s);var a=t.e;t.R=t.k0*n*Math.sqrt(1-s)/(1-s*Math.pow(r,2)),t.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(e),4)),t.b0=Math.asin(r/t.alpha);var c=Math.log(Math.tan(Math.PI/4+t.b0/2)),l=Math.log(Math.tan(Math.PI/4+e/2)),u=Math.log((1+a*r)/(1-a*r));t.K=c-t.alpha*l+t.alpha*a/2*u}function iN(t,e){let r=t.e*Math.sin(e.y),n=2*Math.atan(Math.exp(t.alpha*(Math.log(Math.tan(Math.PI/4+e.y/2))-t.e/2*Math.log((1+r)/(1-r)))+t.K))-Math.PI/2,i=t.alpha*(e.x-t.lambda0),o=Math.cos(n),s=Math.asin(Math.cos(t.b0)*Math.sin(n)-Math.sin(t.b0)*o*Math.cos(i)),a=Math.asin(o*Math.sin(i)/Math.cos(s));return e.x=t.x0+t.R*a,e.y=t.y0+t.R*Math.log(Math.tan(Math.PI/4+s/2)),e}function oN(t,e){let r=(e.x-t.x0)/t.R,n=2*(Math.atan(Math.exp((e.y-t.y0)/t.R))-Math.PI/4),i=Math.asin(Math.cos(t.b0)*Math.sin(n)+Math.sin(t.b0)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),s=(t.K-Math.log(Math.tan(Math.PI/4+i/2)))/t.alpha;for(let a=0;a<6;a++){let c=t.e*Math.sin(i),l=(s+Math.log(Math.tan(Math.PI/4+i/2))-t.e/2*Math.log((1+c)/(1-c)))*(1-c*c)*Math.cos(i)/(1-t.es);if(i-=l,Math.abs(l)<1e-10)return e.x=t.lambda0+o/t.alpha,e.y=i,e}return null}function sN(t,e={}){let r={...t,lambda0:0,rf:0,R:0,alpha:0,b0:0,K:0,...e};return QY(r),r}var aN=p(()=>{});var SS,cN=p(()=>{Ja();tt();ut();Ut();aN();SS={name:"somerc",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(t){let e=Ae(t),r=sN(e,{rf:e.a===e.b?1/0:1/(1-e.b/e.a)}),n=Ie("somerc",t,r,iN,oN);return De(n,Q(e.long0-Math.PI/18,Math.max(-Math.PI/2+1e-8,e.lat0-Math.PI/18),e.long0+Math.PI/18,Math.min(Math.PI/2-1e-8,e.lat0+Math.PI/18)),i=>tC(Gt(r,t),i),e.primeMeridian,e.over)}}});function eZ(t){if(Math.abs(Math.abs(t.lat0)-F)<1e-10?t.mode=t.lat0<0?Kr.S_POLE:Kr.N_POLE:Math.abs(t.lat0)<1e-10?t.mode=Kr.EQUIT:(t.mode=Kr.OBLIQ,t.sinph0=Math.sin(t.lat0),t.cosph0=Math.cos(t.lat0)),t.pn1=t.h/t.a,t.pn1<=0||t.pn1>1e10)throw new Error("Invalid height");t.p=1+t.pn1,t.rp=1/t.p,t.h1=1/t.pn1,t.pfact=(t.p+1)*t.h1,t.es=0;var e=t.tilt,r=t.azi;t.cg=Math.cos(r),t.sg=Math.sin(r),t.cw=Math.cos(e),t.sw=Math.sin(e)}function lN(t,e){e.x-=t.long0;var r=Math.sin(e.y),n=Math.cos(e.y),i=Math.cos(e.x),o,s;switch(t.mode){case Kr.OBLIQ:s=t.sinph0*r+t.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=t.pn1/(t.p-s),o=s*n*Math.sin(e.x),t.mode){case Kr.OBLIQ:s*=t.cosph0*r-t.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*t.cg+o*t.sg,c=1/(a*t.sw*t.h1+t.cw),o=(o*t.cg-s*t.sg)*t.cw*c,s=a*c,e.x=o*t.a,e.y=s*t.a,e}function uN(t,e){e.x/=t.a,e.y/=t.a;var r=e.x,n=e.y,i,o,s;s=1/(t.pn1-e.y*t.sw),i=t.pn1*e.x*s,o=t.pn1*e.y*t.cw*s,e.x=i*t.cg+o*t.sg,e.y=o*t.cg-i*t.sg;var a=tr(e.x,e.y);if(Math.abs(a)<1e-10)r=0,n=t.lat0;else{var c,l;switch(l=1-a*a*t.pfact,l=(t.p-Math.sqrt(l))/(t.pn1/a+a/t.pn1),c=Math.sqrt(1-l*l),t.mode){case Kr.OBLIQ:n=Math.asin(c*t.sinph0+e.y*l*t.cosph0/a),e.y=(c-t.sinph0*Math.sin(n))*a,e.x*=l*t.cosph0;break;case Kr.EQUIT:n=Math.asin(e.y*l/a),e.y=c*a,e.x*=l;break;case Kr.N_POLE:n=Math.asin(c),e.y=-e.y;break;case Kr.S_POLE:n=-Math.asin(c);break}r=Math.atan2(e.x,e.y)}return e.x=r+t.long0,e.y=n,e}function fN(t,e={}){let r={...t,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,...e};return eZ(r),r}var Kr,hN=p(()=>{Ct();xc();Kr={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3}});var MS,dN=p(()=>{Ys();Zs();Ut();hN();Wt();MS={name:"tpers",aliases:["Tilted_Perspective"],parameters:["lon_0","x_0","y_0","lat_0","h","tilt","azi"],create(t){let e=Ae(t),r=re(t.parameters,"h",1e5),n=re(t.parameters,"tilt",0)*Math.PI/180,i=re(t.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=fN(e,{h:r,tilt:n,azi:i}),s=1+r/e.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",t,o,lN,uN,Qa(e,1/(1+r/e.a))),e,u,(h,d)=>l8(Gt(e,t),s,n,i,h,d),a)}}});function tZ(t){t.R=t.a}function mN(t,e){var r=e.x,n=e.y,i=G(r-t.long0,t.over),o,s;if(Math.abs(n)<=1e-10)return o=t.x0+t.R*i,s=t.y0,e.x=o,e.y=s,e;var a=pl(2*Math.abs(n/Math.PI));if(Math.abs(i)<=1e-10||Math.abs(Math.abs(n)-F)<=1e-10)return o=t.x0,n>=0?s=t.y0+Math.PI*t.R*Math.tan(.5*a):s=t.y0+Math.PI*t.R*-Math.tan(.5*a),e.x=o,e.y=s,e;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*t.R*(y-m)/(b-c*(d-y));i<0&&(w=-w),o=t.x0+w;var _=l+d;return w=Math.PI*t.R*(l*(2*d-1)+m)/(g*_+c*Math.sqrt((y+l)*(l+1)-_*_)),n>=0?s=t.y0+w:s=t.y0-w,e.x=o,e.y=s,e}function pN(t,e){var r,n,i,o,s,a,c,l,u,h,d,m,g;return e.x-=t.x0,e.y-=t.y0,Math.abs(e.y)<1e-10?(e.x=G(t.long0+e.x/t.R,t.over),e.y=0,e):(d=Math.PI*t.R,i=e.x/d,o=e.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,e.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=t.long0:r=G(t.long0+2*Math.PI*i/(Math.sqrt(1+2*(i*i-o*o)+s*s)+1-s),t.over),e.x=r,e.y=n,e)}function gN(t,e={}){let r={...t,R:0,...e};return tZ(r),r}var yN=p(()=>{_t();Ct();j1()});var vS,bN=p(()=>{Bt();tt();ut();Ut();yN();vS={name:"vandg",aliases:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=gN(e),n=Ie("vandg",t,r,mN,pN);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>OA(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function rZ(t){let e=[["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=e.find(c=>c.some(l=>TS(t,l)));if(!r)throw new Error("Oblique transformation requires a rotation parameter set");for(let c of r){if(!TS(t,c))throw new Error("Oblique transformation requires "+c);if(c.includes("lat")&&Math.abs(Qi(t,c))>Math.PI/2)throw new Error("Invalid rotation latitude: "+c)}if(r===e[0]){let c=Qi(t,"o_alpha"),l=Qi(t,"o_lon_c"),u=Qi(t,"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===e[1])return{lamp:Qi(t,"o_lon_p"),phip:Qi(t,"o_lat_p")};let n=Qi(t,"o_lon_1"),i=Qi(t,"o_lat_1"),o=Qi(t,"o_lon_2"),s=Qi(t,"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 K1(t){let e=t==="longlat";if(!e&&["obtran","geocent"].includes(ES(t.name)))throw new Error("Cannot wrap a composite or geocentric projection");return{name:"ob_tran",aliases:["General Oblique Transformation","General_Oblique_Transformation"],parameters:[...wN,"lon_0",...e?[]:t.parameters],flags:e?[]:t.flags,create(r){var R;let{parameters:n}=r,i=n.o_proj,o=e?["longlat","latlong","lonlat","latlon","identity"]:[t.name,...t.aliases||[]];if(i&&!o.map(ES).includes(ES(i)))throw new ai("missing-plugin","Oblique transformation dependency does not match +o_proj="+i);let{lamp:s,phip:a}=rZ(n),c=Math.cos(a),l=Math.sin(a),u=Math.abs(a)>1e-10,h=Qi(n,"lon_0"),d=TS(n,"over"),m={...n,proj:e?"longlat":i||t.name,lon_0:"0"};for(let E of wN)delete m[E];let g=e?gi(E=>{E.x*=180/Math.PI,E.y*=180/Math.PI},E=>{E.x*=Math.PI/180,E.y*=Math.PI/180}):t.create({...r,parameters:Object.freeze(m),primeMeridian:0}),y=Yo(g,!1),b=Yo(g,!0),w=E=>Math.asin(Math.max(-1,Math.min(1,E))),_=E=>{let j=E.x,I=E.y,O=Yt(j-h,d),A=Math.cos(O),W=Math.sin(I),k=Math.cos(I),T=Yt(Math.atan2(k*Math.sin(O),u?l*k*A+c*W:W)+s),C=w(u?l*W-c*k*A:-k*A);E.x=T,E.y=C},S=E=>{let j=E.x,I=E.y,O=j-s,A=Math.cos(O),W=Math.sin(I),k=Math.cos(I),T=Math.atan2(k*Math.sin(O),u?l*k*A-c*W:-W),C=w(u?l*W+c*k*A:k*A);E.x=Yt(T+h),E.y=C},M=gi(E=>{_(E),y(E)},E=>{b(E),S(E)}),v=e?Ya(m):(R=g.getRenderingProfile)==null?void 0:R.bind(g);if(!v)return M;let B=(E,j)=>{let I=j&&ur(()=>E.bounds,j,h,r.primeMeridian??0,d),O=zs(A=>{var D;let W=A.x,k=A.y;_(A);let T=A.x*180/Math.PI,C=A.y*180/Math.PI,N={x:T,y:C,z:A.z};if((D=E.normalize)==null||D.call(E,N),N.x===T&&N.y===C){A.x=W,A.y=k;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=E.bounds,W=k=>[k[0]*180/Math.PI,k[1]*180/Math.PI,k[2]];return e?[W(A[0]),W(A[1])]:A},normalize(A){I==null||I.normalize(A),O(A)}}};return{...M,longitudeOrigin:h,getRenderingProfile(E){if(!E)return B(v());let j=js(E,r.primeMeridian??0,h),I=Q(j[0][0]-h,j[0][1],j[1][0]-h,j[1][1]),O=dt(u?[-c,0,l]:[-1,0,0],I),A=u?[l,0,c]:[0,0,1],k=dt(A,I)[0]>0?Xs([0,1,0],A,0,I).map(Math.atan):[-Math.PI,Math.PI];return B(v(kn(Q(k[0]+s,w(O[0]),k[1]+s,w(O[1])))),E)}}}}}var wN,ES,TS,Qi,xN=p(()=>{bc();ud();Wt();yc();Xa();ut();tt();Sc();wN=["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"],ES=t=>t.toLowerCase().replace(/[ _-]/g,""),TS=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Qi=(t,e)=>re(t,e,0)*Math.PI/180});function Rt(t){if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Expected a CRS object");return t}function yd(t){return Array.isArray(t)?t:[]}function Xr(t){return String(t||"").toLowerCase().replace(/[^a-z0-9]/g,"")}function Or(t){if(typeof t!="number"||!Number.isFinite(t))throw new Error("Expected a finite CRS parameter");return t}function Bn(t,e){if(t===void 0)return e;if(typeof t=="object"){let i=Or(Rt(t).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(t)];return n||je("Unsupported CRS unit: "+String(t)),n}function bl(t,e){var E,j,I;let r=String(t.type),n=aZ(t.bbox);if(r==="CompoundCRS"){e.mode!=="horizontal"&&je("CompoundCRS requires explicit horizontal extraction");let O=yd(t.components).map(Rt).filter(W=>["ProjectedCRS","GeographicCRS","GeodeticCRS","BoundCRS"].includes(String(W.type)));if(O.length!==1)throw new Error("CompoundCRS requires exactly one horizontal component");let A=bl(O[0],e);return{...A,areaOfUse:n??A.areaOfUse,lossy:!0}}if(r==="BoundCRS"){let O=bl(Rt(t.source_crs),e),A=bl(Rt(t.target_crs),e);(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))&&je("BoundCRS requires a WGS84 target");let W=Rt(t.transformation),k=Xr(Rt(W.method).name),T=k==="geocentrictranslations"||/^geocentrictranslationsgeog[23]ddomain$/.test(k),C=/^positionvector(?:transformation)?(?:geog[23]ddomain|geocentricdomain)?$/.test(k),N=/^coordinateframe(?:rotation)?(?:geog[23]ddomain|geocentricdomain)?$/.test(k);!T&&!C&&!N&&je("Unsupported BoundCRS transformation: "+k);let D=["xaxistranslation","yaxistranslation","zaxistranslation","xaxisrotation","yaxisrotation","zaxisrotation","scaledifference"],L=new Array(T?3:7).fill(void 0);for(let z of yd(W.parameters)){let we=Rt(z),_e=D.indexOf(Xr(we.name));(_e<0||_e>=L.length||L[_e]!==void 0)&&je("Unsupported or duplicate Helmert parameter: "+String(we.name));let ne=_e<3?1:_e<6?At/3600:1e-6;L[_e]=Or(we.value)*Bn(we.unit,ne)/ne*(N&&_e>=3&&_e<6?-1:1)}if(L.some(z=>z===void 0))throw new Error("Incomplete BoundCRS Helmert transformation");let P={...O.parameters,towgs84:L.join(",")};return delete P.datum,{...O,parameters:P,areaOfUse:n??O.areaOfUse}}["ProjectedCRS","GeographicCRS","GeodeticCRS"].includes(r)||je("Unsupported CRS type: "+r);let i=r==="ProjectedCRS"?Rt(t.base_crs):t,o=Rt(i.datum||i.datum_ensemble);(o.type==="DynamicGeodeticReferenceFrame"||o.frame_reference_epoch!==void 0||t.coordinate_epoch!==void 0)&&je("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=Ku(e),u=String(o.name||""),h=Xr(u),d=Object.keys(l),m=d.find(O=>ml(O)===ml(u)),g=m?[m]:d.filter(O=>Xr(O)===h||Xr(O)===h.replace(/^d/,"")),y=g[0],b=l[y];if(b&&g.some(O=>{let A=l[O];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&&ml(y)==="wgs84"&&(c.datum="WGS84"),y&&["nad83","northamericandatum1983"].includes(ml(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 O=Rt(i.id),A=String(O.authority)+"_"+String(O.code);Object.prototype.hasOwnProperty.call(l,A)&&(c.datum=A)}o.towgs84!==void 0&&(c.towgs84=yd(o.towgs84).map(Or).join(","),delete c.datum);let w=t.coordinate_system?Rt(t.coordinate_system):{},_=yd(w.axis).map(Rt),S=Xr(w.subtype)==="cartesian"&&r==="GeodeticCRS";r!=="ProjectedCRS"&&!S&&w.subtype&&Xr(w.subtype)!=="ellipsoidal"&&je("Unsupported coordinate system subtype"),S&&(c.proj="geocent");let M=Bn(i.angular_unit,At),v=Bn((E=_[0])==null?void 0:E.unit,r==="ProjectedCRS"||S?1:M);_[1]&&Bn(_[1].unit,v)!==v&&je("Mixed horizontal axis units are not supported"),S&&_[2]&&Bn(_[2].unit,v)!==v&&je("Mixed geocentric axis units are not supported");let B=i.prime_meridian||o.prime_meridian;if(B){let O=Rt(B);c.pm=String(Or(O.longitude)*Bn(O.unit,M)/At)}if(r==="ProjectedCRS"){let O=Rt(t.conversion),A=Xr(Rt(O.method).name),W=yd(O.parameters).map(Rt),k=A==="stereographicnorthpole"&&!W.some(D=>Xr(D.name).startsWith("scalefactor")),T=k?"stere":nZ[A],C=W.filter(D=>["xscale","yscale","xyplanerotation"].includes(Xr(D.name)));if(C.length){let D={xscale:-1,yscale:1,xyplanerotation:90};(T!=="krovak"||C.length!==3||new Set(C.map(L=>Xr(L.name))).size!==3||C.some(L=>{let P=Xr(L.name),z=P==="xyplanerotation"?Bn(L.unit,M)/At:Bn(L.unit,1);return Math.abs(Or(L.value)*z-D[P])>1e-10}))&&je("Unsupported ESRI Krovak axis adjustment")}(!T||T.startsWith("unsupported"))&&je("Unsupported projection method: "+String(Rt(O.method).name)),c.proj=T==="webmerc"?"merc":T;let N=!1;for(let D of W){let L=Xr(D.name);if(C.includes(D)||L==="auxiliaryspheretype"&&T==="webmerc"&&D.value===0)continue;if(L==="semiminor"&&T==="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)&&je("Pseudo-Mercator semi_minor must equal the semi-major axis");continue}let P=((j=oZ[T])==null?void 0:j[L])||iZ[L];if(P||je("Unsupported conversion parameter: "+String(D.name)),P==="lat_1"&&A==="stereographicnorthpole"&&!k?P="lat_0":P==="lat_1"&&["merc","webmerc","eqc","stere","cea"].includes(T)&&(P="lat_ts"),c[P]!==void 0)throw new Error("Duplicate conversion parameter: "+P);if(["merc","webmerc"].includes(T)&&P==="lat_0"&&D.value===0)continue;let z=P.startsWith("lat")||P.startsWith("lon")||P==="alpha"||P==="gamma",we=P==="x_0"||P==="y_0",_e=Or(D.value)*Bn(D.unit,z?M:we?v:1)/(z?At:1);P.startsWith("lat")&&Math.abs(Math.abs(_e)-90)<=4*Number.EPSILON*90&&(_e=Math.sign(_e)*90),c[P]=String(_e)}if(T==="omerc"&&["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(A)&&(c.no_uoff=void 0),T==="omerc"&&c.lon_0!==void 0&&c.lonc!==void 0&&(Math.abs(Number(c.lon_0)-Number(c.lonc))>1e-10&&je("Oblique Mercator central meridian conflicts with projection centre"),delete c.lon_0),A==="stereographicnorthpole"&&Math.abs(Number(c.lat_0))===90&&(c.proj="stere"),T==="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}T==="stere"&&(A.includes("polar")||A==="stereographicsouthpole"||k)&&c.lat_0===void 0&&(c.lat_0=Number(c.lat_ts||90)<0?"-90":"90"),T==="webmerc"&&(c.b=c.a,delete c.rf,c.nadgrids="@null")}let R=_.map(O=>cZ(O,c,r==="ProjectedCRS")).join("");return R.length===2&&(R+="u"),!S&&/[ud]/.test(R.slice(0,2))&&je("Structured CRS vertical-first axes require an explicit PROJ axis definition"),R&&(c.axis=R),(r==="ProjectedCRS"||S)&&(c.to_meter=String(v)),{parameters:c,areaOfUse:n,angularUnit:r==="ProjectedCRS"||S?M:v,verticalUnit:S?1:Bn((I=_[2])==null?void 0:I.unit,1)}}function aZ(t){let e;if(t!==void 0){let r=Rt(t),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");e=[n,i,o,s]}return e}function cZ(t,e,r){var a;let n=String(t.direction),i=t.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(e.lat_0),l=c===90;(!r||e.proj!=="stere"||Math.abs(c)!==90||Xr(n)!==(l?"south":"north"))&&je("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(e.lon_0||0))/90);Math.abs(d-Math.round(d))>1e-12&&je("Non-cardinal axis meridians require an orientation operation");let m=(Math.round(d)%4+4)%4;return(l?"senw":"nesw")[m]}let s=sZ[Xr(n)];return s||je("Unsupported axis direction: "+n),s}var nZ,iZ,oZ,sZ,AS=p(()=>{A1();Wt();Xa();nZ={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"},iZ={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"},oZ={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"}},sZ={east:"e",west:"w",north:"n",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"}});function X1(t,...e){return t.values.filter(r=>r.type==="node"&&e.includes(r.keyword.toUpperCase()))}function vt(t,...e){return X1(t,...e)[0]}function wt(t,e=0){let r=t.values[e];return r&&r.type!=="node"?r.value:void 0}function wl(t){return t?{name:wt(t),conversion_factor:wt(t,1)}:void 0}function lZ(t,e){let r=wt(t,1);if(e&&String(r).toLowerCase()==="unknown"){let n=String(wt(t)).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 uZ(t){let e=vt(t,"MERIDIAN");if(e)return{longitude:{value:wt(e),unit:wl(vt(e,"ANGLEUNIT"))}}}function _N(t){let e=vt(t,"METHOD","PROJECTION");if(!e)throw new Error("WKT conversion requires a METHOD or PROJECTION");return vt(t,"PARAMETERFILE")&&je("Grid-based WKT operation is not implemented"),{method:{name:wt(e)},parameters:X1(t,"PARAMETER").map(r=>({name:wt(r),value:wt(r,1),unit:wl(vt(r,"ANGLEUNIT","LENGTHUNIT","SCALEUNIT"))}))}}function bd(t){let e=t.keyword.toUpperCase();if(e==="COMPD_CS"||e==="COMPOUNDCRS")return{type:"CompoundCRS",components:X1(t,"PROJCS","PROJCRS","GEOGCS","GEOGCRS","GEODCRS","BOUNDCRS","VERT_CS","VERTCRS").map(bd)};if(e==="BOUNDCRS"){let d=vt(t,"SOURCECRS"),m=vt(t,"TARGETCRS"),g=vt(t,"ABRIDGEDTRANSFORMATION");if(!d||!m||!g)throw new Error("Incomplete WKT BoundCRS");let y=_=>{let S=_.values.find(M=>M.type==="node");if(!S)throw new Error("Missing bound CRS component");return S},b=_N(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:bd(y(d)),target_crs:bd(y(m)),transformation:b}}if(["VERT_CS","VERTCRS"].includes(e))return{type:"VerticalCRS"};let r=["PROJCS","PROJCRS","PROJECTEDCRS"].includes(e),n=["GEOGCS","GEOGCRS","GEODCRS","GEODETICCRS","GEOGRAPHICCRS","BASEGEOGCRS","BASEGEODCRS","GEOCCS"].includes(e);!r&&!n&&je("Unsupported WKT CRS: "+e),vt(t,"DYNAMIC","DERIVINGCONVERSION","VELOCITYGRID","EXTENSION")&&je("Unsupported WKT dynamic/extension operation");let i=vt(t,"CS"),o=e==="GEOCCS"||String(wt(i||t)).toLowerCase()==="cartesian"&&!r,s=vt(t,r||o?"LENGTHUNIT":"ANGLEUNIT","UNIT"),a=X1(t,"AXIS").sort((d,m)=>Number(wt(vt(d,"ORDER")||d))-Number(wt(vt(m,"ORDER")||m))).map((d,m)=>({name:wt(d),direction:e==="GEOCCS"?["geocentricX","geocentricY","geocentricZ"][m]:lZ(d,r),unit:wl(vt(d,"ANGLEUNIT","LENGTHUNIT")||(!o&&!r&&/^(up|down)$/i.test(String(wt(d,1)))?void 0:s)),meridian:uZ(d)}));if(!a.length)for(let d of o?["geocentricX","geocentricY","geocentricZ"]:["east","north"])a.push({name:d,direction:d,unit:wl(s),meridian:void 0});let c=e==="GEOGCS"?void 0:vt(t,"ID"),l={type:r?"ProjectedCRS":o?"GeodeticCRS":"GeographicCRS",name:wt(t),id:c?{authority:wt(c),code:wt(c,1)}:void 0,coordinate_system:{subtype:r||o?"Cartesian":"ellipsoidal",axis:a}},u=vt(t,"USAGE"),h=vt(u||t,"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(t,"GEOGCS","BASEGEOGCRS","BASEGEODCRS","GEODCRS","GEOGCRS");if(!d)throw new Error("Projected WKT requires a base geographic CRS");l.base_crs=bd(d),l.conversion=_N(vt(t,"CONVERSION")||t)}else{let d=vt(t,"DATUM","GEODETICDATUM","ENSEMBLE");if(!d)throw new Error("WKT requires a geodetic datum");vt(d,"EXTENSION","DYNAMIC")&&je("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:wl(vt(m,"LENGTHUNIT"))},towgs84:g==null?void 0:g.values.map((b,w)=>wt(g,w))};let y=vt(t,"PRIMEM");y&&(l.prime_meridian={name:wt(y),longitude:wt(y,1),unit:wl(vt(y,"ANGLEUNIT")||(o?void 0:s))}),l.angular_unit=o?void 0:wl(s)}return l}var IS,SN=p(()=>{Hl();Qy();Xa();AS();IS={name:"wkt",canParse:t=>wr(t)==="wkt",parse(t,e){if(typeof t!="string")throw new Error("Expected serialized WKT");return bl(bd(kf(t).root),e)}}});var PS,MN=p(()=>{Hl();AS();PS={name:"projjson",canParse:t=>wr(t)==="projjson",parse:(t,e)=>bl(Rt(t),e)}});var eAe,tAe,rAe,vN=p(()=>{eAe=new Float64Array(0),tAe=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,rAe={deg:Math.PI/180,rad:1,m:1,ft:.3048,"us-ft":1200/3937}});var RS=p(()=>{uB();fB();hB();yB();SB();AB();OB();g8();zB();YB();V2();o8();ZB();lC();dC();bC();vC();LC();NC();qC();JC();oD();uD();pD();_D();TD();LD();ND();qD();KD();rN();nN();cN();dN();bN();xN();SN();MN();vN()});var Y1,EN,TN=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 t in Y1){let e=Y1[t];e.datumName&&(Y1[e.datumName]=e)}EN=Y1});var AN,IN=p(()=>{TN();AN=Object.freeze({name:"regional-datums",datums:Object.freeze(EN)})});function fZ(t){return{...t,parse(e,r){let n=t.parse(e,r),i=n.parameters.datum,o=s=>s.toLowerCase().replace(/[\s_-]/g,"");if(i&&!Object.keys(Ku(r)).some(s=>o(s)===o(i))){let s={...n.parameters};return delete s.datum,{...n,parameters:s}}return n}}}function dZ(){if(Z1)return Z1;let t=[O_,B_,C_,N_,F_,j_,K2,z_,$_,z2,q2,W2,H_,X_,Q_,eS,rS,oS,sS,aS,cS,fS,hS,dS,mS,pS,gS,yS,bS,wS,xS,_S,SS,MS,vS],e=i=>i.toLowerCase().replace(/[\s_-]/g,""),r=K1("longlat"),n={name:r.name,aliases:r.aliases,parameters:[...new Set([...r.parameters,...t.flatMap(i=>i.parameters)])],flags:[...new Set(t.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(e(o))?"longlat":t.find(l=>[l.name,...l.aliases||[]].some(u=>e(u)===e(o)));if(!s)throw new Error("Unknown oblique transformation projection: "+o);let a=K1(s),c=new Set([...I1,...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 Z1=[...t,n],Z1}var hZ,Z1,af,mZ,PN=p(()=>{lB();IN();A1();RS();Xu();hZ=[IS,PS].map(fZ);af=class extends F1{constructor(e={}){super({...e,projections:e.projections??dZ(),parsers:e.parsers??hZ,datumCatalogs:e.datumCatalogs??[AN]}),this.useDefinitionSignature=!dd(e)}},mZ=new af});var RN=p(()=>{RS();PN()});function LN(){return gZ}function ON(t){return pZ.get(t)}var pZ,gZ,BN=p(()=>{"use strict";RN();pZ=new Map,gZ=new af});function yZ(t,e,r){let n=[];for(let i=0;i<3;i++){let o=e.slice(),s=e.slice();o[i]+=r,s[i]-=r;let a=t.transformPosition(o),c=t.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 bZ(t,e){let[r,n,i]=t,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?e:[[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]*e[0]+a[1]*e[1]+a[2]*e[2])/o)}function wd(t){if(!t)throw new Error("Cannot construct a projection because the CRS is unknown");if(typeof t!="string"&&t.type==="CompoundCRS"){let e=t.components.filter(r=>r.type!=="VerticalCRS");if(e.length!==1)throw new Error("CompoundCRS requires exactly one horizontal component");return wd(e[0])}return t}function wZ(t){if(t.outputCoordinates==="local-enu")throw new Error("local-enu output requires a dataset-derived local origin and must be created by a tileset source");if(t.outputCoordinates==="target-crs"&&!t.targetCrs)throw new Error("target-crs output requires targetCrs");if(!t.sourceCrs&&t.status==="unresolved")throw new Error("Cannot transform coordinates because the source CRS is unknown");if(cf(t)&&t.heightReference==="unknown")throw new Error("Cannot convert heights because the source height reference is unknown");if(t.coordinateFrame==="geocentric"&&!LS(t.sourceCrs))throw new Error("Only EPSG:4978 geocentric coordinates are supported by the current spatial transformer");if(t.status==="unresolved")throw new Error("The requested spatial output cannot be resolved from the available metadata")}function LS(t){return typeof t=="string"&&sd(t)===S1}function CN(t){if(typeof t!="string")return!1;let e=sd(t);return e===Hu||e==="EPSG:4979"||e==="OGC:CRS84"}function cf(t){let e=t.targetHeightReference;return e!=="native"&&e!==t.heightReference}function xZ(t){return typeof t=="string"?ON(t):t}function _Z(t,e,r,n){if(r===n||n==="native")return t;if(r==="orthometric"&&n==="ellipsoidal")return t+e;if(r==="ellipsoidal"&&n==="orthometric")return t-e;throw new Error(`Unsupported height conversion from ${r} to ${n}`)}var xl,OS=p(()=>{"use strict";Fn();Qf();dO();BN();d_();m_();xl=class{spatialReference;horizontalProjection;horizontalProjectionBuffer;geographicProjection;heightOutputProjection;sourceIsGeocentric;outputIsGeocentric;sourceIsGeographic;outputIsGeographic;geoid;constructor(e,r={}){this.spatialReference=e;let n=LN();wZ(e);let i=e.targetCrs||e.sourceCrs;if(this.sourceIsGeocentric=LS(e.sourceCrs),this.outputIsGeocentric=LS(i),this.sourceIsGeographic=CN(e.sourceCrs),this.outputIsGeographic=CN(i),e.sourceCrs&&e.targetCrs&&!this.sourceIsGeocentric&&!this.outputIsGeocentric&&(this.horizontalProjection=n.createProjection({from:wd(e.sourceCrs),to:wd(e.targetCrs),enforceAxis:!1}),cf(e)||(this.horizontalProjectionBuffer=new E1({projection:this.horizontalProjection,dimension:3}))),(cf(e)||this.sourceIsGeocentric||this.outputIsGeocentric)&&(!this.sourceIsGeographic&&!this.sourceIsGeocentric&&(this.geographicProjection=n.createProjection({from:wd(e.sourceCrs),to:Hu,enforceAxis:!1})),!this.outputIsGeographic&&!this.outputIsGeocentric&&(this.heightOutputProjection=n.createProjection({from:Hu,to:wd(i),enforceAxis:!1}))),cf(e)&&(this.geoid=xZ(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(e){if(e.length<2)throw new Error("A spatial coordinate must contain at least x and y components");let r=[...e];if(cf(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(cf(this.spatialReference)){let o=this.geoid.getHeight(n[1],n[0]);n[2]=_Z(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(e){if(e.length%3!==0)throw new Error("Packed spatial positions must contain a multiple of three components");let r=new Float64Array(e.length);if(this.horizontalProjectionBuffer&&(r.set(e),r.every(Number.isFinite)))return this.horizontalProjectionBuffer.projectFlatTo(r,r);for(let n=0;n<e.length;n+=3){let i=this.transformPosition([Number(e[n]),Number(e[n+1]),Number(e[n+2])]);r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2]}return r}transformNormals(e,r){if(e.length!==r.length||e.length%3!==0)throw new Error("Spatial normals and positions must have matching xyz component counts");let n=new Float32Array(e.length),i=1e-5;for(let o=0;o<e.length;o+=3){let s=[Number(r[o]),Number(r[o+1]),Number(r[o+2])],a=[Number(e[o]),Number(e[o+1]),Number(e[o+2])],c=yZ(this,s,i),l=bZ(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(e){return this.sourceIsGeocentric?Array.from(Tt.WGS84.cartesianToCartographic(new J(e))):this.sourceIsGeographic?e.slice(0,3):this.geographicProjection.projectSync(e.slice(0,3))}fromGeographic(e){return this.outputIsGeocentric?Array.from(Tt.WGS84.cartographicToCartesian(new J(e))):this.outputIsGeographic?e.slice(0,3):this.heightOutputProjection.projectSync(e.slice(0,3))}}});function SZ(t,e){return t==="relativeToScene"?e.sceneElevationProvider:lf(t)?e.terrainElevationProvider:void 0}function lf(t){return t==="onTheGround"||t==="relativeToGround"||t==="relativeToScene"}function BS(t){if(t.length%3!==0)throw new Error("I3S position arrays must contain complete XYZ tuples");let e=[];for(let r=0;r<t.length;r+=3)e.push([t[r],t[r+1],t[r+2]]);return e}function MZ(t){let e=tc(t);return{west:e[0]*180/Math.PI,south:e[1]*180/Math.PI,east:e[2]*180/Math.PI,north:e[3]*180/Math.PI}}function DN(t){if(!t.length)throw new Error("I3S spatial transformation requires at least one bound sample");let e=t.map(o=>Tt.WGS84.cartographicToCartesian(new J(o))),r=new J;for(let o of e)r.add(o);r.scale(1/e.length);let n=0;for(let o of e)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 NN(t,e,r,n){let i=t.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 zf().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(e==="geographic"){let d=r.transformPosition(c),m=Tt.WGS84.cartographicToCartesian(new J(d)),g=t.normalReferenceFrame==="vertex-reference-frame"?h.map(y=>GN(y,d)):h;return FN().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 FN().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=t.mbs?Array.from(t.mbs):[];if(o.length<4)return[];let s=o.slice(0,3);s[2]*=n;let a=o[3];if(e==="geographic"){let c=r.transformPosition(s),l=Tt.WGS84.cartographicToCartesian(new J(c));return kN().map(u=>Array.from(Tt.WGS84.cartesianToCartographic(new J(l).add(new J(u).scale(a)))))}return kN().map(c=>Array.from(new J(s).add(new J(c).scale(a))))}function FN(){return[-1,1].flatMap(t=>[-1,1].flatMap(e=>[-1,1].map(r=>[t,e,r])))}function kN(){return[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]]}function vZ(){return[new J([1,0,0]),new J([0,1,0]),new J([0,0,1])]}function GN(t,e){let r=e[0]*Math.PI/180,n=e[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(t[0]).add(o.scale(t[1])).add(s.scale(t[2]))}function EZ(t,e){let r=e[0]*Math.PI/180,n=e[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(t),o.dot(t),s.dot(t)])}function _l(t){let e=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(let o of t)for(let s=0;s<3;s++)e[s]=Math.min(e[s],o[s]),r[s]=Math.max(r[s],o[s]);let n=e.map((o,s)=>(o+r[s])/2),i=e.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 tc(t){let e=t[0][0],r=1/0,n=-1/0,i=1/0,o=-1/0,s=1/0,a=-1/0;for(let c of t){let l=e+CS(c[0]-e);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[CS(r)*Math.PI/180,i*Math.PI/180,CS(n)*Math.PI/180,o*Math.PI/180,s,a]}function CS(t){return((t+180)%360+360)%360-180}var xd,UN=p(()=>{"use strict";Fn();Qf();OS();cO();uO();xd=class{spatialReference;targetCoordinateFrame;positionTransformer;sourceToGeographicTransformer;geographicToTargetTransformer;sourceCoordinateFrame;sourceVerticalUnitScale;elevationMode;elevationOffset;elevationProvider;providerUnitScale;providerHeightTransformer;constructor(e,r={}){var a;if(e.status!=="transformable"&&e.status!=="transformed")throw new Error("I3SSpatialTransformer requires a requested, transformable spatial output");let n=e.targetCrs||e.sourceCrs;if(!n)throw new Error("I3S spatial transformation requires a target CRS");if(this.positionTransformer=new xl(e,r),this.sourceCoordinateFrame=e.coordinateFrame,this.sourceVerticalUnitScale=e.verticalUnitScale,this.elevationMode=e.elevationMode,this.elevationOffset=(e.elevationOffset||0)*e.elevationUnitScale,this.elevationProvider=SZ(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=lO(((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=Bo(n),this.spatialReference=aO(e);let o=M1({sourceCrs:e.sourceCrs,heightReference:e.heightReference,coordinateFrame:e.coordinateFrame,axisOrder:e.axisOrder,provenance:e.provenance},{targetCrs:"EPSG:4326"});if(this.sourceToGeographicTransformer=new xl(o),lf(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(e.heightReference==="unknown")throw new Error(`I3S elevation mode ${this.elevationMode} requires a known source height reference`);let c=this.elevationProvider.heightReference||e.heightReference;if(c!==e.heightReference){if(e.heightReference!=="ellipsoidal"&&e.heightReference!=="orthometric")throw new Error("Converting elevation-provider heights requires an ellipsoidal or orthometric source height reference");let l=M1({sourceCrs:"EPSG:4326",heightReference:c,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"caller-override"},{targetCrs:"EPSG:4326",targetHeightReference:e.heightReference,geoidModel:r.geoidModel});this.providerHeightTransformer=new xl(l,r)}}let s=M1({sourceCrs:"EPSG:4326",heightReference:e.heightReference,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"format-default"},{targetCrs:n,targetHeightReference:e.targetHeightReference,geoidModel:r.geoidModel});this.geographicToTargetTransformer=new xl(s,r)}transformPosition(e){let r=this.placeSourcePositionsSync(e),n=this.positionTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}async transformPositionAsync(e){let r=await this.placeSourcePositions(e),n=this.positionTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}transformPlacedPosition(e){let r=this.positionTransformer.transformPosition([e[0],e[1],e[2]]);return[r[0],r[1],r[2]]}transformSourcePositionToGeographic(e){let r=this.placeSourcePositionsSync(e),n=this.sourceToGeographicTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}async transformSourcePositionToGeographicAsync(e){let r=await this.placeSourcePositions(e),n=this.sourceToGeographicTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}transformPositions(e,r){let n=this.placeSourcePositionsSync(e),i=this.placeSourcePositionsSync(r);return this.transformPlacedPositions(n,i)}async transformPositionsAsync(e,r){let n=new Float64Array(e.length+3);n.set(Array.from(e),0),n.set(Array.from(r).slice(0,3),e.length);let i=await this.placeSourcePositions(n);return this.transformPlacedPositions(i.subarray(0,e.length),i.subarray(e.length))}async transformGeometryAsync(e,r,n="earth-centered"){if(e.length%3||r&&r.length!==e.length)throw new Error("Conversion positions and normals must contain matching finite xyz triples");for(let o=0;o<e.length;o++)if(!Number.isFinite(e[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(e);return{positions:this.positionTransformer.transformPositions(i),normals:r?this.transformNormals(r,i,n):void 0}}transformPlacedPositions(e,r){let n=this.transformPlacedPosition(r),i=new Float32Array(e.length),o=Float64Array.from(e);for(let c=0;c<e.length;c+=3){let l=this.transformPlacedPosition([e[c],e[c+1],e[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(e,r,n="earth-centered"){if(e.length!==r.length||e.length%3)throw new Error("I3S normals and positions must have matching xyz component counts");let i=new Float32Array(e.length);if(n==="earth-centered"&&(this.spatialReference.targetCrs||this.spatialReference.sourceCrs)==="EPSG:4978"){for(let o=0;o<e.length;o+=3){let s=Math.hypot(e[o],e[o+1],e[o+2]);for(let a=0;a<3;a++)i[o+a]=s?e[o+a]/s:e[o+a]}return i}for(let o=0;o<e.length;o+=3){let s=this.sourceToGeographicTransformer.transformPosition([r[o],r[o+1],r[o+2]]),a=new J([e[o],e[o+1],e[o+2]]).normalize(),c=n==="earth-centered"?a:GN(a,s),l=this.transformEcefNormal(c,s);i.set(l,o)}return i}transformBoundingVolume(e){let n=this.getGeographicBoundSamples(e).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:tc(n)}:{box:_l(n)}}async transformBoundingVolumeAsync(e){let n=(await this.getGeographicBoundSamplesAsync(e)).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:tc(n)}:{box:_l(n)}}transformBoundingVolumeToGeographic(e){return{region:tc(this.getGeographicBoundSamples(e))}}async transformBoundingVolumeToGeographicAsync(e){return{region:tc(await this.getGeographicBoundSamplesAsync(e))}}transformBoundingVolumeToGeocentric(e){let r=this.getGeographicBoundSamples(e).map(n=>Array.from(Tt.WGS84.cartographicToCartesian(new J(n))));return{box:_l(r)}}async transformBoundingVolumeToGeocentricAsync(e){let r=(await this.getGeographicBoundSamplesAsync(e)).map(n=>Array.from(Tt.WGS84.cartographicToCartesian(new J(n))));return{box:_l(r)}}transformBoundingSphereToGeographic(e){var s,a;let r=(s=e.mbs)!=null&&s.length?Array.from(e.mbs).slice(0,3):e.obb?Array.from(e.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=e.mbs)!=null&&a.length?e.mbs[3]:Math.hypot(...Array.from(e.obb.halfSize).slice(0,3));return[i[0],i[1],i[2],o]}async transformBoundingSphereToGeographicAsync(e){return DN(await this.getGeographicBoundSamplesAsync(e))}async transformBoundsAsync(e){let r=await this.getGeographicBoundSamplesAsync(e),n=r.map(o=>Array.from(Tt.WGS84.cartographicToCartesian(new J(o)))),i=r.map(o=>this.geographicToTargetTransformer.transformPosition(o));return{boundingVolume:{box:_l(n)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:tc(i)}:{box:_l(i)},i3sLodMbs:lf(this.elevationMode)?DN(r):this.transformBoundingSphereToGeographic(e)}}async transformPointCloudBoundsAsync(e){let r=await this.getGeographicBoundSamplesAsync(e),n=r.map(i=>this.geographicToTargetTransformer.transformPosition(i));return{boundingVolume:{region:tc(r)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:tc(n)}:{box:_l(n)}}}getGeographicBoundSamples(e){let r=NN(e,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=BS(n);return this.sourceCoordinateFrame==="geographic"?i:i.map(o=>this.sourceToGeographicTransformer.transformPosition(o))}async getGeographicBoundSamplesAsync(e){let r=NN(e,this.sourceCoordinateFrame,this.sourceToGeographicTransformer,this.sourceVerticalUnitScale);if(!r.length)throw new Error("I3S spatial transformation requires an MBS or OBB bound");if(lf(this.elevationMode)){let i=this.sourceCoordinateFrame==="geographic"?r:r.map(o=>this.sourceToGeographicTransformer.transformPosition(o));return await this.placeGeographicBoundSamples(i)}let n=BS(await this.placeSourcePositions(r.flat(),!0));return this.sourceCoordinateFrame==="geographic"?n:n.map(i=>this.sourceToGeographicTransformer.transformPosition(i))}async placeGeographicBoundSamples(e){let n=await this.elevationProvider.getElevationRange(MZ(e)),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=e.map(u=>u[2]),a=Math.min(...s),c=Math.max(...s),l=[];for(let[u,h]of e){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(e,r=!1){if(lf(this.elevationMode))throw new Error(`I3S elevation mode ${this.elevationMode} requires asynchronous surface placement`);let n=Float64Array.from(e),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(e,r=!1){if(!lf(this.elevationMode))return this.placeSourcePositionsSync(e,r);let n=Float64Array.from(e),i=BS(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(e,r){if(this.targetCoordinateFrame==="geocentric")return e.normalize();if(this.targetCoordinateFrame==="geographic")return EZ(e,r).normalize();let n=Tt.WGS84.cartographicToCartesian(new J(r)),i=[];for(let s of vZ()){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 pc(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(e).transformByMatrix3(o).normalize()}}});var jN=p(()=>{"use strict";OS();UN()});function zN(t,e=null){return DS(t,e?{token:e}:void 0)}function DS(t,e){if(!e||Object.keys(e).length===0||/^(?:data|blob):/i.test(t))return t;let r=t.indexOf("#"),n=r>=0?t.slice(r):"",i=r>=0?t.slice(0,r):t,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(e))c.has(h)||l.set(h,String(d));let u=l.toString();return`${s}${o>=0?`?${a}`:""}${u?`${o>=0?"&":"?"}${u}`:""}${n}`}var qN=p(()=>{"use strict"});function NS(t){switch(t){case"UInt8":return Uint8Array;case"UInt16":return Uint16Array;case"UInt32":return Uint32Array;case"Float32":return Float32Array;case"UInt64":return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${t}`)}}function uf(t){switch(t){case"UInt8":return 1;case"UInt16":case"Int16":return 2;case"UInt32":case"Int32":case"Float32":return 4;case"UInt64":case"Int64":case"Float64":return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${t}`)}}var VN,J1,FS=p(()=>{"use strict";PA();VN={UInt8:Gs.UNSIGNED_BYTE,UInt16:Gs.UNSIGNED_SHORT,Float32:Gs.FLOAT,UInt32:Gs.UNSIGNED_INT,UInt64:Gs.DOUBLE};J1={DEFAULT:"default",LNGLAT:"lnglat",METER_OFFSETS:"meter-offsets",LNGLAT_OFFSETS:"lnglat-offsets",CARTESIAN:"cartesian"}});function GS(t,e){if(!t)throw new Error(`parseI3STileContent requires LoaderContext to ${e}. Nested I3S parsing must run through parseFromContext().`);return t}function TZ(t){switch(t){case"ktx-etc2":case"dds":return Qo;case"ktx2":return go;default:return Jo}}async function XN(t,e,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:e.layerType==="Point"?"point-list":"triangle-list",pointRenderer:e.pointRenderer,pointSymbol:e.pointSymbol},a=i?GS(i,"parse nested resources"):null,c=(d=e.textureUrls)!=null&&d.length?e.textureUrls:e.textureUrl?[{textureSetDefinitionId:WZ(e.materialDefinition),textureUrl:e.textureUrl,textureFormat:e.textureFormat||"jpg"}]:[],l={};for(let m of c)try{let g=await IZ(m.textureUrl,m.textureFormat,e,n,a||i);g&&(l[m.textureSetDefinitionId]=g)}catch(g){Li(n).warn(String(g))()}let u=Object.values(l)[0]||null;return s.texture=u,Object.keys(l).length>0&&(s.textures=l),s.material=zZ(e.materialDefinition,l,u),s.material&&(s.texture=null),await PZ(t,s,e,r,n,i)}async function IZ(t,e,r,n,i){var m;let o=n==null?void 0:n.i3s,s=DS(zN(t,o==null?void 0:o.token),n==null?void 0:n.searchParams),a=TZ(e),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=GS(i,"decode texture payloads");if(a===Jo){let g={...r.textureLoaderOptions};try{let y=await Ul(u,Jo,g,h);return yp(y)}catch{let b=await Ul(u,a,g,h);return yp(b)}}let d=await Ul(u,a,r.textureLoaderOptions,h);return a===go&&(d=d[0]),{compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}async function PZ(t,e,r,n,i,o){var m,g,y,b,w,_;let s=t.byteLength,a,c,l=0,u=0,h;if(r.isDracoGeometry){let S=GS(o,"decode Draco geometry"),M=await Ul(t,Ii,{draco:{shape:"mesh",attributeNameEntry:AZ}},S);c=((m=M.header)==null?void 0:m.vertexCount)??0,h=(g=M.indices)==null?void 0:g.value;let{POSITION:v,NORMAL:B,COLOR_0:R,["feature-index"]:E,["uv-region"]:j}=M.attributes;if(a={position:v,normal:B,color:R,uvRegion:j,id:E},LZ(a,M.attributes),e.geometryMode==="source")for(let[O,A]of Object.entries(M.attributes))!["POSITION","NORMAL","COLOR_0","feature-index","uv-region"].includes(O)&&!/^TEXCOORD_\d+$/.test(O)&&(a[O]=A);DZ(a,M);let I=KZ(E);I&&(HZ(a,I),e.drawRanges=CZ(a.id.value,h,e.topology))}else{let S=n.store.defaultGeometrySchema;if(!S)throw new Error("Uncompressed I3S geometry requires store.defaultGeometrySchema");let{vertexAttributes:M,ordering:v,featureAttributes:B,featureAttributeOrder:R}=S,E=FZ(t,S);l=E.byteOffset,c=E.vertexCount,u=E.featureCount;let{attributes:j,byteOffset:I}=$N(t,l,M,c,v),{attributes:O,byteOffset:A}=$N(t,I,B,u,R),W=RZ(t,A);W&&(e.meshSegmentation=W),e.drawRanges=BZ(O),$Z(O),a=NZ(j,O)}let d=n.spatialReference;if(e.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(M=>!Number.isFinite(M)))throw new Error("Source I3S geometry requires packed xyz values and a finite source origin");let S=kS(a.position.value,a.position.metadata,r.mbs);if(S.some(M=>!Number.isFinite(M)))throw new Error("Source I3S positions must be finite");a.position={value:S,size:3},e.origin=[0,0,0],e.cartographicOrigin=[0,0,0],e.coordinateSystem=d!=null&&d.sourceCrs&&Bo(d.sourceCrs)==="geographic"?"lnglat":"cartesian",e.spatialReference=d?Object.freeze({...d,status:"native",targetCrs:void 0,targetHeightReference:"native",outputCoordinates:"auto"}):void 0,e.normalReferenceFrame=n.store.normalReferenceFrame||"earth-centered",e.sourceAttributes=a}else if((d==null?void 0:d.status)==="transformable"||(d==null?void 0:d.status)==="transformed"){let S=new xd(d,n.spatialOptions||((y=i==null?void 0:i.i3s)==null?void 0:y.spatial)),M=kS(a.position.value,a.position.metadata,r.mbs),v=await S.transformPositionsAsync(M,r.mbs);a.position.value=v.positions,(b=a.normal)!=null&&b.value&&(a.normal.value=S.transformNormals(a.normal.value,v.sourcePositions,n.store.normalReferenceFrame)),e.modelMatrix=v.modelMatrix,e.coordinateSystem=v.coordinateSystem,e.origin=v.origin,e.cartographicOrigin=v.cartographicOrigin,e.spatialReference=S.spatialReference}else if(!((w=i==null?void 0:i.i3s)!=null&&w.coordinateSystem)||i.i3s.coordinateSystem===J1.METER_OFFSETS){let S=GZ(a.position,r);e.modelMatrix=S.invert(),e.coordinateSystem="meter-offsets"}else e.modelMatrix=jZ(a.position),e.coordinateSystem="lnglat-offsets";e.attributes={positions:a.position,normals:a.normal,colors:WN(a.color,((_=i==null?void 0:i.i3s)==null?void 0:_.colorFormat)||"uint8norm"),uvRegions:WN(a.uvRegion||a.region)},OZ(e.attributes,a),e.indices=h||null,a.id&&a.id.value&&(e.featureIds=a.id.value);for(let S in e.attributes)e.attributes[S]||delete e.attributes[S];return e.vertexCount=c,e.byteLength=s,e}function RZ(t,e){return e<t.byteLength?t.slice(e):void 0}function LZ(t,e){for(let[r,n]of Object.entries(e)){let i=/^TEXCOORD_(\d+)$/.exec(r);i&&(t[`uv${Number(i[1])}`]=n)}}function OZ(t,e){for(let[r,n]of Object.entries(e)){let i=/^uv(\d+)$/.exec(r);if(!i||!n)continue;let o=Number(i[1]);t[o===0?"texCoords":`texCoords${o}`]=n}}function BZ(t){var o,s;let e=(o=t.id)==null?void 0:o.value,r=(s=t.faceRange)==null?void 0:s.value;if(!e||!r)return;let n=[],i=Math.min(e.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(e[a]),firstPrimitive:c,primitiveCount:u,firstVertex:c*3,vertexCount:u*3})}return n.length?n:void 0}function CZ(t,e,r){let n=r==="point-list"?1:3,i=(e==null?void 0:e.length)||t.length,o=Math.floor(i/n);if(!o)return;let s=[];for(let a=0;a<o;a++){let c=a*n,l=e?Number(e[c]):c,u=Number(t[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 DZ(t,e){for(let r in e.loaderData.attributes){let n=e.loaderData.attributes[r];switch(n.name){case"POSITION":t.position.metadata=n.metadata;break;case"feature-index":t.id.metadata=n.metadata;break;default:break}}}function NZ(t,e){return{...t,...e}}function WN(t,e="uint8norm"){return t&&(e==="float16"&&!t.componentType?{...t,value:s_(t.value,255),normalized:!1,componentType:"float16"}:e==="float32"&&!t.componentType?{...t,value:Float32Array.from(t.value,r=>r/255),normalized:!1}:{...t,normalized:!0})}function FZ(t,e){let r=0,n=0,i=0;for(let{property:o,type:s}of e.header){let a=NS(s);switch(o){case"vertexCount".toString():n=new a(t,0,4)[0],r+=uf(s);break;case"featureCount".toString():i=new a(t,4,4)[0],r+=uf(s);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function $N(t,e,r,n,i){let o={};for(let s of i)if(r[s]){let{valueType:a,valuesPerElement:c}=r[s];if(e+n*c*uf(a)<=t.byteLength){let l=t.slice(e),u;if(a==="UInt64")u=kZ(l,n*c,uf(a));else{let h=NS(a);u=new h(l,0,n*c)}o[s]={value:u,type:VN[a],size:c},s==="color"&&(o.color.normalized=!0),e=e+n*c*uf(a)}else if(s!=="uv0")break}return{attributes:o,byteOffset:e}}function kZ(t,e,r){let n=[],i=new DataView(t),o=0;for(let s=0;s<e;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 GZ(t,e){let r=e.mbs,n=t.value,i=t.metadata,o=new yn,s=new J(r[0],r[1],r[2]),a=new J;return Tt.WGS84.cartographicToCartesian(s,a),B2(Tt.WGS84,a,o),t.value=UZ(n,i,s),o}function kS(t,e={},r){var s,a;let n=new Float64Array(t.length),i=((s=e["i3s-scale_x"])==null?void 0:s.double)??1,o=((a=e["i3s-scale_y"])==null?void 0:a.double)??1;for(let c=0;c<n.length;c+=3)n[c]=t[c]*i+r[0],n[c+1]=t[c+1]*o+r[1],n[c+2]=t[c+2]+r[2];return n}function UZ(t,e={},r){let n=kS(t,e,r);for(let i=0;i<n.length;i+=3)Tt.WGS84.cartographicToCartesian(n.subarray(i,i+3),Q1),n[i]=Q1.x,n[i+1]=Q1.y,n[i+2]=Q1.z;return n}function jZ(t){var o,s;let e=t.metadata,r=((o=e==null?void 0:e["i3s-scale_x"])==null?void 0:o.double)||1,n=((s=e==null?void 0:e["i3s-scale_y"])==null?void 0:s.double)||1,i=new yn;return i[0]=r,i[5]=n,i}function zZ(t,e={},r){var o;let n=[t==null?void 0:t.emissiveFactor,(o=t==null?void 0:t.pbrMetallicRoughness)==null?void 0:o.baseColorFactor].some(s=>s==null?void 0:s.some(a=>a>1))?255:1,i;return t?i={...t,normalTexture:t.normalTexture?{...t.normalTexture}:void 0,occlusionTexture:t.occlusionTexture?{...t.occlusionTexture}:void 0,emissiveTexture:t.emissiveTexture?{...t.emissiveTexture}:void 0,pbrMetallicRoughness:t.pbrMetallicRoughness?{...t.pbrMetallicRoughness,baseColorTexture:t.pbrMetallicRoughness.baseColorTexture?{...t.pbrMetallicRoughness.baseColorTexture}:void 0,metallicRoughnessTexture:t.pbrMetallicRoughness.metallicRoughnessTexture?{...t.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=HN(i.emissiveFactor,n)),i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorFactor&&(i.pbrMetallicRoughness.baseColorFactor=HN(i.pbrMetallicRoughness.baseColorFactor,n)),Object.keys(e).length>0?VZ(i,e):r&&qZ(i,r),i}function HN(t,e){let r=[...t];for(let n=0;n<t.length;n++){let i=t[n]/e;r[n]=n<3?i<=.04045?i/12.92:((i+.055)/1.055)**2.4:i}return r}function qZ(t,e){if(t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture){let r=t.pbrMetallicRoughness.baseColorTexture;t.pbrMetallicRoughness.baseColorTexture={...r,texture:ff(e,r)}}else if(t.emissiveTexture){let r=t.emissiveTexture;t.emissiveTexture={...r,texture:ff(e,r)}}else if(t.pbrMetallicRoughness&&t.pbrMetallicRoughness.metallicRoughnessTexture){let r=t.pbrMetallicRoughness.metallicRoughnessTexture;t.pbrMetallicRoughness.metallicRoughnessTexture={...r,texture:ff(e,r)}}else if(t.normalTexture){let r=t.normalTexture;t.normalTexture={...r,texture:ff(e,r)}}else if(t.occlusionTexture){let r=t.occlusionTexture;t.occlusionTexture={...r,texture:ff(e,r)}}}function VZ(t,e){var n,i;let r=[(n=t.pbrMetallicRoughness)==null?void 0:n.baseColorTexture,(i=t.pbrMetallicRoughness)==null?void 0:i.metallicRoughnessTexture,t.normalTexture,t.occlusionTexture,t.emissiveTexture];for(let o of r){if(!o)continue;let s=e[o.textureSetDefinitionId];s&&(o.texture=ff(s,o))}}function ff(t,e){let r=KN(e.wrapS),n=KN(e.wrapT),i=r||n?{wrapS:r||10497,wrapT:n||10497}:void 0;return i?{source:{image:t},sampler:i}:{source:{image:t}}}function KN(t){switch(t){case"none":return 33071;case"mirror":return 33648;case"repeat":return 10497;default:return}}function WZ(t){var e,r,n,i,o,s,a;return((r=(e=t==null?void 0:t.pbrMetallicRoughness)==null?void 0:e.baseColorTexture)==null?void 0:r.textureSetDefinitionId)??((i=(n=t==null?void 0:t.pbrMetallicRoughness)==null?void 0:n.metallicRoughnessTexture)==null?void 0:i.textureSetDefinitionId)??((o=t==null?void 0:t.normalTexture)==null?void 0:o.textureSetDefinitionId)??((s=t==null?void 0:t.occlusionTexture)==null?void 0:s.textureSetDefinitionId)??((a=t==null?void 0:t.emissiveTexture)==null?void 0:a.textureSetDefinitionId)??0}function $Z(t){let{id:e,faceRange:r}=t;if(!e||!r)return;let n=e.value,i=r.value,o=i[i.length-1]+1,s=new 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}t.id.value=s}function HZ(t,e){let r=t.id.value,n=new Float64Array(r.length);for(let i=0;i<r.length;i++)n[i]=e[r[i]];t.id.value=n}function KZ(t){var e,r;return(r=(e=t==null?void 0:t.metadata)==null?void 0:e["i3s-feature-ids"])==null?void 0:r.intArray}var Q1,AZ,YN=p(()=>{"use strict";yi();ed();Fn();Qf();Qf();yi();oh();h_();oh();jN();qN();FS();Q1=new J([0,0,0]);AZ="i3s-attribute-type"});var eg,US,U8e,ZN,j8e,z8e,q8e,V8e,W8e,JN=p(()=>{"use strict";eg=(t,e,r,n)=>({name:t,id:e,module:"tiles-3d",encoding:"binary",format:r,extensions:n,mimeTypes:["application/octet-stream"],binary:!0}),US=(t,e,r)=>({name:t,id:e,module:"tiles-3d",encoding:"json",format:r,extensions:["json"],mimeTypes:["application/json"],text:!0}),U8e=eg("I3S","i3s","i3s",["bin"]),ZN=eg("I3S Content","i3s-content","i3s-content",["bin"]),j8e=eg("I3S Attribute","i3s-attribute","i3s-attribute",["bin"]),z8e=eg("I3S LEPCC","i3s-lepcc","i3s-lepcc",["bin"]),q8e=US("I3S Node Page","i3s-node-page","i3s-node-page"),V8e=US("ArcGIS Web Scene","arcgis-web-scene","arcgis-web-scene"),W8e=US("I3S Building Scene Layer","i3s-building-scene-layer","i3s-building-scene-layer")});var QN,eF=p(()=>{"use strict";FS();QN={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:J1.METER_OFFSETS}});var XZ,tF,rF=p(()=>{"use strict";JN();eF();XZ="5.0.0-beta.10",tF={...ZN,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:XZ,mimeTypes:["application/octet-stream"],preload:async()=>(await Promise.resolve().then(()=>(jS(),nF))).I3SContentLoaderWithParser,extensions:["bin"],options:{i3s:QN,"i3s-content":{}}}});var nF={};Qt(nF,{I3SContentLoaderWithParser:()=>zS});async function ZZ(t,e,r){let{tile:n,_tileOptions:i,tileset:o,_tilesetOptions:s}=(e==null?void 0:e.i3s)||{},a=i||n,c=s||o;return!a||!c?null:await XN(t,a,c,e,r)}var nIe,YZ,zS,jS=p(()=>{"use strict";oh();h_();oh();YN();rF();({preload:nIe,...YZ}=tF),zS={...YZ,subloaders:{ImageLoader:Jo,DracoLoader:Ii,BasisLoader:go,CompressedTextureLoader:Qo},parse:ZZ}});Tg();var rM=typeof process!="object"||String(process)!=="[object process]"||process.browser;var nM={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"]=nM||{};function Te(t,e,r){return e<=t&&t<=r}function bF(t,e){return t.indexOf(e)!==-1}var Fo=Math.floor;function Gd(t){if(t===void 0)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function wF(t){for(var e=String(t),r=e.length,n=0,i=[];n<r;){var o=e.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=e.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 xF(t){for(var e="",r=0;r<t.length;++r){var n=t[r];n<=65535?e+=String.fromCharCode(n):(n-=65536,e+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return e}function fi(t){return 0<=t&&t<=127}var ui=fi,Je=-1;function Lg(t){this.tokens=[].slice.call(t),this.tokens.reverse()}Lg.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Je},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.pop());else this.tokens.push(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.shift());else this.tokens.unshift(t)}};var gt=-1;function Ze(t,e){if(t)throw TypeError("Decoder error");return e||65533}function Ri(t){throw TypeError("The code point "+t+" could not be encoded.")}function _F(){}_F.prototype={handler:function(t,e){}};function SF(){}SF.prototype={handler:function(t,e){}};function Pg(t){return t=String(t).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Rg,t)?Rg[t]:null}var iM=[{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"}],Rg={};iM.forEach(function(t){t.encodings.forEach(function(e){e.labels.forEach(function(r){Rg[r]=e})})});var mn={},pn={};function Tl(t,e){return e&&e[t]||null}function Al(t,e){var r=e.indexOf(t);return r===-1?null:r}function Zr(t){if(!("encoding-indexes"in globalThis))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return globalThis["encoding-indexes"][t]}function MF(t){if(t>39419&&t<189e3||t>1237575)return null;if(t===7457)return 59335;var e=0,r=0,n=Zr("gb18030-ranges"),i;for(i=0;i<n.length;++i){var o=n[i];if(o[0]<=t)e=o[0],r=o[1];else break}return r+t-e}function vF(t){if(t===59335)return 7457;var e=0,r=0,n=Zr("gb18030-ranges"),i;for(i=0;i<n.length;++i){var o=n[i];if(o[1]<=t)e=o[1],r=o[0];else break}return r+t-e}function EF(t){Ag=Ag||Zr("jis0208").map(function(r,n){return Te(n,8272,8835)?null:r});var e=Ag;return e.indexOf(t)}var Ag;function TF(t){Ig=Ig||Zr("big5").map(function(r,n){return n<5024?null:r});var e=Ig;return t===9552||t===9566||t===9569||t===9578||t===21313||t===21317?e.lastIndexOf(t):Al(t,e)}var Ig,oM="utf-8";function ic(t,e){if(!(this instanceof ic))throw TypeError("Called as a function. Did you forget 'new'?");t=t!==void 0?String(t):oM,e=Gd(e),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=Pg(t);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+t);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,e.fatal&&(n._error_mode="fatal"),e.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(ic.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(ic.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(ic.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));ic.prototype.decode=function(e,r){var n;typeof e=="object"&&e instanceof ArrayBuffer?n=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):n=new Uint8Array(0),r=Gd(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 Lg(n),o=[],s;;){var a=i.read();if(a===Je||(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 bF(["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)),xF(l)}return c.call(this,o)};function Ef(t,e){if(!(this instanceof Ef))throw TypeError("Called as a function. Did you forget 'new'?");e=Gd(e),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=e.fatal?"fatal":"replacement";var r=this;if(e.NONSTANDARD_allowLegacyEncoding){t=t!==void 0?String(t):oM;var n=Pg(t);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+t);if(!mn[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=Pg("utf-8"),t!==void 0&&"console"in globalThis;return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(Ef.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Ef.prototype.encode=function(e,r){e=e===void 0?"":String(e),r=Gd(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 Lg(wF(e)),i=[],o;;){var s=n.read();if(s===Je||(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 AF(t){var e=t.fatal,r=0,n=0,i=0,o=128,s=191;this.handler=function(a,c){if(c===Je&&i!==0)return i=0,Ze(e);if(c===Je)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 Ze(e);return null}if(!Te(c,o,s))return r=i=n=0,o=128,s=191,a.prepend(c),Ze(e);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 IF(t){var e=t.fatal;this.handler=function(r,n){if(n===Je)return gt;if(ui(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(t){return new IF(t)};pn["UTF-8"]=function(t){return new AF(t)};function PF(t,e){var r=e.fatal;this.handler=function(n,i){if(i===Je)return gt;if(fi(i))return i;var o=t[i-128];return o===null?Ze(r):o}}function RF(t,e){var r=e.fatal;this.handler=function(n,i){if(i===Je)return gt;if(ui(i))return i;var o=Al(i,t);return o===null&&Ri(i),o+128}}(function(){"encoding-indexes"in globalThis&&iM.forEach(function(t){t.heading==="Legacy single-byte encodings"&&t.encodings.forEach(function(e){var r=e.name,n=Zr(r.toLowerCase());pn[r]=function(i){return new PF(n,i)},mn[r]=function(i){return new RF(n,i)}})})})();pn.GBK=function(t){return new sM(t)};mn.GBK=function(t){return new aM(t,!0)};function sM(t){var e=t.fatal,r=0,n=0,i=0;this.handler=function(o,s){if(s===Je&&r===0&&n===0&&i===0)return gt;s===Je&&(r!==0||n!==0||i!==0)&&(r=0,n=0,i=0,Ze(e));var a;if(i!==0){a=null,Te(s,48,57)&&(a=MF((((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),Ze(e)):a}if(n!==0)return Te(s,129,254)?(i=s,null):(o.prepend([n,s]),r=0,n=0,Ze(e));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:Tl(u,Zr("gb18030")),a===null&&fi(s)&&o.prepend(s),a===null?Ze(e):a}return fi(s)?s:s===128?8364:Te(s,129,254)?(r=s,null):Ze(e)}}function aM(t,e){var r=t.fatal;this.handler=function(n,i){if(i===Je)return gt;if(ui(i))return i;if(i===58853)return Ri(i);if(e&&i===8364)return 128;var o=Al(i,Zr("gb18030"));if(o!==null){var s=Fo(o/190)+129,a=o%190,c=a<63?64:65;return[s,a+c]}if(e)return Ri(i);o=vF(i);var l=Fo(o/10/126/10);o=o-l*10*126*10;var u=Fo(o/10/126);o=o-u*10*126;var h=Fo(o/10),d=o-h*10;return[l+129,u+48,h+129,d+48]}}mn.gb18030=function(t){return new aM(t)};pn.gb18030=function(t){return new sM(t)};function LF(t){var e=t.fatal,r=0;this.handler=function(n,i){if(i===Je&&r!==0)return r=0,Ze(e);if(i===Je&&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:Tl(s,Zr("big5"));return c===null&&fi(i)&&n.prepend(i),c===null?Ze(e):c}return fi(i)?i:Te(i,129,254)?(r=i,null):Ze(e)}}function OF(t){var e=t.fatal;this.handler=function(r,n){if(n===Je)return gt;if(ui(n))return n;var i=TF(n);if(i===null)return Ri(n);var o=Fo(i/157)+129;if(o<161)return Ri(n);var s=i%157,a=s<63?64:98;return[o,s+a]}}mn.Big5=function(t){return new OF(t)};pn.Big5=function(t){return new LF(t)};function BF(t){var e=t.fatal,r=!1,n=0;this.handler=function(i,o){if(o===Je&&n!==0)return n=0,Ze(e);if(o===Je&&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=Tl((s-161)*94+(o-161),Zr(r?"jis0212":"jis0208"))),r=!1,Te(o,161,254)||i.prepend(o),a===null?Ze(e):a}return fi(o)?o:o===142||o===143||Te(o,161,254)?(n=o,null):Ze(e)}}function CF(t){var e=t.fatal;this.handler=function(r,n){if(n===Je)return gt;if(ui(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=Al(n,Zr("jis0208"));if(i===null)return Ri(n);var o=Fo(i/94)+161,s=i%94+161;return[o,s]}}mn["EUC-JP"]=function(t){return new CF(t)};pn["EUC-JP"]=function(t){return new BF(t)};function DF(t){var e=t.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===Je?gt:(s=!1,Ze(e));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===Je?gt:(s=!1,Ze(e));case r.Katakana:return c===27?(n=r.EscapeStart,null):Te(c,33,95)?(s=!1,65344+c):c===Je?gt:(s=!1,Ze(e));case r.LeadByte:return c===27?(n=r.EscapeStart,null):Te(c,33,126)?(s=!1,o=c,n=r.TrailByte,null):c===Je?gt:(s=!1,Ze(e));case r.TrailByte:if(c===27)return n=r.EscapeStart,Ze(e);if(Te(c,33,126)){n=r.LeadByte;var l=(o-33)*94+c-33,u=Tl(l,Zr("jis0208"));return u===null?Ze(e):u}return c===Je?(n=r.LeadByte,a.prepend(c),Ze(e)):(n=r.LeadByte,Ze(e));case r.EscapeStart:return c===36||c===40?(o=c,n=r.Escape,null):(a.prepend(c),s=!1,n=i,Ze(e));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?Ze(e):null}return a.prepend([h,c]),s=!1,n=i,Ze(e)}}}function NF(t){var e=t.fatal,r={ASCII:0,Roman:1,jis0208:2},n=r.ASCII;this.handler=function(i,o){if(o===Je&&n!==r.ASCII)return i.prepend(o),n=r.ASCII,[27,40,66];if(o===Je&&n===r.ASCII)return gt;if((n===r.ASCII||n===r.Roman)&&(o===14||o===15||o===27))return Ri(65533);if(n===r.ASCII&&ui(o))return o;if(n===r.Roman&&(ui(o)&&o!==92&&o!==126||o===165||o===8254)){if(ui(o))return o;if(o===165)return 92;if(o===8254)return 126}if(ui(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=Al(o,Zr("jis0208"));if(s===null)return Ri(o);if(n!==r.jis0208)return i.prepend(o),n=r.jis0208,[27,36,66];var a=Fo(s/94)+33,c=s%94+33;return[a,c]}}mn["ISO-2022-JP"]=function(t){return new NF(t)};pn["ISO-2022-JP"]=function(t){return new DF(t)};function FF(t){var e=t.fatal,r=0;this.handler=function(n,i){if(i===Je&&r!==0)return r=0,Ze(e);if(i===Je&&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:Tl(s,Zr("jis0208"));return l===null&&fi(i)&&n.prepend(i),l===null?Ze(e):l}return fi(i)||i===128?i:Te(i,161,223)?65216+i:Te(i,129,159)||Te(i,224,252)?(r=i,null):Ze(e)}}function kF(t){var e=t.fatal;this.handler=function(r,n){if(n===Je)return gt;if(ui(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=EF(n);if(i===null)return Ri(n);var o=Fo(i/188),s=o<31?129:193,a=i%188,c=a<63?64:65;return[o+s,a+c]}}mn.Shift_JIS=function(t){return new kF(t)};pn.Shift_JIS=function(t){return new FF(t)};function GF(t){var e=t.fatal,r=0;this.handler=function(n,i){if(i===Je&&r!==0)return r=0,Ze(e);if(i===Je&&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:Tl(s,Zr("euc-kr"));return s===null&&fi(i)&&n.prepend(i),a===null?Ze(e):a}return fi(i)?i:Te(i,129,254)?(r=i,null):Ze(e)}}function UF(t){var e=t.fatal;this.handler=function(r,n){if(n===Je)return gt;if(ui(n))return n;var i=Al(n,Zr("euc-kr"));if(i===null)return Ri(n);var o=Fo(i/190)+129,s=i%190+65;return[o,s]}}mn["EUC-KR"]=function(t){return new UF(t)};pn["EUC-KR"]=function(t){return new GF(t)};function kd(t,e){var r=t>>8,n=t&255;return e?[r,n]:[n,r]}function cM(t,e){var r=e.fatal,n=null,i=null;this.handler=function(o,s){if(s===Je&&(n!==null||i!==null))return Ze(r);if(s===Je&&n===null&&i===null)return gt;if(n===null)return n=s,null;var a;if(t?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(kd(a,t)),Ze(r))}return Te(a,55296,56319)?(i=a,null):Te(a,56320,57343)?Ze(r):a}}function lM(t,e){var r=e.fatal;this.handler=function(n,i){if(i===Je)return gt;if(Te(i,0,65535))return kd(i,t);var o=kd((i-65536>>10)+55296,t),s=kd((i-65536&1023)+56320,t);return o.concat(s)}}mn["UTF-16BE"]=function(t){return new lM(!0,t)};pn["UTF-16BE"]=function(t){return new cM(!0,t)};mn["UTF-16LE"]=function(t){return new lM(!1,t)};pn["UTF-16LE"]=function(t){return new cM(!1,t)};function jF(t){var e=t.fatal;this.handler=function(r,n){return n===Je?gt:fi(n)?n:63360+n-128}}function zF(t){var e=t.fatal;this.handler=function(r,n){return n===Je?gt:ui(n)?n:Te(n,63360,63487)?n-63360+128:Ri(n)}}mn["x-user-defined"]=function(t){return new zF(t)};pn["x-user-defined"]=function(t){return new jF(t)};function Tf(t){return Buffer.from(t).toString("base64")}function Og(t){return Buffer.from(t,"base64").toString("ascii")}async function lm(){try{return(await Promise.resolve().then(()=>(AE(),TE))).default}catch(t){throw new Error("Node image decoding and encoding require the optional 'sharp' package. Install it with 'npm install sharp'.",{cause:t})}}var um=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg+xml"];async function fm(t,e){let r=await lm(),{data:n,info:i}=await r(Buffer.from(t),{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 PE(t){return t instanceof ArrayBuffer?t:(ArrayBuffer.isView(t),hm(t))}function hm(t){if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t)){let{buffer:e,byteOffset:r,byteLength:n}=t;return e instanceof ArrayBuffer&&r===0&&n===e.byteLength?e:IE(e,r,n)}return IE(t)}function IE(t,e=0,r=t.byteLength-e){let n=new Uint8Array(r);return n.set(new Uint8Array(t,e,r)),n.buffer}async function gy(t,e={}){let r=await lm(),n=(e.type||"jpeg").toLowerCase().replace(/^image\//,""),i=n==="jpg"?"jpeg":n,o=await r(Buffer.from(t.data),{raw:{width:t.width,height:t.height,channels:4}}).toFormat(i).toBuffer();return PE(o)}var Gl=class{width;height;data;constructor(e){if(!e||!e.data||!e.width||!e.height)throw new Error("NodeImageBitmap requires decoded image data");this.width=e.width,this.height=e.height,this.data=e.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 yy(t){return t instanceof Gl}function RE(t){return new Gl(t)}function by(t){if(!yy(t))throw new Error("getImageBitmapData");return t._getImageData()}var rz="",nz=new Map;function dm(t){for(let[e,r]of nz)t.startsWith(e)&&(t=t.replace(e,r));return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${rz}${t}`),t}var zo=me(require("fs"),1),cc=class{handle;size;bigsize;url;constructor(e,r,n){e=dm(e),this.handle=zo.default.openSync(e,r,n);let i=zo.default.fstatSync(this.handle,{bigint:!0});this.size=Number(i.size),this.bigsize=i.size,this.url=e}async close(){return new Promise((e,r)=>{zo.default.close(this.handle,n=>n?r(n):e())})}async truncate(e){return new Promise((r,n)=>{zo.default.ftruncate(this.handle,e,i=>{i?n(i):(this.bigsize=BigInt(e),this.size=Number(this.bigsize),r())})})}async append(e){return new Promise((r,n)=>{zo.default.appendFile(this.handle,e,i=>{i?n(i):(this.bigsize=this.bigsize+BigInt(e.length),this.size=Number(this.bigsize),r())})})}async stat(){return await new Promise((e,r)=>zo.default.fstat(this.handle,{bigint:!0},(n,i)=>{let o={size:Number(i.size),bigsize:i.size,isDirectory:i.isDirectory()};n?r(n):e(o)}))}async read(e,r){let n=new ArrayBuffer(r),i=BigInt(e),o=0,s=new Uint8Array(n),a;for(;r>0;){let c=await iz(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(e,r=0,n=e.byteLength){return new Promise((i,o)=>{let s=Number(r),a=new Uint8Array(e,Number(r),n);zo.default.write(this.handle,a,0,n,s,(c,l)=>c?o(c):i(l))})}};async function iz(t,e,r,n,i){return await new Promise((o,s)=>zo.default.read(t,e,r,n,i,(a,c)=>a?s(a):o(c)))}var gm=me(require("fs/promises"),1);var xy=me(require("fs"),1),wy=require("stream");var mm=me(require("zlib"),1);function LE(t,e){switch(e==null?void 0:e.get("content-encoding")){case"br":return t.pipe(mm.default.createBrotliDecompress());case"gzip":return t.pipe(mm.default.createGunzip());case"deflate":return t.pipe(mm.default.createDeflate());default:return t}}var oz=t=>typeof t=="boolean",OE=t=>typeof t=="function",sz=t=>t!==null&&typeof t=="object",az=t=>sz(t)&&OE(t.read)&&OE(t.pipe)&&oz(t.readable);async function pm(t,e){let r=/^file:\/\//;t.replace(r,"/");let n=t.split("?")[0];n=dm(n);let i=new Headers;t.endsWith(".gz")&&i.set("content-encoding","gzip"),t.endsWith(".br")&&i.set("content-encoding","br");try{let o=await new Promise((h,d)=>{let m=xy.default.createReadStream(n,{encoding:null});m.once("readable",()=>h(m)),m.on("error",g=>d(g))}),s=o;az(o)?s=LE(o,i):typeof o=="string"?s=wy.Readable.from([new TextEncoder().encode(o)]):s=wy.Readable.from([o||new ArrayBuffer(0)]);let a=200,c="OK",l=cz(n),u=new Response(s,{headers:l,status:a,statusText:c});return Object.defineProperty(u,"url",{value:t}),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:t}),u}}function cz(t){let e={};if(!e["content-length"]){let r=xy.default.statSync(t);e["content-length"]=r.size}return t.endsWith(".gz")&&(t=t.slice(0,-3),e["content-encoding"]="gzip"),new Headers(e)}var ym=class{readable=!0;writable=!0;constructor(){}async readdir(e=".",r){return await gm.default.readdir(e,r)}async stat(e){let r=await gm.default.stat(e,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(e){return await gm.default.unlink(e)}async fetch(e,r){return await pm(e,r)}async openReadableFile(e,r="r"){return new cc(e,r)}async openWritableFile(e,r="w",n){return new cc(e,r,n)}};var Df=me(require("crypto"),1),bm=class{name="crypto-node";options;_algorithm;_hash;constructor(e){var r,n;if(this.options=e,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(e,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(!Df.createHash)throw new Error("crypto.createHash not available");let c=(a=Df.createHash)==null?void 0:a(n),l=new Uint8Array(e);return c.update(l).digest("base64")}catch(c){throw Error(`${n} hash not available. ${c}`)}}async*hashBatches(e,r="base64"){var o,s,a,c,l,u,h;if(!Df.createHash)throw new Error("crypto.createHash not available");let n=(c=Df.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 e){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 kE=require("node:process"),GE=require("node:stream/web");var wm=require("node:stream");function BE(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[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=(e==null?void 0:e.objectMode)??!1,s=wm.Readable.from(i,{highWaterMark:(0,wm.getDefaultHighWaterMark)(o),...e,objectMode:o}),a=s._destroy;return s._destroy=function(c,l){a.call(this,c,u=>{l(!n&&u===c?null:u)})},s}var xm=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(e){let r=await e.arrayBuffer();this.onload&&this.onload({target:{result:r}})}async readAsBinaryString(e){throw Error("Not implemented")}async readAsDataURL(e){let r=await e.text(),n=`data://;base64,${Tf(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(e){let r=await e.text();this.onload&&this.onload({target:{result:r}})}};function CE(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=xm),global}var _y=me(require("module"),1),Sy=me(require("path"),1),Sm=me(require("fs"),1),My=require("node:url");async function DE(t){return t.startsWith("http")?await(await fetch(t)).arrayBuffer():hm(Sm.default.readFileSync(vy(t)))}async function NE(t){return t.startsWith("http")?await(await fetch(t)).text():Sm.default.readFileSync(vy(t),"utf8")}async function FE(t){if(t.startsWith("http")){let i=await(await fetch(t)).text();return _m(i)}let e=vy(t),r=Sm.default.readFileSync(e,"utf8");return _m(r,e)}function _m(t,e="",r){if(typeof e=="object"&&(r=e,e=""),e.startsWith("file:")&&(e=(0,My.fileURLToPath)(e)),typeof t!="string")throw new Error(`code must be a string, not ${typeof t}`);let n=_y.default._nodeModulePaths(Sy.default.dirname(e)),i=typeof module<"u"&&(module==null?void 0:module.parent),o=new _y.default(e,i);return o.filename=e,o.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),o._compile(t,e),i&&i.children&&i.children.splice(i.children.indexOf(o),1),o.exports}function vy(t){return t.startsWith("file:")?(0,My.fileURLToPath)(t):Sy.default.resolve(t)}var Ute=parseInt(kE.versions.node.split(".")[0]),qte=globalThis.Blob,Vte=globalThis.File;CE();rM&&tM.error("loaders.gl: The @loaders.gl/core/polyfills should only be used in Node.js environments")();globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=BE;globalThis.loaders.NodeFile=cc;globalThis.loaders.NodeFileSystem=ym;globalThis.loaders.fetchNode=pm;globalThis.loaders.NodeHash=bm;globalThis.TextEncoder||(globalThis.TextEncoder=Ef);globalThis.TextDecoder||(globalThis.TextDecoder=ic);globalThis.ReadableStream||(globalThis.ReadableStream=GE.ReadableStream);!("atob"in globalThis)&&Tf&&(globalThis.atob=Tf);!("btoa"in globalThis)&&Og&&(globalThis.btoa=Og);globalThis.loaders.encodeImageNode=gy;globalThis.loaders.parseImageNode=fm;globalThis.loaders.imageFormatsNode=um;globalThis.loaders.createImageBitmapNode=RE;globalThis.loaders.getImageBitmapDataNode=by;globalThis.loaders.isImageBitmapNode=yy;globalThis.ImageBitmap||(globalThis.ImageBitmap=Gl);"getImageBitmapData"in globalThis||(globalThis.getImageBitmapData=by);globalThis._parseImageNode=fm;globalThis._imageFormatsNode=um;globalThis.loaders.readFileAsArrayBuffer=DE;globalThis.loaders.readFileAsText=NE;globalThis.loaders.requireFromFile=FE;globalThis.loaders.requireFromString=_m;yi();jS();Xy(zS);
23
+ }`),this._recordBatchesWithDictionaries=[],this._recordBatches=[],super.close()}}});function mR(t,e){if(xn(t))return new Cx(t[Symbol.asyncIterator](),e);if(jn(t))return new Ox(t[Symbol.iterator](),e);throw new Error("toNodeStream() must be called with an Iterable or AsyncIterable")}var Bx,Ox,Cx,pR=p(()=>{Ar();Bx=require("node:stream");es();Ox=class extends Bx.Readable{constructor(e,r){super(r),this._iterator=e,this._pulling=!1,this._bytesMode=!r||!r.objectMode}_read(e){let r=this._iterator;r&&!this._pulling&&(this._pulling=!0)&&(this._pulling=this._pull(e,r))}_destroy(e,r){let n=this._iterator,i;n&&(i=e!=null&&n.throw||n.return),i==null||i.call(n,e),r&&r(null)}_pull(e,r){let n=this._bytesMode,i=null;for(;this.readable&&!(i=r.next(n?e:null)).done&&(e!=null&&(e-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(i.value)||e<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&r.return&&r.return(),!this.readable}},Cx=class extends Bx.Readable{constructor(e,r){super(r),this._iterator=e,this._pulling=!1,this._bytesMode=!r||!r.objectMode}_read(e){let r=this._iterator;r&&!this._pulling&&(this._pulling=!0)&&$(this,void 0,void 0,function*(){return this._pulling=yield this._pull(e,r)})}_destroy(e,r){let n=this._iterator,i;n&&(i=e!=null&&n.throw||n.return),i!=null&&i.call(n,e).then(()=>r&&r(null))||r&&r(null)}_pull(e,r){return $(this,void 0,void 0,function*(){let n=this._bytesMode,i=null;for(;this.readable&&!(i=yield r.next(n?e:null)).done&&(e!=null&&(e-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(i.value)||e<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&r.return&&r.return(),!this.readable})}}});function yR(t){return new Dx(Qn(t),t)}var gR,Dx,OK,CK,bR=p(()=>{gR=require("node:stream");ku();Dx=class extends gR.Duplex{constructor(e,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=e,this._desiredSize=o,this._getSize=n!=="bytes"?OK:CK}_read(e){this._maybeFlush(this._builder,this._desiredSize=e)}_final(e){this._maybeFlush(this._builder.finish(),this._desiredSize),e&&e()}_write(e,r,n){let i=this._maybeFlush(this._builder.append(e),this._desiredSize);return n&&n(),i}_destroy(e,r){this._builder.clear(),r&&r(e)}_maybeFlush(e,r){return this._getSize(e)>=r&&++this._numChunks&&this.push(e.toVector()),e.finished?((e.length>0||this._numChunks===0)&&++this._numChunks&&this.push(e.toVector()),!this._finished&&(this._finished=!0)&&this.push(null),!1):this._getSize(e)<this.writableHighWaterMark}},OK=t=>t.length,CK=t=>t.byteLength});function xR(t){return new Nx(t)}var wR,Nx,_R=p(()=>{Ar();wR=require("node:stream");To();cl();Nx=class extends wR.Duplex{constructor(e){super(Object.assign(Object.assign({allowHalfOpen:!1},e),{readableObjectMode:!0,writableObjectMode:!1})),this._pulling=!1,this._autoDestroy=!0,this._reader=null,this._pulling=!1,this._asyncQueue=new An,this._autoDestroy=e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:!0}_final(e){let r=this._asyncQueue;r==null||r.close(),e&&e()}_write(e,r,n){let i=this._asyncQueue;return i==null||i.write(e),n&&n(),!0}_read(e){let r=this._asyncQueue;r&&!this._pulling&&(this._pulling=!0)&&$(this,void 0,void 0,function*(){this._reader||(this._reader=yield this._open(r)),this._pulling=yield this._pull(e,this._reader)})}_destroy(e,r){let n=this._asyncQueue;n&&(e?n.abort(e):n.close()),r(this._asyncQueue=this._reader=null)}_open(e){return $(this,void 0,void 0,function*(){return yield(yield pr.from(e)).open({autoDestroy:this._autoDestroy})})}_pull(e,r){return $(this,void 0,void 0,function*(){let n=null;for(;this.readable&&!(n=yield r.next()).done&&!(!this.push(n.value)||e!=null&&--e<=0););return(!this.readable||n!=null&&n.done&&(r.autoDestroy||(yield r.reset().open()).closed))&&(this.push(null),yield r.cancel()),!this.readable})}}});function MR(t){return new Fx(new this(t))}var SR,Fx,vR=p(()=>{Ar();SR=require("node:stream");To();Fx=class extends SR.Duplex{constructor(e,r){super(Object.assign(Object.assign({allowHalfOpen:!1},r),{writableObjectMode:!0,readableObjectMode:!1})),this._pulling=!1,this._writer=e,this._reader=new zr(e)}_final(e){let r=this._writer;r==null||r.close(),e&&e()}_write(e,r,n){let i=this._writer;return i==null||i.write(e),n&&n(),!0}_read(e){let r=this._reader;r&&!this._pulling&&(this._pulling=!0)&&$(this,void 0,void 0,function*(){return this._pulling=yield this._pull(e,r)})}_destroy(e,r){let n=this._writer;n&&(e?n.abort(e):n.close()),r(this._reader=this._writer=null)}_pull(e,r){return $(this,void 0,void 0,function*(){let n=null;for(;this.readable&&!(n=yield r.next(e||null)).done&&(e!=null&&n.value&&(e-=n.value.byteLength),!(!this.push(n.value)||e<=0)););return(n!=null&&n.done||!this.readable)&&(this.push(null),yield r.cancel()),!this.readable})}}});function ER(t,e){if(xn(t))return DK(t,e);if(jn(t))return BK(t,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function BK(t,e){let r=null,n=(e==null?void 0:e.type)==="bytes"||!1,i=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(s){o(s,r||(r=t[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},e));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 DK(t,e){let r=null,n=(e==null?void 0:e.type)==="bytes"||!1,i=(e==null?void 0:e.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(s){return $(this,void 0,void 0,function*(){yield o(s,r||(r=t[Symbol.asyncIterator]()))})},pull(s){return $(this,void 0,void 0,function*(){r?yield o(s,r):s.close()})},cancel(){return $(this,void 0,void 0,function*(){r!=null&&r.return&&(yield r.return()),r=null})}}),Object.assign({highWaterMark:n?i:void 0},e));function o(s,a){return $(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 TR=p(()=>{Ar();ur();es()});function PR(t){return new kx(t)}var kx,AR,IR,RR=p(()=>{Ar();ku();kx=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=e,o=$I(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Qn(o),this._getSize=i!=="bytes"?AR:IR;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"?AR:IR}),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(e){let r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-r}_maybeFlush(e,r){r!=null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(e,r){this._bufferedSize=0,this._controller=null,r==null?e.close():e.enqueue(r)}},AR=t=>{var e;return(e=t==null?void 0:t.length)!==null&&e!==void 0?e:0},IR=t=>{var e;return(e=t==null?void 0:t.byteLength)!==null&&e!==void 0?e:0}});function Y0(t,e){let r=new An,n=null,i=new ReadableStream({cancel(){return $(this,void 0,void 0,function*(){yield r.close()})},start(a){return $(this,void 0,void 0,function*(){yield s(a,n||(n=yield o()))})},pull(a){return $(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)},t)),readable:i};function o(){return $(this,void 0,void 0,function*(){return yield(yield pr.from(r)).open(e)})}function s(a,c){return $(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 LR=p(()=>{Ar();To();cl()});function Z0(t,e){let r=new this(t),n=new zr(r),i=new ReadableStream({cancel(){return $(this,void 0,void 0,function*(){yield n.cancel()})},pull(s){return $(this,void 0,void 0,function*(){yield o(s)})},start(s){return $(this,void 0,void 0,function*(){yield o(s)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(r,t),readable:i};function o(s){return $(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 OR=p(()=>{Ar();To()});function Ba(t){let e=pr.from(t);return Un(e)?e.then(r=>Ba(r)):e.isAsync()?e.readAll().then(r=>new je(r)):new je(e.readAll())}function ll(t,e="stream",r=null){let n={compressionType:r};return(e==="stream"?Ss:Ms).writeAll(t,n).toUint8Array(!0)}var CR=p(()=>{il();es();cl();Hh()});var Gx={};Jt(Gx,{isArrowData:()=>t1,isArrowDataType:()=>e1,isArrowField:()=>Q0,isArrowRecordBatch:()=>n1,isArrowSchema:()=>J0,isArrowTable:()=>i1,isArrowVector:()=>r1});function J0(t){return ve.isSchema(t)}function Q0(t){return ee.isField(t)}function e1(t){return j.isDataType(t)}function t1(t){return de.isData(t)}function r1(t){return H.isVector(t)}function n1(t){return ze.isRecordBatch(t)}function i1(t){return je.isTable(t)}var Ux=p(()=>{Gr();st();yi();Fr();ys();il()});var BR,jx=p(()=>{qp();yu();Dt();yi();st();il();Fr();En();Gr();Lh();l0();bt();ku();Vw();nx();Ww();$w();Hw();Kw();Yw();Qw();sx();ox();Zw();Jw();cx();ux();lx();O0();B0();C0();ex();tx();Xw();rx();ix();ax();To();cl();Hh();CR();V0();q0();la();ys();Ux();Vp();kw();Rc();Rh();ur();Ru();Sh();P0();Ux();Vh();BR=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},aw),Fw),Mw),cw),Eb),Sw),nw),qw),Gx),{compareSchemas:nl,compareFields:qP,compareTypes:F0})});var DR=p(()=>{gu();bt();cl();Hh();TR();RR();LR();OR();jx();jx();fr.toDOMStream=ER;at.throughDOM=PR;pr.throughDOM=Y0;ws.throughDOM=Y0;Xi.throughDOM=Y0;Mi.throughDOM=Z0;Ms.throughDOM=Z0;Ss.throughDOM=Z0});var Ro={};Jt(Ro,{AsyncByteQueue:()=>An,AsyncByteStream:()=>zr,AsyncMessageReader:()=>sl,AsyncRecordBatchFileReader:()=>zu,AsyncRecordBatchStreamReader:()=>bs,Binary:()=>Wn,BinaryBuilder:()=>fs,BinaryView:()=>Ee,BinaryViewBuilder:()=>ms,Bool:()=>en,BoolBuilder:()=>Dc,BufferType:()=>Ne,Builder:()=>at,ByteStream:()=>wi,CompressionType:()=>Ir,Data:()=>de,DataType:()=>j,DateBuilder:()=>Ao,DateDay:()=>dc,DateDayBuilder:()=>fa,DateMillisecond:()=>mc,DateMillisecondBuilder:()=>ha,DateUnit:()=>ut,Date_:()=>vn,Decimal:()=>$n,DecimalBuilder:()=>da,DenseUnion:()=>vc,DenseUnionBuilder:()=>tl,Dictionary:()=>mr,DictionaryBuilder:()=>Nc,Duration:()=>rn,DurationBuilder:()=>xi,DurationMicrosecond:()=>Ah,DurationMicrosecondBuilder:()=>xa,DurationMillisecond:()=>Th,DurationMillisecondBuilder:()=>wa,DurationNanosecond:()=>Ih,DurationNanosecondBuilder:()=>_a,DurationSecond:()=>Eh,DurationSecondBuilder:()=>ba,Field:()=>ee,FixedSizeBinary:()=>Kn,FixedSizeBinaryBuilder:()=>ma,FixedSizeList:()=>Yt,FixedSizeListBuilder:()=>Fc,Float:()=>Zr,Float16:()=>So,Float16Builder:()=>kc,Float32:()=>Mn,Float32Builder:()=>Gc,Float64:()=>pi,Float64Builder:()=>Uc,FloatBuilder:()=>Io,Int:()=>Wt,Int16:()=>Ui,Int16Builder:()=>zc,Int32:()=>hr,Int32Builder:()=>qc,Int64:()=>mi,Int64Builder:()=>Vc,Int8:()=>Gi,Int8Builder:()=>jc,IntBuilder:()=>sn,Interval:()=>tn,IntervalBuilder:()=>Ki,IntervalDayTime:()=>Sc,IntervalDayTimeBuilder:()=>pa,IntervalMonthDayNano:()=>vh,IntervalMonthDayNanoBuilder:()=>ya,IntervalUnit:()=>qe,IntervalYearMonth:()=>Mc,IntervalYearMonthBuilder:()=>ga,JSONMessageReader:()=>al,LargeBinary:()=>qi,LargeBinaryBuilder:()=>hs,LargeList:()=>Hn,LargeListBuilder:()=>Yc,LargeUtf8:()=>Vi,LargeUtf8Builder:()=>La,List:()=>dr,ListBuilder:()=>Xc,MapBuilder:()=>Zc,MapRow:()=>gi,Map_:()=>on,Message:()=>jr,MessageHeader:()=>ke,MessageReader:()=>Oa,MetadataVersion:()=>ot,Null:()=>Xt,NullBuilder:()=>Jc,Precision:()=>rt,RecordBatch:()=>ze,RecordBatchFileReader:()=>ws,RecordBatchFileWriter:()=>Ms,RecordBatchJSONWriter:()=>$h,RecordBatchReader:()=>pr,RecordBatchStreamReader:()=>Xi,RecordBatchStreamWriter:()=>Ss,RecordBatchWriter:()=>Mi,Schema:()=>ve,SparseUnion:()=>Ec,SparseUnionBuilder:()=>el,Struct:()=>Qe,StructBuilder:()=>Qc,StructRow:()=>Mo,Table:()=>je,Time:()=>Dr,TimeBuilder:()=>Si,TimeMicrosecond:()=>yc,TimeMicrosecondBuilder:()=>Ia,TimeMillisecond:()=>gc,TimeMillisecondBuilder:()=>Aa,TimeNanosecond:()=>bc,TimeNanosecondBuilder:()=>Pa,TimeSecond:()=>pc,TimeSecondBuilder:()=>Ta,TimeUnit:()=>W,Timestamp:()=>Nr,TimestampBuilder:()=>_i,TimestampMicrosecond:()=>xc,TimestampMicrosecondBuilder:()=>va,TimestampMillisecond:()=>os,TimestampMillisecondBuilder:()=>Ma,TimestampNanosecond:()=>_c,TimestampNanosecondBuilder:()=>Ea,TimestampSecond:()=>wc,TimestampSecondBuilder:()=>Sa,Type:()=>x,Uint16:()=>zi,Uint16Builder:()=>$c,Uint32:()=>Vn,Uint32Builder:()=>Hc,Uint64:()=>_o,Uint64Builder:()=>Kc,Uint8:()=>ji,Uint8Builder:()=>Wc,Union:()=>nn,UnionBuilder:()=>ds,UnionMode:()=>Ze,Utf8:()=>Jr,Utf8Builder:()=>Ra,Utf8View:()=>Qr,Utf8ViewBuilder:()=>rl,Vector:()=>H,Visitor:()=>ie,builderThroughAsyncIterable:()=>px,builderThroughIterable:()=>G0,compressionRegistry:()=>Ca,isArrowData:()=>t1,isArrowDataType:()=>e1,isArrowField:()=>Q0,isArrowRecordBatch:()=>n1,isArrowSchema:()=>J0,isArrowTable:()=>i1,isArrowVector:()=>r1,makeBuilder:()=>Qn,makeData:()=>te,makeTable:()=>gx,makeVector:()=>Eo,tableFromArrays:()=>yx,tableFromIPC:()=>Ba,tableFromJSON:()=>mx,tableToIPC:()=>ll,util:()=>BR,vectorFromArray:()=>Gu});var Lo=p(()=>{gu();bt();cl();Hh();pR();bR();_R();vR();DR();fr.toNodeStream=mR;at.throughNode=yR;pr.throughNode=xR;Mi.throughNode=MR});function zx(t){return t?new Map(Object.entries(t)):new Map}function vs(t,e){return new ee(t.name,o1(t.type,e),t.nullable,zx(t.metadata))}function o1(t,e){if(typeof t=="object")switch(t.type){case"decimal":return new $n(t.scale,t.precision,t.bitWidth);case"map":{let r=t.children.map(n=>vs(n,e));return new on(r[0],t.keysSorted)}case"list":{let r=vs(t.children[0],e);return new dr(r)}case"large-list":{let r=vs(t.children[0],e),n=qx("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=vs(t.children[0],e);return new Yt(t.listSize,r)}case"fixed-size-binary":return new Kn(t.byteWidth);case"struct":{let r=t.children.map(n=>vs(n,e));return new Qe(r)}case"sparse-union":case"dense-union":{let r=t.children.map(n=>vs(n,e));return t.type==="dense-union"?new vc(t.typeIds,r):new Ec(t.typeIds,r)}case"dictionary":return new mr(o1(t.dictionary,e),NK(t.indices),t.id,t.isOrdered);default:throw new Error("array type not supported")}switch(t){case"null":return new Xt;case"binary":return NR("BinaryView",new Wn,e);case"binary-view":return FR("BinaryView");case"bool":return new en;case"int8":return new Gi;case"int16":return new Ui;case"int32":return new hr;case"int64":return new mi;case"uint8":return new ji;case"uint16":return new zi;case"uint32":return new Vn;case"uint64":return new _o;case"float16":return new So;case"float32":return new Mn;case"float64":return new pi;case"utf8":return NR("Utf8View",new Jr,e);case"utf8-view":return FR("Utf8View");case"date-day":return new dc;case"date-millisecond":return new mc;case"time-second":return new pc;case"time-millisecond":return new gc;case"time-microsecond":return new yc;case"time-nanosecond":return new bc;case"timestamp-second":return new wc;case"timestamp-millisecond":return new os;case"timestamp-microsecond":return new xc;case"timestamp-nanosecond":return new _c;case"interval-daytime":return new Sc;case"interval-yearmonth":return new Mc;default:throw new Error("array type not supported")}}function qx(t){return Ro[t]}function NR(t,e,r){let n=(r==null?void 0:r.viewTypes)||"never";if(n==="never")return e;let i=qx(t);if(i)return new i;if(n==="require")throw new Error(`${t} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return e}function FR(t){let e=qx(t);if(!e)throw new Error(`${t} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return new e}function NK(t){switch(t){case"int8":return new Gi;case"int16":return new Ui;case"int32":return new hr;case"uint8":return new ji;case"uint16":return new zi;case"uint32":return new Vn;default:throw new Error(`schema dictionary index type not supported: ${t}`)}}var Vx=p(()=>{"use strict";Lo()});function s1(t){let e=t==null?void 0:t.POSITION;if(!e||!("value"in e)||!e.value.length)return null;let r=1/0,n=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0,c=e.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 kR=p(()=>{"use strict"});var GR=p(()=>{"use strict";kR()});function UR(t){let e=Km();return new e(t)}function ul(t){return!!(eu&&t instanceof eu)}function jR(t,e,r){ul(t)?t[e]=r:t[e]=zR(r)}function Kh(t){return ul(t)?new Uint16Array(t.buffer,t.byteOffset,t.length):t}function Wx(t,e){let r=UR(t.length);for(let n=0;n<t.length;n++)jR(r,n,t[n]/e);return r}function zR(t){if(!Number.isFinite(t))return t===1/0?31744:t===-1/0?64512:32256;let e=t<0||Object.is(t,-0)?32768:0,r=Math.abs(t);if(r===0)return e;if(r>=65520)return e|31744;if(r>=65504)return e|31743;let n=Math.floor(Math.log2(r));if(n<-14)return e|Math.round(r/2**-24);let i=n+15,o=Math.round((r/2**n-1)*1024);return o===1024?e|i+1<<10:e|i<<10|o}var qR=p(()=>{"use strict";Cn()});var a1,$x,VR=p(()=>{"use strict";Lo();a1=new ve([new ee("POSITION",new Yt(3,new ee("value",new Mn,!1)),!1)]),$x=new ve([...a1.fields,new ee("indices",new dr(new ee("item",new Vn,!1)),!0)])});var Xh=p(()=>{"use strict";qR();VR()});function Hx(t,e,r){let n=FK(t,e,r);return new H([n])}function FK(t,e,r){let n=kK(t,e,r),i=n.children[0].type,o=r==="float16"&&ul(t)?Kh(t):t,s={[Ne.DATA]:o},a=new de(i,0,o.length,0,s);return new de(n,0,o.length/e,0,void 0,[a])}function kK(t,e,r){let n=r||VI(t).type,i=o1(n);return new Yt(e,new ee("value",i,!1))}var WR=p(()=>{"use strict";Xh();Lo();wb();Vx()});function Kx(t){var e;return HR(t.attributes,{schema:t.schema,topology:t.topology,mode:t.mode,boundingBox:(e=t.header)==null?void 0:e.boundingBox,indices:jK(t)?t.indices:void 0})}function HR(t,e={}){var s,a,c;let r=[],n={},i=UK(t);for(let l of i){let u=t[l],{value:h,size:d=1}=u,m=GK(h,d,u.componentType);if(n[l]=m,r.push(zK(e.schema,l,m,u.componentType)),l===i[0]&&((a=(s=e.indices)==null?void 0:s.value)!=null&&a.length)){let g=$x.fields.find(y=>y.name==="indices");n.indices=VK(e.indices.value,m.length,g.type),r.push(g)}}let o=new ve(r,WK(e));return((c=n[i[0]])==null?void 0:c.length)===0?new je(o):new je(o,n)}function GK(t,e,r){if(r==="float16"){let n=ul(t)?Kh(t):t;if(e===1){let i=new de(new So,0,n.length,0,{[Ne.DATA]:n});return new H([i])}return Hx(t,e,r)}return e===1?Eo(t):Hx(t,e)}function UK(t){let e=Object.keys(t),r=$R.filter(i=>i in t),n=e.filter(i=>!$R.includes(i));return[...r,...n]}function jK(t){var e,r;return!!((r=(e=t.indices)==null?void 0:e.value)!=null&&r.length)}function zK(t,e,r,n){if(e==="POSITION"&&qK(r)){let o=a1.fields[0],s=t==null?void 0:t.fields.find(c=>c.name===e);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=t==null?void 0:t.fields.find(o=>o.name===e);if(n==="float16"){let o=new Map(Object.entries((i==null?void 0:i.metadata)||{}));return o.set("componentType","float16"),new ee(e,r.type,!1,o)}if(i&&i.type.toString()!==r.type.toString()){let o=vs(i);return new ee(e,r.type,o.nullable,o.metadata)}return i?vs(i):new ee(e,r.type,!1)}function qK(t){return t.type instanceof Yt&&t.type.listSize===3&&t.type.children[0].type instanceof Mn}function VK(t,e,r){let n=r,i=t instanceof Uint32Array?t:Uint32Array.from(t),o=new Int32Array(e+1);e>0&&o.fill(i.length,1);let s=new Uint8Array(Math.ceil(e/8));e>0&&(s[0]=1);let a=new de(n.children[0].type,0,i.length,0,{[Ne.DATA]:i}),c=new de(n,0,e,Math.max(0,e-1),{[Ne.OFFSET]:o,[Ne.VALIDITY]:s},[a]);return new H([c])}function WK(t){var r;let e={...(r=t.schema)==null?void 0:r.metadata};return t.topology&&(e.topology||=t.topology),Number.isFinite(t.mode)&&(e.mode||=String(t.mode)),t.boundingBox&&(e.boundingBox||=JSON.stringify(t.boundingBox)),zx(e)}var $R,KR=p(()=>{"use strict";Xh();Xh();Lo();WR();Vx();$R=["POSITION"]});function Xx(t,e,r){let n=e.componentType||bb(e.value),i=r||c1(e),o=e.size===1?n:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]};return{name:t,type:o,nullable:!1,metadata:i}}function c1(t){let e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),t.componentType&&(e.componentType=t.componentType),t.transform&&(e["loaders.gl.transform"]=JSON.stringify(t.transform)),e}var XR=p(()=>{"use strict";wb()});var l1=p(()=>{"use strict";GR();KR();XR()});var u1=p(()=>{});var f1=p(()=>{});function Wu(t){return t.variadicBuffers??[]}function Yh(t,e,r,n,i,o,s,a){return Reflect.construct(de,[t,e,r,n,i,o,s,a])}var h1=p(()=>{Lo()});function fl(t){return t.metadata}function hl(t,e,r){if("metadata"in ze.prototype){let i=ze;return Object.assign(new i(t,e,r),{data:e})}let n=Object.assign(new ze(t,e),{data:e});return r===void 0?n:Object.assign(n,{metadata:r})}var d1=p(()=>{Lo()});function m1(t){var r;let e=t;return!!(e&&Number.isInteger(e.numRows)&&Array.isArray(e.batches)&&Array.isArray((r=e.schema)==null?void 0:r.fields)&&typeof e.get=="function"&&typeof e.getChild=="function")}function p1(t){var r,n;let e=t;return!!(e&&Number.isInteger(e.numRows)&&Array.isArray((r=e.schema)==null?void 0:r.fields)&&Array.isArray((n=e.data)==null?void 0:n.children)&&typeof e.get=="function"&&typeof e.getChild=="function")}var Yx=p(()=>{});function Jx(t,e={}){let r=new Set,n=new Set;for(let o of e.retain??[]){let s=m1(o)?o.batches.map(a=>a.data):YR(o)?o.data:[p1(o)?o.data:o];for(let a of s)Zx(a,r,n)}let i={...e,copies:new WeakMap,retainedBuffers:r};return m1(t)?$K(t,i):p1(t)?ZR(t,i):YR(t)?JR(t,i):g1(t,i)}function YR(t){return"data"in t&&Array.isArray(t.data)}function $K(t,e){let r=t.batches.map(n=>ZR(n,e));return new je(t.schema,r)}function ZR(t,e){let r=g1(t.data,e);return hl(t.schema,r,fl(t))}function g1(t,e){let r=t.children.map(o=>g1(o,e)),n=t.dictionary?JR(t.dictionary,e):void 0,i={[Ne.OFFSET]:Zh(t.buffers[Ne.OFFSET],e),[Ne.DATA]:Zh(t.buffers[Ne.DATA],e),[Ne.VALIDITY]:Zh(t.buffers[Ne.VALIDITY],e),[Ne.TYPE]:Zh(t.buffers[Ne.TYPE],e)};return Yh(t.type,t.offset,t.length,t._nullCount,i,r,n,Wu(t).map(o=>Zh(o,e)))}function JR(t,e){return new H(t.data.map(r=>g1(r,e)))}function Zx(t,e,r){var n;if(!r.has(t)){r.add(t);for(let i of[...Object.values(t.buffers),...Wu(t)])QR(i)&&e.add(i.buffer);for(let i of t.children)Zx(i,e,r);for(let i of((n=t.dictionary)==null?void 0:n.data)??[])Zx(i,e,r)}}function Zh(t,e){if(!QR(t))return t;let r=t.byteOffset!==0||t.byteLength!==t.buffer.byteLength;if(!e.retainedBuffers.has(t.buffer)&&e.copy!=="all"&&(e.copy==="none"||!r))return t;let n=e.copies.get(t);return n||(n=t instanceof Uint8Array?new Uint8Array(t):t.slice(),e.copies.set(t,n)),n}function QR(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var y1=p(()=>{Lo();d1();h1();Yx()});var Qx=p(()=>{h1();y1()});var e_=p(()=>{u1()});var t_=p(()=>{u1();f1();Qx();e_()});var rL=p(()=>{u1();t_()});var nL=p(()=>{f1()});function i_(t,e){let r=Jx(t,e);return{transport:"arrow-js",version:1,schema:ll(new je(r.schema,[])),metadataVersion:r.schema.metadataVersion,batches:r.batches.map(n=>{let i=fl(n);return{...r_(n.data),...i!==void 0?{metadata:[...i]}:{}}})}}function o_(t){if(t.transport!=="arrow-js"||t.version!==1)throw new Error("Unsupported Arrow column-buffer transport protocol.");let e=Ba(t.schema).schema,r=new ve(e.fields,e.metadata,e.dictionaries,t.metadataVersion),n=new Qe(r.fields),i=t.batches.map(o=>{let s=n_(o,n);return hl(r,s,o.metadata&&new Map(o.metadata))});return new je(r,i)}function r_(t){var e;return{offset:t.offset,length:t.length,nullCount:t.nullCount,buffers:{[Ne.OFFSET]:t.buffers[Ne.OFFSET],[Ne.DATA]:t.buffers[Ne.DATA],[Ne.VALIDITY]:t.buffers[Ne.VALIDITY],[Ne.TYPE]:t.buffers[Ne.TYPE]},children:t.children.map(r=>r_(r)),variadicBuffers:Wu(t),dictionary:(e=t.dictionary)==null?void 0:e.data.map(r=>r_(r))}}function n_(t,e){let r=t.children.map((i,o)=>n_(i,e.children[o].type)),n=t.dictionary&&j.isDictionary(e)?new H(t.dictionary.map(i=>n_(i,e.dictionary))):void 0;return Yh(e,t.offset,t.length,t.nullCount,t.buffers,r,n,t.variadicBuffers)}function iL(t,e){return i_(new je(t.schema,[t]),e)}function oL(t){if(t.batches.length!==1)throw new Error("Arrow record batch transport requires exactly one batch.");return o_(t).batches[0]}var sL=p(()=>{Lo();d1();h1();y1()});var aL=p(()=>{t_();e_();rL();f1();nL();y1();sL();Yx();Qx();d1()});var cL=p(()=>{aL()});function ZK(t,e={copy:"all"}){let r=t instanceof ze;if(!r&&!(t instanceof je))throw new Error("Workers require Arrow table output");return{transport:r?"arrow-record-batch":"arrow-table-columns",columns:r?{data:iL(t,e)}:eX(t,e)}}function JK(t){let e=t;if((e==null?void 0:e.transport)!=="arrow-table-columns"&&(e==null?void 0:e.transport)!=="arrow-record-batch"||!QK(e.columns))throw new Error("Workers require Arrow column transport");if(e.transport==="arrow-record-batch"&&!e.columns.arrowBatchMetadata)return oL(e.columns.data);let r=rX(e.columns);return e.transport==="arrow-record-batch"?r.batches[0]:r}function lL(t,e){var i;let r=e,n=((i=r==null?void 0:r.core)==null?void 0:i.workerTransferBufferCopy)??(r==null?void 0:r.workerTransferBufferCopy);return t instanceof je||t instanceof ze?ZK(t,{copy:n??"all"}):t}function uL(t){let e=t==null?void 0:t.transport;return e==="arrow-table-columns"||e==="arrow-record-batch"?JK(t):t}function QK(t){var r;let e=t;return((r=e==null?void 0:e.data)==null?void 0:r.transport)==="arrow-js"&&Array.isArray(e.data.batches)}function eX(t,e){return{arrowBatchMetadata:tX(t),data:i_(t,e)}}function tX(t){return t.batches.map(e=>({schema:ll(new je(e.schema,[]))}))}function rX(t){let{arrowBatchMetadata:e,data:r}=t,n=o_(r),i=n.batches.map((o,s)=>{let a=e==null?void 0:e[s];return a?hl(Ba(a.schema).schema,o.data,a.metadata?new Map(a.metadata):fl(o)):o});return new je(n.schema,i)}var fL=p(()=>{"use strict";Lo();cL()});var hL,dL=p(()=>{"use strict";hL="5.0.0-beta.11"});var mL,pL=p(()=>{"use strict";mL={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var gL,yL=p(()=>{"use strict";gL={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow",decoderProfile:"full"}});async function Jh(t,e=null,r={},n=null,i=null){var o;if(Ii&&r.useLocalLibraries&&!r.CDN&&n&&((o=r.modules)==null?void 0:o[n])===void 0){let s=Xa?"./libs":`modules/${e}/dist/libs`;r={...r,modules:{[n]:`${s}/${n}`,...i?{[i]:`${s}/${i}`}:{},...r.modules}}}return await $l(t,e,r,n,i)}var bL=p(()=>{"use strict";Qa()});var nX,iX,Qh,wL,Ft,ed,xL=p(()=>{"use strict";nX="1.5.7",iX="8786740086a9f4d83f44aa83badfbea4dce7a1b5",Qh=`https://www.gstatic.com/draco/versioned/decoders/${nX}`,wL=`https://cdn.jsdelivr.net/gh/google/draco@${iX}/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"},ed={[Ft.DECODER]:`${Qh}/${Ft.DECODER}`,[Ft.DECODER_WASM]:`${Qh}/${Ft.DECODER_WASM}`,[Ft.GLTF_DECODER]:`${Qh}/${Ft.GLTF_DECODER}`,[Ft.GLTF_DECODER_WASM]:`${Qh}/${Ft.GLTF_DECODER_WASM}`,[Ft.FALLBACK_DECODER]:`${Qh}/${Ft.FALLBACK_DECODER}`,[Ft.ENCODER]:`${wL}/${Ft.ENCODER}`,[Ft.ENCODER_WASM]:`${wL}/${Ft.ENCODER_WASM}`}});async function b1(t={},e,r="full"){let n=cX(t);return n?await s_(n):await oX(t,e==="js"?"javascript":e,r)}async function oX(t={},e,r="full"){let n=uX(`${e}:${r}`,t),i=_L.get(n);return i||(i=sX(t,e,r),_L.set(n,i)),await i}async function s_(t){let e=lX(t),r=SL.get(e);return r||(r=zl(()=>e.createDecoderModule({}),n=>({draco:n})),SL.set(e,r)),await r}async function sX(t,e,r){try{return await vL(t,e,r)}catch(n){if(e==="javascript")throw n;try{return await vL(t,"javascript","full")}catch(i){throw new AggregateError([n,i],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function vL(t,e,r){let n=ML.then(()=>aX(t,e,r));return ML=n.then(()=>{},()=>{}),await n}async function aX(t,e,r){if(e==="javascript"){let s;try{s=await Jh(ed[Ft.FALLBACK_DECODER],"scene",t,Ft.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(Ii||t.useLocalLibraries)throw c;s=await Jh(ed[Ft.FALLBACK_DECODER],"scene",{...t,useLocalLibraries:!0},Ft.FALLBACK_DECODER,"draco_decoder.mjs")}let a=AL(s,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await TL(a)}let n,i;try{[n,i]=await EL(t,r)}catch(s){if(Ii||t.useLocalLibraries)throw s;[n,i]=await EL({...t,useLocalLibraries:!0},r)}let o=AL(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await TL(o,i)}async function EL(t,e){let r=e==="gltf"?Ft.GLTF_DECODER:Ft.DECODER,n=e==="gltf"?Ft.GLTF_DECODER_WASM:Ft.DECODER_WASM;return await Promise.all([Jh(ed[r],"scene",t,r,e==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),Jh(ed[n],"scene",t,n)])}function TL(t,e){if(typeof t!="function")throw new Error("Draco module initializer could not be loaded");return zl(r=>t({...e?{wasmBinary:e}:{},onModuleLoaded:r}),r=>({draco:r}))}function AL(t,e){if(typeof t=="function")return t;if(t&&typeof t=="object"){let r=t,n=r[e]||r.default;return typeof n=="function"?n:void 0}}function cX(t){var r;let e=(r=t.modules)==null?void 0:r.draco3d;if(e){if(typeof e!="object"&&typeof e!="function")throw new Error("Invalid draco3d module");return e}}function lX(t){let e=t;if(typeof(e==null?void 0:e.createDecoderModule)!="function")throw new Error("Invalid draco3d decoder module");return e}function uX(t,e){let r=Object.entries(e.modules||{}).filter(([n])=>n!=="draco3d").map(([n,i])=>`${n}:${String(i)}`).sort().join("|");return[t,e.useLocalLibraries?"local":"remote",e.CDN||"",r].join("|")}var _L,SL,ML,w1=p(()=>{"use strict";fi();bL();xL();_L=new Map,SL=new WeakMap;ML=Promise.resolve()});function PL(t,e,r){let n=RL(e.metadata),i=[],o=fX(e.attributes);for(let s in t){let a=t[s],c=IL(s,a,o[s]);i.push(c)}if(r){let s=IL("indices",r);i.push(s)}return{fields:i,metadata:n}}function fX(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function IL(t,e,r){let n={...c1(e),...r?RL(r.metadata):{}};return Xx(t,e,n)}function RL(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var LL=p(()=>{"use strict";l1()});function pX(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function gX(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function yX(t){let e=t.size(),r=new Uint32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function bX(t,e){if(!Object.prototype.hasOwnProperty.call(e,t))return t;let r=/^(.*)_([0-9]+)$/.exec(t),n=r?r[1]:t,i=r?BigInt(r[2])+1n:1n;for(;Object.prototype.hasOwnProperty.call(e,`${n}_${i}`);)i++;return`${n}_${i}`}function wX(t){var e;if(t.quantization_transform){let{quantization_bits:r,min_values:n,range:i}=t.quantization_transform;if(r!==void 0&&n&&i!==void 0)return{type:"quantization",bits:r,origin:Array.from(n),range:i}}if(((e=t.octahedron_transform)==null?void 0:e.quantization_bits)!==void 0)return{type:"octahedron",bits:t.octahedron_transform.quantization_bits}}function xX(t){if(t.includeAttributes&&t.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function _X(t,e){for(let r of t.includeAttributes||t.excludeAttributes||[])if(!e.includes(r))throw new Error(`DracoLoader: selected attribute "${r}" does not exist`)}function SX(t){var a;let e=s1(t);if(!e)throw new Error("Decoded mesh is missing positions");let r=t.POSITION;if(((a=r==null?void 0:r.transform)==null?void 0:a.type)!=="quantization")return e;let{bits:n,origin:i,range:o}=r.transform,s=o/(2**n-1);return e.map(c=>c.map((l,u)=>i[u]+l*s))}var OL,hX,dX,mX,td,CL=p(()=>{"use strict";fi();l1();LL();OL={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},hX={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},dX=2,mX=4,td=class{constructor(e,r=Ai()){this.logger=r;this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}logger;draco;decoder;metadataQuerier;destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,r={}){xX(r);let n=ArrayBuffer.isView(e)?new Int8Array(e.buffer,e.byteOffset,e.byteLength):new Int8Array(e);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=SX(c.attributes),u=PL(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(e,r,n){let i=this._getTopLevelMetadata(e),o=this._getDracoAttributes(e,n);return{geometry_type:r,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:i,attributes:o}}_getDracoAttributes(e,r){let n={};for(let i=0;i<e.num_attributes();i++){let o=this.decoder.GetAttribute(e,i),s=this._getAttributeMetadata(e,i);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:i,metadata:s};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(o,r);c&&(n[o.unique_id()].octahedron_transform=c)}return n}_getMeshData(e,r,n){let i=this._getMeshAttributes(r,e,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");return e instanceof this.draco.Mesh?n.topology==="triangle-strip"?{topology:"triangle-strip",mode:5,attributes:i,indices:{value:this._getTriangleStripIndices(e),size:1}}:{topology:"triangle-list",mode:4,attributes:i,indices:{value:this._getTriangleListIndices(e),size:1}}:{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(e,r,n){let i={},o={},a=Object.values(e.attributes).sort((c,l)=>c.attribute_index-l.attribute_index).map(c=>{let l=this._deduceAttributeName(c,n),u=bX(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:wX(l)}}}return i}_shouldExtractAttribute(e,r,n){var i,o;if(r.attribute_type===this.draco.POSITION){if((i=n.excludeAttributes)!=null&&i.includes(e))throw new Error(`DracoLoader: position attribute "${e}" cannot be excluded`);return!0}return n.includeAttributes&&!n.includeAttributes.includes(e)?!1:!((o=n.excludeAttributes)!=null&&o.includes(e))}_getTriangleListIndices(e){let n=e.num_faces()*3,i=e.num_points()<=65536,o=n*(i?dX:mX),s=this.draco._malloc(o);try{if(i){if(!this.decoder.GetTrianglesUInt16Array(e,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(e,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(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),yX(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=hX[r.data_type];if(!n)return this.logger.warn(`DRACO: Unsupported attribute type ${r.data_type}`)(),null;let i=r.num_components,s=e.num_points()*i,a=s*n.BYTES_PER_ELEMENT,c=pX(this.draco,n),l,u=this.draco._malloc(a);try{let h=this.decoder.GetAttribute(e,r.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(e,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(e,r){let n=e.unique_id;for(let[s,a]of Object.entries(r.extraAttributes||{}))if(a===n)return s;let i=r.attributeNameEntry||"name";if(e.metadata[i]){let s=e.metadata[i].string;return s==="COLOR"?"COLOR_0":s==="TEX_COORD"?"TEXCOORD_0":s}let o=e.attribute_type;for(let s in OL)if(this.draco[s]===o)return OL[s];return`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let r=this.decoder.GetMetadata(e);return this._getDracoMetadata(r)}_getAttributeMetadata(e,r){let n=this.decoder.GetAttributeMetadata(e,r);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(e);for(let i=0;i<n;i++){let o=this.metadataQuerier.GetEntryName(e,i);r[o]=this._getDracoMetadataField(e,o)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let i=gX(n);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=e,i=[...r,...n];for(let o of i)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,i=e.attribute_type();if(n.map(s=>this.draco[s]).includes(i)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:Float32Array.from({length:e.num_components()},(a,c)=>s.min_value(c))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,i=e.attribute_type();if(n.map(s=>this.draco[s]).includes(i)){let s=new this.draco.AttributeOctahedronTransform;try{if(s.InitFromAttribute(e))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}}});async function $u(t,e,r,n){var a,c;let i=(n==null?void 0:n.reportProgress)||(e==null?void 0:e.onProgress);i==null||i({phase:"decode",completed:0,total:1,unit:"tasks"});let{draco:o}=await r();(a=(e==null?void 0:e.signal)||(n==null?void 0:n.signal))==null||a.throwIfAborted();let s=new td(o,Ai(e));try{let l=s.parseSync(t,e==null?void 0:e.draco);return i==null||i({phase:"decode",completed:1,total:1,unit:"tasks"}),((c=e==null?void 0:e.draco)==null?void 0:c.shape)==="arrow"?Kx(l):l}finally{s.destroy()}}var x1=p(()=>{"use strict";fi();l1();CL()});var gwe,MX,vX,BL=p(()=>{"use strict";Qa();w1();x1();rd();({preload:gwe,...MX}=vi),vX={...MX,parse:async(t,e,r)=>await $u(t,e,async()=>{var n;return await b1(Ja({core:e==null?void 0:e.core,modules:e==null?void 0:e.modules}),"wasm",(n=e==null?void 0:e.draco)==null?void 0:n.decoderProfile)},r)}});var DL={};Jt(DL,{DracoWASMLoaderWithParser:()=>vX});var NL=p(()=>{"use strict";BL()});var Mwe,EX,TX,FL=p(()=>{"use strict";Qa();w1();x1();rd();({preload:Mwe,...EX}=vi),TX={...EX,parse:async(t,e,r)=>await $u(t,e,async()=>await b1(Ja({core:e==null?void 0:e.core,modules:e==null?void 0:e.modules}),"js"),r)}});var kL={};Jt(kL,{DracoJavaScriptLoaderWithParser:()=>TX});var GL=p(()=>{"use strict";FL()});function PX(t){var r;let e=(r=t==null?void 0:t.modules)==null?void 0:r.draco3d;if(!e)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return e}var Pwe,AX,IX,UL=p(()=>{"use strict";w1();x1();rd();({preload:Pwe,...AX}=vi),IX={...AX,parse:async(t,e,r)=>await $u(t,e,async()=>await s_(PX(e)),r)}});var jL={};Jt(jL,{Draco3DLoaderWithParser:()=>IX});var zL=p(()=>{"use strict";UL()});async function RX(t,e){var n;let r=e;switch(LX(r)){case"wasm":{let{DracoWASMLoaderWithParser:i}=await Promise.resolve().then(()=>(NL(),DL));return i}case"javascript":{let{DracoJavaScriptLoaderWithParser:i}=await Promise.resolve().then(()=>(GL(),kL));return i}case"draco3d":{let{Draco3DLoaderWithParser:i}=await Promise.resolve().then(()=>(zL(),jL));return i}default:throw new Error(`DracoLoader: unsupported backend "${(n=r==null?void 0:r.draco)==null?void 0:n.backend}"`)}}function LX(t){var e;return(e=t==null?void 0:t.draco)!=null&&e.backend?t.draco.backend==="js"?"javascript":t.draco.backend:vi.options.draco.backend}var vi,rd=p(()=>{"use strict";fL();dL();pL();yL();vi={defaultShape:"arrow",supportsNativeArrow:!0,dataType:null,batchType:null,...mL,version:hL,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:lL,deserializeWorkerResult:uL,options:{draco:gL},preload:RX}});var a_=p(()=>{"use strict";qI();rd()});function nd(t){let e=t.trim().toUpperCase(),r=e.match(/(?:\/DEF\/CRS\/|URN:OGC:DEF:CRS:)([A-Z0-9_-]+)(?:\/|::)(?:[^/:]*[/:])?([A-Z0-9_.-]+)$/);return r?`${r[1]}:${r[2]}`:e}var Hu,_1,c_=p(()=>{"use strict";Hu="EPSG:4326",_1="EPSG:4978"});function Oo(t){var r,n;if(typeof t=="string"){let i=wr(t);return i==="wkt"?CX(t):i==="proj-string"?BX(t):OX(t)||"projected"}let e=t;return e.type==="BoundCRS"&&e.source_crs?Oo(e.source_crs):e.type==="CompoundCRS"&&((r=e.components)!=null&&r[0])?Oo(e.components[0]):String(e.type).includes("Projected")?"projected":String(e.type).includes("Geographic")?"geographic":String(e.type).includes("Geodetic")?((n=e.coordinate_system)==null?void 0:n.subtype)==="Cartesian"?"geocentric":"geographic":"unknown"}function OX(t){if(typeof t!="string")return;let e=nd(t);if(e===_1)return"geocentric";if(e===Hu||e==="OGC:CRS84")return"geographic";let r=/^EPSG:(\d+)$/.exec(e);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 CX(t){let e;try{e=kf(t).root}catch{return"unknown"}switch(e.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=e.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 BX(t){var e;try{let r=(e=Gf(t).parameters.find(n=>n.name.toLowerCase()==="proj"))==null?void 0:e.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 l_=p(()=>{"use strict";t2();c_()});function S1(t,e={}){let r=e.sourceCrs!==void 0,n=e.sourceCrs||t.sourceCrs,i=e.outputCoordinates||"auto",o=e.targetCrs||(i==="ecef"?"EPSG:4978":void 0),s=e.targetHeightReference||"native",a=t.verticalUnitScale??1,c=t.elevationUnitScale??1,l=t.elevationOffset||0,u=t.elevationMode==="onTheGround"||t.elevationMode==="relativeToGround"||t.elevationMode==="relativeToScene",h=t.elevationMode==="relativeToScene"?!!e.sceneElevationProvider:!u||!!e.terrainElevationProvider,d=a!==1||c!==1||t.elevationMode!==void 0&&(u||t.elevationMode==="absoluteHeight"&&l!==0),m=s!=="native"&&s!==t.heightReference,g=!!o||s!=="native"||i!=="auto"||d,y=i!=="target-crs"||!!o,b=!m||(t.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":t.provenance||"unknown",M=r&&n?Oo(n):t.coordinateFrame,v=r?"explicit":t.sourceCrsState||(n?S==="format-default"?"default":"explicit":"absent"),C=Em({crs:n?{state:v==="default"?"default":"explicit",definition:n,representation:!r&&t.sourceCrsRepresentation||wr(n),provenance:S,alternatives:r?void 0:t.sourceCrsAlternatives}:{state:v==="unknown"?"unknown":"absent",provenance:S},vertical:t.verticalCrs?{state:"explicit",definition:t.verticalCrs,representation:wr(t.verticalCrs),provenance:t.provenance||"metadata"}:void 0,coordinateEpoch:e.coordinateEpoch??t.coordinateEpoch,coordinateFrame:M,coordinateOrder:NX(t.axisOrder),units:r?void 0:t.units}),R=u_(C.crs),E=C.vertical?u_(C.vertical):void 0,U=o?DX(o):void 0;return Object.freeze({...C,sourceCrs:R,verticalCrs:E,verticalUnitScale:a,coordinateEpoch:e.coordinateEpoch??t.coordinateEpoch,heightReference:t.heightReference||"unknown",elevationMode:t.elevationMode,elevationOffset:t.elevationOffset,elevationUnit:t.elevationUnit,elevationUnitScale:c,coordinateFrame:M||"unknown",axisOrder:t.axisOrder||"unknown",provenance:S,targetCrs:U,targetHeightReference:s,outputCoordinates:i,status:g?_?"transformable":"unresolved":"native",warnings:Object.freeze([...t.warnings||[]])})}function u_(t){return t.state==="explicit"||t.state==="default"?t.definition:void 0}function DX(t){let e=Em({crs:{state:"explicit",definition:t,representation:wr(t),provenance:"caller-override"}}),r=u_(e.crs);if(!r)throw new Error("Failed to normalize a known target CRS definition");return r}function NX(t){switch(t){case"xy":return["x","y"];case"yx":return["y","x"];case"xyz":return["x","y","z"];default:return[]}}function qL(t){if(t.status!=="transformable"&&t.status!=="transformed")throw new Error("Only a transformable spatial reference can be marked as transformed");return Object.freeze({...t,status:"transformed"})}var VL=p(()=>{"use strict";t2();l_()});function WL(t){if(!t)return;let e=t.trim().toLowerCase().replaceAll("_","-"),r=kX[e]||e;return FX[r]}var FX,kX,$L=p(()=>{"use strict";FX=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}),kX=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 HL(t){return{input:new Float64Array(t),output:new Float64Array(t)}}function id(t){return t instanceof Float32Array||t instanceof Float64Array}function KL(t){return typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function f_(t,e,r,n,i,o){return(t.buffer===n.buffer||KL(t.buffer)&&KL(n.buffer))&&e<o&&i<r}function M1(t,e,r,n){return t<e+n?0:Math.floor((t-e-n)/r)+1}var v1,XL=p(()=>{v1=class{constructor(e){var o,s;this.depth=0;let r=e.dimension??2,n=e.inputOffset??0,i=e.outputOffset??0;if(!Number.isSafeInteger(r)||r<2||!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(i)||i<0||e.inputStride!==void 0&&(!Number.isSafeInteger(e.inputStride)||e.inputStride<1)||e.outputStride!==void 0&&(!Number.isSafeInteger(e.outputStride)||e.outputStride<1)||typeof((o=e.projection)==null?void 0:o.projectToSync)!="function"||typeof((s=e.projection)==null?void 0:s.unprojectToSync)!="function")throw new Error("Invalid projection buffer transform or layout");this.dimension=r,this.projection=e.projection,this.inputOffset=n,this.outputOffset=i,this.inputStride=e.inputStride,this.outputStride=e.outputStride,this.scratch=[HL(r)]}projectFlatTo(e,r,n,i=0,o){return this.flat(e,r,n,i,!1,o)}unprojectFlatTo(e,r,n,i=0,o){return this.flat(e,r,n,i,!0,o)}projectColumnsTo(e,r,n,i=0,o){return this.columns(e,r,n,i,!1,o)}unprojectColumnsTo(e,r,n,i=0,o){return this.columns(e,r,n,i,!0,o)}range(e,r,n){let i=r??Math.max(0,e-n);if(!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(i)||i<0||!Number.isSafeInteger(n+i)||n+i>e)throw new Error("Invalid projection buffer record range");return i}epochStorage(e,r,n){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e))throw new Error("Coordinate epoch must be finite")}else if(!id(e)||e.length<r+n)throw new Error("Epoch buffer requires one value per addressed record")}}aliases(e,r,n,i,o,s,a){if(!i)return;let c=e.byteOffset+(this.inputOffset+n*o)*e.BYTES_PER_ELEMENT,l=c+((i-1)*o+a)*e.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=e.buffer===r.buffer&&e.constructor===r.constructor&&c===u&&o===s;if(f_(e,c,l,r,u,h)&&!d)throw new Error("Projection input/output ranges overlap without an exact in-place mapping")}epochAlias(e,r,n,i,o,s){if(typeof e!="object"||!e||!i)return;let a=e.byteOffset+n*e.BYTES_PER_ELEMENT,c=a+i*e.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(f_(e,a,c,r,l,u))throw new Error("Epoch and output buffers must not overlap")}acquire(){var e;let r=this.depth++;return(e=this.scratch)[r]||(e[r]=HL(this.dimension)),this.scratch[r]}transform(e,r,n){if(n!==void 0&&!Number.isFinite(n))throw new Error("Coordinate epoch must be finite");r?this.projection.unprojectToSync(e.input,e.output,n):this.projection.projectToSync(e.input,e.output,n)}floatRange(e,r){for(let n=0;n<this.dimension;n++){let i=e[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(e,r,n,i,o,s){if(!id(e)||!id(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(M1(e.length,this.inputOffset,a,this.dimension),n,i);if(i+l>M1(r.length,this.outputOffset,c,this.dimension))throw new Error("Projection output buffer is too short");this.epochStorage(s,i,l),this.aliases(e,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]=e[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(e,r,n,i,o,s){if(e.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(!id(e[d])||!id(r[d]))throw new Error("Projection columns require floating typed arrays");l=Math.min(l,M1(e[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>M1(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(e[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(f_(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]=e[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 YL(){return{bounds:[[-1,-1,0],[1,1,0]]}}var ZL=p(()=>{});function d_(){let t=globalThis;return t[h_]||(t[h_]=new WeakMap),t[h_]}function JL(t){var e;return"create"in t?t:(e=d_().get(t))==null?void 0:e.implementation}function QL(t){if("create"in t)return Promise.resolve(t);let e=d_().get(t);if(e||(e={load:()=>t.preload()},d_().set(t,e)),e.implementation)return Promise.resolve(e.implementation);let r=e;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"||![t.name,...t.aliases||[]].every(s=>o.has(i(s))))throw new Error("Loaded projection does not match descriptor: "+t.name);return r.implementation=n,n}).catch(n=>{throw r.pending=void 0,n})),r.pending}var h_,eO=p(()=>{h_=Symbol.for("@math.gl/projection/projection-implementations")});function dl(t,e,r){if(!(Array.isArray(t)||t instanceof Float32Array||t instanceof Float64Array))throw new Error("Scalar input requires a number array, Float32Array or Float64Array");if(!(Array.isArray(e)||e instanceof Float32Array||e instanceof Float64Array)||e.length<r)throw new Error("Scalar output requires a preallocated number array, Float32Array or Float64Array with sufficient capacity");if(t===e||Array.isArray(t)||Array.isArray(e))return;let n=t,i=e,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 od(t,e,r,n){if(e instanceof Float32Array){if(Math.abs(r.x)>E1||Math.abs(r.y)>E1||n>=3&&Math.abs(r.z)>E1)throw new Error("Projected coordinate exceeds Float32 range");for(let i=3;i<t.length;i++){let o=t[i];if(Number.isFinite(o)&&Math.abs(o)>E1)throw new Error("Trailing ordinate exceeds Float32 range")}}for(let i=3;i<t.length;i++)e[i]=t[i];return e[0]=r.x,e[1]=r.y,n>=3&&(e[2]=r.z),e}var E1,m_=p(()=>{E1=34028234663852886e22});function Ge(t){throw new ti("missing-transform-stage",t)}var tO,rO,ti,Da=p(()=>{rO=Symbol.for("@math.gl/projection/TypeScriptCRSError"),ti=class t extends Error{static[(tO=rO,Symbol.hasInstance)](e){return this!==t?Function.prototype[Symbol.hasInstance].call(this,e):e instanceof Error&&e[rO]===!0}constructor(e,r){super(r),this.reason=e,this[tO]=!0,this.name="TypeScriptCRSError"}}});function sd(t,e){if(typeof t=="string"||"type"in t)return{definition:t,lossy:!1};let r=t,n="crs"in r?r:void 0,i="crs"in r?r.crs:r;if(i.state!=="explicit"&&i.state!=="default")throw new ti("unknown-syntax","Cannot transform an "+i.state+" CRS reference");let o=!1;return(n==null?void 0:n.coordinateEpoch)!==void 0&&Ge("Coordinate epochs require a time-dependent transformation"),n!=null&&n.vertical&&n.vertical.state!=="absent"&&(e.mode!=="horizontal"&&Ge("A separately declared vertical CRS requires explicit horizontal extraction"),o=!0),{definition:i.definition,spatialReference:n,lossy:o}}function nO(t,e){var o;if(!e)return t;if(e.coordinateFrame!=="unknown"&&e.coordinateFrame!==t.kind)throw new Error("SpatialReference coordinate frame disagrees with its CRS");let r=e.coordinateOrder,n=t.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"))&&Ge("Unsupported SpatialReference coordinate order"),(r.length>4||r.length>3&&!["m","measure"].includes(r[3]))&&Ge("Unsupported fourth coordinate component")),(o=e.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(e.units.length,3);a++){let c=(i||"enu")[a]==="u",l=t.kind==="geocentric"?t.toMeter:c?t.verticalUnit:t.kind==="geographic"?t.angularUnit:t.toMeter;(Math.abs((s[e.units[a]]??NaN)-l)>1e-12||s[e.units[a]]===void 0)&&Ge("SpatialReference units disagree with its CRS")}}return Object.freeze({...t,storedAxis:i})}var p_=p(()=>{Da()});function Ku(t){var i;if(!((i=t.datumCatalogs)!=null&&i.length))return g_;let e=sO.get(t);if((e==null?void 0:e.catalogs)===t.datumCatalogs)return e.definitions;let r=Object.assign(Object.create(null),g_),n=new Map(Object.entries(g_).map(([o,s])=>[ml(o),{definition:s,owner:-1}]));return t.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=ml(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}}),sO.set(t,{catalogs:t.datumCatalogs,definitions:r}),r}var iO,oO,g_,sO,ml,T1=p(()=>{iO={towgs84:"0,0,0",ellipse:"WGS84"},oO={towgs84:"0,0,0",ellipse:"GRS80"},g_={wgs84:iO,WGS84:iO,nad83:oO,North_American_Datum_1983:oO},sO=new WeakMap,ml=t=>t.toLowerCase().replace(/[\s_-]/g,"")});var GX,aO,cO=p(()=>{GX={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)"}},aO=GX});var In,lO,uO=p(()=>{In={};In.greenwich=0;In.lisbon=-9.131906111111;In.paris=2.337229166667;In.bogota=-74.080916666667;In.madrid=-3.687938888889;In.rome=12.452333333333;In.bern=7.439583333333;In.jakarta=106.807719444444;In.ferro=-17.666666666667;In.brussels=4.367975;In.stockholm=18.058277777778;In.athens=23.7163375;In.oslo=10.722916666667;lO=In});function y_(t,e){let r=Object.keys(t).find(n=>hO(n)===hO(e));return r===void 0?void 0:t[r]}function dO(t){if(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(t)){let r=Number(t);if(Number.isFinite(r))return r}if(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?r$/i.test(t)){let r=Number(t.slice(0,-1))/At;if(Number.isFinite(r))return r}let e=/^([+-]?)(\d+(?:\.\d*)?)(?:d(?:(\d+(?:\.\d*)?)'(?:(\d+(?:\.\d*)?)")?)?)?([NSEW])?$/i.exec(t);if(e&&(/d/i.test(t)||e[5])){let r=Number(e[3]||0),n=Number(e[4]||0);if(r<60&&n<60){let i=e[1]==="-"?-1:1,o=/[SW]/i.test(e[5]||"")?-1:1,s=i*o*(Number(e[2])+r/60+n/3600);if(Number.isFinite(s))return s}}throw new Error("Invalid angular parameter: "+t)}function b_(t,e={}){let r=t,n=e.aliases||{},i=new Set;for(;typeof r=="string"&&(Co(n,r)||Co(fO,r));){if(i.has(r))throw new Error("Circular CRS alias: "+r);i.add(r),r=Co(n,r)?n[r]:fO[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 Es(t,e={}){var U;let r=Ku(e),n=sd(t,e),i=b_(n.definition,e),o;if(wr(i)==="proj-string"&&typeof i=="string"){let I=Object.create(null);for(let O of Gf(i).parameters){if(Co(I,O.name))throw new Error("Duplicate PROJ parameter: +"+O.name);I[O.name]=O.value}o={parameters:I}}else{let I=(U=e.parsers)==null?void 0:U.find(O=>O.canParse(i));if(!I){let O=["wkt","projjson"].includes(wr(i));throw new ti(O?"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=I.parse(i,e)}let s={...o.parameters};for(let I 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[I]!==void 0&&(s[I]=String(dO(s[I])));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"?y_(r,h):void 0;h&&h!=="none"&&!d&&Ge("Unknown datum: "+h+"; register a datumCatalogs plugin");let m=pO(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(I=>{let O=I.startsWith("@"),A=O?I.slice(1):I;if(!A||/\s/.test(A))throw new Error("Invalid datum grid name");return Object.freeze({name:A,optional:O})}),b=s.towgs84??(d==null?void 0:d.towgs84),w;if(b!==void 0&&(w=b.split(",").map(I=>re({value:I},"value",NaN)),![3,7].includes(w.length)||w.some(I=>!Number.isFinite(I))||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"?pO({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 M=o.angularUnit??At;if(u==="geographic"&&(s.units&&s.units!=="degrees"||Co(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 v=mO(s,"units","to_meter"),C=o.verticalUnit??mO(s,"vunits","vto_meter");if(!(C>0)||!Number.isFinite(C))throw new Error("Invalid vertical unit");if(!(M>0)||!Number.isFinite(M))throw new Error("Invalid angular unit");let R=s.pm,E=R===void 0?0:(y_(lO,R)??dO(R))*At;return nO(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:M,toMeter:v,verticalUnit:C,primeMeridian:E,axis:S,longitudeWrap:s.lon_wrap===void 0?void 0:Number(s.lon_wrap)*At,lossy:!!(o.lossy||n.lossy)}),n.spatialReference)}function mO(t,e,r){let n=t[e],i=Uf;if(e==="vunits"&&n==="degrees")throw new Error("Height requires linear units");if(n&&!["m","degrees"].includes(n)&&!Co(i,n))throw new Error("Unsupported units: "+n);let o=re(t,r,n&&i[n]?i[n].metersPerUnit:1);if(!(o>0))throw new Error("+"+r+" must be positive");return o}function pO(t,e){let r=e||t.ellps||"WGS84",n=y_(aO,r);if(!n)throw new Error("Unsupported ellipsoid: "+r);let i=re(t,"a",n.a),o=re(t,"f",NaN),s=re(t,"rf",Number.isNaN(o)?n.rf||0:o===0?0:1/o),a=re(t,"b",s?i*(1-1/s):Co(t,"f")||Co(t,"rf")||Co(t,"a")?i:n.b||i),c=re(t,"R",0);if(i<=0||a<=0||a>i||s<0||s>0&&s<=1||Co(t,"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 fO,A1,gO,Co,hO,Xu=p(()=>{Hl();Qy();p_();Vt();T1();cO();uO();e2();Da();fO={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"},A1=["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"],gO=["no_defs","over"],Co=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),hO=t=>t.toLowerCase().replace(/[\s_-]/g,"")});function R1(t,e){if(Math.abs(t.y)>Math.PI/2)throw new Error("Latitude outside geocentric domain");if(!qf(t,e))throw new Error("Geocentric coordinate must be finite")}function L1(t,e){let r=t.x,n=t.y,i=t.z,{semiMajorAxis:o,semiMinorAxis:s,eccentricitySquared:a}=e;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");t.x=0,t.y=Math.sign(i)*Math.PI/2,t.z=Math.abs(i)-s;return}if(!Vf(t,e))throw Number.isFinite(Math.hypot(r,n,i))?new Error("Geocentric inverse did not converge"):new Error("Geocentric radius must be finite")}function yO(t,e){let r=t[0],n=t[1],i=t[2],o=(t[3]||0)*w_,s=(t[4]||0)*w_,a=(t[5]||0)*w_,c=1+(t[6]||0)/1e6;return e?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 P1(t){var e;return!!((e=t.towgs84)!=null&&e.some(r=>r!==0))}function __(t,e){if(!(!t.towgs84||!e.towgs84)){if(t.grids||e.grids){if(t.grids&&e.grids&&t.ellipsoid.semiMajorAxis===e.ellipsoid.semiMajorAxis&&t.ellipsoid.eccentricitySquared===e.ellipsoid.eccentricitySquared&&t.grids.length===e.grids.length&&t.grids.every((n,i)=>n.name===e.grids[i].name&&n.optional===e.grids[i].optional&&n.grid===e.grids[i].grid))return;let r=__(t.grids?I1:t,e.grids?I1:e);return n=>{t.grids&&bO(n,t,!1),r==null||r(n),e.grids&&bO(n,e,!0)}}if(P1(t)||P1(e)){let r=x_(t,I1),n=x_(I1,e);return i=>{r==null||r(i),n==null||n(i)}}return x_(t,e)}}function x_(t,e){if(!t.towgs84||!e.towgs84)return;let r=t.ellipsoid,n=e.ellipsoid,i=!0;for(let a=0;a<7;a++)(t.towgs84[a]||0)!==(e.towgs84[a]||0)&&(i=!1);if(r.semiMajorAxis===n.semiMajorAxis&&Math.abs(r.eccentricitySquared-n.eccentricitySquared)<=5e-11&&i)return;let o=P1(t)?yO(t.towgs84,!1):void 0,s=P1(e)?yO(e.towgs84,!0):void 0;return a=>{R1(a,r),o==null||o(a),s==null||s(a),L1(a,n)}}function bO(t,e,r){for(let n of e.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(t,r);else{let o=n.grid.shift(t.x,t.y,r);o&&(t.x=o[0],t.y=o[1],i=!0)}if(i){if(!Number.isFinite(t.x)||!Number.isFinite(t.y)||Math.abs(t.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: "+e.grids.map(n=>n.name).join(","))}function wO(t,e){let r={x:t[0],y:t[1],z:t[2]};return R1(r,e),[r.x,r.y,r.z]}function xO(t,e){let r={x:t[0],y:t[1],z:t[2]};return L1(r,e),[r.x,r.y,r.z]}var w_,I1,S_=p(()=>{Cn();w_=Math.PI/(180*3600),I1={ellipsoid:{semiMajorAxis:6378137,semiMinorAxis:6356752314245179e-9,eccentricitySquared:.0066943799901413165},towgs84:[0,0,0]}});function Na(t,e=0){let r=re(t,"lon_wrap",0)*At;return n=>ar(i=>{let o=Lr(i,r);return[[r+o[0],i[0][1],0],[r+o[1],i[1][1],0]]},n??[-180,-90,180,90],r,e)}var ad=p(()=>{Vt();lt();Ot()});function _O(t,e={}){if(t===void 0)return;let r=[];for(let n of t.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(e,o)?e[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||Ge("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 SO=p(()=>{Da()});function M_(t){let e=Object.freeze({...t.ellipsoid});return Object.freeze({kind:t.kind,projection:t.projection,parameters:Object.freeze(Object.fromEntries(Object.entries(t.parameters).map(([r,n])=>[r,n??null]))),ellipsoid:e,datum:Object.freeze({ellipsoid:Object.freeze({...t.datum.ellipsoid}),towgs84:t.datum.towgs84&&Object.freeze([...t.datum.towgs84]),grids:t.datum.grids&&Object.freeze(t.datum.grids.map(r=>Object.freeze({name:r.name,optional:r.optional,loaded:!!r.grid})))}),angularUnit:t.angularUnit,toMeter:t.toMeter,verticalUnit:t.verticalUnit,primeMeridian:t.primeMeridian,axis:t.axis,storedAxis:t.storedAxis,longitudeWrap:t.longitudeWrap,areaOfUse:t.areaOfUse&&Object.freeze([...t.areaOfUse]),lossy:t.lossy,algorithm:t.algorithm&&Object.freeze({...t.algorithm})})}function MO(t,e,r,n){let i=[];return t.algorithm||i.push("source-algorithm"),e.algorithm||i.push("target-algorithm"),(t.datum.grids||e.datum.grids||t.parameters.geoidgrids||e.parameters.geoidgrids)&&i.push("grid-resource"),Object.freeze({version:1,source:t,target:e,forward:r,inverse:n,lossy:t.lossy||e.lossy,complete:i.length===0,opaqueReasons:Object.freeze(i)})}var vO=p(()=>{});function EO(t){let e=PO(t.projections||[]),r=new Set;for(let n of[t.from??"WGS84",t.to??"WGS84"]){let i=Es(n,t);if(["geographic","identity"].includes(i.kind))continue;let o=e.get(C1(i.projection));if(!o)throw new ti("missing-plugin","Projection plugin is not registered: "+i.projection);r.add(o)}return[...r]}function PO(t){let e=new Map;for(let r of t)for(let n of new Set([r.name,...r.aliases||[]].map(C1))){if(!n||["longlat","latlong","latlon","lonlat","identity"].includes(n)||e.has(n))throw new Error("Duplicate or reserved projection plugin: "+n);e.set(n,r)}return e}function TO(t,e,r){var g;let n=Es(t,r),i=e.get(C1(n.projection));if(!["geographic","identity"].includes(n.kind)&&!i)throw new ti("missing-plugin","Projection plugin is not registered: "+n.projection);let o=new Set([...A1,...(i==null?void 0:i.parameters)||[]]);for(let y of Object.keys(n.parameters)){if(!o.has(y))throw new ti("missing-transform-stage","Unsupported PROJ parameter: +"+y);let b=gO.includes(y)||((g=i==null?void 0:i.flags)==null?void 0:g.includes(y));if(b&&n.parameters[y]!==void 0)throw new Error("Expected a flag without a value: +"+y);if(!b&&!n.parameters[y])throw new Error("PROJ parameter requires a value: +"+y)}if(n.parameters.type&&n.parameters.type!=="crs")throw new Error("Only +type=crs is supported");let s=C1(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(y=>y.name==="null"))??-1,u=c==null?void 0:c.slice(0,l<0?void 0:l+1).map(y=>{let b=Object.prototype.hasOwnProperty.call(r.datumGrids||{},y.name)?r.datumGrids[y.name]:void 0;if(b&&typeof b.shift!="function")throw new Error("Invalid prepared datum grid: "+y.name);return Object.freeze({...y,grid:b})});for(let y of u||[]){if(y.name==="null")break;!y.optional&&!y.grid&&Ge("Required datum grid is not registered: "+y.name)}let h=u?Object.freeze({...n.datum,grids:Object.freeze(u)}):n.datum,d=_O(n.parameters.geoidgrids,r.verticalGrids);d&&(n.kind==="geocentric"||n.kind==="identity"||n.lossy)&&Ge("Vertical grids require a non-lossy geographic or projected CRS");let m=i?i.semantics:{id:"@math.gl/geospatial/"+n.kind,version:1};return{...n,datum:h,implementation:a,verticalGrid:d,algorithm:m}}function v_(t){return Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.z)}function AO(t,e){if(t==="enu")return;let r=[0,0,0],n=[0,0,0];for(let i=0;i<3;i++){let o=t[i],s="ew".includes(o)?0:"ns".includes(o)?1:2;r[e?i:s]=e?s:i,n[e?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 IO(t,e,r){var C,R,E,U;let n=t.storedAxis||(r?t.axis:"enu"),i=e.storedAxis||(r?e.axis:"enu"),o=AO(n,!1),s=AO(i,!0),a=t.implementation&&Xo(t.implementation,!0,t.kind==="geocentric"),c=e.implementation&&Xo(e.implementation,!1,e.kind==="geocentric"),l=__(t.datum,e.datum),u=t.lossy||e.lossy,h=t.kind==="geocentric",d=t.kind==="geographic"?t.angularUnit:t.toMeter,m=e.kind==="geographic"?e.angularUnit:e.toMeter,g=h?1:t.verticalUnit,y=e.kind==="geocentric"?m:e.verticalUnit,b=t.primeMeridian,w=e.primeMeridian,_=e.kind==="geographic"?e.longitudeWrap:void 0,S;if(!l&&!t.verticalGrid&&!e.verticalGrid&&!u&&!o&&!s&&!b&&!w&&t.verticalUnit===1&&e.verticalUnit===1&&_===void 0){let I=Object.freeze({inputScale:d,outputScale:m});t.kind==="geographic"&&e.kind==="projected"&&(S=(R=(C=e.implementation)==null?void 0:C.createForwardFlat)==null?void 0:R.call(C,I)),t.kind==="projected"&&e.kind==="geographic"&&(S=(U=(E=t.implementation)==null?void 0:E.createInverseFlat)==null?void 0:U.call(E,I))}let M=!!(t.verticalGrid||e.verticalGrid)||t.kind==="geocentric"||/[ud]/.test(n.slice(0,2))||/[ud]/.test(i.slice(0,2)),v=[];return o&&v.push("input-axis"),u&&v.push("discard-height"),d!==1&&v.push("input-scale"),a&&v.push("source-inverse"),g!==1&&v.push("input-height-scale"),v.push("geographic-domain-check"),b&&v.push("source-prime-meridian"),t.verticalGrid&&v.push("source-vertical-grid"),l&&v.push("datum"),e.verticalGrid&&v.push("target-vertical-grid"),w&&v.push("target-prime-meridian"),_!==void 0&&v.push("longitude-wrap"),c&&v.push("target-forward"),m!==1&&v.push("output-scale"),y!==1&&v.push("output-height-scale"),u&&v.push("restore-height"),s&&v.push("output-axis"),{description:Object.freeze({inputAxis:n,outputAxis:i,requiresInputZ:M,geocentricOutput:e.kind==="geocentric",stages:Object.freeze(v)}),flat:S,requiresInputZ:M,geocentricOutput:e.kind==="geocentric",run(I){if(!v_(I))throw new Error("Coordinates must contain finite x, y and optional z values");o==null||o(I);let O=I.z;if(u&&(I.z=0),d!==1&&(I.x*=d,I.y*=d,h&&(I.z*=d)),a==null||a(I),g!==1&&(I.z*=g),Math.abs(I.y)>Math.PI/2||!v_(I))throw new Error("Coordinate is outside the geographic domain");if(I.x+=b,t.verticalGrid&&(I.z+=t.verticalGrid(I.x,I.y)),l==null||l(I),e.verticalGrid&&(I.z-=e.verticalGrid(I.x,I.y)),I.x-=w,_!==void 0&&(I.x=_+Kt(I.x-_)),c==null||c(I),m!==1&&(I.x/=m,I.y/=m),y!==1&&(I.z/=y),u&&(I.z=O),s==null||s(I),!v_(I))throw new Error("Projection produced non-finite coordinates")}}}function Yu(t,e,r,n){if(t.length<2)throw new Error("Coordinates must contain finite x, y and optional z values");if(t.length<3&&e.requiresInputZ)throw new Error("This transform requires three ordinates");let i=Math.max(t.length,e.geocentricOutput?3:2),o=r.acquire();try{if(o.x=t[0],o.y=t[1],o.z=t.length>=3?t[2]:0,e.run(o),n)return od(t,n,o,i);let s=t.slice();return s[0]=o.x,s[1]=o.y,(t.length>=3||e.geocentricOutput)&&(s[2]=o.z),s}finally{r.release(o)}}function O1(t,e,r,n){if(!(t instanceof Float32Array||t instanceof Float64Array))throw new Error("In-place projection requires a Float32Array or Float64Array");if(!Number.isSafeInteger(e)||e<2||t.length%e!==0)throw new Error("Dimension must be an integer >= 2 and divide the typed array length");if(e<3&&(r.requiresInputZ||r.geocentricOutput))throw new Error("This transform requires a dimension of at least 3");if(r.flat)return r.flat(t,e),t;let i=n.acquire();try{let o=t instanceof Float32Array;for(let s=0;s<t.length;s+=e){if(i.x=t[s],i.y=t[s+1],i.z=e>=3?t[s+2]:0,r.run(i),o&&(Math.abs(i.x)>34028234663852886e22||Math.abs(i.y)>34028234663852886e22||e>=3&&Math.abs(i.z)>34028234663852886e22))throw new Error("Projected coordinate exceeds Float32 range");t[s]=i.x,t[s+1]=i.y,e>=3&&(t[s+2]=i.z)}return t}finally{n.release(i)}}var cd,C1,RO=p(()=>{nc();ZL();eO();ic();np();m_();Xu();Da();S_();Vt();ad();SO();vO();cd=class t{static async create(e={}){let r=await Promise.all(EO(e).map(QL));return new t({...e,projections:r})}get targetProfile(){return this.getTargetRenderingProfile(this.targetCoverage)}getTargetRenderingProfile(e){return this.targetRenderingProfile&&IA(this.targetRenderingProfile,e)}get description(){var e,r;return((r=(e=this.deferred)==null?void 0:e.implementation)==null?void 0:r.description)??this.resolvedDescription}constructor(e={}){var i,o,s;this.coordinateScratch=new js,this.targetLongitudeOrigin=0;let r=e.projections||[],n=PO(r);if(r.some(a=>!("create"in a))){let a=Es(e.from??"WGS84",e),c=Es(e.to??"WGS84",e);this.lossy=a.lossy||c.lossy,this.deferred={options:{...e,projections:[...r]}}}else{let a=e,c=n,l=TO(a.from??"WGS84",c,a),u=TO(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"?Na(u.parameters,u.primeMeridian):u.kind==="identity"?YL: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")&&Ge("Horizontal extraction cannot supply ellipsoidal height for geocentric coordinates"),this.lossy&&(l.verticalGrid||u.verticalGrid)&&Ge("Horizontal extraction cannot be combined with vertical grids"),this.forwardTransform=IO(l,u,!!e.enforceAxis),this.inverseTransform=IO(u,l,!!e.enforceAxis),this.resolvedDescription=MO(M_(l),M_(u),this.forwardTransform.description,this.inverseTransform.description)}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 e=this.deferred;return e?e.implementation?Promise.resolve(e.implementation):(e.pending||(e.pending=t.create(e.options).then(r=>(e.implementation=r,r)).catch(r=>{throw e.pending=void 0,r})),e.pending):Promise.resolve(this)}loadSync(){let e=this.deferred;if(!e)return this;if(!e.implementation){let r=EO(e.options).map(n=>{let i=JL(n);if(!i)throw new Error("Projection is not preloaded: "+n.name+". Call preload() first.");return i});e.implementation=new t({...e.options,projections:r})}return e.implementation}projectSync(e){return this.deferred?this.loadSync().project(e):Yu(e,this.forwardTransform,this.coordinateScratch)}unprojectSync(e){return this.deferred?this.loadSync().unproject(e):Yu(e,this.inverseTransform,this.coordinateScratch)}projectFlatSync(e,r=2){return this.deferred?this.loadSync().projectFlat(e,r):O1(e,r,this.forwardTransform,this.coordinateScratch)}unprojectFlatSync(e,r=2){return this.deferred?this.loadSync().unprojectFlat(e,r):O1(e,r,this.inverseTransform,this.coordinateScratch)}async preload(){await this.load()}project(e){return this.deferred?this.projectLoaded(e,!1):Yu(e,this.forwardTransform,this.coordinateScratch)}unproject(e){return this.deferred?this.projectLoaded(e,!0):Yu(e,this.inverseTransform,this.coordinateScratch)}projectTo(e,r){return this.deferred?this.projectToLoaded(e,r,!1):this.projectToSync(e,r)}unprojectTo(e,r){return this.deferred?this.projectToLoaded(e,r,!0):this.unprojectToSync(e,r)}projectToSync(e,r){return this.deferred?this.loadSync().projectTo(e,r):(dl(e,r,Math.max(e.length,this.forwardTransform.geocentricOutput?3:2)),Yu(e,this.forwardTransform,this.coordinateScratch,r))}unprojectToSync(e,r){return this.deferred?this.loadSync().unprojectTo(e,r):(dl(e,r,Math.max(e.length,this.inverseTransform.geocentricOutput?3:2)),Yu(e,this.inverseTransform,this.coordinateScratch,r))}projectToLoaded(e,r,n){dl(e,r,e.length);let i=e.slice();return this.load().then(o=>n?o.unprojectTo(i,r):o.projectTo(i,r))}projectLoaded(e,r){let n=e.slice();return this.load().then(i=>r?i.unproject(n):i.project(n))}projectFlat(e,r=2){return this.deferred?this.load().then(i=>i.projectFlat(e,r)):O1(e,r,this.forwardTransform,this.coordinateScratch)}unprojectFlat(e,r=2){return this.deferred?this.load().then(i=>i.unprojectFlat(e,r)):O1(e,r,this.inverseTransform,this.coordinateScratch)}};C1=t=>t.toLowerCase().replace(/[\s_-]/g,"")});var B1,LO=p(()=>{B1=class{constructor(e){this.sample=e,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(e,r,n=1e-6){if(!this.difference(e,this.coarse)||!this.difference(e/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(e,r){let[n,i,o,s]=this.samples;if(!this.sample(-2*e,n)||!this.sample(-e,i)||!this.sample(e,o)||!this.sample(2*e,s))return!1;for(let a=0;a<3;a++)if(r[a]=(n[a]-s[a]+8*(o[a]-i[a]))/(12*e),!Number.isFinite(r[a]))return!1;return!0}}});function E_(t){if(t.length!==3||t.some(e=>!Number.isFinite(e)||e<=0))throw new Error("Invalid CRS rendering scale");return t}function CO(t,e,r,n){if(t.kind==="geocentric")return E_([t.toMeter,t.toMeter,t.toMeter]);if(t.kind==="identity")return E_([...r].map(g=>/[ud]/.test(g)?t.verticalUnit:t.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 B1((g,y)=>{for(let _=0;_<3;_++)o[_]=i[_];o[l]+=g,e.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;e.unprojectTo(i,s);let b=s[1]*ld,w=OO.semiMajorAxis,_=OO.eccentricitySquared,S=1-_*Math.sin(b)**2;if(u=w*Math.cos(b)/Math.sqrt(S)*ld,h=w*(1-_)/S**1.5*ld,!(u>w*ld*1e-8)||!(h>0))return null;let M=((s[0]-n+180)%360+360)%360-180;if((t.kind==="geographic"?t.longitudeWrap!==void 0:!Object.prototype.hasOwnProperty.call(t.parameters,"over"))&&Math.abs(M)+2/u>=180||Math.abs(s[1])+2/h>=90)return null;for(l=0;l<3;l++){let C=r[l],R=/[ud]/.test(C)?t.verticalUnit:t.kind==="geographic"?(/[ew]/.test(C)?u:h)*t.angularUnit/ld:t.toMeter;if(!m.evaluate(1/R,R))return null;for(let E=0;E<3;E++)c[l][E]=m.result[E]}if(y=c.map(C=>Math.hypot(...C)),t.kind==="projected"){let C=c[r.search(/[ew]/)],R=c[r.search(/[ns]/)],E=Math.abs(C[0]*R[1]-C[1]*R[0])/t.toMeter**2;y[r.search(/[ud]/)]=t.verticalUnit*Math.sqrt(E)}}catch{return null}finally{d=!1}return E_(y)}}var ld,OO,BO=p(()=>{LO();Xu();ld=Math.PI/180,OO=Es("WGS84").ellipsoid});async function GO(t,e,r,n={},i=!1,o){let s=typeof e=="string"?e:JSON.parse(JSON.stringify(e)),a={enforceAxis:r.enforceAxis,mode:r.mode,...n,converters:n.converters&&[...n.converters]},c=o?await o(s,{...r,...a}):s,l=Es(c,{...r,...a}),u=await t.createProjectionAsync({...a,from:"WGS84",to:c}),h=l.storedAxis||(a.enforceAxis?l.axis:"enu"),d=kO(l.kind==="geographic"?l.angularUnit:l.toMeter,l.kind==="geographic"),m=kO(l.verticalUnit,!1),g=[...h].map(E=>l.kind!=="geocentric"&&/[ud]/.test(E)?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=qX(y,l,h),_=zX(y.normalize),S=CO(l,u,h,b),M=[...new Set(["WGS84",...a.converters||[]])];if(M.some(E=>typeof E!="string"||!E.trim()))throw new Error("Converter source CRS must be a nonempty string");let v=await Promise.all(M.map(async E=>{if(E==="WGS84")return[E,NO(u,_)];let[U,I]=await Promise.all([t.createProjectionAsync({...a,from:E,to:c}),t.createProjectionAsync({...a,from:"WGS84",to:E})]);return[E,NO(U,jX(I,_))]})),C=Object.assign(Object.create(null),Object.fromEntries(v)),R={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{...R,signature:i&&typeof c=="string"&&!a.enforceAxis&&!l.lossy?c:R4(R),renderingBounds:w,renderingScale:S,getRenderingScale:E=>typeof S=="function"?S(E):S,converter:C}}function NO(t,e){return{from:FO(t.project.bind(t),t.projectTo.bind(t)),to:FO(t.unproject.bind(t),t.unprojectTo.bind(t)),normalize:e}}function jX(t,e){function r(n,i){i!==void 0&&dl(n,i,n.length);let o=t.unproject(Array.from(n)),[s,a,c]=o;return e(o,o),o[0]===s&&o[1]===a&&o[2]===c?i===void 0?Array.from(n):od(n,i,{x:n[0],y:n[1],z:n[2]??0},n.length):i===void 0?t.project(o):t.projectTo(o,i)}return r}function FO(t,e){function r(n,i){return i===void 0?t(Array.isArray(n)?n:Array.from(n)):e(n,i)}return r}function zX(t){function e(r,n){let i=n??new Array(r.length);dl(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 t==null||t(c),od(r,i,c,r.length)}return e}function qX(t,e,r){let n=e.kind==="geographic"?e.angularUnit:e.toMeter,i=[n,n,e.kind==="geocentric"?e.toMeter:e.verticalUnit],o=t.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 kO(t,e){let r=e?DO:UX,n=Object.keys(r).find(i=>r[i]===t)||"custom";return e?{name:n,degreesPerUnit:t/DO.degrees}:{name:n,metersPerUnit:t}}var DO,UX,UO=p(()=>{Xu();BO();m_();e2();DO={degrees:Math.PI/180,radians:1,gradians:Math.PI/200},UX={...Object.fromEntries(Object.values(Uf).map(t=>[t.name,t.metersPerUnit]))}});function jO(t){return{...t,projections:t.projections&&[...t.projections],parsers:t.parsers&&[...t.parsers],datumCatalogs:t.datumCatalogs&&[...t.datumCatalogs],aliases:t.aliases&&JSON.parse(JSON.stringify(t.aliases)),datumGrids:t.datumGrids&&{...t.datumGrids},verticalGrids:t.verticalGrids&&{...t.verticalGrids}}}function ud(t){return!!(t.projections||t.parsers||t.datumCatalogs||t.aliases||t.datumGrids||t.verticalGrids||t.resolver)}var T_=p(()=>{});async function qO(t){let e={...t,from:zO(t.from??"WGS84"),to:zO(t.to??"WGS84")},[r,n]=await Promise.all([D1(e.from,e),D1(e.to,e)]);return{...e,from:r,to:n}}async function D1(t,e){var u;let r=sd(t,e),n=b_(r.definition,e),i=typeof t=="string"||"type"in t?void 0:"crs"in t?t.crs:t,o=n===r.definition&&i?i.representation:wr(n);if(o!=="identifier"||(u=e.parsers)!=null&&u.some(h=>h.canParse(n)))return t;let s=await e.resolver.resolve({state:"explicit",provenance:(i==null?void 0:i.provenance)??"unknown",definition:n,representation:o}),a=sd(s.input,e).definition;if(!i)return a;let c=t,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 zO(t){return typeof t=="string"?t:JSON.parse(JSON.stringify(t))}var VO=p(()=>{Hl();Xu();p_()});var N1,WO=p(()=>{UO();T_();VO();RO();T_();N1=class{constructor(e={}){this.options=jO(e),this.useDefinitionSignature=!ud(e)}getCRS(e,r={}){return GO(this,e,this.options,r,this.useDefinitionSignature,this.options.resolver?D1:void 0)}createProjection(e={}){return new cd({...this.options,...e})}async createProjectionAsync(e={}){let r={...this.options,...e};return cd.create(r.resolver?await qO(r):r)}}});var $O=p(()=>{});var A_,HO=p(()=>{ou();Vt();et();lt();Ot();A_={name:"merc",semantics:{id:"@math.gl/geospatial/merc",version:1},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:t,eccentricitySquared:e,parameters:r,primeMeridian:n=0}){let i=Math.sqrt(e),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=$f(r,"lat_ts");l=Math.cos(g)/Math.sqrt(1-e*Math.sin(g)**2)}if(l<=0)throw new Error("Mercator scale must be positive");let u=t*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 ar(S=>ct(Be([a,a],Fe(Lr(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:ar(()=>y,Bn(Q(s-Math.PI,-h,s+Math.PI,h),n),s,n,o).normalize}},...Oi(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,_=Math.atan(Math.sinh(w));if(i===0){g.x=Kt(s+(y-a)/u,o),g.y=_+0;return}for(let S=0;S<30;S++){let M=Math.atan(Math.sinh(w+i*Math.atanh(i*Math.sin(_))));if(Math.abs(M-_)<1e-13){g.x=Kt(s+(y-a)/u,o),g.y=M;return}_=M}throw new Error("Mercator inverse did not converge")})}}}});var I_,KO=p(()=>{ic();Vt();et();lt();Ot();I_={name:"eqc",semantics:{id:"@math.gl/geospatial/eqc",version:1},aliases:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical"],parameters:["lon_0","lat_0","lat_ts","x_0","y_0"],create({semiMajorAxis:t,parameters:e,primeMeridian:r=0}){let n=Object.prototype.hasOwnProperty.call(e,"over"),i=re(e,"lon_0",0)*At,o=$f(e,"lat_0"),s=Math.cos($f(e,"lat_ts")),a=re(e,"x_0",0),c=re(e,"y_0",0),l=t*Math.abs(s)*Math.PI;return{longitudeOrigin:i,getRenderingProfile(u){if(u)return ar(d=>ct(Be([a,a],Fe(Lr(d,i,n),t*s)),[c+t*(d[0][1]-o),c+t*(d[1][1]-o)]),u,i,r,n);let h=[[a-l,c+t*(-Math.PI/2-o),0],[a+l,c+t*(Math.PI/2-o),0]];return{bounds:h,normalize:ar(()=>h,Bn(Q(i-Math.PI,-(Math.PI/2),i+Math.PI,Math.PI/2),r),i,r,n).normalize}},...ui(u=>{u.x=a+t*s*Kt(u.x-i,n),u.y=c+t*(u.y-o)},u=>{u.x=Kt(i+(u.x-a)/(t*s),n),u.y=o+(u.y-c)/t})}}}});function VX(t){if(t.k0||(t.k0=1),t.x0=t.x0||0,t.y0=t.y0||0,t.long0=t.long0||0,!(Math.abs(t.lat1+t.lat2)<1e-10)){var e=t.b/t.a;t.e=Math.sqrt(1-e*e);var r=Math.sin(t.lat1),n=Math.cos(t.lat1),i=yn(t.e,r,n),o=Kr(t.e,t.lat1,r),s=Math.sin(t.lat2),a=Math.cos(t.lat2),c=yn(t.e,s,a),l=Kr(t.e,t.lat2,s),u=Kr(t.e,t.lat0,Math.sin(t.lat0));Math.abs(t.lat1-t.lat2)>1e-10?t.ns=Math.log(i/c)/Math.log(o/l):t.ns=r,Number.isNaN(t.ns)&&(t.ns=r),t.f0=i/(t.ns*Math.pow(o,t.ns)),t.rh=Math.abs(Math.abs(t.lat0)-F)<1e-10?0:t.a*t.f0*Math.pow(u,t.ns)}}function XO(t,e){var r=e.x,n=e.y,i=Math.abs(Math.abs(n)-F),o,s;if(i>1e-10)o=t.sphere?1/Math.tan(Math.PI/4+n/2):Kr(t.e,n,Math.sin(n)),s=t.a*t.f0*Math.pow(o,t.ns);else{if(i=n*t.ns,i<=0)return null;s=0}var a=t.ns*G(r-t.long0,t.over);return e.x=t.k0*(s*Math.sin(a))+t.x0,e.y=t.k0*(t.rh-s*Math.cos(a))+t.y0,e}function YO(t,e){var r,n,i,o,s,a=(e.x-t.x0)/t.k0,c=t.rh-(e.y-t.y0)/t.k0;t.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||t.ns>0){if(n=1/t.ns,i=Math.pow(r/(t.a*t.f0),n),o=lc(t.e,i),o===-9999)return null}else o=-F;return s=G(l/t.ns+t.long0,t.over),e.x=s,e.y=o,e}function ZO(t){let e={...t,ns:0,f0:0,rh:0};return VX(e),e}var JO=p(()=>{cu();Jf();_t();up();Ct()});var P_,QO=p(()=>{Ot();et();lt();ou();Dn();JO();P_={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,...Yo,"lat_1","lat_2"],create(t){let e=xr(t);iu(e,t.parameters);let r=ZO(e),n=cr("lcc",r,XO,YO),i={...Oi(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(e.long0-Math.PI,r.ns>0?-Math.PI/3:-Math.PI/2,e.long0+Math.PI,r.ns>0?Math.PI/2:Math.PI/3),o=>nu(i.forward,o,e.long0,r.ns,r.x0,r.y0+r.k0*r.rh,e.over),e.primeMeridian,e.over)}}});function cn(t,e){var r;return t>1e-7?(r=t*e,(1-t*t)*(e/(1-r*r)-.5/t*Math.log((1-r)/(1+r)))):2*e}var fd=p(()=>{});function F1(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));let n=4*Number.EPSILON*r;if(Math.abs(e)>r+n)return NaN;if(Math.abs(Math.abs(e)-r)<=n)return e<0?-1*F:F;for(var i=Math.asin(.5*e),o,s,a,c,l=0;l<30;l++)if(s=Math.sin(i),a=Math.cos(i),c=t*s,o=Math.pow(1-c*c,2)/(2*a)*(e/(1-t*t)-s/(1-c*c)+.5/t*Math.log((1-c)/(1+c))),i+=o,Math.abs(o)<=1e-10)return i;return NaN}var R_=p(()=>{Ct()});function WX(t){Math.abs(t.lat1+t.lat2)<1e-10||(t.temp=t.b/t.a,t.es=1-Math.pow(t.temp,2),t.e3=Math.sqrt(t.es),t.sin_po=Math.sin(t.lat1),t.cos_po=Math.cos(t.lat1),t.t1=t.sin_po,t.con=t.sin_po,t.ms1=yn(t.e3,t.sin_po,t.cos_po),t.qs1=cn(t.e3,t.sin_po),t.sin_po=Math.sin(t.lat2),t.cos_po=Math.cos(t.lat2),t.t2=t.sin_po,t.ms2=yn(t.e3,t.sin_po,t.cos_po),t.qs2=cn(t.e3,t.sin_po),t.sin_po=Math.sin(t.lat0),t.cos_po=Math.cos(t.lat0),t.t3=t.sin_po,t.qs0=cn(t.e3,t.sin_po),Math.abs(t.lat1-t.lat2)>1e-10?t.ns0=(t.ms1*t.ms1-t.ms2*t.ms2)/(t.qs2-t.qs1):t.ns0=t.con,t.c=t.ms1*t.ms1+t.ns0*t.qs1,t.rh=t.a*Math.sqrt(t.c-t.ns0*t.qs0)/t.ns0)}function eC(t,e){var r=e.x,n=e.y;t.sin_phi=Math.sin(n),t.cos_phi=Math.cos(n);var i=cn(t.e3,t.sin_phi),o=t.a*Math.sqrt(t.c-t.ns0*i)/t.ns0,s=t.ns0*G(r-t.long0,t.over),a=o*Math.sin(s)+t.x0,c=t.rh-o*Math.cos(s)+t.y0;return e.x=a,e.y=c,e}function tC(t,e){var r,n,i,o,s,a;if(e.x-=t.x0,e.y=t.rh-e.y+t.y0,t.ns0>=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),i=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),i=-1),o=0,r!==0&&(o=Math.atan2(i*e.x,i*e.y)),i=r*t.ns0/t.a,t.sphere){let c=(t.c-i*i)/(2*t.ns0);if(Math.abs(c)>1+8*Number.EPSILON)return null;a=Math.asin(Math.max(-1,Math.min(1,c)))}else{n=(t.c-i*i)/t.ns0;let c=cn(t.e3,1);a=Math.abs(Math.abs(n)-c)<=16*Number.EPSILON*c?Math.sign(n)*Math.PI/2:F1(t.e3,n)}return s=G(o/t.ns0+t.long0,t.over),e.x=s,e.y=a,e}function rC(t){let e={...t,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 WX(e),e}var nC=p(()=>{cu();fd();_t();R_()});var L_,iC=p(()=>{ou();Ot();et();lt();Dn();nC();L_={name:"aea",aliases:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers"],parameters:[...Er,"lat_1","lat_2"],create(t){let e=xr(t);iu(e,t.parameters);let r=rC(e),n={...cr("aea",r,eC,tC,Oi)};return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>nu(n.forward,i,e.long0,r.ns0,r.x0,r.y0+r.rh,e.over),e.primeMeridian,e.over)}}});function Ts(t){return Math.abs(t)<=F?t:t-Ws(t)*Math.PI}var hd=p(()=>{Ct();Yf()});function $X(t){Math.abs(t.lat1+t.lat2)<1e-10||(t.temp=t.b/t.a,t.es=1-Math.pow(t.temp,2),t.e=Math.sqrt(t.es),t.en=fo(t.es),t.sin_phi=Math.sin(t.lat1),t.cos_phi=Math.cos(t.lat1),t.ms1=yn(t.e,t.sin_phi,t.cos_phi),t.ml1=_r(t.lat1,Math.sin(t.lat1),Math.cos(t.lat1),t.en),Math.abs(t.lat1-t.lat2)<1e-10?t.ns=t.sin_phi:(t.sin_phi=Math.sin(t.lat2),t.cos_phi=Math.cos(t.lat2),t.ms2=yn(t.e,t.sin_phi,t.cos_phi),t.ml2=_r(t.lat2,Math.sin(t.lat2),Math.cos(t.lat2),t.en),t.ns=(t.ms1-t.ms2)/(t.ml2-t.ml1)),t.g=t.ml1+t.ms1/t.ns,t.ml0=_r(t.lat0,Math.sin(t.lat0),Math.cos(t.lat0),t.en),t.rh=t.a*(t.g-t.ml0))}function oC(t,e){var r=e.x,n=e.y,i;if(t.sphere)i=t.a*(t.g-n);else{var o=_r(n,Math.sin(n),Math.cos(n),t.en);i=t.a*(t.g-o)}var s=t.ns*G(r-t.long0,t.over),a=t.x0+i*Math.sin(s),c=t.y0+t.rh-i*Math.cos(s);return e.x=a,e.y=c,e}function sC(t,e){e.x-=t.x0,e.y=t.rh-e.y+t.y0;var r,n,i,o;t.ns>=0?(n=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(n=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1);var s=0;if(n!==0&&(s=Math.atan2(r*e.x,r*e.y)),t.sphere)return o=G(t.long0+s/t.ns,t.over),i=Ts(t.g-n/t.a),e.x=o,e.y=i,e;var a=t.g-n/t.a;return i=ho(a,t.es,t.en),o=G(t.long0+s/t.ns,t.over),e.x=o,e.y=i,e}function aC(t){let e={...t,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 $X(e),e}var cC=p(()=>{su();ac();au();cu();_t();hd()});var O_,lC=p(()=>{ou();Ot();et();lt();Dn();cC();O_={name:"eqdc",aliases:["Equidistant_Conic"],parameters:[...Er,"lat_1","lat_2"],create(t){let e=xr(t);iu(e,t.parameters);let r=aC(e),n=cr("eqdc",r,oC,sC,Oi);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>nu(n.forward,i,e.long0,r.ns,r.x0,r.y0+r.rh,e.over),e.primeMeridian,e.over)}}});function Fa(t,e){let r=Math.abs(Math.sin(e)),n=Math.cos(e),i=n*n/(1+r);if(t===0)return 2*i;let o=t*t;return i*(1+o*r)/(1-o*r*r)+(1-o)/t*Math.atanh(t*i/(1-o*r))}function C_(t,e,r){if(r===0||t===0)return r;let n=Fa(t,r)/e;return Math.atan2(Math.sign(r)*(1-n),Math.sqrt(n*(2-n)))}function B_(t,e,r){if(t===0||r===0||Math.abs(r)===Math.PI/2)return r;let n=Math.abs(Math.sin(r)),i=Math.cos(r),o=e*i*i/(1+n),s=Math.abs(r),a=t*t,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=Fa(t,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 D_=p(()=>{});function HX(t){var e=Math.abs(t.lat0);if(Math.abs(e-F)<1e-10?t.mode=t.lat0<0?Yi:Bo:Math.abs(e)<1e-10?t.mode=Ei:t.mode=ln,t.es>0){var r;switch(t.qp=cn(t.e,1),t.mmf=.5/(1-t.es),t.mode){case Bo:t.dd=1;break;case Yi:t.dd=1;break;case Ei:t.rq=Math.sqrt(.5*t.qp),t.dd=1/t.rq,t.xmf=1,t.ymf=.5*t.qp;break;case ln:t.rq=Math.sqrt(.5*t.qp),r=Math.sin(t.lat0),t.sinb1=cn(t.e,r)/t.qp,t.cosb1=Math.sqrt(1-t.sinb1*t.sinb1),t.dd=Math.cos(t.lat0)/(Math.sqrt(1-t.es*r*r)*t.rq*t.cosb1),t.xmf=t.rq,t.ymf=t.xmf/t.dd,t.xmf*=t.dd;break}}else t.mode===ln&&(t.sinph0=Math.sin(t.lat0),t.cosph0=Math.cos(t.lat0))}function uC(t,e){var r,n,i,o,s,a,c,l,u,h,d=e.x,m=e.y;if(d=G(d-t.long0,t.over),t.sphere){if(s=Math.sin(m),h=Math.cos(m),i=Math.cos(d),t.mode===ln||t.mode===Ei){if(n=t.mode===Ei?1+h*i:1+t.sinph0*s+t.cosph0*h*i,n<=1e-10)return null;n=Math.sqrt(2/n),r=n*h*Math.sin(d),n*=t.mode===Ei?s:t.cosph0*s-t.sinph0*h*i}else if(t.mode===Bo||t.mode===Yi){if(t.mode===Bo&&(i=-i),Math.abs(m+t.lat0)<1e-10)return null;n=tt-m*.5,n=2*(t.mode===Yi?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=cn(t.e,s),t.mode===ln||t.mode===Ei){c=a/t.qp;let g=Fa(t.e,m)/t.qp;l=Math.sqrt(g*(2-g))}switch(t.mode){case ln:u=1+t.sinb1*c+t.cosb1*l*i;break;case Ei:u=1+l*i;break;case Bo:u=F+m,a=m>=0?Fa(t.e,m):2*t.qp-Fa(t.e,m);break;case Yi:u=m-F,a=m<=0?Fa(t.e,m):2*t.qp-Fa(t.e,m);break}if(Math.abs(u)<1e-10)return null;switch(t.mode){case ln:case Ei:u=Math.sqrt(2/u),t.mode===ln?n=t.ymf*u*(t.cosb1*c-t.sinb1*l*i):(u=Math.sqrt(2/(1+l*i)),n=u*c*t.ymf),r=t.xmf*u*l*o;break;case Bo:case Yi:a>=0?(u=Math.sqrt(a),r=u*o,n=i*(t.mode===Yi?u:-u)):r=n=0;break}}return e.x=t.a*r+t.x0,e.y=t.a*n+t.y0,e}function fC(t,e){e.x-=t.x0,e.y-=t.y0;var r=e.x/t.a,n=e.y/t.a,i,o,s,a,c,l,u;if(t.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)),(t.mode===ln||t.mode===Ei)&&(m=Math.sin(o),h=Math.cos(o)),t.mode){case Ei:o=Math.abs(d)<=1e-10?0:Ci(0,1,m,h,r,n,d),r*=m,n=h*d;break;case ln:o=Math.abs(d)<=1e-10?t.lat0:Ci(t.sinph0,t.cosph0,m,h,r,n,d),r*=m*t.cosph0,n=(h-Math.sin(o)*t.sinph0)*d;break;case Bo:n=-n,o=F-o;break;case Yi:o-=F;break}i=n===0&&(t.mode===Ei||t.mode===ln)?0:Math.atan2(r,n)}else{if(u=0,t.mode===ln||t.mode===Ei){if(r/=t.dd,n*=t.dd,l=Math.sqrt(r*r+n*n),l<1e-10)return e.x=t.long0,e.y=t.lat0,e;let g=.5*l/t.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(t.mode===ln?t.sinb1:0,t.mode===ln?t.cosb1:1,a,s,r,n,l);o=B_(t.e,t.qp,y),r*=a,t.mode===ln?(u=s*t.sinb1+n*a*t.cosb1/l,c=t.qp*u,n=l*t.cosb1*s-n*t.sinb1*a):(u=n*a/l,c=t.qp*u,n=l*s)}else if(t.mode===Bo||t.mode===Yi){if(t.mode===Bo&&(n=-n),c=r*r+n*n,!c)return e.x=t.long0,e.y=t.lat0,e;u=1-c/t.qp,t.mode===Yi&&(u=-u)}if(i=Math.atan2(r,n),Math.abs(u)>1+8*Number.EPSILON)return null;if(t.mode===Bo||t.mode===Yi){let g=Math.max(0,Math.min(2,c/t.qp)),y=Math.atan2(u,Math.sqrt(g*(2-g)));o=B_(t.e,t.qp,y)}}return e.x=G(t.long0+i,t.over),e.y=o,e}function hC(t){let e={...t,mode:0,qp:0,mmf:0,dd:0,rq:0,xmf:0,ymf:0,sinb1:0,cosb1:0,sinph0:0,cosph0:0};return HX(e),e}var Yi,Bo,Ei,ln,dC=p(()=>{Ct();fd();_t();D_();Zf();Yi=1,Bo=2,Ei=3,ln=4});var N_,mC=p(()=>{D_();Ks();Xs();Dn();dC();N_={name:"laea",aliases:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area"],parameters:Er,create(t){let e=xr(t),r=hC(e);return gn(qs(e,cr("laea",r,uC,fC)),e,Math.PI*179/180,(n,i)=>e8(e,e.sphere?1:r.xmf||Math.sqrt(r.qp/2),e.sphere?1:r.ymf||Math.sqrt(r.qp/2),n,i,e.sphere?e.lat0:C_(e.e,r.qp,e.lat0),e.sphere?o=>o:o=>C_(e.e,r.qp,o)))}}});function k1(t,e){return Math.pow((1-t)/(1+t),e)}var pC=p(()=>{});function XX(t){var e=Math.sin(t.lat0),r=Math.cos(t.lat0);r*=r,t.rc=Math.sqrt(1-t.es)/(1-t.es*e*e),t.C=Math.sqrt(1+t.es*r*r/(1-t.es)),t.phic0=Math.asin(e/t.C),t.ratexp=.5*t.C*t.e,t.K=Math.tan(.5*t.phic0+tt)/(Math.pow(Math.tan(.5*t.lat0+tt),t.C)*k1(t.e*e,t.ratexp))}function gC(t,e){var r=e.x,n=e.y;return e.y=2*Math.atan(t.K*Math.pow(Math.tan(.5*n+tt),t.C)*k1(t.e*Math.sin(n),t.ratexp))-F,e.x=t.C*r,e}function yC(t,e){for(var r=1e-14,n=e.x/t.C,i=e.y,o=Math.pow(Math.tan(.5*i+tt)/t.K,1/t.C),s=KX;s>0&&(i=2*Math.atan(o*k1(t.e*Math.sin(e.y),-.5*t.e))-F,!(Math.abs(i-e.y)<r));--s)e.y=i;return s?(e.x=n,e.y=i,e):null}function bC(t){let e={...t,rc:0,C:0,phic0:0,ratexp:0,K:0};return XX(e),e}var KX,wC=p(()=>{pC();Ct();KX=20});function YX(t){t.rc&&(t.sinc0=Math.sin(t.phic0),t.cosc0=Math.cos(t.phic0),t.R2=2*t.rc)}function xC(t,e){var r,n,i,o;return e.x=G(e.x-t.long0,t.over),gC(t,e),r=Math.sin(e.y),n=Math.cos(e.y),i=Math.cos(e.x),o=t.k0*t.R2/(1+t.sinc0*r+t.cosc0*n*i),e.x=o*n*Math.sin(e.x),e.y=o*(t.cosc0*r-t.sinc0*n*i),e.x=t.a*e.x+t.x0,e.y=t.a*e.y+t.y0,e}function _C(t,e){var r,n,i,o,s;if(e.x=(e.x-t.x0)/t.a,e.y=(e.y-t.y0)/t.a,e.x/=t.k0,e.y/=t.k0,s=er(e.x,e.y),s){var a=2*Math.atan2(s,t.R2);r=Math.sin(a),n=Math.cos(a),o=Ci(t.sinc0,t.cosc0,r,n,e.x,e.y,s),i=Math.atan2(e.x*r,s*t.cosc0*n-e.y*t.sinc0*r)}else o=t.phic0,i=0;if(e.x=i,e.y=o,!yC(t,e))throw new Error("Oblique stereographic inverse did not converge");return e.x=G(e.x+t.long0,t.over),e}function SC(t){let e={...bC(t),sinc0:0,cosc0:0,R2:0};return YX(e),e}var MC=p(()=>{Zf();wC();_t();sc()});var F_,vC=p(()=>{Ks();Xs();Dn();MC();F_={name:"sterea",aliases:["Stereographic_North_Pole","Oblique_Stereographic","Oblique Stereographic Alternative","Double_Stereographic"],parameters:[...Er,...Yo],create(t){let e=xr(t);if(Math.abs(e.lat0)===Math.PI/2)throw new Error("sterea requires a non-polar origin; use stere at the poles");let r=SC(e);return gn(qs(e,cr("sterea",r,xC,_C)),e,Math.PI*150/180,(n,i)=>lp(e,o=>2*Math.atan(r.K*Math.pow(Math.tan(Math.PI/4+o/2),r.C)*Math.pow((1-e.e*Math.sin(o))/(1+e.e*Math.sin(o)),r.ratexp))-Math.PI/2,r.phic0,e.a*e.k0*r.R2,n,i,r.C,Math.abs(Math.log(r.C))+Math.abs(Math.log(r.K))+r.C*e.e*Math.atanh(e.e)))}}});function k_(t,e){let r=1-t*Math.sin(e)**2;return(1-t)/(r*Math.sqrt(r))}function G1(t,e,r,n){return k_(t,e-r*n)+k_(t,e+r*n)}function ri(t,e,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*G1(e,a,i,.1834346424956498)+.3137066458778873*G1(e,a,i,.525532409916329)+.2223810344533745*G1(e,a,i,.7966664774136267)+.1012285362903763*G1(e,a,i,.9602898564975363))}return t*o}function G_(t,e,r){let n=Math.PI/2,i=ri(t,e,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=ri(t,e,0,a)-r;if(Math.abs(l)<=8*Number.EPSILON*t)return a;l>0?s=a:o=a;let u=a-l/(t*k_(e,a));a=u>o&&u<s?u:(o+s)/2}return NaN}var U_=p(()=>{});function EC(t,e,r,n,i,o,s){let a=n-e,c=Math.atan((1-o)*Math.tan(t)),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,C,R,E,U,I,O,A,V,k;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}M=u*d+h*m*_,v=Math.atan2(S,M),C=h*m*w/S,R=1-C*C,E=R!==0?M-2*u*d/R:0,U=o/16*R*(4+o*(4-3*R)),y=g,g=a+(1-U)*o*C*(v+U*S*(E+U*M*(-1+2*E*E)))}while(Math.abs(g-y)>1e-12&&--b>0);if(b===0){s.x=NaN,s.y=NaN;return}I=R*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),O=1+I/16384*(4096+I*(-768+I*(320-175*I))),A=I/1024*(256+I*(-128+I*(74-47*I))),V=A*S*(E+A/4*(M*(-1+2*E*E)-A/6*E*(-3+4*S*S)*(-3+4*E*E))),k=i*(1-o)*O*(v-V);let T=Math.atan2(m*w,h*d-u*m*_);s.x=T,s.y=k}function TC(t,e,r,n,i,o,s){let a=Math.atan((1-o)*Math.tan(t)),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,M=100,v,C,R,E;do v=Math.cos(2*d+_),C=Math.sin(_),R=Math.cos(_),E=w*C*(v+w/4*(R*(-1+2*v*v)-w/6*v*(-3+4*C*C)*(-3+4*v*v))),S=_,_=n/(i*(1-o)*b)+E;while(Math.abs(_-S)>1e-12&&--M>0);if(M===0){s.x=NaN,s.y=NaN;return}let U=c*C-l*R*h,I=Math.atan2(c*R+l*C*h,(1-o)*Math.sqrt(m*m+U*U)),O=Math.atan2(C*u,l*R-c*C*h),A=o/16*g*(4+o*(4-3*g)),V=O-(1-A)*o*m*(_+A*C*(v+A*R*(-1+2*v*v))),k=e+V;s.x=k,s.y=I}var AC=p(()=>{});function ZX(t){t.sin_p12=Math.sin(t.lat0),t.cos_p12=Math.cos(t.lat0),t.x0=t.x0||0,t.y0=t.y0||0,t.long0=t.long0||0,t.f=t.es/(1+Math.sqrt(1-t.es))}function IC(t,e){var r=e.x,n=e.y,i=Math.sin(e.y),o=Math.cos(e.y),s=G(r-t.long0,t.over),a,c,l,u,h;if(t.sphere)return Math.abs(t.sin_p12-1)<=1e-10?(e.x=t.x0+t.a*(F-n)*Math.sin(s),e.y=t.y0-t.a*(F-n)*Math.cos(s),e):Math.abs(t.sin_p12+1)<=1e-10?(e.x=t.x0+t.a*(F+n)*Math.sin(s),e.y=t.y0+t.a*(F+n)*Math.cos(s),e):(u=t.sin_p12*i+t.cos_p12*o*Math.cos(s),c=Math.acos(u),l=c?c/Math.sin(c):1,e.x=t.x0+t.a*l*o*Math.sin(s),e.y=t.y0+t.a*l*(t.cos_p12*i-t.sin_p12*o*Math.cos(s)),e);if(Math.abs(t.sin_p12-1)<=1e-10)return a=ri(t.a,t.es,n,F),e.x=t.x0+a*Math.sin(s),e.y=t.y0-a*Math.cos(s),e;if(Math.abs(t.sin_p12+1)<=1e-10)return a=ri(t.a,t.es,-F,n),e.x=t.x0+a*Math.sin(s),e.y=t.y0+a*Math.cos(s),e;{if(Math.abs(s)<1e-10&&Math.abs(n-t.lat0)<1e-10)return e.x=t.x0,e.y=t.y0,e;EC(t.lat0,t.long0,n,r,t.a,t.f,e),h=e.x;let d=e.y;return e.x=t.x0+d*Math.sin(h),e.y=t.y0+d*Math.cos(h),e}}function PC(t,e){e.x-=t.x0,e.y-=t.y0;var r,n,i,o,s,a,c,l,u,h,d;if(t.sphere){if(r=Math.sqrt(e.x*e.x+e.y*e.y),r>2*F*t.a)return null;if(n=r/t.a,i=Math.sin(n),o=Math.cos(n),s=t.long0,Math.abs(r)<=1e-10)a=t.lat0;else if(a=Ci(t.sin_p12,t.cos_p12,i,o,e.x,e.y,r),c=Math.abs(t.lat0)-F,Math.abs(c)<=1e-10)if(t.lat0>=0){if(!Number.isFinite(a))return null;s=G(t.long0+Math.atan2(e.x,-e.y),t.over)}else s=G(t.long0-Math.atan2(-e.x,e.y),t.over);else s=G(t.long0+Math.atan2(e.x*i,r*t.cos_p12*o-e.y*t.sin_p12*i),t.over);return e.x=s,e.y=a,e}else return Math.abs(t.sin_p12-1)<=1e-10?(l=ri(t.a,t.es,0,F),r=Math.sqrt(e.x*e.x+e.y*e.y),u=l-r,a=G_(t.a,t.es,u),Number.isFinite(a)?(s=G(t.long0+Math.atan2(e.x,-1*e.y),t.over),e.x=s,e.y=a,e):null):Math.abs(t.sin_p12+1)<=1e-10?(l=ri(t.a,t.es,0,F),r=Math.sqrt(e.x*e.x+e.y*e.y),u=r-l,a=G_(t.a,t.es,u),Number.isFinite(a)?(s=G(t.long0+Math.atan2(e.x,e.y),t.over),e.x=s,e.y=a,e):null):(h=Math.atan2(e.x,e.y),d=Math.sqrt(e.x*e.x+e.y*e.y),TC(t.lat0,t.long0,h,d,t.a,t.f,e),e)}function RC(t){let e={...t,sin_p12:0,cos_p12:0,f:0};return ZX(e),e}var LC=p(()=>{Zf();_t();Ct();U_();AC()});var j_,OC=p(()=>{Ks();Xs();Dn();LC();j_={name:"aeqd",aliases:["Azimuthal_Equidistant"],parameters:Er,create(t){let e=xr(t),r=RC(e);return gn(qs(e,cr("aeqd",r,IC,PC)),e,Math.PI*179/180,(n,i)=>QA(e,n,i))}}});var z_,CC=p(()=>{ad();S_();z_={name:"geocent",aliases:["Geocentric","geocentric","Geocent"],parameters:[],create({semiMajorAxis:t,semiMinorAxis:e,eccentricitySquared:r,primeMeridian:n=0}){let i={semiMajorAxis:t,eccentricitySquared:r,semiMinorAxis:e??t*Math.sqrt(1-r)};return{getRenderingProfile:()=>({bounds:[[-t,-t,-i.semiMinorAxis],[t,t,i.semiMinorAxis]],normalize:Na({},n)().normalize}),forward(){throw new Error("Geocentric projection requires the 3D pipeline")},inverse(){throw new Error("Geocentric projection requires the 3D pipeline")},forwardInPlace:o=>R1(o,i),inverseInPlace:o=>L1(o,i),forward3D:o=>wO(o,i),inverse3D:o=>xO(o,i)}}}});function BC(t,e,r){let n=ks(Lr(r,t.long0,t.over)),i=t.a/Math.sqrt(1-t.es),o=li(e(t.long0,r[0][1])[1],e(t.long0,r[1][1])[1]),s=Math.max(Math.abs(t.a*(t.es?t.am1:t.cphi1)+t.y0-o[0]),Math.abs(t.a*(t.es?t.am1:t.cphi1)+t.y0-o[1])),a=Math.min(s,i*n),c=Math.min(2*s,i*n);return ct([t.x0-a,t.x0+a],[o[0]-c,o[1]+c])}function DC(t,e,r){let n=ks(Lr(r,t.long0,t.over)),i=t.a/Math.sqrt(1-t.es),o=i*n*n/4,s=li(e(t.long0,r[0][1])[1],e(t.long0,r[1][1])[1]);return t.sphere&&(r[0][1]-t.lat0<-Math.PI/2||r[1][1]-t.lat0>Math.PI/2)&&(s=[t.y0-t.a*Math.PI/2,t.y0+t.a*Math.PI/2]),ct([t.x0-i*n,t.x0+i*n],[s[0]-o,s[1]+o])}function NC(t,e,r){let n=ks(Lr(r,t.long0,t.over));if(t.sphere&&n>Math.PI/2)throw new Error("Unsupported Cassini rendering coverage");let i=t.a/Math.sqrt(1-t.es),o=t.es/(1-t.es),s=t.sphere?t.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=t.sphere?t.a*n:i*(n*n/4+(6+6*o)*n**4/24),c=li(e(t.long0,r[0][1])[1],e(t.long0,r[1][1])[1]);return ct([t.x0-s,t.x0+s],[c[0]-a,c[1]+a])}function q_(t,e){return e[0]<=0&&e[1]>=0?[-1/0,1/0]:Lt(t,li(1/e[0],1/e[1]))}function FC(t,e){let r=l=>{let u=t.alpha*(Math.asinh(Math.tan(l))-t.e*Math.atanh(t.e*Math.sin(l)))+t.K;return Math.asin(Math.tanh(u))},n=Q((e[0][0]-t.long0)*t.alpha,r(e[0][1]),(e[1][0]-t.long0)*t.alpha,r(e[1][1])),i=dt([-Math.sin(t.b0),0,Math.cos(t.b0)],n);if(ks(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(t.b0),0,Math.sin(t.b0)],n),a=q_(o,s).map(Math.atan),c=i.map(l=>Math.atanh(Math.max(-1+Number.EPSILON,Math.min(1-Number.EPSILON,l))));return ct(Be([t.x0,t.x0],Fe(a,t.R)),Be([t.y0,t.y0],Fe(c,t.R)))}function kC(t,e){let r=g=>Math.log(t.E)-t.B*Math.log(Kr(t.e,g,Math.sin(g))),n=li(r(e[0][1]),r(e[1][1])),i=Fe([e[0][0]-t.lam0,e[1][0]-t.lam0],t.B),o=Q(i[0],Math.asin(Math.tanh(n[0])),i[1],Math.asin(Math.tanh(n[1]))),s=dt([0,-t.cosgam,t.singam],o),a=Fe(li(-Math.atanh(s[0]),-Math.atanh(s[1])),t.ArB),c=Be(Fe([Math.sinh(n[0]),Math.sinh(n[1])],t.cosgam),Fe(Hf(i),t.singam)),l=Qm(i),u=l[0]>0?q_(c,l).map(Math.atan):[-Math.PI,Math.PI],h=Fe(u,t.ArB),d,m;return t.no_rot?(d=h,m=a):(h=Be(h,[-t.u_0,-t.u_0]),d=Be(Fe(a,t.cosrot),Fe(h,t.sinrot)),m=Be(Fe(h,t.cosrot),Fe(a,-t.sinrot))),ct(Be([t.x0,t.x0],Fe(d,t.a)),Be([t.y0,t.y0],Fe(m,t.a)))}function GC(t,e){let r=m=>2*(Math.atan(t.k*Math.pow(Math.tan(m/2+t.s45),t.alfa)/Math.pow((1+t.e*Math.sin(m))/(1-t.e*Math.sin(m)),t.alfa*t.e/2))-t.s45),n=Fe(Lr(e,t.long0,t.over),-t.alfa),i=Q(n[0],r(e[0][1]),n[1],r(e[1][1])),o=dt([Math.sin(t.ad),0,Math.cos(t.ad)],i),s=[Math.sqrt(Math.max(Number.EPSILON,1-ks(o)**2)),1],a=dt([0,1,0],i),c=q_(a,s),l=Fe(c.map(m=>Math.asin(Math.max(-1,Math.min(1,m)))),t.n),u=m=>t.ro0*Math.pow(Math.tan(t.s0/2+t.s45)/Math.tan(Math.asin(m)/2+t.s45),t.n),h=li(u(o[0]),u(o[1])),d=t.czech?1:-1;return ct(Be([t.x0,t.x0],Fe(Lt(h,Hf(l)),d)),Be([t.y0,t.y0],Fe(Lt(h,Qm(l)),d)))}function UC(t,e){let r=Fe([e[0][1]-t.lat0,e[1][1]-t.lat0],1e-5/Xf),n=Lr(e,t.long0,t.over),i=[0,0];for(let l=10;l>=1;l--)i=Be([t.A[l],t.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=Be(Lt(o,i),Fe(Lt(s,n),-1)),h=Be(Lt(o,n),Lt(s,i));o=Be(u,[t.B_re[l],t.B_re[l]]),s=Be(h,[t.B_im[l],t.B_im[l]])}let a=Be(Lt(o,i),Fe(Lt(s,n),-1)),c=Be(Lt(o,n),Lt(s,i));return ct(Be([t.x0,t.x0],Fe(c,t.a)),Be([t.y0,t.y0],Fe(a,t.a)))}var ka=p(()=>{et();cc();Ot();Jf();Ct()});function Ae(t){let e=xr(t);return{...e,x0:0,y0:0,lat_ts:Number.isNaN(e.lat_ts)?0:e.lat_ts}}function kt(t,e){return{...t,x0:re(e.parameters,"x_0",0),y0:re(e.parameters,"y_0",0)}}function Ie(t,e,r,n,i,o){let s=cr(t,r,n,i),a=re(e.parameters,"x_0",0),c=re(e.parameters,"y_0",0);return ui(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 Ga(t,e=0,r=!1){return(n,i)=>{let o=Math.sin(t.lat0)*Math.sin(i)+Math.cos(t.lat0)*Math.cos(i)*Math.cos(n-t.long0);if(r?o<e-1e-14:o<=e+1e-14)throw new Error("Coordinate is outside the visible projection horizon")}}var Gt=p(()=>{ic();Dn();Vt()});function JX(t){var e;if(t.phi1=t.lat1,Math.abs(t.phi1)<dd)throw new Error;t.es?(t.en=fo(t.es),t.am1=Math.sin(t.phi1),e=Math.cos(t.phi1),t.m1=_r(t.phi1,t.am1,e,t.en),t.am1=e/(Math.sqrt(1-t.es*t.am1*t.am1)*t.am1)):Math.abs(t.phi1)+dd>=F?t.cphi1=0:t.cphi1=1/Math.tan(t.phi1)}function QX(t,e){var r=G(e.x-(t.long0||0),t.over),n=e.y,i,o,s;return o=Math.sin(n),s=Math.cos(n),i=t.am1+t.m1-_r(n,o,s,t.en),o=s*r/(i*Math.sqrt(1-t.es*o*o)),e.x=i*Math.sin(o),e.y=t.am1-i*Math.cos(o),e.x=t.a*e.x+(t.x0||0),e.y=t.a*e.y+(t.y0||0),e}function eY(t,e){e.x=(e.x-(t.x0||0))/t.a,e.y=(e.y-(t.y0||0))/t.a;var r,n,i,o;if(e.y=t.am1-e.y,n=er(e.x,e.y),t.phi1<0&&(n=-n),o=ho(t.am1+t.m1-n,t.es,t.en),r=Math.abs(o),r<F)r=Math.sin(o),i=n*Math.atan2(Math.sign(t.phi1)*e.x,Math.sign(t.phi1)*e.y)*Math.sqrt(1-t.es*r*r)/Math.cos(o);else if(Math.abs(r-F)<=dd)i=0;else throw new Error;return e.x=G(i+(t.long0||0),t.over),e.y=Ts(o),e}function tY(t,e){var r=G(e.x-(t.long0||0),t.over),n=e.y,i,o;return o=t.cphi1+t.phi1-n,Math.abs(o)>dd?(i=r*Math.cos(n)/o,e.x=o*Math.sin(i),e.y=t.cphi1-o*Math.cos(i)):e.x=e.y=0,e.x=t.a*e.x+(t.x0||0),e.y=t.a*e.y+(t.y0||0),e}function rY(t,e){e.x=(e.x-(t.x0||0))/t.a,e.y=(e.y-(t.y0||0))/t.a;var r,n;e.y=t.cphi1-e.y;var i=er(e.x,e.y);if(t.phi1<0&&(i=-i),n=t.cphi1+t.phi1-i,Math.abs(n)>F)throw new Error;return Math.abs(Math.abs(n)-F)<=dd?r=0:r=i*Math.atan2(Math.sign(t.phi1)*e.x,Math.sign(t.phi1)*e.y)/Math.cos(n),e.x=G(r+(t.long0||0),t.over),e.y=Ts(n),e}function jC(t,e){return t.es?QX(t,e):tY(t,e)}function zC(t,e){return t.es?eY(t,e):rY(t,e)}function qC(t,e={}){let r={...t,phi1:0,en:[],m1:0,am1:0,cphi1:0,...e};return JX(r),r}var dd,VC=p(()=>{hd();_t();sc();su();au();ac();Ct();dd=1e-10});var V_,WC=p(()=>{ka();et();lt();Gt();VC();V_={name:"bonne",aliases:["Bonne (Werner lat_1=90)"],parameters:["lon_0","x_0","y_0","lat_1"],create(t){let e=Ae(t);if(!Object.prototype.hasOwnProperty.call(t.parameters,"lat_1")||Math.abs(e.lat1)<1e-10)throw new Error("Bonne requires a nonzero lat_1");let r=qC(e),n=Ie("bonne",t,r,jC,zC);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>BC(kt(r,t),n.forward,i),e.primeMeridian,e.over)}}});function Zu(t,e,r){var n=e*r;return t/Math.sqrt(1-n*n)}var W_=p(()=>{});function nY(t){t.sphere||(t.en=fo(t.es),t.ml0=t.a*_r(t.lat0,Math.sin(t.lat0),Math.cos(t.lat0),t.en))}function H_(t,e){var r,n,i=e.x,o=e.y;if(i=G(i-t.long0,t.over),t.sphere)r=t.a*Math.asin(Math.cos(o)*Math.sin(i)),n=t.a*(Math.atan2(Math.tan(o),Math.cos(i))-t.lat0);else{var s=Math.sin(o),a=Math.cos(o),c=Zu(t.a,t.e,s),l=Math.tan(o)*Math.tan(o),u=i*Math.cos(o),h=u*u,d=t.es*a*a/(1-t.es),m=t.a*_r(o,s,a,t.en);r=c*u*(1-h*l*(1/6+(8-l+8*d)*h/120)),n=m-t.ml0+c*s/a*h*(.5+(5-l+6*d)*h/24)}return e.x=r+t.x0,e.y=n+t.y0,e}function $C(t,e){e.x-=t.x0,e.y-=t.y0;var r=e.x/t.a,n=e.y/t.a,i,o;if(t.sphere){var s=n+t.lat0;i=Math.asin(Math.sin(s)*Math.cos(r)),o=Math.atan2(Math.tan(r),Math.cos(s))}else{var a=t.ml0/t.a+n,c=ho(a,t.es,t.en);if(Math.abs(Math.abs(c)-F)<=1e-10)return e.x=t.long0,e.y=Math.sign(c)*F,e;var l=Zu(t.a,t.e,Math.sin(c)),u=l*l*l/t.a/t.a*(1-t.es),h=Math.pow(Math.tan(c),2),d=r*t.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(!t.sphere){let g=e.x+t.x0,y=e.y+t.y0,b=t.scratch,w=!1;for(let _=0;_<12;_++){$_(t,o,i);let S=b.x-g,M=b.y-y;if(Math.max(Math.abs(S),Math.abs(M))<1e-7){w=!0;break}let v=1e-7,C=i>F-v?-v:v,R=b.x,E=b.y;$_(t,o+v,i);let U=(b.x-R)/v,I=(b.y-E)/v;$_(t,o,i+C);let O=(b.x-R)/C,A=(b.y-E)/C,V=U*A-O*I;if(!Number.isFinite(V)||Math.abs(V)<1e-12||(o-=(A*S-O*M)/V,i-=(U*M-I*S)/V,!Number.isFinite(o)||Math.abs(i)>F))break}if(!w)throw new Error("Cassini inverse did not converge")}return e.x=G(o+t.long0,t.over),e.y=Ts(i),e}function $_(t,e,r){t.scratch.x=e+t.long0,t.scratch.y=r,H_(t,t.scratch)}function HC(t,e={}){let r={...t,en:[],scratch:{x:0,y:0},ml0:0,...e};return nY(r),r}var KC=p(()=>{su();ac();au();W_();_t();hd();Ct()});var K_,XC=p(()=>{ka();et();lt();Gt();KC();K_={name:"cass",aliases:["Cassini","Cassini_Soldner"],parameters:["lon_0","x_0","y_0","lat_0"],create(t){let e=Ae(t),r=HC(e),n=Ie("cass",t,r,H_,$C);return De(n,Q(e.long0-Math.PI/6,-Math.PI/2+1e-8,e.long0+Math.PI/6,Math.PI/2-1e-8),i=>NC(kt(e,t),n.forward,i),e.primeMeridian,e.over)}}});function iY(t){t.sphere||(t.k0=yn(t.e,Math.sin(t.lat_ts),Math.cos(t.lat_ts)))}function YC(t,e){var r=e.x,n=e.y,i,o,s=G(r-t.long0,t.over);if(t.sphere)i=t.x0+t.a*s*Math.cos(t.lat_ts),o=t.y0+t.a*Math.sin(n)/Math.cos(t.lat_ts);else{var a=cn(t.e,Math.sin(n));i=t.x0+t.a*t.k0*s,o=t.y0+t.a*a*.5/t.k0}return e.x=i,e.y=o,e}function ZC(t,e){e.x-=t.x0,e.y-=t.y0;var r,n;return t.sphere?(r=G(t.long0+e.x/t.a/Math.cos(t.lat_ts),t.over),n=Math.asin(e.y/t.a*Math.cos(t.lat_ts))):(n=F1(t.e,2*e.y*t.k0/t.a),r=G(t.long0+e.x/(t.a*t.k0),t.over)),e.x=r,e.y=n,e}function JC(t,e={}){let r={...t,...e};return iY(r),r}var QC=p(()=>{_t();fd();cu();R_()});var X_,eB=p(()=>{Ot();et();lt();Gt();QC();X_={name:"cea",aliases:[],parameters:["lon_0","x_0","y_0","lat_ts"],create(t){let e=Ae(t);if(Math.abs(e.lat_ts)>=Math.PI/2)throw new Error("CEA standard parallel must be away from the poles");let r=JC(e),n=Ie("cea",t,r,YC,ZC);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Or(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function pl(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}var U1=p(()=>{});function sY(t){t.long0=t.long0||0,t.sphere?(t.n=1,t.m=0,t.es=0,t.C_y=Math.sqrt((t.m+1)/t.n),t.C_x=t.C_y/(t.m+1)):t.en=fo(t.es)}function j1(t,e){var r,n,i=e.x,o=e.y;if(i=G(i-t.long0,t.over),t.sphere){if(!t.m)o=t.n!==1?Math.asin(t.n*Math.sin(o)):o;else for(var s=t.n*Math.sin(o),a=oY;a;--a){var c=(t.m*o+Math.sin(o)-s)/(t.m+Math.cos(o));if(o-=c,Math.abs(c)<1e-10)break}r=t.a*t.C_x*i*(t.m+Math.cos(o)),n=t.a*t.C_y*o}else{var l=Math.sin(o),u=Math.cos(o);n=t.a*_r(o,l,u,t.en),r=t.a*i*u/Math.sqrt(1-t.es*l*l)}return e.x=r,e.y=n,e}function z1(t,e){var r,n,i,o;if(e.x-=t.x0,i=e.x/t.a,e.y-=t.y0,r=e.y/t.a,t.sphere){if(r/=t.C_y,i=i/(t.C_x*(t.m+Math.cos(r))),t.m){let s=(t.m*r+Math.sin(r))/t.n;if(Math.abs(s)>1+8*Number.EPSILON)return null;r=pl(s)}else t.n!==1&&(r=pl(Math.sin(r)/t.n));i=G(i+t.long0,t.over),r=Ts(r)}else r=ho(e.y/t.a,t.es,t.en),o=Math.abs(r),o<F?(o=Math.sin(r),n=t.long0+e.x*Math.sqrt(1-t.es*o*o)/(t.a*Math.cos(r)),i=G(n,t.over)):o-1e-10<F&&(i=t.long0);return e.x=i,e.y=r,e}function tB(t,e={}){let r={...t,en:[],n:0,m:0,C_y:0,C_x:0,...e};return sY(r),r}var oY,Y_=p(()=>{_t();hd();su();ac();au();Ct();U1();oY=20});function aY(t){t.sphere=!0,t.b=t.a,t.m=1,t.n=2.5707963267948966,t.es=0,t.C_y=Math.sqrt((t.m+1)/t.n),t.C_x=t.C_y/(t.m+1)}function iB(t,e={}){let r={...t,m:0,n:0,C_y:0,C_x:0,en:[],...e};return aY(r),r}var rB,nB,oB=p(()=>{Y_();rB=j1,nB=z1});var Z_,sB=p(()=>{Ot();et();lt();Gt();oB();Z_={name:"eck6",aliases:["Eckert_VI"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=iB(e),n=Ie("eck6",t,r,rB,nB);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Or(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function J_(t){var e,r=[];return r[0]=t*cY,e=t*t,r[0]+=e*lY,r[1]=e*fY,e*=t,r[0]+=e*uY,r[1]+=e*hY,r[2]=e*dY,r}var cY,lY,uY,fY,hY,dY,aB=p(()=>{cY=.3333333333333333,lY=.17222222222222222,uY=.10257936507936508,fY=.06388888888888888,hY=.0664021164021164,dY=.016415012942191543});function Q_(t,e){var r=t+t;return t+e[0]*Math.sin(r)+e[1]*Math.sin(r+r)+e[2]*Math.sin(r+r+r)}var cB=p(()=>{});function mY(t){t.long0=t.long0!==void 0?t.long0:0,t.x0=t.x0!==void 0?t.x0:0,t.y0=t.y0!==void 0?t.y0:0,t.es!==0&&(t.apa=J_(t.es),t.qp=cn(t.e,1),t.rqda=Math.sqrt(.5*t.qp))}function lB(t,e){var r=G(e.x-t.long0,t.over),n=e.y,i=Math.sin(n);t.es!==0&&(i=cn(t.e,i)/t.qp);var o=Math.asin(q1*i),s=o*o,a=s*s*s;return e.x=r*Math.cos(o)/(q1*(Ju+3*Qu*s+a*(7*ef+9*tf*s))),e.y=o*(Ju+Qu*s+a*(ef+tf*s)),t.es!==0&&(e.x*=t.rqda,e.y*=t.rqda),e.x=t.a*e.x+t.x0,e.y=t.a*e.y+t.y0,e}function uB(t,e){e.x=(e.x-t.x0)/t.a,e.y=(e.y-t.y0)/t.a,t.es!==0&&(e.x/=t.rqda,e.y/=t.rqda);let r=Math.PI/3,n=r*r,i=r*(Ju+Qu*n+n**3*(ef+tf*n));if(Math.abs(e.y)>i+8*Number.EPSILON*i)return null;var o=1e-9,s=12,a=e.y,c,l,u,h,d,m;for(m=0;m<s&&(c=a*a,l=c*c*c,u=a*(Ju+Qu*c+l*(ef+tf*c))-e.y,h=Ju+3*Qu*c+l*(7*ef+9*tf*c),a-=d=u/h,!(Math.abs(d)<o));++m);c=a*a,l=c*c*c,e.x=q1*e.x*(Ju+3*Qu*c+l*(7*ef+9*tf*c))/Math.cos(a);let g=Math.sin(a)/q1,y=8*Number.EPSILON;return Math.abs(g)>1+y?null:(e.y=Math.abs(g)>=1-y?Math.sign(g)*Math.PI/2:Math.asin(g),t.es!==0&&(e.y=Q_(e.y,t.apa)),e.x=G(e.x+t.long0,t.over),e)}function fB(t,e={}){let r={...t,apa:[],qp:0,rqda:0,...e};return mY(r),r}var Ju,Qu,ef,tf,q1,hB=p(()=>{_t();fd();aB();cB();Ju=1.340264,Qu=-.081106,ef=893e-6,tf=.003796,q1=Math.sqrt(3)/2});var eS,dB=p(()=>{Vt();Gt();hB();et();lt();Ot();eS={name:"eqearth",aliases:["Equal Earth","Equal_Earth"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=t.primeMeridian??0,n=fB(e),i=Ie("eqearth",t,n,lB,uB),o=Math.sqrt(t.eccentricitySquared),s=t.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(t.parameters,"x_0",0),d=re(t.parameters,"y_0",0),m=s*a*(1.340264-.081106*c+l*(893e-6+.003796*c));return{...i,longitudeOrigin:e.long0,getRenderingProfile(g){if(g)return ar(b=>Or(i.forward,b,e.long0,e.over),g,e.long0,r,e.over);let y=[[h-u,d-m,0],[h+u,d+m,0]];return{bounds:y,normalize:ar(()=>y,Bn(Q(e.long0-Math.PI,-(Math.PI/2),e.long0+Math.PI,Math.PI/2),r),e.long0,r,e.over).normalize}}}}}});function pY(t){t.x0=t.x0||0,t.y0=t.y0||0,t.lat0=t.lat0||0,t.long0=t.long0||0}function mB(t,e){var r=e.x,n=e.y,i=G(r-t.long0,t.over),o=t.x0+t.a*i*Math.cos(t.lat0),s=t.y0+t.a*n;return t.t1=o,t.t2=Math.cos(t.lat0),e.x=o,e.y=s,e}function pB(t,e){e.x-=t.x0,e.y-=t.y0;var r=e.y/t.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=G(t.long0+e.x/(t.a*Math.cos(t.lat0)),t.over);return e.x=n,e.y=r,e}function gB(t,e={}){let r={...t,t2:0,t1:0,...e};return pY(r),r}var yB=p(()=>{_t()});var tS,bB=p(()=>{Ot();et();lt();Gt();yB();tS={name:"equi",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(t){let e=Ae(t);if(Math.abs(e.lat0)>=Math.PI/2)throw new Error("Equirectangular standard parallel must be away from the poles");let r=gB(e),n=Ie("equi",t,r,mB,pB);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Or(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function wB(t,e,r=!1){let n=1+e/t.a,i=n/(1+1e-10),o=h=>Math.acos(Math.min(1,Math.sqrt(1-t.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-t.es))))},a=e*Math.asin(1/n),c=e*Math.atan(Math.sqrt((1-t.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]-t.long0,-g),b=Math.min(h[1][0]-t.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 M=Q(y,_,b,S),v=Bn(Q(y+t.long0,_,b+t.long0,S),t.primeMeridian),C=(t.long0+t.primeMeridian)*180/Math.PI,R=Us(E=>{let U=Math.max(y,Math.min(b,Kt(E.x-t.long0))),I=s(U),O=Math.max(Math.max(_,-I),Math.min(Math.min(S,I),E.y));U!==E.x-t.long0&&(E.x=U+t.long0),E.y=O},t.primeMeridian);return{get bounds(){if(!d)return ct([t.x0-a,t.x0+a],[t.y0-c,t.y0+c]);let E=dt([0,0,1],M),U=[1,1/Math.sqrt(1-t.es*Math.max(E[0]**2,E[1]**2))],I=Lt(dt([1,0,0],M),U),O=Lt(dt([0,1,0],M),U),A=Lt(E,[1-t.es,(1-t.es)*U[1]]),V=[n-Math.min(1,I[1]),n-Math.max(1/n,I[0])],k=(T,B,N,D)=>{let L=B[0]<=0&&B[1]>=0?0:Math.min(Math.abs(B[0]),Math.abs(B[1])),P=D?[Math.hypot(V[0],L),Math.hypot(V[1],Math.max(Math.abs(B[0]),Math.abs(B[1])))]:V,z=T.flatMap(we=>P.map(_e=>e*Math.atan(we/_e)));return[Math.max(-N,Math.min(...z)),Math.min(N,Math.max(...z))]};return ct(Be([t.x0,t.x0],k(O,A,a,r)),Be([t.y0,t.y0],k(A,O,c,!r)))},normalize(E){rp(E,v,C),R(E)}}},u=Bn(Q(t.long0-o(0),-s(0),t.long0+o(0),s(0)),t.primeMeridian);return h=>{let d=h?ep(h,u):[u],m=tp(d,g=>l(Gs(g,t.primeMeridian,t.long0),!!h));if(!m)throw new Error("CRS coverage does not intersect the satellite limb");return m}}var xB=p(()=>{et();nc();lt();Vt();cc();Ot()});function gY(t){if(t.flip_axis=t.sweep==="x"?1:0,t.h=Number(t.h),t.radius_g_1=t.h/t.a,t.radius_g_1<=0||t.radius_g_1>1e10)throw new Error;if(t.radius_g=1+t.radius_g_1,t.C=t.radius_g*t.radius_g-1,t.es!==0){var e=1-t.es,r=1/e;t.radius_p=Math.sqrt(e),t.radius_p2=e,t.radius_p_inv2=r,t.shape="ellipse"}else t.radius_p=1,t.radius_p2=1,t.radius_p_inv2=1,t.shape="sphere"}function _B(t,e){var r=e.x,n=e.y,i,o,s,a;if(r=r-t.long0,t.shape==="ellipse"){n=Math.atan(t.radius_p2*Math.tan(n));var c=t.radius_p/er(t.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),(t.radius_g-o)*o-s*s-a*a*t.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;i=t.radius_g-o,t.flip_axis?(e.x=t.radius_g_1*Math.atan(s/er(a,i)),e.y=t.radius_g_1*Math.atan(a/i)):(e.x=t.radius_g_1*Math.atan(s/i),e.y=t.radius_g_1*Math.atan(a/er(s,i)))}else t.shape==="sphere"&&(i=Math.cos(n),o=Math.cos(r)*i,s=Math.sin(r)*i,a=Math.sin(n),i=t.radius_g-o,t.flip_axis?(e.x=t.radius_g_1*Math.atan(s/er(a,i)),e.y=t.radius_g_1*Math.atan(a/i)):(e.x=t.radius_g_1*Math.atan(s/i),e.y=t.radius_g_1*Math.atan(a/er(s,i))));return e.x=e.x*t.a,e.y=e.y*t.a,e}function SB(t,e){var r=-1,n=0,i=0,o,s,a,c;if(e.x=e.x/t.a,e.y=e.y/t.a,t.shape==="ellipse"){t.flip_axis?(i=Math.tan(e.y/t.radius_g_1),n=Math.tan(e.x/t.radius_g_1)*er(1,i)):(n=Math.tan(e.x/t.radius_g_1),i=Math.tan(e.y/t.radius_g_1)*er(1,n));var l=i/t.radius_p;if(o=n*n+l*l+r*r,s=2*t.radius_g*r,a=s*s-4*o*t.C,a<0)return e.x=Number.NaN,e.y=Number.NaN,e;c=(-s-Math.sqrt(a))/(2*o),r=t.radius_g+c*r,n*=c,i*=c,e.x=Math.atan2(n,r),e.y=Math.atan(i*Math.cos(e.x)/r),e.y=Math.atan(t.radius_p_inv2*Math.tan(e.y))}else if(t.shape==="sphere"){if(t.flip_axis?(i=Math.tan(e.y/t.radius_g_1),n=Math.tan(e.x/t.radius_g_1)*Math.sqrt(1+i*i)):(n=Math.tan(e.x/t.radius_g_1),i=Math.tan(e.y/t.radius_g_1)*Math.sqrt(1+n*n)),o=n*n+i*i+r*r,s=2*t.radius_g*r,a=s*s-4*o*t.C,a<0)return e.x=Number.NaN,e.y=Number.NaN,e;c=(-s-Math.sqrt(a))/(2*o),r=t.radius_g+c*r,n*=c,i*=c,e.x=Math.atan2(n,r),e.y=Math.atan(i*Math.cos(e.x)/r)}return e.x=e.x+t.long0,e}function MB(t,e={}){let r={...t,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:"",...e};return gY(r),r}var vB=p(()=>{sc()});var rS,EB=p(()=>{xB();Gt();vB();Vt();rS={name:"geos",aliases:["Geostationary Satellite View","Geostationary_Satellite"],parameters:["lon_0","x_0","y_0","h","sweep"],create(t){let e=Ae(t),r=re(t.parameters,"h",NaN);if(!Number.isFinite(r)||r<=0)throw new Error("Geostationary projection requires positive h");let n=t.parameters.sweep||"y";if(!["x","y"].includes(n))throw new Error("Geostationary sweep must be x or y");let i=MB(e,{h:r,sweep:n});return{...Ie("geos",t,i,_B,SB,e.sphere?Ga({...e,lat0:0},1/(1+r/e.a),!0):void 0),longitudeOrigin:e.long0,getRenderingProfile:wB(kt(e,t),r,n==="x")}}}});function TB(t){return{engine:mA({semiMajorAxis:1,semiMinorAxis:Math.sqrt(1-t.es)}),latitude:t.lat0*gl}}function AB(t,e,r){let n=e.engine.Inverse(e.latitude,0,r.y*gl,G(r.x-t.long0,t.over)*gl,Wf);if(!(n.M12>0))throw new Error("Coordinate is outside the ellipsoidal gnomonic horizon");let i=t.a*n.m12/n.M12,o=n.azi1/gl;return r.x=t.x0+i*Math.sin(o),r.y=t.y0+i*Math.cos(o),r}function IB(t,e,r){let n=(r.x-t.x0)/t.a,i=(r.y-t.y0)/t.a,o=Math.hypot(n,i);if(o===0)return r.x=t.long0,r.y=t.lat0,r;let s=e.engine.Line(e.latitude,0,Math.atan2(n,i)*gl,Wf),a=o<=1,c=a?o:1/o,l=Math.atan(o);for(let u=0;u<20;u++){let h=s.Position(l,Wf),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,Wf);if(!(m.M12>0))break;return r.x=G(t.long0+m.lon2/gl,t.over),r.y=m.lat2/gl,r}}throw new Error("Ellipsoidal gnomonic inverse did not converge")}var gl,PB=p(()=>{pA();_t();gl=180/Math.PI});function yY(t){t.sphere||(t.ellipsoid=TB(t)),t.sin_p14=Math.sin(t.lat0),t.cos_p14=Math.cos(t.lat0),t.infinity_dist=1e3*t.a,t.rc=1}function RB(t,e){if(t.ellipsoid)return AB(t,t.ellipsoid,e);var r,n,i,o,s,a,c,l,u=e.x,h=e.y;return i=G(u-t.long0,t.over),r=Math.sin(h),n=Math.cos(h),o=Math.cos(i),a=t.sin_p14*r+t.cos_p14*n*o,s=1,a>0||Math.abs(a)<=1e-10?(c=t.x0+t.a*s*n*Math.sin(i)/a,l=t.y0+t.a*s*(t.cos_p14*r-t.sin_p14*n*o)/a):(c=t.x0+t.infinity_dist*n*Math.sin(i),l=t.y0+t.infinity_dist*(t.cos_p14*r-t.sin_p14*n*o)),e.x=c,e.y=l,e}function LB(t,e){if(t.ellipsoid)return IB(t,t.ellipsoid,e);var r,n,i,o,s,a;return e.x=(e.x-t.x0)/t.a,e.y=(e.y-t.y0)/t.a,e.x/=t.k0,e.y/=t.k0,r=Math.sqrt(e.x*e.x+e.y*e.y),r?(o=Math.atan2(r,t.rc),n=Math.sin(o),i=Math.cos(o),a=pl(i*t.sin_p14+e.y*n*t.cos_p14/r),s=Math.atan2(e.x*n,r*t.cos_p14*i-e.y*t.sin_p14*n),s=G(t.long0+s,t.over)):(a=t.lat0,s=t.long0),e.x=s,e.y=a,e}function OB(t,e={}){let r={...t,sin_p14:0,cos_p14:0,infinity_dist:0,rc:0,phic0:0,...e};return yY(r),r}var CB=p(()=>{PB();_t();U1()});var nS,BB=p(()=>{Ks();Xs();Gt();CB();nS={name:"gnom",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(t){let e=Ae(t),r=OB(e);return gn(Ie("gnom",t,r,RB,LB,e.sphere?Ga(e):void 0),e,Math.min(Math.PI*80/180,(1-e.es)*Math.PI*.45),(n,i)=>e.sphere?cp(kt(e,t),n,i,"gnom"):r8(kt(e,t),n,i),(1-e.es)*Math.PI/2)}}});function iS(t,e){return 2*Math.atan(t*Math.exp(e))-F}var DB=p(()=>{Ct()});function V1(t,e){var r=iS(1,e),n=0,i=0;let o=0;do{if(++o>50)throw new Error("Isometric latitude inverse did not converge");n=r,i=t*Math.sin(n),r=iS(Math.exp(t*Math.log((1+i)/(1-i))/2),e)}while(Math.abs(r-n)>1e-12);return r}var oS=p(()=>{DB()});function rf(t,e,r){if(Math.abs(e)>F)return Number.NaN;if(e===F)return Number.POSITIVE_INFINITY;if(e===-1*F)return Number.NEGATIVE_INFINITY;var n=t*r;return Math.log(Math.tan((F+e)/2))+t*Math.log((1-n)/(1+n))/2}var NB=p(()=>{Ct()});function bY(t){t.k0||(t.k0=1);var e=t.b/t.a;t.e=Math.sqrt(1-e*e),t.lc=t.long0,t.rs=Math.sqrt(1+t.e*t.e*Math.pow(Math.cos(t.lat0),4)/(1-t.e*t.e));var r=Math.sin(t.lat0),n=Math.asin(r/t.rs),i=Math.sin(n);t.cp=rf(0,n,i)-t.rs*rf(t.e,t.lat0,r),t.n2=t.k0*t.a*Math.sqrt(1-t.e*t.e)/(1-t.e*t.e*r*r),t.xs=t.x0,t.ys=t.y0-t.n2*n}function FB(t,e){var r=e.x,n=e.y,i=t.rs*(r-t.lc),o=t.cp+t.rs*rf(t.e,n,Math.sin(n)),s=Math.asin(Math.sin(i)/Kf(o)),a=rf(0,s,Math.sin(s));return e.x=t.xs+t.n2*a,e.y=t.ys+t.n2*Math.atan(oc(o)/Math.cos(i)),e}function kB(t,e){var r=e.x,n=e.y,i=Math.atan(oc((r-t.xs)/t.n2)/Math.cos((n-t.ys)/t.n2)),o=Math.asin(Math.sin((n-t.ys)/t.n2)/Kf((r-t.xs)/t.n2)),s=rf(0,o,Math.sin(o));return e.x=t.lc+i/t.rs,e.y=V1(t.e,(s-t.cp)/t.rs),e}function GB(t,e={}){let r={...t,lc:0,rs:0,cp:0,n2:0,xs:0,ys:0,...e};return bY(r),r}var UB=p(()=>{NB();ip();C2();oS()});var sS,jB=p(()=>{Ot();oS();et();lt();Gt();UB();sS={name:"gstmerc",aliases:["gstmerg"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(t){let e=Ae(t),r=GB(e),n=Ie("gstmerc",t,r,FB,kB);return De(n,Q(e.long0-Math.PI/6,-Math.PI/3,e.long0+Math.PI/6,Math.PI/3),i=>ru(n.forward,i,e.long0,e.over,V1(r.e,-r.cp/r.rs)),e.primeMeridian,e.over)}}});function wY(t){t.a=6377397155e-3,t.es=.006674372230614,t.e=Math.sqrt(t.es),t.s45=Math.PI/4,t.s90=2*t.s45,t.fi0=t.lat0,t.e2=t.es,t.e=Math.sqrt(t.e2),t.alfa=Math.sqrt(1+t.e2*Math.pow(Math.cos(t.fi0),4)/(1-t.e2)),t.uq=1.04216856380474,t.u0=Math.asin(Math.sin(t.fi0)/t.alfa),t.g=Math.pow((1+t.e*Math.sin(t.fi0))/(1-t.e*Math.sin(t.fi0)),t.alfa*t.e/2),t.k=Math.tan(t.u0/2+t.s45)/Math.pow(Math.tan(t.fi0/2+t.s45),t.alfa)*t.g,t.k1=t.k0,t.n0=t.a*Math.sqrt(1-t.e2)/(1-t.e2*Math.pow(Math.sin(t.fi0),2)),t.s0=1.37008346281555,t.n=Math.sin(t.s0),t.ro0=t.k1*t.n0/Math.tan(t.s0),t.ad=t.s90-t.uq}function zB(t,e){var r,n,i,o,s,a,c,l=e.x,u=e.y,h=G(l-t.long0,t.over);return r=Math.pow((1+t.e*Math.sin(u))/(1-t.e*Math.sin(u)),t.alfa*t.e/2),n=2*(Math.atan(t.k*Math.pow(Math.tan(u/2+t.s45),t.alfa)/r)-t.s45),i=-h*t.alfa,o=Math.asin(Math.cos(t.ad)*Math.sin(n)+Math.sin(t.ad)*Math.cos(n)*Math.cos(i)),s=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(o)),a=t.n*s,c=t.ro0*Math.pow(Math.tan(t.s0/2+t.s45),t.n)/Math.pow(Math.tan(o/2+t.s45),t.n),e.y=c*Math.cos(a)/1,e.x=c*Math.sin(a)/1,t.czech||(e.y*=-1,e.x*=-1),e}function qB(t,e){var r,n,i,o,s,a,c,l,u=e.x;e.x=e.y,e.y=u,t.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),s=Math.atan2(e.y,e.x),o=s/Math.sin(t.s0),i=2*(Math.atan(Math.pow(t.ro0/a,1/t.n)*Math.tan(t.s0/2+t.s45))-t.s45),r=Math.asin(Math.cos(t.ad)*Math.sin(i)-Math.sin(t.ad)*Math.cos(i)*Math.cos(o)),n=Math.asin(Math.cos(i)*Math.sin(o)/Math.cos(r)),e.x=t.long0-n/t.alfa,c=r,l=0;var h=0;do e.y=2*(Math.atan(Math.pow(t.k,-1/t.alfa)*Math.pow(Math.tan(r/2+t.s45),1/t.alfa)*Math.pow((1+t.e*Math.sin(c))/(1-t.e*Math.sin(c)),t.e/2))-t.s45),Math.abs(c-e.y)<1e-10&&(l=1),c=e.y,h+=1;while(l===0&&h<15);return h>=15?null:e}function VB(t,e={}){let r={...t,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,...e};return wY(r),r}var WB=p(()=>{_t()});var aS,$B=p(()=>{ka();et();lt();Gt();WB();Vt();Dn();aS={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(t){let e=re(t.parameters,"alpha",30.28813972222222),r=re(t.parameters,"lat_ts",78.5);if(![30.28813972222222,30.28813975277778].some(s=>Math.abs(e-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(t);n.lat0=zs(t.parameters,"lat_0",49.5),n.long0=zs(t.parameters,"lon_0",24.83333333333333),n.k0=re(t.parameters,"k_0",re(t.parameters,"k",.9999));let i=VB(n,{czech:Li(t.parameters,"czech")}),o=Ie("krovak",t,i,zB,qB);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=>GC(kt(i,t),s),n.primeMeridian,n.over)}}});function HB(t,e){var r=e.x,n=e.y,i=G(r-t.long0,t.over),o=t.x0+t.a*i,s=t.y0+t.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return e.x=o,e.y=s,e}function KB(t,e){e.x-=t.x0,e.y-=t.y0;var r=G(t.long0+e.x/t.a,t.over),n=2.5*(Math.atan(Math.exp(.8*e.y/t.a))-Math.PI/4);return e.x=r,e.y=n,e}function XB(t,e={}){let r={...t,...e};return r}var YB=p(()=>{_t()});var cS,ZB=p(()=>{Ot();et();lt();Gt();YB();cS={name:"mill",aliases:["Miller_Cylindrical"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=XB(e),n=Ie("mill",t,r,HB,KB);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Or(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function xY(t){t.x0=t.x0!==void 0?t.x0:0,t.y0=t.y0!==void 0?t.y0:0,t.long0=t.long0!==void 0?t.long0:0}function JB(t,e){var r=e.x,n=e.y,i=G(r-t.long0,t.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=tD(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*t.a*i*Math.sin(c/2)+t.x0,d=Math.sign(n)*Math.SQRT2*t.a*Math.cos(c/2)+t.y0;return e.x=h,e.y=d,e}function QB(t,e){let r=e.x-t.x0,n=(e.y-t.y0)/(Math.SQRT2*t.a);if(Math.abs(n)>1+8*Number.EPSILON)return null;let i=r/(2*Math.SQRT2*t.a),o=i*i+n*n;if(!t.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(!t.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*t.a)return null;let c=a===0?0:Math.PI*i/a;var l=G(t.long0+c,t.over),u=Math.sign(n)*(Math.PI/2-2*Math.asin(Math.sqrt(tD(s)/(2*Math.PI))));return e.x=l,e.y=u,e}function eD(t,e={}){let r={...t,...e};return xY(r),r}function tD(t){if(t>.5)return t-Math.sin(t);let e=t*t;return t*e*(1/6+e*(-1/120+e*(1/5040+e*(-1/362880+e*(1/39916800+e*(-1/6227020800+e/1307674368e3))))))}var rD=p(()=>{_t()});var lS,nD=p(()=>{Ot();et();lt();Gt();rD();lS={name:"moll",aliases:["Mollweide"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=eD(e),n=Ie("moll",t,r,JB,QB);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Or(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function _Y(t){t.A=[],t.A[1]=.6399175073,t.A[2]=-.1358797613,t.A[3]=.063294409,t.A[4]=-.02526853,t.A[5]=.0117879,t.A[6]=-.0055161,t.A[7]=.0026906,t.A[8]=-.001333,t.A[9]=67e-5,t.A[10]=-34e-5,t.B_re=[],t.B_im=[],t.B_re[1]=.7557853228,t.B_im[1]=0,t.B_re[2]=.249204646,t.B_im[2]=.003371507,t.B_re[3]=-.001541739,t.B_im[3]=.04105856,t.B_re[4]=-.10162907,t.B_im[4]=.01727609,t.B_re[5]=-.26623489,t.B_im[5]=-.36249218,t.B_re[6]=-.6870983,t.B_im[6]=-1.1651967,t.C_re=[],t.C_im=[],t.C_re[1]=1.3231270439,t.C_im[1]=0,t.C_re[2]=-.577245789,t.C_im[2]=-.007809598,t.C_re[3]=.508307513,t.C_im[3]=-.112208952,t.C_re[4]=-.15094762,t.C_im[4]=.18200602,t.C_re[5]=1.01418179,t.C_im[5]=1.64497696,t.C_re[6]=1.9660549,t.C_im[6]=2.5127645,t.D=[],t.D[1]=1.5627014243,t.D[2]=.5185406398,t.D[3]=-.03333098,t.D[4]=-.1052906,t.D[5]=-.0368594,t.D[6]=.007317,t.D[7]=.0122,t.D[8]=.00394,t.D[9]=-.0013}function iD(t,e){var r,n=e.x,i=e.y,o=i-t.lat0,s=n-t.long0,a=o/Xf*1e-5,c=s,l=1,u=0;for(r=1;r<=10;r++)l=l*a,u=u+t.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+t.B_re[r]*m-t.B_im[r]*g,_=_+t.B_im[r]*m+t.B_re[r]*g;return e.x=_*t.a+t.x0,e.y=w*t.a+t.y0,e}function oD(t,e){var r,n=e.x,i=e.y,o=n-t.x0,s=i-t.y0,a=s/t.a,c=o/t.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+t.C_re[r]*l-t.C_im[r]*u,g=g+t.C_im[r]*l+t.C_re[r]*u;for(var y=0;y<t.iterations;y++){var b=m,w=g,_,S,M=a,v=c;for(r=2;r<=6;r++)_=b*m-w*g,S=w*m+b*g,b=_,w=S,M=M+(r-1)*(t.B_re[r]*b-t.B_im[r]*w),v=v+(r-1)*(t.B_im[r]*b+t.B_re[r]*w);b=1,w=0;var C=t.B_re[1],R=t.B_im[1];for(r=2;r<=6;r++)_=b*m-w*g,S=w*m+b*g,b=_,w=S,C=C+r*(t.B_re[r]*b-t.B_im[r]*w),R=R+r*(t.B_im[r]*b+t.B_re[r]*w);var E=C*C+R*R;m=(M*C+v*R)/E,g=(v*C-M*R)/E}var U=m,I=g,O=1,A=0;for(r=1;r<=9;r++)O=O*U,A=A+t.D[r]*O;var V=t.lat0+A*Xf*1e5,k=t.long0+I;return e.x=k,e.y=V,e}function sD(t,e={}){let r={...t,A:[],B_re:[],B_im:[],C_re:[],C_im:[],D:[],iterations:1,...e};return _Y(r),r}var aD=p(()=>{Ct()});var uS,cD=p(()=>{ka();et();lt();Gt();aD();Vt();uS={name:"nzmg",aliases:["New_Zealand_Map_Grid"],parameters:["lon_0","x_0","y_0","lat_0","iterations"],create(t){let e=Ae(t),r=re(t.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(t.parameters,"lat_0")||!Object.prototype.hasOwnProperty.call(t.parameters,"lon_0"))throw new Error("NZMG requires lat_0 and lon_0");let n=sD(e,{iterations:r}),i=Ie("nzmg",t,n,iD,oD);return De(i,Q(e.long0-Math.PI/22.5,Math.max(-Math.PI/2,e.lat0-Math.PI/22.5),e.long0+Math.PI/22.5,Math.min(Math.PI/2,e.lat0+Math.PI/22.5)),o=>UC(kt(n,t),o),e.primeMeridian,e.over)}}});function SY(t){return t.no_uoff||t.no_off||["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(t.projName.toLowerCase().replace(/[ _-]/g,""))}function MY(t){var e,r,n,i,o,s,a,c,l,u,h=0,d,m=0,g=0,y=0,b=0,w=0,_=0;t.k0||(t.k0=1),t.no_off=SY(t),t.no_rot=t.no_rot;var S=!1;Number.isFinite(t.alpha)&&(S=!0);var M=!1;if(Number.isFinite(t.rectified_grid_angle)&&(M=!0),S&&(_=t.alpha),M&&(h=t.rectified_grid_angle,S||(_=0,S=!0)),S||M)m=t.longc;else if(g=t.long1,b=t.lat1,y=t.long2,w=t.lat2,Math.abs(b-w)<=nf||Math.abs(b)<=nf||Math.abs(Math.abs(b)-F)<=nf||Math.abs(Math.abs(t.lat0)-F)<=nf||Math.abs(Math.abs(w)-F)<=nf)throw new Error;var v=1-t.es;if(r=Math.sqrt(v),Math.abs(t.lat0)>1e-10?(c=Math.sin(t.lat0),n=Math.cos(t.lat0),e=1-t.es*c*c,t.B=n*n,t.B=Math.sqrt(1+t.es*t.B*t.B/v),t.A=t.B*t.k0*r/e,i=t.B*r/(n*Math.sqrt(e)),o=i*i-1,o<=0?o=0:(o=Math.sqrt(o),t.lat0<0&&(o=-o)),t.E=o+=i,t.E*=Math.pow(Kr(t.e,t.lat0,c),t.B)):(t.B=1/r,t.A=t.k0,t.E=i=o=1),S||M){S?(d=Math.asin(Math.sin(_)/i),M||(h=_)):(d=h,_=Math.asin(i*Math.sin(d)));let C=.5*(o-1/o)*Math.tan(d);i>1&&Math.abs(Math.cos(_))<=8*Number.EPSILON?C=Math.sign(t.lat0)*Math.sign(Math.sin(_)):Math.abs(C)>1&&Math.abs(C)<=1+8*Number.EPSILON&&(C=Math.sign(C)),t.lam0=m-Math.asin(C)/t.B}else s=Math.pow(Kr(t.e,b,Math.sin(b)),t.B),a=Math.pow(Kr(t.e,w,Math.sin(w)),t.B),o=t.E/s,l=(a-s)/(a+s),u=t.E*t.E,u=(u-a*s)/(u+a*s),e=g-y,e<-Math.PI?y-=Vs:e>Math.PI&&(y+=Vs),t.lam0=G(.5*(g+y)-Math.atan(u*Math.tan(.5*t.B*(g-y))/l)/t.B,t.over),d=Math.atan(2*Math.sin(t.B*G(g-t.lam0,t.over))/(o-1/o)),h=_=Math.asin(i*Math.sin(d));t.singam=Math.sin(d),t.cosgam=Math.cos(d),t.sinrot=Math.sin(h),t.cosrot=Math.cos(h),t.rB=1/t.B,t.ArB=t.A*t.rB,t.BrA=1/t.ArB,t.no_off?t.u_0=0:(t.u_0=Math.abs(t.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(_))),t.lat0<0&&(t.u_0=-t.u_0)),o=.5*d,t.v_pole_n=t.ArB*Math.log(Math.tan(tt-o)),t.v_pole_s=t.ArB*Math.log(Math.tan(tt+o))}function lD(t,e){var r=e,n,i,o,s,a,c,l,u;if(e.x=e.x-t.lam0,Math.abs(Math.abs(e.y)-F)>1e-10){if(a=t.E/Math.pow(Kr(t.e,e.y,Math.sin(e.y)),t.B),c=1/a,n=.5*(a-c),i=.5*(a+c),s=Math.sin(t.B*e.x),o=(n*t.singam-s*t.cosgam)/i,Math.abs(Math.abs(o)-1)<1e-10)throw new Error;u=.5*t.ArB*Math.log((1-o)/(1+o)),c=Math.cos(t.B*e.x),Math.abs(c)<nf?l=t.A*e.x:l=t.ArB*Math.atan2(n*t.cosgam+s*t.singam,c)}else u=e.y>0?t.v_pole_n:t.v_pole_s,l=t.ArB*e.y;return t.no_rot?(r.x=l,r.y=u):(l-=t.u_0,r.x=u*t.cosrot+l*t.sinrot,r.y=l*t.cosrot-u*t.sinrot),r.x=t.a*r.x+t.x0,r.y=t.a*r.y+t.y0,r}function uD(t,e){var r,n,i,o,s,a,c,l=e;if(e.x=(e.x-t.x0)*(1/t.a),e.y=(e.y-t.y0)*(1/t.a),t.no_rot?(n=e.y,r=e.x):(n=e.x*t.cosrot-e.y*t.sinrot,r=e.y*t.cosrot+e.x*t.sinrot+t.u_0),i=Math.exp(-t.BrA*n),o=.5*(i-1/i),s=.5*(i+1/i),a=Math.sin(t.BrA*r),c=(a*t.cosgam+o*t.singam)/s,Math.abs(Math.abs(c)-1)<1e-10)l.x=0,l.y=c<0?-F:F;else{if(l.y=t.E/Math.sqrt((1+c)/(1-c)),l.y=lc(t.e,Math.pow(l.y,1/t.B)),l.y===1/0)throw new Error;l.x=-t.rB*Math.atan2(o*t.cosgam-a*t.singam,Math.cos(t.BrA*r))}return l.x+=t.lam0,l}function fD(t,e={}){let r={...t,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:"",...e};return MY(r),r}var nf,hD=p(()=>{Jf();_t();up();Ct();nf=1e-7});var fS,dD=p(()=>{ka();et();lt();Gt();hD();Vt();Dn();fS={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(t){let e=Ae(t);if(Math.abs(e.lat0)>=Math.PI/2)throw new Error("Oblique Mercator origin must be away from the poles");let n=Object.prototype.hasOwnProperty.call(t.parameters,"alpha")||Object.prototype.hasOwnProperty.call(t.parameters,"gamma")?["lonc"]:["lon_1","lat_1","lon_2","lat_2"];for(let s of n)if(!Object.prototype.hasOwnProperty.call(t.parameters,s))throw new Error("Oblique Mercator requires "+s);let i=fD(e,{projName:t.parameters.proj||"omerc",alpha:re(t.parameters,"alpha",NaN)*Math.PI/180,rectified_grid_angle:re(t.parameters,"gamma",NaN)*Math.PI/180,longc:re(t.parameters,"lonc",0)*Math.PI/180,long1:re(t.parameters,"lon_1",0)*Math.PI/180,long2:re(t.parameters,"lon_2",0)*Math.PI/180,no_off:Li(t.parameters,"no_off"),no_uoff:Li(t.parameters,"no_uoff"),no_rot:Li(t.parameters,"no_rot")}),o=Ie("omerc",t,i,lD,uD);return De(o,Q(i.lam0-Math.PI/18,Math.max(-Math.PI/2+1e-8,e.lat0-Math.PI/18),i.lam0+Math.PI/18,Math.min(Math.PI/2-1e-8,e.lat0+Math.PI/18)),s=>kC(kt(i,t),s),e.primeMeridian,e.over)}}});function mD(t){let e=Math.sin(t.lat0),r=Math.cos(t.lat0),n=1/Math.sqrt(1-t.es*e*e);return{...t,sin0:e,cos0:r,originY:-t.es*n*e*r}}function pD(t,e){let r=G(e.x-t.long0,t.over),n=Math.sin(e.y),i=Math.cos(e.y),o=1/Math.sqrt(1-t.es*n*n);return e.x=t.x0+t.a*t.k0*o*i*Math.sin(r),e.y=t.y0+t.a*t.k0*(o*((1-t.es)*n*t.cos0-i*Math.cos(r)*t.sin0)-t.originY),e}function gD(t,e){let r=(e.x-t.x0)/(t.a*t.k0),n=(e.y-t.y0)/(t.a*t.k0)+t.originY,i=1-t.es,o=t.cos0*t.cos0+t.sin0*t.sin0/i,s=n*t.sin0*t.cos0*t.es/i,a=r*r+n*n*(t.sin0*t.sin0+t.cos0*t.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*t.cos0-n*t.sin0,h=l*t.sin0+n*t.cos0;return e.x=G(t.long0+Math.atan2(r,u),t.over),e.y=Math.atan2(h,i*Math.hypot(u,r)),e}var yD=p(()=>{_t()});var hS,bD=p(()=>{Ks();Xs();Gt();yD();hS={name:"ortho",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(t){let e=Ae(t),r=mD(e);return gn(Ie("ortho",t,r,pD,gD,Ga(e,0,!0)),e,Math.PI/2,(n,i)=>JA(kt(e,t),n,i),Math.PI/2)}}});function vY(t){t.meridianPole=ri(t.a,t.es,0,Math.PI/2),t.poleRadius=t.a/Math.sqrt(1-t.es),t.ml0=ri(t.a,t.es,0,t.lat0)}function _D(t,e){var r=e.x,n=e.y,i,o,s,a=G(r-t.long0,t.over);if(s=a*Math.sin(n),t.sphere)n===0?(i=t.a*a,o=-1*t.a*t.lat0):(i=t.a*Math.sin(s)/Math.tan(n),o=t.a*(n-t.lat0+2*Math.sin(s/2)**2/Math.tan(n)));else if(n===0)i=t.a*a,o=-1*t.ml0;else{var c=Zu(t.a,t.e,Math.sin(n))/Math.tan(n);i=c*Math.sin(s),o=ri(t.a,t.es,t.lat0,n)+c*(2*Math.sin(s/2)**2)}return e.x=i+t.x0,e.y=o+t.y0,e}function SD(t,e){var r,n,i,o,s,a,c,l,u;i=e.x-t.x0,o=e.y-t.y0;let h=o+(t.sphere?t.a*t.lat0:t.ml0),d=h<0?-1:1,g=(t.sphere?t.a*Math.PI/2:t.meridianPole)-d*h,y=Math.hypot(i,g);if(y/t.a<1e-6)return e.x=G(t.long0+Math.atan2(i,g),t.over),e.y=d*(Math.PI/2-y/t.poleRadius),e;if(t.sphere)if(Math.abs(o+t.a*t.lat0)<=1e-10)r=G(i/t.a+t.long0,t.over),n=0;else{a=t.lat0+o/t.a,c=i*i/t.a/t.a+a*a,l=a;var b;for(s=wD;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=xD(t,n===void 0?l:n,i,o),n===void 0)return null;l=n,r=G(t.long0+Math.asin(i*Math.tan(l)/t.a)/Math.sin(n),t.over)}else if(Math.abs(o+t.ml0)<=1e-10)n=0,r=G(t.long0+i/t.a,t.over);else{a=(t.ml0+o)/t.a,c=i*i/t.a/t.a+a*a,l=a;var w,_,S,M,v;for(s=wD;s;--s)if(v=t.e*Math.sin(l),w=Math.sqrt(1-v*v)*Math.tan(l),_=ri(t.a,t.es,0,l),S=(1-t.es)/Math.pow(1-v*v,1.5),M=_/t.a,u=(a*(w*M+1)-M-.5*w*(M*M+c))/(t.es*Math.sin(2*l)*(M*M+c-2*a*M)/(4*w)+(a-M)*(w*S-2/Math.sin(2*l))-S),l-=u,Math.abs(u)<=1e-14){n=l;break}if(n=xD(t,n===void 0?l:n,i,o),n===void 0)return null;l=n,w=Math.sqrt(1-t.es*Math.pow(Math.sin(n),2))*Math.tan(n),r=G(t.long0+Math.asin(i*w/t.a)/Math.sin(n),t.over)}return e.x=r,e.y=n,e}function MD(t,e={}){let r={...t,ml0:0,meridianPole:0,poleRadius:0,...e};return vY(r),r}function xD(t,e,r,n){for(let i=0;i<8;i++){if(!Number.isFinite(e)||Math.abs(e)>=Math.PI/2)return;let o=Math.sin(e),s=Math.cos(e),a=1-t.es*o*o,c=t.sphere?t.a:Zu(t.a,t.e,o),l=c/Math.tan(e),u=Math.asin(r/l),h=l*Math.sin(u),d=2*Math.sin(u/2)**2,m=t.sphere?t.a*(e-t.lat0):ri(t.a,t.es,t.lat0,e),g=l*d,b=m+g-n;if(Math.abs(h-r)<=64*Number.EPSILON*Math.max(t.a,Math.abs(r))&&Math.abs(b)<=64*Number.EPSILON*Math.max(Math.abs(n),Math.abs(m),Math.abs(g),t.a*Math.max(Math.abs(e),Math.abs(t.lat0))))return e;let w=t.sphere?t.a:t.a*(1-t.es)/Math.pow(a,1.5),_=c*((t.sphere?0:t.es*s*s/a)-1/(o*o)),S=w+_*(-d/Math.cos(u)),M=b/S;if(!Number.isFinite(M)||Math.abs(M)>1e-6)return;e-=M}}var wD,vD=p(()=>{_t();W_();U_();wD=20});var dS,ED=p(()=>{ka();et();lt();Gt();vD();dS={name:"poly",aliases:["Polyconic","American_Polyconic"],parameters:["lon_0","x_0","y_0","lat_0"],create(t){let e=Ae(t),r=MD(e),n=Ie("poly",t,r,_D,SD);return De(n,Q(e.long0-Math.PI/6,Math.max(-Math.PI/2+1e-8,e.lat0-Math.PI/2+1e-8),e.long0+Math.PI/6,Math.min(Math.PI/2-1e-8,e.lat0+Math.PI/2-1e-8)),i=>DC(kt(e,t),n.forward,i),e.primeMeridian,e.over)}}});function EY(t){t.x0=t.x0||0,t.y0=t.y0||0,t.lat0=t.lat0||0,t.long0=t.long0||0,t.lat_ts=t.lat_ts||0,t.lat0>=F-tt/2?t.face=Ut.TOP:t.lat0<=-(F-tt/2)?t.face=Ut.BOTTOM:Math.abs(t.long0)<=tt?t.face=Ut.FRONT:Math.abs(t.long0)<=F+tt?t.face=t.long0>0?Ut.RIGHT:Ut.LEFT:t.face=Ut.BACK,t.es!==0&&(t.one_minus_f=1-(t.a-t.b)/t.a,t.one_minus_f_squared=t.one_minus_f*t.one_minus_f)}function TD(t,e){var r=e,n,i,o,s,a,c,l=0;if(e.x-=t.long0,t.es!==0?n=Math.atan(t.one_minus_f_squared*Math.tan(e.y)):n=e.y,i=e.x,t.face===Ut.TOP)s=F-n,i>=tt&&i<=F+tt?(l=mt.AREA_0,o=i-F):i>F+tt||i<=-(F+tt)?(l=mt.AREA_1,o=i>0?i-Math.PI:i+Math.PI):i>-(F+tt)&&i<=-tt?(l=mt.AREA_2,o=i+F):(l=mt.AREA_3,o=i);else if(t.face===Ut.BOTTOM)s=F+n,i>=tt&&i<=F+tt?(l=mt.AREA_0,o=-i+F):i<tt&&i>=-tt?(l=mt.AREA_1,o=-i):i<-tt&&i>=-(F+tt)?(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;t.face===Ut.RIGHT?i=of(i,+F):t.face===Ut.BACK?i=of(i,+Math.PI):t.face===Ut.LEFT&&(i=of(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,t.face===Ut.FRONT?(s=Math.atan2(Math.hypot(h,d),u),o=W1(s,d,h)):t.face===Ut.RIGHT?(s=Math.atan2(Math.hypot(u,d),h),o=W1(s,d,-u)):t.face===Ut.BACK?(s=Math.atan2(Math.hypot(h,d),-u),o=W1(s,d,-h)):t.face===Ut.LEFT?(s=Math.atan2(Math.hypot(u,d),-h),o=W1(s,d,u)):s=o=0,Math.abs(o)<=tt?l=mt.AREA_0:o>tt&&o<=F+tt?(l=mt.AREA_1,o-=F):o>F+tt||o<=-(F+tt)?(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(tt))-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*t.a+t.x0,r.y=r.y*t.a+t.y0,e}function AD(t,e){var r=0,n=0,i,o,s,a,c,l,u,h,d=0;e.x=(e.x-t.x0)/t.a,e.y=(e.y-t.y0)/t.a,i=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?d=mt.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(d=mt.AREA_1,i-=F):e.x<0&&-e.x>=Math.abs(e.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(e.x,e.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),t.face===Ut.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(t.face===Ut.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),t.face===Ut.RIGHT?(h=g,g=-y,y=h):t.face===Ut.BACK?(g=-g,y=-y):t.face===Ut.LEFT&&(h=g,g=y,y=-h),n=Math.atan2(b,Math.hypot(g,y)),r=Math.atan2(y,g),t.face===Ut.RIGHT?r=of(r,-F):t.face===Ut.BACK?r=of(r,-Math.PI):t.face===Ut.LEFT&&(r=of(r,+F))}return t.es!==0&&(n=Math.atan2(Math.sin(n),t.one_minus_f_squared*Math.cos(n))),r+=t.long0,e.x=r,e.y=n,e}function W1(t,e,r){return t===0?0:Math.atan2(e,r)}function of(t,e){var r=t+e;return r<-Math.PI?r+=Vs:r>+Math.PI&&(r-=Vs),r}function ID(t,e={}){let r={...t,face:0,one_minus_f:0,one_minus_f_squared:0,...e};return EY(r),r}var Ut,mt,PD=p(()=>{Ct();Ut={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 mS,RD=p(()=>{nc();ad();Gt();Vt();PD();et();lt();cc();Ot();mS={name:"qsc",aliases:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube"],parameters:["lon_0","x_0","y_0","lat_0"],create(t){let e=Ae(t),r=t.primeMeridian??0,n=ID(e),i=Ie("qsc",t,n,TD,AD),o=re(t.parameters,"x_0",0),s=re(t.parameters,"y_0",0);return{...i,longitudeOrigin:e.long0,getRenderingProfile(a){if(a)return ar(h=>{let d=w=>e.es?Math.atan((1-e.es)*Math.tan(w)):w,m=Q(h[0][0]-e.long0,d(h[0][1]),h[1][0]-e.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=e.a*Math.sqrt((1-y)/(.5*(1-Math.SQRT1_2)));return ct([o-b,o+b],[s-b,s+b])},a,e.long0,r);let c=[[o-e.a,s-e.a,0],[o+e.a,s+e.a,0]],l=Na(t.parameters,r)().normalize,u=Us(h=>{let[d,m]=i.forward(h.x,h.y);Math.abs(d-o)<=e.a&&Math.abs(m-s)<=e.a||([h.x,h.y]=i.inverse(o+Math.max(-e.a,Math.min(e.a,d-o)),s+Math.max(-e.a,Math.min(e.a,m-s))))},r);return{bounds:c,normalize(h){l(h),u(h)}}}}}}});function IY(t,e,r,n,i){for(var o=r;i;--i){var s=($1(t,o)-e)/AY(t,o);if(o-=s,Math.abs(s)<n)break}return o}function PY(t){t.x0=t.x0||0,t.y0=t.y0||0,t.long0=t.long0||0,t.es=0}function BD(t,e){var r=G(e.x-t.long0,t.over),n=Math.abs(e.y),i=Math.floor(n*CD+1e-15);i<0?i=0:i>=yl&&(i=yl),n=N2*(n-TY*i);var o=$1(sf[i],n)*r,s=$1(Ua[i],n);return e.y<0&&(s=-s),e.x=o*t.a*LD+t.x0,e.y=s*t.a*OD+t.y0,e}function DD(t,e){var r=e.y,n=e;n.x=(n.x-t.x0)/(t.a*LD),n.y=Math.abs(r-t.y0)/(t.a*OD);for(let a=0;a<=yl;a++)if(Math.abs(n.y-Ua[a][0])<=8*Number.EPSILON)return n.x=G(n.x/sf[a][0]+t.long0,t.over),n.y=(r<t.y0?-1:1)*a*5*D2,n;if(n.y>=1)n.x/=sf[yl][0],n.y=r<0?-F:F;else{var i=Math.floor(n.y*yl);for(i<0?i=0:i>=yl&&(i=yl-1);;)if(Ua[i][0]>n.y)--i;else if(Ua[i+1][0]<=n.y)++i;else break;var o=Ua[i],s=5*(n.y-o[0])/(Ua[i+1][0]-o[0]);s=IY(o,n.y,s,1e-10,100),n.x/=$1(sf[i],s),n.y=(5*i+s)*D2,r<0&&(n.y=-n.y)}return n.x=G(n.x+t.long0,t.over),n}function ND(t,e={}){let r={...t,...e};return PY(r),r}var sf,Ua,LD,OD,CD,TY,yl,$1,AY,FD=p(()=>{Ct();_t();sf=[[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]],Ua=[[-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]];sf=sf.map(t=>t.map(Math.fround));Ua=Ua.map(t=>t.map(Math.fround));LD=.8487,OD=1.3523,CD=N2/5,TY=1/CD,yl=18,$1=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},AY=function(t,e){return t[1]+e*(2*t[2]+e*3*t[3])}});var pS,kD=p(()=>{Ot();et();lt();Gt();FD();pS={name:"robin",aliases:["Robinson"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=ND(e),n=Ie("robin",t,r,BD,DD);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Or(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});var gS,GD=p(()=>{Ot();et();lt();Gt();Y_();gS={name:"sinu",aliases:["Sinusoidal"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=tB(e),n=Ie("sinu",t,r,j1,z1);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>Or(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function RY(t){t.k0||(t.k0=1);var e=t.lat0;t.lambda0=t.long0;var r=Math.sin(e),n=t.a,i=t.rf,o=1/i,s=2*o-Math.pow(o,2);t.e=Math.sqrt(s);var a=t.e;t.R=t.k0*n*Math.sqrt(1-s)/(1-s*Math.pow(r,2)),t.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(e),4)),t.b0=Math.asin(r/t.alpha);var c=Math.log(Math.tan(Math.PI/4+t.b0/2)),l=Math.log(Math.tan(Math.PI/4+e/2)),u=Math.log((1+a*r)/(1-a*r));t.K=c-t.alpha*l+t.alpha*a/2*u}function UD(t,e){let r=t.e*Math.sin(e.y),n=2*Math.atan(Math.exp(t.alpha*(Math.log(Math.tan(Math.PI/4+e.y/2))-t.e/2*Math.log((1+r)/(1-r)))+t.K))-Math.PI/2,i=t.alpha*(e.x-t.lambda0),o=Math.cos(n),s=Math.asin(Math.cos(t.b0)*Math.sin(n)-Math.sin(t.b0)*o*Math.cos(i)),a=Math.asin(o*Math.sin(i)/Math.cos(s));return e.x=t.x0+t.R*a,e.y=t.y0+t.R*Math.log(Math.tan(Math.PI/4+s/2)),e}function jD(t,e){let r=(e.x-t.x0)/t.R,n=2*(Math.atan(Math.exp((e.y-t.y0)/t.R))-Math.PI/4),i=Math.asin(Math.cos(t.b0)*Math.sin(n)+Math.sin(t.b0)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),s=(t.K-Math.log(Math.tan(Math.PI/4+i/2)))/t.alpha;for(let a=0;a<6;a++){let c=t.e*Math.sin(i),l=(s+Math.log(Math.tan(Math.PI/4+i/2))-t.e/2*Math.log((1+c)/(1-c)))*(1-c*c)*Math.cos(i)/(1-t.es);if(i-=l,Math.abs(l)<1e-10)return e.x=t.lambda0+o/t.alpha,e.y=i,e}return null}function zD(t,e={}){let r={...t,lambda0:0,rf:0,R:0,alpha:0,b0:0,K:0,...e};return RY(r),r}var qD=p(()=>{});var yS,VD=p(()=>{ka();et();lt();Gt();qD();yS={name:"somerc",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(t){let e=Ae(t),r=zD(e,{rf:e.a===e.b?1/0:1/(1-e.b/e.a)}),n=Ie("somerc",t,r,UD,jD);return De(n,Q(e.long0-Math.PI/18,Math.max(-Math.PI/2+1e-8,e.lat0-Math.PI/18),e.long0+Math.PI/18,Math.min(Math.PI/2-1e-8,e.lat0+Math.PI/18)),i=>FC(kt(r,t),i),e.primeMeridian,e.over)}}});function LY(t){if(Math.abs(Math.abs(t.lat0)-F)<1e-10?t.mode=t.lat0<0?qr.S_POLE:qr.N_POLE:Math.abs(t.lat0)<1e-10?t.mode=qr.EQUIT:(t.mode=qr.OBLIQ,t.sinph0=Math.sin(t.lat0),t.cosph0=Math.cos(t.lat0)),t.pn1=t.h/t.a,t.pn1<=0||t.pn1>1e10)throw new Error("Invalid height");t.p=1+t.pn1,t.rp=1/t.p,t.h1=1/t.pn1,t.pfact=(t.p+1)*t.h1,t.es=0;var e=t.tilt,r=t.azi;t.cg=Math.cos(r),t.sg=Math.sin(r),t.cw=Math.cos(e),t.sw=Math.sin(e)}function WD(t,e){e.x-=t.long0;var r=Math.sin(e.y),n=Math.cos(e.y),i=Math.cos(e.x),o,s;switch(t.mode){case qr.OBLIQ:s=t.sinph0*r+t.cosph0*n*i;break;case qr.EQUIT:s=n*i;break;case qr.S_POLE:s=-r;break;case qr.N_POLE:s=r;break}switch(s=t.pn1/(t.p-s),o=s*n*Math.sin(e.x),t.mode){case qr.OBLIQ:s*=t.cosph0*r-t.sinph0*n*i;break;case qr.EQUIT:s*=r;break;case qr.N_POLE:s*=-(n*i);break;case qr.S_POLE:s*=n*i;break}var a,c;return a=s*t.cg+o*t.sg,c=1/(a*t.sw*t.h1+t.cw),o=(o*t.cg-s*t.sg)*t.cw*c,s=a*c,e.x=o*t.a,e.y=s*t.a,e}function $D(t,e){e.x/=t.a,e.y/=t.a;var r=e.x,n=e.y,i,o,s;s=1/(t.pn1-e.y*t.sw),i=t.pn1*e.x*s,o=t.pn1*e.y*t.cw*s,e.x=i*t.cg+o*t.sg,e.y=o*t.cg-i*t.sg;var a=er(e.x,e.y);if(Math.abs(a)<1e-10)r=0,n=t.lat0;else{var c,l;switch(l=1-a*a*t.pfact,l=(t.p-Math.sqrt(l))/(t.pn1/a+a/t.pn1),c=Math.sqrt(1-l*l),t.mode){case qr.OBLIQ:n=Math.asin(c*t.sinph0+e.y*l*t.cosph0/a),e.y=(c-t.sinph0*Math.sin(n))*a,e.x*=l*t.cosph0;break;case qr.EQUIT:n=Math.asin(e.y*l/a),e.y=c*a,e.x*=l;break;case qr.N_POLE:n=Math.asin(c),e.y=-e.y;break;case qr.S_POLE:n=-Math.asin(c);break}r=Math.atan2(e.x,e.y)}return e.x=r+t.long0,e.y=n,e}function HD(t,e={}){let r={...t,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,...e};return LY(r),r}var qr,KD=p(()=>{Ct();sc();qr={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3}});var bS,XD=p(()=>{Ks();Xs();Gt();KD();Vt();bS={name:"tpers",aliases:["Tilted_Perspective"],parameters:["lon_0","x_0","y_0","lat_0","h","tilt","azi"],create(t){let e=Ae(t),r=re(t.parameters,"h",1e5),n=re(t.parameters,"tilt",0)*Math.PI/180,i=re(t.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=HD(e,{h:r,tilt:n,azi:i}),s=1+r/e.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 gn(Ie("tpers",t,o,WD,$D,Ga(e,1/(1+r/e.a))),e,u,(h,d)=>t8(kt(e,t),s,n,i,h,d),a)}}});function OY(t){t.R=t.a}function YD(t,e){var r=e.x,n=e.y,i=G(r-t.long0,t.over),o,s;if(Math.abs(n)<=1e-10)return o=t.x0+t.R*i,s=t.y0,e.x=o,e.y=s,e;var a=pl(2*Math.abs(n/Math.PI));if(Math.abs(i)<=1e-10||Math.abs(Math.abs(n)-F)<=1e-10)return o=t.x0,n>=0?s=t.y0+Math.PI*t.R*Math.tan(.5*a):s=t.y0+Math.PI*t.R*-Math.tan(.5*a),e.x=o,e.y=s,e;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*t.R*(y-m)/(b-c*(d-y));i<0&&(w=-w),o=t.x0+w;var _=l+d;return w=Math.PI*t.R*(l*(2*d-1)+m)/(g*_+c*Math.sqrt((y+l)*(l+1)-_*_)),n>=0?s=t.y0+w:s=t.y0-w,e.x=o,e.y=s,e}function ZD(t,e){var r,n,i,o,s,a,c,l,u,h,d,m,g;return e.x-=t.x0,e.y-=t.y0,Math.abs(e.y)<1e-10?(e.x=G(t.long0+e.x/t.R,t.over),e.y=0,e):(d=Math.PI*t.R,i=e.x/d,o=e.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,e.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=t.long0:r=G(t.long0+2*Math.PI*i/(Math.sqrt(1+2*(i*i-o*o)+s*s)+1-s),t.over),e.x=r,e.y=n,e)}function JD(t,e={}){let r={...t,R:0,...e};return OY(r),r}var QD=p(()=>{_t();Ct();U1()});var wS,eN=p(()=>{Ot();et();lt();Gt();QD();wS={name:"vandg",aliases:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten"],parameters:["lon_0","x_0","y_0"],create(t){let e=Ae(t),r=JD(e),n=Ie("vandg",t,r,YD,ZD);return De(n,Q(e.long0-Math.PI,-Math.PI/2,e.long0+Math.PI,Math.PI/2),i=>vA(n.forward,i,e.long0,e.over),e.primeMeridian,e.over)}}});function CY(t){let e=[["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=e.find(c=>c.some(l=>_S(t,l)));if(!r)throw new Error("Oblique transformation requires a rotation parameter set");for(let c of r){if(!_S(t,c))throw new Error("Oblique transformation requires "+c);if(c.includes("lat")&&Math.abs(Zi(t,c))>Math.PI/2)throw new Error("Invalid rotation latitude: "+c)}if(r===e[0]){let c=Zi(t,"o_alpha"),l=Zi(t,"o_lon_c"),u=Zi(t,"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===e[1])return{lamp:Zi(t,"o_lon_p"),phip:Zi(t,"o_lat_p")};let n=Zi(t,"o_lon_1"),i=Zi(t,"o_lat_1"),o=Zi(t,"o_lon_2"),s=Zi(t,"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 H1(t){let e=t==="longlat";if(!e&&["obtran","geocent"].includes(xS(t.name)))throw new Error("Cannot wrap a composite or geocentric projection");return{name:"ob_tran",aliases:["General Oblique Transformation","General_Oblique_Transformation"],parameters:[...tN,"lon_0",...e?[]:t.parameters],flags:e?[]:t.flags,create(r){var R;let{parameters:n}=r,i=n.o_proj,o=e?["longlat","latlong","lonlat","latlon","identity"]:[t.name,...t.aliases||[]];if(i&&!o.map(xS).includes(xS(i)))throw new ti("missing-plugin","Oblique transformation dependency does not match +o_proj="+i);let{lamp:s,phip:a}=CY(n),c=Math.cos(a),l=Math.sin(a),u=Math.abs(a)>1e-10,h=Zi(n,"lon_0"),d=_S(n,"over"),m={...n,proj:e?"longlat":i||t.name,lon_0:"0"};for(let E of tN)delete m[E];let g=e?ui(E=>{E.x*=180/Math.PI,E.y*=180/Math.PI},E=>{E.x*=Math.PI/180,E.y*=Math.PI/180}):t.create({...r,parameters:Object.freeze(m),primeMeridian:0}),y=Xo(g,!1),b=Xo(g,!0),w=E=>Math.asin(Math.max(-1,Math.min(1,E))),_=E=>{let U=E.x,I=E.y,O=Kt(U-h,d),A=Math.cos(O),V=Math.sin(I),k=Math.cos(I),T=Kt(Math.atan2(k*Math.sin(O),u?l*k*A+c*V:V)+s),B=w(u?l*V-c*k*A:-k*A);E.x=T,E.y=B},S=E=>{let U=E.x,I=E.y,O=U-s,A=Math.cos(O),V=Math.sin(I),k=Math.cos(I),T=Math.atan2(k*Math.sin(O),u?l*k*A-c*V:-V),B=w(u?l*V+c*k*A:k*A);E.x=Kt(T+h),E.y=B},M=ui(E=>{_(E),y(E)},E=>{b(E),S(E)}),v=e?Na(m):(R=g.getRenderingProfile)==null?void 0:R.bind(g);if(!v)return M;let C=(E,U)=>{let I=U&&ar(()=>E.bounds,U,h,r.primeMeridian??0,d),O=Us(A=>{var D;let V=A.x,k=A.y;_(A);let T=A.x*180/Math.PI,B=A.y*180/Math.PI,N={x:T,y:B,z:A.z};if((D=E.normalize)==null||D.call(E,N),N.x===T&&N.y===B){A.x=V,A.y=k;return}A.x=N.x*Math.PI/180,A.y=N.y*Math.PI/180,S(A),d&&(A.x+=Math.round((V-A.x)/(2*Math.PI))*2*Math.PI)},r.primeMeridian??0);return{get bounds(){let A=E.bounds,V=k=>[k[0]*180/Math.PI,k[1]*180/Math.PI,k[2]];return e?[V(A[0]),V(A[1])]:A},normalize(A){I==null||I.normalize(A),O(A)}}};return{...M,longitudeOrigin:h,getRenderingProfile(E){if(!E)return C(v());let U=Gs(E,r.primeMeridian??0,h),I=Q(U[0][0]-h,U[0][1],U[1][0]-h,U[1][1]),O=dt(u?[-c,0,l]:[-1,0,0],I),A=u?[l,0,c]:[0,0,1],k=dt(A,I)[0]>0?Hs([0,1,0],A,0,I).map(Math.atan):[-Math.PI,Math.PI];return C(v(Bn(Q(k[0]+s,w(O[0]),k[1]+s,w(O[1])))),E)}}}}}var tN,xS,_S,Zi,rN=p(()=>{ic();ad();Vt();nc();Da();lt();et();cc();tN=["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"],xS=t=>t.toLowerCase().replace(/[ _-]/g,""),_S=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Zi=(t,e)=>re(t,e,0)*Math.PI/180});function Pt(t){if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Expected a CRS object");return t}function md(t){return Array.isArray(t)?t:[]}function Vr(t){return String(t||"").toLowerCase().replace(/[^a-z0-9]/g,"")}function Rr(t){if(typeof t!="number"||!Number.isFinite(t))throw new Error("Expected a finite CRS parameter");return t}function Pn(t,e){if(t===void 0)return e;if(typeof t=="object"){let i=Rr(Pt(t).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}[Vr(t)];return n||Ge("Unsupported CRS unit: "+String(t)),n}function bl(t,e){var E,U,I;let r=String(t.type),n=kY(t.bbox);if(r==="CompoundCRS"){e.mode!=="horizontal"&&Ge("CompoundCRS requires explicit horizontal extraction");let O=md(t.components).map(Pt).filter(V=>["ProjectedCRS","GeographicCRS","GeodeticCRS","BoundCRS"].includes(String(V.type)));if(O.length!==1)throw new Error("CompoundCRS requires exactly one horizontal component");let A=bl(O[0],e);return{...A,areaOfUse:n??A.areaOfUse,lossy:!0}}if(r==="BoundCRS"){let O=bl(Pt(t.source_crs),e),A=bl(Pt(t.target_crs),e);(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))&&Ge("BoundCRS requires a WGS84 target");let V=Pt(t.transformation),k=Vr(Pt(V.method).name),T=k==="geocentrictranslations"||/^geocentrictranslationsgeog[23]ddomain$/.test(k),B=/^positionvector(?:transformation)?(?:geog[23]ddomain|geocentricdomain)?$/.test(k),N=/^coordinateframe(?:rotation)?(?:geog[23]ddomain|geocentricdomain)?$/.test(k);!T&&!B&&!N&&Ge("Unsupported BoundCRS transformation: "+k);let D=["xaxistranslation","yaxistranslation","zaxistranslation","xaxisrotation","yaxisrotation","zaxisrotation","scaledifference"],L=new Array(T?3:7).fill(void 0);for(let z of md(V.parameters)){let we=Pt(z),_e=D.indexOf(Vr(we.name));(_e<0||_e>=L.length||L[_e]!==void 0)&&Ge("Unsupported or duplicate Helmert parameter: "+String(we.name));let ne=_e<3?1:_e<6?At/3600:1e-6;L[_e]=Rr(we.value)*Pn(we.unit,ne)/ne*(N&&_e>=3&&_e<6?-1:1)}if(L.some(z=>z===void 0))throw new Error("Incomplete BoundCRS Helmert transformation");let P={...O.parameters,towgs84:L.join(",")};return delete P.datum,{...O,parameters:P,areaOfUse:n??O.areaOfUse}}["ProjectedCRS","GeographicCRS","GeodeticCRS"].includes(r)||Ge("Unsupported CRS type: "+r);let i=r==="ProjectedCRS"?Pt(t.base_crs):t,o=Pt(i.datum||i.datum_ensemble);(o.type==="DynamicGeodeticReferenceFrame"||o.frame_reference_epoch!==void 0||t.coordinate_epoch!==void 0)&&Ge("Time-dependent datum transformations are not implemented");let s=Pt(o.ellipsoid),a=Rr(s.semi_major_axis??s.radius),c={proj:"longlat",a:String(a*Pn(s.unit,1))};if(s.inverse_flattening!==void 0)c.rf=String(Rr(s.inverse_flattening));else if(s.semi_minor_axis!==void 0)c.b=String(Rr(s.semi_minor_axis)*Pn(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=Ku(e),u=String(o.name||""),h=Vr(u),d=Object.keys(l),m=d.find(O=>ml(O)===ml(u)),g=m?[m]:d.filter(O=>Vr(O)===h||Vr(O)===h.replace(/^d/,"")),y=g[0],b=l[y];if(b&&g.some(O=>{let A=l[O];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&&ml(y)==="wgs84"&&(c.datum="WGS84"),y&&["nad83","northamericandatum1983"].includes(ml(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 O=Pt(i.id),A=String(O.authority)+"_"+String(O.code);Object.prototype.hasOwnProperty.call(l,A)&&(c.datum=A)}o.towgs84!==void 0&&(c.towgs84=md(o.towgs84).map(Rr).join(","),delete c.datum);let w=t.coordinate_system?Pt(t.coordinate_system):{},_=md(w.axis).map(Pt),S=Vr(w.subtype)==="cartesian"&&r==="GeodeticCRS";r!=="ProjectedCRS"&&!S&&w.subtype&&Vr(w.subtype)!=="ellipsoidal"&&Ge("Unsupported coordinate system subtype"),S&&(c.proj="geocent");let M=Pn(i.angular_unit,At),v=Pn((E=_[0])==null?void 0:E.unit,r==="ProjectedCRS"||S?1:M);_[1]&&Pn(_[1].unit,v)!==v&&Ge("Mixed horizontal axis units are not supported"),S&&_[2]&&Pn(_[2].unit,v)!==v&&Ge("Mixed geocentric axis units are not supported");let C=i.prime_meridian||o.prime_meridian;if(C){let O=Pt(C);c.pm=String(Rr(O.longitude)*Pn(O.unit,M)/At)}if(r==="ProjectedCRS"){let O=Pt(t.conversion),A=Vr(Pt(O.method).name),V=md(O.parameters).map(Pt),k=A==="stereographicnorthpole"&&!V.some(D=>Vr(D.name).startsWith("scalefactor")),T=k?"stere":BY[A],B=V.filter(D=>["xscale","yscale","xyplanerotation"].includes(Vr(D.name)));if(B.length){let D={xscale:-1,yscale:1,xyplanerotation:90};(T!=="krovak"||B.length!==3||new Set(B.map(L=>Vr(L.name))).size!==3||B.some(L=>{let P=Vr(L.name),z=P==="xyplanerotation"?Pn(L.unit,M)/At:Pn(L.unit,1);return Math.abs(Rr(L.value)*z-D[P])>1e-10}))&&Ge("Unsupported ESRI Krovak axis adjustment")}(!T||T.startsWith("unsupported"))&&Ge("Unsupported projection method: "+String(Pt(O.method).name)),c.proj=T==="webmerc"?"merc":T;let N=!1;for(let D of V){let L=Vr(D.name);if(B.includes(D)||L==="auxiliaryspheretype"&&T==="webmerc"&&D.value===0)continue;if(L==="semiminor"&&T==="webmerc"){if(N)throw new Error("Duplicate conversion parameter: semi_minor");N=!0;let ne=Rr(D.value)*Pn(D.unit,1);Math.abs(ne-Number(c.a))>4*Number.EPSILON*Number(c.a)&&Ge("Pseudo-Mercator semi_minor must equal the semi-major axis");continue}let P=((U=NY[T])==null?void 0:U[L])||DY[L];if(P||Ge("Unsupported conversion parameter: "+String(D.name)),P==="lat_1"&&A==="stereographicnorthpole"&&!k?P="lat_0":P==="lat_1"&&["merc","webmerc","eqc","stere","cea"].includes(T)&&(P="lat_ts"),c[P]!==void 0)throw new Error("Duplicate conversion parameter: "+P);if(["merc","webmerc"].includes(T)&&P==="lat_0"&&D.value===0)continue;let z=P.startsWith("lat")||P.startsWith("lon")||P==="alpha"||P==="gamma",we=P==="x_0"||P==="y_0",_e=Rr(D.value)*Pn(D.unit,z?M:we?v:1)/(z?At:1);P.startsWith("lat")&&Math.abs(Math.abs(_e)-90)<=4*Number.EPSILON*90&&(_e=Math.sign(_e)*90),c[P]=String(_e)}if(T==="omerc"&&["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(A)&&(c.no_uoff=void 0),T==="omerc"&&c.lon_0!==void 0&&c.lonc!==void 0&&(Math.abs(Number(c.lon_0)-Number(c.lonc))>1e-10&&Ge("Oblique Mercator central meridian conflicts with projection centre"),delete c.lon_0),A==="stereographicnorthpole"&&Math.abs(Number(c.lat_0))===90&&(c.proj="stere"),T==="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}T==="stere"&&(A.includes("polar")||A==="stereographicsouthpole"||k)&&c.lat_0===void 0&&(c.lat_0=Number(c.lat_ts||90)<0?"-90":"90"),T==="webmerc"&&(c.b=c.a,delete c.rf,c.nadgrids="@null")}let R=_.map(O=>GY(O,c,r==="ProjectedCRS")).join("");return R.length===2&&(R+="u"),!S&&/[ud]/.test(R.slice(0,2))&&Ge("Structured CRS vertical-first axes require an explicit PROJ axis definition"),R&&(c.axis=R),(r==="ProjectedCRS"||S)&&(c.to_meter=String(v)),{parameters:c,areaOfUse:n,angularUnit:r==="ProjectedCRS"||S?M:v,verticalUnit:S?1:Pn((I=_[2])==null?void 0:I.unit,1)}}function kY(t){let e;if(t!==void 0){let r=Pt(t),n=Rr(r.west_longitude),i=Rr(r.south_latitude),o=Rr(r.east_longitude),s=Rr(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");e=[n,i,o,s]}return e}function GY(t,e,r){var a;let n=String(t.direction),i=t.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(e.lat_0),l=c===90;(!r||e.proj!=="stere"||Math.abs(c)!==90||Vr(n)!==(l?"south":"north"))&&Ge("Axis meridians require an outward-facing polar stereographic axis");let u=Pt(i).longitude,h=typeof u=="number"?Rr(u):Rr(Pt(u).value)*Pn(Pt(u).unit,At)/At,d=Rr((h-Number(e.lon_0||0))/90);Math.abs(d-Math.round(d))>1e-12&&Ge("Non-cardinal axis meridians require an orientation operation");let m=(Math.round(d)%4+4)%4;return(l?"senw":"nesw")[m]}let s=FY[Vr(n)];return s||Ge("Unsupported axis direction: "+n),s}var BY,DY,NY,FY,SS=p(()=>{T1();Vt();Da();BY={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"},DY={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"},NY={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"}},FY={east:"e",west:"w",north:"n",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"}});function K1(t,...e){return t.values.filter(r=>r.type==="node"&&e.includes(r.keyword.toUpperCase()))}function vt(t,...e){return K1(t,...e)[0]}function wt(t,e=0){let r=t.values[e];return r&&r.type!=="node"?r.value:void 0}function wl(t){return t?{name:wt(t),conversion_factor:wt(t,1)}:void 0}function UY(t,e){let r=wt(t,1);if(e&&String(r).toLowerCase()==="unknown"){let n=String(wt(t)).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 jY(t){let e=vt(t,"MERIDIAN");if(e)return{longitude:{value:wt(e),unit:wl(vt(e,"ANGLEUNIT"))}}}function nN(t){let e=vt(t,"METHOD","PROJECTION");if(!e)throw new Error("WKT conversion requires a METHOD or PROJECTION");return vt(t,"PARAMETERFILE")&&Ge("Grid-based WKT operation is not implemented"),{method:{name:wt(e)},parameters:K1(t,"PARAMETER").map(r=>({name:wt(r),value:wt(r,1),unit:wl(vt(r,"ANGLEUNIT","LENGTHUNIT","SCALEUNIT"))}))}}function pd(t){let e=t.keyword.toUpperCase();if(e==="COMPD_CS"||e==="COMPOUNDCRS")return{type:"CompoundCRS",components:K1(t,"PROJCS","PROJCRS","GEOGCS","GEOGCRS","GEODCRS","BOUNDCRS","VERT_CS","VERTCRS").map(pd)};if(e==="BOUNDCRS"){let d=vt(t,"SOURCECRS"),m=vt(t,"TARGETCRS"),g=vt(t,"ABRIDGEDTRANSFORMATION");if(!d||!m||!g)throw new Error("Incomplete WKT BoundCRS");let y=_=>{let S=_.values.find(M=>M.type==="node");if(!S)throw new Error("Missing bound CRS component");return S},b=nN(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:pd(y(d)),target_crs:pd(y(m)),transformation:b}}if(["VERT_CS","VERTCRS"].includes(e))return{type:"VerticalCRS"};let r=["PROJCS","PROJCRS","PROJECTEDCRS"].includes(e),n=["GEOGCS","GEOGCRS","GEODCRS","GEODETICCRS","GEOGRAPHICCRS","BASEGEOGCRS","BASEGEODCRS","GEOCCS"].includes(e);!r&&!n&&Ge("Unsupported WKT CRS: "+e),vt(t,"DYNAMIC","DERIVINGCONVERSION","VELOCITYGRID","EXTENSION")&&Ge("Unsupported WKT dynamic/extension operation");let i=vt(t,"CS"),o=e==="GEOCCS"||String(wt(i||t)).toLowerCase()==="cartesian"&&!r,s=vt(t,r||o?"LENGTHUNIT":"ANGLEUNIT","UNIT"),a=K1(t,"AXIS").sort((d,m)=>Number(wt(vt(d,"ORDER")||d))-Number(wt(vt(m,"ORDER")||m))).map((d,m)=>({name:wt(d),direction:e==="GEOCCS"?["geocentricX","geocentricY","geocentricZ"][m]:UY(d,r),unit:wl(vt(d,"ANGLEUNIT","LENGTHUNIT")||(!o&&!r&&/^(up|down)$/i.test(String(wt(d,1)))?void 0:s)),meridian:jY(d)}));if(!a.length)for(let d of o?["geocentricX","geocentricY","geocentricZ"]:["east","north"])a.push({name:d,direction:d,unit:wl(s),meridian:void 0});let c=e==="GEOGCS"?void 0:vt(t,"ID"),l={type:r?"ProjectedCRS":o?"GeodeticCRS":"GeographicCRS",name:wt(t),id:c?{authority:wt(c),code:wt(c,1)}:void 0,coordinate_system:{subtype:r||o?"Cartesian":"ellipsoidal",axis:a}},u=vt(t,"USAGE"),h=vt(u||t,"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(t,"GEOGCS","BASEGEOGCRS","BASEGEODCRS","GEODCRS","GEOGCRS");if(!d)throw new Error("Projected WKT requires a base geographic CRS");l.base_crs=pd(d),l.conversion=nN(vt(t,"CONVERSION")||t)}else{let d=vt(t,"DATUM","GEODETICDATUM","ENSEMBLE");if(!d)throw new Error("WKT requires a geodetic datum");vt(d,"EXTENSION","DYNAMIC")&&Ge("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:wl(vt(m,"LENGTHUNIT"))},towgs84:g==null?void 0:g.values.map((b,w)=>wt(g,w))};let y=vt(t,"PRIMEM");y&&(l.prime_meridian={name:wt(y),longitude:wt(y,1),unit:wl(vt(y,"ANGLEUNIT")||(o?void 0:s))}),l.angular_unit=o?void 0:wl(s)}return l}var MS,iN=p(()=>{Hl();Jy();Da();SS();MS={name:"wkt",canParse:t=>wr(t)==="wkt",parse(t,e){if(typeof t!="string")throw new Error("Expected serialized WKT");return bl(pd(kf(t).root),e)}}});var vS,oN=p(()=>{Hl();SS();vS={name:"projjson",canParse:t=>wr(t)==="projjson",parse:(t,e)=>bl(Pt(t),e)}});var J4e,Q4e,eTe,sN=p(()=>{J4e=new Float64Array(0),Q4e=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,eTe={deg:Math.PI/180,rad:1,m:1,ft:.3048,"us-ft":1200/3937}});var ES=p(()=>{$O();HO();KO();QO();iC();lC();mC();c8();vC();OC();G2();ZA();CC();WC();XC();eB();sB();dB();bB();EB();BB();jB();$B();ZB();nD();cD();dD();bD();ED();RD();kD();GD();VD();XD();eN();rN();iN();oN();sN()});var X1,aN,cN=p(()=>{X1={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 t in X1){let e=X1[t];e.datumName&&(X1[e.datumName]=e)}aN=X1});var lN,uN=p(()=>{cN();lN=Object.freeze({name:"regional-datums",datums:Object.freeze(aN)})});function zY(t){return{...t,parse(e,r){let n=t.parse(e,r),i=n.parameters.datum,o=s=>s.toLowerCase().replace(/[\s_-]/g,"");if(i&&!Object.keys(Ku(r)).some(s=>o(s)===o(i))){let s={...n.parameters};return delete s.datum,{...n,parameters:s}}return n}}}function VY(){if(Y1)return Y1;let t=[A_,I_,P_,L_,O_,N_,q2,F_,j_,F2,k2,U2,z_,V_,K_,X_,Z_,eS,tS,rS,nS,sS,aS,cS,lS,uS,fS,hS,dS,mS,pS,gS,yS,bS,wS],e=i=>i.toLowerCase().replace(/[\s_-]/g,""),r=H1("longlat"),n={name:r.name,aliases:r.aliases,parameters:[...new Set([...r.parameters,...t.flatMap(i=>i.parameters)])],flags:[...new Set(t.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(e(o))?"longlat":t.find(l=>[l.name,...l.aliases||[]].some(u=>e(u)===e(o)));if(!s)throw new Error("Unknown oblique transformation projection: "+o);let a=H1(s),c=new Set([...A1,...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 Y1=[...t,n],Y1}var qY,Y1,af,WY,fN=p(()=>{WO();uN();T1();ES();Xu();qY=[MS,vS].map(zY);af=class extends N1{constructor(e={}){super({...e,projections:e.projections??VY(),parsers:e.parsers??qY,datumCatalogs:e.datumCatalogs??[lN]}),this.useDefinitionSignature=!ud(e)}},WY=new af});var hN=p(()=>{ES();fN()});function dN(){return HY}function mN(t){return $Y.get(t)}var $Y,HY,pN=p(()=>{"use strict";hN();$Y=new Map,HY=new af});function KY(t,e,r){let n=[];for(let i=0;i<3;i++){let o=e.slice(),s=e.slice();o[i]+=r,s[i]-=r;let a=t.transformPosition(o),c=t.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 XY(t,e){let[r,n,i]=t,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?e:[[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]*e[0]+a[1]*e[1]+a[2]*e[2])/o)}function gd(t){if(!t)throw new Error("Cannot construct a projection because the CRS is unknown");if(typeof t!="string"&&t.type==="CompoundCRS"){let e=t.components.filter(r=>r.type!=="VerticalCRS");if(e.length!==1)throw new Error("CompoundCRS requires exactly one horizontal component");return gd(e[0])}return t}function YY(t){if(t.outputCoordinates==="local-enu")throw new Error("local-enu output requires a dataset-derived local origin and must be created by a tileset source");if(t.outputCoordinates==="target-crs"&&!t.targetCrs)throw new Error("target-crs output requires targetCrs");if(!t.sourceCrs&&t.status==="unresolved")throw new Error("Cannot transform coordinates because the source CRS is unknown");if(cf(t)&&t.heightReference==="unknown")throw new Error("Cannot convert heights because the source height reference is unknown");if(t.coordinateFrame==="geocentric"&&!TS(t.sourceCrs))throw new Error("Only EPSG:4978 geocentric coordinates are supported by the current spatial transformer");if(t.status==="unresolved")throw new Error("The requested spatial output cannot be resolved from the available metadata")}function TS(t){return typeof t=="string"&&nd(t)===_1}function gN(t){if(typeof t!="string")return!1;let e=nd(t);return e===Hu||e==="EPSG:4979"||e==="OGC:CRS84"}function cf(t){let e=t.targetHeightReference;return e!=="native"&&e!==t.heightReference}function ZY(t){return typeof t=="string"?mN(t):t}function JY(t,e,r,n){if(r===n||n==="native")return t;if(r==="orthometric"&&n==="ellipsoidal")return t+e;if(r==="ellipsoidal"&&n==="orthometric")return t-e;throw new Error(`Unsupported height conversion from ${r} to ${n}`)}var xl,AS=p(()=>{"use strict";Cn();Qf();XL();pN();c_();l_();xl=class{spatialReference;horizontalProjection;horizontalProjectionBuffer;geographicProjection;heightOutputProjection;sourceIsGeocentric;outputIsGeocentric;sourceIsGeographic;outputIsGeographic;geoid;constructor(e,r={}){this.spatialReference=e;let n=dN();YY(e);let i=e.targetCrs||e.sourceCrs;if(this.sourceIsGeocentric=TS(e.sourceCrs),this.outputIsGeocentric=TS(i),this.sourceIsGeographic=gN(e.sourceCrs),this.outputIsGeographic=gN(i),e.sourceCrs&&e.targetCrs&&!this.sourceIsGeocentric&&!this.outputIsGeocentric&&(this.horizontalProjection=n.createProjection({from:gd(e.sourceCrs),to:gd(e.targetCrs),enforceAxis:!1}),cf(e)||(this.horizontalProjectionBuffer=new v1({projection:this.horizontalProjection,dimension:3}))),(cf(e)||this.sourceIsGeocentric||this.outputIsGeocentric)&&(!this.sourceIsGeographic&&!this.sourceIsGeocentric&&(this.geographicProjection=n.createProjection({from:gd(e.sourceCrs),to:Hu,enforceAxis:!1})),!this.outputIsGeographic&&!this.outputIsGeocentric&&(this.heightOutputProjection=n.createProjection({from:Hu,to:gd(i),enforceAxis:!1}))),cf(e)&&(this.geoid=ZY(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(e){if(e.length<2)throw new Error("A spatial coordinate must contain at least x and y components");let r=[...e];if(cf(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(cf(this.spatialReference)){let o=this.geoid.getHeight(n[1],n[0]);n[2]=JY(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(e){if(e.length%3!==0)throw new Error("Packed spatial positions must contain a multiple of three components");let r=new Float64Array(e.length);if(this.horizontalProjectionBuffer&&(r.set(e),r.every(Number.isFinite)))return this.horizontalProjectionBuffer.projectFlatTo(r,r);for(let n=0;n<e.length;n+=3){let i=this.transformPosition([Number(e[n]),Number(e[n+1]),Number(e[n+2])]);r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2]}return r}transformNormals(e,r){if(e.length!==r.length||e.length%3!==0)throw new Error("Spatial normals and positions must have matching xyz component counts");let n=new Float32Array(e.length),i=1e-5;for(let o=0;o<e.length;o+=3){let s=[Number(r[o]),Number(r[o+1]),Number(r[o+2])],a=[Number(e[o]),Number(e[o+1]),Number(e[o+2])],c=KY(this,s,i),l=XY(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(e){return this.sourceIsGeocentric?Array.from(Tt.WGS84.cartesianToCartographic(new J(e))):this.sourceIsGeographic?e.slice(0,3):this.geographicProjection.projectSync(e.slice(0,3))}fromGeographic(e){return this.outputIsGeocentric?Array.from(Tt.WGS84.cartographicToCartesian(new J(e))):this.outputIsGeographic?e.slice(0,3):this.heightOutputProjection.projectSync(e.slice(0,3))}}});function QY(t,e){return t==="relativeToScene"?e.sceneElevationProvider:lf(t)?e.terrainElevationProvider:void 0}function lf(t){return t==="onTheGround"||t==="relativeToGround"||t==="relativeToScene"}function IS(t){if(t.length%3!==0)throw new Error("I3S position arrays must contain complete XYZ tuples");let e=[];for(let r=0;r<t.length;r+=3)e.push([t[r],t[r+1],t[r+2]]);return e}function eZ(t){let e=ja(t);return{west:e[0]*180/Math.PI,south:e[1]*180/Math.PI,east:e[2]*180/Math.PI,north:e[3]*180/Math.PI}}function yN(t){if(!t.length)throw new Error("I3S spatial transformation requires at least one bound sample");let e=t.map(o=>Tt.WGS84.cartographicToCartesian(new J(o))),r=new J;for(let o of e)r.add(o);r.scale(1/e.length);let n=0;for(let o of e)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 bN(t,e,r,n){let i=t.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 zf().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(e==="geographic"){let d=r.transformPosition(c),m=Tt.WGS84.cartographicToCartesian(new J(d)),g=t.normalReferenceFrame==="vertex-reference-frame"?h.map(y=>_N(y,d)):h;return wN().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 wN().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=t.mbs?Array.from(t.mbs):[];if(o.length<4)return[];let s=o.slice(0,3);s[2]*=n;let a=o[3];if(e==="geographic"){let c=r.transformPosition(s),l=Tt.WGS84.cartographicToCartesian(new J(c));return xN().map(u=>Array.from(Tt.WGS84.cartesianToCartographic(new J(l).add(new J(u).scale(a)))))}return xN().map(c=>Array.from(new J(s).add(new J(c).scale(a))))}function wN(){return[-1,1].flatMap(t=>[-1,1].flatMap(e=>[-1,1].map(r=>[t,e,r])))}function xN(){return[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]]}function tZ(){return[new J([1,0,0]),new J([0,1,0]),new J([0,0,1])]}function _N(t,e){let r=e[0]*Math.PI/180,n=e[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(t[0]).add(o.scale(t[1])).add(s.scale(t[2]))}function rZ(t,e){let r=e[0]*Math.PI/180,n=e[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(t),o.dot(t),s.dot(t)])}function _l(t){let e=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(let o of t)for(let s=0;s<3;s++)e[s]=Math.min(e[s],o[s]),r[s]=Math.max(r[s],o[s]);let n=e.map((o,s)=>(o+r[s])/2),i=e.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 ja(t){let e=t[0][0],r=1/0,n=-1/0,i=1/0,o=-1/0,s=1/0,a=-1/0;for(let c of t){let l=e+PS(c[0]-e);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[PS(r)*Math.PI/180,i*Math.PI/180,PS(n)*Math.PI/180,o*Math.PI/180,s,a]}function PS(t){return((t+180)%360+360)%360-180}var yd,SN=p(()=>{"use strict";Cn();Qf();AS();VL();$L();yd=class{spatialReference;targetCoordinateFrame;positionTransformer;sourceToGeographicTransformer;geographicToTargetTransformer;sourceCoordinateFrame;sourceVerticalUnitScale;elevationMode;elevationOffset;elevationProvider;providerUnitScale;providerHeightTransformer;constructor(e,r={}){var a;if(e.status!=="transformable"&&e.status!=="transformed")throw new Error("I3SSpatialTransformer requires a requested, transformable spatial output");let n=e.targetCrs||e.sourceCrs;if(!n)throw new Error("I3S spatial transformation requires a target CRS");if(this.positionTransformer=new xl(e,r),this.sourceCoordinateFrame=e.coordinateFrame,this.sourceVerticalUnitScale=e.verticalUnitScale,this.elevationMode=e.elevationMode,this.elevationOffset=(e.elevationOffset||0)*e.elevationUnitScale,this.elevationProvider=QY(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=WL(((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=Oo(n),this.spatialReference=qL(e);let o=S1({sourceCrs:e.sourceCrs,heightReference:e.heightReference,coordinateFrame:e.coordinateFrame,axisOrder:e.axisOrder,provenance:e.provenance},{targetCrs:"EPSG:4326"});if(this.sourceToGeographicTransformer=new xl(o),lf(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(e.heightReference==="unknown")throw new Error(`I3S elevation mode ${this.elevationMode} requires a known source height reference`);let c=this.elevationProvider.heightReference||e.heightReference;if(c!==e.heightReference){if(e.heightReference!=="ellipsoidal"&&e.heightReference!=="orthometric")throw new Error("Converting elevation-provider heights requires an ellipsoidal or orthometric source height reference");let l=S1({sourceCrs:"EPSG:4326",heightReference:c,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"caller-override"},{targetCrs:"EPSG:4326",targetHeightReference:e.heightReference,geoidModel:r.geoidModel});this.providerHeightTransformer=new xl(l,r)}}let s=S1({sourceCrs:"EPSG:4326",heightReference:e.heightReference,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"format-default"},{targetCrs:n,targetHeightReference:e.targetHeightReference,geoidModel:r.geoidModel});this.geographicToTargetTransformer=new xl(s,r)}transformPosition(e){let r=this.placeSourcePositionsSync(e),n=this.positionTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}async transformPositionAsync(e){let r=await this.placeSourcePositions(e),n=this.positionTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}transformPlacedPosition(e){let r=this.positionTransformer.transformPosition([e[0],e[1],e[2]]);return[r[0],r[1],r[2]]}transformSourcePositionToGeographic(e){let r=this.placeSourcePositionsSync(e),n=this.sourceToGeographicTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}async transformSourcePositionToGeographicAsync(e){let r=await this.placeSourcePositions(e),n=this.sourceToGeographicTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}transformPositions(e,r){let n=this.placeSourcePositionsSync(e),i=this.placeSourcePositionsSync(r);return this.transformPlacedPositions(n,i)}async transformPositionsAsync(e,r){let n=new Float64Array(e.length+3);n.set(Array.from(e),0),n.set(Array.from(r).slice(0,3),e.length);let i=await this.placeSourcePositions(n);return this.transformPlacedPositions(i.subarray(0,e.length),i.subarray(e.length))}async transformGeometryAsync(e,r,n="earth-centered"){if(e.length%3||r&&r.length!==e.length)throw new Error("Conversion positions and normals must contain matching finite xyz triples");for(let o=0;o<e.length;o++)if(!Number.isFinite(e[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(e);return{positions:this.positionTransformer.transformPositions(i),normals:r?this.transformNormals(r,i,n):void 0}}transformPlacedPositions(e,r){let n=this.transformPlacedPosition(r),i=new Float32Array(e.length),o=Float64Array.from(e);for(let c=0;c<e.length;c+=3){let l=this.transformPlacedPosition([e[c],e[c+1],e[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 mn:new mn().translate(n);return{positions:i,sourcePositions:o,origin:n,cartographicOrigin:s?n:[0,0,0],coordinateSystem:s?"lnglat-offsets":"cartesian",modelMatrix:a}}transformNormals(e,r,n="earth-centered"){if(e.length!==r.length||e.length%3)throw new Error("I3S normals and positions must have matching xyz component counts");let i=new Float32Array(e.length);if(n==="earth-centered"&&(this.spatialReference.targetCrs||this.spatialReference.sourceCrs)==="EPSG:4978"){for(let o=0;o<e.length;o+=3){let s=Math.hypot(e[o],e[o+1],e[o+2]);for(let a=0;a<3;a++)i[o+a]=s?e[o+a]/s:e[o+a]}return i}for(let o=0;o<e.length;o+=3){let s=this.sourceToGeographicTransformer.transformPosition([r[o],r[o+1],r[o+2]]),a=new J([e[o],e[o+1],e[o+2]]).normalize(),c=n==="earth-centered"?a:_N(a,s),l=this.transformEcefNormal(c,s);i.set(l,o)}return i}transformBoundingVolume(e){let n=this.getGeographicBoundSamples(e).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:ja(n)}:{box:_l(n)}}async transformBoundingVolumeAsync(e){let n=(await this.getGeographicBoundSamplesAsync(e)).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:ja(n)}:{box:_l(n)}}transformBoundingVolumeToGeographic(e){return{region:ja(this.getGeographicBoundSamples(e))}}async transformBoundingVolumeToGeographicAsync(e){return{region:ja(await this.getGeographicBoundSamplesAsync(e))}}transformBoundingVolumeToGeocentric(e){let r=this.getGeographicBoundSamples(e).map(n=>Array.from(Tt.WGS84.cartographicToCartesian(new J(n))));return{box:_l(r)}}async transformBoundingVolumeToGeocentricAsync(e){let r=(await this.getGeographicBoundSamplesAsync(e)).map(n=>Array.from(Tt.WGS84.cartographicToCartesian(new J(n))));return{box:_l(r)}}transformBoundingSphereToGeographic(e){var s,a;let r=(s=e.mbs)!=null&&s.length?Array.from(e.mbs).slice(0,3):e.obb?Array.from(e.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=e.mbs)!=null&&a.length?e.mbs[3]:Math.hypot(...Array.from(e.obb.halfSize).slice(0,3));return[i[0],i[1],i[2],o]}async transformBoundingSphereToGeographicAsync(e){return yN(await this.getGeographicBoundSamplesAsync(e))}async transformBoundsAsync(e){let r=await this.getGeographicBoundSamplesAsync(e),n=r.map(o=>Array.from(Tt.WGS84.cartographicToCartesian(new J(o)))),i=r.map(o=>this.geographicToTargetTransformer.transformPosition(o));return{boundingVolume:{box:_l(n)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:ja(i)}:{box:_l(i)},i3sLodMbs:lf(this.elevationMode)?yN(r):this.transformBoundingSphereToGeographic(e)}}async transformPointCloudBoundsAsync(e){let r=await this.getGeographicBoundSamplesAsync(e),n=r.map(i=>this.geographicToTargetTransformer.transformPosition(i));return{boundingVolume:{region:ja(r)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:ja(n)}:{box:_l(n)}}}getGeographicBoundSamples(e){let r=bN(e,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=IS(n);return this.sourceCoordinateFrame==="geographic"?i:i.map(o=>this.sourceToGeographicTransformer.transformPosition(o))}async getGeographicBoundSamplesAsync(e){let r=bN(e,this.sourceCoordinateFrame,this.sourceToGeographicTransformer,this.sourceVerticalUnitScale);if(!r.length)throw new Error("I3S spatial transformation requires an MBS or OBB bound");if(lf(this.elevationMode)){let i=this.sourceCoordinateFrame==="geographic"?r:r.map(o=>this.sourceToGeographicTransformer.transformPosition(o));return await this.placeGeographicBoundSamples(i)}let n=IS(await this.placeSourcePositions(r.flat(),!0));return this.sourceCoordinateFrame==="geographic"?n:n.map(i=>this.sourceToGeographicTransformer.transformPosition(i))}async placeGeographicBoundSamples(e){let n=await this.elevationProvider.getElevationRange(eZ(e)),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=e.map(u=>u[2]),a=Math.min(...s),c=Math.max(...s),l=[];for(let[u,h]of e){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(e,r=!1){if(lf(this.elevationMode))throw new Error(`I3S elevation mode ${this.elevationMode} requires asynchronous surface placement`);let n=Float64Array.from(e),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(e,r=!1){if(!lf(this.elevationMode))return this.placeSourcePositionsSync(e,r);let n=Float64Array.from(e),i=IS(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(e,r){if(this.targetCoordinateFrame==="geocentric")return e.normalize();if(this.targetCoordinateFrame==="geographic")return rZ(e,r).normalize();let n=Tt.WGS84.cartographicToCartesian(new J(r)),i=[];for(let s of tZ()){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 tc(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(e).transformByMatrix3(o).normalize()}}});var MN=p(()=>{"use strict";AS();SN()});function vN(t,e=null){return RS(t,e?{token:e}:void 0)}function RS(t,e){if(!e||Object.keys(e).length===0||/^(?:data|blob):/i.test(t))return t;let r=t.indexOf("#"),n=r>=0?t.slice(r):"",i=r>=0?t.slice(0,r):t,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(e))c.has(h)||l.set(h,String(d));let u=l.toString();return`${s}${o>=0?`?${a}`:""}${u?`${o>=0?"&":"?"}${u}`:""}${n}`}var EN=p(()=>{"use strict"});function LS(t){switch(t){case"UInt8":return Uint8Array;case"UInt16":return Uint16Array;case"UInt32":return Uint32Array;case"Float32":return Float32Array;case"UInt64":return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${t}`)}}function uf(t){switch(t){case"UInt8":return 1;case"UInt16":case"Int16":return 2;case"UInt32":case"Int32":case"Float32":return 4;case"UInt64":case"Int64":case"Float64":return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${t}`)}}var Z1,OS=p(()=>{"use strict";Z1={DEFAULT:"default",LNGLAT:"lnglat",METER_OFFSETS:"meter-offsets",LNGLAT_OFFSETS:"lnglat-offsets",CARTESIAN:"cartesian"}});function BS(t,e){if(!t)throw new Error(`parseI3STileContent requires LoaderContext to ${e}. Nested I3S parsing must run through parseFromContext().`);return t}function nZ(t){switch(t){case"ktx-etc2":case"dds":return Jo;case"ktx2":return mo;default:return Zo}}async function RN(t,e,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 mn,coordinateSystem:"meter-offsets",byteLength:0,texture:null,topology:e.layerType==="Point"?"point-list":"triangle-list",pointRenderer:e.pointRenderer,pointSymbol:e.pointSymbol},a=i?BS(i,"parse nested resources"):null,c=(d=e.textureUrls)!=null&&d.length?e.textureUrls:e.textureUrl?[{textureSetDefinitionId:SZ(e.materialDefinition),textureUrl:e.textureUrl,textureFormat:e.textureFormat||"jpg"}]:[],l={};for(let m of c)try{let g=await oZ(m.textureUrl,m.textureFormat,e,n,a||i);g&&(l[m.textureSetDefinitionId]=g)}catch(g){Ai(n).warn(String(g))()}let u=Object.values(l)[0]||null;return s.texture=u,Object.keys(l).length>0&&(s.textures=l),s.material=wZ(e.materialDefinition,l,u),s.material&&(s.texture=null),await sZ(t,s,e,r,n,i)}async function oZ(t,e,r,n,i){var m;let o=n==null?void 0:n.i3s,s=RS(vN(t,o==null?void 0:o.token),n==null?void 0:n.searchParams),a=nZ(e),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=BS(i,"decode texture payloads");if(a===Zo){let g={...r.textureLoaderOptions};try{let y=await Ul(u,Zo,g,h);return mp(y)}catch{let b=await Ul(u,a,g,h);return mp(b)}}let d=await Ul(u,a,r.textureLoaderOptions,h);return a===mo&&(d=d[0]),{compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}async function sZ(t,e,r,n,i,o){var m,g,y,b,w,_;let s=t.byteLength,a,c,l=0,u=0,h;if(r.isDracoGeometry){let S=BS(o,"decode Draco geometry"),M=await Ul(t,vi,{draco:{shape:"mesh",attributeNameEntry:iZ}},S);c=((m=M.header)==null?void 0:m.vertexCount)??0,h=(g=M.indices)==null?void 0:g.value;let{POSITION:v,NORMAL:C,COLOR_0:R,["feature-index"]:E,["uv-region"]:U}=M.attributes;if(a={position:v,normal:C,color:R,uvRegion:U,id:E},cZ(a,M.attributes),e.geometryMode==="source")for(let[O,A]of Object.entries(M.attributes))!["POSITION","NORMAL","COLOR_0","feature-index","uv-region"].includes(O)&&!/^TEXCOORD_\d+$/.test(O)&&(a[O]=A);hZ(a,M);let I=EZ(E);I&&(vZ(a,I),e.drawRanges=fZ(a.id.value,h,e.topology))}else{let S=n.store.defaultGeometrySchema;if(!S)throw new Error("Uncompressed I3S geometry requires store.defaultGeometrySchema");let{vertexAttributes:M,ordering:v,featureAttributes:C,featureAttributeOrder:R}=S,E=mZ(t,S);l=E.byteOffset,c=E.vertexCount,u=E.featureCount;let{attributes:U,byteOffset:I}=AN(t,l,M,c,v),{attributes:O,byteOffset:A}=AN(t,I,C,u,R),V=aZ(t,A);V&&(e.meshSegmentation=V),e.drawRanges=uZ(O),MZ(O),a=dZ(U,O)}let d=n.spatialReference;if(e.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(M=>!Number.isFinite(M)))throw new Error("Source I3S geometry requires packed xyz values and a finite source origin");let S=CS(a.position.value,a.position.metadata,r.mbs);if(S.some(M=>!Number.isFinite(M)))throw new Error("Source I3S positions must be finite");a.position={value:S,size:3},e.origin=[0,0,0],e.cartographicOrigin=[0,0,0],e.coordinateSystem=d!=null&&d.sourceCrs&&Oo(d.sourceCrs)==="geographic"?"lnglat":"cartesian",e.spatialReference=d?Object.freeze({...d,status:"native",targetCrs:void 0,targetHeightReference:"native",outputCoordinates:"auto"}):void 0,e.normalReferenceFrame=n.store.normalReferenceFrame||"earth-centered",e.sourceAttributes=a}else if((d==null?void 0:d.status)==="transformable"||(d==null?void 0:d.status)==="transformed"){let S=new yd(d,n.spatialOptions||((y=i==null?void 0:i.i3s)==null?void 0:y.spatial)),M=CS(a.position.value,a.position.metadata,r.mbs),v=await S.transformPositionsAsync(M,r.mbs);a.position.value=v.positions,(b=a.normal)!=null&&b.value&&(a.normal.value=S.transformNormals(a.normal.value,v.sourcePositions,n.store.normalReferenceFrame)),e.modelMatrix=v.modelMatrix,e.coordinateSystem=v.coordinateSystem,e.origin=v.origin,e.cartographicOrigin=v.cartographicOrigin,e.spatialReference=S.spatialReference}else if(!((w=i==null?void 0:i.i3s)!=null&&w.coordinateSystem)||i.i3s.coordinateSystem===Z1.METER_OFFSETS){let S=gZ(a.position,r);e.modelMatrix=S.invert(),e.coordinateSystem="meter-offsets"}else e.modelMatrix=bZ(a.position),e.coordinateSystem="lnglat-offsets";e.attributes={positions:a.position,normals:a.normal,colors:TN(a.color,((_=i==null?void 0:i.i3s)==null?void 0:_.colorFormat)||"uint8norm"),uvRegions:TN(a.uvRegion||a.region)},lZ(e.attributes,a),e.indices=h||null,a.id&&a.id.value&&(e.featureIds=a.id.value);for(let S in e.attributes)e.attributes[S]||delete e.attributes[S];return e.vertexCount=c,e.byteLength=s,e}function aZ(t,e){return e<t.byteLength?t.slice(e):void 0}function cZ(t,e){for(let[r,n]of Object.entries(e)){let i=/^TEXCOORD_(\d+)$/.exec(r);i&&(t[`uv${Number(i[1])}`]=n)}}function lZ(t,e){for(let[r,n]of Object.entries(e)){let i=/^uv(\d+)$/.exec(r);if(!i||!n)continue;let o=Number(i[1]);t[o===0?"texCoords":`texCoords${o}`]=n}}function uZ(t){var o,s;let e=(o=t.id)==null?void 0:o.value,r=(s=t.faceRange)==null?void 0:s.value;if(!e||!r)return;let n=[],i=Math.min(e.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(e[a]),firstPrimitive:c,primitiveCount:u,firstVertex:c*3,vertexCount:u*3})}return n.length?n:void 0}function fZ(t,e,r){let n=r==="point-list"?1:3,i=(e==null?void 0:e.length)||t.length,o=Math.floor(i/n);if(!o)return;let s=[];for(let a=0;a<o;a++){let c=a*n,l=e?Number(e[c]):c,u=Number(t[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 hZ(t,e){for(let r in e.loaderData.attributes){let n=e.loaderData.attributes[r];switch(n.name){case"POSITION":t.position.metadata=n.metadata;break;case"feature-index":t.id.metadata=n.metadata;break;default:break}}}function dZ(t,e){return{...t,...e}}function TN(t,e="uint8norm"){return t&&(e==="float16"&&!t.componentType?{...t,value:Wx(t.value,255),normalized:!1,componentType:"float16"}:e==="float32"&&!t.componentType?{...t,value:Float32Array.from(t.value,r=>r/255),normalized:!1}:{...t,normalized:!0})}function mZ(t,e){let r=0,n=0,i=0;for(let{property:o,type:s}of e.header){let a=LS(s);switch(o){case"vertexCount".toString():n=new a(t,0,4)[0],r+=uf(s);break;case"featureCount".toString():i=new a(t,4,4)[0],r+=uf(s);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function AN(t,e,r,n,i){let o={};for(let s of i)if(r[s]){let{valueType:a,valuesPerElement:c}=r[s];if(e+n*c*uf(a)<=t.byteLength){let l=t.slice(e),u;if(a==="UInt64")u=pZ(l,n*c,uf(a));else{let h=LS(a);u=new h(l,0,n*c)}o[s]={value:u,size:c},s==="color"&&(o.color.normalized=!0),e=e+n*c*uf(a)}else if(s!=="uv0")break}return{attributes:o,byteOffset:e}}function pZ(t,e,r){let n=[],i=new DataView(t),o=0;for(let s=0;s<e;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 gZ(t,e){let r=e.mbs,n=t.value,i=t.metadata,o=new mn,s=new J(r[0],r[1],r[2]),a=new J;return Tt.WGS84.cartographicToCartesian(s,a),R2(Tt.WGS84,a,o),t.value=yZ(n,i,s),o}function CS(t,e={},r){var s,a;let n=new Float64Array(t.length),i=((s=e["i3s-scale_x"])==null?void 0:s.double)??1,o=((a=e["i3s-scale_y"])==null?void 0:a.double)??1;for(let c=0;c<n.length;c+=3)n[c]=t[c]*i+r[0],n[c+1]=t[c+1]*o+r[1],n[c+2]=t[c+2]+r[2];return n}function yZ(t,e={},r){let n=CS(t,e,r);for(let i=0;i<n.length;i+=3)Tt.WGS84.cartographicToCartesian(n.subarray(i,i+3),J1),n[i]=J1.x,n[i+1]=J1.y,n[i+2]=J1.z;return n}function bZ(t){var o,s;let e=t.metadata,r=((o=e==null?void 0:e["i3s-scale_x"])==null?void 0:o.double)||1,n=((s=e==null?void 0:e["i3s-scale_y"])==null?void 0:s.double)||1,i=new mn;return i[0]=r,i[5]=n,i}function wZ(t,e={},r){var o;let n=[t==null?void 0:t.emissiveFactor,(o=t==null?void 0:t.pbrMetallicRoughness)==null?void 0:o.baseColorFactor].some(s=>s==null?void 0:s.some(a=>a>1))?255:1,i;return t?i={...t,normalTexture:t.normalTexture?{...t.normalTexture}:void 0,occlusionTexture:t.occlusionTexture?{...t.occlusionTexture}:void 0,emissiveTexture:t.emissiveTexture?{...t.emissiveTexture}:void 0,pbrMetallicRoughness:t.pbrMetallicRoughness?{...t.pbrMetallicRoughness,baseColorTexture:t.pbrMetallicRoughness.baseColorTexture?{...t.pbrMetallicRoughness.baseColorTexture}:void 0,metallicRoughnessTexture:t.pbrMetallicRoughness.metallicRoughnessTexture?{...t.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=IN(i.emissiveFactor,n)),i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorFactor&&(i.pbrMetallicRoughness.baseColorFactor=IN(i.pbrMetallicRoughness.baseColorFactor,n)),Object.keys(e).length>0?_Z(i,e):r&&xZ(i,r),i}function IN(t,e){let r=[...t];for(let n=0;n<t.length;n++){let i=t[n]/e;r[n]=n<3?i<=.04045?i/12.92:((i+.055)/1.055)**2.4:i}return r}function xZ(t,e){if(t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture){let r=t.pbrMetallicRoughness.baseColorTexture;t.pbrMetallicRoughness.baseColorTexture={...r,texture:ff(e,r)}}else if(t.emissiveTexture){let r=t.emissiveTexture;t.emissiveTexture={...r,texture:ff(e,r)}}else if(t.pbrMetallicRoughness&&t.pbrMetallicRoughness.metallicRoughnessTexture){let r=t.pbrMetallicRoughness.metallicRoughnessTexture;t.pbrMetallicRoughness.metallicRoughnessTexture={...r,texture:ff(e,r)}}else if(t.normalTexture){let r=t.normalTexture;t.normalTexture={...r,texture:ff(e,r)}}else if(t.occlusionTexture){let r=t.occlusionTexture;t.occlusionTexture={...r,texture:ff(e,r)}}}function _Z(t,e){var n,i;let r=[(n=t.pbrMetallicRoughness)==null?void 0:n.baseColorTexture,(i=t.pbrMetallicRoughness)==null?void 0:i.metallicRoughnessTexture,t.normalTexture,t.occlusionTexture,t.emissiveTexture];for(let o of r){if(!o)continue;let s=e[o.textureSetDefinitionId];s&&(o.texture=ff(s,o))}}function ff(t,e){let r=PN(e.wrapS),n=PN(e.wrapT),i=r||n?{wrapS:r||10497,wrapT:n||10497}:void 0;return i?{source:{image:t},sampler:i}:{source:{image:t}}}function PN(t){switch(t){case"none":return 33071;case"mirror":return 33648;case"repeat":return 10497;default:return}}function SZ(t){var e,r,n,i,o,s,a;return((r=(e=t==null?void 0:t.pbrMetallicRoughness)==null?void 0:e.baseColorTexture)==null?void 0:r.textureSetDefinitionId)??((i=(n=t==null?void 0:t.pbrMetallicRoughness)==null?void 0:n.metallicRoughnessTexture)==null?void 0:i.textureSetDefinitionId)??((o=t==null?void 0:t.normalTexture)==null?void 0:o.textureSetDefinitionId)??((s=t==null?void 0:t.occlusionTexture)==null?void 0:s.textureSetDefinitionId)??((a=t==null?void 0:t.emissiveTexture)==null?void 0:a.textureSetDefinitionId)??0}function MZ(t){let{id:e,faceRange:r}=t;if(!e||!r)return;let n=e.value,i=r.value,o=i[i.length-1]+1,s=new 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}t.id.value=s}function vZ(t,e){let r=t.id.value,n=new Float64Array(r.length);for(let i=0;i<r.length;i++)n[i]=e[r[i]];t.id.value=n}function EZ(t){var e,r;return(r=(e=t==null?void 0:t.metadata)==null?void 0:e["i3s-feature-ids"])==null?void 0:r.intArray}var J1,iZ,LN=p(()=>{"use strict";fi();Xh();Cn();Qf();Qf();fi();oh();a_();oh();MN();EN();OS();J1=new J([0,0,0]);iZ="i3s-attribute-type"});var Q1,DS,FAe,ON,kAe,GAe,UAe,jAe,zAe,CN=p(()=>{"use strict";Q1=(t,e,r,n)=>({name:t,id:e,module:"tiles-3d",encoding:"binary",format:r,extensions:n,mimeTypes:["application/octet-stream"],binary:!0}),DS=(t,e,r)=>({name:t,id:e,module:"tiles-3d",encoding:"json",format:r,extensions:["json"],mimeTypes:["application/json"],text:!0}),FAe=Q1("I3S","i3s","i3s",["bin"]),ON=Q1("I3S Content","i3s-content","i3s-content",["bin"]),kAe=Q1("I3S Attribute","i3s-attribute","i3s-attribute",["bin"]),GAe=Q1("I3S LEPCC","i3s-lepcc","i3s-lepcc",["bin"]),UAe=DS("I3S Node Page","i3s-node-page","i3s-node-page"),jAe=DS("ArcGIS Web Scene","arcgis-web-scene","arcgis-web-scene"),zAe=DS("I3S Building Scene Layer","i3s-building-scene-layer","i3s-building-scene-layer")});var BN,DN=p(()=>{"use strict";OS();BN={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:Z1.METER_OFFSETS}});var TZ,NN,FN=p(()=>{"use strict";CN();DN();TZ="5.0.0-beta.11",NN={...ON,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:TZ,mimeTypes:["application/octet-stream"],preload:async()=>(await Promise.resolve().then(()=>(NS(),kN))).I3SContentLoaderWithParser,extensions:["bin"],options:{i3s:BN,"i3s-content":{}}}});var kN={};Jt(kN,{I3SContentLoaderWithParser:()=>FS});async function IZ(t,e,r){let{tile:n,_tileOptions:i,tileset:o,_tilesetOptions:s}=(e==null?void 0:e.i3s)||{},a=i||n,c=s||o;return!a||!c?null:await RN(t,a,c,e,r)}var e8e,AZ,FS,NS=p(()=>{"use strict";oh();a_();oh();LN();FN();({preload:e8e,...AZ}=NN),FS={...AZ,subloaders:{ImageLoader:Zo,DracoLoader:vi,BasisLoader:mo,CompressedTextureLoader:Jo},parse:IZ}});Eg();var ZS=typeof process!="object"||String(process)!=="[object process]"||process.browser;var JS={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"]=JS||{};function Te(t,e,r){return e<=t&&t<=r}function QN(t,e){return t.indexOf(e)!==-1}var No=Math.floor;function Nd(t){if(t===void 0)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function eF(t){for(var e=String(t),r=e.length,n=0,i=[];n<r;){var o=e.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=e.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 tF(t){for(var e="",r=0;r<t.length;++r){var n=t[r];n<=65535?e+=String.fromCharCode(n):(n-=65536,e+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return e}function oi(t){return 0<=t&&t<=127}var ii=oi,Ye=-1;function Rg(t){this.tokens=[].slice.call(t),this.tokens.reverse()}Rg.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Ye},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.pop());else this.tokens.push(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.shift());else this.tokens.unshift(t)}};var gt=-1;function Xe(t,e){if(t)throw TypeError("Decoder error");return e||65533}function Ti(t){throw TypeError("The code point "+t+" could not be encoded.")}function rF(){}rF.prototype={handler:function(t,e){}};function nF(){}nF.prototype={handler:function(t,e){}};function Ig(t){return t=String(t).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Pg,t)?Pg[t]:null}var QS=[{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"}],Pg={};QS.forEach(function(t){t.encodings.forEach(function(e){e.labels.forEach(function(r){Pg[r]=e})})});var fn={},hn={};function Tl(t,e){return e&&e[t]||null}function Al(t,e){var r=e.indexOf(t);return r===-1?null:r}function $r(t){if(!("encoding-indexes"in globalThis))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return globalThis["encoding-indexes"][t]}function iF(t){if(t>39419&&t<189e3||t>1237575)return null;if(t===7457)return 59335;var e=0,r=0,n=$r("gb18030-ranges"),i;for(i=0;i<n.length;++i){var o=n[i];if(o[0]<=t)e=o[0],r=o[1];else break}return r+t-e}function oF(t){if(t===59335)return 7457;var e=0,r=0,n=$r("gb18030-ranges"),i;for(i=0;i<n.length;++i){var o=n[i];if(o[1]<=t)e=o[1],r=o[0];else break}return r+t-e}function sF(t){Tg=Tg||$r("jis0208").map(function(r,n){return Te(n,8272,8835)?null:r});var e=Tg;return e.indexOf(t)}var Tg;function aF(t){Ag=Ag||$r("big5").map(function(r,n){return n<5024?null:r});var e=Ag;return t===9552||t===9566||t===9569||t===9578||t===21313||t===21317?e.lastIndexOf(t):Al(t,e)}var Ag,eM="utf-8";function Va(t,e){if(!(this instanceof Va))throw TypeError("Called as a function. Did you forget 'new'?");t=t!==void 0?String(t):eM,e=Nd(e),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=Ig(t);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+t);if(!hn[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var n=this;return n._encoding=r,e.fatal&&(n._error_mode="fatal"),e.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(Va.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Va.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Va.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Va.prototype.decode=function(e,r){var n;typeof e=="object"&&e instanceof ArrayBuffer?n=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):n=new Uint8Array(0),r=Nd(r),this._do_not_flush||(this._decoder=hn[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=!!r.stream;for(var i=new Rg(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 QN(["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)),tF(l)}return c.call(this,o)};function Ef(t,e){if(!(this instanceof Ef))throw TypeError("Called as a function. Did you forget 'new'?");e=Nd(e),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=e.fatal?"fatal":"replacement";var r=this;if(e.NONSTANDARD_allowLegacyEncoding){t=t!==void 0?String(t):eM;var n=Ig(t);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+t);if(!fn[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=Ig("utf-8"),t!==void 0&&"console"in globalThis;return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(Ef.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Ef.prototype.encode=function(e,r){e=e===void 0?"":String(e),r=Nd(r),this._do_not_flush||(this._encoder=fn[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=!!r.stream;for(var n=new Rg(eF(e)),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 cF(t){var e=t.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(e);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(e);return null}if(!Te(c,o,s))return r=i=n=0,o=128,s=191,a.prepend(c),Xe(e);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 lF(t){var e=t.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(ii(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}}fn["UTF-8"]=function(t){return new lF(t)};hn["UTF-8"]=function(t){return new cF(t)};function uF(t,e){var r=e.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(oi(i))return i;var o=t[i-128];return o===null?Xe(r):o}}function fF(t,e){var r=e.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(ii(i))return i;var o=Al(i,t);return o===null&&Ti(i),o+128}}(function(){"encoding-indexes"in globalThis&&QS.forEach(function(t){t.heading==="Legacy single-byte encodings"&&t.encodings.forEach(function(e){var r=e.name,n=$r(r.toLowerCase());hn[r]=function(i){return new uF(n,i)},fn[r]=function(i){return new fF(n,i)}})})})();hn.GBK=function(t){return new tM(t)};fn.GBK=function(t){return new rM(t,!0)};function tM(t){var e=t.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(e));var a;if(i!==0){a=null,Te(s,48,57)&&(a=iF((((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(e)):a}if(n!==0)return Te(s,129,254)?(i=s,null):(o.prepend([n,s]),r=0,n=0,Xe(e));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:Tl(u,$r("gb18030")),a===null&&oi(s)&&o.prepend(s),a===null?Xe(e):a}return oi(s)?s:s===128?8364:Te(s,129,254)?(r=s,null):Xe(e)}}function rM(t,e){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(ii(i))return i;if(i===58853)return Ti(i);if(e&&i===8364)return 128;var o=Al(i,$r("gb18030"));if(o!==null){var s=No(o/190)+129,a=o%190,c=a<63?64:65;return[s,a+c]}if(e)return Ti(i);o=oF(i);var l=No(o/10/126/10);o=o-l*10*126*10;var u=No(o/10/126);o=o-u*10*126;var h=No(o/10),d=o-h*10;return[l+129,u+48,h+129,d+48]}}fn.gb18030=function(t){return new rM(t)};hn.gb18030=function(t){return new tM(t)};function hF(t){var e=t.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(e);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:Tl(s,$r("big5"));return c===null&&oi(i)&&n.prepend(i),c===null?Xe(e):c}return oi(i)?i:Te(i,129,254)?(r=i,null):Xe(e)}}function dF(t){var e=t.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(ii(n))return n;var i=aF(n);if(i===null)return Ti(n);var o=No(i/157)+129;if(o<161)return Ti(n);var s=i%157,a=s<63?64:98;return[o,s+a]}}fn.Big5=function(t){return new dF(t)};hn.Big5=function(t){return new hF(t)};function mF(t){var e=t.fatal,r=!1,n=0;this.handler=function(i,o){if(o===Ye&&n!==0)return n=0,Xe(e);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=Tl((s-161)*94+(o-161),$r(r?"jis0212":"jis0208"))),r=!1,Te(o,161,254)||i.prepend(o),a===null?Xe(e):a}return oi(o)?o:o===142||o===143||Te(o,161,254)?(n=o,null):Xe(e)}}function pF(t){var e=t.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(ii(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=Al(n,$r("jis0208"));if(i===null)return Ti(n);var o=No(i/94)+161,s=i%94+161;return[o,s]}}fn["EUC-JP"]=function(t){return new pF(t)};hn["EUC-JP"]=function(t){return new mF(t)};function gF(t){var e=t.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(e));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(e));case r.Katakana:return c===27?(n=r.EscapeStart,null):Te(c,33,95)?(s=!1,65344+c):c===Ye?gt:(s=!1,Xe(e));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(e));case r.TrailByte:if(c===27)return n=r.EscapeStart,Xe(e);if(Te(c,33,126)){n=r.LeadByte;var l=(o-33)*94+c-33,u=Tl(l,$r("jis0208"));return u===null?Xe(e):u}return c===Ye?(n=r.LeadByte,a.prepend(c),Xe(e)):(n=r.LeadByte,Xe(e));case r.EscapeStart:return c===36||c===40?(o=c,n=r.Escape,null):(a.prepend(c),s=!1,n=i,Xe(e));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(e):null}return a.prepend([h,c]),s=!1,n=i,Xe(e)}}}function yF(t){var e=t.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 Ti(65533);if(n===r.ASCII&&ii(o))return o;if(n===r.Roman&&(ii(o)&&o!==92&&o!==126||o===165||o===8254)){if(ii(o))return o;if(o===165)return 92;if(o===8254)return 126}if(ii(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=Al(o,$r("jis0208"));if(s===null)return Ti(o);if(n!==r.jis0208)return i.prepend(o),n=r.jis0208,[27,36,66];var a=No(s/94)+33,c=s%94+33;return[a,c]}}fn["ISO-2022-JP"]=function(t){return new yF(t)};hn["ISO-2022-JP"]=function(t){return new gF(t)};function bF(t){var e=t.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(e);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:Tl(s,$r("jis0208"));return l===null&&oi(i)&&n.prepend(i),l===null?Xe(e):l}return oi(i)||i===128?i:Te(i,161,223)?65216+i:Te(i,129,159)||Te(i,224,252)?(r=i,null):Xe(e)}}function wF(t){var e=t.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(ii(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=sF(n);if(i===null)return Ti(n);var o=No(i/188),s=o<31?129:193,a=i%188,c=a<63?64:65;return[o+s,a+c]}}fn.Shift_JIS=function(t){return new wF(t)};hn.Shift_JIS=function(t){return new bF(t)};function xF(t){var e=t.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(e);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:Tl(s,$r("euc-kr"));return s===null&&oi(i)&&n.prepend(i),a===null?Xe(e):a}return oi(i)?i:Te(i,129,254)?(r=i,null):Xe(e)}}function _F(t){var e=t.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(ii(n))return n;var i=Al(n,$r("euc-kr"));if(i===null)return Ti(n);var o=No(i/190)+129,s=i%190+65;return[o,s]}}fn["EUC-KR"]=function(t){return new _F(t)};hn["EUC-KR"]=function(t){return new xF(t)};function Dd(t,e){var r=t>>8,n=t&255;return e?[r,n]:[n,r]}function nM(t,e){var r=e.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(t?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(Dd(a,t)),Xe(r))}return Te(a,55296,56319)?(i=a,null):Te(a,56320,57343)?Xe(r):a}}function iM(t,e){var r=e.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(Te(i,0,65535))return Dd(i,t);var o=Dd((i-65536>>10)+55296,t),s=Dd((i-65536&1023)+56320,t);return o.concat(s)}}fn["UTF-16BE"]=function(t){return new iM(!0,t)};hn["UTF-16BE"]=function(t){return new nM(!0,t)};fn["UTF-16LE"]=function(t){return new iM(!1,t)};hn["UTF-16LE"]=function(t){return new nM(!1,t)};function SF(t){var e=t.fatal;this.handler=function(r,n){return n===Ye?gt:oi(n)?n:63360+n-128}}function MF(t){var e=t.fatal;this.handler=function(r,n){return n===Ye?gt:ii(n)?n:Te(n,63360,63487)?n-63360+128:Ti(n)}}fn["x-user-defined"]=function(t){return new MF(t)};hn["x-user-defined"]=function(t){return new SF(t)};function Tf(t){return Buffer.from(t).toString("base64")}function Lg(t){return Buffer.from(t,"base64").toString("ascii")}async function sm(){try{return(await Promise.resolve().then(()=>(SE(),_E))).default}catch(t){throw new Error("Node image decoding and encoding require the optional 'sharp' package. Install it with 'npm install sharp'.",{cause:t})}}var am=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg+xml"];async function cm(t,e){let r=await sm(),{data:n,info:i}=await r(Buffer.from(t),{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 vE(t){return t instanceof ArrayBuffer?t:(ArrayBuffer.isView(t),lm(t))}function lm(t){if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t)){let{buffer:e,byteOffset:r,byteLength:n}=t;return e instanceof ArrayBuffer&&r===0&&n===e.byteLength?e:ME(e,r,n)}return ME(t)}function ME(t,e=0,r=t.byteLength-e){let n=new Uint8Array(r);return n.set(new Uint8Array(t,e,r)),n.buffer}async function py(t,e={}){let r=await sm(),n=(e.type||"jpeg").toLowerCase().replace(/^image\//,""),i=n==="jpg"?"jpeg":n,o=await r(Buffer.from(t.data),{raw:{width:t.width,height:t.height,channels:4}}).toFormat(i).toBuffer();return vE(o)}var Gl=class{width;height;data;constructor(e){if(!e||!e.data||!e.width||!e.height)throw new Error("NodeImageBitmap requires decoded image data");this.width=e.width,this.height=e.height,this.data=e.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 gy(t){return t instanceof Gl}function EE(t){return new Gl(t)}function yy(t){if(!gy(t))throw new Error("getImageBitmapData");return t._getImageData()}var Fj="",kj=new Map;function um(t){for(let[e,r]of kj)t.startsWith(e)&&(t=t.replace(e,r));return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${Fj}${t}`),t}var jo=me(require("fs"),1),Ka=class{handle;size;bigsize;url;constructor(e,r,n){e=um(e),this.handle=jo.default.openSync(e,r,n);let i=jo.default.fstatSync(this.handle,{bigint:!0});this.size=Number(i.size),this.bigsize=i.size,this.url=e}async close(){return new Promise((e,r)=>{jo.default.close(this.handle,n=>n?r(n):e())})}async truncate(e){return new Promise((r,n)=>{jo.default.ftruncate(this.handle,e,i=>{i?n(i):(this.bigsize=BigInt(e),this.size=Number(this.bigsize),r())})})}async append(e){return new Promise((r,n)=>{jo.default.appendFile(this.handle,e,i=>{i?n(i):(this.bigsize=this.bigsize+BigInt(e.length),this.size=Number(this.bigsize),r())})})}async stat(){return await new Promise((e,r)=>jo.default.fstat(this.handle,{bigint:!0},(n,i)=>{let o={size:Number(i.size),bigsize:i.size,isDirectory:i.isDirectory()};n?r(n):e(o)}))}async read(e,r){let n=new ArrayBuffer(r),i=BigInt(e),o=0,s=new Uint8Array(n),a;for(;r>0;){let c=await Gj(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(e,r=0,n=e.byteLength){return new Promise((i,o)=>{let s=Number(r),a=new Uint8Array(e,Number(r),n);jo.default.write(this.handle,a,0,n,s,(c,l)=>c?o(c):i(l))})}};async function Gj(t,e,r,n,i){return await new Promise((o,s)=>jo.default.read(t,e,r,n,i,(a,c)=>a?s(a):o(c)))}var dm=me(require("fs/promises"),1);var wy=me(require("fs"),1),by=require("stream");var fm=me(require("zlib"),1);function TE(t,e){switch(e==null?void 0:e.get("content-encoding")){case"br":return t.pipe(fm.default.createBrotliDecompress());case"gzip":return t.pipe(fm.default.createGunzip());case"deflate":return t.pipe(fm.default.createDeflate());default:return t}}var Uj=t=>typeof t=="boolean",AE=t=>typeof t=="function",jj=t=>t!==null&&typeof t=="object",zj=t=>jj(t)&&AE(t.read)&&AE(t.pipe)&&Uj(t.readable);async function hm(t,e){let r=/^file:\/\//;t.replace(r,"/");let n=t.split("?")[0];n=um(n);let i=new Headers;t.endsWith(".gz")&&i.set("content-encoding","gzip"),t.endsWith(".br")&&i.set("content-encoding","br");try{let o=await new Promise((h,d)=>{let m=wy.default.createReadStream(n,{encoding:null});m.once("readable",()=>h(m)),m.on("error",g=>d(g))}),s=o;zj(o)?s=TE(o,i):typeof o=="string"?s=by.Readable.from([new TextEncoder().encode(o)]):s=by.Readable.from([o||new ArrayBuffer(0)]);let a=200,c="OK",l=qj(n),u=new Response(s,{headers:l,status:a,statusText:c});return Object.defineProperty(u,"url",{value:t}),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:t}),u}}function qj(t){let e={};if(!e["content-length"]){let r=wy.default.statSync(t);e["content-length"]=r.size}return t.endsWith(".gz")&&(t=t.slice(0,-3),e["content-encoding"]="gzip"),new Headers(e)}var mm=class{readable=!0;writable=!0;constructor(){}async readdir(e=".",r){return await dm.default.readdir(e,r)}async stat(e){let r=await dm.default.stat(e,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(e){return await dm.default.unlink(e)}async fetch(e,r){return await hm(e,r)}async openReadableFile(e,r="r"){return new Ka(e,r)}async openWritableFile(e,r="w",n){return new Ka(e,r,n)}};var Df=me(require("crypto"),1),pm=class{name="crypto-node";options;_algorithm;_hash;constructor(e){var r,n;if(this.options=e,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(e,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(!Df.createHash)throw new Error("crypto.createHash not available");let c=(a=Df.createHash)==null?void 0:a(n),l=new Uint8Array(e);return c.update(l).digest("base64")}catch(c){throw Error(`${n} hash not available. ${c}`)}}async*hashBatches(e,r="base64"){var o,s,a,c,l,u,h;if(!Df.createHash)throw new Error("crypto.createHash not available");let n=(c=Df.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 e){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 CE=require("node:process"),BE=require("node:stream/web");var gm=require("node:stream");function IE(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[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=(e==null?void 0:e.objectMode)??!1,s=gm.Readable.from(i,{highWaterMark:(0,gm.getDefaultHighWaterMark)(o),...e,objectMode:o}),a=s._destroy;return s._destroy=function(c,l){a.call(this,c,u=>{l(!n&&u===c?null:u)})},s}var ym=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(e){let r=await e.arrayBuffer();this.onload&&this.onload({target:{result:r}})}async readAsBinaryString(e){throw Error("Not implemented")}async readAsDataURL(e){let r=await e.text(),n=`data://;base64,${Tf(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(e){let r=await e.text();this.onload&&this.onload({target:{result:r}})}};function PE(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=ym),global}var xy=me(require("module"),1),_y=me(require("path"),1),wm=me(require("fs"),1),Sy=require("node:url");async function RE(t){return t.startsWith("http")?await(await fetch(t)).arrayBuffer():lm(wm.default.readFileSync(My(t)))}async function LE(t){return t.startsWith("http")?await(await fetch(t)).text():wm.default.readFileSync(My(t),"utf8")}async function OE(t){if(t.startsWith("http")){let i=await(await fetch(t)).text();return bm(i)}let e=My(t),r=wm.default.readFileSync(e,"utf8");return bm(r,e)}function bm(t,e="",r){if(typeof e=="object"&&(r=e,e=""),e.startsWith("file:")&&(e=(0,Sy.fileURLToPath)(e)),typeof t!="string")throw new Error(`code must be a string, not ${typeof t}`);let n=xy.default._nodeModulePaths(_y.default.dirname(e)),i=typeof module<"u"&&(module==null?void 0:module.parent),o=new xy.default(e,i);return o.filename=e,o.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),o._compile(t,e),i&&i.children&&i.children.splice(i.children.indexOf(o),1),o.exports}function My(t){return t.startsWith("file:")?(0,Sy.fileURLToPath)(t):_y.default.resolve(t)}var yte=parseInt(CE.versions.node.split(".")[0]),xte=globalThis.Blob,_te=globalThis.File;PE();ZS&&YS.error("loaders.gl: The @loaders.gl/core/polyfills should only be used in Node.js environments")();globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=IE;globalThis.loaders.NodeFile=Ka;globalThis.loaders.NodeFileSystem=mm;globalThis.loaders.fetchNode=hm;globalThis.loaders.NodeHash=pm;globalThis.TextEncoder||(globalThis.TextEncoder=Ef);globalThis.TextDecoder||(globalThis.TextDecoder=Va);globalThis.ReadableStream||(globalThis.ReadableStream=BE.ReadableStream);!("atob"in globalThis)&&Tf&&(globalThis.atob=Tf);!("btoa"in globalThis)&&Lg&&(globalThis.btoa=Lg);globalThis.loaders.encodeImageNode=py;globalThis.loaders.parseImageNode=cm;globalThis.loaders.imageFormatsNode=am;globalThis.loaders.createImageBitmapNode=EE;globalThis.loaders.getImageBitmapDataNode=yy;globalThis.loaders.isImageBitmapNode=gy;globalThis.ImageBitmap||(globalThis.ImageBitmap=Gl);"getImageBitmapData"in globalThis||(globalThis.getImageBitmapData=yy);globalThis._parseImageNode=cm;globalThis._imageFormatsNode=am;globalThis.loaders.readFileAsArrayBuffer=RE;globalThis.loaders.readFileAsText=LE;globalThis.loaders.requireFromFile=OE;globalThis.loaders.requireFromString=bm;fi();NS();Ky(FS);
24
24
  /*! Bundled license information:
25
25
 
26
26
  sharp/dist/is.mjs: