@ifc-lite/viewer 1.17.2 → 1.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (520) hide show
  1. package/.turbo/turbo-build.log +34 -24
  2. package/.turbo/turbo-typecheck.log +1 -42
  3. package/CHANGELOG.md +24 -0
  4. package/DESKTOP_CONTRACT_VERSION +1 -0
  5. package/dist/assets/arrow-CZ5kQ26f.js +20 -0
  6. package/dist/assets/basketViewActivator-BmnNtVfZ.js +1 -0
  7. package/dist/assets/bcf-DOG9_WPX.js +281 -0
  8. package/dist/assets/{browser-BDShTXzi.js → browser-C5TFR7sH.js} +1 -1
  9. package/dist/assets/cesium-ADbP7waU.css +1 -0
  10. package/dist/assets/cesium-DUOzBlqv.js +17817 -0
  11. package/dist/assets/drawing-2d-gWfpdfYe.js +257 -0
  12. package/dist/assets/epsg-index.generated-BjJrt_0S.js +1 -0
  13. package/dist/assets/exporters-ChAtBmlj.js +80367 -0
  14. package/dist/assets/geometry.worker-BQ0rzNo-.js +1 -0
  15. package/dist/assets/ids-B4jTqB1O.js +1 -0
  16. package/dist/assets/ifc-lite_bg-BX4E7TX8.wasm +0 -0
  17. package/dist/assets/index-Co8E2-FE.js +106013 -0
  18. package/dist/assets/index-DckuDqlv.css +1 -0
  19. package/dist/assets/lens-CSASnhAL.js +1 -0
  20. package/dist/assets/maplibre-gl-CGLcoNXc.js +811 -0
  21. package/dist/assets/native-bridge-BRvbckFQ.js +429 -0
  22. package/dist/assets/{arrow2-bb-jcVEo.js → parquet-CEXmQNRO.js} +2 -2
  23. package/dist/assets/sandbox-DZiNLNMk.js +5933 -0
  24. package/dist/assets/server-client-BV8zHZ7Y.js +626 -0
  25. package/dist/assets/tauri-core-stub-D8Fa-u43.js +1 -0
  26. package/dist/assets/tauri-dialog-stub-r7Wksg7o.js +1 -0
  27. package/dist/assets/tauri-fs-stub-BdeRC7aK.js +1 -0
  28. package/dist/assets/wasm-bridge-g01g7T9b.js +1 -0
  29. package/dist/assets/zip-DBEtpeu6.js +12 -0
  30. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
  31. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
  32. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
  33. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
  34. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
  35. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
  36. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
  37. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
  38. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
  39. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
  40. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
  41. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
  42. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
  43. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
  44. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
  45. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
  46. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
  47. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
  48. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
  49. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
  50. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
  51. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
  52. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
  53. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
  54. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
  55. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
  56. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
  57. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
  58. package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
  59. package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
  60. package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
  61. package/dist/cesium/Assets/Images/ion-credit.png +0 -0
  62. package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
  63. package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
  64. package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
  65. package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
  66. package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
  67. package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
  68. package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
  69. package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
  70. package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
  71. package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
  72. package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
  73. package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
  74. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
  75. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
  76. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
  77. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
  78. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
  79. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
  80. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
  81. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
  82. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
  83. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
  84. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
  85. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
  86. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
  87. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
  88. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
  89. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
  90. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
  91. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
  92. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
  93. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
  94. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
  95. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
  96. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
  97. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
  98. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
  99. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
  100. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
  101. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
  102. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
  103. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
  104. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
  105. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
  106. package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
  107. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
  108. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
  109. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
  110. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
  111. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
  112. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
  113. package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
  114. package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
  115. package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
  116. package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
  117. package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
  118. package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
  119. package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
  120. package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
  121. package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
  122. package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
  123. package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
  124. package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
  125. package/dist/cesium/Assets/Textures/maki/building.png +0 -0
  126. package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
  127. package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
  128. package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
  129. package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
  130. package/dist/cesium/Assets/Textures/maki/car.png +0 -0
  131. package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
  132. package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
  133. package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
  134. package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
  135. package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
  136. package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
  137. package/dist/cesium/Assets/Textures/maki/city.png +0 -0
  138. package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
  139. package/dist/cesium/Assets/Textures/maki/college.png +0 -0
  140. package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
  141. package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
  142. package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
  143. package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
  144. package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
  145. package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
  146. package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
  147. package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
  148. package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
  149. package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
  150. package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
  151. package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
  152. package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
  153. package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
  154. package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
  155. package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
  156. package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
  157. package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
  158. package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
  159. package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
  160. package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
  161. package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
  162. package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
  163. package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
  164. package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
  165. package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
  166. package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
  167. package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
  168. package/dist/cesium/Assets/Textures/maki/library.png +0 -0
  169. package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
  170. package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
  171. package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
  172. package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
  173. package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
  174. package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
  175. package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
  176. package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
  177. package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
  178. package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
  179. package/dist/cesium/Assets/Textures/maki/music.png +0 -0
  180. package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
  181. package/dist/cesium/Assets/Textures/maki/park.png +0 -0
  182. package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
  183. package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
  184. package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
  185. package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
  186. package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
  187. package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
  188. package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
  189. package/dist/cesium/Assets/Textures/maki/police.png +0 -0
  190. package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
  191. package/dist/cesium/Assets/Textures/maki/post.png +0 -0
  192. package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
  193. package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
  194. package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
  195. package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
  196. package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
  197. package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
  198. package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
  199. package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
  200. package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
  201. package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
  202. package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
  203. package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
  204. package/dist/cesium/Assets/Textures/maki/school.png +0 -0
  205. package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
  206. package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
  207. package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
  208. package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
  209. package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
  210. package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
  211. package/dist/cesium/Assets/Textures/maki/square.png +0 -0
  212. package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
  213. package/dist/cesium/Assets/Textures/maki/star.png +0 -0
  214. package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
  215. package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
  216. package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
  217. package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
  218. package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
  219. package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
  220. package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
  221. package/dist/cesium/Assets/Textures/maki/town.png +0 -0
  222. package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
  223. package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
  224. package/dist/cesium/Assets/Textures/maki/village.png +0 -0
  225. package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
  226. package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
  227. package/dist/cesium/Assets/Textures/maki/water.png +0 -0
  228. package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
  229. package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
  230. package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
  231. package/dist/cesium/Assets/Textures/pin.svg +1 -0
  232. package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
  233. package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
  234. package/dist/cesium/Assets/approximateTerrainHeights.json +1 -0
  235. package/dist/cesium/ThirdParty/Workers/package.json +1 -0
  236. package/dist/cesium/ThirdParty/Workers/zip-web-worker.js +1 -0
  237. package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
  238. package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
  239. package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +1 -0
  240. package/dist/cesium/ThirdParty/wasm_splats_bg.wasm +0 -0
  241. package/dist/cesium/ThirdParty/zip-module.wasm +0 -0
  242. package/dist/cesium/Widgets/Animation/Animation.css +127 -0
  243. package/dist/cesium/Widgets/Animation/lighter.css +70 -0
  244. package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +108 -0
  245. package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +22 -0
  246. package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +102 -0
  247. package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +113 -0
  248. package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +119 -0
  249. package/dist/cesium/Widgets/CesiumWidget/lighter.css +14 -0
  250. package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +8 -0
  251. package/dist/cesium/Widgets/Geocoder/Geocoder.css +70 -0
  252. package/dist/cesium/Widgets/Geocoder/lighter.css +17 -0
  253. package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +27 -0
  254. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
  255. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
  256. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
  257. package/dist/cesium/Widgets/Images/ImageryProviders/azureAerial.png +0 -0
  258. package/dist/cesium/Widgets/Images/ImageryProviders/azureRoads.png +0 -0
  259. package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
  260. package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
  261. package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
  262. package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
  263. package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
  264. package/dist/cesium/Widgets/Images/ImageryProviders/googleContour.png +0 -0
  265. package/dist/cesium/Widgets/Images/ImageryProviders/googleRoadmap.png +0 -0
  266. package/dist/cesium/Widgets/Images/ImageryProviders/googleSatellite.png +0 -0
  267. package/dist/cesium/Widgets/Images/ImageryProviders/googleSatelliteLabels.png +0 -0
  268. package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
  269. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
  270. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
  271. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
  272. package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
  273. package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
  274. package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
  275. package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
  276. package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
  277. package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
  278. package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
  279. package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +84 -0
  280. package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +76 -0
  281. package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +76 -0
  282. package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +76 -0
  283. package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +120 -0
  284. package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +129 -0
  285. package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +76 -0
  286. package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +135 -0
  287. package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +74 -0
  288. package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
  289. package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
  290. package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
  291. package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
  292. package/dist/cesium/Widgets/InfoBox/InfoBox.css +92 -0
  293. package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +178 -0
  294. package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +93 -0
  295. package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +38 -0
  296. package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +15 -0
  297. package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +38 -0
  298. package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +56 -0
  299. package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +20 -0
  300. package/dist/cesium/Widgets/Timeline/Timeline.css +103 -0
  301. package/dist/cesium/Widgets/Timeline/lighter.css +23 -0
  302. package/dist/cesium/Widgets/VRButton/VRButton.css +8 -0
  303. package/dist/cesium/Widgets/Viewer/Viewer.css +107 -0
  304. package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +16 -0
  305. package/dist/cesium/Widgets/lighter.css +237 -0
  306. package/dist/cesium/Widgets/lighterShared.css +46 -0
  307. package/dist/cesium/Widgets/shared.css +103 -0
  308. package/dist/cesium/Widgets/widgets.css +1342 -0
  309. package/dist/cesium/Workers/chunk-23ZQ2IVV.js +29 -0
  310. package/dist/cesium/Workers/chunk-2EQO3Q56.js +26 -0
  311. package/dist/cesium/Workers/chunk-2MJIIVP4.js +26 -0
  312. package/dist/cesium/Workers/chunk-2TE5NTVD.js +26 -0
  313. package/dist/cesium/Workers/chunk-2ZBHLJST.js +26 -0
  314. package/dist/cesium/Workers/chunk-5TJMAQVL.js +26 -0
  315. package/dist/cesium/Workers/chunk-6BD4U3VO.js +26 -0
  316. package/dist/cesium/Workers/chunk-7TVGLKQF.js +26 -0
  317. package/dist/cesium/Workers/chunk-BTSYJ5XU.js +26 -0
  318. package/dist/cesium/Workers/chunk-BXMEEOCS.js +63 -0
  319. package/dist/cesium/Workers/chunk-BYLCY7GP.js +29 -0
  320. package/dist/cesium/Workers/chunk-CTHM3W6I.js +26 -0
  321. package/dist/cesium/Workers/chunk-CUUSNIVQ.js +26 -0
  322. package/dist/cesium/Workers/chunk-E3JOOS3S.js +26 -0
  323. package/dist/cesium/Workers/chunk-E7KYDCM5.js +26 -0
  324. package/dist/cesium/Workers/chunk-EDVBB7SS.js +27 -0
  325. package/dist/cesium/Workers/chunk-EFBN7QNX.js +26 -0
  326. package/dist/cesium/Workers/chunk-EQ4YRVWL.js +26 -0
  327. package/dist/cesium/Workers/chunk-F6PRE7D6.js +26 -0
  328. package/dist/cesium/Workers/chunk-FC4ZZ65J.js +26 -0
  329. package/dist/cesium/Workers/chunk-FFBVWF2L.js +26 -0
  330. package/dist/cesium/Workers/chunk-GBAA6GVX.js +26 -0
  331. package/dist/cesium/Workers/chunk-ICALLYLG.js +26 -0
  332. package/dist/cesium/Workers/chunk-ILRYTWTP.js +26 -0
  333. package/dist/cesium/Workers/chunk-IRNLBSEJ.js +26 -0
  334. package/dist/cesium/Workers/chunk-IX4VMHEV.js +26 -0
  335. package/dist/cesium/Workers/chunk-L6QHHACZ.js +26 -0
  336. package/dist/cesium/Workers/chunk-LI2ZSORM.js +26 -0
  337. package/dist/cesium/Workers/chunk-LSLE2RL4.js +26 -0
  338. package/dist/cesium/Workers/chunk-M4HLDBCG.js +26 -0
  339. package/dist/cesium/Workers/chunk-MJHHSGEH.js +26 -0
  340. package/dist/cesium/Workers/chunk-NMVKML6W.js +26 -0
  341. package/dist/cesium/Workers/chunk-OCWJRAXS.js +26 -0
  342. package/dist/cesium/Workers/chunk-OIRKANTH.js +26 -0
  343. package/dist/cesium/Workers/chunk-OIT7J4IC.js +26 -0
  344. package/dist/cesium/Workers/chunk-OLZ3FYUM.js +26 -0
  345. package/dist/cesium/Workers/chunk-Q5BPHJQF.js +26 -0
  346. package/dist/cesium/Workers/chunk-QFM5DCMQ.js +26 -0
  347. package/dist/cesium/Workers/chunk-QKUIYMGC.js +28 -0
  348. package/dist/cesium/Workers/chunk-S44JILQT.js +26 -0
  349. package/dist/cesium/Workers/chunk-SLT4J352.js +26 -0
  350. package/dist/cesium/Workers/chunk-SQMIIXB7.js +26 -0
  351. package/dist/cesium/Workers/chunk-TJ4XLGBQ.js +26 -0
  352. package/dist/cesium/Workers/chunk-TNSUQXWK.js +27 -0
  353. package/dist/cesium/Workers/chunk-UBOGZS7F.js +26 -0
  354. package/dist/cesium/Workers/chunk-V3OSTMM6.js +26 -0
  355. package/dist/cesium/Workers/chunk-V7QEYVP3.js +26 -0
  356. package/dist/cesium/Workers/chunk-VUKYSU4H.js +26 -0
  357. package/dist/cesium/Workers/chunk-W37FE5GR.js +26 -0
  358. package/dist/cesium/Workers/chunk-WBOV35NL.js +26 -0
  359. package/dist/cesium/Workers/chunk-WPMZLB3Y.js +26 -0
  360. package/dist/cesium/Workers/chunk-WWWZVEEH.js +26 -0
  361. package/dist/cesium/Workers/chunk-XFIQ5DEQ.js +28 -0
  362. package/dist/cesium/Workers/chunk-XQHLGIO7.js +26 -0
  363. package/dist/cesium/Workers/chunk-XUSCFAVF.js +26 -0
  364. package/dist/cesium/Workers/chunk-YP7I5QBZ.js +26 -0
  365. package/dist/cesium/Workers/chunk-Z3QF2EHT.js +26 -0
  366. package/dist/cesium/Workers/combineGeometry.js +26 -0
  367. package/dist/cesium/Workers/createBoxGeometry.js +26 -0
  368. package/dist/cesium/Workers/createBoxOutlineGeometry.js +26 -0
  369. package/dist/cesium/Workers/createCircleGeometry.js +26 -0
  370. package/dist/cesium/Workers/createCircleOutlineGeometry.js +26 -0
  371. package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +26 -0
  372. package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +26 -0
  373. package/dist/cesium/Workers/createCorridorGeometry.js +26 -0
  374. package/dist/cesium/Workers/createCorridorOutlineGeometry.js +26 -0
  375. package/dist/cesium/Workers/createCylinderGeometry.js +26 -0
  376. package/dist/cesium/Workers/createCylinderOutlineGeometry.js +26 -0
  377. package/dist/cesium/Workers/createEllipseGeometry.js +26 -0
  378. package/dist/cesium/Workers/createEllipseOutlineGeometry.js +26 -0
  379. package/dist/cesium/Workers/createEllipsoidGeometry.js +26 -0
  380. package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +26 -0
  381. package/dist/cesium/Workers/createFrustumGeometry.js +26 -0
  382. package/dist/cesium/Workers/createFrustumOutlineGeometry.js +26 -0
  383. package/dist/cesium/Workers/createGeometry.js +26 -0
  384. package/dist/cesium/Workers/createGroundPolylineGeometry.js +26 -0
  385. package/dist/cesium/Workers/createPlaneGeometry.js +26 -0
  386. package/dist/cesium/Workers/createPlaneOutlineGeometry.js +26 -0
  387. package/dist/cesium/Workers/createPolygonGeometry.js +26 -0
  388. package/dist/cesium/Workers/createPolygonOutlineGeometry.js +26 -0
  389. package/dist/cesium/Workers/createPolylineGeometry.js +26 -0
  390. package/dist/cesium/Workers/createPolylineVolumeGeometry.js +26 -0
  391. package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +26 -0
  392. package/dist/cesium/Workers/createRectangleGeometry.js +26 -0
  393. package/dist/cesium/Workers/createRectangleOutlineGeometry.js +26 -0
  394. package/dist/cesium/Workers/createSimplePolylineGeometry.js +26 -0
  395. package/dist/cesium/Workers/createSphereGeometry.js +26 -0
  396. package/dist/cesium/Workers/createSphereOutlineGeometry.js +26 -0
  397. package/dist/cesium/Workers/createTaskProcessorWorker.js +26 -0
  398. package/dist/cesium/Workers/createVectorTileClampedPolylines.js +26 -0
  399. package/dist/cesium/Workers/createVectorTileGeometries.js +26 -0
  400. package/dist/cesium/Workers/createVectorTilePoints.js +26 -0
  401. package/dist/cesium/Workers/createVectorTilePolygons.js +26 -0
  402. package/dist/cesium/Workers/createVectorTilePolylines.js +26 -0
  403. package/dist/cesium/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -0
  404. package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +26 -0
  405. package/dist/cesium/Workers/createVerticesFromHeightmap.js +26 -0
  406. package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -0
  407. package/dist/cesium/Workers/createWallGeometry.js +26 -0
  408. package/dist/cesium/Workers/createWallOutlineGeometry.js +26 -0
  409. package/dist/cesium/Workers/decodeDraco.js +26 -0
  410. package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +26 -0
  411. package/dist/cesium/Workers/decodeI3S.js +26 -0
  412. package/dist/cesium/Workers/gaussianSplatSorter.js +26 -0
  413. package/dist/cesium/Workers/gaussianSplatTextureGenerator.js +26 -0
  414. package/dist/cesium/Workers/incrementallyBuildTerrainPicker.js +26 -0
  415. package/dist/cesium/Workers/transcodeKTX2.js +56 -0
  416. package/dist/cesium/Workers/transferTypedArrayTest.js +26 -0
  417. package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +26 -0
  418. package/dist/cesium/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -0
  419. package/dist/index.html +13 -2
  420. package/package.json +27 -19
  421. package/src/App.tsx +1 -17
  422. package/src/components/viewer/BCFPanel.tsx +46 -4
  423. package/src/components/viewer/CesiumOverlay.tsx +672 -0
  424. package/src/components/viewer/CesiumSettingsDialog.tsx +100 -0
  425. package/src/components/viewer/ChatPanel.tsx +54 -16
  426. package/src/components/viewer/CommandPalette.tsx +6 -1
  427. package/src/components/viewer/DesktopEntitlementBanner.tsx +74 -0
  428. package/src/components/viewer/ExportChangesButton.tsx +24 -4
  429. package/src/components/viewer/ExportDialog.tsx +38 -9
  430. package/src/components/viewer/HierarchyPanel.tsx +202 -6
  431. package/src/components/viewer/IDSPanel.tsx +52 -3
  432. package/src/components/viewer/KeyboardShortcutsDialog.tsx +1 -1
  433. package/src/components/viewer/MainToolbar.tsx +353 -27
  434. package/src/components/viewer/PropertiesPanel.tsx +306 -131
  435. package/src/components/viewer/ScriptPanel.tsx +34 -8
  436. package/src/components/viewer/Section2DPanel.tsx +3 -2
  437. package/src/components/viewer/SettingsPage.tsx +430 -0
  438. package/src/components/viewer/StatusBar.tsx +17 -1
  439. package/src/components/viewer/UpgradePage.tsx +6 -4
  440. package/src/components/viewer/ViewerLayout.tsx +47 -6
  441. package/src/components/viewer/Viewport.tsx +49 -8
  442. package/src/components/viewer/ViewportContainer.tsx +285 -32
  443. package/src/components/viewer/ViewportOverlays.tsx +129 -27
  444. package/src/components/viewer/hierarchy/treeDataBuilder.ts +2 -1
  445. package/src/components/viewer/properties/EpsgLookupDialog.tsx +418 -0
  446. package/src/components/viewer/properties/GeoreferencingPanel.tsx +703 -0
  447. package/src/components/viewer/properties/LocationMap.tsx +730 -0
  448. package/src/components/viewer/properties/ModelMetadataPanel.tsx +3 -70
  449. package/src/components/viewer/selectionHandlers.ts +4 -3
  450. package/src/components/viewer/useAnimationLoop.ts +4 -0
  451. package/src/components/viewer/useGeometryStreaming.ts +127 -40
  452. package/src/components/viewer/useMouseControls.ts +4 -1
  453. package/src/hooks/bcfIdLookup.ts +13 -11
  454. package/src/hooks/ids/idsColorSystem.ts +3 -8
  455. package/src/hooks/ingest/viewerModelIngest.ts +275 -0
  456. package/src/hooks/useIDS.ts +32 -17
  457. package/src/hooks/useIfc.ts +7 -1
  458. package/src/hooks/useIfcCache.ts +28 -15
  459. package/src/hooks/useIfcFederation.ts +59 -227
  460. package/src/hooks/useIfcLoader.ts +1656 -130
  461. package/src/hooks/useIfcServer.ts +0 -69
  462. package/src/lib/desktop/ClerkDesktopEntitlementSync.tsx +175 -0
  463. package/src/lib/desktop/desktopEntitlementEvents.ts +39 -0
  464. package/src/lib/desktop-entitlement.ts +45 -0
  465. package/src/lib/desktop-product.ts +124 -0
  466. package/src/lib/geo/cesium-bridge.ts +310 -0
  467. package/src/lib/geo/kmz-exporter.ts +112 -0
  468. package/src/lib/geo/reproject.ts +370 -0
  469. package/src/lib/lens/adapter.ts +3 -1
  470. package/src/lib/recent-files.ts +2 -1
  471. package/src/main.tsx +1 -0
  472. package/src/sdk/adapters/export-adapter.ts +14 -1
  473. package/src/sdk/adapters/viewer-adapter.ts +5 -9
  474. package/src/sdk/adapters/visibility-adapter.ts +6 -9
  475. package/src/services/analysis-extensions.ts +125 -0
  476. package/src/services/app-navigation.ts +13 -0
  477. package/src/services/bsdd.ts +53 -4
  478. package/src/services/cacheService.ts +1 -1
  479. package/src/services/desktop-cache.ts +43 -0
  480. package/src/services/desktop-export.ts +77 -0
  481. package/src/services/desktop-harness.ts +196 -0
  482. package/src/services/desktop-logger.ts +20 -0
  483. package/src/services/desktop-native-metadata.ts +207 -0
  484. package/src/services/desktop-panel-actions.ts +43 -0
  485. package/src/services/desktop-preferences.ts +44 -0
  486. package/src/services/file-dialog.ts +147 -0
  487. package/src/services/tauri-core-stub.ts +7 -0
  488. package/src/services/tauri-dialog-stub.ts +7 -0
  489. package/src/services/tauri-fs-stub.ts +7 -0
  490. package/src/store/basketVisibleSet.ts +3 -4
  491. package/src/store/globalId.ts +79 -0
  492. package/src/store/index.ts +41 -2
  493. package/src/store/slices/cesiumSlice.ts +122 -0
  494. package/src/store/slices/chatSlice.ts +5 -1
  495. package/src/store/slices/dataSlice.ts +139 -28
  496. package/src/store/slices/desktopEntitlementSlice.ts +86 -0
  497. package/src/store/slices/loadingSlice.ts +14 -2
  498. package/src/store/slices/modelSlice.ts +58 -3
  499. package/src/store/slices/mutationSlice.ts +178 -0
  500. package/src/store/slices/pinboardSlice.ts +4 -8
  501. package/src/store/types.ts +96 -2
  502. package/src/store.ts +1 -1
  503. package/src/utils/desktopModelSnapshot.ts +358 -0
  504. package/src/utils/ifcConfig.ts +6 -1
  505. package/src/utils/nativeSpatialDataStore.ts +250 -0
  506. package/src/utils/serverDataModel.ts +4 -0
  507. package/src/utils/spatialHierarchy.ts +10 -11
  508. package/vite.config.ts +41 -0
  509. package/dist/assets/Arrow.dom-BhOg9lpn.js +0 -20
  510. package/dist/assets/arrow2_bg-BlXl-cSQ.js +0 -1
  511. package/dist/assets/basketViewActivator-BRG5DBmM.js +0 -1
  512. package/dist/assets/desktop-cache-oPzaWXYE.js +0 -1
  513. package/dist/assets/geometry.worker-kgiT_Qhh.js +0 -1
  514. package/dist/assets/ifc-lite_bg-FNRmpSvM.wasm +0 -0
  515. package/dist/assets/index-B1Ecw4AU.js +0 -189756
  516. package/dist/assets/index-Ba4eoTe7.css +0 -1
  517. package/dist/assets/index-CrgYBjTn.js +0 -229
  518. package/dist/assets/module-6F3E5H7Y-tx0BadV3.js +0 -6
  519. package/dist/assets/native-bridge-Crsb7TKz.js +0 -111
  520. package/dist/assets/wasm-bridge-mJUhb7uk.js +0 -1
@@ -1,20 +0,0 @@
1
- import{c as bt,e as M,f as Si,g as ie,h as p,i as ba}from"./index-B1Ecw4AU.js";const _a=new TextDecoder("utf-8"),vn=i=>_a.decode(i),va=new TextEncoder,Zi=i=>va.encode(i),wa=i=>typeof i=="number",Hs=i=>typeof i=="boolean",P=i=>typeof i=="function",nt=i=>i!=null&&Object(i)===i,ne=i=>nt(i)&&P(i.then),Ge=i=>nt(i)&&P(i[Symbol.iterator]),Se=i=>nt(i)&&P(i[Symbol.asyncIterator]),wn=i=>nt(i)&&nt(i.schema),Ks=i=>nt(i)&&"done"in i&&"value"in i,Gs=i=>nt(i)&&P(i.stat)&&wa(i.fd),qs=i=>nt(i)&&Tn(i.body),Qi=i=>"_getDOMStream"in i&&"_getNodeStream"in i,Ia=i=>nt(i)&&P(i.abort)&&P(i.getWriter)&&!Qi(i),Tn=i=>nt(i)&&P(i.cancel)&&P(i.getReader)&&!Qi(i),Sa=i=>nt(i)&&P(i.end)&&P(i.write)&&Hs(i.writable)&&!Qi(i),Zs=i=>nt(i)&&P(i.read)&&P(i.pipe)&&Hs(i.readable)&&!Qi(i),Ba=i=>nt(i)&&P(i.clear)&&P(i.bytes)&&P(i.position)&&P(i.setPosition)&&P(i.capacity)&&P(i.getBufferIdentifier)&&P(i.createLong),Nn=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function Da(i){const t=i[0]?[i[0]]:[];let e,n,s,r;for(let o,a,c=0,l=0,h=i.length;++c<h;){if(o=t[l],a=i[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(t[++l]=a);continue}if({byteOffset:e,byteLength:s}=o,{byteOffset:n,byteLength:r}=a,e+s<n||n+r<e){a&&(t[++l]=a);continue}t[l]=new Uint8Array(o.buffer,e,n-e+r)}return t}function ii(i,t,e=0,n=t.byteLength){const s=i.byteLength,r=new Uint8Array(i.buffer,i.byteOffset,s),o=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,s));return r.set(o,e),i}function wt(i,t){const e=Da(i),n=e.reduce((h,d)=>h+d.byteLength,0);let s,r,o,a=0,c=-1;const l=Math.min(t||Number.POSITIVE_INFINITY,n);for(const h=e.length;++c<h;){if(s=e[c],r=s.subarray(0,Math.min(s.length,l-a)),l<=a+r.length){r.length<s.length?e[c]=s.subarray(r.length):r.length===s.length&&c++,o?ii(o,r,a):o=r;break}ii(o||(o=new Uint8Array(l)),r,a),a+=r.length}return[o||new Uint8Array(0),e.slice(c),n-(o?o.byteLength:0)]}function T(i,t){let e=Ks(t)?t.value:t;return e instanceof i?i===Uint8Array?new i(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=Zi(e)),e instanceof ArrayBuffer?new i(e):e instanceof Nn?new i(e):Ba(e)?T(i,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new i(0):new i(e.buffer,e.byteOffset,e.byteLength/i.BYTES_PER_ELEMENT):i.from(e)):new i(0)}const Aa=i=>T(Int8Array,i),Oa=i=>T(Int16Array,i),Fe=i=>T(Int32Array,i),Fa=i=>T(BigInt64Array,i),N=i=>T(Uint8Array,i),Ma=i=>T(Uint16Array,i),Ta=i=>T(Uint32Array,i),Na=i=>T(BigUint64Array,i),La=i=>T(Float32Array,i),Ua=i=>T(Float64Array,i),xa=i=>T(Uint8ClampedArray,i),In=i=>(i.next(),i);function*kt(i,t){const e=function*(s){yield s},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Nn?e(t):Ge(t)?t:e(t);return yield*In(function*(s){let r=null;do r=s.next(yield T(i,r));while(!r.done)}(n[Symbol.iterator]())),new i}const Ca=i=>kt(Int8Array,i),Ea=i=>kt(Int16Array,i),Va=i=>kt(Int32Array,i),Qs=i=>kt(Uint8Array,i),Ra=i=>kt(Uint16Array,i),za=i=>kt(Uint32Array,i),ja=i=>kt(Float32Array,i),ka=i=>kt(Float64Array,i),Pa=i=>kt(Uint8ClampedArray,i);function Bt(i,t){return bt(this,arguments,function*(){if(ne(t))return yield M(yield M(yield*Si(ie(Bt(i,yield M(t))))));const n=function(o){return bt(this,arguments,function*(){yield yield M(yield M(o))})},s=function(o){return bt(this,arguments,function*(){yield M(yield*Si(ie(In(function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)}(o[Symbol.iterator]())))))})},r=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Nn?n(t):Ge(t)?s(t):Se(t)?t:n(t);return yield M(yield*Si(ie(In(function(o){return bt(this,arguments,function*(){let a=null;do a=yield M(o.next(yield yield M(T(i,a))));while(!a.done)})}(r[Symbol.asyncIterator]()))))),yield M(new i)})}const $a=i=>Bt(Int8Array,i),Wa=i=>Bt(Int16Array,i),Ya=i=>Bt(Int32Array,i),Xs=i=>Bt(Uint8Array,i),Ja=i=>Bt(Uint16Array,i),Ha=i=>Bt(Uint32Array,i),Ka=i=>Bt(Float32Array,i),Ga=i=>Bt(Float64Array,i),qa=i=>Bt(Uint8ClampedArray,i);function Ln(i,t,e){if(i!==0){e=e.slice(0,t);for(let n=-1,s=e.length;++n<s;)e[n]+=i}return e.subarray(0,t)}function tr(i,t){let e=0;const n=i.length;if(n!==t.length)return!1;if(n>0)do if(i[e]!==t[e])return!1;while(++e<n);return!0}const Za=Object.freeze(Object.defineProperty({__proto__:null,compareArrayLike:tr,joinUint8Arrays:wt,memcpy:ii,rebaseValueOffsets:Ln,toArrayBufferView:T,toArrayBufferViewAsyncIterator:Bt,toArrayBufferViewIterator:kt,toBigInt64Array:Fa,toBigUint64Array:Na,toFloat32Array:La,toFloat32ArrayAsyncIterator:Ka,toFloat32ArrayIterator:ja,toFloat64Array:Ua,toFloat64ArrayAsyncIterator:Ga,toFloat64ArrayIterator:ka,toInt16Array:Oa,toInt16ArrayAsyncIterator:Wa,toInt16ArrayIterator:Ea,toInt32Array:Fe,toInt32ArrayAsyncIterator:Ya,toInt32ArrayIterator:Va,toInt8Array:Aa,toInt8ArrayAsyncIterator:$a,toInt8ArrayIterator:Ca,toUint16Array:Ma,toUint16ArrayAsyncIterator:Ja,toUint16ArrayIterator:Ra,toUint32Array:Ta,toUint32ArrayAsyncIterator:Ha,toUint32ArrayIterator:za,toUint8Array:N,toUint8ArrayAsyncIterator:Xs,toUint8ArrayIterator:Qs,toUint8ClampedArray:xa,toUint8ClampedArrayAsyncIterator:qa,toUint8ClampedArrayIterator:Pa},Symbol.toStringTag,{value:"Module"})),ot={fromIterable(i){return vi(Qa(i))},fromAsyncIterable(i){return vi(Xa(i))},fromDOMStream(i){return vi(tc(i))},fromNodeStream(i){return vi(ic(i))},toDOMStream(i,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(i,t){throw new Error('"toNodeStream" not available in this environment')}},vi=i=>(i.next(),i);function*Qa(i){let t,e=!1,n=[],s,r,o,a=0;function c(){return r==="peek"?wt(n,o)[0]:([s,n,a]=wt(n,o),s)}({cmd:r,size:o}=yield null);const l=Qs(i)[Symbol.iterator]();try{do if({done:t,value:s}=Number.isNaN(o-a)?l.next():l.next(o-a),!t&&s.byteLength>0&&(n.push(s),a+=s.byteLength),t||o<=a)do({cmd:r,size:o}=yield c());while(o<a);while(!t)}catch(h){(e=!0)&&typeof l.throw=="function"&&l.throw(h)}finally{e===!1&&typeof l.return=="function"&&l.return(null)}return null}function Xa(i){return bt(this,arguments,function*(){let e,n=!1,s=[],r,o,a,c=0;function l(){return o==="peek"?wt(s,a)[0]:([r,s,c]=wt(s,a),r)}({cmd:o,size:a}=yield yield M(null));const h=Xs(i)[Symbol.asyncIterator]();try{do if({done:e,value:r}=Number.isNaN(a-c)?yield M(h.next()):yield M(h.next(a-c)),!e&&r.byteLength>0&&(s.push(r),c+=r.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield M(l()));while(a<c);while(!e)}catch(d){(n=!0)&&typeof h.throw=="function"&&(yield M(h.throw(d)))}finally{n===!1&&typeof h.return=="function"&&(yield M(h.return(new Uint8Array(0))))}return yield M(null)})}function tc(i){return bt(this,arguments,function*(){let e=!1,n=!1,s=[],r,o,a,c=0;function l(){return o==="peek"?wt(s,a)[0]:([r,s,c]=wt(s,a),r)}({cmd:o,size:a}=yield yield M(null));const h=new ec(i);try{do if({done:e,value:r}=Number.isNaN(a-c)?yield M(h.read()):yield M(h.read(a-c)),!e&&r.byteLength>0&&(s.push(N(r)),c+=r.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield M(l()));while(a<c);while(!e)}catch(d){(n=!0)&&(yield M(h.cancel(d)))}finally{n===!1?yield M(h.cancel()):i.locked&&h.releaseLock()}return yield M(null)})}class ec{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return p(this,void 0,void 0,function*(){const{reader:e,source:n}=this;e&&(yield e.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return p(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const e=yield this.reader.read();return!e.done&&(e.value=N(e)),e})}}const yn=(i,t)=>{const e=s=>n([t,s]);let n;return[t,e,new Promise(s=>(n=s)&&i.once(t,e))]};function ic(i){return bt(this,arguments,function*(){const e=[];let n="error",s=!1,r=null,o,a,c=0,l=[],h;function d(){return o==="peek"?wt(l,a)[0]:([h,l,c]=wt(l,a),h)}if({cmd:o,size:a}=yield yield M(null),i.isTTY)return yield yield M(new Uint8Array(0)),yield M(null);try{e[0]=yn(i,"end"),e[1]=yn(i,"error");do{if(e[2]=yn(i,"readable"),[n,r]=yield M(Promise.race(e.map(j=>j[2]))),n==="error")break;if((s=n==="end")||(Number.isFinite(a-c)?(h=N(i.read(a-c)),h.byteLength<a-c&&(h=N(i.read()))):h=N(i.read()),h.byteLength>0&&(l.push(h),c+=h.byteLength)),s||a<=c)do({cmd:o,size:a}=yield yield M(d()));while(a<c)}while(!s)}finally{yield M(U(e,n==="error"?r:null))}return yield M(null);function U(j,ut){return h=l=null,new Promise((pa,ga)=>{for(const[De,ma]of j)i.off(De,ma);try{const De=i.destroy;De&&De.call(i,ut),ut=void 0}catch(De){ut=De||ut}finally{ut!=null?ga(ut):pa()}})}})}var H;(function(i){i[i.V1=0]="V1",i[i.V2=1]="V2",i[i.V3=2]="V3",i[i.V4=3]="V4",i[i.V5=4]="V5"})(H||(H={}));var W;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(W||(W={}));var J;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(J||(J={}));var ct;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(ct||(ct={}));var f;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(f||(f={}));var It;(function(i){i[i.YEAR_MONTH=0]="YEAR_MONTH",i[i.DAY_TIME=1]="DAY_TIME",i[i.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(It||(It={}));var V;(function(i){i[i.NONE=0]="NONE",i[i.Schema=1]="Schema",i[i.DictionaryBatch=2]="DictionaryBatch",i[i.RecordBatch=3]="RecordBatch",i[i.Tensor=4]="Tensor",i[i.SparseTensor=5]="SparseTensor"})(V||(V={}));var u;(function(i){i[i.NONE=0]="NONE",i[i.Null=1]="Null",i[i.Int=2]="Int",i[i.Float=3]="Float",i[i.Binary=4]="Binary",i[i.Utf8=5]="Utf8",i[i.Bool=6]="Bool",i[i.Decimal=7]="Decimal",i[i.Date=8]="Date",i[i.Time=9]="Time",i[i.Timestamp=10]="Timestamp",i[i.Interval=11]="Interval",i[i.List=12]="List",i[i.Struct=13]="Struct",i[i.Union=14]="Union",i[i.FixedSizeBinary=15]="FixedSizeBinary",i[i.FixedSizeList=16]="FixedSizeList",i[i.Map=17]="Map",i[i.Duration=18]="Duration",i[i.Dictionary=-1]="Dictionary",i[i.Int8=-2]="Int8",i[i.Int16=-3]="Int16",i[i.Int32=-4]="Int32",i[i.Int64=-5]="Int64",i[i.Uint8=-6]="Uint8",i[i.Uint16=-7]="Uint16",i[i.Uint32=-8]="Uint32",i[i.Uint64=-9]="Uint64",i[i.Float16=-10]="Float16",i[i.Float32=-11]="Float32",i[i.Float64=-12]="Float64",i[i.DateDay=-13]="DateDay",i[i.DateMillisecond=-14]="DateMillisecond",i[i.TimestampSecond=-15]="TimestampSecond",i[i.TimestampMillisecond=-16]="TimestampMillisecond",i[i.TimestampMicrosecond=-17]="TimestampMicrosecond",i[i.TimestampNanosecond=-18]="TimestampNanosecond",i[i.TimeSecond=-19]="TimeSecond",i[i.TimeMillisecond=-20]="TimeMillisecond",i[i.TimeMicrosecond=-21]="TimeMicrosecond",i[i.TimeNanosecond=-22]="TimeNanosecond",i[i.DenseUnion=-23]="DenseUnion",i[i.SparseUnion=-24]="SparseUnion",i[i.IntervalDayTime=-25]="IntervalDayTime",i[i.IntervalYearMonth=-26]="IntervalYearMonth",i[i.DurationSecond=-27]="DurationSecond",i[i.DurationMillisecond=-28]="DurationMillisecond",i[i.DurationMicrosecond=-29]="DurationMicrosecond",i[i.DurationNanosecond=-30]="DurationNanosecond"})(u||(u={}));var Ft;(function(i){i[i.OFFSET=0]="OFFSET",i[i.DATA=1]="DATA",i[i.VALIDITY=2]="VALIDITY",i[i.TYPE=3]="TYPE"})(Ft||(Ft={}));const nc=void 0;function se(i){if(i===null)return"null";if(i===nc)return"undefined";switch(typeof i){case"number":return`${i}`;case"bigint":return`${i}`;case"string":return`"${i}"`}return typeof i[Symbol.toPrimitive]=="function"?i[Symbol.toPrimitive]("string"):ArrayBuffer.isView(i)?i instanceof BigInt64Array||i instanceof BigUint64Array?`[${[...i].map(t=>se(t))}]`:`[${i}]`:ArrayBuffer.isView(i)?`[${i}]`:JSON.stringify(i,(t,e)=>typeof e=="bigint"?`${e}`:e)}const sc=Object.freeze(Object.defineProperty({__proto__:null,valueToString:se},Symbol.toStringTag,{value:"Module"})),er=Symbol.for("isArrowBigNum");function Dt(i,...t){return t.length===0?Object.setPrototypeOf(T(this.TypedArray,i),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(i,...t),this.constructor.prototype)}Dt.prototype[er]=!0;Dt.prototype.toJSON=function(){return`"${ze(this)}"`};Dt.prototype.valueOf=function(){return ir(this)};Dt.prototype.toString=function(){return ze(this)};Dt.prototype[Symbol.toPrimitive]=function(i="default"){switch(i){case"number":return ir(this);case"string":return ze(this);case"default":return nr(this)}return ze(this)};function xe(...i){return Dt.apply(this,i)}function Ce(...i){return Dt.apply(this,i)}function ni(...i){return Dt.apply(this,i)}Object.setPrototypeOf(xe.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Ce.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(ni.prototype,Object.create(Uint32Array.prototype));Object.assign(xe.prototype,Dt.prototype,{constructor:xe,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Ce.prototype,Dt.prototype,{constructor:Ce,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(ni.prototype,Dt.prototype,{constructor:ni,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});function ir(i){const{buffer:t,byteOffset:e,length:n,signed:s}=i,r=new BigUint64Array(t,e,n),o=s&&r.at(-1)&BigInt(1)<<BigInt(63);let a=BigInt(o?1:0),c=BigInt(0);if(o){for(const l of r)a+=~l*(BigInt(1)<<BigInt(32)*c++);a*=BigInt(-1)}else for(const l of r)a+=l*(BigInt(1)<<BigInt(32)*c++);return a}const ze=i=>{if(i.byteLength===8)return`${new i.BigIntArray(i.buffer,i.byteOffset,1)[0]}`;if(!i.signed)return pn(i);let t=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return pn(i);t=t.slice();let n=1;for(let r=0;r<t.length;r++){const o=t[r],a=~o+n;t[r]=a,n&=o===0?1:0}return`-${pn(t)}`},nr=i=>i.byteLength===8?new i.BigIntArray(i.buffer,i.byteOffset,1)[0]:ze(i);function pn(i){let t="";const e=new Uint32Array(2);let n=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);const s=new Uint32Array((n=new Uint16Array(n).reverse()).buffer);let r=-1;const o=n.length-1;do{for(e[0]=n[r=0];r<o;)n[r++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+n[r];n[r]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(s[0]||s[1]||s[2]||s[3]);return t??"0"}class fi{static new(t,e){switch(e){case!0:return new xe(t);case!1:return new Ce(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new xe(t)}return t.byteLength===16?new ni(t):new Ce(t)}static signed(t){return new xe(t)}static unsigned(t){return new Ce(t)}static decimal(t){return new ni(t)}constructor(t,e){return fi.new(t,e)}}const rc=Object.freeze(Object.defineProperty({__proto__:null,BN:fi,bigNumToBigInt:nr,bigNumToString:ze,isArrowBigNumSymbol:er},Symbol.toStringTag,{value:"Module"}));function St(i){if(typeof i=="bigint"&&(i<Number.MIN_SAFE_INTEGER||i>Number.MAX_SAFE_INTEGER))throw new TypeError(`${i} is not safe to convert to a number.`);return Number(i)}var sr,rr,or,ar,cr,lr,ur,hr,dr,fr,yr,pr,gr,mr,br,_r,vr,wr,Ir,Sr;class y{static isNull(t){return t?.typeId===u.Null}static isInt(t){return t?.typeId===u.Int}static isFloat(t){return t?.typeId===u.Float}static isBinary(t){return t?.typeId===u.Binary}static isUtf8(t){return t?.typeId===u.Utf8}static isBool(t){return t?.typeId===u.Bool}static isDecimal(t){return t?.typeId===u.Decimal}static isDate(t){return t?.typeId===u.Date}static isTime(t){return t?.typeId===u.Time}static isTimestamp(t){return t?.typeId===u.Timestamp}static isInterval(t){return t?.typeId===u.Interval}static isDuration(t){return t?.typeId===u.Duration}static isList(t){return t?.typeId===u.List}static isStruct(t){return t?.typeId===u.Struct}static isUnion(t){return t?.typeId===u.Union}static isFixedSizeBinary(t){return t?.typeId===u.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===u.FixedSizeList}static isMap(t){return t?.typeId===u.Map}static isDictionary(t){return t?.typeId===u.Dictionary}static isDenseUnion(t){return y.isUnion(t)&&t.mode===W.Dense}static isSparseUnion(t){return y.isUnion(t)&&t.mode===W.Sparse}get typeId(){return u.NONE}}sr=Symbol.toStringTag;y[sr]=(i=>(i.children=null,i.ArrayType=Array,i[Symbol.toStringTag]="DataType"))(y.prototype);let Jt=class extends y{toString(){return"Null"}get typeId(){return u.Null}};rr=Symbol.toStringTag;Jt[rr]=(i=>i[Symbol.toStringTag]="Null")(Jt.prototype);class Q extends y{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return u.Int}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}`}}or=Symbol.toStringTag;Q[or]=(i=>(i.isSigned=null,i.bitWidth=null,i[Symbol.toStringTag]="Int"))(Q.prototype);class Br extends Q{constructor(){super(!0,8)}get ArrayType(){return Int8Array}}class Dr extends Q{constructor(){super(!0,16)}get ArrayType(){return Int16Array}}class ve extends Q{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}let Un=class extends Q{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}};class Ar extends Q{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}}class Or extends Q{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}}class Fr extends Q{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}}let Mr=class extends Q{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Br.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Dr.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(ve.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Un.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Ar.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Or.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Fr.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Mr.prototype,"ArrayType",{value:BigUint64Array});class re extends y{constructor(t){super(),this.precision=t}get typeId(){return u.Float}get ArrayType(){switch(this.precision){case J.HALF:return Uint16Array;case J.SINGLE:return Float32Array;case J.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}ar=Symbol.toStringTag;re[ar]=(i=>(i.precision=null,i[Symbol.toStringTag]="Float"))(re.prototype);class oc extends re{constructor(){super(J.HALF)}}class Tr extends re{constructor(){super(J.SINGLE)}}class xn extends re{constructor(){super(J.DOUBLE)}}Object.defineProperty(oc.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Tr.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(xn.prototype,"ArrayType",{value:Float64Array});let Ni=class extends y{constructor(){super()}get typeId(){return u.Binary}toString(){return"Binary"}};cr=Symbol.toStringTag;Ni[cr]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Binary"))(Ni.prototype);let si=class extends y{constructor(){super()}get typeId(){return u.Utf8}toString(){return"Utf8"}};lr=Symbol.toStringTag;si[lr]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Utf8"))(si.prototype);let ri=class extends y{constructor(){super()}get typeId(){return u.Bool}toString(){return"Bool"}};ur=Symbol.toStringTag;ri[ur]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Bool"))(ri.prototype);let Li=class extends y{constructor(t,e,n=128){super(),this.scale=t,this.precision=e,this.bitWidth=n}get typeId(){return u.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};hr=Symbol.toStringTag;Li[hr]=(i=>(i.scale=null,i.precision=null,i.ArrayType=Uint32Array,i[Symbol.toStringTag]="Decimal"))(Li.prototype);class je extends y{constructor(t){super(),this.unit=t}get typeId(){return u.Date}toString(){return`Date${(this.unit+1)*32}<${ct[this.unit]}>`}}dr=Symbol.toStringTag;je[dr]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Date"))(je.prototype);class gh extends je{constructor(){super(ct.DAY)}}class ac extends je{constructor(){super(ct.MILLISECOND)}}class Ht extends y{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return u.Time}toString(){return`Time${this.bitWidth}<${f[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}fr=Symbol.toStringTag;Ht[fr]=(i=>(i.unit=null,i.bitWidth=null,i[Symbol.toStringTag]="Time"))(Ht.prototype);class mh extends Ht{constructor(){super(f.SECOND,32)}}class bh extends Ht{constructor(){super(f.MILLISECOND,32)}}class _h extends Ht{constructor(){super(f.MICROSECOND,64)}}class vh extends Ht{constructor(){super(f.NANOSECOND,64)}}class oe extends y{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return u.Timestamp}toString(){return`Timestamp<${f[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}yr=Symbol.toStringTag;oe[yr]=(i=>(i.unit=null,i.timezone=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Timestamp"))(oe.prototype);class wh extends oe{constructor(t){super(f.SECOND,t)}}class Ih extends oe{constructor(t){super(f.MILLISECOND,t)}}class Sh extends oe{constructor(t){super(f.MICROSECOND,t)}}class Bh extends oe{constructor(t){super(f.NANOSECOND,t)}}class ke extends y{constructor(t){super(),this.unit=t}get typeId(){return u.Interval}toString(){return`Interval<${It[this.unit]}>`}}pr=Symbol.toStringTag;ke[pr]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Interval"))(ke.prototype);class Dh extends ke{constructor(){super(It.DAY_TIME)}}class Ah extends ke{constructor(){super(It.YEAR_MONTH)}}let ae=class extends y{constructor(t){super(),this.unit=t}get typeId(){return u.Duration}toString(){return`Duration<${f[this.unit]}>`}};gr=Symbol.toStringTag;ae[gr]=(i=>(i.unit=null,i.ArrayType=BigInt64Array,i[Symbol.toStringTag]="Duration"))(ae.prototype);class Fh extends ae{constructor(){super(f.SECOND)}}class Mh extends ae{constructor(){super(f.MILLISECOND)}}class Th extends ae{constructor(){super(f.MICROSECOND)}}class Nh extends ae{constructor(){super(f.NANOSECOND)}}let Pe=class extends y{constructor(t){super(),this.children=[t]}get typeId(){return u.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};mr=Symbol.toStringTag;Pe[mr]=(i=>(i.children=null,i[Symbol.toStringTag]="List"))(Pe.prototype);class K extends y{constructor(t){super(),this.children=t}get typeId(){return u.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}br=Symbol.toStringTag;K[br]=(i=>(i.children=null,i[Symbol.toStringTag]="Struct"))(K.prototype);class we extends y{constructor(t,e,n){super(),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((s,r,o)=>(s[r]=o)&&s||s,Object.create(null))}get typeId(){return u.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}_r=Symbol.toStringTag;we[_r]=(i=>(i.mode=null,i.typeIds=null,i.children=null,i.typeIdToChildIndex=null,i.ArrayType=Int8Array,i[Symbol.toStringTag]="Union"))(we.prototype);class Uh extends we{constructor(t,e){super(W.Dense,t,e)}}class xh extends we{constructor(t,e){super(W.Sparse,t,e)}}let Ui=class extends y{constructor(t){super(),this.byteWidth=t}get typeId(){return u.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};vr=Symbol.toStringTag;Ui[vr]=(i=>(i.byteWidth=null,i.ArrayType=Uint8Array,i[Symbol.toStringTag]="FixedSizeBinary"))(Ui.prototype);let oi=class extends y{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return u.FixedSizeList}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}>`}};wr=Symbol.toStringTag;oi[wr]=(i=>(i.children=null,i.listSize=null,i[Symbol.toStringTag]="FixedSizeList"))(oi.prototype);class ai extends y{constructor(t,e=!1){var n,s,r;if(super(),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t?.type)===null||n===void 0)&&n.children)){const o=(s=t?.type)===null||s===void 0?void 0:s.children[0];o&&(o.name="key");const a=(r=t?.type)===null||r===void 0?void 0:r.children[1];a&&(a.name="value")}}get typeId(){return u.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Ir=Symbol.toStringTag;ai[Ir]=(i=>(i.children=null,i.keysSorted=null,i[Symbol.toStringTag]="Map_"))(ai.prototype);const cc=(i=>()=>++i)(-1);class ce extends y{constructor(t,e,n,s){super(),this.indices=e,this.dictionary=t,this.isOrdered=s||!1,this.id=n==null?cc():St(n)}get typeId(){return u.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}Sr=Symbol.toStringTag;ce[Sr]=(i=>(i.id=null,i.indices=null,i.isOrdered=null,i.dictionary=null,i[Symbol.toStringTag]="Dictionary"))(ce.prototype);function Mt(i){const t=i;switch(i.typeId){case u.Decimal:return i.bitWidth/32;case u.Timestamp:return 2;case u.Date:return 1+t.unit;case u.Interval:return 1+t.unit;case u.FixedSizeList:return t.listSize;case u.FixedSizeBinary:return t.byteWidth;default:return 1}}class O{visitMany(t,...e){return t.map((n,s)=>this.visit(n,...e.map(r=>r[s])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return lc(this,t,e)}getVisitFnByTypeId(t,e=!0){return Me(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function lc(i,t,e=!0){return typeof t=="number"?Me(i,t,e):typeof t=="string"&&t in u?Me(i,u[t],e):t&&t instanceof y?Me(i,As(t),e):t?.type&&t.type instanceof y?Me(i,As(t.type),e):Me(i,u.NONE,e)}function Me(i,t,e=!0){let n=null;switch(t){case u.Null:n=i.visitNull;break;case u.Bool:n=i.visitBool;break;case u.Int:n=i.visitInt;break;case u.Int8:n=i.visitInt8||i.visitInt;break;case u.Int16:n=i.visitInt16||i.visitInt;break;case u.Int32:n=i.visitInt32||i.visitInt;break;case u.Int64:n=i.visitInt64||i.visitInt;break;case u.Uint8:n=i.visitUint8||i.visitInt;break;case u.Uint16:n=i.visitUint16||i.visitInt;break;case u.Uint32:n=i.visitUint32||i.visitInt;break;case u.Uint64:n=i.visitUint64||i.visitInt;break;case u.Float:n=i.visitFloat;break;case u.Float16:n=i.visitFloat16||i.visitFloat;break;case u.Float32:n=i.visitFloat32||i.visitFloat;break;case u.Float64:n=i.visitFloat64||i.visitFloat;break;case u.Utf8:n=i.visitUtf8;break;case u.Binary:n=i.visitBinary;break;case u.FixedSizeBinary:n=i.visitFixedSizeBinary;break;case u.Date:n=i.visitDate;break;case u.DateDay:n=i.visitDateDay||i.visitDate;break;case u.DateMillisecond:n=i.visitDateMillisecond||i.visitDate;break;case u.Timestamp:n=i.visitTimestamp;break;case u.TimestampSecond:n=i.visitTimestampSecond||i.visitTimestamp;break;case u.TimestampMillisecond:n=i.visitTimestampMillisecond||i.visitTimestamp;break;case u.TimestampMicrosecond:n=i.visitTimestampMicrosecond||i.visitTimestamp;break;case u.TimestampNanosecond:n=i.visitTimestampNanosecond||i.visitTimestamp;break;case u.Time:n=i.visitTime;break;case u.TimeSecond:n=i.visitTimeSecond||i.visitTime;break;case u.TimeMillisecond:n=i.visitTimeMillisecond||i.visitTime;break;case u.TimeMicrosecond:n=i.visitTimeMicrosecond||i.visitTime;break;case u.TimeNanosecond:n=i.visitTimeNanosecond||i.visitTime;break;case u.Decimal:n=i.visitDecimal;break;case u.List:n=i.visitList;break;case u.Struct:n=i.visitStruct;break;case u.Union:n=i.visitUnion;break;case u.DenseUnion:n=i.visitDenseUnion||i.visitUnion;break;case u.SparseUnion:n=i.visitSparseUnion||i.visitUnion;break;case u.Dictionary:n=i.visitDictionary;break;case u.Interval:n=i.visitInterval;break;case u.IntervalDayTime:n=i.visitIntervalDayTime||i.visitInterval;break;case u.IntervalYearMonth:n=i.visitIntervalYearMonth||i.visitInterval;break;case u.Duration:n=i.visitDuration;break;case u.DurationSecond:n=i.visitDurationSecond||i.visitDuration;break;case u.DurationMillisecond:n=i.visitDurationMillisecond||i.visitDuration;break;case u.DurationMicrosecond:n=i.visitDurationMicrosecond||i.visitDuration;break;case u.DurationNanosecond:n=i.visitDurationNanosecond||i.visitDuration;break;case u.FixedSizeList:n=i.visitFixedSizeList;break;case u.Map:n=i.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${u[t]}'`)}function As(i){switch(i.typeId){case u.Null:return u.Null;case u.Int:{const{bitWidth:t,isSigned:e}=i;switch(t){case 8:return e?u.Int8:u.Uint8;case 16:return e?u.Int16:u.Uint16;case 32:return e?u.Int32:u.Uint32;case 64:return e?u.Int64:u.Uint64}return u.Int}case u.Float:switch(i.precision){case J.HALF:return u.Float16;case J.SINGLE:return u.Float32;case J.DOUBLE:return u.Float64}return u.Float;case u.Binary:return u.Binary;case u.Utf8:return u.Utf8;case u.Bool:return u.Bool;case u.Decimal:return u.Decimal;case u.Time:switch(i.unit){case f.SECOND:return u.TimeSecond;case f.MILLISECOND:return u.TimeMillisecond;case f.MICROSECOND:return u.TimeMicrosecond;case f.NANOSECOND:return u.TimeNanosecond}return u.Time;case u.Timestamp:switch(i.unit){case f.SECOND:return u.TimestampSecond;case f.MILLISECOND:return u.TimestampMillisecond;case f.MICROSECOND:return u.TimestampMicrosecond;case f.NANOSECOND:return u.TimestampNanosecond}return u.Timestamp;case u.Date:switch(i.unit){case ct.DAY:return u.DateDay;case ct.MILLISECOND:return u.DateMillisecond}return u.Date;case u.Interval:switch(i.unit){case It.DAY_TIME:return u.IntervalDayTime;case It.YEAR_MONTH:return u.IntervalYearMonth}return u.Interval;case u.Duration:switch(i.unit){case f.SECOND:return u.DurationSecond;case f.MILLISECOND:return u.DurationMillisecond;case f.MICROSECOND:return u.DurationMicrosecond;case f.NANOSECOND:return u.DurationNanosecond}return u.Duration;case u.Map:return u.Map;case u.List:return u.List;case u.Struct:return u.Struct;case u.Union:switch(i.mode){case W.Dense:return u.DenseUnion;case W.Sparse:return u.SparseUnion}return u.Union;case u.FixedSizeBinary:return u.FixedSizeBinary;case u.FixedSizeList:return u.FixedSizeList;case u.Dictionary:return u.Dictionary}throw new Error(`Unrecognized type '${u[i.typeId]}'`)}O.prototype.visitInt8=null;O.prototype.visitInt16=null;O.prototype.visitInt32=null;O.prototype.visitInt64=null;O.prototype.visitUint8=null;O.prototype.visitUint16=null;O.prototype.visitUint32=null;O.prototype.visitUint64=null;O.prototype.visitFloat16=null;O.prototype.visitFloat32=null;O.prototype.visitFloat64=null;O.prototype.visitDateDay=null;O.prototype.visitDateMillisecond=null;O.prototype.visitTimestampSecond=null;O.prototype.visitTimestampMillisecond=null;O.prototype.visitTimestampMicrosecond=null;O.prototype.visitTimestampNanosecond=null;O.prototype.visitTimeSecond=null;O.prototype.visitTimeMillisecond=null;O.prototype.visitTimeMicrosecond=null;O.prototype.visitTimeNanosecond=null;O.prototype.visitDenseUnion=null;O.prototype.visitSparseUnion=null;O.prototype.visitIntervalDayTime=null;O.prototype.visitIntervalYearMonth=null;O.prototype.visitDuration=null;O.prototype.visitDurationSecond=null;O.prototype.visitDurationMillisecond=null;O.prototype.visitDurationMicrosecond=null;O.prototype.visitDurationNanosecond=null;const Nr=new Float64Array(1),Ae=new Uint32Array(Nr.buffer);function Cn(i){const t=(i&31744)>>10,e=(i&1023)/1024,n=Math.pow(-1,(i&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function En(i){if(i!==i)return 32256;Nr[0]=i;const t=(Ae[1]&2147483648)>>16&65535;let e=Ae[1]&2146435072,n=0;return e>=1089470464?Ae[0]>0?e=31744:(e=(e&2080374784)>>16,n=(Ae[1]&1048575)>>10):e<=1056964608?(n=1048576+(Ae[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(Ae[1]&1048575)+512>>10),t|e|n&65535}const uc=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:En,uint16ToFloat64:Cn},Symbol.toStringTag,{value:"Module"}));class I extends O{}function D(i){return(t,e,n)=>{if(t.setValid(e,n!=null))return i(t,e,n)}}const hc=(i,t,e)=>{i[t]=Math.trunc(e/864e5)},Vn=(i,t,e)=>{i[t]=Math.trunc(e%4294967296),i[t+1]=Math.trunc(e/4294967296)},dc=(i,t,e)=>{i[t]=Math.trunc(e*1e3%4294967296),i[t+1]=Math.trunc(e*1e3/4294967296)},fc=(i,t,e)=>{i[t]=Math.trunc(e*1e6%4294967296),i[t+1]=Math.trunc(e*1e6/4294967296)},Lr=(i,t,e,n)=>{if(e+1<t.length){const{[e]:s,[e+1]:r}=t;i.set(n.subarray(0,r-s),s)}},yc=({offset:i,values:t},e,n)=>{const s=i+e;n?t[s>>3]|=1<<s%8:t[s>>3]&=~(1<<s%8)},Kt=({values:i},t,e)=>{i[t]=e},Rn=({values:i},t,e)=>{i[t]=e},Ur=({values:i},t,e)=>{i[t]=En(e)},pc=(i,t,e)=>{switch(i.type.precision){case J.HALF:return Ur(i,t,e);case J.SINGLE:case J.DOUBLE:return Rn(i,t,e)}},zn=({values:i},t,e)=>{hc(i,t,e.valueOf())},jn=({values:i},t,e)=>{Vn(i,t*2,e.valueOf())},xr=({stride:i,values:t},e,n)=>{t.set(n.subarray(0,i),i*e)},gc=({values:i,valueOffsets:t},e,n)=>Lr(i,t,e,n),mc=({values:i,valueOffsets:t},e,n)=>{Lr(i,t,e,Zi(n))},Cr=(i,t,e)=>{i.type.unit===ct.DAY?zn(i,t,e):jn(i,t,e)},kn=({values:i},t,e)=>Vn(i,t*2,e/1e3),Pn=({values:i},t,e)=>Vn(i,t*2,e),$n=({values:i},t,e)=>dc(i,t*2,e),Wn=({values:i},t,e)=>fc(i,t*2,e),Er=(i,t,e)=>{switch(i.type.unit){case f.SECOND:return kn(i,t,e);case f.MILLISECOND:return Pn(i,t,e);case f.MICROSECOND:return $n(i,t,e);case f.NANOSECOND:return Wn(i,t,e)}},Yn=({values:i},t,e)=>{i[t]=e},Jn=({values:i},t,e)=>{i[t]=e},Hn=({values:i},t,e)=>{i[t]=e},Kn=({values:i},t,e)=>{i[t]=e},Vr=(i,t,e)=>{switch(i.type.unit){case f.SECOND:return Yn(i,t,e);case f.MILLISECOND:return Jn(i,t,e);case f.MICROSECOND:return Hn(i,t,e);case f.NANOSECOND:return Kn(i,t,e)}},Rr=({values:i,stride:t},e,n)=>{i.set(n.subarray(0,t),t*e)},bc=(i,t,e)=>{const n=i.children[0],s=i.valueOffsets,r=yt.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=s[t],c=s[t+1];a<c;)r(n,a++,e[++o]);else for(let o=-1,a=s[t],c=s[t+1];a<c;)r(n,a++,e.get(++o))},_c=(i,t,e)=>{const n=i.children[0],{valueOffsets:s}=i,r=yt.getVisitFn(n);let{[t]:o,[t+1]:a}=s;const c=e instanceof Map?e.entries():Object.entries(e);for(const l of c)if(r(n,o,l),++o>=a)break},vc=(i,t)=>(e,n,s,r)=>n&&e(n,i,t[r]),wc=(i,t)=>(e,n,s,r)=>n&&e(n,i,t.get(r)),Ic=(i,t)=>(e,n,s,r)=>n&&e(n,i,t.get(s.name)),Sc=(i,t)=>(e,n,s,r)=>n&&e(n,i,t[s.name]),Bc=(i,t,e)=>{const n=i.type.children.map(r=>yt.getVisitFn(r.type)),s=e instanceof Map?Ic(t,e):e instanceof g?wc(t,e):Array.isArray(e)?vc(t,e):Sc(t,e);i.type.children.forEach((r,o)=>s(n[o],i.children[o],r,o))},Dc=(i,t,e)=>{i.type.mode===W.Dense?zr(i,t,e):jr(i,t,e)},zr=(i,t,e)=>{const n=i.type.typeIdToChildIndex[i.typeIds[t]],s=i.children[n];yt.visit(s,i.valueOffsets[t],e)},jr=(i,t,e)=>{const n=i.type.typeIdToChildIndex[i.typeIds[t]],s=i.children[n];yt.visit(s,t,e)},Ac=(i,t,e)=>{var n;(n=i.dictionary)===null||n===void 0||n.set(i.values[t],e)},kr=(i,t,e)=>{i.type.unit===It.DAY_TIME?Gn(i,t,e):qn(i,t,e)},Gn=({values:i},t,e)=>{i.set(e.subarray(0,2),2*t)},qn=({values:i},t,e)=>{i[t]=e[0]*12+e[1]%12},Zn=({values:i},t,e)=>{i[t]=e},Qn=({values:i},t,e)=>{i[t]=e},Xn=({values:i},t,e)=>{i[t]=e},ts=({values:i},t,e)=>{i[t]=e},Pr=(i,t,e)=>{switch(i.type.unit){case f.SECOND:return Zn(i,t,e);case f.MILLISECOND:return Qn(i,t,e);case f.MICROSECOND:return Xn(i,t,e);case f.NANOSECOND:return ts(i,t,e)}},Oc=(i,t,e)=>{const{stride:n}=i,s=i.children[0],r=yt.getVisitFn(s);if(Array.isArray(e))for(let o=-1,a=t*n;++o<n;)r(s,a+o,e[o]);else for(let o=-1,a=t*n;++o<n;)r(s,a+o,e.get(o))};I.prototype.visitBool=D(yc);I.prototype.visitInt=D(Kt);I.prototype.visitInt8=D(Kt);I.prototype.visitInt16=D(Kt);I.prototype.visitInt32=D(Kt);I.prototype.visitInt64=D(Kt);I.prototype.visitUint8=D(Kt);I.prototype.visitUint16=D(Kt);I.prototype.visitUint32=D(Kt);I.prototype.visitUint64=D(Kt);I.prototype.visitFloat=D(pc);I.prototype.visitFloat16=D(Ur);I.prototype.visitFloat32=D(Rn);I.prototype.visitFloat64=D(Rn);I.prototype.visitUtf8=D(mc);I.prototype.visitBinary=D(gc);I.prototype.visitFixedSizeBinary=D(xr);I.prototype.visitDate=D(Cr);I.prototype.visitDateDay=D(zn);I.prototype.visitDateMillisecond=D(jn);I.prototype.visitTimestamp=D(Er);I.prototype.visitTimestampSecond=D(kn);I.prototype.visitTimestampMillisecond=D(Pn);I.prototype.visitTimestampMicrosecond=D($n);I.prototype.visitTimestampNanosecond=D(Wn);I.prototype.visitTime=D(Vr);I.prototype.visitTimeSecond=D(Yn);I.prototype.visitTimeMillisecond=D(Jn);I.prototype.visitTimeMicrosecond=D(Hn);I.prototype.visitTimeNanosecond=D(Kn);I.prototype.visitDecimal=D(Rr);I.prototype.visitList=D(bc);I.prototype.visitStruct=D(Bc);I.prototype.visitUnion=D(Dc);I.prototype.visitDenseUnion=D(zr);I.prototype.visitSparseUnion=D(jr);I.prototype.visitDictionary=D(Ac);I.prototype.visitInterval=D(kr);I.prototype.visitIntervalDayTime=D(Gn);I.prototype.visitIntervalYearMonth=D(qn);I.prototype.visitDuration=D(Pr);I.prototype.visitDurationSecond=D(Zn);I.prototype.visitDurationMillisecond=D(Qn);I.prototype.visitDurationMicrosecond=D(Xn);I.prototype.visitDurationNanosecond=D(ts);I.prototype.visitFixedSizeList=D(Oc);I.prototype.visitMap=D(_c);const yt=new I,gt=Symbol.for("parent"),Ee=Symbol.for("rowIndex");class es{constructor(t,e){return this[gt]=t,this[Ee]=e,new Proxy(this,new Mc)}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Ee],e=this[gt],n=e.type.children,s={};for(let r=-1,o=n.length;++r<o;)s[n[r].name]=st.visit(e.children[r],t);return s}toString(){return`{${[...this].map(([t,e])=>`${se(t)}: ${se(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Fc(this[gt],this[Ee])}}class Fc{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,st.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}}Object.defineProperties(es.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[gt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ee]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});class Mc{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[gt].type.children.map(e=>e.name)}has(t,e){return t[gt].type.children.findIndex(n=>n.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[gt].type.children.findIndex(n=>n.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[gt].type.children.findIndex(s=>s.name===e);if(n!==-1){const s=st.visit(t[gt].children[n],t[Ee]);return Reflect.set(t,e,s),s}}set(t,e,n){const s=t[gt].type.children.findIndex(r=>r.name===e);return s!==-1?(yt.visit(t[gt].children[s],t[Ee],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}}class m extends O{}function S(i){return(t,e)=>t.getValid(e)?i(t,e):null}const Tc=(i,t)=>864e5*i[t],is=(i,t)=>4294967296*i[t+1]+(i[t]>>>0),Nc=(i,t)=>4294967296*(i[t+1]/1e3)+(i[t]>>>0)/1e3,Lc=(i,t)=>4294967296*(i[t+1]/1e6)+(i[t]>>>0)/1e6,$r=i=>new Date(i),Uc=(i,t)=>$r(Tc(i,t)),xc=(i,t)=>$r(is(i,t)),Cc=(i,t)=>null,Wr=(i,t,e)=>{if(e+1>=t.length)return null;const n=t[e],s=t[e+1];return i.subarray(n,s)},Ec=({offset:i,values:t},e)=>{const n=i+e;return(t[n>>3]&1<<n%8)!==0},Yr=({values:i},t)=>Uc(i,t),Jr=({values:i},t)=>xc(i,t*2),he=({stride:i,values:t},e)=>t[i*e],Vc=({stride:i,values:t},e)=>Cn(t[i*e]),Hr=({values:i},t)=>i[t],Rc=({stride:i,values:t},e)=>t.subarray(i*e,i*(e+1)),zc=({values:i,valueOffsets:t},e)=>Wr(i,t,e),jc=({values:i,valueOffsets:t},e)=>{const n=Wr(i,t,e);return n!==null?vn(n):null},kc=({values:i},t)=>i[t],Pc=({type:i,values:t},e)=>i.precision!==J.HALF?t[e]:Cn(t[e]),$c=(i,t)=>i.type.unit===ct.DAY?Yr(i,t):Jr(i,t),Kr=({values:i},t)=>1e3*is(i,t*2),Gr=({values:i},t)=>is(i,t*2),qr=({values:i},t)=>Nc(i,t*2),Zr=({values:i},t)=>Lc(i,t*2),Wc=(i,t)=>{switch(i.type.unit){case f.SECOND:return Kr(i,t);case f.MILLISECOND:return Gr(i,t);case f.MICROSECOND:return qr(i,t);case f.NANOSECOND:return Zr(i,t)}},Qr=({values:i},t)=>i[t],Xr=({values:i},t)=>i[t],to=({values:i},t)=>i[t],eo=({values:i},t)=>i[t],Yc=(i,t)=>{switch(i.type.unit){case f.SECOND:return Qr(i,t);case f.MILLISECOND:return Xr(i,t);case f.MICROSECOND:return to(i,t);case f.NANOSECOND:return eo(i,t)}},Jc=({values:i,stride:t},e)=>fi.decimal(i.subarray(t*e,t*(e+1))),Hc=(i,t)=>{const{valueOffsets:e,stride:n,children:s}=i,{[t*n]:r,[t*n+1]:o}=e,c=s[0].slice(r,o-r);return new g([c])},Kc=(i,t)=>{const{valueOffsets:e,children:n}=i,{[t]:s,[t+1]:r}=e,o=n[0];return new Xi(o.slice(s,r-s))},Gc=(i,t)=>new es(i,t),qc=(i,t)=>i.type.mode===W.Dense?io(i,t):no(i,t),io=(i,t)=>{const e=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[e];return st.visit(n,i.valueOffsets[t])},no=(i,t)=>{const e=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[e];return st.visit(n,t)},Zc=(i,t)=>{var e;return(e=i.dictionary)===null||e===void 0?void 0:e.get(i.values[t])},Qc=(i,t)=>i.type.unit===It.DAY_TIME?so(i,t):ro(i,t),so=({values:i},t)=>i.subarray(2*t,2*(t+1)),ro=({values:i},t)=>{const e=i[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},oo=({values:i},t)=>i[t],ao=({values:i},t)=>i[t],co=({values:i},t)=>i[t],lo=({values:i},t)=>i[t],Xc=(i,t)=>{switch(i.type.unit){case f.SECOND:return oo(i,t);case f.MILLISECOND:return ao(i,t);case f.MICROSECOND:return co(i,t);case f.NANOSECOND:return lo(i,t)}},tl=(i,t)=>{const{stride:e,children:n}=i,r=n[0].slice(t*e,e);return new g([r])};m.prototype.visitNull=S(Cc);m.prototype.visitBool=S(Ec);m.prototype.visitInt=S(kc);m.prototype.visitInt8=S(he);m.prototype.visitInt16=S(he);m.prototype.visitInt32=S(he);m.prototype.visitInt64=S(Hr);m.prototype.visitUint8=S(he);m.prototype.visitUint16=S(he);m.prototype.visitUint32=S(he);m.prototype.visitUint64=S(Hr);m.prototype.visitFloat=S(Pc);m.prototype.visitFloat16=S(Vc);m.prototype.visitFloat32=S(he);m.prototype.visitFloat64=S(he);m.prototype.visitUtf8=S(jc);m.prototype.visitBinary=S(zc);m.prototype.visitFixedSizeBinary=S(Rc);m.prototype.visitDate=S($c);m.prototype.visitDateDay=S(Yr);m.prototype.visitDateMillisecond=S(Jr);m.prototype.visitTimestamp=S(Wc);m.prototype.visitTimestampSecond=S(Kr);m.prototype.visitTimestampMillisecond=S(Gr);m.prototype.visitTimestampMicrosecond=S(qr);m.prototype.visitTimestampNanosecond=S(Zr);m.prototype.visitTime=S(Yc);m.prototype.visitTimeSecond=S(Qr);m.prototype.visitTimeMillisecond=S(Xr);m.prototype.visitTimeMicrosecond=S(to);m.prototype.visitTimeNanosecond=S(eo);m.prototype.visitDecimal=S(Jc);m.prototype.visitList=S(Hc);m.prototype.visitStruct=S(Gc);m.prototype.visitUnion=S(qc);m.prototype.visitDenseUnion=S(io);m.prototype.visitSparseUnion=S(no);m.prototype.visitDictionary=S(Zc);m.prototype.visitInterval=S(Qc);m.prototype.visitIntervalDayTime=S(so);m.prototype.visitIntervalYearMonth=S(ro);m.prototype.visitDuration=S(Xc);m.prototype.visitDurationSecond=S(oo);m.prototype.visitDurationMillisecond=S(ao);m.prototype.visitDurationMicrosecond=S(co);m.prototype.visitDurationNanosecond=S(lo);m.prototype.visitFixedSizeList=S(tl);m.prototype.visitMap=S(Kc);const st=new m,mt=Symbol.for("keys"),Ve=Symbol.for("vals");class Xi{constructor(t){return this[mt]=new g([t.children[0]]).memoize(),this[Ve]=t.children[1],new Proxy(this,new il)}[Symbol.iterator](){return new el(this[mt],this[Ve])}get size(){return this[mt].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[mt],e=this[Ve],n={};for(let s=-1,r=t.length;++s<r;)n[t.get(s)]=st.visit(e,s);return n}toString(){return`{${[...this].map(([t,e])=>`${se(t)}: ${se(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class el{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),st.visit(this.vals,t)]})}}class il{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[mt].toArray().map(String)}has(t,e){return t[mt].includes(e)}getOwnPropertyDescriptor(t,e){if(t[mt].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[mt].indexOf(e);if(n!==-1){const s=st.visit(Reflect.get(t,Ve),n);return Reflect.set(t,e,s),s}}set(t,e,n){const s=t[mt].indexOf(e);return s!==-1?(yt.visit(Reflect.get(t,Ve),s,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}}Object.defineProperties(Xi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[mt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ve]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function nl(i,t,e){const n=i.length,s=t>-1?t:n+t%n;return e?e(i,s):s}let Os;function ns(i,t,e,n){const{length:s=0}=i;let r=typeof t!="number"?0:t,o=typeof e!="number"?s:e;return r<0&&(r=(r%s+s)%s),o<0&&(o=(o%s+s)%s),o<r&&(Os=r,r=o,o=Os),o>s&&(o=s),n?n(i,r,o):[r,o]}const Fs=i=>i!==i;function Be(i){if(typeof i!=="object"||i===null)return Fs(i)?Fs:e=>e===i;if(i instanceof Date){const e=i.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(i)?e=>e?tr(i,e):!1:i instanceof Map?rl(i):Array.isArray(i)?sl(i):i instanceof g?ol(i):al(i,!0)}function sl(i){const t=[];for(let e=-1,n=i.length;++e<n;)t[e]=Be(i[e]);return tn(t)}function rl(i){let t=-1;const e=[];for(const n of i.values())e[++t]=Be(n);return tn(e)}function ol(i){const t=[];for(let e=-1,n=i.length;++e<n;)t[e]=Be(i.get(e));return tn(t)}function al(i,t=!1){const e=Object.keys(i);if(!t&&e.length===0)return()=>!1;const n=[];for(let s=-1,r=e.length;++s<r;)n[s]=Be(i[e[s]]);return tn(n,e)}function tn(i,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return cl(i,e);case Map:return Ms(i,e,e.keys());case Xi:case es:case Object:case void 0:return Ms(i,e,t||Object.keys(e))}return e instanceof g?ll(i,e):!1}}function cl(i,t){const e=i.length;if(t.length!==e)return!1;for(let n=-1;++n<e;)if(!i[n](t[n]))return!1;return!0}function ll(i,t){const e=i.length;if(t.length!==e)return!1;for(let n=-1;++n<e;)if(!i[n](t.get(n)))return!1;return!0}function Ms(i,t,e){const n=e[Symbol.iterator](),s=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),r=t instanceof Map?t.values():Object.values(t)[Symbol.iterator]();let o=0;const a=i.length;let c=r.next(),l=n.next(),h=s.next();for(;o<a&&!l.done&&!h.done&&!c.done&&!(l.value!==h.value||!i[o](c.value));++o,l=n.next(),h=s.next(),c=r.next());return o===a&&l.done&&h.done&&c.done?!0:(n.return&&n.return(),s.return&&s.return(),r.return&&r.return(),!1)}const ul=Object.freeze(Object.defineProperty({__proto__:null,clampIndex:nl,clampRange:ns,createElementComparator:Be},Symbol.toStringTag,{value:"Module"}));function en(i,t,e,n){return(e&1<<n)!==0}function ss(i,t,e,n){return(e&1<<n)>>n}function hl(i,t,e){return e?!!(i[t>>3]|=1<<t%8)||!0:!(i[t>>3]&=~(1<<t%8))&&!1}function ci(i,t,e){const n=e.byteLength+7&-8;if(i>0||e.byteLength<n){const s=new Uint8Array(n);return s.set(i%8===0?e.subarray(i>>3):li(new $e(e,i,t,null,en)).subarray(0,n)),s}return e}function li(i){const t=[];let e=0,n=0,s=0;for(const o of i)o&&(s|=1<<n),++n===8&&(t[e++]=s,s=n=0);(e===0||n>0)&&(t[e++]=s);const r=new Uint8Array(t.length+7&-8);return r.set(t),r}class $e{constructor(t,e,n,s,r){this.bytes=t,this.length=n,this.context=s,this.get=r,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}function xi(i,t,e){if(e-t<=0)return 0;if(e-t<8){let r=0;for(const o of new $e(i,t,e-t,i,ss))r+=o;return r}const n=e>>3<<3,s=t+(t%8===0?0:8-t%8);return xi(i,t,s)+xi(i,n,e)+uo(i,s>>3,n-s>>3)}function uo(i,t,e){let n=0,s=Math.trunc(t);const r=new DataView(i.buffer,i.byteOffset,i.byteLength),o=e===void 0?i.byteLength:s+e;for(;o-s>=4;)n+=Bi(r.getUint32(s)),s+=4;for(;o-s>=2;)n+=Bi(r.getUint16(s)),s+=2;for(;o-s>=1;)n+=Bi(r.getUint8(s)),s+=1;return n}function Bi(i){let t=Math.trunc(i);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const dl=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:$e,getBit:ss,getBool:en,packBools:li,popcnt_array:uo,popcnt_bit_range:xi,popcnt_uint32:Bi,setBool:hl,truncateBitmap:ci},Symbol.toStringTag,{value:"Module"})),fl=-1;class C{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){const{type:t}=this;return y.isSparseUnion(t)?this.children.some(e=>e.nullable):y.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:s,typeIds:r}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),r&&(t+=r.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(y.isUnion(this.type))return this.children.reduce((n,s)=>n+s.nullCount,0);let t=this._nullCount,e;return t<=fl&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-xi(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,s,r,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(s||0,-1));let c;r instanceof C?(this.stride=r.stride,this.values=r.values,this.typeIds=r.typeIds,this.nullBitmap=r.nullBitmap,this.valueOffsets=r.valueOffsets):(this.stride=Mt(t),r&&((c=r[0])&&(this.valueOffsets=c),(c=r[1])&&(this.values=c),(c=r[2])&&(this.nullBitmap=c),(c=r[3])&&(this.typeIds=c)))}getValid(t){const{type:e}=this;if(y.isUnion(e)){const n=e,s=this.children[n.typeIdToChildIndex[this.typeIds[t]]],r=n.mode===W.Dense?this.valueOffsets[t]:t;return s.getValid(r)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(t,e){let n;const{type:s}=this;if(y.isUnion(s)){const r=s,o=this.children[r.typeIdToChildIndex[this.typeIds[t]]],a=r.mode===W.Dense?this.valueOffsets[t]:t;n=o.getValid(a),o.setValid(a,e)}else{let{nullBitmap:r}=this;const{offset:o,length:a}=this,c=o+t,l=1<<c%8,h=c>>3;(!r||r.byteLength<=h)&&(r=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0&&r.set(ci(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r,_nullCount:-1}));const d=r[h];n=(d&l)!==0,e?r[h]=d|l:r[h]=d&~l}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,s=this._nullCount,r=this,o=this.children){return new C(t,e,n,s,r,o,this.dictionary)}slice(t,e){const{stride:n,typeId:s,children:r}=this,o=+(this._nullCount===0)-1,a=s===16?n:1,c=this._sliceBuffers(t,e,n,s);return this.clone(this.type,this.offset+t,e,o,c,r.length===0||this.valueOffsets?r:this._sliceChildren(r,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===u.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,s=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);s[e>>3]=(1<<e-(e&-8))-1,n>0&&s.set(ci(this.offset,e,this.nullBitmap),0);const r=this.buffers;return r[Ft.VALIDITY]=s,this.clone(this.type,0,t,n+(t-e),r)}_sliceBuffers(t,e,n,s){let r;const{buffers:o}=this;return(r=o[Ft.TYPE])&&(o[Ft.TYPE]=r.subarray(t,t+e)),(r=o[Ft.OFFSET])&&(o[Ft.OFFSET]=r.subarray(t,t+e+1))||(r=o[Ft.DATA])&&(o[Ft.DATA]=s===6?r:r.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(s=>s.slice(e,n))}}C.prototype.children=Object.freeze([]);class ti extends O{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:n=0,["length"]:s=0}=t;return new C(e,n,s,s)}visitBool(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitInt(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitFloat(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitUtf8(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.data),r=N(t.nullBitmap),o=Fe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[o,s,r])}visitBinary(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.data),r=N(t.nullBitmap),o=Fe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[o,s,r])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitDate(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitTimestamp(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitTime(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitDecimal(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitList(t){const{["type"]:e,["offset"]:n=0,["child"]:s}=t,r=N(t.nullBitmap),o=Fe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[o,void 0,r],[s])}visitStruct(t){const{["type"]:e,["offset"]:n=0,["children"]:s=[]}=t,r=N(t.nullBitmap),{length:o=s.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,void 0,r],s)}visitUnion(t){const{["type"]:e,["offset"]:n=0,["children"]:s=[]}=t,r=T(e.ArrayType,t.typeIds),{["length"]:o=r.length,["nullCount"]:a=-1}=t;if(y.isSparseUnion(e))return new C(e,n,o,a,[void 0,void 0,void 0,r],s);const c=Fe(t.valueOffsets);return new C(e,n,o,a,[c,void 0,void 0,r],s)}visitDictionary(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.indices.ArrayType,t.data),{["dictionary"]:o=new g([new ti().visit({type:e.dictionary})])}=t,{["length"]:a=r.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[void 0,r,s],[],o)}visitInterval(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitDuration(t){const{["type"]:e,["offset"]:n=0}=t,s=N(t.nullBitmap),r=T(e.ArrayType,t.data),{["length"]:o=r.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,r,s])}visitFixedSizeList(t){const{["type"]:e,["offset"]:n=0,["child"]:s=new ti().visit({type:e.valueType})}=t,r=N(t.nullBitmap),{["length"]:o=s.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new C(e,n,o,a,[void 0,void 0,r],[s])}visitMap(t){const{["type"]:e,["offset"]:n=0,["child"]:s=new ti().visit({type:e.childType})}=t,r=N(t.nullBitmap),o=Fe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new C(e,n,a,c,[o,void 0,r],[s])}}const yl=new ti;function w(i){return yl.visit(i)}class Ts{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){const t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}function ho(i){return i.reduce((t,e)=>t+e.nullCount,0)}function fo(i){return i.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(i.length+1))}function yo(i,t,e,n){const s=[];for(let r=-1,o=i.length;++r<o;){const a=i[r],c=t[r],{length:l}=a;if(c>=n)break;if(e>=c+l)continue;if(c>=e&&c+l<=n){s.push(a);continue}const h=Math.max(0,e-c),d=Math.min(n-c,l);s.push(a.slice(h,d-h))}return s.length===0&&s.push(i[0].slice(0,0)),s}function rs(i,t,e,n){let s=0,r=0,o=t.length-1;do{if(s>=o-1)return e<t[o]?n(i,s,e-t[s]):null;r=s+Math.trunc((o-s)*.5),e<t[r]?o=r:s=r}while(s<o)}function os(i,t){return i.getValid(t)}function Re(i){function t(e,n,s){return i(e[n],s)}return function(e){const n=this.data;return rs(n,this._offsets,e,t)}}function po(i){let t;function e(n,s,r){return i(n[s],r,t)}return function(n,s){const r=this.data;t=s;const o=rs(r,this._offsets,n,e);return t=void 0,o}}function go(i){let t;function e(n,s,r){let o=r,a=0,c=0;for(let l=s-1,h=n.length;++l<h;){const d=n[l];if(~(a=i(d,t,o)))return c+a;o=0,c+=d.length}return-1}return function(n,s){t=n;const r=this.data,o=typeof s!="number"?e(r,0,0):rs(r,this._offsets,s,e);return t=void 0,o}}class b extends O{}function pl(i,t){return t===null&&i.length>0?0:-1}function gl(i,t){const{nullBitmap:e}=i;if(!e||i.nullCount<=0)return-1;let n=0;for(const s of new $e(e,i.offset+(t||0),i.length,e,en)){if(!s)return n;++n}return-1}function A(i,t,e){if(t===void 0)return-1;if(t===null)switch(i.typeId){case u.Union:break;case u.Dictionary:break;default:return gl(i,e)}const n=st.getVisitFn(i),s=Be(t);for(let r=(e||0)-1,o=i.length;++r<o;)if(s(n(i,r)))return r;return-1}function mo(i,t,e){const n=st.getVisitFn(i),s=Be(t);for(let r=(e||0)-1,o=i.length;++r<o;)if(s(n(i,r)))return r;return-1}b.prototype.visitNull=pl;b.prototype.visitBool=A;b.prototype.visitInt=A;b.prototype.visitInt8=A;b.prototype.visitInt16=A;b.prototype.visitInt32=A;b.prototype.visitInt64=A;b.prototype.visitUint8=A;b.prototype.visitUint16=A;b.prototype.visitUint32=A;b.prototype.visitUint64=A;b.prototype.visitFloat=A;b.prototype.visitFloat16=A;b.prototype.visitFloat32=A;b.prototype.visitFloat64=A;b.prototype.visitUtf8=A;b.prototype.visitBinary=A;b.prototype.visitFixedSizeBinary=A;b.prototype.visitDate=A;b.prototype.visitDateDay=A;b.prototype.visitDateMillisecond=A;b.prototype.visitTimestamp=A;b.prototype.visitTimestampSecond=A;b.prototype.visitTimestampMillisecond=A;b.prototype.visitTimestampMicrosecond=A;b.prototype.visitTimestampNanosecond=A;b.prototype.visitTime=A;b.prototype.visitTimeSecond=A;b.prototype.visitTimeMillisecond=A;b.prototype.visitTimeMicrosecond=A;b.prototype.visitTimeNanosecond=A;b.prototype.visitDecimal=A;b.prototype.visitList=A;b.prototype.visitStruct=A;b.prototype.visitUnion=A;b.prototype.visitDenseUnion=mo;b.prototype.visitSparseUnion=mo;b.prototype.visitDictionary=A;b.prototype.visitInterval=A;b.prototype.visitIntervalDayTime=A;b.prototype.visitIntervalYearMonth=A;b.prototype.visitDuration=A;b.prototype.visitDurationSecond=A;b.prototype.visitDurationMillisecond=A;b.prototype.visitDurationMicrosecond=A;b.prototype.visitDurationNanosecond=A;b.prototype.visitFixedSizeList=A;b.prototype.visitMap=A;const Ci=new b;class _ extends O{}function B(i){const{type:t}=i;if(i.nullCount===0&&i.stride===1&&(t.typeId===u.Timestamp||t instanceof Q&&t.bitWidth!==64||t instanceof Ht&&t.bitWidth!==64||t instanceof re&&t.precision!==J.HALF))return new Ts(i.data.length,n=>{const s=i.data[n];return s.values.subarray(0,s.length)[Symbol.iterator]()});let e=0;return new Ts(i.data.length,n=>{const r=i.data[n].length,o=i.slice(e,e+r);return e+=r,new ml(o)})}class ml{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}}_.prototype.visitNull=B;_.prototype.visitBool=B;_.prototype.visitInt=B;_.prototype.visitInt8=B;_.prototype.visitInt16=B;_.prototype.visitInt32=B;_.prototype.visitInt64=B;_.prototype.visitUint8=B;_.prototype.visitUint16=B;_.prototype.visitUint32=B;_.prototype.visitUint64=B;_.prototype.visitFloat=B;_.prototype.visitFloat16=B;_.prototype.visitFloat32=B;_.prototype.visitFloat64=B;_.prototype.visitUtf8=B;_.prototype.visitBinary=B;_.prototype.visitFixedSizeBinary=B;_.prototype.visitDate=B;_.prototype.visitDateDay=B;_.prototype.visitDateMillisecond=B;_.prototype.visitTimestamp=B;_.prototype.visitTimestampSecond=B;_.prototype.visitTimestampMillisecond=B;_.prototype.visitTimestampMicrosecond=B;_.prototype.visitTimestampNanosecond=B;_.prototype.visitTime=B;_.prototype.visitTimeSecond=B;_.prototype.visitTimeMillisecond=B;_.prototype.visitTimeMicrosecond=B;_.prototype.visitTimeNanosecond=B;_.prototype.visitDecimal=B;_.prototype.visitList=B;_.prototype.visitStruct=B;_.prototype.visitUnion=B;_.prototype.visitDenseUnion=B;_.prototype.visitSparseUnion=B;_.prototype.visitDictionary=B;_.prototype.visitInterval=B;_.prototype.visitIntervalDayTime=B;_.prototype.visitIntervalYearMonth=B;_.prototype.visitDuration=B;_.prototype.visitDurationSecond=B;_.prototype.visitDurationMillisecond=B;_.prototype.visitDurationMicrosecond=B;_.prototype.visitDurationNanosecond=B;_.prototype.visitFixedSizeList=B;_.prototype.visitMap=B;const as=new _,bl=(i,t)=>i+t;class de extends O{visitNull(t,e){return 0}visitInt(t,e){return t.type.bitWidth/8}visitFloat(t,e){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,e){return 1/8}visitDecimal(t,e){return t.type.bitWidth/8}visitDate(t,e){return(t.type.unit+1)*4}visitTime(t,e){return t.type.bitWidth/8}visitTimestamp(t,e){return t.type.unit===f.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitDuration(t,e){return 8}visitStruct(t,e){return t.children.reduce((n,s)=>n+Vt.visit(s,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((n,s)=>n+Vt.visit(s,e),0)}visitDictionary(t,e){var n;return t.type.indices.bitWidth/8+(((n=t.dictionary)===null||n===void 0?void 0:n.getByteLength(t.values[e]))||0)}}const _l=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),vl=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),wl=({valueOffsets:i,stride:t,children:e},n)=>{const s=e[0],{[n*t]:r}=i,{[n*t+1]:o}=i,a=Vt.getVisitFn(s.type),c=s.slice(r,o-r);let l=8;for(let h=-1,d=o-r;++h<d;)l+=a(c,h);return l},Il=({stride:i,children:t},e)=>{const n=t[0],s=n.slice(e*i,i),r=Vt.getVisitFn(n.type);let o=0;for(let a=-1,c=s.length;++a<c;)o+=r(s,a);return o},Sl=(i,t)=>i.type.mode===W.Dense?bo(i,t):_o(i,t),bo=({type:i,children:t,typeIds:e,valueOffsets:n},s)=>{const r=i.typeIdToChildIndex[e[s]];return 8+Vt.visit(t[r],n[s])},_o=({children:i},t)=>4+Vt.visitMany(i,i.map(()=>t)).reduce(bl,0);de.prototype.visitUtf8=_l;de.prototype.visitBinary=vl;de.prototype.visitList=wl;de.prototype.visitFixedSizeList=Il;de.prototype.visitUnion=Sl;de.prototype.visitDenseUnion=bo;de.prototype.visitSparseUnion=_o;const Vt=new de;var vo;const wo={},Io={};class g{constructor(t){var e,n,s;const r=t[0]instanceof g?t.flatMap(a=>a.data):t;if(r.length===0||r.some(a=>!(a instanceof C)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=r[0])===null||e===void 0?void 0:e.type;switch(r.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:c,indexOf:l,byteLength:h}=wo[o.typeId],d=r[0];this.isValid=U=>os(d,U),this.get=U=>a(d,U),this.set=(U,j)=>c(d,U,j),this.indexOf=U=>l(d,U),this.getByteLength=U=>h(d,U),this._offsets=[0,d.length];break}default:Object.setPrototypeOf(this,Io[o.typeId]),this._offsets=fo(r);break}this.data=r,this.type=o,this.stride=Mt(o),this.numChildren=(s=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&s!==void 0?s:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullCount(){return ho(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${u[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}getByteLength(t){return 0}[Symbol.iterator](){return as.visit(this)}concat(...t){return new g(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new g(ns(this,t,e,({data:n,_offsets:s},r,o)=>yo(n,s,r,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:s,ArrayType:r}=this;switch(t.typeId){case u.Int:case u.Float:case u.Decimal:case u.Time:case u.Timestamp:switch(e.length){case 0:return new r;case 1:return e[0].values.subarray(0,n*s);default:return e.reduce((o,{values:a,length:c})=>(o.array.set(a.subarray(0,c*s),o.offset),o.offset+=c*s,o),{array:new r(n*s),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new g(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return y.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(y.isDictionary(this.type)){const t=new Ei(this.data[0].dictionary),e=this.data.map(n=>{const s=n.clone();return s.dictionary=t,s});return new g(e)}return new Ei(this)}unmemoize(){if(y.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const s=n.clone();return s.dictionary=t,s});return new g(e)}return this}}vo=Symbol.toStringTag;g[vo]=(i=>{i.type=y.prototype,i.data=[],i.length=0,i.stride=1,i.numChildren=0,i._offsets=new Uint32Array([0]),i[Symbol.isConcatSpreadable]=!0;const t=Object.keys(u).map(e=>u[e]).filter(e=>typeof e=="number"&&e!==u.NONE);for(const e of t){const n=st.getVisitFnByTypeId(e),s=yt.getVisitFnByTypeId(e),r=Ci.getVisitFnByTypeId(e),o=Vt.getVisitFnByTypeId(e);wo[e]={get:n,set:s,indexOf:r,byteLength:o},Io[e]=Object.create(i,{isValid:{value:Re(os)},get:{value:Re(st.getVisitFnByTypeId(e))},set:{value:po(yt.getVisitFnByTypeId(e))},indexOf:{value:go(Ci.getVisitFnByTypeId(e))},getByteLength:{value:Re(Vt.getVisitFnByTypeId(e))}})}return"Vector"})(g.prototype);class Ei extends g{constructor(t){super(t.data);const e=this.get,n=this.set,s=this.slice,r=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=r[o];if(a!==void 0)return a;const c=e.call(this,o);return r[o]=c,c}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),r[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new Ei(s.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new g(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}function cs(i){if(i){if(i instanceof C)return new g([i]);if(i instanceof g)return new g(i.data);if(i.type instanceof y)return new g([w(i)]);if(Array.isArray(i))return new g(i.flatMap(t=>Bl(t)));if(ArrayBuffer.isView(i)){i instanceof DataView&&(i=new Uint8Array(i.buffer));const t={offset:0,length:i.length,nullCount:0,data:i};if(i instanceof Int8Array)return new g([w(Object.assign(Object.assign({},t),{type:new Br}))]);if(i instanceof Int16Array)return new g([w(Object.assign(Object.assign({},t),{type:new Dr}))]);if(i instanceof Int32Array)return new g([w(Object.assign(Object.assign({},t),{type:new ve}))]);if(i instanceof BigInt64Array)return new g([w(Object.assign(Object.assign({},t),{type:new Un}))]);if(i instanceof Uint8Array||i instanceof Uint8ClampedArray)return new g([w(Object.assign(Object.assign({},t),{type:new Ar}))]);if(i instanceof Uint16Array)return new g([w(Object.assign(Object.assign({},t),{type:new Or}))]);if(i instanceof Uint32Array)return new g([w(Object.assign(Object.assign({},t),{type:new Fr}))]);if(i instanceof BigUint64Array)return new g([w(Object.assign(Object.assign({},t),{type:new Mr}))]);if(i instanceof Float32Array)return new g([w(Object.assign(Object.assign({},t),{type:new Tr}))]);if(i instanceof Float64Array)return new g([w(Object.assign(Object.assign({},t),{type:new xn}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function Bl(i){return i instanceof C?[i]:i instanceof g?i.data:cs(i).data}function Dl(i){if(!i||i.length<=0)return function(s){return!0};let t="";const e=i.filter(n=>n===n);return e.length>0&&(t=`
2
- switch (x) {${e.map(n=>`
3
- case ${Al(n)}:`).join("")}
4
- return false;
5
- }`),i.length!==e.length&&(t=`if (x !== x) return false;
6
- ${t}`),new Function("x",`${t}
7
- return true;`)}function Al(i){return typeof i!="bigint"?se(i):`${se(i)}n`}const gn=(i,t)=>(Math.ceil(i)*t+63&-64||64)/t,Ol=(i,t=0)=>i.length>=t?i.subarray(0,t):ii(new i.constructor(t),i,0);class nn{constructor(t,e=1){this.buffer=t,this.stride=e,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=Math.ceil(t.length/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(t,e){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;const e=this.stride,n=this.length*e,s=this.buffer.length;n>=s&&this._resize(s===0?gn(n*1,this.BYTES_PER_ELEMENT):gn(n*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=gn(t*this.stride,this.BYTES_PER_ELEMENT);const e=Ol(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=ii(new this.ArrayType(t),this.buffer)}}nn.prototype.offset=0;class yi extends nn{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,e){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=e,this}}class So extends yi{constructor(t=new Uint8Array(0)){super(t,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,e){const{buffer:n}=this.reserve(t-this.length+1),s=t>>3,r=t%8,o=n[s]>>r&1;return e?o===0&&(n[s]|=1<<r,++this.numValid):o===1&&(n[s]&=~(1<<r),--this.numValid),this}clear(){return this.numValid=0,super.clear()}}class Bo extends yi{constructor(t=new Int32Array(1)){super(t,1)}append(t){return this.set(this.length-1,t)}set(t,e){const n=this.length-1,s=this.reserve(t-n+1).buffer;return n<t++&&s.fill(s[n],n,t),s[t]=s[t-1]+e,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,0),super.flush(t+1)}}let X=class{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}constructor({type:t,nullValues:e}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=e,this.stride=Mt(t),this._nulls=new So,e&&e.length>0&&(this._isValid=Dl(e))}toVector(){return new g([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0;const{_offsets:e,_values:n,_nulls:s,_typeIds:r,children:o}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),r&&(t+=r.byteLength),o.reduce((a,c)=>a+c.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((e,n)=>e+n.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,e){return this.setValid(t,this.isValid(e))&&this.setValue(t,e),this}setValue(t,e){this._setValue(this,t,e)}setValid(t,e){return this.length=this._nulls.set(t,+e).length,e}addChild(t,e=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,e,n,s;const{type:r,length:o,nullCount:a,_typeIds:c,_offsets:l,_values:h,_nulls:d}=this;(e=c?.flush(o))?s=l?.flush(o):(s=l?.flush(o))?t=h?.flush(l.last()):t=h?.flush(o),a>0&&(n=d?.flush(o));const U=this.children.map(j=>j.flush());return this.clear(),w({type:r,length:o,nullCount:a,children:U,child:U[0],data:t,typeIds:e,nullBitmap:n,valueOffsets:s})}finish(){this.finished=!0;for(const t of this.children)t.finish();return this}clear(){var t,e,n,s;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(e=this._values)===null||e===void 0||e.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(s=this._typeIds)===null||s===void 0||s.clear();for(const r of this.children)r.clear();return this}};X.prototype.length=1;X.prototype.stride=1;X.prototype.children=null;X.prototype.finished=!1;X.prototype.nullValues=null;X.prototype._isValid=()=>!0;class Gt extends X{constructor(t){super(t),this._values=new yi(new this.ArrayType(0),this.stride)}setValue(t,e){const n=this._values;return n.reserve(t-n.length+1),super.setValue(t,e)}}class sn extends X{constructor(t){super(t),this._pendingLength=0,this._offsets=new Bo}setValue(t,e){const n=this._pending||(this._pending=new Map),s=n.get(t);s&&(this._pendingLength-=s.length),this._pendingLength+=e instanceof Xi?e[mt].length:e.length,n.set(t,e)}setValid(t,e){return super.setValid(t,e)?!0:((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){const t=this._pending,e=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,e),this}}class Sn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,e,n,s){return t.prep(8,24),t.writeInt64(BigInt(s??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(e??0)),t.offset()}}const mn=2,Tt=4,Wt=4,R=4,te=new Int32Array(2),Ns=new Float32Array(te.buffer),Ls=new Float64Array(te.buffer),wi=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Bn;(function(i){i[i.UTF8_BYTES=1]="UTF8_BYTES",i[i.UTF16_STRING=2]="UTF16_STRING"})(Bn||(Bn={}));let We=class Do{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new Do(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return te[0]=this.readInt32(t),Ns[0]}readFloat64(t){return te[wi?0:1]=this.readInt32(t),te[wi?1:0]=this.readInt32(t+4),Ls[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}writeUint64(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}writeFloat32(t,e){Ns[0]=e,this.writeInt32(t,te[0])}writeFloat64(t,e){Ls[0]=e,this.writeInt32(t,te[wi?0:1]),this.writeInt32(t+4,te[wi?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+Tt+Wt)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<Wt;e++)t+=String.fromCharCode(this.readInt8(this.position_+Tt+e));return t}__offset(t,e){const n=t-this.readInt32(t);return e<this.readInt16(n)?this.readInt16(n+e):0}__union(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t}__string(t,e){t+=this.readInt32(t);const n=this.readInt32(t);t+=Tt;const s=this.bytes_.subarray(t,t+n);return e===Bn.UTF8_BYTES?s:this.text_decoder_.decode(s)}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+Tt}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=Wt)throw new Error("FlatBuffers: file identifier must be length "+Wt);for(let e=0;e<Wt;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+Tt+e))return!1;return!0}createScalarList(t,e){const n=[];for(let s=0;s<e;++s){const r=t(s);r!==null&&n.push(r)}return n}createObjList(t,e){const n=[];for(let s=0;s<e;++s){const r=t(s);r!==null&&n.push(r.unpack())}return n}},Ao=class Oo{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let e;t?e=t:e=1024,this.bb=We.allocate(e),this.space=e}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,e){t>this.minalign&&(this.minalign=t);const n=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<n+t+e;){const s=this.bb.capacity();this.bb=Oo.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}this.pad(n)}pad(t){for(let e=0;e<t;e++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,e,n){(this.force_defaults||e!=n)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,n){(this.force_defaults||e!=n)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,n){(this.force_defaults||e!=n)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,n){(this.force_defaults||e!==n)&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,n){(this.force_defaults||e!=n)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,n){(this.force_defaults||e!=n)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,n){(this.force_defaults||e!=n)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,n){e!=n&&(this.nested(e),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){const e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const n=e<<1,s=We.allocate(n);return s.setPosition(n-e),s.bytes().set(t.bytes(),n-e),s}addOffset(t){this.prep(Tt,0),this.writeInt32(this.offset()-t+Tt)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let e=0;e<t;e++)this.vtable[e]=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);const t=this.offset();let e=this.vtable_in_use-1;for(;e>=0&&this.vtable[e]==0;e--);const n=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const s=2;this.addInt16(t-this.object_start);const r=(n+s)*mn;this.addInt16(r);let o=0;const a=this.space;t:for(e=0;e<this.vtables.length;e++){const c=this.bb.capacity()-this.vtables[e];if(r==this.bb.readInt16(c)){for(let l=mn;l<r;l+=mn)if(this.bb.readInt16(a+l)!=this.bb.readInt16(c+l))continue t;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,o-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,n){const s=n?R:0;if(e){const r=e;if(this.prep(this.minalign,Tt+Wt+s),r.length!=Wt)throw new TypeError("FlatBuffers: file identifier must be length "+Wt);for(let o=Wt-1;o>=0;o--)this.writeInt8(r.charCodeAt(o))}this.prep(this.minalign,Tt+s),this.addOffset(t),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const n=this.bb.capacity()-t,s=n-this.bb.readInt32(n);if(!(e<this.bb.readInt16(s)&&this.bb.readInt16(s+e)!=0))throw new TypeError("FlatBuffers: field "+e+" must be set")}startVector(t,e,n){this.notNested(),this.vector_num_elems=e,this.prep(Tt,t*e),this.prep(n,t*e)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);const e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(t==null)return 0;let e;t instanceof Uint8Array?e=t:e=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let n=0,s=this.space,r=this.bb.bytes();n<e.length;n++)r[s++]=e[n];return this.endVector()}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){const e=[];for(let n=0;n<t.length;++n){const s=t[n];if(s!==null)e.push(this.createObjectOffset(s));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};class ${constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKeyValue(t,e){return(e||new $).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+R),(e||new $).__init(t.readInt32(t.position())+t.position(),t)}key(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}value(t){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,e){t.addFieldOffset(0,e,0)}static addValue(t,e){t.addFieldOffset(1,e,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,e,n){return $.startKeyValue(t),$.addKey(t,e),$.addValue(t,n),$.endKeyValue(t)}}var Ye;(function(i){i[i.V1=0]="V1",i[i.V2=1]="V2",i[i.V3=2]="V3",i[i.V4=3]="V4",i[i.V5=4]="V5"})(Ye||(Ye={}));var Je;(function(i){i[i.Little=0]="Little",i[i.Big=1]="Big"})(Je||(Je={}));var Vi;(function(i){i[i.DenseArray=0]="DenseArray"})(Vi||(Vi={}));class at{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInt(t,e){return(e||new at).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+R),(e||new at).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,e){t.addFieldInt32(0,e,0)}static addIsSigned(t,e){t.addFieldInt8(1,+e,0)}static endInt(t){return t.endObject()}static createInt(t,e,n){return at.startInt(t),at.addBitWidth(t,e),at.addIsSigned(t,n),at.endInt(t)}}class Yt{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryEncoding(t,e){return(e||new Yt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+R),(e||new Yt).__init(t.readInt32(t.position())+t.position(),t)}id(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}indexType(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new at).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isOrdered(){const t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):Vi.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addIndexType(t,e){t.addFieldOffset(1,e,0)}static addIsOrdered(t,e){t.addFieldInt8(2,+e,0)}static addDictionaryKind(t,e){t.addFieldInt16(3,e,Vi.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}class ye{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBinary(t,e){return(e||new ye).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+R),(e||new ye).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return ye.startBinary(t),ye.endBinary(t)}}class pe{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBool(t,e){return(e||new pe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+R),(e||new pe).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return pe.startBool(t),pe.endBool(t)}}var Ri;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(Ri||(Ri={}));let Di=class Te{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDate(t,e){return(e||new Te).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+R),(e||new Te).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ri.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Ri.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return Te.startDate(t),Te.addUnit(t,e),Te.endDate(t)}};class et{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDecimal(t,e){return(e||new et).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+R),(e||new et).__init(t.readInt32(t.position())+t.position(),t)}precision(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,e){t.addFieldInt32(0,e,0)}static addScale(t,e){t.addFieldInt32(1,e,0)}static addBitWidth(t,e){t.addFieldInt32(2,e,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,e,n,s){return et.startDecimal(t),et.addPrecision(t,e),et.addScale(t,n),et.addBitWidth(t,s),et.endDecimal(t)}}var le;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(le||(le={}));class Nt{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDuration(t,e){return(e||new Nt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,e){return t.setPosition(t.position()+R),(e||new Nt).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):le.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,le.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,e){return Nt.startDuration(t),Nt.addUnit(t,e),Nt.endDuration(t)}}class Lt{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeBinary(t,e){return(e||new Lt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+R),(e||new Lt).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,e){return Lt.startFixedSizeBinary(t),Lt.addByteWidth(t,e),Lt.endFixedSizeBinary(t)}}class Ut{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeList(t,e){return(e||new Ut).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+R),(e||new Ut).__init(t.readInt32(t.position())+t.position(),t)}listSize(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,e){return Ut.startFixedSizeList(t),Ut.addListSize(t,e),Ut.endFixedSizeList(t)}}var zi;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(zi||(zi={}));class xt{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFloatingPoint(t,e){return(e||new xt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+R),(e||new xt).__init(t.readInt32(t.position())+t.position(),t)}precision(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):zi.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,zi.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return xt.startFloatingPoint(t),xt.addPrecision(t,e),xt.endFloatingPoint(t)}}var ji;(function(i){i[i.YEAR_MONTH=0]="YEAR_MONTH",i[i.DAY_TIME=1]="DAY_TIME",i[i.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(ji||(ji={}));class Ct{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInterval(t,e){return(e||new Ct).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+R),(e||new Ct).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ji.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,ji.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return Ct.startInterval(t),Ct.addUnit(t,e),Ct.endInterval(t)}}class ge{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsList(t,e){return(e||new ge).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+R),(e||new ge).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return ge.startList(t),ge.endList(t)}}let Ai=class Ne{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMap(t,e){return(e||new Ne).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+R),(e||new Ne).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){const t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,e){t.addFieldInt8(0,+e,0)}static endMap(t){return t.endObject()}static createMap(t,e){return Ne.startMap(t),Ne.addKeysSorted(t,e),Ne.endMap(t)}};class me{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNull(t,e){return(e||new me).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+R),(e||new me).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return me.startNull(t),me.endNull(t)}}class be{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsStruct_(t,e){return(e||new be).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+R),(e||new be).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return be.startStruct_(t),be.endStruct_(t)}}class dt{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTime(t,e){return(e||new dt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+R),(e||new dt).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):le.MILLISECOND}bitWidth(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,le.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,n){return dt.startTime(t),dt.addUnit(t,e),dt.addBitWidth(t,n),dt.endTime(t)}}class ft{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTimestamp(t,e){return(e||new ft).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+R),(e||new ft).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):le.SECOND}timezone(t){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,e){t.addFieldInt16(0,e,le.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,n){return ft.startTimestamp(t),ft.addUnit(t,e),ft.addTimezone(t,n),ft.endTimestamp(t)}}var ki;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(ki||(ki={}));class it{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUnion(t,e){return(e||new it).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+R),(e||new it).__init(t.readInt32(t.position())+t.position(),t)}mode(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ki.Sparse}typeIds(t){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+t*4):0}typeIdsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){const t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,e){t.addFieldInt16(0,e,ki.Sparse)}static addTypeIds(t,e){t.addFieldOffset(1,e,0)}static createTypeIdsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,n){return it.startUnion(t),it.addMode(t,e),it.addTypeIds(t,n),it.endUnion(t)}}class _e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,e){return(e||new _e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+R),(e||new _e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return _e.startUtf8(t),_e.endUtf8(t)}}var F;(function(i){i[i.NONE=0]="NONE",i[i.Null=1]="Null",i[i.Int=2]="Int",i[i.FloatingPoint=3]="FloatingPoint",i[i.Binary=4]="Binary",i[i.Utf8=5]="Utf8",i[i.Bool=6]="Bool",i[i.Decimal=7]="Decimal",i[i.Date=8]="Date",i[i.Time=9]="Time",i[i.Timestamp=10]="Timestamp",i[i.Interval=11]="Interval",i[i.List=12]="List",i[i.Struct_=13]="Struct_",i[i.Union=14]="Union",i[i.FixedSizeBinary=15]="FixedSizeBinary",i[i.FixedSizeList=16]="FixedSizeList",i[i.Map=17]="Map",i[i.Duration=18]="Duration",i[i.LargeBinary=19]="LargeBinary",i[i.LargeUtf8=20]="LargeUtf8",i[i.LargeList=21]="LargeList",i[i.RunEndEncoded=22]="RunEndEncoded"})(F||(F={}));let ht=class Oi{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsField(t,e){return(e||new Oi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+R),(e||new Oi).__init(t.readInt32(t.position())+t.position(),t)}name(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):F.NONE}type(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(t){const e=this.bb.__offset(this.bb_pos,12);return e?(t||new Yt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const n=this.bb.__offset(this.bb_pos,14);return n?(e||new Oi).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}childrenLength(){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,16);return n?(e||new $).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(t,e){t.addFieldInt8(2,e,F.NONE)}static addType(t,e){t.addFieldOffset(3,e,0)}static addDictionary(t,e){t.addFieldOffset(4,e,0)}static addChildren(t,e){t.addFieldOffset(5,e,0)}static createChildrenVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startChildrenVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(6,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},Ot=class Pt{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new Pt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+R),(e||new Pt).__init(t.readInt32(t.position())+t.position(),t)}endianness(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Je.Little}fields(t,e){const n=this.bb.__offset(this.bb_pos,6);return n?(e||new ht).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}fieldsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new $).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):BigInt(0)}featuresLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,e){t.addFieldInt16(0,e,Je.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startFieldsVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(2,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static addFeatures(t,e){t.addFieldOffset(3,e,0)}static createFeaturesVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startFeaturesVector(t,e){t.startVector(8,e,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}static finishSizePrefixedSchemaBuffer(t,e){t.finish(e,void 0,!0)}static createSchema(t,e,n,s,r){return Pt.startSchema(t),Pt.addEndianness(t,e),Pt.addFields(t,n),Pt.addCustomMetadata(t,s),Pt.addFeatures(t,r),Pt.endSchema(t)}};class rt{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFooter(t,e){return(e||new rt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+R),(e||new rt).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ye.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new Ot).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new Sn).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}dictionariesLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){const n=this.bb.__offset(this.bb_pos,10);return n?(e||new Sn).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}recordBatchesLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new $).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,Ye.V1)}static addSchema(t,e){t.addFieldOffset(1,e,0)}static addDictionaries(t,e){t.addFieldOffset(2,e,0)}static startDictionariesVector(t,e){t.startVector(24,e,8)}static addRecordBatches(t,e){t.addFieldOffset(3,e,0)}static startRecordBatchesVector(t,e){t.startVector(24,e,8)}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}static finishSizePrefixedFooterBuffer(t,e){t.finish(e,void 0,!0)}}class x{constructor(t=[],e,n,s=H.V5){this.fields=t||[],this.metadata=e||new Map,n||(n=Dn(t)),this.dictionaries=n,this.metadataVersion=s}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){const e=new Set(t),n=this.fields.filter(s=>e.has(s.name));return new x(n,this.metadata)}selectAt(t){const e=t.map(n=>this.fields[n]).filter(Boolean);return new x(e,this.metadata)}assign(...t){const e=t[0]instanceof x?t[0]:Array.isArray(t[0])?new x(t[0]):new x(t),n=[...this.fields],s=Ii(Ii(new Map,this.metadata),e.metadata),r=e.fields.filter(a=>{const c=n.findIndex(l=>l.name===a.name);return~c?(n[c]=a.clone({metadata:Ii(Ii(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),o=Dn(r,new Map);return new x([...n,...r],s,new Map([...this.dictionaries,...o]))}}x.prototype.fields=null;x.prototype.metadata=null;x.prototype.dictionaries=null;class L{static new(...t){let[e,n,s,r]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],n===void 0&&(n=t[0].type),s===void 0&&(s=t[0].nullable),r===void 0&&(r=t[0].metadata)),new L(`${e}`,n,s,r)}constructor(t,e,n=!1,s){this.name=t,this.type=e,this.nullable=n,this.metadata=s||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,n,s,r]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,n=this.type,s=this.nullable,r=this.metadata]=t:{name:e=this.name,type:n=this.type,nullable:s=this.nullable,metadata:r=this.metadata}=t[0],L.new(e,n,s,r)}}L.prototype.type=null;L.prototype.name=null;L.prototype.nullable=null;L.prototype.metadata=null;function Ii(i,t){return new Map([...i||new Map,...t||new Map])}function Dn(i,t=new Map){for(let e=-1,n=i.length;++e<n;){const r=i[e].type;if(y.isDictionary(r)){if(!t.has(r.id))t.set(r.id,r.dictionary);else if(t.get(r.id)!==r.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}r.children&&r.children.length>0&&Dn(r.children,t)}return t}var Fl=Ao,Ml=We;class ui{static decode(t){t=new Ml(N(t));const e=rt.getRootAsFooter(t),n=x.decode(e.schema(),new Map,e.version());return new Tl(n,e)}static encode(t){const e=new Fl,n=x.encode(e,t.schema);rt.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())Rt.encode(e,o);const s=e.endVector();rt.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())Rt.encode(e,o);const r=e.endVector();return rt.startFooter(e),rt.addSchema(e,n),rt.addVersion(e,H.V5),rt.addRecordBatches(e,s),rt.addDictionaries(e,r),rt.finishFooterBuffer(e,rt.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=H.V5,n,s){this.schema=t,this.version=e,n&&(this._recordBatches=n),s&&(this._dictionaryBatches=s)}*recordBatches(){for(let t,e=-1,n=this.numRecordBatches;++e<n;)(t=this.getRecordBatch(e))&&(yield t)}*dictionaryBatches(){for(let t,e=-1,n=this.numDictionaries;++e<n;)(t=this.getDictionaryBatch(e))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}}class Tl extends ui{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,e){super(t,e.version()),this._footer=e}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){const e=this._footer.recordBatches(t);if(e)return Rt.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){const e=this._footer.dictionaries(t);if(e)return Rt.decode(e)}return null}}class Rt{static decode(t){return new Rt(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){const{metaDataLength:n}=e,s=BigInt(e.offset),r=BigInt(e.bodyLength);return Sn.createBlock(t,s,n,r)}constructor(t,e,n){this.metaDataLength=t,this.offset=St(n),this.bodyLength=St(e)}}const z=Object.freeze({done:!0,value:void 0});class Us{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class ls{tee(){return this._getDOMStream().tee()}pipe(t,e){return this._getNodeStream().pipe(t,e)}pipeTo(t,e){return this._getDOMStream().pipeTo(t,e)}pipeThrough(t,e){return this._getDOMStream().pipeThrough(t,e)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}}class Nl extends ls{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return p(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){const{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(z);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return ot.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return ot.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return p(this,void 0,void 0,function*(){return yield this.abort(t),z})}return(t){return p(this,void 0,void 0,function*(){return yield this.close(),z})}read(t){return p(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return p(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((e,n)=>{this.resolvers.push({resolve:e,reject:n})}):Promise.resolve(z)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class ei extends Nl{write(t){if((t=N(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?vn(this.toUint8Array(!0)):this.toUint8Array(!1).then(vn)}toUint8Array(t=!1){return t?wt(this._values)[0]:p(this,void 0,void 0,function*(){var e,n,s,r;const o=[];let a=0;try{for(var c=!0,l=ie(this),h;h=yield l.next(),e=h.done,!e;c=!0){r=h.value,c=!1;const d=r;o.push(d),a+=d.byteLength}}catch(d){n={error:d}}finally{try{!c&&!e&&(s=l.return)&&(yield s.call(l))}finally{if(n)throw n.error}}return wt(o,a)[0]})}}class Pi{constructor(t){t&&(this.source=new Ll(ot.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class Ie{constructor(t){t instanceof Ie?this.source=t.source:t instanceof ei?this.source=new fe(ot.fromAsyncIterable(t)):Zs(t)?this.source=new fe(ot.fromNodeStream(t)):Tn(t)?this.source=new fe(ot.fromDOMStream(t)):qs(t)?this.source=new fe(ot.fromDOMStream(t.body)):Ge(t)?this.source=new fe(ot.fromIterable(t)):ne(t)?this.source=new fe(ot.fromAsyncIterable(t)):Se(t)&&(this.source=new fe(ot.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class Ll{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||z)}return(t){return Object.create(this.source.return&&this.source.return(t)||z)}}class fe{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return p(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return p(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return p(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,e="read"){return p(this,void 0,void 0,function*(){return yield this.source.next({cmd:e,size:t})})}throw(t){return p(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||z;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return p(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||z;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class xs extends Pi{constructor(t,e){super(),this.position=0,this.buffer=N(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:n}=this.readAt(t,4);return new DataView(e,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){const{buffer:e,size:n,position:s}=this;return e&&s<n?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,s+Math.min(n-s,t)),e.subarray(s,this.position)):null}readAt(t,e){const n=this.buffer,s=Math.min(this.size,t+e);return n?n.subarray(t,s):new Uint8Array(e)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}}class $i extends Ie{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=p(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return p(this,void 0,void 0,function*(){const{buffer:e,byteOffset:n}=yield this.readAt(t,4);return new DataView(e,n).getInt32(0,!0)})}seek(t){return p(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return p(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:e,size:n,position:s}=this;if(e&&s<n){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let r=s,o=0,a=0;const c=Math.min(n,r+Math.min(n-r,t)),l=new Uint8Array(Math.max(0,(this.position=c)-r));for(;(r+=a)<c&&(o+=a)<l.byteLength;)({bytesRead:a}=yield e.read(l,o,l.byteLength-o,r));return l}return null})}readAt(t,e){return p(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:n,size:s}=this;if(n&&t+e<s){const r=Math.min(s,t+e),o=new Uint8Array(r-t);return(yield n.read(o,0,e,t)).buffer}return new Uint8Array(e)})}close(){return p(this,void 0,void 0,function*(){const t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return p(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return p(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}}const Ul=65536;function Ue(i){return i<0&&(i=4294967295+i+1),`0x${i.toString(16)}`}const He=8,us=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class hs{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let s=e[3]*n[3];this.buffer[0]=s&65535;let r=s>>>16;return s=e[2]*n[3],r+=s,s=e[3]*n[2]>>>0,r+=s,this.buffer[0]+=r<<16,this.buffer[1]=r>>>0<s?Ul:0,this.buffer[1]+=r>>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${Ue(this.buffer[1])} ${Ue(this.buffer[0])}`}}class E extends hs{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return E.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return E.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const n=t.length,s=new E(e);for(let r=0;r<n;){const o=He<n-r?He:n-r,a=new E(new Uint32Array([Number.parseInt(t.slice(r,r+o),10),0])),c=new E(new Uint32Array([us[o],0]));s.times(c),s.plus(a),r+=o}return s}static convertArray(t){const e=new Uint32Array(t.length*2);for(let n=-1,s=t.length;++n<s;)E.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2));return e}static multiply(t,e){return new E(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new E(new Uint32Array(t.buffer)).plus(e)}}class q extends hs{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){const e=this.buffer[1]<<0,n=t.buffer[1]<<0;return e<n||e===n&&this.buffer[0]<t.buffer[0]}static from(t,e=new Uint32Array(2)){return q.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return q.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const n=t.startsWith("-"),s=t.length,r=new q(e);for(let o=n?1:0;o<s;){const a=He<s-o?He:s-o,c=new q(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0])),l=new q(new Uint32Array([us[a],0]));r.times(l),r.plus(c),o+=a}return n?r.negate():r}static convertArray(t){const e=new Uint32Array(t.length*2);for(let n=-1,s=t.length;++n<s;)q.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2));return e}static multiply(t,e){return new q(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new q(new Uint32Array(t.buffer)).plus(e)}}class pt{constructor(t){this.buffer=t}high(){return new q(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new q(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(t){const e=new E(new Uint32Array([this.buffer[3],0])),n=new E(new Uint32Array([this.buffer[2],0])),s=new E(new Uint32Array([this.buffer[1],0])),r=new E(new Uint32Array([this.buffer[0],0])),o=new E(new Uint32Array([t.buffer[3],0])),a=new E(new Uint32Array([t.buffer[2],0])),c=new E(new Uint32Array([t.buffer[1],0])),l=new E(new Uint32Array([t.buffer[0],0]));let h=E.multiply(r,l);this.buffer[0]=h.low();const d=new E(new Uint32Array([h.high(),0]));return h=E.multiply(s,l),d.plus(h),h=E.multiply(r,c),d.plus(h),this.buffer[1]=d.low(),this.buffer[3]=d.lessThan(h)?1:0,this.buffer[2]=d.high(),new E(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(E.multiply(n,l)).plus(E.multiply(s,c)).plus(E.multiply(r,a)),this.buffer[3]+=E.multiply(e,l).plus(E.multiply(n,c)).plus(E.multiply(s,a)).plus(E.multiply(r,o)).low(),this}plus(t){const e=new Uint32Array(4);return e[3]=this.buffer[3]+t.buffer[3]>>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]<this.buffer[0]>>>0&&++e[1],e[1]<this.buffer[1]>>>0&&++e[2],e[2]<this.buffer[2]>>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${Ue(this.buffer[3])} ${Ue(this.buffer[2])} ${Ue(this.buffer[1])} ${Ue(this.buffer[0])}`}static multiply(t,e){return new pt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new pt(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return pt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return pt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),s=t.length,r=new pt(e);for(let o=n?1:0;o<s;){const a=He<s-o?He:s-o,c=new pt(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0,0,0])),l=new pt(new Uint32Array([us[a],0,0,0]));r.times(l),r.plus(c),o+=a}return n?r.negate():r}static convertArray(t){const e=new Uint32Array(t.length*4);for(let n=-1,s=t.length;++n<s;)pt.from(t[n],new Uint32Array(e.buffer,e.byteOffset+4*4*n,4));return e}}const xl=Object.freeze(Object.defineProperty({__proto__:null,BaseInt64:hs,Int128:pt,Int64:q,Uint64:E},Symbol.toStringTag,{value:"Module"}));class Fo extends O{constructor(t,e,n,s,r=H.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=n,this.dictionaries=s,this.metadataVersion=r}visit(t){return super.visit(t instanceof L?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return w({type:t,length:e})}visitBool(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),children:this.visitMany(t.children)})}visitUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<H.V5&&this.readNullBitmap(t,n),t.mode===W.Sparse?this.visitSparseUnion(t,{length:e,nullCount:n}):this.visitDenseUnion(t,{length:e,nullCount:n})}visitDenseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDuration(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),child:this.visit(t.children[0])})}visitMap(t,{length:e,nullCount:n}=this.nextFieldNode()){return w({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,e,n=this.nextBufferRange()){return e>0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class Cl extends Fo{constructor(t,e,n,s,r){super(new Uint8Array(0),e,n,s,r),this.sources=t}readNullBitmap(t,e,{offset:n}=this.nextBufferRange()){return e<=0?new Uint8Array(0):li(this.sources[n])}readOffsets(t,{offset:e}=this.nextBufferRange()){return T(Uint8Array,T(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return T(Uint8Array,T(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:n}=this;return y.isTimestamp(t)||(y.isInt(t)||y.isTime(t))&&t.bitWidth===64||y.isDuration(t)||y.isDate(t)&&t.unit===ct.MILLISECOND?T(Uint8Array,q.convertArray(n[e])):y.isDecimal(t)?T(Uint8Array,pt.convertArray(n[e])):y.isBinary(t)||y.isFixedSizeBinary(t)?El(n[e]):y.isBool(t)?li(n[e]):y.isUtf8(t)?Zi(n[e].join("")):T(Uint8Array,T(t.ArrayType,n[e].map(s=>+s)))}}function El(i){const t=i.join(""),e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)e[n>>1]=Number.parseInt(t.slice(n,n+2),16);return e}class Mo extends sn{constructor(t){super(t),this._values=new nn(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,N(e))}_flushPending(t,e){const n=this._offsets,s=this._values.reserve(e).buffer;let r=0;for(const[o,a]of t)if(a===void 0)n.set(o,0);else{const c=a.length;s.set(a,r),n.set(o,c),r+=c}}}class Vl extends X{constructor(t){super(t),this._values=new So}setValue(t,e){this._values.set(t,+e)}}class rn extends Gt{}rn.prototype._setValue=Cr;class To extends rn{}To.prototype._setValue=zn;class No extends rn{}No.prototype._setValue=jn;class Lo extends Gt{}Lo.prototype._setValue=Rr;class Rl extends X{constructor({type:t,nullValues:e,dictionaryHashFunction:n}){super({type:new ce(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Ke({type:this.type.indices,nullValues:e}),this.dictionary=Ke({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,e){const n=this.indices;return e=n.setValid(t,e),this.length=n.length,e}setValue(t,e){const n=this._keysToIndices,s=this.valueToKey(e);let r=n[s];return r===void 0&&(n[s]=r=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,r)}flush(){const t=this.type,e=this._dictionary,n=this.dictionary.toVector(),s=this.indices.flush().clone(t);return s.dictionary=e?e.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=s.dictionary,this.clear(),s}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}}class Uo extends Gt{}Uo.prototype._setValue=xr;class zl extends X{setValue(t,e){const[n]=this.children,s=t*this.stride;for(let r=-1,o=e.length;++r<o;)n.set(s+r,e[r])}addChild(t,e="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");const n=this.children.push(t);return this.type=new oi(this.type.listSize,new L(e,t.type,!0)),n}}class on extends Gt{setValue(t,e){this._values.set(t,e)}}class jl extends on{setValue(t,e){super.setValue(t,En(e))}}class kl extends on{}class Pl extends on{}class an extends Gt{}an.prototype._setValue=kr;class xo extends an{}xo.prototype._setValue=Gn;class Co extends an{}Co.prototype._setValue=qn;class qe extends Gt{}qe.prototype._setValue=Pr;class Eo extends qe{}Eo.prototype._setValue=Zn;class Vo extends qe{}Vo.prototype._setValue=Qn;class Ro extends qe{}Ro.prototype._setValue=Xn;class zo extends qe{}zo.prototype._setValue=ts;class qt extends Gt{setValue(t,e){this._values.set(t,e)}}class $l extends qt{}class Wl extends qt{}class Yl extends qt{}class Jl extends qt{}class Hl extends qt{}class Kl extends qt{}class Gl extends qt{}class ql extends qt{}class Zl extends sn{constructor(t){super(t),this._offsets=new Bo}addChild(t,e="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Pe(new L(e,t.type,!0)),this.numChildren-1}_flushPending(t){const e=this._offsets,[n]=this.children;for(const[s,r]of t)if(typeof r>"u")e.set(s,0);else{const o=r,a=o.length,c=e.set(s,a).buffer[s];for(let l=-1;++l<a;)n.set(c+l,o[l])}}}class Ql extends sn{set(t,e){return super.set(t,e)}setValue(t,e){const n=e instanceof Map?e:new Map(Object.entries(e)),s=this._pending||(this._pending=new Map),r=s.get(t);r&&(this._pendingLength-=r.size),this._pendingLength+=n.size,s.set(t,n)}addChild(t,e=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new ai(new L(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){const e=this._offsets,[n]=this.children;for(const[s,r]of t)if(r===void 0)e.set(s,0);else{let{[s]:o,[s+1]:a}=e.set(s,r.size).buffer;for(const c of r.entries())if(n.set(o,c),++o>=a)break}}}class Xl extends X{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}}class tu extends X{setValue(t,e){const{children:n,type:s}=this;switch(Array.isArray(e)||e.constructor){case!0:return s.children.forEach((r,o)=>n[o].set(t,e[o]));case Map:return s.children.forEach((r,o)=>n[o].set(t,e.get(r.name)));default:return s.children.forEach((r,o)=>n[o].set(t,e[r.name]))}}setValid(t,e){return super.setValid(t,e)||this.children.forEach(n=>n.setValid(t,e)),e}addChild(t,e=`${this.numChildren}`){const n=this.children.push(t);return this.type=new K([...this.type.children,new L(e,t.type,!0)]),n}}class Ze extends Gt{}Ze.prototype._setValue=Er;class jo extends Ze{}jo.prototype._setValue=kn;class ko extends Ze{}ko.prototype._setValue=Pn;class Po extends Ze{}Po.prototype._setValue=$n;class $o extends Ze{}$o.prototype._setValue=Wn;class Qe extends Gt{}Qe.prototype._setValue=Vr;class Wo extends Qe{}Wo.prototype._setValue=Yn;class Yo extends Qe{}Yo.prototype._setValue=Jn;class Jo extends Qe{}Jo.prototype._setValue=Hn;class Ho extends Qe{}Ho.prototype._setValue=Kn;class ds extends X{constructor(t){super(t),this._typeIds=new yi(new Int8Array(0),1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,e){return this.set(this.length,t,e)}set(t,e,n){return n===void 0&&(n=this._valueToChildTypeId(this,e,t)),this.setValue(t,e,n),this}setValue(t,e,n){this._typeIds.set(t,n);const s=this.type.typeIdToChildIndex[n],r=this.children[s];r?.set(t,e)}addChild(t,e=`${this.children.length}`){const n=this.children.push(t),{type:{children:s,mode:r,typeIds:o}}=this,a=[...s,new L(e,t.type)];return this.type=new we(r,[...o,n],a),n}_valueToChildTypeId(t,e,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.")}}class eu extends ds{}class iu extends ds{constructor(t){super(t),this._offsets=new yi(new Int32Array(0))}setValue(t,e,n){const s=this._typeIds.set(t,n).buffer[t],r=this.getChildAt(this.type.typeIdToChildIndex[s]),o=this._offsets.set(t,r.length).buffer[t];r?.set(o,e)}}class Ko extends sn{constructor(t){super(t),this._values=new nn(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,Zi(e))}_flushPending(t,e){}}Ko.prototype._flushPending=Mo.prototype._flushPending;class nu extends O{visitNull(){return Xl}visitBool(){return Vl}visitInt(){return qt}visitInt8(){return $l}visitInt16(){return Wl}visitInt32(){return Yl}visitInt64(){return Jl}visitUint8(){return Hl}visitUint16(){return Kl}visitUint32(){return Gl}visitUint64(){return ql}visitFloat(){return on}visitFloat16(){return jl}visitFloat32(){return kl}visitFloat64(){return Pl}visitUtf8(){return Ko}visitBinary(){return Mo}visitFixedSizeBinary(){return Uo}visitDate(){return rn}visitDateDay(){return To}visitDateMillisecond(){return No}visitTimestamp(){return Ze}visitTimestampSecond(){return jo}visitTimestampMillisecond(){return ko}visitTimestampMicrosecond(){return Po}visitTimestampNanosecond(){return $o}visitTime(){return Qe}visitTimeSecond(){return Wo}visitTimeMillisecond(){return Yo}visitTimeMicrosecond(){return Jo}visitTimeNanosecond(){return Ho}visitDecimal(){return Lo}visitList(){return Zl}visitStruct(){return tu}visitUnion(){return ds}visitDenseUnion(){return iu}visitSparseUnion(){return eu}visitDictionary(){return Rl}visitInterval(){return an}visitIntervalDayTime(){return xo}visitIntervalYearMonth(){return Co}visitDuration(){return qe}visitDurationSecond(){return Eo}visitDurationMillisecond(){return Vo}visitDurationMicrosecond(){return Ro}visistDurationNanosecond(){return zo}visitFixedSizeList(){return zl}visitMap(){return Ql}}const su=new nu;class v extends O{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((n,s)=>this.compareFields(n,e[s]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function tt(i,t){return t instanceof i.constructor}function pi(i,t){return i===t||tt(i,t)}function Zt(i,t){return i===t||tt(i,t)&&i.bitWidth===t.bitWidth&&i.isSigned===t.isSigned}function cn(i,t){return i===t||tt(i,t)&&i.precision===t.precision}function ru(i,t){return i===t||tt(i,t)&&i.byteWidth===t.byteWidth}function fs(i,t){return i===t||tt(i,t)&&i.unit===t.unit}function gi(i,t){return i===t||tt(i,t)&&i.unit===t.unit&&i.timezone===t.timezone}function mi(i,t){return i===t||tt(i,t)&&i.unit===t.unit&&i.bitWidth===t.bitWidth}function ou(i,t){return i===t||tt(i,t)&&i.children.length===t.children.length&&zt.compareManyFields(i.children,t.children)}function au(i,t){return i===t||tt(i,t)&&i.children.length===t.children.length&&zt.compareManyFields(i.children,t.children)}function ys(i,t){return i===t||tt(i,t)&&i.mode===t.mode&&i.typeIds.every((e,n)=>e===t.typeIds[n])&&zt.compareManyFields(i.children,t.children)}function cu(i,t){return i===t||tt(i,t)&&i.id===t.id&&i.isOrdered===t.isOrdered&&zt.visit(i.indices,t.indices)&&zt.visit(i.dictionary,t.dictionary)}function ps(i,t){return i===t||tt(i,t)&&i.unit===t.unit}function bi(i,t){return i===t||tt(i,t)&&i.unit===t.unit}function lu(i,t){return i===t||tt(i,t)&&i.listSize===t.listSize&&i.children.length===t.children.length&&zt.compareManyFields(i.children,t.children)}function uu(i,t){return i===t||tt(i,t)&&i.keysSorted===t.keysSorted&&i.children.length===t.children.length&&zt.compareManyFields(i.children,t.children)}v.prototype.visitNull=pi;v.prototype.visitBool=pi;v.prototype.visitInt=Zt;v.prototype.visitInt8=Zt;v.prototype.visitInt16=Zt;v.prototype.visitInt32=Zt;v.prototype.visitInt64=Zt;v.prototype.visitUint8=Zt;v.prototype.visitUint16=Zt;v.prototype.visitUint32=Zt;v.prototype.visitUint64=Zt;v.prototype.visitFloat=cn;v.prototype.visitFloat16=cn;v.prototype.visitFloat32=cn;v.prototype.visitFloat64=cn;v.prototype.visitUtf8=pi;v.prototype.visitBinary=pi;v.prototype.visitFixedSizeBinary=ru;v.prototype.visitDate=fs;v.prototype.visitDateDay=fs;v.prototype.visitDateMillisecond=fs;v.prototype.visitTimestamp=gi;v.prototype.visitTimestampSecond=gi;v.prototype.visitTimestampMillisecond=gi;v.prototype.visitTimestampMicrosecond=gi;v.prototype.visitTimestampNanosecond=gi;v.prototype.visitTime=mi;v.prototype.visitTimeSecond=mi;v.prototype.visitTimeMillisecond=mi;v.prototype.visitTimeMicrosecond=mi;v.prototype.visitTimeNanosecond=mi;v.prototype.visitDecimal=pi;v.prototype.visitList=ou;v.prototype.visitStruct=au;v.prototype.visitUnion=ys;v.prototype.visitDenseUnion=ys;v.prototype.visitSparseUnion=ys;v.prototype.visitDictionary=cu;v.prototype.visitInterval=ps;v.prototype.visitIntervalDayTime=ps;v.prototype.visitIntervalYearMonth=ps;v.prototype.visitDuration=bi;v.prototype.visitDurationSecond=bi;v.prototype.visitDurationMillisecond=bi;v.prototype.visitDurationMicrosecond=bi;v.prototype.visitDurationNanosecond=bi;v.prototype.visitFixedSizeList=lu;v.prototype.visitMap=uu;const zt=new v;function Wi(i,t){return zt.compareSchemas(i,t)}function hu(i,t){return zt.compareFields(i,t)}function Go(i,t){return zt.visit(i,t)}function Ke(i){const t=i.type,e=new(su.getVisitFn(t)())(i);if(t.children&&t.children.length>0){const n=i.children||[],s={nullValues:i.nullValues},r=Array.isArray(n)?(o,a)=>n[a]||s:({name:o})=>n[o]||s;for(const[o,a]of t.children.entries()){const{type:c}=a,l=r(a,o);e.children.push(Ke(Object.assign(Object.assign({},l),{type:c})))}}return e}function qo(i,t){if(i instanceof C||i instanceof g||i.type instanceof y||ArrayBuffer.isView(i))return cs(i);const e={type:t??Fi(i),nullValues:[null]},n=[...du(e)(i)],s=n.length===1?n[0]:n.reduce((r,o)=>r.concat(o));return y.isDictionary(s.type)?s.memoize():s}function Rh(i){const t=qo(i),e=new G(new x(t.type.children),t.data[0]);return new Y(e)}function Fi(i){if(i.length===0)return new Jt;let t=0,e=0,n=0,s=0,r=0,o=0,a=0,c=0;for(const l of i){if(l==null){++t;continue}switch(typeof l){case"bigint":++o;continue;case"boolean":++a;continue;case"number":++s;continue;case"string":++r;continue;case"object":Array.isArray(l)?++e: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(s+t===i.length)return new xn;if(r+t===i.length)return new ce(new si,new ve);if(o+t===i.length)return new Un;if(a+t===i.length)return new ri;if(c+t===i.length)return new ac;if(e+t===i.length){const l=i,h=Fi(l[l.findIndex(d=>d!=null)]);if(l.every(d=>d==null||Go(h,Fi(d))))return new Pe(new L("",h,!0))}else if(n+t===i.length){const l=new Map;for(const h of i)for(const d of Object.keys(h))!l.has(d)&&h[d]!=null&&l.set(d,new L(d,Fi([h[d]]),!0));return new K([...l.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function du(i){const{["queueingStrategy"]:t="count"}=i,{["highWaterMark"]:e=t!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=i,n=t!=="bytes"?"length":"byteLength";return function*(s){let r=0;const o=Ke(i);for(const a of s)o.append(a)[n]>=e&&++r&&(yield o.toVector());(o.finish().length>0||r===0)&&(yield o.toVector())}}function zh(i){const{["queueingStrategy"]:t="count"}=i,{["highWaterMark"]:e=t!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=i,n=t!=="bytes"?"length":"byteLength";return function(s){return bt(this,arguments,function*(){var r,o,a,c;let l=0;const h=Ke(i);try{for(var d=!0,U=ie(s),j;j=yield M(U.next()),r=j.done,!r;d=!0){c=j.value,d=!1;const ut=c;h.append(ut)[n]>=e&&++l&&(yield yield M(h.toVector()))}}catch(ut){o={error:ut}}finally{try{!d&&!r&&(a=U.return)&&(yield M(a.call(U)))}finally{if(o)throw o.error}}(h.finish().length>0||l===0)&&(yield yield M(h.toVector()))})}}function bn(i,t){return fu(i,t.map(e=>e.data.concat()))}function fu(i,t){const e=[...i.fields],n=[],s={numBatches:t.reduce((d,U)=>Math.max(d,U.length),0)};let r=0,o=0,a=-1;const c=t.length;let l,h=[];for(;s.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a<c;)h[a]=l=t[a].shift(),o=Math.min(o,l?l.length:o);Number.isFinite(o)&&(h=yu(e,o,h,t,s),o>0&&(n[r++]=w({type:new K(e),length:o,nullCount:0,children:h.slice()})))}return[i=i.assign(e),n.map(d=>new G(i,d))]}function yu(i,t,e,n,s){var r;const o=(t+63&-64)>>3;for(let a=-1,c=n.length;++a<c;){const l=e[a],h=l?.length;if(h>=t)h===t?e[a]=l:(e[a]=l.slice(0,t),s.numBatches=Math.max(s.numBatches,n[a].unshift(l.slice(t,h-t))));else{const d=i[a];i[a]=d.clone({nullable:!0}),e[a]=(r=l?._changeLengthAndBackfillNullBitmap(t))!==null&&r!==void 0?r:w({type:d.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var Zo;class Y{constructor(...t){var e,n;if(t.length===0)return this.batches=[],this.schema=new x([]),this._offsets=[0],this;let s,r;t[0]instanceof x&&(s=t.shift()),t.at(-1)instanceof Uint32Array&&(r=t.pop());const o=c=>{if(c){if(c instanceof G)return[c];if(c instanceof Y)return c.batches;if(c instanceof C){if(c.type instanceof K)return[new G(new x(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(l=>o(l));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(l=>o(l));if(typeof c=="object"){const l=Object.keys(c),h=l.map(j=>new g([c[j]])),d=new x(l.map((j,ut)=>new L(String(j),h[ut].type))),[,U]=bn(d,h);return U.length===0?[new G(c)]:U}}}return[]},a=t.flatMap(c=>o(c));if(s=(n=s??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&n!==void 0?n:new x([]),!(s instanceof x))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const c of a){if(!(c instanceof G))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Wi(s,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=s,this.batches=a,this._offsets=r??fo(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,e)=>t+e.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=ho(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?as.visit(new g(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
8
- ${this.toArray().join(`,
9
- `)}
10
- ]`}concat(...t){const e=this.schema,n=this.data.concat(t.flatMap(({data:s})=>s));return new Y(e,n.map(s=>new G(e,s)))}slice(t,e){const n=this.schema;[t,e]=ns({length:this.numRows},t,e);const s=yo(this.data,this._offsets,t,e);return new Y(n,s.map(r=>new G(n,r)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){const e=this.data.map(n=>n.children[t]);if(e.length===0){const{type:n}=this.schema.fields[t],s=w({type:n,length:0,nullCount:0});e.push(s._changeLengthAndBackfillNullBitmap(this.numRows))}return new g(e)}return null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(s=>s.name===t),e)}setChildAt(t,e){let n=this.schema,s=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new g([w({type:new Jt,length:this.numRows})]));const r=n.fields.slice(),o=r[t].clone({type:e.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[r[t],a[t]]=[o,e],[n,s]=bn(n,a)}return new Y(n,s)}select(t){const e=this.schema.fields.reduce((n,s,r)=>n.set(s.name,r),new Map);return this.selectAt(t.map(n=>e.get(n)).filter(n=>n>-1))}selectAt(t){const e=this.schema.selectAt(t),n=this.batches.map(s=>s.selectAt(t));return new Y(e,n)}assign(t){const e=this.schema.fields,[n,s]=t.schema.fields.reduce((a,c,l)=>{const[h,d]=a,U=e.findIndex(j=>j.name===c.name);return~U?d[U]=l:h.push(l),a},[[],[]]),r=this.schema.assign(t.schema),o=[...e.map((a,c)=>[c,s[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new Y(...bn(r,o))}}Zo=Symbol.toStringTag;Y[Zo]=(i=>(i.schema=null,i.batches=[],i._offsets=new Uint32Array([0]),i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,i.isValid=Re(os),i.get=Re(st.getVisitFn(u.Struct)),i.set=po(yt.getVisitFn(u.Struct)),i.indexOf=go(Ci.getVisitFn(u.Struct)),i.getByteLength=Re(Vt.getVisitFn(u.Struct)),"Table"))(Y.prototype);function jh(i){const t={},e=Object.entries(i);for(const[n,s]of e)t[n]=cs(s);return new Y(t)}function kh(i){const t={},e=Object.entries(i);for(const[n,s]of e)t[n]=qo(s);return new Y(t)}var Qo;let G=class Xe{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof x))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=w({nullCount:0,type:new K(this.schema.fields),children:this.schema.fields.map(e=>w({type:e.type,nullCount:0}))})]=t,!(this.data instanceof C))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Cs(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:n,children:s,length:r}=Object.keys(e).reduce((c,l,h)=>(c.children[h]=e[l],c.length=Math.max(c.length,e[l].length),c.fields[h]=L.new({name:l,type:e[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),o=new x(n),a=w({type:new K(n),length:r,children:s,nullCount:0});[this.schema,this.data]=Cs(o,a.children,r);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=Xo(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return st.visit(this.data,t)}set(t,e){return yt.visit(this.data,t,e)}indexOf(t,e){return Ci.visit(this.data,t,e)}getByteLength(t){return Vt.visit(this.data,t)}[Symbol.iterator](){return as.visit(new g([this.data]))}toArray(){return[...this]}concat(...t){return new Y(this.schema,[this,...t])}slice(t,e){const[n]=new g([this.data]).slice(t,e).data;return new Xe(this.schema,n)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new g([this.data.children[t]]):null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(s=>s.name===t),e)}setChildAt(t,e){let n=this.schema,s=this.data;if(t>-1&&t<this.numCols){e||(e=new g([w({type:new Jt,length:this.numRows})]));const r=n.fields.slice(),o=s.children.slice(),a=r[t].clone({type:e.type});[r[t],o[t]]=[a,e.data[0]],n=new x(r,new Map(this.schema.metadata)),s=w({type:new K(r),children:o})}return new Xe(n,s)}select(t){const e=this.schema.select(t),n=new K(e.fields),s=[];for(const r of t){const o=this.schema.fields.findIndex(a=>a.name===r);~o&&(s[o]=this.data.children[o])}return new Xe(e,w({type:n,length:this.numRows,children:s}))}selectAt(t){const e=this.schema.selectAt(t),n=t.map(r=>this.data.children[r]).filter(Boolean),s=w({type:new K(e.fields),length:this.numRows,children:n});return new Xe(e,s)}};Qo=Symbol.toStringTag;G[Qo]=(i=>(i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(G.prototype);function Cs(i,t,e=t.reduce((n,s)=>Math.max(n,s.length),0)){var n;const s=[...i.fields],r=[...t],o=(e+63&-64)>>3;for(const[a,c]of i.fields.entries()){const l=t[a];(!l||l.length!==e)&&(s[a]=c.clone({nullable:!0}),r[a]=(n=l?._changeLengthAndBackfillNullBitmap(e))!==null&&n!==void 0?n:w({type:c.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[i.assign(s),w({type:new K(s),length:e,children:r})]}function Xo(i,t,e=new Map){var n,s;if(((n=i?.length)!==null&&n!==void 0?n:0)>0&&i?.length===t?.length)for(let r=-1,o=i.length;++r<o;){const{type:a}=i[r],c=t[r];for(const l of[c,...((s=c?.dictionary)===null||s===void 0?void 0:s.data)||[]])Xo(a.children,l?.children,e);if(y.isDictionary(a)){const{id:l}=a;if(!e.has(l))c?.dictionary&&e.set(l,c.dictionary);else if(e.get(l)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return e}class gs extends G{constructor(t){const e=t.fields.map(s=>w({type:s.type})),n=w({type:new K(t.fields),nullCount:0,children:e});super(t,n)}}var Yi;(function(i){i[i.BUFFER=0]="BUFFER"})(Yi||(Yi={}));var Ji;(function(i){i[i.LZ4_FRAME=0]="LZ4_FRAME",i[i.ZSTD=1]="ZSTD"})(Ji||(Ji={}));class ee{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBodyCompression(t,e){return(e||new ee).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+R),(e||new ee).__init(t.readInt32(t.position())+t.position(),t)}codec(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):Ji.LZ4_FRAME}method(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Yi.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,Ji.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,Yi.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,n){return ee.startBodyCompression(t),ee.addCodec(t,e),ee.addMethod(t,n),ee.endBodyCompression(t)}}class ta{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,e,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(e??0)),t.offset()}}let ea=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,e,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(e??0)),t.offset()}},$t=class An{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsRecordBatch(t,e){return(e||new An).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+R),(e||new An).__init(t.readInt32(t.position())+t.position(),t)}length(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,e){const n=this.bb.__offset(this.bb_pos,6);return n?(e||new ea).__init(this.bb.__vector(this.bb_pos+n)+t*16,this.bb):null}nodesLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new ta).__init(this.bb.__vector(this.bb_pos+n)+t*16,this.bb):null}buffersLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){const e=this.bb.__offset(this.bb_pos,10);return e?(t||new ee).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addNodes(t,e){t.addFieldOffset(1,e,0)}static startNodesVector(t,e){t.startVector(16,e,8)}static addBuffers(t,e){t.addFieldOffset(2,e,0)}static startBuffersVector(t,e){t.startVector(16,e,8)}static addCompression(t,e){t.addFieldOffset(3,e,0)}static endRecordBatch(t){return t.endObject()}},Le=class On{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryBatch(t,e){return(e||new On).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+R),(e||new On).__init(t.readInt32(t.position())+t.position(),t)}id(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new $t).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isDelta(){const t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addData(t,e){t.addFieldOffset(1,e,0)}static addIsDelta(t,e){t.addFieldInt8(2,+e,0)}static endDictionaryBatch(t){return t.endObject()}};var Hi;(function(i){i[i.NONE=0]="NONE",i[i.Schema=1]="Schema",i[i.DictionaryBatch=2]="DictionaryBatch",i[i.RecordBatch=3]="RecordBatch",i[i.Tensor=4]="Tensor",i[i.SparseTensor=5]="SparseTensor"})(Hi||(Hi={}));let Xt=class At{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new At).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+R),(e||new At).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ye.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):Hi.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new $).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,Ye.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,Hi.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,n,s,r,o){return At.startMessage(t),At.addVersion(t,e),At.addHeaderType(t,n),At.addHeader(t,s),At.addBodyLength(t,r),At.addCustomMetadata(t,o),At.endMessage(t)}};class pu extends O{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return me.startNull(e),me.endNull(e)}visitInt(t,e){return at.startInt(e),at.addBitWidth(e,t.bitWidth),at.addIsSigned(e,t.isSigned),at.endInt(e)}visitFloat(t,e){return xt.startFloatingPoint(e),xt.addPrecision(e,t.precision),xt.endFloatingPoint(e)}visitBinary(t,e){return ye.startBinary(e),ye.endBinary(e)}visitBool(t,e){return pe.startBool(e),pe.endBool(e)}visitUtf8(t,e){return _e.startUtf8(e),_e.endUtf8(e)}visitDecimal(t,e){return et.startDecimal(e),et.addScale(e,t.scale),et.addPrecision(e,t.precision),et.addBitWidth(e,t.bitWidth),et.endDecimal(e)}visitDate(t,e){return Di.startDate(e),Di.addUnit(e,t.unit),Di.endDate(e)}visitTime(t,e){return dt.startTime(e),dt.addUnit(e,t.unit),dt.addBitWidth(e,t.bitWidth),dt.endTime(e)}visitTimestamp(t,e){const n=t.timezone&&e.createString(t.timezone)||void 0;return ft.startTimestamp(e),ft.addUnit(e,t.unit),n!==void 0&&ft.addTimezone(e,n),ft.endTimestamp(e)}visitInterval(t,e){return Ct.startInterval(e),Ct.addUnit(e,t.unit),Ct.endInterval(e)}visitDuration(t,e){return Nt.startDuration(e),Nt.addUnit(e,t.unit),Nt.endDuration(e)}visitList(t,e){return ge.startList(e),ge.endList(e)}visitStruct(t,e){return be.startStruct_(e),be.endStruct_(e)}visitUnion(t,e){it.startTypeIdsVector(e,t.typeIds.length);const n=it.createTypeIdsVector(e,t.typeIds);return it.startUnion(e),it.addMode(e,t.mode),it.addTypeIds(e,n),it.endUnion(e)}visitDictionary(t,e){const n=this.visit(t.indices,e);return Yt.startDictionaryEncoding(e),Yt.addId(e,BigInt(t.id)),Yt.addIsOrdered(e,t.isOrdered),n!==void 0&&Yt.addIndexType(e,n),Yt.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return Lt.startFixedSizeBinary(e),Lt.addByteWidth(e,t.byteWidth),Lt.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Ut.startFixedSizeList(e),Ut.addListSize(e,t.listSize),Ut.endFixedSizeList(e)}visitMap(t,e){return Ai.startMap(e),Ai.addKeysSorted(e,t.keysSorted),Ai.endMap(e)}}const _n=new pu;function gu(i,t=new Map){return new x(bu(i,t),Mi(i.metadata),t)}function ia(i){return new lt(i.count,na(i.columns),sa(i.columns))}function mu(i){return new jt(ia(i.data),i.id,i.isDelta)}function bu(i,t){return(i.fields||[]).filter(Boolean).map(e=>L.fromJSON(e,t))}function Es(i,t){return(i.children||[]).filter(Boolean).map(e=>L.fromJSON(e,t))}function na(i){return(i||[]).reduce((t,e)=>[...t,new ue(e.count,_u(e.VALIDITY)),...na(e.children)],[])}function sa(i,t=[]){for(let e=-1,n=(i||[]).length;++e<n;){const s=i[e];s.VALIDITY&&t.push(new Et(t.length,s.VALIDITY.length)),s.TYPE_ID&&t.push(new Et(t.length,s.TYPE_ID.length)),s.OFFSET&&t.push(new Et(t.length,s.OFFSET.length)),s.DATA&&t.push(new Et(t.length,s.DATA.length)),t=sa(s.children,t)}return t}function _u(i){return(i||[]).reduce((t,e)=>t+ +(e===0),0)}function vu(i,t){let e,n,s,r,o,a;return!t||!(r=i.dictionary)?(o=Rs(i,Es(i,t)),s=new L(i.name,o,i.nullable,Mi(i.metadata))):t.has(e=r.id)?(n=(n=r.indexType)?Vs(n):new ve,a=new ce(t.get(e),n,e,r.isOrdered),s=new L(i.name,a,i.nullable,Mi(i.metadata))):(n=(n=r.indexType)?Vs(n):new ve,t.set(e,o=Rs(i,Es(i,t))),a=new ce(o,n,e,r.isOrdered),s=new L(i.name,a,i.nullable,Mi(i.metadata))),s||null}function Mi(i=[]){return new Map(i.map(({key:t,value:e})=>[t,e]))}function Vs(i){return new Q(i.isSigned,i.bitWidth)}function Rs(i,t){const e=i.type.name;switch(e){case"NONE":return new Jt;case"null":return new Jt;case"binary":return new Ni;case"utf8":return new si;case"bool":return new ri;case"list":return new Pe((t||[])[0]);case"struct":return new K(t||[]);case"struct_":return new K(t||[])}switch(e){case"int":{const n=i.type;return new Q(n.isSigned,n.bitWidth)}case"floatingpoint":{const n=i.type;return new re(J[n.precision])}case"decimal":{const n=i.type;return new Li(n.scale,n.precision,n.bitWidth)}case"date":{const n=i.type;return new je(ct[n.unit])}case"time":{const n=i.type;return new Ht(f[n.unit],n.bitWidth)}case"timestamp":{const n=i.type;return new oe(f[n.unit],n.timezone)}case"interval":{const n=i.type;return new ke(It[n.unit])}case"duration":{const n=i.type;return new ae(f[n.unit])}case"union":{const n=i.type,[s,...r]=(n.mode+"").toLowerCase(),o=s.toUpperCase()+r.join("");return new we(W[o],n.typeIds||[],t||[])}case"fixedsizebinary":{const n=i.type;return new Ui(n.byteWidth)}case"fixedsizelist":{const n=i.type;return new oi(n.listSize,(t||[])[0])}case"map":{const n=i.type;return new ai((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var wu=Ao,Iu=We;class Z{static fromJSON(t,e){const n=new Z(0,H.V5,e);return n._createHeader=Su(t,e),n}static decode(t){t=new Iu(N(t));const e=Xt.getRootAsMessage(t),n=e.bodyLength(),s=e.version(),r=e.headerType(),o=new Z(n,s,r);return o._createHeader=Bu(e,r),o}static encode(t){const e=new wu;let n=-1;return t.isSchema()?n=x.encode(e,t.header()):t.isRecordBatch()?n=lt.encode(e,t.header()):t.isDictionaryBatch()&&(n=jt.encode(e,t.header())),Xt.startMessage(e),Xt.addVersion(e,H.V5),Xt.addHeader(e,n),Xt.addHeaderType(e,t.headerType),Xt.addBodyLength(e,BigInt(t.bodyLength)),Xt.finishMessageBuffer(e,Xt.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof x)return new Z(0,H.V5,V.Schema,t);if(t instanceof lt)return new Z(e,H.V5,V.RecordBatch,t);if(t instanceof jt)return new Z(e,H.V5,V.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===V.Schema}isRecordBatch(){return this.headerType===V.RecordBatch}isDictionaryBatch(){return this.headerType===V.DictionaryBatch}constructor(t,e,n,s){this._version=e,this._headerType=n,this.body=new Uint8Array(0),s&&(this._createHeader=()=>s),this._bodyLength=St(t)}}class lt{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,n){this._nodes=e,this._buffers=n,this._length=St(t)}}class jt{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,e,n=!1){this._data=t,this._isDelta=n,this._id=St(e)}}class Et{constructor(t,e){this.offset=St(t),this.length=St(e)}}class ue{constructor(t,e){this.length=St(t),this.nullCount=St(e)}}function Su(i,t){return()=>{switch(t){case V.Schema:return x.fromJSON(i);case V.RecordBatch:return lt.fromJSON(i);case V.DictionaryBatch:return jt.fromJSON(i)}throw new Error(`Unrecognized Message type: { name: ${V[t]}, type: ${t} }`)}}function Bu(i,t){return()=>{switch(t){case V.Schema:return x.decode(i.header(new Ot),new Map,i.version());case V.RecordBatch:return lt.decode(i.header(new $t),i.version());case V.DictionaryBatch:return jt.decode(i.header(new Le),i.version())}throw new Error(`Unrecognized Message type: { name: ${V[t]}, type: ${t} }`)}}L.encode=Cu;L.decode=Uu;L.fromJSON=vu;x.encode=xu;x.decode=Du;x.fromJSON=gu;lt.encode=Eu;lt.decode=Au;lt.fromJSON=ia;jt.encode=Vu;jt.decode=Ou;jt.fromJSON=mu;ue.encode=Ru;ue.decode=Mu;Et.encode=zu;Et.decode=Fu;function Du(i,t=new Map,e=H.V5){const n=Lu(i,t);return new x(n,Ti(i),t,e)}function Au(i,t=H.V5){if(i.compression()!==null)throw new Error("Record batch compression not implemented");return new lt(i.length(),Tu(i),Nu(i,t))}function Ou(i,t=H.V5){return new jt(lt.decode(i.data(),t),i.id(),i.isDelta())}function Fu(i){return new Et(i.offset(),i.length())}function Mu(i){return new ue(i.length(),i.nullCount())}function Tu(i){const t=[];for(let e,n=-1,s=-1,r=i.nodesLength();++n<r;)(e=i.nodes(n))&&(t[++s]=ue.decode(e));return t}function Nu(i,t){const e=[];for(let n,s=-1,r=-1,o=i.buffersLength();++s<o;)(n=i.buffers(s))&&(t<H.V4&&(n.bb_pos+=8*(s+1)),e[++r]=Et.decode(n));return e}function Lu(i,t){const e=[];for(let n,s=-1,r=-1,o=i.fieldsLength();++s<o;)(n=i.fields(s))&&(e[++r]=L.decode(n,t));return e}function zs(i,t){const e=[];for(let n,s=-1,r=-1,o=i.childrenLength();++s<o;)(n=i.children(s))&&(e[++r]=L.decode(n,t));return e}function Uu(i,t){let e,n,s,r,o,a;return!t||!(a=i.dictionary())?(s=ks(i,zs(i,t)),n=new L(i.name(),s,i.nullable(),Ti(i))):t.has(e=St(a.id()))?(r=(r=a.indexType())?js(r):new ve,o=new ce(t.get(e),r,e,a.isOrdered()),n=new L(i.name(),o,i.nullable(),Ti(i))):(r=(r=a.indexType())?js(r):new ve,t.set(e,s=ks(i,zs(i,t))),o=new ce(s,r,e,a.isOrdered()),n=new L(i.name(),o,i.nullable(),Ti(i))),n||null}function Ti(i){const t=new Map;if(i)for(let e,n,s=-1,r=Math.trunc(i.customMetadataLength());++s<r;)(e=i.customMetadata(s))&&(n=e.key())!=null&&t.set(n,e.value());return t}function js(i){return new Q(i.isSigned(),i.bitWidth())}function ks(i,t){const e=i.typeType();switch(e){case F.NONE:return new Jt;case F.Null:return new Jt;case F.Binary:return new Ni;case F.Utf8:return new si;case F.Bool:return new ri;case F.List:return new Pe((t||[])[0]);case F.Struct_:return new K(t||[])}switch(e){case F.Int:{const n=i.type(new at);return new Q(n.isSigned(),n.bitWidth())}case F.FloatingPoint:{const n=i.type(new xt);return new re(n.precision())}case F.Decimal:{const n=i.type(new et);return new Li(n.scale(),n.precision(),n.bitWidth())}case F.Date:{const n=i.type(new Di);return new je(n.unit())}case F.Time:{const n=i.type(new dt);return new Ht(n.unit(),n.bitWidth())}case F.Timestamp:{const n=i.type(new ft);return new oe(n.unit(),n.timezone())}case F.Interval:{const n=i.type(new Ct);return new ke(n.unit())}case F.Duration:{const n=i.type(new Nt);return new ae(n.unit())}case F.Union:{const n=i.type(new it);return new we(n.mode(),n.typeIdsArray()||[],t||[])}case F.FixedSizeBinary:{const n=i.type(new Lt);return new Ui(n.byteWidth())}case F.FixedSizeList:{const n=i.type(new Ut);return new oi(n.listSize(),(t||[])[0])}case F.Map:{const n=i.type(new Ai);return new ai((t||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${F[e]}" (${e})`)}function xu(i,t){const e=t.fields.map(r=>L.encode(i,r));Ot.startFieldsVector(i,e.length);const n=Ot.createFieldsVector(i,e),s=t.metadata&&t.metadata.size>0?Ot.createCustomMetadataVector(i,[...t.metadata].map(([r,o])=>{const a=i.createString(`${r}`),c=i.createString(`${o}`);return $.startKeyValue(i),$.addKey(i,a),$.addValue(i,c),$.endKeyValue(i)})):-1;return Ot.startSchema(i),Ot.addFields(i,n),Ot.addEndianness(i,ju?Je.Little:Je.Big),s!==-1&&Ot.addCustomMetadata(i,s),Ot.endSchema(i)}function Cu(i,t){let e=-1,n=-1,s=-1;const r=t.type;let o=t.typeId;y.isDictionary(r)?(o=r.dictionary.typeId,s=_n.visit(r,i),n=_n.visit(r.dictionary,i)):n=_n.visit(r,i);const a=(r.children||[]).map(h=>L.encode(i,h)),c=ht.createChildrenVector(i,a),l=t.metadata&&t.metadata.size>0?ht.createCustomMetadataVector(i,[...t.metadata].map(([h,d])=>{const U=i.createString(`${h}`),j=i.createString(`${d}`);return $.startKeyValue(i),$.addKey(i,U),$.addValue(i,j),$.endKeyValue(i)})):-1;return t.name&&(e=i.createString(t.name)),ht.startField(i),ht.addType(i,n),ht.addTypeType(i,o),ht.addChildren(i,c),ht.addNullable(i,!!t.nullable),e!==-1&&ht.addName(i,e),s!==-1&&ht.addDictionary(i,s),l!==-1&&ht.addCustomMetadata(i,l),ht.endField(i)}function Eu(i,t){const e=t.nodes||[],n=t.buffers||[];$t.startNodesVector(i,e.length);for(const o of e.slice().reverse())ue.encode(i,o);const s=i.endVector();$t.startBuffersVector(i,n.length);for(const o of n.slice().reverse())Et.encode(i,o);const r=i.endVector();return $t.startRecordBatch(i),$t.addLength(i,BigInt(t.length)),$t.addNodes(i,s),$t.addBuffers(i,r),$t.endRecordBatch(i)}function Vu(i,t){const e=lt.encode(i,t.data);return Le.startDictionaryBatch(i),Le.addId(i,BigInt(t.id)),Le.addIsDelta(i,t.isDelta),Le.addData(i,e),Le.endDictionaryBatch(i)}function Ru(i,t){return ea.createFieldNode(i,BigInt(t.length),BigInt(t.nullCount))}function zu(i,t){return ta.createBuffer(i,BigInt(t.offset),BigInt(t.length))}const ju=(()=>{const i=new ArrayBuffer(2);return new DataView(i).setInt16(0,256,!0),new Int16Array(i)[0]===256})(),ms=i=>`Expected ${V[i]} Message in stream, but was null or length 0.`,bs=i=>`Header pointer of flatbuffer-encoded ${V[i]} Message is null or length 0.`,ra=(i,t)=>`Expected to read ${i} metadata bytes, but only read ${t}.`,oa=(i,t)=>`Expected to read ${i} bytes for message body, but only read ${t}.`;class aa{constructor(t){this.source=t instanceof Pi?t:new Pi(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?z:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(ms(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=N(this.source.read(t));if(e.byteLength<t)throw new Error(oa(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){const e=V.Schema,n=this.readMessage(e),s=n?.header();if(t&&!s)throw new Error(bs(e));return s}readMetadataLength(){const t=this.source.read(ln),e=t&&new We(t),n=e?.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(t){const e=this.source.read(t);if(!e)return z;if(e.byteLength<t)throw new Error(ra(t,e.byteLength));return{done:!1,value:Z.decode(e)}}}class ku{constructor(t,e){this.source=t instanceof Ie?t:Gs(t)?new $i(t,e):new Ie(t)}[Symbol.asyncIterator](){return this}next(){return p(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done||t.value===-1&&(t=yield this.readMetadataLength()).done||(t=yield this.readMetadata(t.value)).done?z:t})}throw(t){return p(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return p(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return p(this,void 0,void 0,function*(){let e;if((e=yield this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(ms(t));return e.value})}readMessageBody(t){return p(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);const e=N(yield this.source.read(t));if(e.byteLength<t)throw new Error(oa(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(t=!1){return p(this,void 0,void 0,function*(){const e=V.Schema,n=yield this.readMessage(e),s=n?.header();if(t&&!s)throw new Error(bs(e));return s})}readMetadataLength(){return p(this,void 0,void 0,function*(){const t=yield this.source.read(ln),e=t&&new We(t),n=e?.readInt32(0)||0;return{done:n===0,value:n}})}readMetadata(t){return p(this,void 0,void 0,function*(){const e=yield this.source.read(t);if(!e)return z;if(e.byteLength<t)throw new Error(ra(t,e.byteLength));return{done:!1,value:Z.decode(e)}})}}class Pu extends aa{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof Us?t:new Us(t)}next(){const{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Z.fromJSON(t.schema,V.Schema)};if(this._dictionaryIndex<t.dictionaries.length){const e=t.dictionaries[this._dictionaryIndex++];return this._body=e.data.columns,{done:!1,value:Z.fromJSON(e,V.DictionaryBatch)}}if(this._batchIndex<t.batches.length){const e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:Z.fromJSON(e,V.RecordBatch)}}return this._body=[],z}readMessageBody(t){return e(this._body);function e(n){return(n||[]).reduce((s,r)=>[...s,...r.VALIDITY&&[r.VALIDITY]||[],...r.TYPE_ID&&[r.TYPE_ID]||[],...r.OFFSET&&[r.OFFSET]||[],...r.DATA&&[r.DATA]||[],...e(r.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(ms(t));return e.value}readSchema(){const t=V.Schema,e=this.readMessage(t),n=e?.header();if(!e||!n)throw new Error(bs(t));return n}}const ln=4,Fn="ARROW1",hi=new Uint8Array(Fn.length);for(let i=0;i<Fn.length;i+=1)hi[i]=Fn.codePointAt(i);function _s(i,t=0){for(let e=-1,n=hi.length;++e<n;)if(hi[e]!==i[t+e])return!1;return!0}const _i=hi.length,ca=_i+ln,$u=_i*2+ln;class _t extends ls{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){const e=this._impl.open(t);return ne(e)?e.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return ot.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return ot.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof _t?t:wn(t)?Hu(t):Gs(t)?qu(t):ne(t)?p(this,void 0,void 0,function*(){return yield _t.from(yield t)}):qs(t)||Tn(t)||Zs(t)||Se(t)?Gu(new Ie(t)):Ku(new Pi(t))}static readAll(t){return t instanceof _t?t.isSync()?Ps(t):$s(t):wn(t)||ArrayBuffer.isView(t)||Ge(t)||Ks(t)?Ps(t):$s(t)}}class di extends _t{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return bt(this,arguments,function*(){yield M(yield*Si(ie(this[Symbol.iterator]())))})}}class Ki extends _t{constructor(t){super(t),this._impl=t}readAll(){var t,e,n,s;return p(this,void 0,void 0,function*(){const r=new Array;try{for(var o=!0,a=ie(this),c;c=yield a.next(),t=c.done,!t;o=!0){s=c.value,o=!1;const l=s;r.push(l)}}catch(l){e={error:l}}finally{try{!o&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(e)throw e.error}}return r})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class vs extends di{constructor(t){super(t),this._impl=t}}class Wu extends Ki{constructor(t){super(t),this._impl=t}}class la{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const n=this._loadVectors(t,e,this.schema.fields),s=w({type:new K(this.schema.fields),length:t.length,children:n});return new G(this.schema,s)}_loadDictionaryBatch(t,e){const{id:n,isDelta:s}=t,{dictionaries:r,schema:o}=this,a=r.get(n);if(s||!a){const c=o.dictionaries.get(n),l=this._loadVectors(t.data,e,[c]);return(a&&s?a.concat(new g(l)):new g(l)).memoize()}return a.memoize()}_loadVectors(t,e,n){return new Fo(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}class Gi extends la{constructor(t,e){super(e),this._reader=wn(t)?new Pu(this._handle=t):new aa(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=ha(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):z}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):z}next(){if(this.closed)return z;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),s=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,s)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),s=e.readMessageBody(t.bodyLength),r=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,r)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new gs(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class qi extends la{constructor(t,e){super(e),this._reader=new ku(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return p(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return p(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=ha(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return p(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):z})}return(t){return p(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):z})}next(){return p(this,void 0,void 0,function*(){if(this.closed)return z;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),s=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,s)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),s=yield e.readMessageBody(t.bodyLength),r=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,r)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new gs(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return p(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class ua extends Gi{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof xs?t:new xs(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){const s=this._reader.readMessage(V.RecordBatch);if(s?.isRecordBatch()){const r=s.header(),o=this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(r,o)}}return null}_readDictionaryBatch(t){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){const s=this._reader.readMessage(V.DictionaryBatch);if(s?.isDictionaryBatch()){const r=s.header(),o=this._reader.readMessageBody(s.bodyLength),a=this._loadDictionaryBatch(r,o);this.dictionaries.set(r.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-ca,n=t.readInt32(e),s=t.readAt(e-n,n);return ui.decode(s)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}}class Yu extends qi{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...e){const n=typeof e[0]!="number"?e.shift():void 0,s=e[0]instanceof Map?e.shift():void 0;super(t instanceof $i?t:new $i(t,n),s)}isFile(){return!0}isAsync(){return!0}open(t){const e=Object.create(null,{open:{get:()=>super.open}});return p(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){var e;return p(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){const s=yield this._reader.readMessage(V.RecordBatch);if(s?.isRecordBatch()){const r=s.header(),o=yield this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(r,o)}}return null})}_readDictionaryBatch(t){var e;return p(this,void 0,void 0,function*(){const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){const s=yield this._reader.readMessage(V.DictionaryBatch);if(s?.isDictionaryBatch()){const r=s.header(),o=yield this._reader.readMessageBody(s.bodyLength),a=this._loadDictionaryBatch(r,o);this.dictionaries.set(r.id,a)}}})}_readFooter(){return p(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-ca,n=yield t.readInt32(e),s=yield t.readAt(e-n,n);return ui.decode(s)})}_readNextMessageAndValidate(t){return p(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){const e=this._footer.getRecordBatch(this._recordBatchIndex);if(e&&(yield this._handle.seek(e.offset)))return yield this._reader.readMessage(t)}return null})}}class Ju extends Gi{constructor(t,e){super(t,e)}_loadVectors(t,e,n){return new Cl(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}function ha(i,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:i.autoDestroy}function*Ps(i){const t=_t.from(i);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function $s(i){return bt(this,arguments,function*(){const e=yield M(_t.from(i));try{if(!(yield M(e.open({autoDestroy:!1}))).closed)do yield yield M(e);while(!(yield M(e.reset().open())).closed)}finally{yield M(e.cancel())}})}function Hu(i){return new di(new Ju(i))}function Ku(i){const t=i.peek(_i+7&-8);return t&&t.byteLength>=4?_s(t)?new vs(new ua(i.read())):new di(new Gi(i)):new di(new Gi(function*(){}()))}function Gu(i){return p(this,void 0,void 0,function*(){const t=yield i.peek(_i+7&-8);return t&&t.byteLength>=4?_s(t)?new vs(new ua(yield i.read())):new Ki(new qi(i)):new Ki(new qi(function(){return bt(this,arguments,function*(){})}()))})}function qu(i){return p(this,void 0,void 0,function*(){const{size:t}=yield i.stat(),e=new $i(i,t);return t>=$u&&_s(yield e.readAt(0,_i+7&-8))?new Wu(new Yu(e)):new Ki(new qi(e))})}class k extends O{static assemble(...t){const e=s=>s.flatMap(r=>Array.isArray(r)?e(r):r instanceof G?r.data.children:r.data),n=new k;return n.visitMany(e(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof g)return this.visitMany(t.data),this;const{type:e}=t;if(!y.isDictionary(e)){const{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(y.isUnion(e))this.nodes.push(new ue(n,0));else{const{nullCount:s}=t;y.isNull(e)||vt.call(this,s<=0?new Uint8Array(0):ci(t.offset,n,t.nullBitmap)),this.nodes.push(new ue(n,s))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function vt(i){const t=i.byteLength+7&-8;return this.buffers.push(i),this.bufferRegions.push(new Et(this._byteLength,t)),this._byteLength+=t,this}function Zu(i){var t;const{type:e,length:n,typeIds:s,valueOffsets:r}=i;if(vt.call(this,s),e.mode===W.Sparse)return Mn.call(this,i);if(e.mode===W.Dense){if(i.offset<=0)return vt.call(this,r),Mn.call(this,i);{const o=new Int32Array(n),a=Object.create(null),c=Object.create(null);for(let l,h,d=-1;++d<n;)(l=s[d])!==void 0&&((h=a[l])===void 0&&(h=a[l]=r[d]),o[d]=r[d]-h,c[l]=((t=c[l])!==null&&t!==void 0?t:0)+1);vt.call(this,o),this.visitMany(i.children.map((l,h)=>{const d=e.typeIds[h],U=a[d],j=c[d];return l.slice(U,Math.min(n,j))}))}}return this}function Qu(i){let t;return i.nullCount>=i.length?vt.call(this,new Uint8Array(0)):(t=i.values)instanceof Uint8Array?vt.call(this,ci(i.offset,i.length,t)):vt.call(this,li(i.values))}function Qt(i){return vt.call(this,i.values.subarray(0,i.length*i.stride))}function da(i){const{length:t,values:e,valueOffsets:n}=i,{[0]:s,[t]:r}=n,o=Math.min(r-s,e.byteLength-s);return vt.call(this,Ln(-s,t+1,n)),vt.call(this,e.subarray(s,s+o)),this}function ws(i){const{length:t,valueOffsets:e}=i;if(e){const{[0]:n,[t]:s}=e;return vt.call(this,Ln(-n,t+1,e)),this.visit(i.children[0].slice(n,s-n))}return this.visit(i.children[0])}function Mn(i){return this.visitMany(i.type.children.map((t,e)=>i.children[e]).filter(Boolean))[0]}k.prototype.visitBool=Qu;k.prototype.visitInt=Qt;k.prototype.visitFloat=Qt;k.prototype.visitUtf8=da;k.prototype.visitBinary=da;k.prototype.visitFixedSizeBinary=Qt;k.prototype.visitDate=Qt;k.prototype.visitTimestamp=Qt;k.prototype.visitTime=Qt;k.prototype.visitDecimal=Qt;k.prototype.visitList=ws;k.prototype.visitStruct=Mn;k.prototype.visitUnion=Zu;k.prototype.visitInterval=Qt;k.prototype.visitDuration=Qt;k.prototype.visitFixedSizeList=ws;k.prototype.visitMap=ws;class Xu extends O{visit(t){return t==null?void 0:super.visit(t)}visitNull({typeId:t}){return{name:F[t].toLowerCase()}}visitInt({typeId:t,bitWidth:e,isSigned:n}){return{name:F[t].toLowerCase(),bitWidth:e,isSigned:n}}visitFloat({typeId:t,precision:e}){return{name:F[t].toLowerCase(),precision:J[e]}}visitBinary({typeId:t}){return{name:F[t].toLowerCase()}}visitBool({typeId:t}){return{name:F[t].toLowerCase()}}visitUtf8({typeId:t}){return{name:F[t].toLowerCase()}}visitDecimal({typeId:t,scale:e,precision:n,bitWidth:s}){return{name:F[t].toLowerCase(),scale:e,precision:n,bitWidth:s}}visitDate({typeId:t,unit:e}){return{name:F[t].toLowerCase(),unit:ct[e]}}visitTime({typeId:t,unit:e,bitWidth:n}){return{name:F[t].toLowerCase(),unit:f[e],bitWidth:n}}visitTimestamp({typeId:t,timezone:e,unit:n}){return{name:F[t].toLowerCase(),unit:f[n],timezone:e}}visitInterval({typeId:t,unit:e}){return{name:F[t].toLowerCase(),unit:It[e]}}visitDuration({typeId:t,unit:e}){return{name:F[t].toLocaleLowerCase(),unit:f[e]}}visitList({typeId:t}){return{name:F[t].toLowerCase()}}visitStruct({typeId:t}){return{name:F[t].toLowerCase()}}visitUnion({typeId:t,mode:e,typeIds:n}){return{name:F[t].toLowerCase(),mode:W[e].toUpperCase(),typeIds:[...n]}}visitDictionary(t){return this.visit(t.dictionary)}visitFixedSizeBinary({typeId:t,byteWidth:e}){return{name:F[t].toLowerCase(),byteWidth:e}}visitFixedSizeList({typeId:t,listSize:e}){return{name:F[t].toLowerCase(),listSize:e}}visitMap({typeId:t,keysSorted:e}){return{name:F[t].toLowerCase(),keysSorted:e}}}class un extends O{static assemble(...t){const e=new un;return t.map(({schema:n,data:s})=>e.visitMany(n.fields,s.children))}visit({name:t},e){const{length:n}=e,{offset:s,nullCount:r,nullBitmap:o}=e,a=y.isDictionary(e.type)?e.type.indices:e.type,c=Object.assign([],e.buffers,{[Ft.VALIDITY]:void 0});return Object.assign({name:t,count:n,VALIDITY:y.isNull(a)||y.isUnion(a)?void 0:r<=0?Array.from({length:n},()=>1):[...new $e(o,s,n,null,ss)]},super.visit(e.clone(a,s,n,0,c)))}visitNull(){return{}}visitBool({values:t,offset:e,length:n}){return{DATA:[...new $e(t,e,n,null,en)]}}visitInt(t){return{DATA:t.type.bitWidth<64?[...t.values]:[...Oe(t.values,2)]}}visitFloat(t){return{DATA:[...t.values]}}visitUtf8(t){return{DATA:[...new g([t])],OFFSET:[...t.valueOffsets]}}visitBinary(t){return{DATA:[...Ws(new g([t]))],OFFSET:[...t.valueOffsets]}}visitFixedSizeBinary(t){return{DATA:[...Ws(new g([t]))]}}visitDate(t){return{DATA:t.type.unit===ct.DAY?[...t.values]:[...Oe(t.values,2)]}}visitTimestamp(t){return{DATA:[...Oe(t.values,2)]}}visitTime(t){return{DATA:t.type.unit<f.MICROSECOND?[...t.values]:[...Oe(t.values,2)]}}visitDecimal(t){return{DATA:[...Oe(t.values,4)]}}visitList(t){return{OFFSET:[...t.valueOffsets],children:this.visitMany(t.type.children,t.children)}}visitStruct(t){return{children:this.visitMany(t.type.children,t.children)}}visitUnion(t){return{TYPE_ID:[...t.typeIds],OFFSET:t.type.mode===W.Dense?[...t.valueOffsets]:void 0,children:this.visitMany(t.type.children,t.children)}}visitInterval(t){return{DATA:[...t.values]}}visitDuration(t){return{DATA:[...Oe(t.values,2)]}}visitFixedSizeList(t){return{children:this.visitMany(t.type.children,t.children)}}visitMap(t){return{OFFSET:[...t.valueOffsets],children:this.visitMany(t.type.children,t.children)}}}function*Ws(i){for(const t of i)yield t.reduce((e,n)=>`${e}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*Oe(i,t){const e=new Uint32Array(i.buffer);for(let n=-1,s=e.length/t;++n<s;)yield`${fi.new(e.subarray((n+0)*t,(n+1)*t),!1)}`}class hn extends ls{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new ei,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,nt(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return ne(t)?t.then(e=>this.writeAll(e)):Se(t)?Ss(this,t):Is(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof ei?this._sink=t:(this._sink=new ei,t&&Ia(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&Sa(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!e||!Wi(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof Y&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof G&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!Wi(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof G?t instanceof gs||this._writeRecordBatch(t):t instanceof Y?this.writeAll(t.batches):Ge(t)&&this.writeAll(t)}_writeMessage(t,e=8){const n=e-1,s=Z.encode(t),r=s.byteLength,o=this._writeLegacyIpcFormat?4:8,a=r+o+n&~n,c=a-r-o;return t.headerType===V.RecordBatch?this._recordBatchBlocks.push(new Rt(a,t.bodyLength,this._position)):t.headerType===V.DictionaryBatch&&this._dictionaryBlocks.push(new Rt(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),r>0&&this._write(s),this._writePadding(c)}_write(t){if(this._started){const e=N(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(Z.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(hi)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:n,bufferRegions:s,buffers:r}=k.assemble(t),o=new lt(t.numRows,n,s),a=Z.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(r)}_writeDictionaryBatch(t,e,n=!1){this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));const{byteLength:s,nodes:r,bufferRegions:o,buffers:a}=k.assemble(new g([t])),c=new lt(t.length,r,o),l=new jt(c,e,n),h=Z.from(l,s);return this._writeMessage(h)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,n,s;for(let r=-1,o=t.length;++r<o;)(e=t[r])&&(n=e.byteLength)>0&&(this._write(e),(s=(n+7&-8)-n)>0&&this._writePadding(s));return this}_writeDictionaries(t){for(let[e,n]of t.dictionaries){let s=this._dictionaryDeltaOffsets.get(e)||0;if(s===0||(n=n?.slice(s)).length>0)for(const r of n.data)this._writeDictionaryBatch(r,e,s>0),s+=r.length}return this}}class dn extends hn{static writeAll(t,e){const n=new dn(e);return ne(t)?t.then(s=>n.writeAll(s)):Se(t)?Ss(n,t):Is(n,t)}}class fn extends hn{static writeAll(t){const e=new fn;return ne(t)?t.then(n=>e.writeAll(n)):Se(t)?Ss(e,t):Is(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const e=ui.encode(new ui(t,H.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}class fa extends hn{static writeAll(t){return new fa().writeAll(t)}constructor(){super(),this._autoDestroy=!0,this._recordBatches=[],this._dictionaries=[]}_writeMessage(){return this}_writeFooter(t){return this}_writeSchema(t){return this._write(`{
11
- "schema": ${JSON.stringify({fields:t.fields.map(e=>ya(e))},null,2)}`)}_writeDictionaries(t){return t.dictionaries.size>0&&this._dictionaries.push(t),this}_writeDictionaryBatch(t,e,n=!1){return this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0)),this._write(this._dictionaryBlocks.length===0?" ":`,
12
- `),this._write(`${th(t,e,n)}`),this._dictionaryBlocks.push(new Rt(0,0,0)),this}_writeRecordBatch(t){return this._writeDictionaries(t),this._recordBatches.push(t),this}close(){if(this._dictionaries.length>0){this._write(`,
13
- "dictionaries": [
14
- `);for(const t of this._dictionaries)super._writeDictionaries(t);this._write(`
15
- ]`)}if(this._recordBatches.length>0){for(let t=-1,e=this._recordBatches.length;++t<e;)this._write(t===0?`,
16
- "batches": [
17
- `:`,
18
- `),this._write(`${eh(this._recordBatches[t])}`),this._recordBatchBlocks.push(new Rt(0,0,0));this._write(`
19
- ]`)}return this._schema&&this._write(`
20
- }`),this._dictionaries=[],this._recordBatches=[],super.close()}}function Is(i,t){let e=t;t instanceof Y&&(e=t.batches,i.reset(void 0,t.schema));for(const n of e)i.write(n);return i.finish()}function Ss(i,t){var e,n,s,r,o,a,c;return p(this,void 0,void 0,function*(){try{for(e=!0,n=ie(t);s=yield n.next(),r=s.done,!r;e=!0){c=s.value,e=!1;const l=c;i.write(l)}}catch(l){o={error:l}}finally{try{!e&&!r&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return i.finish()})}function ya({name:i,type:t,nullable:e}){const n=new Xu;return{name:i,nullable:e,type:n.visit(t),children:(t.children||[]).map(s=>ya(s)),dictionary:y.isDictionary(t)?{id:t.id,isOrdered:t.isOrdered,indexType:n.visit(t.indices)}:void 0}}function th(i,t,e=!1){const[n]=un.assemble(new G({[t]:i}));return JSON.stringify({id:t,isDelta:e,data:{count:i.length,columns:n}},null,2)}function eh(i){const[t]=un.assemble(i);return JSON.stringify({count:i.numRows,columns:t},null,2)}function ih(i,t){if(Se(i))return sh(i,t);if(Ge(i))return nh(i,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function nh(i,t){let e=null;const n=t?.type==="bytes"||!1,s=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(o){r(o,e||(e=i[Symbol.iterator]()))},pull(o){e?r(o,e):o.close()},cancel(){(e?.return&&e.return()||!0)&&(e=null)}}),Object.assign({highWaterMark:n?s:void 0},t));function r(o,a){let c,l=null,h=o.desiredSize||null;for(;!(l=a.next(n?h:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=N(l.value))&&(h!=null&&n&&(h=h-c.byteLength+1),l.value=c),o.enqueue(l.value),h!=null&&--h<=0)return;o.close()}}function sh(i,t){let e=null;const n=t?.type==="bytes"||!1,s=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(o){return p(this,void 0,void 0,function*(){yield r(o,e||(e=i[Symbol.asyncIterator]()))})},pull(o){return p(this,void 0,void 0,function*(){e?yield r(o,e):o.close()})},cancel(){return p(this,void 0,void 0,function*(){(e?.return&&(yield e.return())||!0)&&(e=null)})}}),Object.assign({highWaterMark:n?s:void 0},t));function r(o,a){return p(this,void 0,void 0,function*(){let c,l=null,h=o.desiredSize||null;for(;!(l=yield a.next(n?h:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=N(l.value))&&(h!=null&&n&&(h=h-c.byteLength+1),l.value=c),o.enqueue(l.value),h!=null&&--h<=0)return;o.close()})}}function rh(i){return new oh(i)}class oh{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;const{["readableStrategy"]:e,["writableStrategy"]:n,["queueingStrategy"]:s="count"}=t,r=ba(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Ke(r),this._getSize=s!=="bytes"?Ys:Js;const{["highWaterMark"]:o=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},e),{["highWaterMark"]:a=s==="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:o,size:s!=="bytes"?Ys:Js}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(t){const e=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-e}_maybeFlush(t,e){e!=null&&(this._bufferedSize>=e.desiredSize&&++this._numChunks&&this._enqueue(e,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(e,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(e,null)))}_enqueue(t,e){this._bufferedSize=0,this._controller=null,e==null?t.close():t.enqueue(e)}}const Ys=i=>{var t;return(t=i?.length)!==null&&t!==void 0?t:0},Js=i=>{var t;return(t=i?.byteLength)!==null&&t!==void 0?t:0};function Bs(i,t){const e=new ei;let n=null;const s=new ReadableStream({cancel(){return p(this,void 0,void 0,function*(){yield e.close()})},start(a){return p(this,void 0,void 0,function*(){yield o(a,n||(n=yield r()))})},pull(a){return p(this,void 0,void 0,function*(){n?yield o(a,n):a.close()})}});return{writable:new WritableStream(e,Object.assign({highWaterMark:Math.pow(2,14)},i)),readable:s};function r(){return p(this,void 0,void 0,function*(){return yield(yield _t.from(e)).open(t)})}function o(a,c){return p(this,void 0,void 0,function*(){let l=a.desiredSize,h=null;for(;!(h=yield c.next()).done;)if(a.enqueue(h.value),l!=null&&--l<=0)return;a.close()})}}function Ds(i,t){const e=new this(i),n=new Ie(e),s=new ReadableStream({cancel(){return p(this,void 0,void 0,function*(){yield n.cancel()})},pull(o){return p(this,void 0,void 0,function*(){yield r(o)})},start(o){return p(this,void 0,void 0,function*(){yield r(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(e,i),readable:s};function r(o){return p(this,void 0,void 0,function*(){let a=null,c=o.desiredSize;for(;a=yield n.read(c||null);)if(o.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;o.close()})}}function ah(i){const t=_t.from(i);return ne(t)?t.then(e=>ah(e)):t.isAsync()?t.readAll().then(e=>new Y(e)):new Y(t.readAll())}function $h(i,t="stream"){return(t==="stream"?dn:fn).writeAll(i).toUint8Array(!0)}const Wh=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},rc),xl),dl),uc),Za),ul),sc),{compareSchemas:Wi,compareFields:hu,compareTypes:Go});ot.toDOMStream=ih;X.throughDOM=rh;_t.throughDOM=Bs;vs.throughDOM=Bs;di.throughDOM=Bs;hn.throughDOM=Ds;fn.throughDOM=Ds;dn.throughDOM=Ds;export{ei as AsyncByteQueue,Ie as AsyncByteStream,ku as AsyncMessageReader,Wu as AsyncRecordBatchFileReader,Ki as AsyncRecordBatchStreamReader,Ni as Binary,Mo as BinaryBuilder,ri as Bool,Vl as BoolBuilder,Ft as BufferType,X as Builder,Pi as ByteStream,C as Data,y as DataType,rn as DateBuilder,gh as DateDay,To as DateDayBuilder,ac as DateMillisecond,No as DateMillisecondBuilder,ct as DateUnit,je as Date_,Li as Decimal,Lo as DecimalBuilder,Uh as DenseUnion,iu as DenseUnionBuilder,ce as Dictionary,Rl as DictionaryBuilder,ae as Duration,qe as DurationBuilder,Th as DurationMicrosecond,Ro as DurationMicrosecondBuilder,Mh as DurationMillisecond,Vo as DurationMillisecondBuilder,Nh as DurationNanosecond,zo as DurationNanosecondBuilder,Fh as DurationSecond,Eo as DurationSecondBuilder,L as Field,Ui as FixedSizeBinary,Uo as FixedSizeBinaryBuilder,oi as FixedSizeList,zl as FixedSizeListBuilder,re as Float,oc as Float16,jl as Float16Builder,Tr as Float32,kl as Float32Builder,xn as Float64,Pl as Float64Builder,on as FloatBuilder,Q as Int,Dr as Int16,Wl as Int16Builder,ve as Int32,Yl as Int32Builder,Un as Int64,Jl as Int64Builder,Br as Int8,$l as Int8Builder,qt as IntBuilder,ke as Interval,an as IntervalBuilder,Dh as IntervalDayTime,xo as IntervalDayTimeBuilder,It as IntervalUnit,Ah as IntervalYearMonth,Co as IntervalYearMonthBuilder,Pu as JSONMessageReader,Pe as List,Zl as ListBuilder,Ql as MapBuilder,Xi as MapRow,ai as Map_,Z as Message,Hi as MessageHeader,aa as MessageReader,H as MetadataVersion,Jt as Null,Xl as NullBuilder,J as Precision,G as RecordBatch,vs as RecordBatchFileReader,fn as RecordBatchFileWriter,fa as RecordBatchJSONWriter,_t as RecordBatchReader,di as RecordBatchStreamReader,dn as RecordBatchStreamWriter,hn as RecordBatchWriter,x as Schema,xh as SparseUnion,eu as SparseUnionBuilder,K as Struct,tu as StructBuilder,es as StructRow,Y as Table,Ht as Time,Qe as TimeBuilder,_h as TimeMicrosecond,Jo as TimeMicrosecondBuilder,bh as TimeMillisecond,Yo as TimeMillisecondBuilder,vh as TimeNanosecond,Ho as TimeNanosecondBuilder,mh as TimeSecond,Wo as TimeSecondBuilder,f as TimeUnit,oe as Timestamp,Ze as TimestampBuilder,Sh as TimestampMicrosecond,Po as TimestampMicrosecondBuilder,Ih as TimestampMillisecond,ko as TimestampMillisecondBuilder,Bh as TimestampNanosecond,$o as TimestampNanosecondBuilder,wh as TimestampSecond,jo as TimestampSecondBuilder,u as Type,Or as Uint16,Kl as Uint16Builder,Fr as Uint32,Gl as Uint32Builder,Mr as Uint64,ql as Uint64Builder,Ar as Uint8,Hl as Uint8Builder,we as Union,ds as UnionBuilder,W as UnionMode,si as Utf8,Ko as Utf8Builder,g as Vector,O as Visitor,zh as builderThroughAsyncIterable,du as builderThroughIterable,Ke as makeBuilder,w as makeData,jh as makeTable,cs as makeVector,kh as tableFromArrays,ah as tableFromIPC,Rh as tableFromJSON,$h as tableToIPC,Wh as util,qo as vectorFromArray};
@@ -1 +0,0 @@
1
- const a="/assets/arrow2_bg-4Y7xYo54.wasm";export{a as default};
@@ -1 +0,0 @@
1
- import{u as s}from"./index-B1Ecw4AU.js";const o=700;function l(n){const e=s.getState(),i=e.basketViews.find(t=>t.id===n);if(i){if(e.setDrawing2D(null),e.setDrawing2DPanelVisible(!1),e.updateDrawing2DDisplayOptions({show3DOverlay:!1}),e.clearEntitySelection(),e.restoreBasketEntities(i.entityRefs,n),i.viewpoint){const t=i.transitionMs??o;e.cameraCallbacks.applyViewpoint?.(i.viewpoint,!0,t)}if(i.section){const t=i.section;s.setState({sectionPlane:{...t.plane},drawing2DPanelVisible:!1}),t.plane.enabled?(e.activeTool!=="section"&&e.setSuppressNextSection2DPanelAutoOpen(!0),e.setActiveTool("section")):e.activeTool==="section"&&e.setActiveTool("select")}else{const t=s.getState().sectionPlane;s.setState({sectionPlane:{...t,enabled:!1}}),e.activeTool==="section"&&e.setActiveTool("select")}}}export{l as activateBasketViewFromStore};
@@ -1 +0,0 @@
1
- let n=null;async function c(){if(n)return n;const e=globalThis;if(e.__TAURI_INTERNALS__?.invoke)return n=e.__TAURI_INTERNALS__.invoke,n;throw new Error("Tauri API not available - this module should only be used in Tauri apps")}async function s(e){try{const t=await(await c())("get_cached",{cacheKey:e});return t?(console.log(`[DesktopCache] Cache HIT for key: ${e} (${t.length} bytes)`),{buffer:new Uint8Array(t).buffer}):(console.log(`[DesktopCache] Cache MISS for key: ${e}`),null)}catch(a){return console.warn("[DesktopCache] Failed to get cached data:",a),null}}async function h(e,a,t,i,l){try{const o=await c(),r=Array.from(new Uint8Array(a));console.log(`[DesktopCache] Caching ${t} (${r.length} bytes) with key: ${e}`),await o("set_cached",{cacheKey:e,data:r}),console.log(`[DesktopCache] Successfully cached ${t}`)}catch(o){console.warn("[DesktopCache] Failed to save to cache:",o)}}async function u(){try{await(await c())("clear_cache"),console.log("[DesktopCache] Cache cleared")}catch(e){console.warn("[DesktopCache] Failed to clear cache:",e)}}async function d(){try{return await(await c())("get_cache_stats")}catch(e){return console.warn("[DesktopCache] Failed to get cache stats:",e),{entries:[],totalSize:0,entryCount:0}}}async function y(e){try{await(await c())("delete_cache_entry",{cacheKey:e}),console.log("[DesktopCache] Cache entry deleted:",e)}catch(a){console.warn("[DesktopCache] Failed to delete cache entry:",a)}}async function C(e){return await s(e)!==null}export{u as clearCache,y as deleteCached,d as getCacheStats,s as getCached,C as hasCached,h as setCached};