maplibre-gl-components 0.16.2 → 0.17.0

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 (232) hide show
  1. package/README.md +4 -3
  2. package/dist/{ControlGrid-DQ4w_Nf9.js → ControlGrid-C6zp03Vq.js} +125375 -115454
  3. package/dist/ControlGrid-DIAcXRBe.cjs +17278 -0
  4. package/dist/DuckDBConverter-5a2FWwmf.js +354 -0
  5. package/dist/DuckDBConverter-pfXSUi_l.cjs +23 -0
  6. package/dist/ShapefileConverter-DGCXPY_S.cjs +1 -0
  7. package/dist/ShapefileConverter-DN3fVOuo.js +102 -0
  8. package/dist/basedecoder-BliCKuUS.js +62 -0
  9. package/dist/basedecoder-Zw0CbD9L.cjs +1 -0
  10. package/dist/deflate-DBL0msKQ.js +10 -0
  11. package/dist/deflate-DNeBKDsy.cjs +1 -0
  12. package/dist/esm-Bp6m44bk.js +811 -0
  13. package/dist/esm-oEp_aN1n.cjs +1 -0
  14. package/dist/geojson-Bnoe76Pm.js +2002 -0
  15. package/dist/geojson-CxMdRvJX.cjs +1 -0
  16. package/dist/geotiff-Bzy-Zyc2.js +1882 -0
  17. package/dist/geotiff-DYylEFA9.cjs +8 -0
  18. package/dist/globals-B4iCNAg9.cjs +1 -0
  19. package/dist/globals-BKIWameS.js +572 -0
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.mjs +150 -147
  22. package/dist/jpeg-B6Sg6W8k.cjs +1 -0
  23. package/dist/jpeg-CJcNvScS.js +545 -0
  24. package/dist/lerc-2QwcA_K7.js +840 -0
  25. package/dist/lerc-DQRITnja.cjs +1 -0
  26. package/dist/lib-B4jvG7hB.cjs +4 -0
  27. package/dist/lib-CNQtqzfc.js +4060 -0
  28. package/dist/lzw-1HaU0PJK.cjs +1 -0
  29. package/dist/lzw-DF5VHuii.js +76 -0
  30. package/dist/main-dist-CbHNdsir.js +18314 -0
  31. package/dist/main-dist-DOx_Axbx.cjs +2 -0
  32. package/dist/maplibre-geoman.es-C0F1ydoG.cjs +213 -0
  33. package/dist/maplibre-geoman.es-D1CztSQd.js +27213 -0
  34. package/dist/maplibre-gl-components.css +2 -1
  35. package/dist/packbits-CK8RPU_B.js +22 -0
  36. package/dist/packbits-D5Zovac7.cjs +1 -0
  37. package/dist/pako.esm-DFyPB7cO.cjs +1 -0
  38. package/dist/pako.esm-hTfpTBhd.js +1536 -0
  39. package/dist/raw-Brljg6vy.js +9 -0
  40. package/dist/raw-C-CSxCoU.cjs +1 -0
  41. package/dist/react.cjs +1 -1
  42. package/dist/react.mjs +1357 -1004
  43. package/dist/{types → src}/lib/core/CogLayer.d.ts.map +1 -1
  44. package/dist/{types → src}/lib/core/PMTilesLayer.d.ts.map +1 -1
  45. package/dist/{types → src}/lib/core/SpinGlobeControl.d.ts +6 -7
  46. package/dist/src/lib/core/SpinGlobeControl.d.ts.map +1 -0
  47. package/dist/{types → src}/lib/core/StacLayer.d.ts.map +1 -1
  48. package/dist/{types → src}/lib/core/types.d.ts +3 -1
  49. package/dist/{types → src}/lib/core/types.d.ts.map +1 -1
  50. package/dist/{types → src}/lib/utils/color.d.ts +8 -0
  51. package/dist/src/lib/utils/color.d.ts.map +1 -0
  52. package/dist/{types → src}/lib/utils/index.d.ts +1 -1
  53. package/dist/{types → src}/lib/utils/index.d.ts.map +1 -1
  54. package/dist/webimage-Bh2pNwjN.cjs +1 -0
  55. package/dist/webimage-rg-Z9Sbn.js +25 -0
  56. package/dist/zstd-B3Xa90HD.cjs +1 -0
  57. package/dist/zstd-BwwN0X3K.js +51 -0
  58. package/package.json +66 -53
  59. package/dist/ControlGrid-Bukna_at.cjs +0 -17062
  60. package/dist/DuckDBConverter-B98M0DFs.cjs +0 -23
  61. package/dist/DuckDBConverter-RPq48-t0.js +0 -434
  62. package/dist/ShapefileConverter-AjbEjEyq.cjs +0 -1
  63. package/dist/ShapefileConverter-trvt8J3z.js +0 -125
  64. package/dist/decoder-CLokFc0V.js +0 -8
  65. package/dist/decoder-D9LU4bUo.cjs +0 -1
  66. package/dist/deflate-Bay-vzHJ.cjs +0 -1
  67. package/dist/deflate-yeu3ogBn.js +0 -10
  68. package/dist/geojson-BQSVgKFt.cjs +0 -1
  69. package/dist/geojson-BSUuDj5k.js +0 -2551
  70. package/dist/geotiff-BNxc90fm.cjs +0 -8
  71. package/dist/geotiff-BUZniE5g.js +0 -3105
  72. package/dist/index-8ZZtuDTp.js +0 -705
  73. package/dist/index-DQXdX5y1.js +0 -4666
  74. package/dist/index-Dh1kpCb6.cjs +0 -1
  75. package/dist/index-IrsIiQNM.cjs +0 -4
  76. package/dist/jpeg-B7yImnpY.js +0 -533
  77. package/dist/jpeg-BiN8bMT5.cjs +0 -1
  78. package/dist/lerc-BvSjGMM2.cjs +0 -1
  79. package/dist/lerc-CqgA9njy.js +0 -1031
  80. package/dist/lzw-C-_B7Jis.cjs +0 -1
  81. package/dist/lzw-DL9RcHOz.js +0 -84
  82. package/dist/main-dist-Bymiy5aM.cjs +0 -2
  83. package/dist/main-dist-Cv8AKwrY.js +0 -629
  84. package/dist/maplibre-geoman.es-Bxdg-2EU.cjs +0 -129
  85. package/dist/maplibre-geoman.es-CFgM2ajb.js +0 -22827
  86. package/dist/packbits-DRGSjtn-.cjs +0 -1
  87. package/dist/packbits-YEJGULcy.js +0 -24
  88. package/dist/pako.esm-Bx5X36Wo.js +0 -1074
  89. package/dist/pako.esm-DZC2QrbJ.cjs +0 -1
  90. package/dist/raw-CoQHiEnn.js +0 -9
  91. package/dist/raw-D6OidBKc.cjs +0 -1
  92. package/dist/types/lib/core/SpinGlobeControl.d.ts.map +0 -1
  93. package/dist/types/lib/utils/color.d.ts.map +0 -1
  94. package/dist/webimage-BXLN-zu8.js +0 -19
  95. package/dist/webimage-mWTez3Wv.cjs +0 -1
  96. /package/dist/{types → src}/index.d.ts +0 -0
  97. /package/dist/{types → src}/index.d.ts.map +0 -0
  98. /package/dist/{types → src}/lib/adapters/AddVectorAdapter.d.ts +0 -0
  99. /package/dist/{types → src}/lib/adapters/AddVectorAdapter.d.ts.map +0 -0
  100. /package/dist/{types → src}/lib/adapters/CogLayerAdapter.d.ts +0 -0
  101. /package/dist/{types → src}/lib/adapters/CogLayerAdapter.d.ts.map +0 -0
  102. /package/dist/{types → src}/lib/adapters/PMTilesLayerAdapter.d.ts +0 -0
  103. /package/dist/{types → src}/lib/adapters/PMTilesLayerAdapter.d.ts.map +0 -0
  104. /package/dist/{types → src}/lib/adapters/StacLayerAdapter.d.ts +0 -0
  105. /package/dist/{types → src}/lib/adapters/StacLayerAdapter.d.ts.map +0 -0
  106. /package/dist/{types → src}/lib/adapters/ZarrLayerAdapter.d.ts +0 -0
  107. /package/dist/{types → src}/lib/adapters/ZarrLayerAdapter.d.ts.map +0 -0
  108. /package/dist/{types → src}/lib/adapters/index.d.ts +0 -0
  109. /package/dist/{types → src}/lib/adapters/index.d.ts.map +0 -0
  110. /package/dist/{types → src}/lib/addControlGrid.d.ts +0 -0
  111. /package/dist/{types → src}/lib/addControlGrid.d.ts.map +0 -0
  112. /package/dist/{types → src}/lib/colormaps/diverging.d.ts +0 -0
  113. /package/dist/{types → src}/lib/colormaps/diverging.d.ts.map +0 -0
  114. /package/dist/{types → src}/lib/colormaps/index.d.ts +0 -0
  115. /package/dist/{types → src}/lib/colormaps/index.d.ts.map +0 -0
  116. /package/dist/{types → src}/lib/colormaps/misc.d.ts +0 -0
  117. /package/dist/{types → src}/lib/colormaps/misc.d.ts.map +0 -0
  118. /package/dist/{types → src}/lib/colormaps/sequential.d.ts +0 -0
  119. /package/dist/{types → src}/lib/colormaps/sequential.d.ts.map +0 -0
  120. /package/dist/{types → src}/lib/converters/DuckDBConverter.d.ts +0 -0
  121. /package/dist/{types → src}/lib/converters/DuckDBConverter.d.ts.map +0 -0
  122. /package/dist/{types → src}/lib/converters/ShapefileConverter.d.ts +0 -0
  123. /package/dist/{types → src}/lib/converters/ShapefileConverter.d.ts.map +0 -0
  124. /package/dist/{types → src}/lib/converters/index.d.ts +0 -0
  125. /package/dist/{types → src}/lib/converters/index.d.ts.map +0 -0
  126. /package/dist/{types → src}/lib/converters/types.d.ts +0 -0
  127. /package/dist/{types → src}/lib/converters/types.d.ts.map +0 -0
  128. /package/dist/{types → src}/lib/core/AddVector.d.ts +0 -0
  129. /package/dist/{types → src}/lib/core/AddVector.d.ts.map +0 -0
  130. /package/dist/{types → src}/lib/core/Basemap.d.ts +0 -0
  131. /package/dist/{types → src}/lib/core/Basemap.d.ts.map +0 -0
  132. /package/dist/{types → src}/lib/core/BasemapReact.d.ts +0 -0
  133. /package/dist/{types → src}/lib/core/BasemapReact.d.ts.map +0 -0
  134. /package/dist/{types → src}/lib/core/BookmarkControl.d.ts +0 -0
  135. /package/dist/{types → src}/lib/core/BookmarkControl.d.ts.map +0 -0
  136. /package/dist/{types → src}/lib/core/ChoroplethControl.d.ts +0 -0
  137. /package/dist/{types → src}/lib/core/ChoroplethControl.d.ts.map +0 -0
  138. /package/dist/{types → src}/lib/core/CogLayer.d.ts +0 -0
  139. /package/dist/{types → src}/lib/core/CogLayerReact.d.ts +0 -0
  140. /package/dist/{types → src}/lib/core/CogLayerReact.d.ts.map +0 -0
  141. /package/dist/{types → src}/lib/core/Colorbar.d.ts +0 -0
  142. /package/dist/{types → src}/lib/core/Colorbar.d.ts.map +0 -0
  143. /package/dist/{types → src}/lib/core/ColorbarGuiControl.d.ts +0 -0
  144. /package/dist/{types → src}/lib/core/ColorbarGuiControl.d.ts.map +0 -0
  145. /package/dist/{types → src}/lib/core/ColorbarReact.d.ts +0 -0
  146. /package/dist/{types → src}/lib/core/ColorbarReact.d.ts.map +0 -0
  147. /package/dist/{types → src}/lib/core/ControlGrid.d.ts +0 -0
  148. /package/dist/{types → src}/lib/core/ControlGrid.d.ts.map +0 -0
  149. /package/dist/{types → src}/lib/core/ControlGridReact.d.ts +0 -0
  150. /package/dist/{types → src}/lib/core/ControlGridReact.d.ts.map +0 -0
  151. /package/dist/{types → src}/lib/core/HtmlControl.d.ts +0 -0
  152. /package/dist/{types → src}/lib/core/HtmlControl.d.ts.map +0 -0
  153. /package/dist/{types → src}/lib/core/HtmlControlReact.d.ts +0 -0
  154. /package/dist/{types → src}/lib/core/HtmlControlReact.d.ts.map +0 -0
  155. /package/dist/{types → src}/lib/core/HtmlGuiControl.d.ts +0 -0
  156. /package/dist/{types → src}/lib/core/HtmlGuiControl.d.ts.map +0 -0
  157. /package/dist/{types → src}/lib/core/InspectControl.d.ts +0 -0
  158. /package/dist/{types → src}/lib/core/InspectControl.d.ts.map +0 -0
  159. /package/dist/{types → src}/lib/core/InspectControlReact.d.ts +0 -0
  160. /package/dist/{types → src}/lib/core/InspectControlReact.d.ts.map +0 -0
  161. /package/dist/{types → src}/lib/core/Legend.d.ts +0 -0
  162. /package/dist/{types → src}/lib/core/Legend.d.ts.map +0 -0
  163. /package/dist/{types → src}/lib/core/LegendGuiControl.d.ts +0 -0
  164. /package/dist/{types → src}/lib/core/LegendGuiControl.d.ts.map +0 -0
  165. /package/dist/{types → src}/lib/core/LegendReact.d.ts +0 -0
  166. /package/dist/{types → src}/lib/core/LegendReact.d.ts.map +0 -0
  167. /package/dist/{types → src}/lib/core/MeasureControl.d.ts +0 -0
  168. /package/dist/{types → src}/lib/core/MeasureControl.d.ts.map +0 -0
  169. /package/dist/{types → src}/lib/core/MinimapControl.d.ts +0 -0
  170. /package/dist/{types → src}/lib/core/MinimapControl.d.ts.map +0 -0
  171. /package/dist/{types → src}/lib/core/MinimapControlReact.d.ts +0 -0
  172. /package/dist/{types → src}/lib/core/MinimapControlReact.d.ts.map +0 -0
  173. /package/dist/{types → src}/lib/core/PMTilesLayer.d.ts +0 -0
  174. /package/dist/{types → src}/lib/core/PrintControl.d.ts +0 -0
  175. /package/dist/{types → src}/lib/core/PrintControl.d.ts.map +0 -0
  176. /package/dist/{types → src}/lib/core/SearchControl.d.ts +0 -0
  177. /package/dist/{types → src}/lib/core/SearchControl.d.ts.map +0 -0
  178. /package/dist/{types → src}/lib/core/SearchControlReact.d.ts +0 -0
  179. /package/dist/{types → src}/lib/core/SearchControlReact.d.ts.map +0 -0
  180. /package/dist/{types → src}/lib/core/StacLayer.d.ts +0 -0
  181. /package/dist/{types → src}/lib/core/StacSearch.d.ts +0 -0
  182. /package/dist/{types → src}/lib/core/StacSearch.d.ts.map +0 -0
  183. /package/dist/{types → src}/lib/core/Terrain.d.ts +0 -0
  184. /package/dist/{types → src}/lib/core/Terrain.d.ts.map +0 -0
  185. /package/dist/{types → src}/lib/core/TerrainReact.d.ts +0 -0
  186. /package/dist/{types → src}/lib/core/TerrainReact.d.ts.map +0 -0
  187. /package/dist/{types → src}/lib/core/TileLayerControl.d.ts +0 -0
  188. /package/dist/{types → src}/lib/core/TileLayerControl.d.ts.map +0 -0
  189. /package/dist/{types → src}/lib/core/VectorDataset.d.ts +0 -0
  190. /package/dist/{types → src}/lib/core/VectorDataset.d.ts.map +0 -0
  191. /package/dist/{types → src}/lib/core/VectorDatasetReact.d.ts +0 -0
  192. /package/dist/{types → src}/lib/core/VectorDatasetReact.d.ts.map +0 -0
  193. /package/dist/{types → src}/lib/core/ViewStateControl.d.ts +0 -0
  194. /package/dist/{types → src}/lib/core/ViewStateControl.d.ts.map +0 -0
  195. /package/dist/{types → src}/lib/core/ViewStateControlReact.d.ts +0 -0
  196. /package/dist/{types → src}/lib/core/ViewStateControlReact.d.ts.map +0 -0
  197. /package/dist/{types → src}/lib/core/ZarrLayer.d.ts +0 -0
  198. /package/dist/{types → src}/lib/core/ZarrLayer.d.ts.map +0 -0
  199. /package/dist/{types → src}/lib/hooks/index.d.ts +0 -0
  200. /package/dist/{types → src}/lib/hooks/index.d.ts.map +0 -0
  201. /package/dist/{types → src}/lib/hooks/useBasemap.d.ts +0 -0
  202. /package/dist/{types → src}/lib/hooks/useBasemap.d.ts.map +0 -0
  203. /package/dist/{types → src}/lib/hooks/useCogLayer.d.ts +0 -0
  204. /package/dist/{types → src}/lib/hooks/useCogLayer.d.ts.map +0 -0
  205. /package/dist/{types → src}/lib/hooks/useColorbar.d.ts +0 -0
  206. /package/dist/{types → src}/lib/hooks/useColorbar.d.ts.map +0 -0
  207. /package/dist/{types → src}/lib/hooks/useControlGrid.d.ts +0 -0
  208. /package/dist/{types → src}/lib/hooks/useControlGrid.d.ts.map +0 -0
  209. /package/dist/{types → src}/lib/hooks/useHtmlControl.d.ts +0 -0
  210. /package/dist/{types → src}/lib/hooks/useHtmlControl.d.ts.map +0 -0
  211. /package/dist/{types → src}/lib/hooks/useInspectControl.d.ts +0 -0
  212. /package/dist/{types → src}/lib/hooks/useInspectControl.d.ts.map +0 -0
  213. /package/dist/{types → src}/lib/hooks/useLegend.d.ts +0 -0
  214. /package/dist/{types → src}/lib/hooks/useLegend.d.ts.map +0 -0
  215. /package/dist/{types → src}/lib/hooks/useMinimapControl.d.ts +0 -0
  216. /package/dist/{types → src}/lib/hooks/useMinimapControl.d.ts.map +0 -0
  217. /package/dist/{types → src}/lib/hooks/useSearchControl.d.ts +0 -0
  218. /package/dist/{types → src}/lib/hooks/useSearchControl.d.ts.map +0 -0
  219. /package/dist/{types → src}/lib/hooks/useTerrain.d.ts +0 -0
  220. /package/dist/{types → src}/lib/hooks/useTerrain.d.ts.map +0 -0
  221. /package/dist/{types → src}/lib/hooks/useVectorDataset.d.ts +0 -0
  222. /package/dist/{types → src}/lib/hooks/useVectorDataset.d.ts.map +0 -0
  223. /package/dist/{types → src}/lib/hooks/useViewState.d.ts +0 -0
  224. /package/dist/{types → src}/lib/hooks/useViewState.d.ts.map +0 -0
  225. /package/dist/{types → src}/lib/utils/fileHelpers.d.ts +0 -0
  226. /package/dist/{types → src}/lib/utils/fileHelpers.d.ts.map +0 -0
  227. /package/dist/{types → src}/lib/utils/helpers.d.ts +0 -0
  228. /package/dist/{types → src}/lib/utils/helpers.d.ts.map +0 -0
  229. /package/dist/{types → src}/lib/utils/providers.d.ts +0 -0
  230. /package/dist/{types → src}/lib/utils/providers.d.ts.map +0 -0
  231. /package/dist/{types → src}/react.d.ts +0 -0
  232. /package/dist/{types → src}/react.d.ts.map +0 -0
@@ -0,0 +1,2002 @@
1
+ var U = new Uint8Array([
2
+ 102,
3
+ 103,
4
+ 98,
5
+ 3,
6
+ 102,
7
+ 103,
8
+ 98,
9
+ 0
10
+ ]), O = new Int32Array(2), bt = new Float32Array(O.buffer), ft = new Float64Array(O.buffer), G = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1, et;
11
+ (function(r) {
12
+ r[r.UTF8_BYTES = 1] = "UTF8_BYTES", r[r.UTF16_STRING = 2] = "UTF16_STRING";
13
+ })(et || (et = {}));
14
+ var B = class gt {
15
+ constructor(t) {
16
+ this.bytes_ = t, this.position_ = 0, this.text_decoder_ = new TextDecoder();
17
+ }
18
+ static allocate(t) {
19
+ return new gt(new Uint8Array(t));
20
+ }
21
+ clear() {
22
+ this.position_ = 0;
23
+ }
24
+ bytes() {
25
+ return this.bytes_;
26
+ }
27
+ position() {
28
+ return this.position_;
29
+ }
30
+ setPosition(t) {
31
+ this.position_ = t;
32
+ }
33
+ capacity() {
34
+ return this.bytes_.length;
35
+ }
36
+ readInt8(t) {
37
+ return this.readUint8(t) << 24 >> 24;
38
+ }
39
+ readUint8(t) {
40
+ return this.bytes_[t];
41
+ }
42
+ readInt16(t) {
43
+ return this.readUint16(t) << 16 >> 16;
44
+ }
45
+ readUint16(t) {
46
+ return this.bytes_[t] | this.bytes_[t + 1] << 8;
47
+ }
48
+ readInt32(t) {
49
+ return this.bytes_[t] | this.bytes_[t + 1] << 8 | this.bytes_[t + 2] << 16 | this.bytes_[t + 3] << 24;
50
+ }
51
+ readUint32(t) {
52
+ return this.readInt32(t) >>> 0;
53
+ }
54
+ readInt64(t) {
55
+ return BigInt.asIntN(64, BigInt(this.readUint32(t)) + (BigInt(this.readUint32(t + 4)) << BigInt(32)));
56
+ }
57
+ readUint64(t) {
58
+ return BigInt.asUintN(64, BigInt(this.readUint32(t)) + (BigInt(this.readUint32(t + 4)) << BigInt(32)));
59
+ }
60
+ readFloat32(t) {
61
+ return O[0] = this.readInt32(t), bt[0];
62
+ }
63
+ readFloat64(t) {
64
+ return O[G ? 0 : 1] = this.readInt32(t), O[G ? 1 : 0] = this.readInt32(t + 4), ft[0];
65
+ }
66
+ writeInt8(t, e) {
67
+ this.bytes_[t] = e;
68
+ }
69
+ writeUint8(t, e) {
70
+ this.bytes_[t] = e;
71
+ }
72
+ writeInt16(t, e) {
73
+ this.bytes_[t] = e, this.bytes_[t + 1] = e >> 8;
74
+ }
75
+ writeUint16(t, e) {
76
+ this.bytes_[t] = e, this.bytes_[t + 1] = e >> 8;
77
+ }
78
+ writeInt32(t, e) {
79
+ this.bytes_[t] = e, this.bytes_[t + 1] = e >> 8, this.bytes_[t + 2] = e >> 16, this.bytes_[t + 3] = e >> 24;
80
+ }
81
+ writeUint32(t, e) {
82
+ this.bytes_[t] = e, this.bytes_[t + 1] = e >> 8, this.bytes_[t + 2] = e >> 16, this.bytes_[t + 3] = e >> 24;
83
+ }
84
+ writeInt64(t, e) {
85
+ this.writeInt32(t, Number(BigInt.asIntN(32, e))), this.writeInt32(t + 4, Number(BigInt.asIntN(32, e >> BigInt(32))));
86
+ }
87
+ writeUint64(t, e) {
88
+ this.writeUint32(t, Number(BigInt.asUintN(32, e))), this.writeUint32(t + 4, Number(BigInt.asUintN(32, e >> BigInt(32))));
89
+ }
90
+ writeFloat32(t, e) {
91
+ bt[0] = e, this.writeInt32(t, O[0]);
92
+ }
93
+ writeFloat64(t, e) {
94
+ ft[0] = e, this.writeInt32(t, O[G ? 0 : 1]), this.writeInt32(t + 4, O[G ? 1 : 0]);
95
+ }
96
+ getBufferIdentifier() {
97
+ if (this.bytes_.length < this.position_ + 4 + 4) throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");
98
+ let t = "";
99
+ for (let e = 0; e < 4; e++) t += String.fromCharCode(this.readInt8(this.position_ + 4 + e));
100
+ return t;
101
+ }
102
+ __offset(t, e) {
103
+ const n = t - this.readInt32(t);
104
+ return e < this.readInt16(n) ? this.readInt16(n + e) : 0;
105
+ }
106
+ __union(t, e) {
107
+ return t.bb_pos = e + this.readInt32(e), t.bb = this, t;
108
+ }
109
+ __string(t, e) {
110
+ t += this.readInt32(t);
111
+ const n = this.readInt32(t);
112
+ t += 4;
113
+ const i = this.bytes_.subarray(t, t + n);
114
+ return e === et.UTF8_BYTES ? i : this.text_decoder_.decode(i);
115
+ }
116
+ __union_with_string(t, e) {
117
+ return typeof t == "string" ? this.__string(e) : this.__union(t, e);
118
+ }
119
+ __indirect(t) {
120
+ return t + this.readInt32(t);
121
+ }
122
+ __vector(t) {
123
+ return t + this.readInt32(t) + 4;
124
+ }
125
+ __vector_len(t) {
126
+ return this.readInt32(t + this.readInt32(t));
127
+ }
128
+ __has_identifier(t) {
129
+ if (t.length != 4) throw new Error("FlatBuffers: file identifier must be length 4");
130
+ for (let e = 0; e < 4; e++) if (t.charCodeAt(e) != this.readInt8(this.position() + 4 + e)) return !1;
131
+ return !0;
132
+ }
133
+ createScalarList(t, e) {
134
+ const n = [];
135
+ for (let i = 0; i < e; ++i) {
136
+ const s = t(i);
137
+ s !== null && n.push(s);
138
+ }
139
+ return n;
140
+ }
141
+ createObjList(t, e) {
142
+ const n = [];
143
+ for (let i = 0; i < e; ++i) {
144
+ const s = t(i);
145
+ s !== null && n.push(s.unpack());
146
+ }
147
+ return n;
148
+ }
149
+ }, y, g = ((y = {})[y.Byte = 0] = "Byte", y[y.UByte = 1] = "UByte", y[y.Bool = 2] = "Bool", y[y.Short = 3] = "Short", y[y.UShort = 4] = "UShort", y[y.Int = 5] = "Int", y[y.UInt = 6] = "UInt", y[y.Long = 7] = "Long", y[y.ULong = 8] = "ULong", y[y.Float = 9] = "Float", y[y.Double = 10] = "Double", y[y.String = 11] = "String", y[y.Json = 12] = "Json", y[y.DateTime = 13] = "DateTime", y[y.Binary = 14] = "Binary", y), vt = class m {
150
+ bb = null;
151
+ bb_pos = 0;
152
+ __init(t, e) {
153
+ return this.bb_pos = t, this.bb = e, this;
154
+ }
155
+ static getRootAsColumn(t, e) {
156
+ return (e || new m()).__init(t.readInt32(t.position()) + t.position(), t);
157
+ }
158
+ static getSizePrefixedRootAsColumn(t, e) {
159
+ return t.setPosition(t.position() + 4), (e || new m()).__init(t.readInt32(t.position()) + t.position(), t);
160
+ }
161
+ name(t) {
162
+ let e = this.bb.__offset(this.bb_pos, 4);
163
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
164
+ }
165
+ type() {
166
+ let t = this.bb.__offset(this.bb_pos, 6);
167
+ return t ? this.bb.readUint8(this.bb_pos + t) : g.Byte;
168
+ }
169
+ title(t) {
170
+ let e = this.bb.__offset(this.bb_pos, 8);
171
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
172
+ }
173
+ description(t) {
174
+ let e = this.bb.__offset(this.bb_pos, 10);
175
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
176
+ }
177
+ width() {
178
+ let t = this.bb.__offset(this.bb_pos, 12);
179
+ return t ? this.bb.readInt32(this.bb_pos + t) : -1;
180
+ }
181
+ precision() {
182
+ let t = this.bb.__offset(this.bb_pos, 14);
183
+ return t ? this.bb.readInt32(this.bb_pos + t) : -1;
184
+ }
185
+ scale() {
186
+ let t = this.bb.__offset(this.bb_pos, 16);
187
+ return t ? this.bb.readInt32(this.bb_pos + t) : -1;
188
+ }
189
+ nullable() {
190
+ let t = this.bb.__offset(this.bb_pos, 18);
191
+ return !t || !!this.bb.readInt8(this.bb_pos + t);
192
+ }
193
+ unique() {
194
+ let t = this.bb.__offset(this.bb_pos, 20);
195
+ return !!t && !!this.bb.readInt8(this.bb_pos + t);
196
+ }
197
+ primaryKey() {
198
+ let t = this.bb.__offset(this.bb_pos, 22);
199
+ return !!t && !!this.bb.readInt8(this.bb_pos + t);
200
+ }
201
+ metadata(t) {
202
+ let e = this.bb.__offset(this.bb_pos, 24);
203
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
204
+ }
205
+ static startColumn(t) {
206
+ t.startObject(11);
207
+ }
208
+ static addName(t, e) {
209
+ t.addFieldOffset(0, e, 0);
210
+ }
211
+ static addType(t, e) {
212
+ t.addFieldInt8(1, e, g.Byte);
213
+ }
214
+ static addTitle(t, e) {
215
+ t.addFieldOffset(2, e, 0);
216
+ }
217
+ static addDescription(t, e) {
218
+ t.addFieldOffset(3, e, 0);
219
+ }
220
+ static addWidth(t, e) {
221
+ t.addFieldInt32(4, e, -1);
222
+ }
223
+ static addPrecision(t, e) {
224
+ t.addFieldInt32(5, e, -1);
225
+ }
226
+ static addScale(t, e) {
227
+ t.addFieldInt32(6, e, -1);
228
+ }
229
+ static addNullable(t, e) {
230
+ t.addFieldInt8(7, +e, 1);
231
+ }
232
+ static addUnique(t, e) {
233
+ t.addFieldInt8(8, +e, 0);
234
+ }
235
+ static addPrimaryKey(t, e) {
236
+ t.addFieldInt8(9, +e, 0);
237
+ }
238
+ static addMetadata(t, e) {
239
+ t.addFieldOffset(10, e, 0);
240
+ }
241
+ static endColumn(t) {
242
+ let e = t.endObject();
243
+ return t.requiredField(e, 4), e;
244
+ }
245
+ static createColumn(t, e, n, i, s, o, u, h, a, b, f, l) {
246
+ return m.startColumn(t), m.addName(t, e), m.addType(t, n), m.addTitle(t, i), m.addDescription(t, s), m.addWidth(t, o), m.addPrecision(t, u), m.addScale(t, h), m.addNullable(t, a), m.addUnique(t, b), m.addPrimaryKey(t, f), m.addMetadata(t, l), m.endColumn(t);
247
+ }
248
+ }, _, x = ((_ = {})[_.Unknown = 0] = "Unknown", _[_.Point = 1] = "Point", _[_.LineString = 2] = "LineString", _[_.Polygon = 3] = "Polygon", _[_.MultiPoint = 4] = "MultiPoint", _[_.MultiLineString = 5] = "MultiLineString", _[_.MultiPolygon = 6] = "MultiPolygon", _[_.GeometryCollection = 7] = "GeometryCollection", _[_.CircularString = 8] = "CircularString", _[_.CompoundCurve = 9] = "CompoundCurve", _[_.CurvePolygon = 10] = "CurvePolygon", _[_.MultiCurve = 11] = "MultiCurve", _[_.MultiSurface = 12] = "MultiSurface", _[_.Curve = 13] = "Curve", _[_.Surface = 14] = "Surface", _[_.PolyhedralSurface = 15] = "PolyhedralSurface", _[_.TIN = 16] = "TIN", _[_.Triangle = 17] = "Triangle", _), Ot = class I {
249
+ bb = null;
250
+ bb_pos = 0;
251
+ __init(t, e) {
252
+ return this.bb_pos = t, this.bb = e, this;
253
+ }
254
+ static getRootAsGeometry(t, e) {
255
+ return (e || new I()).__init(t.readInt32(t.position()) + t.position(), t);
256
+ }
257
+ static getSizePrefixedRootAsGeometry(t, e) {
258
+ return t.setPosition(t.position() + 4), (e || new I()).__init(t.readInt32(t.position()) + t.position(), t);
259
+ }
260
+ ends(t) {
261
+ let e = this.bb.__offset(this.bb_pos, 4);
262
+ return e ? this.bb.readUint32(this.bb.__vector(this.bb_pos + e) + 4 * t) : 0;
263
+ }
264
+ endsLength() {
265
+ let t = this.bb.__offset(this.bb_pos, 4);
266
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
267
+ }
268
+ endsArray() {
269
+ let t = this.bb.__offset(this.bb_pos, 4);
270
+ return t ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t), this.bb.__vector_len(this.bb_pos + t)) : null;
271
+ }
272
+ xy(t) {
273
+ let e = this.bb.__offset(this.bb_pos, 6);
274
+ return e ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + e) + 8 * t) : 0;
275
+ }
276
+ xyLength() {
277
+ let t = this.bb.__offset(this.bb_pos, 6);
278
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
279
+ }
280
+ xyArray() {
281
+ let t = this.bb.__offset(this.bb_pos, 6);
282
+ return t ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t), this.bb.__vector_len(this.bb_pos + t)) : null;
283
+ }
284
+ z(t) {
285
+ let e = this.bb.__offset(this.bb_pos, 8);
286
+ return e ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + e) + 8 * t) : 0;
287
+ }
288
+ zLength() {
289
+ let t = this.bb.__offset(this.bb_pos, 8);
290
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
291
+ }
292
+ zArray() {
293
+ let t = this.bb.__offset(this.bb_pos, 8);
294
+ return t ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t), this.bb.__vector_len(this.bb_pos + t)) : null;
295
+ }
296
+ m(t) {
297
+ let e = this.bb.__offset(this.bb_pos, 10);
298
+ return e ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + e) + 8 * t) : 0;
299
+ }
300
+ mLength() {
301
+ let t = this.bb.__offset(this.bb_pos, 10);
302
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
303
+ }
304
+ mArray() {
305
+ let t = this.bb.__offset(this.bb_pos, 10);
306
+ return t ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t), this.bb.__vector_len(this.bb_pos + t)) : null;
307
+ }
308
+ t(t) {
309
+ let e = this.bb.__offset(this.bb_pos, 12);
310
+ return e ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + e) + 8 * t) : 0;
311
+ }
312
+ tLength() {
313
+ let t = this.bb.__offset(this.bb_pos, 12);
314
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
315
+ }
316
+ tArray() {
317
+ let t = this.bb.__offset(this.bb_pos, 12);
318
+ return t ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t), this.bb.__vector_len(this.bb_pos + t)) : null;
319
+ }
320
+ tm(t) {
321
+ let e = this.bb.__offset(this.bb_pos, 14);
322
+ return e ? this.bb.readUint64(this.bb.__vector(this.bb_pos + e) + 8 * t) : BigInt(0);
323
+ }
324
+ tmLength() {
325
+ let t = this.bb.__offset(this.bb_pos, 14);
326
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
327
+ }
328
+ type() {
329
+ let t = this.bb.__offset(this.bb_pos, 16);
330
+ return t ? this.bb.readUint8(this.bb_pos + t) : x.Unknown;
331
+ }
332
+ parts(t, e) {
333
+ let n = this.bb.__offset(this.bb_pos, 18);
334
+ return n ? (e || new I()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + n) + 4 * t), this.bb) : null;
335
+ }
336
+ partsLength() {
337
+ let t = this.bb.__offset(this.bb_pos, 18);
338
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
339
+ }
340
+ static startGeometry(t) {
341
+ t.startObject(8);
342
+ }
343
+ static addEnds(t, e) {
344
+ t.addFieldOffset(0, e, 0);
345
+ }
346
+ static createEndsVector(t, e) {
347
+ t.startVector(4, e.length, 4);
348
+ for (let n = e.length - 1; n >= 0; n--) t.addInt32(e[n]);
349
+ return t.endVector();
350
+ }
351
+ static startEndsVector(t, e) {
352
+ t.startVector(4, e, 4);
353
+ }
354
+ static addXy(t, e) {
355
+ t.addFieldOffset(1, e, 0);
356
+ }
357
+ static createXyVector(t, e) {
358
+ t.startVector(8, e.length, 8);
359
+ for (let n = e.length - 1; n >= 0; n--) t.addFloat64(e[n]);
360
+ return t.endVector();
361
+ }
362
+ static startXyVector(t, e) {
363
+ t.startVector(8, e, 8);
364
+ }
365
+ static addZ(t, e) {
366
+ t.addFieldOffset(2, e, 0);
367
+ }
368
+ static createZVector(t, e) {
369
+ t.startVector(8, e.length, 8);
370
+ for (let n = e.length - 1; n >= 0; n--) t.addFloat64(e[n]);
371
+ return t.endVector();
372
+ }
373
+ static startZVector(t, e) {
374
+ t.startVector(8, e, 8);
375
+ }
376
+ static addM(t, e) {
377
+ t.addFieldOffset(3, e, 0);
378
+ }
379
+ static createMVector(t, e) {
380
+ t.startVector(8, e.length, 8);
381
+ for (let n = e.length - 1; n >= 0; n--) t.addFloat64(e[n]);
382
+ return t.endVector();
383
+ }
384
+ static startMVector(t, e) {
385
+ t.startVector(8, e, 8);
386
+ }
387
+ static addT(t, e) {
388
+ t.addFieldOffset(4, e, 0);
389
+ }
390
+ static createTVector(t, e) {
391
+ t.startVector(8, e.length, 8);
392
+ for (let n = e.length - 1; n >= 0; n--) t.addFloat64(e[n]);
393
+ return t.endVector();
394
+ }
395
+ static startTVector(t, e) {
396
+ t.startVector(8, e, 8);
397
+ }
398
+ static addTm(t, e) {
399
+ t.addFieldOffset(5, e, 0);
400
+ }
401
+ static createTmVector(t, e) {
402
+ t.startVector(8, e.length, 8);
403
+ for (let n = e.length - 1; n >= 0; n--) t.addInt64(e[n]);
404
+ return t.endVector();
405
+ }
406
+ static startTmVector(t, e) {
407
+ t.startVector(8, e, 8);
408
+ }
409
+ static addType(t, e) {
410
+ t.addFieldInt8(6, e, x.Unknown);
411
+ }
412
+ static addParts(t, e) {
413
+ t.addFieldOffset(7, e, 0);
414
+ }
415
+ static createPartsVector(t, e) {
416
+ t.startVector(4, e.length, 4);
417
+ for (let n = e.length - 1; n >= 0; n--) t.addOffset(e[n]);
418
+ return t.endVector();
419
+ }
420
+ static startPartsVector(t, e) {
421
+ t.startVector(4, e, 4);
422
+ }
423
+ static endGeometry(t) {
424
+ return t.endObject();
425
+ }
426
+ static createGeometry(t, e, n, i, s, o, u, h, a) {
427
+ return I.startGeometry(t), I.addEnds(t, e), I.addXy(t, n), I.addZ(t, i), I.addM(t, s), I.addT(t, o), I.addTm(t, u), I.addType(t, h), I.addParts(t, a), I.endGeometry(t);
428
+ }
429
+ }, W = class C {
430
+ bb = null;
431
+ bb_pos = 0;
432
+ __init(t, e) {
433
+ return this.bb_pos = t, this.bb = e, this;
434
+ }
435
+ static getRootAsFeature(t, e) {
436
+ return (e || new C()).__init(t.readInt32(t.position()) + t.position(), t);
437
+ }
438
+ static getSizePrefixedRootAsFeature(t, e) {
439
+ return t.setPosition(t.position() + 4), (e || new C()).__init(t.readInt32(t.position()) + t.position(), t);
440
+ }
441
+ geometry(t) {
442
+ let e = this.bb.__offset(this.bb_pos, 4);
443
+ return e ? (t || new Ot()).__init(this.bb.__indirect(this.bb_pos + e), this.bb) : null;
444
+ }
445
+ properties(t) {
446
+ let e = this.bb.__offset(this.bb_pos, 6);
447
+ return e ? this.bb.readUint8(this.bb.__vector(this.bb_pos + e) + t) : 0;
448
+ }
449
+ propertiesLength() {
450
+ let t = this.bb.__offset(this.bb_pos, 6);
451
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
452
+ }
453
+ propertiesArray() {
454
+ let t = this.bb.__offset(this.bb_pos, 6);
455
+ return t ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t), this.bb.__vector_len(this.bb_pos + t)) : null;
456
+ }
457
+ columns(t, e) {
458
+ let n = this.bb.__offset(this.bb_pos, 8);
459
+ return n ? (e || new vt()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + n) + 4 * t), this.bb) : null;
460
+ }
461
+ columnsLength() {
462
+ let t = this.bb.__offset(this.bb_pos, 8);
463
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
464
+ }
465
+ static startFeature(t) {
466
+ t.startObject(3);
467
+ }
468
+ static addGeometry(t, e) {
469
+ t.addFieldOffset(0, e, 0);
470
+ }
471
+ static addProperties(t, e) {
472
+ t.addFieldOffset(1, e, 0);
473
+ }
474
+ static createPropertiesVector(t, e) {
475
+ t.startVector(1, e.length, 1);
476
+ for (let n = e.length - 1; n >= 0; n--) t.addInt8(e[n]);
477
+ return t.endVector();
478
+ }
479
+ static startPropertiesVector(t, e) {
480
+ t.startVector(1, e, 1);
481
+ }
482
+ static addColumns(t, e) {
483
+ t.addFieldOffset(2, e, 0);
484
+ }
485
+ static createColumnsVector(t, e) {
486
+ t.startVector(4, e.length, 4);
487
+ for (let n = e.length - 1; n >= 0; n--) t.addOffset(e[n]);
488
+ return t.endVector();
489
+ }
490
+ static startColumnsVector(t, e) {
491
+ t.startVector(4, e, 4);
492
+ }
493
+ static endFeature(t) {
494
+ return t.endObject();
495
+ }
496
+ static finishFeatureBuffer(t, e) {
497
+ t.finish(e);
498
+ }
499
+ static finishSizePrefixedFeatureBuffer(t, e) {
500
+ t.finish(e, void 0, !0);
501
+ }
502
+ static createFeature(t, e, n, i) {
503
+ return C.startFeature(t), C.addGeometry(t, e), C.addProperties(t, n), C.addColumns(t, i), C.endFeature(t);
504
+ }
505
+ };
506
+ function Q(r, t) {
507
+ let e = [];
508
+ for (let n = 0; n < r.length; n += 2) {
509
+ let i = [r[n], r[n + 1]];
510
+ t && i.push(t[n >> 1]), e.push(i);
511
+ }
512
+ return e;
513
+ }
514
+ var ie = new TextEncoder(), ct = new TextDecoder();
515
+ function Tt(r, t) {
516
+ let e = {};
517
+ if (!t || t.length === 0) return e;
518
+ let n = r.propertiesArray();
519
+ if (!n) return e;
520
+ let i = new DataView(n.buffer, n.byteOffset), s = r.propertiesLength(), o = 0;
521
+ for (; o < s; ) {
522
+ let u = i.getUint16(o, !0);
523
+ o += 2;
524
+ let h = t[u], a = h.name;
525
+ switch (h.type) {
526
+ case g.Bool:
527
+ e[a] = !!i.getUint8(o), o += 1;
528
+ break;
529
+ case g.Byte:
530
+ e[a] = i.getInt8(o), o += 1;
531
+ break;
532
+ case g.UByte:
533
+ e[a] = i.getUint8(o), o += 1;
534
+ break;
535
+ case g.Short:
536
+ e[a] = i.getInt16(o, !0), o += 2;
537
+ break;
538
+ case g.UShort:
539
+ e[a] = i.getUint16(o, !0), o += 2;
540
+ break;
541
+ case g.Int:
542
+ e[a] = i.getInt32(o, !0), o += 4;
543
+ break;
544
+ case g.UInt:
545
+ e[a] = i.getUint32(o, !0), o += 4;
546
+ break;
547
+ case g.Long:
548
+ e[a] = Number(i.getBigInt64(o, !0)), o += 8;
549
+ break;
550
+ case g.ULong:
551
+ e[a] = Number(i.getBigUint64(o, !0)), o += 8;
552
+ break;
553
+ case g.Float:
554
+ e[a] = i.getFloat32(o, !0), o += 4;
555
+ break;
556
+ case g.Double:
557
+ e[a] = i.getFloat64(o, !0), o += 8;
558
+ break;
559
+ case g.DateTime:
560
+ case g.String: {
561
+ let b = i.getUint32(o, !0);
562
+ o += 4, e[a] = ct.decode(n.subarray(o, o + b)), o += b;
563
+ break;
564
+ }
565
+ case g.Json: {
566
+ let b = i.getUint32(o, !0);
567
+ o += 4;
568
+ let f = ct.decode(n.subarray(o, o + b));
569
+ e[a] = JSON.parse(f), o += b;
570
+ break;
571
+ }
572
+ case g.Binary: {
573
+ let b = i.getUint32(o, !0);
574
+ o += 4, e[a] = n.subarray(o, o + b), o += b;
575
+ break;
576
+ }
577
+ default:
578
+ throw Error(`Unknown type ${h.type}`);
579
+ }
580
+ }
581
+ return e;
582
+ }
583
+ var at = new Uint8Array(0);
584
+ function At() {
585
+ return this._source.cancel();
586
+ }
587
+ function Vt(r, t) {
588
+ if (!r.length) return t;
589
+ if (!t.length) return r;
590
+ var e = new Uint8Array(r.length + t.length);
591
+ return e.set(r), e.set(t, r.length), e;
592
+ }
593
+ function Et() {
594
+ var r = this, t = r._array.subarray(r._index);
595
+ return r._source.read().then(function(e) {
596
+ return r._array = at, r._index = 0, e.done ? t.length > 0 ? {
597
+ done: !1,
598
+ value: t
599
+ } : {
600
+ done: !0,
601
+ value: void 0
602
+ } : {
603
+ done: !1,
604
+ value: Vt(t, e.value)
605
+ };
606
+ });
607
+ }
608
+ function Nt(r) {
609
+ if ((r |= 0) < 0) throw new Error("invalid length");
610
+ var t = this, e = this._array.length - this._index;
611
+ if (this._index + r <= this._array.length) return Promise.resolve(this._array.subarray(this._index, this._index += r));
612
+ var n = new Uint8Array(r);
613
+ return n.set(this._array.subarray(this._index)), (function i() {
614
+ return t._source.read().then(function(s) {
615
+ return s.done ? (t._array = at, t._index = 0, e > 0 ? n.subarray(0, e) : null) : e + s.value.length >= r ? (t._array = s.value, t._index = r - e, n.set(s.value.subarray(0, r - e), e), n) : (n.set(s.value, e), e += s.value.length, i());
616
+ });
617
+ })();
618
+ }
619
+ function Rt(r) {
620
+ return typeof r.slice == "function" ? r : new X(typeof r.read == "function" ? r : r.getReader());
621
+ }
622
+ function X(r) {
623
+ this._source = r, this._array = at, this._index = 0;
624
+ }
625
+ X.prototype.read = Et;
626
+ X.prototype.slice = Nt;
627
+ X.prototype.cancel = At;
628
+ var Lt = class S {
629
+ bb = null;
630
+ bb_pos = 0;
631
+ __init(t, e) {
632
+ return this.bb_pos = t, this.bb = e, this;
633
+ }
634
+ static getRootAsCrs(t, e) {
635
+ return (e || new S()).__init(t.readInt32(t.position()) + t.position(), t);
636
+ }
637
+ static getSizePrefixedRootAsCrs(t, e) {
638
+ return t.setPosition(t.position() + 4), (e || new S()).__init(t.readInt32(t.position()) + t.position(), t);
639
+ }
640
+ org(t) {
641
+ let e = this.bb.__offset(this.bb_pos, 4);
642
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
643
+ }
644
+ code() {
645
+ let t = this.bb.__offset(this.bb_pos, 6);
646
+ return t ? this.bb.readInt32(this.bb_pos + t) : 0;
647
+ }
648
+ name(t) {
649
+ let e = this.bb.__offset(this.bb_pos, 8);
650
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
651
+ }
652
+ description(t) {
653
+ let e = this.bb.__offset(this.bb_pos, 10);
654
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
655
+ }
656
+ wkt(t) {
657
+ let e = this.bb.__offset(this.bb_pos, 12);
658
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
659
+ }
660
+ codeString(t) {
661
+ let e = this.bb.__offset(this.bb_pos, 14);
662
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
663
+ }
664
+ static startCrs(t) {
665
+ t.startObject(6);
666
+ }
667
+ static addOrg(t, e) {
668
+ t.addFieldOffset(0, e, 0);
669
+ }
670
+ static addCode(t, e) {
671
+ t.addFieldInt32(1, e, 0);
672
+ }
673
+ static addName(t, e) {
674
+ t.addFieldOffset(2, e, 0);
675
+ }
676
+ static addDescription(t, e) {
677
+ t.addFieldOffset(3, e, 0);
678
+ }
679
+ static addWkt(t, e) {
680
+ t.addFieldOffset(4, e, 0);
681
+ }
682
+ static addCodeString(t, e) {
683
+ t.addFieldOffset(5, e, 0);
684
+ }
685
+ static endCrs(t) {
686
+ return t.endObject();
687
+ }
688
+ static createCrs(t, e, n, i, s, o, u) {
689
+ return S.startCrs(t), S.addOrg(t, e), S.addCode(t, n), S.addName(t, i), S.addDescription(t, s), S.addWkt(t, o), S.addCodeString(t, u), S.endCrs(t);
690
+ }
691
+ }, kt = class rt {
692
+ bb = null;
693
+ bb_pos = 0;
694
+ __init(t, e) {
695
+ return this.bb_pos = t, this.bb = e, this;
696
+ }
697
+ static getRootAsHeader(t, e) {
698
+ return (e || new rt()).__init(t.readInt32(t.position()) + t.position(), t);
699
+ }
700
+ static getSizePrefixedRootAsHeader(t, e) {
701
+ return t.setPosition(t.position() + 4), (e || new rt()).__init(t.readInt32(t.position()) + t.position(), t);
702
+ }
703
+ name(t) {
704
+ let e = this.bb.__offset(this.bb_pos, 4);
705
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
706
+ }
707
+ envelope(t) {
708
+ let e = this.bb.__offset(this.bb_pos, 6);
709
+ return e ? this.bb.readFloat64(this.bb.__vector(this.bb_pos + e) + 8 * t) : 0;
710
+ }
711
+ envelopeLength() {
712
+ let t = this.bb.__offset(this.bb_pos, 6);
713
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
714
+ }
715
+ envelopeArray() {
716
+ let t = this.bb.__offset(this.bb_pos, 6);
717
+ return t ? new Float64Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + t), this.bb.__vector_len(this.bb_pos + t)) : null;
718
+ }
719
+ geometryType() {
720
+ let t = this.bb.__offset(this.bb_pos, 8);
721
+ return t ? this.bb.readUint8(this.bb_pos + t) : x.Unknown;
722
+ }
723
+ hasZ() {
724
+ let t = this.bb.__offset(this.bb_pos, 10);
725
+ return !!t && !!this.bb.readInt8(this.bb_pos + t);
726
+ }
727
+ hasM() {
728
+ let t = this.bb.__offset(this.bb_pos, 12);
729
+ return !!t && !!this.bb.readInt8(this.bb_pos + t);
730
+ }
731
+ hasT() {
732
+ let t = this.bb.__offset(this.bb_pos, 14);
733
+ return !!t && !!this.bb.readInt8(this.bb_pos + t);
734
+ }
735
+ hasTm() {
736
+ let t = this.bb.__offset(this.bb_pos, 16);
737
+ return !!t && !!this.bb.readInt8(this.bb_pos + t);
738
+ }
739
+ columns(t, e) {
740
+ let n = this.bb.__offset(this.bb_pos, 18);
741
+ return n ? (e || new vt()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + n) + 4 * t), this.bb) : null;
742
+ }
743
+ columnsLength() {
744
+ let t = this.bb.__offset(this.bb_pos, 18);
745
+ return t ? this.bb.__vector_len(this.bb_pos + t) : 0;
746
+ }
747
+ featuresCount() {
748
+ let t = this.bb.__offset(this.bb_pos, 20);
749
+ return t ? this.bb.readUint64(this.bb_pos + t) : BigInt("0");
750
+ }
751
+ indexNodeSize() {
752
+ let t = this.bb.__offset(this.bb_pos, 22);
753
+ return t ? this.bb.readUint16(this.bb_pos + t) : 16;
754
+ }
755
+ crs(t) {
756
+ let e = this.bb.__offset(this.bb_pos, 24);
757
+ return e ? (t || new Lt()).__init(this.bb.__indirect(this.bb_pos + e), this.bb) : null;
758
+ }
759
+ title(t) {
760
+ let e = this.bb.__offset(this.bb_pos, 26);
761
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
762
+ }
763
+ description(t) {
764
+ let e = this.bb.__offset(this.bb_pos, 28);
765
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
766
+ }
767
+ metadata(t) {
768
+ let e = this.bb.__offset(this.bb_pos, 30);
769
+ return e ? this.bb.__string(this.bb_pos + e, t) : null;
770
+ }
771
+ static startHeader(t) {
772
+ t.startObject(14);
773
+ }
774
+ static addName(t, e) {
775
+ t.addFieldOffset(0, e, 0);
776
+ }
777
+ static addEnvelope(t, e) {
778
+ t.addFieldOffset(1, e, 0);
779
+ }
780
+ static createEnvelopeVector(t, e) {
781
+ t.startVector(8, e.length, 8);
782
+ for (let n = e.length - 1; n >= 0; n--) t.addFloat64(e[n]);
783
+ return t.endVector();
784
+ }
785
+ static startEnvelopeVector(t, e) {
786
+ t.startVector(8, e, 8);
787
+ }
788
+ static addGeometryType(t, e) {
789
+ t.addFieldInt8(2, e, x.Unknown);
790
+ }
791
+ static addHasZ(t, e) {
792
+ t.addFieldInt8(3, +e, 0);
793
+ }
794
+ static addHasM(t, e) {
795
+ t.addFieldInt8(4, +e, 0);
796
+ }
797
+ static addHasT(t, e) {
798
+ t.addFieldInt8(5, +e, 0);
799
+ }
800
+ static addHasTm(t, e) {
801
+ t.addFieldInt8(6, +e, 0);
802
+ }
803
+ static addColumns(t, e) {
804
+ t.addFieldOffset(7, e, 0);
805
+ }
806
+ static createColumnsVector(t, e) {
807
+ t.startVector(4, e.length, 4);
808
+ for (let n = e.length - 1; n >= 0; n--) t.addOffset(e[n]);
809
+ return t.endVector();
810
+ }
811
+ static startColumnsVector(t, e) {
812
+ t.startVector(4, e, 4);
813
+ }
814
+ static addFeaturesCount(t, e) {
815
+ t.addFieldInt64(8, e, BigInt("0"));
816
+ }
817
+ static addIndexNodeSize(t, e) {
818
+ t.addFieldInt16(9, e, 16);
819
+ }
820
+ static addCrs(t, e) {
821
+ t.addFieldOffset(10, e, 0);
822
+ }
823
+ static addTitle(t, e) {
824
+ t.addFieldOffset(11, e, 0);
825
+ }
826
+ static addDescription(t, e) {
827
+ t.addFieldOffset(12, e, 0);
828
+ }
829
+ static addMetadata(t, e) {
830
+ t.addFieldOffset(13, e, 0);
831
+ }
832
+ static endHeader(t) {
833
+ return t.endObject();
834
+ }
835
+ static finishHeaderBuffer(t, e) {
836
+ t.finish(e);
837
+ }
838
+ static finishSizePrefixedHeaderBuffer(t, e) {
839
+ t.finish(e, void 0, !0);
840
+ }
841
+ };
842
+ function Z(r) {
843
+ let t = kt.getSizePrefixedRootAsHeader(r), e = t.featuresCount(), n = t.indexNodeSize(), i = [];
844
+ for (let u = 0; u < t.columnsLength(); u++) {
845
+ let h = t.columns(u);
846
+ if (!h) throw Error("Column unexpectedly missing");
847
+ if (!h.name()) throw Error("Column name unexpectedly missing");
848
+ i.push({
849
+ name: h.name(),
850
+ type: h.type(),
851
+ title: h.title(),
852
+ description: h.description(),
853
+ width: h.width(),
854
+ precision: h.precision(),
855
+ scale: h.scale(),
856
+ nullable: h.nullable(),
857
+ unique: h.unique(),
858
+ primary_key: h.primaryKey()
859
+ });
860
+ }
861
+ let s = t.crs(), o = s ? {
862
+ org: s.org(),
863
+ code: s.code(),
864
+ name: s.name(),
865
+ description: s.description(),
866
+ wkt: s.wkt(),
867
+ code_string: s.codeString()
868
+ } : null;
869
+ return {
870
+ geometryType: t.geometryType(),
871
+ columns: i,
872
+ envelope: t.envelopeLength() > 0 ? t.envelopeArray() : null,
873
+ featuresCount: Number(e),
874
+ indexNodeSize: n,
875
+ crs: o,
876
+ title: t.title(),
877
+ description: t.description(),
878
+ metadata: t.metadata()
879
+ };
880
+ }
881
+ var wt = class mt {
882
+ static global = new mt();
883
+ _extraRequestThreshold = 262144;
884
+ extraRequestThreshold() {
885
+ return this._extraRequestThreshold;
886
+ }
887
+ setExtraRequestThreshold(t) {
888
+ if (t < 0) throw Error("extraRequestThreshold cannot be negative");
889
+ this._extraRequestThreshold = t;
890
+ }
891
+ };
892
+ function Y(r, t) {
893
+ t = Math.min(Math.max(+t, 2), 65535);
894
+ let e = r, n = e;
895
+ do
896
+ n += e = Math.ceil(e / t);
897
+ while (e !== 1);
898
+ return 40 * n;
899
+ }
900
+ function zt(r, t) {
901
+ if (t < 2) throw Error("Node size must be at least 2");
902
+ if (r === 0) throw Error("Number of items must be greater than 0");
903
+ let e = r, n = e, i = [e];
904
+ do
905
+ n += e = Math.ceil(e / t), i.push(e);
906
+ while (e !== 1);
907
+ let s = [];
908
+ for (let u of (e = n, i)) s.push(e - u), e -= u;
909
+ let o = [];
910
+ for (let u = 0; u < i.length; u++) o.push([s[u], s[u] + i[u]]);
911
+ return o;
912
+ }
913
+ async function* xt(r, t, e, n) {
914
+ class i {
915
+ _level;
916
+ nodes;
917
+ constructor(c, d) {
918
+ this._level = d, this.nodes = c;
919
+ }
920
+ level() {
921
+ return this._level;
922
+ }
923
+ startNodeIdx() {
924
+ return this.nodes[0];
925
+ }
926
+ endNodeIdx() {
927
+ return this.nodes[1];
928
+ }
929
+ extendEndNodeIdx(c) {
930
+ this.nodes[1] = c;
931
+ }
932
+ toString() {
933
+ return `[NodeRange level: ${this._level}, nodes: ${this.nodes[0]}-${this.nodes[1]}]`;
934
+ }
935
+ }
936
+ let { minX: s, minY: o, maxX: u, maxY: h } = e, a = zt(r, t), b = a[0][0], f = [new i([0, 1], a.length - 1)];
937
+ for (; f.length !== 0; ) {
938
+ let l = f.shift(), c = l.startNodeIdx(), d = c >= b, p = (() => {
939
+ let [, F] = a[l.level()], w = Math.min(l.endNodeIdx() + t, F);
940
+ return d && w < F ? w + 1 : w;
941
+ })(), v = p - c, P = new DataView(await n(40 * c, 40 * v));
942
+ for (let F = c; F < p; F++) {
943
+ let w = F - c, z = 40 * w;
944
+ if (u < P.getFloat64(z + 0, !0) || h < P.getFloat64(z + 8, !0) || s > P.getFloat64(z + 16, !0) || o > P.getFloat64(z + 24, !0)) continue;
945
+ let E = P.getBigUint64(z + 32, !0);
946
+ if (d) {
947
+ let K = (() => {
948
+ if (F < r - 1) {
949
+ let Ct = (w + 1) * 40;
950
+ return P.getBigUint64(Ct + 32, !0) - E;
951
+ }
952
+ return null;
953
+ })(), Bt = F - b;
954
+ yield [
955
+ Number(E),
956
+ Bt,
957
+ Number(K)
958
+ ];
959
+ continue;
960
+ }
961
+ let St = wt.global.extraRequestThreshold() / 40, N = f[f.length - 1];
962
+ if (N !== void 0 && N.level() === l.level() - 1 && E < N.endNodeIdx() + St) {
963
+ N.extendEndNodeIdx(Number(E));
964
+ continue;
965
+ }
966
+ let ht = (() => {
967
+ let K = l.level() - 1;
968
+ return new i([Number(E), Number(E) + 1], K);
969
+ })();
970
+ N !== void 0 && (N.level(), ht.level()), f.push(ht);
971
+ }
972
+ }
973
+ }
974
+ var Mt = class It {
975
+ bytes;
976
+ header;
977
+ headerLength;
978
+ indexLength;
979
+ constructor(t, e, n, i) {
980
+ this.bytes = t, this.header = e, this.headerLength = n, this.indexLength = i;
981
+ }
982
+ static open(t) {
983
+ if (!t.subarray(0, 3).every((s, o) => U[o] === s)) throw Error("Not a FlatGeobuf file");
984
+ let e = new DataView(t.buffer).getUint32(U.length, !0);
985
+ if (e > 10485760 || e < 8) throw Error("Invalid header size");
986
+ let n = t.subarray(U.length, U.length + 4 + e), i = Z(new B(n));
987
+ return new It(t, i, e, Y(i.featuresCount, i.indexNodeSize));
988
+ }
989
+ async *selectBbox(t) {
990
+ let e = this.lengthBeforeTree(), n = async (i, s) => {
991
+ let o = e + i;
992
+ return this.bytes.slice(o, o + s).buffer;
993
+ };
994
+ for await (let i of xt(this.header.featuresCount, this.header.indexNodeSize, t, n)) {
995
+ let [s, o] = i;
996
+ yield {
997
+ id: o,
998
+ feature: this.readFeature(s)
999
+ };
1000
+ }
1001
+ }
1002
+ lengthBeforeTree() {
1003
+ return U.length + 4 + this.headerLength;
1004
+ }
1005
+ lengthBeforeFeatures() {
1006
+ return this.lengthBeforeTree() + this.indexLength;
1007
+ }
1008
+ readFeature(t) {
1009
+ let e = t + this.lengthBeforeFeatures(), n = new DataView(this.bytes.buffer).getUint32(e, !0), i = this.bytes.subarray(e + 4, e + 4 + n), s = new Uint8Array(n + 4);
1010
+ s.set(i, 4);
1011
+ let o = new B(s);
1012
+ return W.getSizePrefixedRootAsFeature(o);
1013
+ }
1014
+ }, nt = function(r, t) {
1015
+ return nt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
1016
+ e.__proto__ = n;
1017
+ } || function(e, n) {
1018
+ for (var i in n) n.hasOwnProperty(i) && (e[i] = n[i]);
1019
+ }, nt(r, t);
1020
+ };
1021
+ function qt(r, t) {
1022
+ nt(r, t);
1023
+ function e() {
1024
+ this.constructor = r;
1025
+ }
1026
+ r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
1027
+ }
1028
+ function L(r, t, e, n) {
1029
+ function i(s) {
1030
+ return s instanceof e ? s : new e(function(o) {
1031
+ o(s);
1032
+ });
1033
+ }
1034
+ return new (e || (e = Promise))(function(s, o) {
1035
+ function u(b) {
1036
+ try {
1037
+ a(n.next(b));
1038
+ } catch (f) {
1039
+ o(f);
1040
+ }
1041
+ }
1042
+ function h(b) {
1043
+ try {
1044
+ a(n.throw(b));
1045
+ } catch (f) {
1046
+ o(f);
1047
+ }
1048
+ }
1049
+ function a(b) {
1050
+ b.done ? s(b.value) : i(b.value).then(u, h);
1051
+ }
1052
+ a((n = n.apply(r, t || [])).next());
1053
+ });
1054
+ }
1055
+ function T(r, t) {
1056
+ var e = {
1057
+ label: 0,
1058
+ sent: function() {
1059
+ if (s[0] & 1) throw s[1];
1060
+ return s[1];
1061
+ },
1062
+ trys: [],
1063
+ ops: []
1064
+ }, n, i, s, o;
1065
+ return o = {
1066
+ next: u(0),
1067
+ throw: u(1),
1068
+ return: u(2)
1069
+ }, typeof Symbol == "function" && (o[Symbol.iterator] = function() {
1070
+ return this;
1071
+ }), o;
1072
+ function u(a) {
1073
+ return function(b) {
1074
+ return h([a, b]);
1075
+ };
1076
+ }
1077
+ function h(a) {
1078
+ if (n) throw new TypeError("Generator is already executing.");
1079
+ for (; e; ) try {
1080
+ if (n = 1, i && (s = a[0] & 2 ? i.return : a[0] ? i.throw || ((s = i.return) && s.call(i), 0) : i.next) && !(s = s.call(i, a[1])).done) return s;
1081
+ switch (i = 0, s && (a = [a[0] & 2, s.value]), a[0]) {
1082
+ case 0:
1083
+ case 1:
1084
+ s = a;
1085
+ break;
1086
+ case 4:
1087
+ return e.label++, {
1088
+ value: a[1],
1089
+ done: !1
1090
+ };
1091
+ case 5:
1092
+ e.label++, i = a[1], a = [0];
1093
+ continue;
1094
+ case 7:
1095
+ a = e.ops.pop(), e.trys.pop();
1096
+ continue;
1097
+ default:
1098
+ if (s = e.trys, !(s = s.length > 0 && s[s.length - 1]) && (a[0] === 6 || a[0] === 2)) {
1099
+ e = 0;
1100
+ continue;
1101
+ }
1102
+ if (a[0] === 3 && (!s || a[1] > s[0] && a[1] < s[3])) {
1103
+ e.label = a[1];
1104
+ break;
1105
+ }
1106
+ if (a[0] === 6 && e.label < s[1]) {
1107
+ e.label = s[1], s = a;
1108
+ break;
1109
+ }
1110
+ if (s && e.label < s[2]) {
1111
+ e.label = s[2], e.ops.push(a);
1112
+ break;
1113
+ }
1114
+ s[2] && e.ops.pop(), e.trys.pop();
1115
+ continue;
1116
+ }
1117
+ a = t.call(r, e);
1118
+ } catch (b) {
1119
+ a = [6, b], i = 0;
1120
+ } finally {
1121
+ n = s = 0;
1122
+ }
1123
+ if (a[0] & 5) throw a[1];
1124
+ return {
1125
+ value: a[0] ? a[1] : void 0,
1126
+ done: !0
1127
+ };
1128
+ }
1129
+ }
1130
+ function k(r) {
1131
+ var t = typeof Symbol == "function" && Symbol.iterator, e = t && r[t], n = 0;
1132
+ if (e) return e.call(r);
1133
+ if (r && typeof r.length == "number") return { next: function() {
1134
+ return r && n >= r.length && (r = void 0), {
1135
+ value: r && r[n++],
1136
+ done: !r
1137
+ };
1138
+ } };
1139
+ throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
1140
+ }
1141
+ function q(r) {
1142
+ return this instanceof q ? (this.v = r, this) : new q(r);
1143
+ }
1144
+ function jt(r, t, e) {
1145
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
1146
+ var n = e.apply(r, t || []), i, s = [];
1147
+ return i = {}, o("next"), o("throw"), o("return"), i[Symbol.asyncIterator] = function() {
1148
+ return this;
1149
+ }, i;
1150
+ function o(l) {
1151
+ n[l] && (i[l] = function(c) {
1152
+ return new Promise(function(d, p) {
1153
+ s.push([
1154
+ l,
1155
+ c,
1156
+ d,
1157
+ p
1158
+ ]) > 1 || u(l, c);
1159
+ });
1160
+ });
1161
+ }
1162
+ function u(l, c) {
1163
+ try {
1164
+ h(n[l](c));
1165
+ } catch (d) {
1166
+ f(s[0][3], d);
1167
+ }
1168
+ }
1169
+ function h(l) {
1170
+ l.value instanceof q ? Promise.resolve(l.value.v).then(a, b) : f(s[0][2], l);
1171
+ }
1172
+ function a(l) {
1173
+ u("next", l);
1174
+ }
1175
+ function b(l) {
1176
+ u("throw", l);
1177
+ }
1178
+ function f(l, c) {
1179
+ l(c), s.shift(), s.length && u(s[0][0], s[0][1]);
1180
+ }
1181
+ }
1182
+ var Ft = (function(r) {
1183
+ qt(t, r);
1184
+ function t(e) {
1185
+ var n = r.call(this, e) || this;
1186
+ return Object.defineProperty(n, "name", {
1187
+ value: "RepeaterOverflowError",
1188
+ enumerable: !1
1189
+ }), typeof Object.setPrototypeOf == "function" ? Object.setPrototypeOf(n, n.constructor.prototype) : n.__proto__ = n.constructor.prototype, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(n, n.constructor), n;
1190
+ }
1191
+ return t;
1192
+ })(Error), se = (function() {
1193
+ function r(t) {
1194
+ if (t < 0) throw new RangeError("Capacity may not be less than 0");
1195
+ this._c = t, this._q = [];
1196
+ }
1197
+ return Object.defineProperty(r.prototype, "empty", {
1198
+ get: function() {
1199
+ return this._q.length === 0;
1200
+ },
1201
+ enumerable: !1,
1202
+ configurable: !0
1203
+ }), Object.defineProperty(r.prototype, "full", {
1204
+ get: function() {
1205
+ return this._q.length >= this._c;
1206
+ },
1207
+ enumerable: !1,
1208
+ configurable: !0
1209
+ }), r.prototype.add = function(t) {
1210
+ if (this.full) throw new Error("Buffer full");
1211
+ this._q.push(t);
1212
+ }, r.prototype.remove = function() {
1213
+ if (this.empty) throw new Error("Buffer empty");
1214
+ return this._q.shift();
1215
+ }, r;
1216
+ })(), oe = (function() {
1217
+ function r(t) {
1218
+ if (t < 1) throw new RangeError("Capacity may not be less than 1");
1219
+ this._c = t, this._q = [];
1220
+ }
1221
+ return Object.defineProperty(r.prototype, "empty", {
1222
+ get: function() {
1223
+ return this._q.length === 0;
1224
+ },
1225
+ enumerable: !1,
1226
+ configurable: !0
1227
+ }), Object.defineProperty(r.prototype, "full", {
1228
+ get: function() {
1229
+ return !1;
1230
+ },
1231
+ enumerable: !1,
1232
+ configurable: !0
1233
+ }), r.prototype.add = function(t) {
1234
+ for (; this._q.length >= this._c; ) this._q.shift();
1235
+ this._q.push(t);
1236
+ }, r.prototype.remove = function() {
1237
+ if (this.empty) throw new Error("Buffer empty");
1238
+ return this._q.shift();
1239
+ }, r;
1240
+ })(), ae = (function() {
1241
+ function r(t) {
1242
+ if (t < 1) throw new RangeError("Capacity may not be less than 1");
1243
+ this._c = t, this._q = [];
1244
+ }
1245
+ return Object.defineProperty(r.prototype, "empty", {
1246
+ get: function() {
1247
+ return this._q.length === 0;
1248
+ },
1249
+ enumerable: !1,
1250
+ configurable: !0
1251
+ }), Object.defineProperty(r.prototype, "full", {
1252
+ get: function() {
1253
+ return !1;
1254
+ },
1255
+ enumerable: !1,
1256
+ configurable: !0
1257
+ }), r.prototype.add = function(t) {
1258
+ this._q.length < this._c && this._q.push(t);
1259
+ }, r.prototype.remove = function() {
1260
+ if (this.empty) throw new Error("Buffer empty");
1261
+ return this._q.shift();
1262
+ }, r;
1263
+ })();
1264
+ function it(r) {
1265
+ r != null && typeof r.then == "function" && r.then($, $);
1266
+ }
1267
+ var tt = 0, dt = 1, V = 2, H = 3, st = 4, Ut = 1024, $ = function() {
1268
+ };
1269
+ function R(r) {
1270
+ var t = r.err, e = Promise.resolve(r.execution).then(function(n) {
1271
+ if (t != null) throw t;
1272
+ return n;
1273
+ });
1274
+ return r.err = void 0, r.execution = e.then(function() {
1275
+ }, function() {
1276
+ }), r.pending === void 0 ? e : r.pending.then(function() {
1277
+ return e;
1278
+ });
1279
+ }
1280
+ function A(r, t) {
1281
+ var e = r.state >= H;
1282
+ return Promise.resolve(t).then(function(n) {
1283
+ return !e && r.state >= st ? R(r).then(function(i) {
1284
+ return {
1285
+ value: i,
1286
+ done: !0
1287
+ };
1288
+ }) : {
1289
+ value: n,
1290
+ done: e
1291
+ };
1292
+ });
1293
+ }
1294
+ function ut(r, t) {
1295
+ var e, n;
1296
+ if (!(r.state >= V))
1297
+ if (r.state = V, r.onnext(), r.onstop(), r.err == null && (r.err = t), r.pushes.length === 0 && (typeof r.buffer > "u" || r.buffer.empty)) M(r);
1298
+ else try {
1299
+ for (var i = k(r.pushes), s = i.next(); !s.done; s = i.next()) s.value.resolve();
1300
+ } catch (o) {
1301
+ e = { error: o };
1302
+ } finally {
1303
+ try {
1304
+ s && !s.done && (n = i.return) && n.call(i);
1305
+ } finally {
1306
+ if (e) throw e.error;
1307
+ }
1308
+ }
1309
+ }
1310
+ function M(r) {
1311
+ var t, e;
1312
+ if (!(r.state >= H)) {
1313
+ r.state < V && ut(r), r.state = H, r.buffer = void 0;
1314
+ try {
1315
+ for (var n = k(r.nexts), i = n.next(); !i.done; i = n.next()) {
1316
+ var s = i.value, o = r.pending === void 0 ? R(r) : r.pending.then(function() {
1317
+ return R(r);
1318
+ });
1319
+ s.resolve(A(r, o));
1320
+ }
1321
+ } catch (u) {
1322
+ t = { error: u };
1323
+ } finally {
1324
+ try {
1325
+ i && !i.done && (e = n.return) && e.call(n);
1326
+ } finally {
1327
+ if (t) throw t.error;
1328
+ }
1329
+ }
1330
+ r.pushes = [], r.nexts = [];
1331
+ }
1332
+ }
1333
+ function _t(r) {
1334
+ r.state >= st || (r.state < H && M(r), r.state = st);
1335
+ }
1336
+ function Gt(r, t) {
1337
+ if (it(t), r.pushes.length >= 1024) throw new Ft("No more than " + Ut + " pending calls to push are allowed on a single repeater.");
1338
+ if (r.state >= V) return Promise.resolve(void 0);
1339
+ var e = r.pending === void 0 ? Promise.resolve(t) : r.pending.then(function() {
1340
+ return t;
1341
+ });
1342
+ e = e.catch(function(u) {
1343
+ r.state < V && (r.err = u), _t(r);
1344
+ });
1345
+ var n;
1346
+ r.nexts.length ? (r.nexts.shift().resolve(A(r, e)), r.nexts.length ? n = Promise.resolve(r.nexts[0].value) : typeof r.buffer < "u" && !r.buffer.full ? n = Promise.resolve(void 0) : n = new Promise(function(u) {
1347
+ return r.onnext = u;
1348
+ })) : typeof r.buffer < "u" && !r.buffer.full ? (r.buffer.add(e), n = Promise.resolve(void 0)) : n = new Promise(function(u) {
1349
+ return r.pushes.push({
1350
+ resolve: u,
1351
+ value: e
1352
+ });
1353
+ });
1354
+ var i = !0, s = {}, o = n.catch(function(u) {
1355
+ if (i) throw u;
1356
+ });
1357
+ return s.then = function(u, h) {
1358
+ return i = !1, Promise.prototype.then.call(n, u, h);
1359
+ }, s.catch = function(u) {
1360
+ return i = !1, Promise.prototype.catch.call(n, u);
1361
+ }, s.finally = n.finally.bind(n), r.pending = e.then(function() {
1362
+ return o;
1363
+ }).catch(function(u) {
1364
+ r.err = u, _t(r);
1365
+ }), s;
1366
+ }
1367
+ function Dt(r) {
1368
+ var t = ut.bind(null, r), e = new Promise(function(n) {
1369
+ return r.onstop = n;
1370
+ });
1371
+ return t.then = e.then.bind(e), t.catch = e.catch.bind(e), t.finally = e.finally.bind(e), t;
1372
+ }
1373
+ function Ht(r) {
1374
+ if (!(r.state >= dt)) {
1375
+ r.state = dt;
1376
+ var t = Gt.bind(null, r), e = Dt(r);
1377
+ r.execution = new Promise(function(n) {
1378
+ return n(r.executor(t, e));
1379
+ }), r.execution.catch(function() {
1380
+ return ut(r);
1381
+ });
1382
+ }
1383
+ }
1384
+ var D = /* @__PURE__ */ new WeakMap(), j = (function() {
1385
+ function r(t, e) {
1386
+ D.set(this, {
1387
+ executor: t,
1388
+ buffer: e,
1389
+ err: void 0,
1390
+ state: tt,
1391
+ pushes: [],
1392
+ nexts: [],
1393
+ pending: void 0,
1394
+ execution: void 0,
1395
+ onnext: $,
1396
+ onstop: $
1397
+ });
1398
+ }
1399
+ return r.prototype.next = function(t) {
1400
+ it(t);
1401
+ var e = D.get(this);
1402
+ if (e === void 0) throw new Error("WeakMap error");
1403
+ if (e.nexts.length >= 1024) throw new Ft("No more than " + Ut + " pending calls to next are allowed on a single repeater.");
1404
+ if (e.state <= tt && Ht(e), e.onnext(t), typeof e.buffer < "u" && !e.buffer.empty) {
1405
+ var n = A(e, e.buffer.remove());
1406
+ if (e.pushes.length) {
1407
+ var i = e.pushes.shift();
1408
+ e.buffer.add(i.value), e.onnext = i.resolve;
1409
+ }
1410
+ return n;
1411
+ } else if (e.pushes.length) {
1412
+ var s = e.pushes.shift();
1413
+ return e.onnext = s.resolve, A(e, s.value);
1414
+ } else if (e.state >= V)
1415
+ return M(e), A(e, R(e));
1416
+ return new Promise(function(o) {
1417
+ return e.nexts.push({
1418
+ resolve: o,
1419
+ value: t
1420
+ });
1421
+ });
1422
+ }, r.prototype.return = function(t) {
1423
+ it(t);
1424
+ var e = D.get(this);
1425
+ if (e === void 0) throw new Error("WeakMap error");
1426
+ return M(e), e.execution = Promise.resolve(e.execution).then(function() {
1427
+ return t;
1428
+ }), A(e, R(e));
1429
+ }, r.prototype.throw = function(t) {
1430
+ var e = D.get(this);
1431
+ if (e === void 0) throw new Error("WeakMap error");
1432
+ return e.state <= tt || e.state >= V || typeof e.buffer < "u" && !e.buffer.empty ? (M(e), e.err == null && (e.err = t), A(e, R(e))) : this.next(Promise.reject(t));
1433
+ }, r.prototype[Symbol.asyncIterator] = function() {
1434
+ return this;
1435
+ }, r.race = $t, r.merge = Wt, r.zip = Xt, r.latest = Zt, r;
1436
+ })();
1437
+ function J(r, t) {
1438
+ var e, n, i = [], s = function(a) {
1439
+ a != null && typeof a[Symbol.asyncIterator] == "function" ? i.push(a[Symbol.asyncIterator]()) : a != null && typeof a[Symbol.iterator] == "function" ? i.push(a[Symbol.iterator]()) : i.push((function() {
1440
+ return jt(this, arguments, function() {
1441
+ return T(this, function(l) {
1442
+ switch (l.label) {
1443
+ case 0:
1444
+ return t.yieldValues ? [4, q(a)] : [3, 3];
1445
+ case 1:
1446
+ return [4, l.sent()];
1447
+ case 2:
1448
+ l.sent(), l.label = 3;
1449
+ case 3:
1450
+ return t.returnValues ? [4, q(a)] : [3, 5];
1451
+ case 4:
1452
+ return [2, l.sent()];
1453
+ case 5:
1454
+ return [2];
1455
+ }
1456
+ });
1457
+ });
1458
+ })());
1459
+ };
1460
+ try {
1461
+ for (var o = k(r), u = o.next(); !u.done; u = o.next()) {
1462
+ var h = u.value;
1463
+ s(h);
1464
+ }
1465
+ } catch (a) {
1466
+ e = { error: a };
1467
+ } finally {
1468
+ try {
1469
+ u && !u.done && (n = o.return) && n.call(o);
1470
+ } finally {
1471
+ if (e) throw e.error;
1472
+ }
1473
+ }
1474
+ return i;
1475
+ }
1476
+ function $t(r) {
1477
+ var t = this, e = J(r, { returnValues: !0 });
1478
+ return new j(function(n, i) {
1479
+ return L(t, void 0, void 0, function() {
1480
+ var s, o, u, h, a, b;
1481
+ return T(this, function(f) {
1482
+ switch (f.label) {
1483
+ case 0:
1484
+ if (!e.length)
1485
+ return i(), [2];
1486
+ o = !1, i.then(function() {
1487
+ s(), o = !0;
1488
+ }), f.label = 1;
1489
+ case 1:
1490
+ f.trys.push([
1491
+ 1,
1492
+ ,
1493
+ 5,
1494
+ 7
1495
+ ]), h = void 0, a = 0, b = function() {
1496
+ var l, c, d, p, v, P;
1497
+ return T(this, function(F) {
1498
+ switch (F.label) {
1499
+ case 0:
1500
+ l = a;
1501
+ try {
1502
+ for (c = (v = void 0, k(e)), d = c.next(); !d.done; d = c.next())
1503
+ p = d.value, Promise.resolve(p.next()).then(function(w) {
1504
+ w.done ? (i(), u === void 0 && (u = w)) : a === l && (a++, s(w));
1505
+ }, function(w) {
1506
+ return i(w);
1507
+ });
1508
+ } catch (w) {
1509
+ v = { error: w };
1510
+ } finally {
1511
+ try {
1512
+ d && !d.done && (P = c.return) && P.call(c);
1513
+ } finally {
1514
+ if (v) throw v.error;
1515
+ }
1516
+ }
1517
+ return [4, new Promise(function(w) {
1518
+ return s = w;
1519
+ })];
1520
+ case 1:
1521
+ return h = F.sent(), h === void 0 ? [3, 3] : [4, n(h.value)];
1522
+ case 2:
1523
+ F.sent(), F.label = 3;
1524
+ case 3:
1525
+ return [2];
1526
+ }
1527
+ });
1528
+ }, f.label = 2;
1529
+ case 2:
1530
+ return o ? [3, 4] : [5, b()];
1531
+ case 3:
1532
+ return f.sent(), [3, 2];
1533
+ case 4:
1534
+ return [2, u && u.value];
1535
+ case 5:
1536
+ return i(), [4, Promise.race(e.map(function(l) {
1537
+ return l.return && l.return();
1538
+ }))];
1539
+ case 6:
1540
+ return f.sent(), [7];
1541
+ case 7:
1542
+ return [2];
1543
+ }
1544
+ });
1545
+ });
1546
+ });
1547
+ }
1548
+ function Wt(r) {
1549
+ var t = this, e = J(r, { yieldValues: !0 });
1550
+ return new j(function(n, i) {
1551
+ return L(t, void 0, void 0, function() {
1552
+ var s, o, u, h = this;
1553
+ return T(this, function(a) {
1554
+ switch (a.label) {
1555
+ case 0:
1556
+ if (!e.length)
1557
+ return i(), [2];
1558
+ s = [], o = !1, i.then(function() {
1559
+ var b, f;
1560
+ o = !0;
1561
+ try {
1562
+ for (var l = k(s), c = l.next(); !c.done; c = l.next()) {
1563
+ var d = c.value;
1564
+ d();
1565
+ }
1566
+ } catch (p) {
1567
+ b = { error: p };
1568
+ } finally {
1569
+ try {
1570
+ c && !c.done && (f = l.return) && f.call(l);
1571
+ } finally {
1572
+ if (b) throw b.error;
1573
+ }
1574
+ }
1575
+ }), a.label = 1;
1576
+ case 1:
1577
+ return a.trys.push([
1578
+ 1,
1579
+ ,
1580
+ 3,
1581
+ 4
1582
+ ]), [4, Promise.all(e.map(function(b, f) {
1583
+ return L(h, void 0, void 0, function() {
1584
+ var l, c;
1585
+ return T(this, function(d) {
1586
+ switch (d.label) {
1587
+ case 0:
1588
+ d.trys.push([
1589
+ 0,
1590
+ ,
1591
+ 6,
1592
+ 9
1593
+ ]), d.label = 1;
1594
+ case 1:
1595
+ return o ? [3, 5] : (Promise.resolve(b.next()).then(function(p) {
1596
+ return s[f](p);
1597
+ }, function(p) {
1598
+ return i(p);
1599
+ }), [4, new Promise(function(p) {
1600
+ s[f] = p;
1601
+ })]);
1602
+ case 2:
1603
+ return l = d.sent(), l === void 0 ? [3, 4] : l.done ? (u = l, [2]) : [4, n(l.value)];
1604
+ case 3:
1605
+ d.sent(), d.label = 4;
1606
+ case 4:
1607
+ return [3, 1];
1608
+ case 5:
1609
+ return [3, 9];
1610
+ case 6:
1611
+ return c = b.return, c ? [4, b.return()] : [3, 8];
1612
+ case 7:
1613
+ c = d.sent(), d.label = 8;
1614
+ case 8:
1615
+ return [7];
1616
+ case 9:
1617
+ return [2];
1618
+ }
1619
+ });
1620
+ });
1621
+ }))];
1622
+ case 2:
1623
+ return a.sent(), [2, u && u.value];
1624
+ case 3:
1625
+ return i(), [7];
1626
+ case 4:
1627
+ return [2];
1628
+ }
1629
+ });
1630
+ });
1631
+ });
1632
+ }
1633
+ function Xt(r) {
1634
+ var t = this, e = J(r, { returnValues: !0 });
1635
+ return new j(function(n, i) {
1636
+ return L(t, void 0, void 0, function() {
1637
+ var s, o, u, h;
1638
+ return T(this, function(a) {
1639
+ switch (a.label) {
1640
+ case 0:
1641
+ if (!e.length)
1642
+ return i(), [2, []];
1643
+ o = !1, i.then(function() {
1644
+ s(), o = !0;
1645
+ }), a.label = 1;
1646
+ case 1:
1647
+ a.trys.push([
1648
+ 1,
1649
+ ,
1650
+ 6,
1651
+ 8
1652
+ ]), a.label = 2;
1653
+ case 2:
1654
+ return o ? [3, 5] : (Promise.all(e.map(function(b) {
1655
+ return b.next();
1656
+ })).then(function(b) {
1657
+ return s(b);
1658
+ }, function(b) {
1659
+ return i(b);
1660
+ }), [4, new Promise(function(b) {
1661
+ return s = b;
1662
+ })]);
1663
+ case 3:
1664
+ return u = a.sent(), u === void 0 ? [2] : (h = u.map(function(b) {
1665
+ return b.value;
1666
+ }), u.some(function(b) {
1667
+ return b.done;
1668
+ }) ? [2, h] : [4, n(h)]);
1669
+ case 4:
1670
+ return a.sent(), [3, 2];
1671
+ case 5:
1672
+ return [3, 8];
1673
+ case 6:
1674
+ return i(), [4, Promise.all(e.map(function(b) {
1675
+ return b.return && b.return();
1676
+ }))];
1677
+ case 7:
1678
+ return a.sent(), [7];
1679
+ case 8:
1680
+ return [2];
1681
+ }
1682
+ });
1683
+ });
1684
+ });
1685
+ }
1686
+ function Zt(r) {
1687
+ var t = this, e = J(r, {
1688
+ yieldValues: !0,
1689
+ returnValues: !0
1690
+ });
1691
+ return new j(function(n, i) {
1692
+ return L(t, void 0, void 0, function() {
1693
+ var s, o, u, h, a, b = this;
1694
+ return T(this, function(f) {
1695
+ switch (f.label) {
1696
+ case 0:
1697
+ if (!e.length)
1698
+ return i(), [2, []];
1699
+ o = [], u = !1, i.then(function() {
1700
+ var l, c;
1701
+ s();
1702
+ try {
1703
+ for (var d = k(o), p = d.next(); !p.done; p = d.next()) {
1704
+ var v = p.value;
1705
+ v();
1706
+ }
1707
+ } catch (P) {
1708
+ l = { error: P };
1709
+ } finally {
1710
+ try {
1711
+ p && !p.done && (c = d.return) && c.call(d);
1712
+ } finally {
1713
+ if (l) throw l.error;
1714
+ }
1715
+ }
1716
+ u = !0;
1717
+ }), f.label = 1;
1718
+ case 1:
1719
+ return f.trys.push([
1720
+ 1,
1721
+ ,
1722
+ 5,
1723
+ 7
1724
+ ]), Promise.all(e.map(function(l) {
1725
+ return l.next();
1726
+ })).then(function(l) {
1727
+ return s(l);
1728
+ }, function(l) {
1729
+ return i(l);
1730
+ }), [4, new Promise(function(l) {
1731
+ return s = l;
1732
+ })];
1733
+ case 2:
1734
+ return h = f.sent(), h === void 0 ? [2] : (a = h.map(function(l) {
1735
+ return l.value;
1736
+ }), h.every(function(l) {
1737
+ return l.done;
1738
+ }) ? [2, a] : [4, n(a.slice())]);
1739
+ case 3:
1740
+ return f.sent(), [4, Promise.all(e.map(function(l, c) {
1741
+ return L(b, void 0, void 0, function() {
1742
+ var d;
1743
+ return T(this, function(p) {
1744
+ switch (p.label) {
1745
+ case 0:
1746
+ if (h[c].done) return [2, h[c].value];
1747
+ p.label = 1;
1748
+ case 1:
1749
+ return u ? [3, 4] : (Promise.resolve(l.next()).then(function(v) {
1750
+ return o[c](v);
1751
+ }, function(v) {
1752
+ return i(v);
1753
+ }), [4, new Promise(function(v) {
1754
+ return o[c] = v;
1755
+ })]);
1756
+ case 2:
1757
+ return d = p.sent(), d === void 0 ? [2, h[c].value] : d.done ? [2, d.value] : (a[c] = d.value, [4, n(a.slice())]);
1758
+ case 3:
1759
+ return p.sent(), [3, 1];
1760
+ case 4:
1761
+ return [2];
1762
+ }
1763
+ });
1764
+ });
1765
+ }))];
1766
+ case 4:
1767
+ return [2, f.sent()];
1768
+ case 5:
1769
+ return i(), [4, Promise.all(e.map(function(l) {
1770
+ return l.return && l.return();
1771
+ }))];
1772
+ case 6:
1773
+ return f.sent(), [7];
1774
+ case 7:
1775
+ return [2];
1776
+ }
1777
+ });
1778
+ });
1779
+ });
1780
+ }
1781
+ var Yt = class Pt {
1782
+ headerClient;
1783
+ header;
1784
+ headerLength;
1785
+ indexLength;
1786
+ nocache;
1787
+ headers;
1788
+ constructor(t, e, n, i, s, o = {}) {
1789
+ this.headerClient = t, this.header = e, this.headerLength = n, this.indexLength = i, this.nocache = s, this.headers = o;
1790
+ }
1791
+ static async open(t, e, n = {}) {
1792
+ let i, s = new pt(t, e, n), o = 2024 + (() => {
1793
+ let b, f = 0;
1794
+ for (b = 0; b < 3; b++) f += 16 ** b * 40;
1795
+ return f;
1796
+ })();
1797
+ if (!new Uint8Array(await s.getRange(0, 8, o, "header")).subarray(0, 3).every((b, f) => U[f] === b)) throw Error("Not a FlatGeobuf file");
1798
+ if ((i = new DataView(await s.getRange(8, 4, o, "header")).getUint32(0, !0)) > 10485760 || i < 8) throw Error("Invalid header size");
1799
+ let u = await s.getRange(U.length, 4 + i, o, "header"), h = Z(new B(new Uint8Array(u)));
1800
+ if (h.indexNodeSize === 0) throw Error("No index found, cannot read features filtered by bbox");
1801
+ let a = Y(h.featuresCount, h.indexNodeSize);
1802
+ return new Pt(s, h, i, a, e, n);
1803
+ }
1804
+ async *selectBbox(t) {
1805
+ let e = this.lengthBeforeTree(), n = this.headerClient, i = async (h, a) => n.getRange(e + h, a, 0, "index"), s = [], o = [];
1806
+ for await (let h of xt(this.header.featuresCount, this.header.indexNodeSize, t, i)) {
1807
+ let [a, b] = h, [, , f] = h;
1808
+ if (f || (f = 4), o.length === 0) {
1809
+ o.push([
1810
+ a,
1811
+ f,
1812
+ b
1813
+ ]);
1814
+ continue;
1815
+ }
1816
+ let l = o[o.length - 1];
1817
+ a - (l[0] + l[1]) > wt.global.extraRequestThreshold() && (s.push(o), o = []), o.push([
1818
+ a,
1819
+ f,
1820
+ b
1821
+ ]);
1822
+ }
1823
+ this.headerClient.logUsage("header+index"), o.length > 0 && s.push(o);
1824
+ let u = s.flatMap((h) => this.readFeatureBatch(h, this.nocache));
1825
+ yield* j.merge(u);
1826
+ }
1827
+ lengthBeforeTree() {
1828
+ return U.length + 4 + this.headerLength;
1829
+ }
1830
+ lengthBeforeFeatures() {
1831
+ return this.lengthBeforeTree() + this.indexLength;
1832
+ }
1833
+ buildFeatureClient(t) {
1834
+ return new pt(this.headerClient.httpClient, t, this.headers);
1835
+ }
1836
+ async *readFeatureBatch(t, e) {
1837
+ let [n] = t[0], [i, s] = t[t.length - 1], o = this.buildFeatureClient(e), u = i + s - n;
1838
+ for (let [h, , a] of t) yield {
1839
+ id: a,
1840
+ feature: await this.readFeature(o, h, u)
1841
+ }, u = 0;
1842
+ o.logUsage("feature");
1843
+ }
1844
+ async readFeature(t, e, n) {
1845
+ let i, s = e + this.lengthBeforeFeatures();
1846
+ i = new DataView(await t.getRange(s, 4, n, "feature length")).getUint32(0, !0);
1847
+ let o = new Uint8Array(await t.getRange(s + 4, i, n, "feature data")), u = new Uint8Array(i + 4);
1848
+ u.set(o, 4);
1849
+ let h = new B(u);
1850
+ return W.getSizePrefixedRootAsFeature(h);
1851
+ }
1852
+ }, pt = class {
1853
+ httpClient;
1854
+ bytesEverUsed = 0;
1855
+ bytesEverFetched = 0;
1856
+ buffer = /* @__PURE__ */ new ArrayBuffer(0);
1857
+ head = 0;
1858
+ constructor(r, t, e = {}) {
1859
+ if (typeof r == "string") this.httpClient = new yt(r, t, e);
1860
+ else if (r instanceof yt) this.httpClient = r;
1861
+ else throw Error("Unknown source");
1862
+ }
1863
+ async getRange(r, t, e, n) {
1864
+ this.bytesEverUsed += t;
1865
+ let i = r - this.head, s = i + t;
1866
+ if (i >= 0 && s <= this.buffer.byteLength) return this.buffer.slice(i, s);
1867
+ let o = Math.max(t, e);
1868
+ return this.bytesEverFetched += o, this.buffer = await this.httpClient.getRange(r, o, n), this.head = r, this.buffer.slice(0, t);
1869
+ }
1870
+ logUsage(r) {
1871
+ r.split(" ")[0], (100 * this.bytesEverUsed / this.bytesEverFetched).toFixed(2);
1872
+ }
1873
+ }, yt = class {
1874
+ url;
1875
+ nocache;
1876
+ headers;
1877
+ requestsEverMade = 0;
1878
+ bytesEverRequested = 0;
1879
+ constructor(r, t, e = {}) {
1880
+ this.url = r, this.nocache = t, this.headers = e;
1881
+ }
1882
+ async getRange(r, t, e) {
1883
+ this.requestsEverMade += 1, this.bytesEverRequested += t;
1884
+ let n = `bytes=${r}-${r + t - 1}`, i = new Headers(this.headers);
1885
+ return i.set("Range", n), this.nocache && i.set("Cache-Control", "no-cache, no-store"), await (await fetch(this.url, { headers: i })).arrayBuffer();
1886
+ }
1887
+ };
1888
+ async function* Jt(r, t, e, n) {
1889
+ if (!r.subarray(0, 3).every((f, l) => U[l] === f)) throw Error("Not a FlatGeobuf file");
1890
+ if (e) {
1891
+ let f = Mt.open(r);
1892
+ for await (let l of f.selectBbox(e)) yield t(l.id, l.feature, f.header);
1893
+ return;
1894
+ }
1895
+ let i = new B(r), s = i.readUint32(U.length);
1896
+ i.setPosition(U.length);
1897
+ let o = Z(i);
1898
+ n && n(o);
1899
+ let u = U.length + 4 + s, { indexNodeSize: h, featuresCount: a } = o;
1900
+ h > 0 && (u += Y(a, h));
1901
+ let b = 0;
1902
+ for (; u < i.capacity(); ) {
1903
+ let f = i.readUint32(u);
1904
+ i.setPosition(u);
1905
+ let l = W.getSizePrefixedRootAsFeature(i);
1906
+ yield t(b++, l, o), u += 4 + f;
1907
+ }
1908
+ }
1909
+ async function* Kt(r, t, e) {
1910
+ let n, i = Rt(r), s = async (p) => await i.slice(p), o = new Uint8Array(await s(8, "magic bytes"));
1911
+ if (!o.subarray(0, 3).every((p, v) => U[v] === p)) throw Error("Not a FlatGeobuf file");
1912
+ let u = new Uint8Array(await s(4, "header length")), h = new B(u), a = h.readUint32(0), b = new Uint8Array(await s(a, "header data"));
1913
+ (o = new Uint8Array(u.length + b.length)).set(u), o.set(b, u.length);
1914
+ let f = Z(h = new B(o));
1915
+ e && e(f);
1916
+ let { indexNodeSize: l, featuresCount: c } = f;
1917
+ l > 0 && await s(Y(c, l), "entire index, w/o rect");
1918
+ let d = 0;
1919
+ for (; n = await te(s, f, t, d++); ) yield n;
1920
+ }
1921
+ async function* Qt(r, t, e, n, i = !1, s = {}) {
1922
+ let o = await Yt.open(r, i, s);
1923
+ for await (let u of (n && n(o.header), o.selectBbox(t))) yield e(u.id, u.feature, o.header);
1924
+ }
1925
+ async function te(r, t, e, n) {
1926
+ let i = new Uint8Array(await r(4, "feature length"));
1927
+ if (i.byteLength === 0) return;
1928
+ let s = new B(i), o = s.readUint32(0);
1929
+ i = new Uint8Array(await r(o, "feature data"));
1930
+ let u = new Uint8Array(o + 4);
1931
+ return u.set(i, 4), s = new B(u), e(n, W.getSizePrefixedRootAsFeature(s), t);
1932
+ }
1933
+ function ot(r, t) {
1934
+ let e = t;
1935
+ if (e === x.Unknown && (e = r.type()), e === x.GeometryCollection) {
1936
+ let i = [];
1937
+ for (let s = 0; s < r.partsLength(); s++) {
1938
+ let o = r.parts(s), u = o.type();
1939
+ i.push(ot(o, u));
1940
+ }
1941
+ return {
1942
+ type: x[e],
1943
+ geometries: i
1944
+ };
1945
+ }
1946
+ if (e === x.MultiPolygon) {
1947
+ let i = [];
1948
+ for (let s = 0; s < r.partsLength(); s++) i.push(ot(r.parts(s), x.Polygon));
1949
+ return {
1950
+ type: x[e],
1951
+ coordinates: i.map((s) => s.coordinates)
1952
+ };
1953
+ }
1954
+ let n = (function(i, s) {
1955
+ let o = i.xyArray(), u = i.zArray();
1956
+ switch (s) {
1957
+ case x.Point: {
1958
+ let h = Array.from(o);
1959
+ return u && h.push(u[0]), h;
1960
+ }
1961
+ case x.MultiPoint:
1962
+ case x.LineString:
1963
+ return Q(o, u);
1964
+ case x.MultiLineString:
1965
+ case x.Polygon:
1966
+ return (function(h, a, b) {
1967
+ let f;
1968
+ if (!b || b.length === 0) return [Q(h, a)];
1969
+ let l = 0, c = Array.from(b).map((d) => h.slice(l, l = d << 1));
1970
+ return a && (l = 0, f = Array.from(b).map((d) => a.slice(l, l = d))), c.map((d, p) => Q(d, f ? f[p] : void 0));
1971
+ })(o, u, i.endsArray());
1972
+ }
1973
+ })(r, e);
1974
+ return {
1975
+ type: x[e],
1976
+ coordinates: n
1977
+ };
1978
+ }
1979
+ function lt(r, t, e) {
1980
+ let n = e.columns;
1981
+ return {
1982
+ type: "Feature",
1983
+ id: r,
1984
+ geometry: ot(t.geometry(), e.geometryType),
1985
+ properties: Tt(t, n)
1986
+ };
1987
+ }
1988
+ async function* ee(r, t, e) {
1989
+ yield* Jt(r, lt, t, e);
1990
+ }
1991
+ function re(r, t) {
1992
+ return Kt(r, lt, t);
1993
+ }
1994
+ function ne(r, t, e, n = !1, i = {}) {
1995
+ return Qt(r, t, lt, e, n, i);
1996
+ }
1997
+ function ue(r, t, e, n = !1, i = {}) {
1998
+ return r instanceof Uint8Array ? ee(r, t, e) : r instanceof ReadableStream ? re(r, e) : ne(r, t, e, n, i);
1999
+ }
2000
+ export {
2001
+ ue as deserialize
2002
+ };