@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.
- package/.turbo/turbo-build.log +34 -24
- package/.turbo/turbo-typecheck.log +1 -42
- package/CHANGELOG.md +24 -0
- package/DESKTOP_CONTRACT_VERSION +1 -0
- package/dist/assets/arrow-CZ5kQ26f.js +20 -0
- package/dist/assets/basketViewActivator-BmnNtVfZ.js +1 -0
- package/dist/assets/bcf-DOG9_WPX.js +281 -0
- package/dist/assets/{browser-BDShTXzi.js → browser-C5TFR7sH.js} +1 -1
- package/dist/assets/cesium-ADbP7waU.css +1 -0
- package/dist/assets/cesium-DUOzBlqv.js +17817 -0
- package/dist/assets/drawing-2d-gWfpdfYe.js +257 -0
- package/dist/assets/epsg-index.generated-BjJrt_0S.js +1 -0
- package/dist/assets/exporters-ChAtBmlj.js +80367 -0
- package/dist/assets/geometry.worker-BQ0rzNo-.js +1 -0
- package/dist/assets/ids-B4jTqB1O.js +1 -0
- package/dist/assets/ifc-lite_bg-BX4E7TX8.wasm +0 -0
- package/dist/assets/index-Co8E2-FE.js +106013 -0
- package/dist/assets/index-DckuDqlv.css +1 -0
- package/dist/assets/lens-CSASnhAL.js +1 -0
- package/dist/assets/maplibre-gl-CGLcoNXc.js +811 -0
- package/dist/assets/native-bridge-BRvbckFQ.js +429 -0
- package/dist/assets/{arrow2-bb-jcVEo.js → parquet-CEXmQNRO.js} +2 -2
- package/dist/assets/sandbox-DZiNLNMk.js +5933 -0
- package/dist/assets/server-client-BV8zHZ7Y.js +626 -0
- package/dist/assets/tauri-core-stub-D8Fa-u43.js +1 -0
- package/dist/assets/tauri-dialog-stub-r7Wksg7o.js +1 -0
- package/dist/assets/tauri-fs-stub-BdeRC7aK.js +1 -0
- package/dist/assets/wasm-bridge-g01g7T9b.js +1 -0
- package/dist/assets/zip-DBEtpeu6.js +12 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/cesium/Assets/Textures/pin.svg +1 -0
- package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/cesium/Assets/approximateTerrainHeights.json +1 -0
- package/dist/cesium/ThirdParty/Workers/package.json +1 -0
- package/dist/cesium/ThirdParty/Workers/zip-web-worker.js +1 -0
- package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +1 -0
- package/dist/cesium/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/dist/cesium/ThirdParty/zip-module.wasm +0 -0
- package/dist/cesium/Widgets/Animation/Animation.css +127 -0
- package/dist/cesium/Widgets/Animation/lighter.css +70 -0
- package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +108 -0
- package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +22 -0
- package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +102 -0
- package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +113 -0
- package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +119 -0
- package/dist/cesium/Widgets/CesiumWidget/lighter.css +14 -0
- package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +8 -0
- package/dist/cesium/Widgets/Geocoder/Geocoder.css +70 -0
- package/dist/cesium/Widgets/Geocoder/lighter.css +17 -0
- package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +27 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/azureAerial.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/azureRoads.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/googleContour.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/googleRoadmap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/googleSatellite.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/googleSatelliteLabels.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +84 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +120 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +129 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +135 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +74 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/cesium/Widgets/InfoBox/InfoBox.css +92 -0
- package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +178 -0
- package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +93 -0
- package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +38 -0
- package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +15 -0
- package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +38 -0
- package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +56 -0
- package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +20 -0
- package/dist/cesium/Widgets/Timeline/Timeline.css +103 -0
- package/dist/cesium/Widgets/Timeline/lighter.css +23 -0
- package/dist/cesium/Widgets/VRButton/VRButton.css +8 -0
- package/dist/cesium/Widgets/Viewer/Viewer.css +107 -0
- package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +16 -0
- package/dist/cesium/Widgets/lighter.css +237 -0
- package/dist/cesium/Widgets/lighterShared.css +46 -0
- package/dist/cesium/Widgets/shared.css +103 -0
- package/dist/cesium/Widgets/widgets.css +1342 -0
- package/dist/cesium/Workers/chunk-23ZQ2IVV.js +29 -0
- package/dist/cesium/Workers/chunk-2EQO3Q56.js +26 -0
- package/dist/cesium/Workers/chunk-2MJIIVP4.js +26 -0
- package/dist/cesium/Workers/chunk-2TE5NTVD.js +26 -0
- package/dist/cesium/Workers/chunk-2ZBHLJST.js +26 -0
- package/dist/cesium/Workers/chunk-5TJMAQVL.js +26 -0
- package/dist/cesium/Workers/chunk-6BD4U3VO.js +26 -0
- package/dist/cesium/Workers/chunk-7TVGLKQF.js +26 -0
- package/dist/cesium/Workers/chunk-BTSYJ5XU.js +26 -0
- package/dist/cesium/Workers/chunk-BXMEEOCS.js +63 -0
- package/dist/cesium/Workers/chunk-BYLCY7GP.js +29 -0
- package/dist/cesium/Workers/chunk-CTHM3W6I.js +26 -0
- package/dist/cesium/Workers/chunk-CUUSNIVQ.js +26 -0
- package/dist/cesium/Workers/chunk-E3JOOS3S.js +26 -0
- package/dist/cesium/Workers/chunk-E7KYDCM5.js +26 -0
- package/dist/cesium/Workers/chunk-EDVBB7SS.js +27 -0
- package/dist/cesium/Workers/chunk-EFBN7QNX.js +26 -0
- package/dist/cesium/Workers/chunk-EQ4YRVWL.js +26 -0
- package/dist/cesium/Workers/chunk-F6PRE7D6.js +26 -0
- package/dist/cesium/Workers/chunk-FC4ZZ65J.js +26 -0
- package/dist/cesium/Workers/chunk-FFBVWF2L.js +26 -0
- package/dist/cesium/Workers/chunk-GBAA6GVX.js +26 -0
- package/dist/cesium/Workers/chunk-ICALLYLG.js +26 -0
- package/dist/cesium/Workers/chunk-ILRYTWTP.js +26 -0
- package/dist/cesium/Workers/chunk-IRNLBSEJ.js +26 -0
- package/dist/cesium/Workers/chunk-IX4VMHEV.js +26 -0
- package/dist/cesium/Workers/chunk-L6QHHACZ.js +26 -0
- package/dist/cesium/Workers/chunk-LI2ZSORM.js +26 -0
- package/dist/cesium/Workers/chunk-LSLE2RL4.js +26 -0
- package/dist/cesium/Workers/chunk-M4HLDBCG.js +26 -0
- package/dist/cesium/Workers/chunk-MJHHSGEH.js +26 -0
- package/dist/cesium/Workers/chunk-NMVKML6W.js +26 -0
- package/dist/cesium/Workers/chunk-OCWJRAXS.js +26 -0
- package/dist/cesium/Workers/chunk-OIRKANTH.js +26 -0
- package/dist/cesium/Workers/chunk-OIT7J4IC.js +26 -0
- package/dist/cesium/Workers/chunk-OLZ3FYUM.js +26 -0
- package/dist/cesium/Workers/chunk-Q5BPHJQF.js +26 -0
- package/dist/cesium/Workers/chunk-QFM5DCMQ.js +26 -0
- package/dist/cesium/Workers/chunk-QKUIYMGC.js +28 -0
- package/dist/cesium/Workers/chunk-S44JILQT.js +26 -0
- package/dist/cesium/Workers/chunk-SLT4J352.js +26 -0
- package/dist/cesium/Workers/chunk-SQMIIXB7.js +26 -0
- package/dist/cesium/Workers/chunk-TJ4XLGBQ.js +26 -0
- package/dist/cesium/Workers/chunk-TNSUQXWK.js +27 -0
- package/dist/cesium/Workers/chunk-UBOGZS7F.js +26 -0
- package/dist/cesium/Workers/chunk-V3OSTMM6.js +26 -0
- package/dist/cesium/Workers/chunk-V7QEYVP3.js +26 -0
- package/dist/cesium/Workers/chunk-VUKYSU4H.js +26 -0
- package/dist/cesium/Workers/chunk-W37FE5GR.js +26 -0
- package/dist/cesium/Workers/chunk-WBOV35NL.js +26 -0
- package/dist/cesium/Workers/chunk-WPMZLB3Y.js +26 -0
- package/dist/cesium/Workers/chunk-WWWZVEEH.js +26 -0
- package/dist/cesium/Workers/chunk-XFIQ5DEQ.js +28 -0
- package/dist/cesium/Workers/chunk-XQHLGIO7.js +26 -0
- package/dist/cesium/Workers/chunk-XUSCFAVF.js +26 -0
- package/dist/cesium/Workers/chunk-YP7I5QBZ.js +26 -0
- package/dist/cesium/Workers/chunk-Z3QF2EHT.js +26 -0
- package/dist/cesium/Workers/combineGeometry.js +26 -0
- package/dist/cesium/Workers/createBoxGeometry.js +26 -0
- package/dist/cesium/Workers/createBoxOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCircleGeometry.js +26 -0
- package/dist/cesium/Workers/createCircleOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +26 -0
- package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCorridorGeometry.js +26 -0
- package/dist/cesium/Workers/createCorridorOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCylinderGeometry.js +26 -0
- package/dist/cesium/Workers/createCylinderOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipseGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipseOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipsoidGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createFrustumGeometry.js +26 -0
- package/dist/cesium/Workers/createFrustumOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createGeometry.js +26 -0
- package/dist/cesium/Workers/createGroundPolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createPlaneGeometry.js +26 -0
- package/dist/cesium/Workers/createPlaneOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolygonGeometry.js +26 -0
- package/dist/cesium/Workers/createPolygonOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineVolumeGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createRectangleGeometry.js +26 -0
- package/dist/cesium/Workers/createRectangleOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createSimplePolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createSphereGeometry.js +26 -0
- package/dist/cesium/Workers/createSphereOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createTaskProcessorWorker.js +26 -0
- package/dist/cesium/Workers/createVectorTileClampedPolylines.js +26 -0
- package/dist/cesium/Workers/createVectorTileGeometries.js +26 -0
- package/dist/cesium/Workers/createVectorTilePoints.js +26 -0
- package/dist/cesium/Workers/createVectorTilePolygons.js +26 -0
- package/dist/cesium/Workers/createVectorTilePolylines.js +26 -0
- package/dist/cesium/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -0
- package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +26 -0
- package/dist/cesium/Workers/createVerticesFromHeightmap.js +26 -0
- package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -0
- package/dist/cesium/Workers/createWallGeometry.js +26 -0
- package/dist/cesium/Workers/createWallOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/decodeDraco.js +26 -0
- package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +26 -0
- package/dist/cesium/Workers/decodeI3S.js +26 -0
- package/dist/cesium/Workers/gaussianSplatSorter.js +26 -0
- package/dist/cesium/Workers/gaussianSplatTextureGenerator.js +26 -0
- package/dist/cesium/Workers/incrementallyBuildTerrainPicker.js +26 -0
- package/dist/cesium/Workers/transcodeKTX2.js +56 -0
- package/dist/cesium/Workers/transferTypedArrayTest.js +26 -0
- package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +26 -0
- package/dist/cesium/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -0
- package/dist/index.html +13 -2
- package/package.json +27 -19
- package/src/App.tsx +1 -17
- package/src/components/viewer/BCFPanel.tsx +46 -4
- package/src/components/viewer/CesiumOverlay.tsx +672 -0
- package/src/components/viewer/CesiumSettingsDialog.tsx +100 -0
- package/src/components/viewer/ChatPanel.tsx +54 -16
- package/src/components/viewer/CommandPalette.tsx +6 -1
- package/src/components/viewer/DesktopEntitlementBanner.tsx +74 -0
- package/src/components/viewer/ExportChangesButton.tsx +24 -4
- package/src/components/viewer/ExportDialog.tsx +38 -9
- package/src/components/viewer/HierarchyPanel.tsx +202 -6
- package/src/components/viewer/IDSPanel.tsx +52 -3
- package/src/components/viewer/KeyboardShortcutsDialog.tsx +1 -1
- package/src/components/viewer/MainToolbar.tsx +353 -27
- package/src/components/viewer/PropertiesPanel.tsx +306 -131
- package/src/components/viewer/ScriptPanel.tsx +34 -8
- package/src/components/viewer/Section2DPanel.tsx +3 -2
- package/src/components/viewer/SettingsPage.tsx +430 -0
- package/src/components/viewer/StatusBar.tsx +17 -1
- package/src/components/viewer/UpgradePage.tsx +6 -4
- package/src/components/viewer/ViewerLayout.tsx +47 -6
- package/src/components/viewer/Viewport.tsx +49 -8
- package/src/components/viewer/ViewportContainer.tsx +285 -32
- package/src/components/viewer/ViewportOverlays.tsx +129 -27
- package/src/components/viewer/hierarchy/treeDataBuilder.ts +2 -1
- package/src/components/viewer/properties/EpsgLookupDialog.tsx +418 -0
- package/src/components/viewer/properties/GeoreferencingPanel.tsx +703 -0
- package/src/components/viewer/properties/LocationMap.tsx +730 -0
- package/src/components/viewer/properties/ModelMetadataPanel.tsx +3 -70
- package/src/components/viewer/selectionHandlers.ts +4 -3
- package/src/components/viewer/useAnimationLoop.ts +4 -0
- package/src/components/viewer/useGeometryStreaming.ts +127 -40
- package/src/components/viewer/useMouseControls.ts +4 -1
- package/src/hooks/bcfIdLookup.ts +13 -11
- package/src/hooks/ids/idsColorSystem.ts +3 -8
- package/src/hooks/ingest/viewerModelIngest.ts +275 -0
- package/src/hooks/useIDS.ts +32 -17
- package/src/hooks/useIfc.ts +7 -1
- package/src/hooks/useIfcCache.ts +28 -15
- package/src/hooks/useIfcFederation.ts +59 -227
- package/src/hooks/useIfcLoader.ts +1656 -130
- package/src/hooks/useIfcServer.ts +0 -69
- package/src/lib/desktop/ClerkDesktopEntitlementSync.tsx +175 -0
- package/src/lib/desktop/desktopEntitlementEvents.ts +39 -0
- package/src/lib/desktop-entitlement.ts +45 -0
- package/src/lib/desktop-product.ts +124 -0
- package/src/lib/geo/cesium-bridge.ts +310 -0
- package/src/lib/geo/kmz-exporter.ts +112 -0
- package/src/lib/geo/reproject.ts +370 -0
- package/src/lib/lens/adapter.ts +3 -1
- package/src/lib/recent-files.ts +2 -1
- package/src/main.tsx +1 -0
- package/src/sdk/adapters/export-adapter.ts +14 -1
- package/src/sdk/adapters/viewer-adapter.ts +5 -9
- package/src/sdk/adapters/visibility-adapter.ts +6 -9
- package/src/services/analysis-extensions.ts +125 -0
- package/src/services/app-navigation.ts +13 -0
- package/src/services/bsdd.ts +53 -4
- package/src/services/cacheService.ts +1 -1
- package/src/services/desktop-cache.ts +43 -0
- package/src/services/desktop-export.ts +77 -0
- package/src/services/desktop-harness.ts +196 -0
- package/src/services/desktop-logger.ts +20 -0
- package/src/services/desktop-native-metadata.ts +207 -0
- package/src/services/desktop-panel-actions.ts +43 -0
- package/src/services/desktop-preferences.ts +44 -0
- package/src/services/file-dialog.ts +147 -0
- package/src/services/tauri-core-stub.ts +7 -0
- package/src/services/tauri-dialog-stub.ts +7 -0
- package/src/services/tauri-fs-stub.ts +7 -0
- package/src/store/basketVisibleSet.ts +3 -4
- package/src/store/globalId.ts +79 -0
- package/src/store/index.ts +41 -2
- package/src/store/slices/cesiumSlice.ts +122 -0
- package/src/store/slices/chatSlice.ts +5 -1
- package/src/store/slices/dataSlice.ts +139 -28
- package/src/store/slices/desktopEntitlementSlice.ts +86 -0
- package/src/store/slices/loadingSlice.ts +14 -2
- package/src/store/slices/modelSlice.ts +58 -3
- package/src/store/slices/mutationSlice.ts +178 -0
- package/src/store/slices/pinboardSlice.ts +4 -8
- package/src/store/types.ts +96 -2
- package/src/store.ts +1 -1
- package/src/utils/desktopModelSnapshot.ts +358 -0
- package/src/utils/ifcConfig.ts +6 -1
- package/src/utils/nativeSpatialDataStore.ts +250 -0
- package/src/utils/serverDataModel.ts +4 -0
- package/src/utils/spatialHierarchy.ts +10 -11
- package/vite.config.ts +41 -0
- package/dist/assets/Arrow.dom-BhOg9lpn.js +0 -20
- package/dist/assets/arrow2_bg-BlXl-cSQ.js +0 -1
- package/dist/assets/basketViewActivator-BRG5DBmM.js +0 -1
- package/dist/assets/desktop-cache-oPzaWXYE.js +0 -1
- package/dist/assets/geometry.worker-kgiT_Qhh.js +0 -1
- package/dist/assets/ifc-lite_bg-FNRmpSvM.wasm +0 -0
- package/dist/assets/index-B1Ecw4AU.js +0 -189756
- package/dist/assets/index-Ba4eoTe7.css +0 -1
- package/dist/assets/index-CrgYBjTn.js +0 -229
- package/dist/assets/module-6F3E5H7Y-tx0BadV3.js +0 -6
- package/dist/assets/native-bridge-Crsb7TKz.js +0 -111
- package/dist/assets/wasm-bridge-mJUhb7uk.js +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var Fn=function(i,t){return Fn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])},Fn(i,t)};function xh(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Fn(i,t);function e(){this.constructor=i}i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var ss=function(){return ss=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},ss.apply(this,arguments)};function Ka(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(i);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(i,n[r])&&(e[n[r]]=i[n[r]]);return e}function p(i,t,e,n){function r(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(h){try{l(n.next(h))}catch(d){o(d)}}function c(h){try{l(n.throw(h))}catch(d){o(d)}}function l(h){h.done?s(h.value):r(h.value).then(a,c)}l((n=n.apply(i,t||[])).next())})}function os(i){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&i[t],n=0;if(e)return e.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&n>=i.length&&(i=void 0),{value:i&&i[n++],done:!i}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ch(i,t){var e=typeof Symbol=="function"&&i[Symbol.iterator];if(!e)return i;var n=e.call(i),r,s=[],o;try{for(;(t===void 0||t-- >0)&&!(r=n.next()).done;)s.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return s}function Eh(i,t,e){if(e||arguments.length===2)for(var n=0,r=t.length,s;n<r;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return i.concat(s||Array.prototype.slice.call(t))}function D(i){return this instanceof D?(this.v=i,this):new D(i)}function wt(i,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(i,t||[]),r,s=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),r[Symbol.asyncIterator]=function(){return this},r;function o(M){return function(k){return Promise.resolve(k).then(M,d)}}function a(M,k){n[M]&&(r[M]=function(Ue){return new Promise(function(wn,ne){s.push([M,Ue,wn,ne])>1||c(M,Ue)})},k&&(r[M]=k(r[M])))}function c(M,k){try{l(n[M](k))}catch(Ue){U(s[0][3],Ue)}}function l(M){M.value instanceof D?Promise.resolve(M.value.v).then(h,d):U(s[0][2],M)}function h(M){c("next",M)}function d(M){c("throw",M)}function U(M,k){M(k),s.shift(),s.length&&c(s[0][0],s[0][1])}}function Vi(i){var t,e;return t={},n("next"),n("throw",function(r){throw r}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(r,s){t[r]=i[r]?function(o){return(e=!e)?{value:D(i[r](o)),done:!1}:s?s(o):o}:s}}function ae(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=i[Symbol.asyncIterator],e;return t?t.call(i):(i=typeof os=="function"?os(i):i[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(s){e[s]=i[s]&&function(o){return new Promise(function(a,c){o=i[s](o),r(a,c,o.done,o.value)})}}function r(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}const qa=new TextDecoder("utf-8"),Mn=i=>qa.decode(i),Ga=new TextEncoder,on=i=>Ga.encode(i),Za=i=>typeof i=="number",Fs=i=>typeof i=="boolean",W=i=>typeof i=="function",rt=i=>i!=null&&Object(i)===i,ce=i=>rt(i)&&W(i.then),si=i=>rt(i)&&W(i[Symbol.iterator]),Fe=i=>rt(i)&&W(i[Symbol.asyncIterator]),Tn=i=>rt(i)&&rt(i.schema),Ms=i=>rt(i)&&"done"in i&&"value"in i,Ts=i=>rt(i)&&W(i.stat)&&Za(i.fd),Ns=i=>rt(i)&&zn(i.body),an=i=>"_getDOMStream"in i&&"_getNodeStream"in i,Qa=i=>rt(i)&&W(i.abort)&&W(i.getWriter)&&!an(i),zn=i=>rt(i)&&W(i.cancel)&&W(i.getReader)&&!an(i),Xa=i=>rt(i)&&W(i.end)&&W(i.write)&&Fs(i.writable)&&!an(i),Ls=i=>rt(i)&&W(i.read)&&W(i.pipe)&&Fs(i.readable)&&!an(i),tc=i=>rt(i)&&W(i.clear)&&W(i.bytes)&&W(i.position)&&W(i.setPosition)&&W(i.capacity)&&W(i.getBufferIdentifier)&&W(i.createLong),jn=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function ec(i){const t=i[0]?[i[0]]:[];let e,n,r,s;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:r}=o,{byteOffset:n,byteLength:s}=a,e+r<n||n+s<e){a&&(t[++l]=a);continue}t[l]=new Uint8Array(o.buffer,e,n-e+s)}return t}function ci(i,t,e=0,n=t.byteLength){const r=i.byteLength,s=new Uint8Array(i.buffer,i.byteOffset,r),o=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,r));return s.set(o,e),i}function St(i,t){const e=ec(i),n=e.reduce((h,d)=>h+d.byteLength,0);let r,s,o,a=0,c=-1;const l=Math.min(t||Number.POSITIVE_INFINITY,n);for(const h=e.length;++c<h;){if(r=e[c],s=r.subarray(0,Math.min(r.length,l-a)),l<=a+s.length){s.length<r.length?e[c]=r.subarray(s.length):s.length===r.length&&c++,o?ci(o,s,a):o=s;break}ci(o||(o=new Uint8Array(l)),s,a),a+=s.length}return[o||new Uint8Array(0),e.slice(c),n-(o?o.byteLength:0)]}function N(i,t){let e=Ms(t)?t.value:t;return e instanceof i?i===Uint8Array?new i(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=on(e)),e instanceof ArrayBuffer?new i(e):e instanceof jn?new i(e):tc(e)?N(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 ic=i=>N(Int8Array,i),nc=i=>N(Int16Array,i),Ee=i=>N(Int32Array,i),rc=i=>N(BigInt64Array,i),L=i=>N(Uint8Array,i),sc=i=>N(Uint16Array,i),oc=i=>N(Uint32Array,i),ac=i=>N(BigUint64Array,i),cc=i=>N(Float32Array,i),lc=i=>N(Float64Array,i),uc=i=>N(Uint8ClampedArray,i),Nn=i=>(i.next(),i);function*$t(i,t){const e=function*(r){yield r},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof jn?e(t):si(t)?t:e(t);return yield*Nn(function*(r){let s=null;do s=r.next(yield N(i,s));while(!s.done)}(n[Symbol.iterator]())),new i}const hc=i=>$t(Int8Array,i),dc=i=>$t(Int16Array,i),fc=i=>$t(Int32Array,i),Us=i=>$t(Uint8Array,i),yc=i=>$t(Uint16Array,i),pc=i=>$t(Uint32Array,i),gc=i=>$t(Float32Array,i),mc=i=>$t(Float64Array,i),bc=i=>$t(Uint8ClampedArray,i);function At(i,t){return wt(this,arguments,function*(){if(ce(t))return yield D(yield D(yield*Vi(ae(At(i,yield D(t))))));const n=function(o){return wt(this,arguments,function*(){yield yield D(yield D(o))})},r=function(o){return wt(this,arguments,function*(){yield D(yield*Vi(ae(Nn(function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof jn?n(t):si(t)?r(t):Fe(t)?t:n(t);return yield D(yield*Vi(ae(Nn(function(o){return wt(this,arguments,function*(){let a=null;do a=yield D(o.next(yield yield D(N(i,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield D(new i)})}const _c=i=>At(Int8Array,i),vc=i=>At(Int16Array,i),wc=i=>At(Int32Array,i),xs=i=>At(Uint8Array,i),Ic=i=>At(Uint16Array,i),Sc=i=>At(Uint32Array,i),Bc=i=>At(Float32Array,i),Ac=i=>At(Float64Array,i),Dc=i=>At(Uint8ClampedArray,i);function kn(i,t,e){if(i!==0){e=e.slice(0,t);for(let n=-1,r=e.length;++n<r;)e[n]+=i}return e.subarray(0,t)}function Cs(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 Oc=Object.freeze(Object.defineProperty({__proto__:null,compareArrayLike:Cs,joinUint8Arrays:St,memcpy:ci,rebaseValueOffsets:kn,toArrayBufferView:N,toArrayBufferViewAsyncIterator:At,toArrayBufferViewIterator:$t,toBigInt64Array:rc,toBigUint64Array:ac,toFloat32Array:cc,toFloat32ArrayAsyncIterator:Bc,toFloat32ArrayIterator:gc,toFloat64Array:lc,toFloat64ArrayAsyncIterator:Ac,toFloat64ArrayIterator:mc,toInt16Array:nc,toInt16ArrayAsyncIterator:vc,toInt16ArrayIterator:dc,toInt32Array:Ee,toInt32ArrayAsyncIterator:wc,toInt32ArrayIterator:fc,toInt8Array:ic,toInt8ArrayAsyncIterator:_c,toInt8ArrayIterator:hc,toUint16Array:sc,toUint16ArrayAsyncIterator:Ic,toUint16ArrayIterator:yc,toUint32Array:oc,toUint32ArrayAsyncIterator:Sc,toUint32ArrayIterator:pc,toUint8Array:L,toUint8ArrayAsyncIterator:xs,toUint8ArrayIterator:Us,toUint8ClampedArray:uc,toUint8ClampedArrayAsyncIterator:Dc,toUint8ClampedArrayIterator:bc},Symbol.toStringTag,{value:"Module"})),ct={fromIterable(i){return xi(Fc(i))},fromAsyncIterable(i){return xi(Mc(i))},fromDOMStream(i){return xi(Tc(i))},fromNodeStream(i){return xi(Lc(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')}},xi=i=>(i.next(),i);function*Fc(i){let t,e=!1,n=[],r,s,o,a=0;function c(){return s==="peek"?St(n,o)[0]:([r,n,a]=St(n,o),r)}({cmd:s,size:o}=yield null);const l=Us(i)[Symbol.iterator]();try{do if({done:t,value:r}=Number.isNaN(o-a)?l.next():l.next(o-a),!t&&r.byteLength>0&&(n.push(r),a+=r.byteLength),t||o<=a)do({cmd:s,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 Mc(i){return wt(this,arguments,function*(){let e,n=!1,r=[],s,o,a,c=0;function l(){return o==="peek"?St(r,a)[0]:([s,r,c]=St(r,a),s)}({cmd:o,size:a}=yield yield D(null));const h=xs(i)[Symbol.asyncIterator]();try{do if({done:e,value:s}=Number.isNaN(a-c)?yield D(h.next()):yield D(h.next(a-c)),!e&&s.byteLength>0&&(r.push(s),c+=s.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield D(l()));while(a<c);while(!e)}catch(d){(n=!0)&&typeof h.throw=="function"&&(yield D(h.throw(d)))}finally{n===!1&&typeof h.return=="function"&&(yield D(h.return(new Uint8Array(0))))}return yield D(null)})}function Tc(i){return wt(this,arguments,function*(){let e=!1,n=!1,r=[],s,o,a,c=0;function l(){return o==="peek"?St(r,a)[0]:([s,r,c]=St(r,a),s)}({cmd:o,size:a}=yield yield D(null));const h=new Nc(i);try{do if({done:e,value:s}=Number.isNaN(a-c)?yield D(h.read()):yield D(h.read(a-c)),!e&&s.byteLength>0&&(r.push(L(s)),c+=s.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield D(l()));while(a<c);while(!e)}catch(d){(n=!0)&&(yield D(h.cancel(d)))}finally{n===!1?yield D(h.cancel()):i.locked&&h.releaseLock()}return yield D(null)})}class Nc{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=L(e)),e})}}const In=(i,t)=>{const e=r=>n([t,r]);let n;return[t,e,new Promise(r=>(n=r)&&i.once(t,e))]};function Lc(i){return wt(this,arguments,function*(){const e=[];let n="error",r=!1,s=null,o,a,c=0,l=[],h;function d(){return o==="peek"?St(l,a)[0]:([h,l,c]=St(l,a),h)}if({cmd:o,size:a}=yield yield D(null),i.isTTY)return yield yield D(new Uint8Array(0)),yield D(null);try{e[0]=In(i,"end"),e[1]=In(i,"error");do{if(e[2]=In(i,"readable"),[n,s]=yield D(Promise.race(e.map(M=>M[2]))),n==="error")break;if((r=n==="end")||(Number.isFinite(a-c)?(h=L(i.read(a-c)),h.byteLength<a-c&&(h=L(i.read()))):h=L(i.read()),h.byteLength>0&&(l.push(h),c+=h.byteLength)),r||a<=c)do({cmd:o,size:a}=yield yield D(d()));while(a<c)}while(!r)}finally{yield D(U(e,n==="error"?s:null))}return yield D(null);function U(M,k){return h=l=null,new Promise((Ue,wn)=>{for(const[ne,Ha]of M)i.off(ne,Ha);try{const ne=i.destroy;ne&&ne.call(i,k),k=void 0}catch(ne){k=ne||k}finally{k!=null?wn(k):Ue()}})}})}var K;(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"})(K||(K={}));var $;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})($||($={}));var H;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(H||(H={}));var st;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(st||(st={}));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 pt;(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"})(pt||(pt={}));var R;(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"})(R||(R={}));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 bt;(function(i){i[i.OFFSET=0]="OFFSET",i[i.DATA=1]="DATA",i[i.VALIDITY=2]="VALIDITY",i[i.TYPE=3]="TYPE"})(bt||(bt={}));const Uc=void 0;function le(i){if(i===null)return"null";if(i===Uc)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=>le(t))}]`:`[${i}]`:ArrayBuffer.isView(i)?`[${i}]`:JSON.stringify(i,(t,e)=>typeof e=="bigint"?`${e}`:e)}const xc=Object.freeze(Object.defineProperty({__proto__:null,valueToString:le},Symbol.toStringTag,{value:"Module"})),Es=Symbol.for("isArrowBigNum");function Dt(i,...t){return t.length===0?Object.setPrototypeOf(N(this.TypedArray,i),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(i,...t),this.constructor.prototype)}Dt.prototype[Es]=!0;Dt.prototype.toJSON=function(){return`"${Ke(this)}"`};Dt.prototype.valueOf=function(){return Vs(this)};Dt.prototype.toString=function(){return Ke(this)};Dt.prototype[Symbol.toPrimitive]=function(i="default"){switch(i){case"number":return Vs(this);case"string":return Ke(this);case"default":return Rs(this)}return Ke(this)};function Pe(...i){return Dt.apply(this,i)}function $e(...i){return Dt.apply(this,i)}function li(...i){return Dt.apply(this,i)}Object.setPrototypeOf(Pe.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf($e.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(li.prototype,Object.create(Uint32Array.prototype));Object.assign(Pe.prototype,Dt.prototype,{constructor:Pe,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign($e.prototype,Dt.prototype,{constructor:$e,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(li.prototype,Dt.prototype,{constructor:li,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});function Vs(i){const{buffer:t,byteOffset:e,length:n,signed:r}=i,s=new BigUint64Array(t,e,n),o=r&&s.at(-1)&BigInt(1)<<BigInt(63);let a=BigInt(o?1:0),c=BigInt(0);if(o){for(const l of s)a+=~l*(BigInt(1)<<BigInt(32)*c++);a*=BigInt(-1)}else for(const l of s)a+=l*(BigInt(1)<<BigInt(32)*c++);return a}const Ke=i=>{if(i.byteLength===8)return`${new i.BigIntArray(i.buffer,i.byteOffset,1)[0]}`;if(!i.signed)return Sn(i);let t=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return Sn(i);t=t.slice();let n=1;for(let s=0;s<t.length;s++){const o=t[s],a=~o+n;t[s]=a,n&=o===0?1:0}return`-${Sn(t)}`},Rs=i=>i.byteLength===8?new i.BigIntArray(i.buffer,i.byteOffset,1)[0]:Ke(i);function Sn(i){let t="";const e=new Uint32Array(2);let n=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2);const r=new Uint32Array((n=new Uint16Array(n).reverse()).buffer);let s=-1;const o=n.length-1;do{for(e[0]=n[s=0];s<o;)n[s++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+n[s];n[s]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(r[0]||r[1]||r[2]||r[3]);return t??"0"}class vi{static new(t,e){switch(e){case!0:return new Pe(t);case!1:return new $e(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Pe(t)}return t.byteLength===16?new li(t):new $e(t)}static signed(t){return new Pe(t)}static unsigned(t){return new $e(t)}static decimal(t){return new li(t)}constructor(t,e){return vi.new(t,e)}}const Cc=Object.freeze(Object.defineProperty({__proto__:null,BN:vi,bigNumToBigInt:Rs,bigNumToString:Ke,isArrowBigNumSymbol:Es},Symbol.toStringTag,{value:"Module"}));function Bt(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 zs,js,ks,Ps,$s,Ws,Ys,Js,Hs,Ks,qs,Gs,Zs,Qs,Xs,to,eo,io,no,ro;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===$.Dense}static isSparseUnion(t){return y.isUnion(t)&&t.mode===$.Sparse}get typeId(){return u.NONE}}zs=Symbol.toStringTag;y[zs]=(i=>(i.children=null,i.ArrayType=Array,i[Symbol.toStringTag]="DataType"))(y.prototype);let Vt=class extends y{toString(){return"Null"}get typeId(){return u.Null}};js=Symbol.toStringTag;Vt[js]=(i=>i[Symbol.toStringTag]="Null")(Vt.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}`}}ks=Symbol.toStringTag;Q[ks]=(i=>(i.isSigned=null,i.bitWidth=null,i[Symbol.toStringTag]="Int"))(Q.prototype);class Pn extends Q{constructor(){super(!0,8)}get ArrayType(){return Int8Array}}class $n extends Q{constructor(){super(!0,16)}get ArrayType(){return Int16Array}}class ue extends Q{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}let cn=class extends Q{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}};class Wn extends Q{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}}class Yn extends Q{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}}class Jn extends Q{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}}let Hn=class extends Q{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Pn.prototype,"ArrayType",{value:Int8Array});Object.defineProperty($n.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(ue.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(cn.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Wn.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Yn.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Jn.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Hn.prototype,"ArrayType",{value:BigUint64Array});class qt extends y{constructor(t){super(),this.precision=t}get typeId(){return u.Float}get ArrayType(){switch(this.precision){case H.HALF:return Uint16Array;case H.SINGLE:return Float32Array;case H.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}Ps=Symbol.toStringTag;qt[Ps]=(i=>(i.precision=null,i[Symbol.toStringTag]="Float"))(qt.prototype);class so extends qt{constructor(){super(H.HALF)}}class Kn extends qt{constructor(){super(H.SINGLE)}}class ln extends qt{constructor(){super(H.DOUBLE)}}Object.defineProperty(so.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Kn.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(ln.prototype,"ArrayType",{value:Float64Array});let ui=class extends y{constructor(){super()}get typeId(){return u.Binary}toString(){return"Binary"}};$s=Symbol.toStringTag;ui[$s]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Binary"))(ui.prototype);let qe=class extends y{constructor(){super()}get typeId(){return u.Utf8}toString(){return"Utf8"}};Ws=Symbol.toStringTag;qe[Ws]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Utf8"))(qe.prototype);let Ge=class extends y{constructor(){super()}get typeId(){return u.Bool}toString(){return"Bool"}};Ys=Symbol.toStringTag;Ge[Ys]=(i=>(i.ArrayType=Uint8Array,i[Symbol.toStringTag]="Bool"))(Ge.prototype);let hi=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}]`}};Js=Symbol.toStringTag;hi[Js]=(i=>(i.scale=null,i.precision=null,i.ArrayType=Uint32Array,i[Symbol.toStringTag]="Decimal"))(hi.prototype);class Be extends y{constructor(t){super(),this.unit=t}get typeId(){return u.Date}toString(){return`Date${(this.unit+1)*32}<${st[this.unit]}>`}}Hs=Symbol.toStringTag;Be[Hs]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Date"))(Be.prototype);class Ec extends Be{constructor(){super(st.DAY)}}class oo extends Be{constructor(){super(st.MILLISECOND)}}class Rt 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`)}}Ks=Symbol.toStringTag;Rt[Ks]=(i=>(i.unit=null,i.bitWidth=null,i[Symbol.toStringTag]="Time"))(Rt.prototype);class Vc extends Rt{constructor(){super(f.SECOND,32)}}class Rc extends Rt{constructor(){super(f.MILLISECOND,32)}}class zc extends Rt{constructor(){super(f.MICROSECOND,64)}}class jc extends Rt{constructor(){super(f.NANOSECOND,64)}}class Gt 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}`:""}>`}}qs=Symbol.toStringTag;Gt[qs]=(i=>(i.unit=null,i.timezone=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Timestamp"))(Gt.prototype);class kc extends Gt{constructor(t){super(f.SECOND,t)}}class Pc extends Gt{constructor(t){super(f.MILLISECOND,t)}}class $c extends Gt{constructor(t){super(f.MICROSECOND,t)}}class Wc extends Gt{constructor(t){super(f.NANOSECOND,t)}}class Ae extends y{constructor(t){super(),this.unit=t}get typeId(){return u.Interval}toString(){return`Interval<${pt[this.unit]}>`}}Gs=Symbol.toStringTag;Ae[Gs]=(i=>(i.unit=null,i.ArrayType=Int32Array,i[Symbol.toStringTag]="Interval"))(Ae.prototype);class Yc extends Ae{constructor(){super(pt.DAY_TIME)}}class Jc extends Ae{constructor(){super(pt.YEAR_MONTH)}}let Zt=class extends y{constructor(t){super(),this.unit=t}get typeId(){return u.Duration}toString(){return`Duration<${f[this.unit]}>`}};Zs=Symbol.toStringTag;Zt[Zs]=(i=>(i.unit=null,i.ArrayType=BigInt64Array,i[Symbol.toStringTag]="Duration"))(Zt.prototype);class Hc extends Zt{constructor(){super(f.SECOND)}}class Kc extends Zt{constructor(){super(f.MILLISECOND)}}class qc extends Zt{constructor(){super(f.MICROSECOND)}}class Gc extends Zt{constructor(){super(f.NANOSECOND)}}let De=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}};Qs=Symbol.toStringTag;De[Qs]=(i=>(i.children=null,i[Symbol.toStringTag]="List"))(De.prototype);class q 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(", ")}}>`}}Xs=Symbol.toStringTag;q[Xs]=(i=>(i.children=null,i[Symbol.toStringTag]="Struct"))(q.prototype);class he extends y{constructor(t,e,n){super(),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((r,s,o)=>(r[s]=o)&&r||r,Object.create(null))}get typeId(){return u.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}to=Symbol.toStringTag;he[to]=(i=>(i.mode=null,i.typeIds=null,i.children=null,i.typeIdToChildIndex=null,i.ArrayType=Int8Array,i[Symbol.toStringTag]="Union"))(he.prototype);class Zc extends he{constructor(t,e){super($.Dense,t,e)}}class Qc extends he{constructor(t,e){super($.Sparse,t,e)}}let di=class extends y{constructor(t){super(),this.byteWidth=t}get typeId(){return u.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};eo=Symbol.toStringTag;di[eo]=(i=>(i.byteWidth=null,i.ArrayType=Uint8Array,i[Symbol.toStringTag]="FixedSizeBinary"))(di.prototype);let Ze=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}>`}};io=Symbol.toStringTag;Ze[io]=(i=>(i.children=null,i.listSize=null,i[Symbol.toStringTag]="FixedSizeList"))(Ze.prototype);class Qe extends y{constructor(t,e=!1){var n,r,s;if(super(),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t?.type)===null||n===void 0)&&n.children)){const o=(r=t?.type)===null||r===void 0?void 0:r.children[0];o&&(o.name="key");const a=(s=t?.type)===null||s===void 0?void 0:s.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(", ")}}>`}}no=Symbol.toStringTag;Qe[no]=(i=>(i.children=null,i.keysSorted=null,i[Symbol.toStringTag]="Map_"))(Qe.prototype);const Xc=(i=>()=>++i)(-1);class Qt extends y{constructor(t,e,n,r){super(),this.indices=e,this.dictionary=t,this.isOrdered=r||!1,this.id=n==null?Xc():Bt(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}>`}}ro=Symbol.toStringTag;Qt[ro]=(i=>(i.id=null,i.indices=null,i.isOrdered=null,i.dictionary=null,i[Symbol.toStringTag]="Dictionary"))(Qt.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 F{visitMany(t,...e){return t.map((n,r)=>this.visit(n,...e.map(s=>s[r])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return tl(this,t,e)}getVisitFnByTypeId(t,e=!0){return Ve(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 tl(i,t,e=!0){return typeof t=="number"?Ve(i,t,e):typeof t=="string"&&t in u?Ve(i,u[t],e):t&&t instanceof y?Ve(i,as(t),e):t?.type&&t.type instanceof y?Ve(i,as(t.type),e):Ve(i,u.NONE,e)}function Ve(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 H.HALF:return u.Float16;case H.SINGLE:return u.Float32;case H.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 st.DAY:return u.DateDay;case st.MILLISECOND:return u.DateMillisecond}return u.Date;case u.Interval:switch(i.unit){case pt.DAY_TIME:return u.IntervalDayTime;case pt.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 $.Dense:return u.DenseUnion;case $.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]}'`)}F.prototype.visitInt8=null;F.prototype.visitInt16=null;F.prototype.visitInt32=null;F.prototype.visitInt64=null;F.prototype.visitUint8=null;F.prototype.visitUint16=null;F.prototype.visitUint32=null;F.prototype.visitUint64=null;F.prototype.visitFloat16=null;F.prototype.visitFloat32=null;F.prototype.visitFloat64=null;F.prototype.visitDateDay=null;F.prototype.visitDateMillisecond=null;F.prototype.visitTimestampSecond=null;F.prototype.visitTimestampMillisecond=null;F.prototype.visitTimestampMicrosecond=null;F.prototype.visitTimestampNanosecond=null;F.prototype.visitTimeSecond=null;F.prototype.visitTimeMillisecond=null;F.prototype.visitTimeMicrosecond=null;F.prototype.visitTimeNanosecond=null;F.prototype.visitDenseUnion=null;F.prototype.visitSparseUnion=null;F.prototype.visitIntervalDayTime=null;F.prototype.visitIntervalYearMonth=null;F.prototype.visitDuration=null;F.prototype.visitDurationSecond=null;F.prototype.visitDurationMillisecond=null;F.prototype.visitDurationMicrosecond=null;F.prototype.visitDurationNanosecond=null;const ao=new Float64Array(1),xe=new Uint32Array(ao.buffer);function qn(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 Gn(i){if(i!==i)return 32256;ao[0]=i;const t=(xe[1]&2147483648)>>16&65535;let e=xe[1]&2146435072,n=0;return e>=1089470464?xe[0]>0?e=31744:(e=(e&2080374784)>>16,n=(xe[1]&1048575)>>10):e<=1056964608?(n=1048576+(xe[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(xe[1]&1048575)+512>>10),t|e|n&65535}const el=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:Gn,uint16ToFloat64:qn},Symbol.toStringTag,{value:"Module"}));class I extends F{}function A(i){return(t,e,n)=>{if(t.setValid(e,n!=null))return i(t,e,n)}}const il=(i,t,e)=>{i[t]=Math.trunc(e/864e5)},Zn=(i,t,e)=>{i[t]=Math.trunc(e%4294967296),i[t+1]=Math.trunc(e/4294967296)},nl=(i,t,e)=>{i[t]=Math.trunc(e*1e3%4294967296),i[t+1]=Math.trunc(e*1e3/4294967296)},rl=(i,t,e)=>{i[t]=Math.trunc(e*1e6%4294967296),i[t+1]=Math.trunc(e*1e6/4294967296)},co=(i,t,e,n)=>{if(e+1<t.length){const{[e]:r,[e+1]:s}=t;i.set(n.subarray(0,s-r),r)}},sl=({offset:i,values:t},e,n)=>{const r=i+e;n?t[r>>3]|=1<<r%8:t[r>>3]&=~(1<<r%8)},Xt=({values:i},t,e)=>{i[t]=e},Qn=({values:i},t,e)=>{i[t]=e},lo=({values:i},t,e)=>{i[t]=Gn(e)},ol=(i,t,e)=>{switch(i.type.precision){case H.HALF:return lo(i,t,e);case H.SINGLE:case H.DOUBLE:return Qn(i,t,e)}},Xn=({values:i},t,e)=>{il(i,t,e.valueOf())},tr=({values:i},t,e)=>{Zn(i,t*2,e.valueOf())},uo=({stride:i,values:t},e,n)=>{t.set(n.subarray(0,i),i*e)},al=({values:i,valueOffsets:t},e,n)=>co(i,t,e,n),cl=({values:i,valueOffsets:t},e,n)=>{co(i,t,e,on(n))},ho=(i,t,e)=>{i.type.unit===st.DAY?Xn(i,t,e):tr(i,t,e)},er=({values:i},t,e)=>Zn(i,t*2,e/1e3),ir=({values:i},t,e)=>Zn(i,t*2,e),nr=({values:i},t,e)=>nl(i,t*2,e),rr=({values:i},t,e)=>rl(i,t*2,e),fo=(i,t,e)=>{switch(i.type.unit){case f.SECOND:return er(i,t,e);case f.MILLISECOND:return ir(i,t,e);case f.MICROSECOND:return nr(i,t,e);case f.NANOSECOND:return rr(i,t,e)}},sr=({values:i},t,e)=>{i[t]=e},or=({values:i},t,e)=>{i[t]=e},ar=({values:i},t,e)=>{i[t]=e},cr=({values:i},t,e)=>{i[t]=e},yo=(i,t,e)=>{switch(i.type.unit){case f.SECOND:return sr(i,t,e);case f.MILLISECOND:return or(i,t,e);case f.MICROSECOND:return ar(i,t,e);case f.NANOSECOND:return cr(i,t,e)}},po=({values:i,stride:t},e,n)=>{i.set(n.subarray(0,t),t*e)},ll=(i,t,e)=>{const n=i.children[0],r=i.valueOffsets,s=gt.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=r[t],c=r[t+1];a<c;)s(n,a++,e[++o]);else for(let o=-1,a=r[t],c=r[t+1];a<c;)s(n,a++,e.get(++o))},ul=(i,t,e)=>{const n=i.children[0],{valueOffsets:r}=i,s=gt.getVisitFn(n);let{[t]:o,[t+1]:a}=r;const c=e instanceof Map?e.entries():Object.entries(e);for(const l of c)if(s(n,o,l),++o>=a)break},hl=(i,t)=>(e,n,r,s)=>n&&e(n,i,t[s]),dl=(i,t)=>(e,n,r,s)=>n&&e(n,i,t.get(s)),fl=(i,t)=>(e,n,r,s)=>n&&e(n,i,t.get(r.name)),yl=(i,t)=>(e,n,r,s)=>n&&e(n,i,t[r.name]),pl=(i,t,e)=>{const n=i.type.children.map(s=>gt.getVisitFn(s.type)),r=e instanceof Map?fl(t,e):e instanceof g?dl(t,e):Array.isArray(e)?hl(t,e):yl(t,e);i.type.children.forEach((s,o)=>r(n[o],i.children[o],s,o))},gl=(i,t,e)=>{i.type.mode===$.Dense?go(i,t,e):mo(i,t,e)},go=(i,t,e)=>{const n=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[n];gt.visit(r,i.valueOffsets[t],e)},mo=(i,t,e)=>{const n=i.type.typeIdToChildIndex[i.typeIds[t]],r=i.children[n];gt.visit(r,t,e)},ml=(i,t,e)=>{var n;(n=i.dictionary)===null||n===void 0||n.set(i.values[t],e)},bo=(i,t,e)=>{i.type.unit===pt.DAY_TIME?lr(i,t,e):ur(i,t,e)},lr=({values:i},t,e)=>{i.set(e.subarray(0,2),2*t)},ur=({values:i},t,e)=>{i[t]=e[0]*12+e[1]%12},hr=({values:i},t,e)=>{i[t]=e},dr=({values:i},t,e)=>{i[t]=e},fr=({values:i},t,e)=>{i[t]=e},yr=({values:i},t,e)=>{i[t]=e},_o=(i,t,e)=>{switch(i.type.unit){case f.SECOND:return hr(i,t,e);case f.MILLISECOND:return dr(i,t,e);case f.MICROSECOND:return fr(i,t,e);case f.NANOSECOND:return yr(i,t,e)}},bl=(i,t,e)=>{const{stride:n}=i,r=i.children[0],s=gt.getVisitFn(r);if(Array.isArray(e))for(let o=-1,a=t*n;++o<n;)s(r,a+o,e[o]);else for(let o=-1,a=t*n;++o<n;)s(r,a+o,e.get(o))};I.prototype.visitBool=A(sl);I.prototype.visitInt=A(Xt);I.prototype.visitInt8=A(Xt);I.prototype.visitInt16=A(Xt);I.prototype.visitInt32=A(Xt);I.prototype.visitInt64=A(Xt);I.prototype.visitUint8=A(Xt);I.prototype.visitUint16=A(Xt);I.prototype.visitUint32=A(Xt);I.prototype.visitUint64=A(Xt);I.prototype.visitFloat=A(ol);I.prototype.visitFloat16=A(lo);I.prototype.visitFloat32=A(Qn);I.prototype.visitFloat64=A(Qn);I.prototype.visitUtf8=A(cl);I.prototype.visitBinary=A(al);I.prototype.visitFixedSizeBinary=A(uo);I.prototype.visitDate=A(ho);I.prototype.visitDateDay=A(Xn);I.prototype.visitDateMillisecond=A(tr);I.prototype.visitTimestamp=A(fo);I.prototype.visitTimestampSecond=A(er);I.prototype.visitTimestampMillisecond=A(ir);I.prototype.visitTimestampMicrosecond=A(nr);I.prototype.visitTimestampNanosecond=A(rr);I.prototype.visitTime=A(yo);I.prototype.visitTimeSecond=A(sr);I.prototype.visitTimeMillisecond=A(or);I.prototype.visitTimeMicrosecond=A(ar);I.prototype.visitTimeNanosecond=A(cr);I.prototype.visitDecimal=A(po);I.prototype.visitList=A(ll);I.prototype.visitStruct=A(pl);I.prototype.visitUnion=A(gl);I.prototype.visitDenseUnion=A(go);I.prototype.visitSparseUnion=A(mo);I.prototype.visitDictionary=A(ml);I.prototype.visitInterval=A(bo);I.prototype.visitIntervalDayTime=A(lr);I.prototype.visitIntervalYearMonth=A(ur);I.prototype.visitDuration=A(_o);I.prototype.visitDurationSecond=A(hr);I.prototype.visitDurationMillisecond=A(dr);I.prototype.visitDurationMicrosecond=A(fr);I.prototype.visitDurationNanosecond=A(yr);I.prototype.visitFixedSizeList=A(bl);I.prototype.visitMap=A(ul);const gt=new I,_t=Symbol.for("parent"),We=Symbol.for("rowIndex");class un{constructor(t,e){return this[_t]=t,this[We]=e,new Proxy(this,new vl)}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[We],e=this[_t],n=e.type.children,r={};for(let s=-1,o=n.length;++s<o;)r[n[s].name]=ot.visit(e.children[s],t);return r}toString(){return`{${[...this].map(([t,e])=>`${le(t)}: ${le(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new _l(this[_t],this[We])}}class _l{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,ot.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}}Object.defineProperties(un.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[_t]:{writable:!0,enumerable:!1,configurable:!1,value:null},[We]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});class vl{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[_t].type.children.map(e=>e.name)}has(t,e){return t[_t].type.children.findIndex(n=>n.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[_t].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[_t].type.children.findIndex(r=>r.name===e);if(n!==-1){const r=ot.visit(t[_t].children[n],t[We]);return Reflect.set(t,e,r),r}}set(t,e,n){const r=t[_t].type.children.findIndex(s=>s.name===e);return r!==-1?(gt.visit(t[_t].children[r],t[We],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}}class b extends F{}function S(i){return(t,e)=>t.getValid(e)?i(t,e):null}const wl=(i,t)=>864e5*i[t],pr=(i,t)=>4294967296*i[t+1]+(i[t]>>>0),Il=(i,t)=>4294967296*(i[t+1]/1e3)+(i[t]>>>0)/1e3,Sl=(i,t)=>4294967296*(i[t+1]/1e6)+(i[t]>>>0)/1e6,vo=i=>new Date(i),Bl=(i,t)=>vo(wl(i,t)),Al=(i,t)=>vo(pr(i,t)),Dl=(i,t)=>null,wo=(i,t,e)=>{if(e+1>=t.length)return null;const n=t[e],r=t[e+1];return i.subarray(n,r)},Ol=({offset:i,values:t},e)=>{const n=i+e;return(t[n>>3]&1<<n%8)!==0},Io=({values:i},t)=>Bl(i,t),So=({values:i},t)=>Al(i,t*2),pe=({stride:i,values:t},e)=>t[i*e],Fl=({stride:i,values:t},e)=>qn(t[i*e]),Bo=({values:i},t)=>i[t],Ml=({stride:i,values:t},e)=>t.subarray(i*e,i*(e+1)),Tl=({values:i,valueOffsets:t},e)=>wo(i,t,e),Nl=({values:i,valueOffsets:t},e)=>{const n=wo(i,t,e);return n!==null?Mn(n):null},Ll=({values:i},t)=>i[t],Ul=({type:i,values:t},e)=>i.precision!==H.HALF?t[e]:qn(t[e]),xl=(i,t)=>i.type.unit===st.DAY?Io(i,t):So(i,t),Ao=({values:i},t)=>1e3*pr(i,t*2),Do=({values:i},t)=>pr(i,t*2),Oo=({values:i},t)=>Il(i,t*2),Fo=({values:i},t)=>Sl(i,t*2),Cl=(i,t)=>{switch(i.type.unit){case f.SECOND:return Ao(i,t);case f.MILLISECOND:return Do(i,t);case f.MICROSECOND:return Oo(i,t);case f.NANOSECOND:return Fo(i,t)}},Mo=({values:i},t)=>i[t],To=({values:i},t)=>i[t],No=({values:i},t)=>i[t],Lo=({values:i},t)=>i[t],El=(i,t)=>{switch(i.type.unit){case f.SECOND:return Mo(i,t);case f.MILLISECOND:return To(i,t);case f.MICROSECOND:return No(i,t);case f.NANOSECOND:return Lo(i,t)}},Vl=({values:i,stride:t},e)=>vi.decimal(i.subarray(t*e,t*(e+1))),Rl=(i,t)=>{const{valueOffsets:e,stride:n,children:r}=i,{[t*n]:s,[t*n+1]:o}=e,c=r[0].slice(s,o-s);return new g([c])},zl=(i,t)=>{const{valueOffsets:e,children:n}=i,{[t]:r,[t+1]:s}=e,o=n[0];return new wi(o.slice(r,s-r))},jl=(i,t)=>new un(i,t),kl=(i,t)=>i.type.mode===$.Dense?Uo(i,t):xo(i,t),Uo=(i,t)=>{const e=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[e];return ot.visit(n,i.valueOffsets[t])},xo=(i,t)=>{const e=i.type.typeIdToChildIndex[i.typeIds[t]],n=i.children[e];return ot.visit(n,t)},Pl=(i,t)=>{var e;return(e=i.dictionary)===null||e===void 0?void 0:e.get(i.values[t])},$l=(i,t)=>i.type.unit===pt.DAY_TIME?Co(i,t):Eo(i,t),Co=({values:i},t)=>i.subarray(2*t,2*(t+1)),Eo=({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},Vo=({values:i},t)=>i[t],Ro=({values:i},t)=>i[t],zo=({values:i},t)=>i[t],jo=({values:i},t)=>i[t],Wl=(i,t)=>{switch(i.type.unit){case f.SECOND:return Vo(i,t);case f.MILLISECOND:return Ro(i,t);case f.MICROSECOND:return zo(i,t);case f.NANOSECOND:return jo(i,t)}},Yl=(i,t)=>{const{stride:e,children:n}=i,s=n[0].slice(t*e,e);return new g([s])};b.prototype.visitNull=S(Dl);b.prototype.visitBool=S(Ol);b.prototype.visitInt=S(Ll);b.prototype.visitInt8=S(pe);b.prototype.visitInt16=S(pe);b.prototype.visitInt32=S(pe);b.prototype.visitInt64=S(Bo);b.prototype.visitUint8=S(pe);b.prototype.visitUint16=S(pe);b.prototype.visitUint32=S(pe);b.prototype.visitUint64=S(Bo);b.prototype.visitFloat=S(Ul);b.prototype.visitFloat16=S(Fl);b.prototype.visitFloat32=S(pe);b.prototype.visitFloat64=S(pe);b.prototype.visitUtf8=S(Nl);b.prototype.visitBinary=S(Tl);b.prototype.visitFixedSizeBinary=S(Ml);b.prototype.visitDate=S(xl);b.prototype.visitDateDay=S(Io);b.prototype.visitDateMillisecond=S(So);b.prototype.visitTimestamp=S(Cl);b.prototype.visitTimestampSecond=S(Ao);b.prototype.visitTimestampMillisecond=S(Do);b.prototype.visitTimestampMicrosecond=S(Oo);b.prototype.visitTimestampNanosecond=S(Fo);b.prototype.visitTime=S(El);b.prototype.visitTimeSecond=S(Mo);b.prototype.visitTimeMillisecond=S(To);b.prototype.visitTimeMicrosecond=S(No);b.prototype.visitTimeNanosecond=S(Lo);b.prototype.visitDecimal=S(Vl);b.prototype.visitList=S(Rl);b.prototype.visitStruct=S(jl);b.prototype.visitUnion=S(kl);b.prototype.visitDenseUnion=S(Uo);b.prototype.visitSparseUnion=S(xo);b.prototype.visitDictionary=S(Pl);b.prototype.visitInterval=S($l);b.prototype.visitIntervalDayTime=S(Co);b.prototype.visitIntervalYearMonth=S(Eo);b.prototype.visitDuration=S(Wl);b.prototype.visitDurationSecond=S(Vo);b.prototype.visitDurationMillisecond=S(Ro);b.prototype.visitDurationMicrosecond=S(zo);b.prototype.visitDurationNanosecond=S(jo);b.prototype.visitFixedSizeList=S(Yl);b.prototype.visitMap=S(zl);const ot=new b,vt=Symbol.for("keys"),Ye=Symbol.for("vals");class wi{constructor(t){return this[vt]=new g([t.children[0]]).memoize(),this[Ye]=t.children[1],new Proxy(this,new Hl)}[Symbol.iterator](){return new Jl(this[vt],this[Ye])}get size(){return this[vt].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[vt],e=this[Ye],n={};for(let r=-1,s=t.length;++r<s;)n[t.get(r)]=ot.visit(e,r);return n}toString(){return`{${[...this].map(([t,e])=>`${le(t)}: ${le(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class Jl{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),ot.visit(this.vals,t)]})}}class Hl{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[vt].toArray().map(String)}has(t,e){return t[vt].includes(e)}getOwnPropertyDescriptor(t,e){if(t[vt].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[vt].indexOf(e);if(n!==-1){const r=ot.visit(Reflect.get(t,Ye),n);return Reflect.set(t,e,r),r}}set(t,e,n){const r=t[vt].indexOf(e);return r!==-1?(gt.visit(Reflect.get(t,Ye),r,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}}Object.defineProperties(wi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[vt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ye]:{writable:!0,enumerable:!1,configurable:!1,value:null}});function Kl(i,t,e){const n=i.length,r=t>-1?t:n+t%n;return e?e(i,r):r}let cs;function gr(i,t,e,n){const{length:r=0}=i;let s=typeof t!="number"?0:t,o=typeof e!="number"?r:e;return s<0&&(s=(s%r+r)%r),o<0&&(o=(o%r+r)%r),o<s&&(cs=s,s=o,o=cs),o>r&&(o=r),n?n(i,s,o):[s,o]}const ls=i=>i!==i;function Me(i){if(typeof i!=="object"||i===null)return ls(i)?ls: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?Cs(i,e):!1:i instanceof Map?Gl(i):Array.isArray(i)?ql(i):i instanceof g?Zl(i):Ql(i,!0)}function ql(i){const t=[];for(let e=-1,n=i.length;++e<n;)t[e]=Me(i[e]);return hn(t)}function Gl(i){let t=-1;const e=[];for(const n of i.values())e[++t]=Me(n);return hn(e)}function Zl(i){const t=[];for(let e=-1,n=i.length;++e<n;)t[e]=Me(i.get(e));return hn(t)}function Ql(i,t=!1){const e=Object.keys(i);if(!t&&e.length===0)return()=>!1;const n=[];for(let r=-1,s=e.length;++r<s;)n[r]=Me(i[e[r]]);return hn(n,e)}function hn(i,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return Xl(i,e);case Map:return us(i,e,e.keys());case wi:case un:case Object:case void 0:return us(i,e,t||Object.keys(e))}return e instanceof g?tu(i,e):!1}}function Xl(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 tu(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 us(i,t,e){const n=e[Symbol.iterator](),r=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),s=t instanceof Map?t.values():Object.values(t)[Symbol.iterator]();let o=0;const a=i.length;let c=s.next(),l=n.next(),h=r.next();for(;o<a&&!l.done&&!h.done&&!c.done&&!(l.value!==h.value||!i[o](c.value));++o,l=n.next(),h=r.next(),c=s.next());return o===a&&l.done&&h.done&&c.done?!0:(n.return&&n.return(),r.return&&r.return(),s.return&&s.return(),!1)}const eu=Object.freeze(Object.defineProperty({__proto__:null,clampIndex:Kl,clampRange:gr,createElementComparator:Me},Symbol.toStringTag,{value:"Module"}));function dn(i,t,e,n){return(e&1<<n)!==0}function mr(i,t,e,n){return(e&1<<n)>>n}function iu(i,t,e){return e?!!(i[t>>3]|=1<<t%8)||!0:!(i[t>>3]&=~(1<<t%8))&&!1}function fi(i,t,e){const n=e.byteLength+7&-8;if(i>0||e.byteLength<n){const r=new Uint8Array(n);return r.set(i%8===0?e.subarray(i>>3):yi(new Xe(e,i,t,null,dn)).subarray(0,n)),r}return e}function yi(i){const t=[];let e=0,n=0,r=0;for(const o of i)o&&(r|=1<<n),++n===8&&(t[e++]=r,r=n=0);(e===0||n>0)&&(t[e++]=r);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class Xe{constructor(t,e,n,r,s){this.bytes=t,this.length=n,this.context=r,this.get=s,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 Yi(i,t,e){if(e-t<=0)return 0;if(e-t<8){let s=0;for(const o of new Xe(i,t,e-t,i,mr))s+=o;return s}const n=e>>3<<3,r=t+(t%8===0?0:8-t%8);return Yi(i,t,r)+Yi(i,n,e)+ko(i,r>>3,n-r>>3)}function ko(i,t,e){let n=0,r=Math.trunc(t);const s=new DataView(i.buffer,i.byteOffset,i.byteLength),o=e===void 0?i.byteLength:r+e;for(;o-r>=4;)n+=Ri(s.getUint32(r)),r+=4;for(;o-r>=2;)n+=Ri(s.getUint16(r)),r+=2;for(;o-r>=1;)n+=Ri(s.getUint8(r)),r+=1;return n}function Ri(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 nu=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:Xe,getBit:mr,getBool:dn,packBools:yi,popcnt_array:ko,popcnt_bit_range:Yi,popcnt_uint32:Ri,setBool:iu,truncateBitmap:fi},Symbol.toStringTag,{value:"Module"})),ru=-1;class E{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:r,typeIds:s}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),r&&(t+=r.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(y.isUnion(this.type))return this.children.reduce((n,r)=>n+r.nullCount,0);let t=this._nullCount,e;return t<=ru&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-Yi(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,r,s,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(r||0,-1));let c;s instanceof E?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=Mt(t),s&&((c=s[0])&&(this.valueOffsets=c),(c=s[1])&&(this.values=c),(c=s[2])&&(this.nullBitmap=c),(c=s[3])&&(this.typeIds=c)))}getValid(t){const{type:e}=this;if(y.isUnion(e)){const n=e,r=this.children[n.typeIdToChildIndex[this.typeIds[t]]],s=n.mode===$.Dense?this.valueOffsets[t]:t;return r.getValid(s)}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:r}=this;if(y.isUnion(r)){const s=r,o=this.children[s.typeIdToChildIndex[this.typeIds[t]]],a=s.mode===$.Dense?this.valueOffsets[t]:t;n=o.getValid(a),o.setValid(a,e)}else{let{nullBitmap:s}=this;const{offset:o,length:a}=this,c=o+t,l=1<<c%8,h=c>>3;(!s||s.byteLength<=h)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0&&s.set(fi(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s,_nullCount:-1}));const d=s[h];n=(d&l)!==0,e?s[h]=d|l:s[h]=d&~l}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,r=this._nullCount,s=this,o=this.children){return new E(t,e,n,r,s,o,this.dictionary)}slice(t,e){const{stride:n,typeId:r,children:s}=this,o=+(this._nullCount===0)-1,a=r===16?n:1,c=this._sliceBuffers(t,e,n,r);return this.clone(this.type,this.offset+t,e,o,c,s.length===0||this.valueOffsets?s:this._sliceChildren(s,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,r=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);r[e>>3]=(1<<e-(e&-8))-1,n>0&&r.set(fi(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[bt.VALIDITY]=r,this.clone(this.type,0,t,n+(t-e),s)}_sliceBuffers(t,e,n,r){let s;const{buffers:o}=this;return(s=o[bt.TYPE])&&(o[bt.TYPE]=s.subarray(t,t+e)),(s=o[bt.OFFSET])&&(o[bt.OFFSET]=s.subarray(t,t+e+1))||(s=o[bt.DATA])&&(o[bt.DATA]=r===6?s:s.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(r=>r.slice(e,n))}}E.prototype.children=Object.freeze([]);class ai extends F{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:n=0,["length"]:r=0}=t;return new E(e,n,r,r)}visitBool(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.nullBitmap),s=N(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new E(e,n,o,a,[void 0,s,r])}visitInt(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.nullBitmap),s=N(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new E(e,n,o,a,[void 0,s,r])}visitFloat(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.nullBitmap),s=N(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new E(e,n,o,a,[void 0,s,r])}visitUtf8(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.data),s=L(t.nullBitmap),o=Ee(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new E(e,n,a,c,[o,r,s])}visitBinary(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.data),s=L(t.nullBitmap),o=Ee(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new E(e,n,a,c,[o,r,s])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.nullBitmap),s=N(e.ArrayType,t.data),{["length"]:o=s.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new E(e,n,o,a,[void 0,s,r])}visitDate(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.nullBitmap),s=N(e.ArrayType,t.data),{["length"]:o=s.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new E(e,n,o,a,[void 0,s,r])}visitTimestamp(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.nullBitmap),s=N(e.ArrayType,t.data),{["length"]:o=s.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new E(e,n,o,a,[void 0,s,r])}visitTime(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.nullBitmap),s=N(e.ArrayType,t.data),{["length"]:o=s.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new E(e,n,o,a,[void 0,s,r])}visitDecimal(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.nullBitmap),s=N(e.ArrayType,t.data),{["length"]:o=s.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new E(e,n,o,a,[void 0,s,r])}visitList(t){const{["type"]:e,["offset"]:n=0,["child"]:r}=t,s=L(t.nullBitmap),o=Ee(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new E(e,n,a,c,[o,void 0,s],[r])}visitStruct(t){const{["type"]:e,["offset"]:n=0,["children"]:r=[]}=t,s=L(t.nullBitmap),{length:o=r.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new E(e,n,o,a,[void 0,void 0,s],r)}visitUnion(t){const{["type"]:e,["offset"]:n=0,["children"]:r=[]}=t,s=N(e.ArrayType,t.typeIds),{["length"]:o=s.length,["nullCount"]:a=-1}=t;if(y.isSparseUnion(e))return new E(e,n,o,a,[void 0,void 0,void 0,s],r);const c=Ee(t.valueOffsets);return new E(e,n,o,a,[c,void 0,void 0,s],r)}visitDictionary(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.nullBitmap),s=N(e.indices.ArrayType,t.data),{["dictionary"]:o=new g([new ai().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new E(e,n,a,c,[void 0,s,r],[],o)}visitInterval(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.nullBitmap),s=N(e.ArrayType,t.data),{["length"]:o=s.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new E(e,n,o,a,[void 0,s,r])}visitDuration(t){const{["type"]:e,["offset"]:n=0}=t,r=L(t.nullBitmap),s=N(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new E(e,n,o,a,[void 0,s,r])}visitFixedSizeList(t){const{["type"]:e,["offset"]:n=0,["child"]:r=new ai().visit({type:e.valueType})}=t,s=L(t.nullBitmap),{["length"]:o=r.length/Mt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new E(e,n,o,a,[void 0,void 0,s],[r])}visitMap(t){const{["type"]:e,["offset"]:n=0,["child"]:r=new ai().visit({type:e.childType})}=t,s=L(t.nullBitmap),o=Ee(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new E(e,n,a,c,[o,void 0,s],[r])}}const su=new ai;function m(i){return su.visit(i)}class hs{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 Po(i){return i.reduce((t,e)=>t+e.nullCount,0)}function $o(i){return i.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(i.length+1))}function Wo(i,t,e,n){const r=[];for(let s=-1,o=i.length;++s<o;){const a=i[s],c=t[s],{length:l}=a;if(c>=n)break;if(e>=c+l)continue;if(c>=e&&c+l<=n){r.push(a);continue}const h=Math.max(0,e-c),d=Math.min(n-c,l);r.push(a.slice(h,d-h))}return r.length===0&&r.push(i[0].slice(0,0)),r}function br(i,t,e,n){let r=0,s=0,o=t.length-1;do{if(r>=o-1)return e<t[o]?n(i,r,e-t[r]):null;s=r+Math.trunc((o-r)*.5),e<t[s]?o=s:r=s}while(r<o)}function _r(i,t){return i.getValid(t)}function Je(i){function t(e,n,r){return i(e[n],r)}return function(e){const n=this.data;return br(n,this._offsets,e,t)}}function Yo(i){let t;function e(n,r,s){return i(n[r],s,t)}return function(n,r){const s=this.data;t=r;const o=br(s,this._offsets,n,e);return t=void 0,o}}function Jo(i){let t;function e(n,r,s){let o=s,a=0,c=0;for(let l=r-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,r){t=n;const s=this.data,o=typeof r!="number"?e(s,0,0):br(s,this._offsets,r,e);return t=void 0,o}}class _ extends F{}function ou(i,t){return t===null&&i.length>0?0:-1}function au(i,t){const{nullBitmap:e}=i;if(!e||i.nullCount<=0)return-1;let n=0;for(const r of new Xe(e,i.offset+(t||0),i.length,e,dn)){if(!r)return n;++n}return-1}function O(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 au(i,e)}const n=ot.getVisitFn(i),r=Me(t);for(let s=(e||0)-1,o=i.length;++s<o;)if(r(n(i,s)))return s;return-1}function Ho(i,t,e){const n=ot.getVisitFn(i),r=Me(t);for(let s=(e||0)-1,o=i.length;++s<o;)if(r(n(i,s)))return s;return-1}_.prototype.visitNull=ou;_.prototype.visitBool=O;_.prototype.visitInt=O;_.prototype.visitInt8=O;_.prototype.visitInt16=O;_.prototype.visitInt32=O;_.prototype.visitInt64=O;_.prototype.visitUint8=O;_.prototype.visitUint16=O;_.prototype.visitUint32=O;_.prototype.visitUint64=O;_.prototype.visitFloat=O;_.prototype.visitFloat16=O;_.prototype.visitFloat32=O;_.prototype.visitFloat64=O;_.prototype.visitUtf8=O;_.prototype.visitBinary=O;_.prototype.visitFixedSizeBinary=O;_.prototype.visitDate=O;_.prototype.visitDateDay=O;_.prototype.visitDateMillisecond=O;_.prototype.visitTimestamp=O;_.prototype.visitTimestampSecond=O;_.prototype.visitTimestampMillisecond=O;_.prototype.visitTimestampMicrosecond=O;_.prototype.visitTimestampNanosecond=O;_.prototype.visitTime=O;_.prototype.visitTimeSecond=O;_.prototype.visitTimeMillisecond=O;_.prototype.visitTimeMicrosecond=O;_.prototype.visitTimeNanosecond=O;_.prototype.visitDecimal=O;_.prototype.visitList=O;_.prototype.visitStruct=O;_.prototype.visitUnion=O;_.prototype.visitDenseUnion=Ho;_.prototype.visitSparseUnion=Ho;_.prototype.visitDictionary=O;_.prototype.visitInterval=O;_.prototype.visitIntervalDayTime=O;_.prototype.visitIntervalYearMonth=O;_.prototype.visitDuration=O;_.prototype.visitDurationSecond=O;_.prototype.visitDurationMillisecond=O;_.prototype.visitDurationMicrosecond=O;_.prototype.visitDurationNanosecond=O;_.prototype.visitFixedSizeList=O;_.prototype.visitMap=O;const Ji=new _;class v extends F{}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 Rt&&t.bitWidth!==64||t instanceof qt&&t.precision!==H.HALF))return new hs(i.data.length,n=>{const r=i.data[n];return r.values.subarray(0,r.length)[Symbol.iterator]()});let e=0;return new hs(i.data.length,n=>{const s=i.data[n].length,o=i.slice(e,e+s);return e+=s,new cu(o)})}class cu{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}}v.prototype.visitNull=B;v.prototype.visitBool=B;v.prototype.visitInt=B;v.prototype.visitInt8=B;v.prototype.visitInt16=B;v.prototype.visitInt32=B;v.prototype.visitInt64=B;v.prototype.visitUint8=B;v.prototype.visitUint16=B;v.prototype.visitUint32=B;v.prototype.visitUint64=B;v.prototype.visitFloat=B;v.prototype.visitFloat16=B;v.prototype.visitFloat32=B;v.prototype.visitFloat64=B;v.prototype.visitUtf8=B;v.prototype.visitBinary=B;v.prototype.visitFixedSizeBinary=B;v.prototype.visitDate=B;v.prototype.visitDateDay=B;v.prototype.visitDateMillisecond=B;v.prototype.visitTimestamp=B;v.prototype.visitTimestampSecond=B;v.prototype.visitTimestampMillisecond=B;v.prototype.visitTimestampMicrosecond=B;v.prototype.visitTimestampNanosecond=B;v.prototype.visitTime=B;v.prototype.visitTimeSecond=B;v.prototype.visitTimeMillisecond=B;v.prototype.visitTimeMicrosecond=B;v.prototype.visitTimeNanosecond=B;v.prototype.visitDecimal=B;v.prototype.visitList=B;v.prototype.visitStruct=B;v.prototype.visitUnion=B;v.prototype.visitDenseUnion=B;v.prototype.visitSparseUnion=B;v.prototype.visitDictionary=B;v.prototype.visitInterval=B;v.prototype.visitIntervalDayTime=B;v.prototype.visitIntervalYearMonth=B;v.prototype.visitDuration=B;v.prototype.visitDurationSecond=B;v.prototype.visitDurationMillisecond=B;v.prototype.visitDurationMicrosecond=B;v.prototype.visitDurationNanosecond=B;v.prototype.visitFixedSizeList=B;v.prototype.visitMap=B;const vr=new v,lu=(i,t)=>i+t;class ge extends F{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,r)=>n+zt.visit(r,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((n,r)=>n+zt.visit(r,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 uu=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),hu=({valueOffsets:i},t)=>8+(i[t+1]-i[t]),du=({valueOffsets:i,stride:t,children:e},n)=>{const r=e[0],{[n*t]:s}=i,{[n*t+1]:o}=i,a=zt.getVisitFn(r.type),c=r.slice(s,o-s);let l=8;for(let h=-1,d=o-s;++h<d;)l+=a(c,h);return l},fu=({stride:i,children:t},e)=>{const n=t[0],r=n.slice(e*i,i),s=zt.getVisitFn(n.type);let o=0;for(let a=-1,c=r.length;++a<c;)o+=s(r,a);return o},yu=(i,t)=>i.type.mode===$.Dense?Ko(i,t):qo(i,t),Ko=({type:i,children:t,typeIds:e,valueOffsets:n},r)=>{const s=i.typeIdToChildIndex[e[r]];return 8+zt.visit(t[s],n[r])},qo=({children:i},t)=>4+zt.visitMany(i,i.map(()=>t)).reduce(lu,0);ge.prototype.visitUtf8=uu;ge.prototype.visitBinary=hu;ge.prototype.visitList=du;ge.prototype.visitFixedSizeList=fu;ge.prototype.visitUnion=yu;ge.prototype.visitDenseUnion=Ko;ge.prototype.visitSparseUnion=qo;const zt=new ge;var Go;const Zo={},Qo={};class g{constructor(t){var e,n,r;const s=t[0]instanceof g?t.flatMap(a=>a.data):t;if(s.length===0||s.some(a=>!(a instanceof E)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:c,indexOf:l,byteLength:h}=Zo[o.typeId],d=s[0];this.isValid=U=>_r(d,U),this.get=U=>a(d,U),this.set=(U,M)=>c(d,U,M),this.indexOf=U=>l(d,U),this.getByteLength=U=>h(d,U),this._offsets=[0,d.length];break}default:Object.setPrototypeOf(this,Qo[o.typeId]),this._offsets=$o(s);break}this.data=s,this.type=o,this.stride=Mt(o),this.numChildren=(r=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullCount(){return Po(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 vr.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(gr(this,t,e,({data:n,_offsets:r},s,o)=>Wo(n,r,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:r,ArrayType:s}=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 s;case 1:return e[0].values.subarray(0,n*r);default:return e.reduce((o,{values:a,length:c})=>(o.array.set(a.subarray(0,c*r),o.offset),o.offset+=c*r,o),{array:new s(n*r),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 Hi(this.data[0].dictionary),e=this.data.map(n=>{const r=n.clone();return r.dictionary=t,r});return new g(e)}return new Hi(this)}unmemoize(){if(y.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const r=n.clone();return r.dictionary=t,r});return new g(e)}return this}}Go=Symbol.toStringTag;g[Go]=(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=ot.getVisitFnByTypeId(e),r=gt.getVisitFnByTypeId(e),s=Ji.getVisitFnByTypeId(e),o=zt.getVisitFnByTypeId(e);Zo[e]={get:n,set:r,indexOf:s,byteLength:o},Qo[e]=Object.create(i,{isValid:{value:Je(_r)},get:{value:Je(ot.getVisitFnByTypeId(e))},set:{value:Yo(gt.getVisitFnByTypeId(e))},indexOf:{value:Jo(Ji.getVisitFnByTypeId(e))},getByteLength:{value:Je(zt.getVisitFnByTypeId(e))}})}return"Vector"})(g.prototype);class Hi extends g{constructor(t){super(t.data);const e=this.get,n=this.set,r=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const c=e.call(this,o);return s[o]=c,c}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new Hi(r.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 fn(i){if(i){if(i instanceof E)return new g([i]);if(i instanceof g)return new g(i.data);if(i.type instanceof y)return new g([m(i)]);if(Array.isArray(i))return new g(i.flatMap(t=>pu(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([m(Object.assign(Object.assign({},t),{type:new Pn}))]);if(i instanceof Int16Array)return new g([m(Object.assign(Object.assign({},t),{type:new $n}))]);if(i instanceof Int32Array)return new g([m(Object.assign(Object.assign({},t),{type:new ue}))]);if(i instanceof BigInt64Array)return new g([m(Object.assign(Object.assign({},t),{type:new cn}))]);if(i instanceof Uint8Array||i instanceof Uint8ClampedArray)return new g([m(Object.assign(Object.assign({},t),{type:new Wn}))]);if(i instanceof Uint16Array)return new g([m(Object.assign(Object.assign({},t),{type:new Yn}))]);if(i instanceof Uint32Array)return new g([m(Object.assign(Object.assign({},t),{type:new Jn}))]);if(i instanceof BigUint64Array)return new g([m(Object.assign(Object.assign({},t),{type:new Hn}))]);if(i instanceof Float32Array)return new g([m(Object.assign(Object.assign({},t),{type:new Kn}))]);if(i instanceof Float64Array)return new g([m(Object.assign(Object.assign({},t),{type:new ln}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function pu(i){return i instanceof E?[i]:i instanceof g?i.data:fn(i).data}function gu(i){if(!i||i.length<=0)return function(r){return!0};let t="";const e=i.filter(n=>n===n);return e.length>0&&(t=`
|
|
2
|
+
switch (x) {${e.map(n=>`
|
|
3
|
+
case ${mu(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 mu(i){return typeof i!="bigint"?le(i):`${le(i)}n`}const Bn=(i,t)=>(Math.ceil(i)*t+63&-64||64)/t,bu=(i,t=0)=>i.length>=t?i.subarray(0,t):ci(new i.constructor(t),i,0);class yn{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,r=this.buffer.length;n>=r&&this._resize(r===0?Bn(n*1,this.BYTES_PER_ELEMENT):Bn(n*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=Bn(t*this.stride,this.BYTES_PER_ELEMENT);const e=bu(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=ci(new this.ArrayType(t),this.buffer)}}yn.prototype.offset=0;class Ii extends yn{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 Xo extends Ii{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),r=t>>3,s=t%8,o=n[r]>>s&1;return e?o===0&&(n[r]|=1<<s,++this.numValid):o===1&&(n[r]&=~(1<<s),--this.numValid),this}clear(){return this.numValid=0,super.clear()}}class ta extends Ii{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,r=this.reserve(t-n+1).buffer;return n<t++&&r.fill(r[n],n,t),r[t]=r[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 Xo,e&&e.length>0&&(this._isValid=gu(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:r,_typeIds:s,children:o}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),r&&(t+=r.byteLength),s&&(t+=s.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,r;const{type:s,length:o,nullCount:a,_typeIds:c,_offsets:l,_values:h,_nulls:d}=this;(e=c?.flush(o))?r=l?.flush(o):(r=l?.flush(o))?t=h?.flush(l.last()):t=h?.flush(o),a>0&&(n=d?.flush(o));const U=this.children.map(M=>M.flush());return this.clear(),m({type:s,length:o,nullCount:a,children:U,child:U[0],data:t,typeIds:e,nullBitmap:n,valueOffsets:r})}finish(){this.finished=!0;for(const t of this.children)t.finish();return this}clear(){var t,e,n,r;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(),(r=this._typeIds)===null||r===void 0||r.clear();for(const s of this.children)s.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 te extends X{constructor(t){super(t),this._values=new Ii(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 pn extends X{constructor(t){super(t),this._pendingLength=0,this._offsets=new ta}setValue(t,e){const n=this._pending||(this._pending=new Map),r=n.get(t);r&&(this._pendingLength-=r.length),this._pendingLength+=e instanceof wi?e[vt].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 Ln{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,r){return t.prep(8,24),t.writeInt64(BigInt(r??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(e??0)),t.offset()}}const An=2,Tt=4,Ht=4,z=4,se=new Int32Array(2),ds=new Float32Array(se.buffer),fs=new Float64Array(se.buffer),Ci=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Un;(function(i){i[i.UTF8_BYTES=1]="UTF8_BYTES",i[i.UTF16_STRING=2]="UTF16_STRING"})(Un||(Un={}));let ti=class ea{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new ea(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 se[0]=this.readInt32(t),ds[0]}readFloat64(t){return se[Ci?0:1]=this.readInt32(t),se[Ci?1:0]=this.readInt32(t+4),fs[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){ds[0]=e,this.writeInt32(t,se[0])}writeFloat64(t,e){fs[0]=e,this.writeInt32(t,se[Ci?0:1]),this.writeInt32(t+4,se[Ci?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+Tt+Ht)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<Ht;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 r=this.bytes_.subarray(t,t+n);return e===Un.UTF8_BYTES?r:this.text_decoder_.decode(r)}__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!=Ht)throw new Error("FlatBuffers: file identifier must be length "+Ht);for(let e=0;e<Ht;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+Tt+e))return!1;return!0}createScalarList(t,e){const n=[];for(let r=0;r<e;++r){const s=t(r);s!==null&&n.push(s)}return n}createObjList(t,e){const n=[];for(let r=0;r<e;++r){const s=t(r);s!==null&&n.push(s.unpack())}return n}},ia=class na{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=ti.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 r=this.bb.capacity();this.bb=na.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}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,r=ti.allocate(n);return r.setPosition(n-e),r.bytes().set(t.bytes(),n-e),r}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 r=2;this.addInt16(t-this.object_start);const s=(n+r)*An;this.addInt16(s);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(s==this.bb.readInt16(c)){for(let l=An;l<s;l+=An)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 r=n?z:0;if(e){const s=e;if(this.prep(this.minalign,Tt+Ht+r),s.length!=Ht)throw new TypeError("FlatBuffers: file identifier must be length "+Ht);for(let o=Ht-1;o>=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,Tt+r),this.addOffset(t),r&&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,r=n-this.bb.readInt32(n);if(!(e<this.bb.readInt16(r)&&this.bb.readInt16(r+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,r=this.space,s=this.bb.bytes();n<e.length;n++)s[r++]=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 r=t[n];if(r!==null)e.push(this.createObjectOffset(r));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 Y{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 Y).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+z),(e||new Y).__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 Y.startKeyValue(t),Y.addKey(t,e),Y.addValue(t,n),Y.endKeyValue(t)}}var ei;(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"})(ei||(ei={}));var ii;(function(i){i[i.Little=0]="Little",i[i.Big=1]="Big"})(ii||(ii={}));var Ki;(function(i){i[i.DenseArray=0]="DenseArray"})(Ki||(Ki={}));class lt{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 lt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+z),(e||new lt).__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 lt.startInt(t),lt.addBitWidth(t,e),lt.addIsSigned(t,n),lt.endInt(t)}}class Kt{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 Kt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+z),(e||new Kt).__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 lt).__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):Ki.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,Ki.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}class be{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 be).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+z),(e||new be).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return be.startBinary(t),be.endBinary(t)}}class _e{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 _e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+z),(e||new _e).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return _e.startBool(t),_e.endBool(t)}}var qi;(function(i){i[i.DAY=0]="DAY",i[i.MILLISECOND=1]="MILLISECOND"})(qi||(qi={}));let zi=class Re{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 Re).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+z),(e||new Re).__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):qi.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,qi.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return Re.startDate(t),Re.addUnit(t,e),Re.endDate(t)}};class it{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 it).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+z),(e||new it).__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,r){return it.startDecimal(t),it.addPrecision(t,e),it.addScale(t,n),it.addBitWidth(t,r),it.endDecimal(t)}}var de;(function(i){i[i.SECOND=0]="SECOND",i[i.MILLISECOND=1]="MILLISECOND",i[i.MICROSECOND=2]="MICROSECOND",i[i.NANOSECOND=3]="NANOSECOND"})(de||(de={}));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()+z),(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):de.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,de.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()+z),(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()+z),(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 Gi;(function(i){i[i.HALF=0]="HALF",i[i.SINGLE=1]="SINGLE",i[i.DOUBLE=2]="DOUBLE"})(Gi||(Gi={}));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()+z),(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):Gi.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,Gi.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return xt.startFloatingPoint(t),xt.addPrecision(t,e),xt.endFloatingPoint(t)}}var Zi;(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"})(Zi||(Zi={}));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()+z),(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):Zi.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Zi.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return Ct.startInterval(t),Ct.addUnit(t,e),Ct.endInterval(t)}}class ve{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 ve).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+z),(e||new ve).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return ve.startList(t),ve.endList(t)}}let ji=class ze{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 ze).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+z),(e||new ze).__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 ze.startMap(t),ze.addKeysSorted(t,e),ze.endMap(t)}};class we{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 we).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+z),(e||new we).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return we.startNull(t),we.endNull(t)}}class Ie{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 Ie).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+z),(e||new Ie).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return Ie.startStruct_(t),Ie.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()+z),(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):de.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,de.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()+z),(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):de.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,de.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 Qi;(function(i){i[i.Sparse=0]="Sparse",i[i.Dense=1]="Dense"})(Qi||(Qi={}));class nt{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 nt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+z),(e||new nt).__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):Qi.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,Qi.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 nt.startUnion(t),nt.addMode(t,e),nt.addTypeIds(t,n),nt.endUnion(t)}}class Se{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 Se).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+z),(e||new Se).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return Se.startUtf8(t),Se.endUtf8(t)}}var T;(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"})(T||(T={}));let ht=class ki{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 ki).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+z),(e||new ki).__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):T.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 Kt).__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 ki).__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 Y).__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,T.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()}},Ft=class Yt{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 Yt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+z),(e||new Yt).__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):ii.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 Y).__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,ii.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,r,s){return Yt.startSchema(t),Yt.addEndianness(t,e),Yt.addFields(t,n),Yt.addCustomMetadata(t,r),Yt.addFeatures(t,s),Yt.endSchema(t)}};class at{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 at).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+z),(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):ei.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new Ft).__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 Ln).__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 Ln).__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 Y).__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,ei.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 C{constructor(t=[],e,n,r=K.V5){this.fields=t||[],this.metadata=e||new Map,n||(n=xn(t)),this.dictionaries=n,this.metadataVersion=r}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(r=>e.has(r.name));return new C(n,this.metadata)}selectAt(t){const e=t.map(n=>this.fields[n]).filter(Boolean);return new C(e,this.metadata)}assign(...t){const e=t[0]instanceof C?t[0]:Array.isArray(t[0])?new C(t[0]):new C(t),n=[...this.fields],r=Ei(Ei(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{const c=n.findIndex(l=>l.name===a.name);return~c?(n[c]=a.clone({metadata:Ei(Ei(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),o=xn(s,new Map);return new C([...n,...s],r,new Map([...this.dictionaries,...o]))}}C.prototype.fields=null;C.prototype.metadata=null;C.prototype.dictionaries=null;class x{static new(...t){let[e,n,r,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],n===void 0&&(n=t[0].type),r===void 0&&(r=t[0].nullable),s===void 0&&(s=t[0].metadata)),new x(`${e}`,n,r,s)}constructor(t,e,n=!1,r){this.name=t,this.type=e,this.nullable=n,this.metadata=r||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,n,r,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,n=this.type,r=this.nullable,s=this.metadata]=t:{name:e=this.name,type:n=this.type,nullable:r=this.nullable,metadata:s=this.metadata}=t[0],x.new(e,n,r,s)}}x.prototype.type=null;x.prototype.name=null;x.prototype.nullable=null;x.prototype.metadata=null;function Ei(i,t){return new Map([...i||new Map,...t||new Map])}function xn(i,t=new Map){for(let e=-1,n=i.length;++e<n;){const s=i[e].type;if(y.isDictionary(s)){if(!t.has(s.id))t.set(s.id,s.dictionary);else if(t.get(s.id)!==s.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}s.children&&s.children.length>0&&xn(s.children,t)}return t}var _u=ia,vu=ti;class pi{static decode(t){t=new vu(L(t));const e=at.getRootAsFooter(t),n=C.decode(e.schema(),new Map,e.version());return new wu(n,e)}static encode(t){const e=new _u,n=C.encode(e,t.schema);at.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())jt.encode(e,o);const r=e.endVector();at.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())jt.encode(e,o);const s=e.endVector();return at.startFooter(e),at.addSchema(e,n),at.addVersion(e,K.V5),at.addRecordBatches(e,r),at.addDictionaries(e,s),at.finishFooterBuffer(e,at.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=K.V5,n,r){this.schema=t,this.version=e,n&&(this._recordBatches=n),r&&(this._dictionaryBatches=r)}*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 wu extends pi{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 jt.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){const e=this._footer.dictionaries(t);if(e)return jt.decode(e)}return null}}class jt{static decode(t){return new jt(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){const{metaDataLength:n}=e,r=BigInt(e.offset),s=BigInt(e.bodyLength);return Ln.createBlock(t,r,n,s)}constructor(t,e,n){this.metaDataLength=t,this.offset=Bt(n),this.bodyLength=Bt(e)}}const j=Object.freeze({done:!0,value:void 0});class ys{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class wr{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 Iu extends wr{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(j);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return ct.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return ct.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return p(this,void 0,void 0,function*(){return yield this.abort(t),j})}return(t){return p(this,void 0,void 0,function*(){return yield this.close(),j})}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(j)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class He extends Iu{write(t){if((t=L(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Mn(this.toUint8Array(!0)):this.toUint8Array(!1).then(Mn)}toUint8Array(t=!1){return t?St(this._values)[0]:p(this,void 0,void 0,function*(){var e,n,r,s;const o=[];let a=0;try{for(var c=!0,l=ae(this),h;h=yield l.next(),e=h.done,!e;c=!0){s=h.value,c=!1;const d=s;o.push(d),a+=d.byteLength}}catch(d){n={error:d}}finally{try{!c&&!e&&(r=l.return)&&(yield r.call(l))}finally{if(n)throw n.error}}return St(o,a)[0]})}}class gi{constructor(t){t&&(this.source=new Su(ct.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 fe{constructor(t){t instanceof fe?this.source=t.source:t instanceof He?this.source=new me(ct.fromAsyncIterable(t)):Ls(t)?this.source=new me(ct.fromNodeStream(t)):zn(t)?this.source=new me(ct.fromDOMStream(t)):Ns(t)?this.source=new me(ct.fromDOMStream(t.body)):si(t)?this.source=new me(ct.fromIterable(t)):ce(t)?this.source=new me(ct.fromAsyncIterable(t)):Fe(t)&&(this.source=new me(ct.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 Su{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)||j)}return(t){return Object.create(this.source.return&&this.source.return(t)||j)}}class me{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))||j;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))||j;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class ps extends gi{constructor(t,e){super(),this.position=0,this.buffer=L(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:r}=this;return e&&r<n?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,r+Math.min(n-r,t)),e.subarray(r,this.position)):null}readAt(t,e){const n=this.buffer,r=Math.min(this.size,t+e);return n?n.subarray(t,r):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 Xi extends fe{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:r}=this;if(e&&r<n){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let s=r,o=0,a=0;const c=Math.min(n,s+Math.min(n-s,t)),l=new Uint8Array(Math.max(0,(this.position=c)-s));for(;(s+=a)<c&&(o+=a)<l.byteLength;)({bytesRead:a}=yield e.read(l,o,l.byteLength-o,s));return l}return null})}readAt(t,e){return p(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:n,size:r}=this;if(n&&t+e<r){const s=Math.min(r,t+e),o=new Uint8Array(s-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 Bu=65536;function ke(i){return i<0&&(i=4294967295+i+1),`0x${i.toString(16)}`}const ni=8,Ir=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Sr{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 r=e[3]*n[3];this.buffer[0]=r&65535;let s=r>>>16;return r=e[2]*n[3],s+=r,r=e[3]*n[2]>>>0,s+=r,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0<r?Bu:0,this.buffer[1]+=s>>>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`${ke(this.buffer[1])} ${ke(this.buffer[0])}`}}class V extends Sr{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return V.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return V.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const n=t.length,r=new V(e);for(let s=0;s<n;){const o=ni<n-s?ni:n-s,a=new V(new Uint32Array([Number.parseInt(t.slice(s,s+o),10),0])),c=new V(new Uint32Array([Ir[o],0]));r.times(c),r.plus(a),s+=o}return r}static convertArray(t){const e=new Uint32Array(t.length*2);for(let n=-1,r=t.length;++n<r;)V.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2));return e}static multiply(t,e){return new V(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new V(new Uint32Array(t.buffer)).plus(e)}}class tt extends Sr{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 tt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return tt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const n=t.startsWith("-"),r=t.length,s=new tt(e);for(let o=n?1:0;o<r;){const a=ni<r-o?ni:r-o,c=new tt(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0])),l=new tt(new Uint32Array([Ir[a],0]));s.times(l),s.plus(c),o+=a}return n?s.negate():s}static convertArray(t){const e=new Uint32Array(t.length*2);for(let n=-1,r=t.length;++n<r;)tt.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2));return e}static multiply(t,e){return new tt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new tt(new Uint32Array(t.buffer)).plus(e)}}class mt{constructor(t){this.buffer=t}high(){return new tt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new tt(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 V(new Uint32Array([this.buffer[3],0])),n=new V(new Uint32Array([this.buffer[2],0])),r=new V(new Uint32Array([this.buffer[1],0])),s=new V(new Uint32Array([this.buffer[0],0])),o=new V(new Uint32Array([t.buffer[3],0])),a=new V(new Uint32Array([t.buffer[2],0])),c=new V(new Uint32Array([t.buffer[1],0])),l=new V(new Uint32Array([t.buffer[0],0]));let h=V.multiply(s,l);this.buffer[0]=h.low();const d=new V(new Uint32Array([h.high(),0]));return h=V.multiply(r,l),d.plus(h),h=V.multiply(s,c),d.plus(h),this.buffer[1]=d.low(),this.buffer[3]=d.lessThan(h)?1:0,this.buffer[2]=d.high(),new V(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(V.multiply(n,l)).plus(V.multiply(r,c)).plus(V.multiply(s,a)),this.buffer[3]+=V.multiply(e,l).plus(V.multiply(n,c)).plus(V.multiply(r,a)).plus(V.multiply(s,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`${ke(this.buffer[3])} ${ke(this.buffer[2])} ${ke(this.buffer[1])} ${ke(this.buffer[0])}`}static multiply(t,e){return new mt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new mt(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return mt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return mt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),r=t.length,s=new mt(e);for(let o=n?1:0;o<r;){const a=ni<r-o?ni:r-o,c=new mt(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0,0,0])),l=new mt(new Uint32Array([Ir[a],0,0,0]));s.times(l),s.plus(c),o+=a}return n?s.negate():s}static convertArray(t){const e=new Uint32Array(t.length*4);for(let n=-1,r=t.length;++n<r;)mt.from(t[n],new Uint32Array(e.buffer,e.byteOffset+4*4*n,4));return e}}const Au=Object.freeze(Object.defineProperty({__proto__:null,BaseInt64:Sr,Int128:mt,Int64:tt,Uint64:V},Symbol.toStringTag,{value:"Module"}));class ra extends F{constructor(t,e,n,r,s=K.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=n,this.dictionaries=r,this.metadataVersion=s}visit(t){return super.visit(t instanceof x?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return m({type:t,length:e})}visitBool(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({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 m({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 m({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({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 m({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<K.V5&&this.readNullBitmap(t,n),t.mode===$.Sparse?this.visitSparseUnion(t,{length:e,nullCount:n}):this.visitDenseUnion(t,{length:e,nullCount:n})}visitDenseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({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 m({type:t,length:e,nullCount:n,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({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 m({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDuration(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:n}=this.nextFieldNode()){return m({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 m({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 Du extends ra{constructor(t,e,n,r,s){super(new Uint8Array(0),e,n,r,s),this.sources=t}readNullBitmap(t,e,{offset:n}=this.nextBufferRange()){return e<=0?new Uint8Array(0):yi(this.sources[n])}readOffsets(t,{offset:e}=this.nextBufferRange()){return N(Uint8Array,N(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return N(Uint8Array,N(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===st.MILLISECOND?N(Uint8Array,tt.convertArray(n[e])):y.isDecimal(t)?N(Uint8Array,mt.convertArray(n[e])):y.isBinary(t)||y.isFixedSizeBinary(t)?Ou(n[e]):y.isBool(t)?yi(n[e]):y.isUtf8(t)?on(n[e].join("")):N(Uint8Array,N(t.ArrayType,n[e].map(r=>+r)))}}function Ou(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 Br extends pn{constructor(t){super(t),this._values=new yn(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,L(e))}_flushPending(t,e){const n=this._offsets,r=this._values.reserve(e).buffer;let s=0;for(const[o,a]of t)if(a===void 0)n.set(o,0);else{const c=a.length;r.set(a,s),n.set(o,c),s+=c}}}class sa extends X{constructor(t){super(t),this._values=new Xo}setValue(t,e){this._values.set(t,+e)}}class Si extends te{}Si.prototype._setValue=ho;class Ar extends Si{}Ar.prototype._setValue=Xn;class Dr extends Si{}Dr.prototype._setValue=tr;class Or extends te{}Or.prototype._setValue=po;class oa extends X{constructor({type:t,nullValues:e,dictionaryHashFunction:n}){super({type:new Qt(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Oe({type:this.type.indices,nullValues:e}),this.dictionary=Oe({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,r=this.valueToKey(e);let s=n[r];return s===void 0&&(n[r]=s=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,s)}flush(){const t=this.type,e=this._dictionary,n=this.dictionary.toVector(),r=this.indices.flush().clone(t);return r.dictionary=e?e.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=r.dictionary,this.clear(),r}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 Fr extends te{}Fr.prototype._setValue=uo;class aa extends X{setValue(t,e){const[n]=this.children,r=t*this.stride;for(let s=-1,o=e.length;++s<o;)n.set(r+s,e[s])}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 Ze(this.type.listSize,new x(e,t.type,!0)),n}}class Bi extends te{setValue(t,e){this._values.set(t,e)}}class ca extends Bi{setValue(t,e){super.setValue(t,Gn(e))}}class la extends Bi{}class ua extends Bi{}class Ai extends te{}Ai.prototype._setValue=bo;class Mr extends Ai{}Mr.prototype._setValue=lr;class Tr extends Ai{}Tr.prototype._setValue=ur;class Te extends te{}Te.prototype._setValue=_o;class Nr extends Te{}Nr.prototype._setValue=hr;class Lr extends Te{}Lr.prototype._setValue=dr;class Ur extends Te{}Ur.prototype._setValue=fr;class xr extends Te{}xr.prototype._setValue=yr;class Wt extends te{setValue(t,e){this._values.set(t,e)}}class ha extends Wt{}class da extends Wt{}class fa extends Wt{}class ya extends Wt{}class pa extends Wt{}class ga extends Wt{}class ma extends Wt{}class ba extends Wt{}class _a extends pn{constructor(t){super(t),this._offsets=new ta}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 De(new x(e,t.type,!0)),this.numChildren-1}_flushPending(t){const e=this._offsets,[n]=this.children;for(const[r,s]of t)if(typeof s>"u")e.set(r,0);else{const o=s,a=o.length,c=e.set(r,a).buffer[r];for(let l=-1;++l<a;)n.set(c+l,o[l])}}}class va extends pn{set(t,e){return super.set(t,e)}setValue(t,e){const n=e instanceof Map?e:new Map(Object.entries(e)),r=this._pending||(this._pending=new Map),s=r.get(t);s&&(this._pendingLength-=s.size),this._pendingLength+=n.size,r.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 Qe(new x(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){const e=this._offsets,[n]=this.children;for(const[r,s]of t)if(s===void 0)e.set(r,0);else{let{[r]:o,[r+1]:a}=e.set(r,s.size).buffer;for(const c of s.entries())if(n.set(o,c),++o>=a)break}}}class wa extends X{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}}class Ia extends X{setValue(t,e){const{children:n,type:r}=this;switch(Array.isArray(e)||e.constructor){case!0:return r.children.forEach((s,o)=>n[o].set(t,e[o]));case Map:return r.children.forEach((s,o)=>n[o].set(t,e.get(s.name)));default:return r.children.forEach((s,o)=>n[o].set(t,e[s.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 q([...this.type.children,new x(e,t.type,!0)]),n}}class Ne extends te{}Ne.prototype._setValue=fo;class Cr extends Ne{}Cr.prototype._setValue=er;class Er extends Ne{}Er.prototype._setValue=ir;class Vr extends Ne{}Vr.prototype._setValue=nr;class Rr extends Ne{}Rr.prototype._setValue=rr;class Le extends te{}Le.prototype._setValue=yo;class zr extends Le{}zr.prototype._setValue=sr;class jr extends Le{}jr.prototype._setValue=or;class kr extends Le{}kr.prototype._setValue=ar;class Pr extends Le{}Pr.prototype._setValue=cr;class gn extends X{constructor(t){super(t),this._typeIds=new Ii(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 r=this.type.typeIdToChildIndex[n],s=this.children[r];s?.set(t,e)}addChild(t,e=`${this.children.length}`){const n=this.children.push(t),{type:{children:r,mode:s,typeIds:o}}=this,a=[...r,new x(e,t.type)];return this.type=new he(s,[...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 Sa extends gn{}class Ba extends gn{constructor(t){super(t),this._offsets=new Ii(new Int32Array(0))}setValue(t,e,n){const r=this._typeIds.set(t,n).buffer[t],s=this.getChildAt(this.type.typeIdToChildIndex[r]),o=this._offsets.set(t,s.length).buffer[t];s?.set(o,e)}}class $r extends pn{constructor(t){super(t),this._values=new yn(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,on(e))}_flushPending(t,e){}}$r.prototype._flushPending=Br.prototype._flushPending;class Fu extends F{visitNull(){return wa}visitBool(){return sa}visitInt(){return Wt}visitInt8(){return ha}visitInt16(){return da}visitInt32(){return fa}visitInt64(){return ya}visitUint8(){return pa}visitUint16(){return ga}visitUint32(){return ma}visitUint64(){return ba}visitFloat(){return Bi}visitFloat16(){return ca}visitFloat32(){return la}visitFloat64(){return ua}visitUtf8(){return $r}visitBinary(){return Br}visitFixedSizeBinary(){return Fr}visitDate(){return Si}visitDateDay(){return Ar}visitDateMillisecond(){return Dr}visitTimestamp(){return Ne}visitTimestampSecond(){return Cr}visitTimestampMillisecond(){return Er}visitTimestampMicrosecond(){return Vr}visitTimestampNanosecond(){return Rr}visitTime(){return Le}visitTimeSecond(){return zr}visitTimeMillisecond(){return jr}visitTimeMicrosecond(){return kr}visitTimeNanosecond(){return Pr}visitDecimal(){return Or}visitList(){return _a}visitStruct(){return Ia}visitUnion(){return gn}visitDenseUnion(){return Ba}visitSparseUnion(){return Sa}visitDictionary(){return oa}visitInterval(){return Ai}visitIntervalDayTime(){return Mr}visitIntervalYearMonth(){return Tr}visitDuration(){return Te}visitDurationSecond(){return Nr}visitDurationMillisecond(){return Lr}visitDurationMicrosecond(){return Ur}visistDurationNanosecond(){return xr}visitFixedSizeList(){return aa}visitMap(){return va}}const Mu=new Fu;class w extends F{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,r)=>this.compareFields(n,e[r]))}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 et(i,t){return t instanceof i.constructor}function Di(i,t){return i===t||et(i,t)}function ee(i,t){return i===t||et(i,t)&&i.bitWidth===t.bitWidth&&i.isSigned===t.isSigned}function mn(i,t){return i===t||et(i,t)&&i.precision===t.precision}function Tu(i,t){return i===t||et(i,t)&&i.byteWidth===t.byteWidth}function Wr(i,t){return i===t||et(i,t)&&i.unit===t.unit}function Oi(i,t){return i===t||et(i,t)&&i.unit===t.unit&&i.timezone===t.timezone}function Fi(i,t){return i===t||et(i,t)&&i.unit===t.unit&&i.bitWidth===t.bitWidth}function Nu(i,t){return i===t||et(i,t)&&i.children.length===t.children.length&&kt.compareManyFields(i.children,t.children)}function Lu(i,t){return i===t||et(i,t)&&i.children.length===t.children.length&&kt.compareManyFields(i.children,t.children)}function Yr(i,t){return i===t||et(i,t)&&i.mode===t.mode&&i.typeIds.every((e,n)=>e===t.typeIds[n])&&kt.compareManyFields(i.children,t.children)}function Uu(i,t){return i===t||et(i,t)&&i.id===t.id&&i.isOrdered===t.isOrdered&&kt.visit(i.indices,t.indices)&&kt.visit(i.dictionary,t.dictionary)}function Jr(i,t){return i===t||et(i,t)&&i.unit===t.unit}function Mi(i,t){return i===t||et(i,t)&&i.unit===t.unit}function xu(i,t){return i===t||et(i,t)&&i.listSize===t.listSize&&i.children.length===t.children.length&&kt.compareManyFields(i.children,t.children)}function Cu(i,t){return i===t||et(i,t)&&i.keysSorted===t.keysSorted&&i.children.length===t.children.length&&kt.compareManyFields(i.children,t.children)}w.prototype.visitNull=Di;w.prototype.visitBool=Di;w.prototype.visitInt=ee;w.prototype.visitInt8=ee;w.prototype.visitInt16=ee;w.prototype.visitInt32=ee;w.prototype.visitInt64=ee;w.prototype.visitUint8=ee;w.prototype.visitUint16=ee;w.prototype.visitUint32=ee;w.prototype.visitUint64=ee;w.prototype.visitFloat=mn;w.prototype.visitFloat16=mn;w.prototype.visitFloat32=mn;w.prototype.visitFloat64=mn;w.prototype.visitUtf8=Di;w.prototype.visitBinary=Di;w.prototype.visitFixedSizeBinary=Tu;w.prototype.visitDate=Wr;w.prototype.visitDateDay=Wr;w.prototype.visitDateMillisecond=Wr;w.prototype.visitTimestamp=Oi;w.prototype.visitTimestampSecond=Oi;w.prototype.visitTimestampMillisecond=Oi;w.prototype.visitTimestampMicrosecond=Oi;w.prototype.visitTimestampNanosecond=Oi;w.prototype.visitTime=Fi;w.prototype.visitTimeSecond=Fi;w.prototype.visitTimeMillisecond=Fi;w.prototype.visitTimeMicrosecond=Fi;w.prototype.visitTimeNanosecond=Fi;w.prototype.visitDecimal=Di;w.prototype.visitList=Nu;w.prototype.visitStruct=Lu;w.prototype.visitUnion=Yr;w.prototype.visitDenseUnion=Yr;w.prototype.visitSparseUnion=Yr;w.prototype.visitDictionary=Uu;w.prototype.visitInterval=Jr;w.prototype.visitIntervalDayTime=Jr;w.prototype.visitIntervalYearMonth=Jr;w.prototype.visitDuration=Mi;w.prototype.visitDurationSecond=Mi;w.prototype.visitDurationMillisecond=Mi;w.prototype.visitDurationMicrosecond=Mi;w.prototype.visitDurationNanosecond=Mi;w.prototype.visitFixedSizeList=xu;w.prototype.visitMap=Cu;const kt=new w;function tn(i,t){return kt.compareSchemas(i,t)}function Eu(i,t){return kt.compareFields(i,t)}function Aa(i,t){return kt.visit(i,t)}function Oe(i){const t=i.type,e=new(Mu.getVisitFn(t)())(i);if(t.children&&t.children.length>0){const n=i.children||[],r={nullValues:i.nullValues},s=Array.isArray(n)?(o,a)=>n[a]||r:({name:o})=>n[o]||r;for(const[o,a]of t.children.entries()){const{type:c}=a,l=s(a,o);e.children.push(Oe(Object.assign(Object.assign({},l),{type:c})))}}return e}function Hr(i,t){if(i instanceof E||i instanceof g||i.type instanceof y||ArrayBuffer.isView(i))return fn(i);const e={type:t??Pi(i),nullValues:[null]},n=[...Da(e)(i)],r=n.length===1?n[0]:n.reduce((s,o)=>s.concat(o));return y.isDictionary(r.type)?r.memoize():r}function Vu(i){const t=Hr(i),e=new G(new C(t.type.children),t.data[0]);return new J(e)}function Pi(i){if(i.length===0)return new Vt;let t=0,e=0,n=0,r=0,s=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":++r;continue;case"string":++s;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(r+t===i.length)return new ln;if(s+t===i.length)return new Qt(new qe,new ue);if(o+t===i.length)return new cn;if(a+t===i.length)return new Ge;if(c+t===i.length)return new oo;if(e+t===i.length){const l=i,h=Pi(l[l.findIndex(d=>d!=null)]);if(l.every(d=>d==null||Aa(h,Pi(d))))return new De(new x("",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 x(d,Pi([h[d]]),!0));return new q([...l.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function Da(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*(r){let s=0;const o=Oe(i);for(const a of r)o.append(a)[n]>=e&&++s&&(yield o.toVector());(o.finish().length>0||s===0)&&(yield o.toVector())}}function Ru(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(r){return wt(this,arguments,function*(){var s,o,a,c;let l=0;const h=Oe(i);try{for(var d=!0,U=ae(r),M;M=yield D(U.next()),s=M.done,!s;d=!0){c=M.value,d=!1;const k=c;h.append(k)[n]>=e&&++l&&(yield yield D(h.toVector()))}}catch(k){o={error:k}}finally{try{!d&&!s&&(a=U.return)&&(yield D(a.call(U)))}finally{if(o)throw o.error}}(h.finish().length>0||l===0)&&(yield yield D(h.toVector()))})}}function Dn(i,t){return zu(i,t.map(e=>e.data.concat()))}function zu(i,t){const e=[...i.fields],n=[],r={numBatches:t.reduce((d,U)=>Math.max(d,U.length),0)};let s=0,o=0,a=-1;const c=t.length;let l,h=[];for(;r.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=ju(e,o,h,t,r),o>0&&(n[s++]=m({type:new q(e),length:o,nullCount:0,children:h.slice()})))}return[i=i.assign(e),n.map(d=>new G(i,d))]}function ju(i,t,e,n,r){var s;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),r.numBatches=Math.max(r.numBatches,n[a].unshift(l.slice(t,h-t))));else{const d=i[a];i[a]=d.clone({nullable:!0}),e[a]=(s=l?._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:m({type:d.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var Oa;class J{constructor(...t){var e,n;if(t.length===0)return this.batches=[],this.schema=new C([]),this._offsets=[0],this;let r,s;t[0]instanceof C&&(r=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());const o=c=>{if(c){if(c instanceof G)return[c];if(c instanceof J)return c.batches;if(c instanceof E){if(c.type instanceof q)return[new G(new C(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(M=>new g([c[M]])),d=new C(l.map((M,k)=>new x(String(M),h[k].type))),[,U]=Dn(d,h);return U.length===0?[new G(c)]:U}}}return[]},a=t.flatMap(c=>o(c));if(r=(n=r??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&n!==void 0?n:new C([]),!(r instanceof C))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(!tn(r,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=r,this.batches=a,this._offsets=s??$o(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=Po(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?vr.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:r})=>r));return new J(e,n.map(r=>new G(e,r)))}slice(t,e){const n=this.schema;[t,e]=gr({length:this.numRows},t,e);const r=Wo(this.data,this._offsets,t,e);return new J(n,r.map(s=>new G(n,s)))}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],r=m({type:n,length:0,nullCount:0});e.push(r._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(r=>r.name===t),e)}setChildAt(t,e){let n=this.schema,r=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new g([m({type:new Vt,length:this.numRows})]));const s=n.fields.slice(),o=s[t].clone({type:e.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[s[t],a[t]]=[o,e],[n,r]=Dn(n,a)}return new J(n,r)}select(t){const e=this.schema.fields.reduce((n,r,s)=>n.set(r.name,s),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(r=>r.selectAt(t));return new J(e,n)}assign(t){const e=this.schema.fields,[n,r]=t.schema.fields.reduce((a,c,l)=>{const[h,d]=a,U=e.findIndex(M=>M.name===c.name);return~U?d[U]=l:h.push(l),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,c)=>[c,r[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new J(...Dn(s,o))}}Oa=Symbol.toStringTag;J[Oa]=(i=>(i.schema=null,i.batches=[],i._offsets=new Uint32Array([0]),i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,i.isValid=Je(_r),i.get=Je(ot.getVisitFn(u.Struct)),i.set=Yo(gt.getVisitFn(u.Struct)),i.indexOf=Jo(Ji.getVisitFn(u.Struct)),i.getByteLength=Je(zt.getVisitFn(u.Struct)),"Table"))(J.prototype);function ku(i){const t={},e=Object.entries(i);for(const[n,r]of e)t[n]=fn(r);return new J(t)}function Pu(i){const t={},e=Object.entries(i);for(const[n,r]of e)t[n]=Hr(r);return new J(t)}var Fa;let G=class oi{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof C))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=m({nullCount:0,type:new q(this.schema.fields),children:this.schema.fields.map(e=>m({type:e.type,nullCount:0}))})]=t,!(this.data instanceof E))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=gs(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:n,children:r,length:s}=Object.keys(e).reduce((c,l,h)=>(c.children[h]=e[l],c.length=Math.max(c.length,e[l].length),c.fields[h]=x.new({name:l,type:e[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),o=new C(n),a=m({type:new q(n),length:s,children:r,nullCount:0});[this.schema,this.data]=gs(o,a.children,s);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=Ma(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 ot.visit(this.data,t)}set(t,e){return gt.visit(this.data,t,e)}indexOf(t,e){return Ji.visit(this.data,t,e)}getByteLength(t){return zt.visit(this.data,t)}[Symbol.iterator](){return vr.visit(new g([this.data]))}toArray(){return[...this]}concat(...t){return new J(this.schema,[this,...t])}slice(t,e){const[n]=new g([this.data]).slice(t,e).data;return new oi(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(r=>r.name===t),e)}setChildAt(t,e){let n=this.schema,r=this.data;if(t>-1&&t<this.numCols){e||(e=new g([m({type:new Vt,length:this.numRows})]));const s=n.fields.slice(),o=r.children.slice(),a=s[t].clone({type:e.type});[s[t],o[t]]=[a,e.data[0]],n=new C(s,new Map(this.schema.metadata)),r=m({type:new q(s),children:o})}return new oi(n,r)}select(t){const e=this.schema.select(t),n=new q(e.fields),r=[];for(const s of t){const o=this.schema.fields.findIndex(a=>a.name===s);~o&&(r[o]=this.data.children[o])}return new oi(e,m({type:n,length:this.numRows,children:r}))}selectAt(t){const e=this.schema.selectAt(t),n=t.map(s=>this.data.children[s]).filter(Boolean),r=m({type:new q(e.fields),length:this.numRows,children:n});return new oi(e,r)}};Fa=Symbol.toStringTag;G[Fa]=(i=>(i._nullCount=-1,i[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(G.prototype);function gs(i,t,e=t.reduce((n,r)=>Math.max(n,r.length),0)){var n;const r=[...i.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,c]of i.fields.entries()){const l=t[a];(!l||l.length!==e)&&(r[a]=c.clone({nullable:!0}),s[a]=(n=l?._changeLengthAndBackfillNullBitmap(e))!==null&&n!==void 0?n:m({type:c.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[i.assign(r),m({type:new q(r),length:e,children:s})]}function Ma(i,t,e=new Map){var n,r;if(((n=i?.length)!==null&&n!==void 0?n:0)>0&&i?.length===t?.length)for(let s=-1,o=i.length;++s<o;){const{type:a}=i[s],c=t[s];for(const l of[c,...((r=c?.dictionary)===null||r===void 0?void 0:r.data)||[]])Ma(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 Kr extends G{constructor(t){const e=t.fields.map(r=>m({type:r.type})),n=m({type:new q(t.fields),nullCount:0,children:e});super(t,n)}}var en;(function(i){i[i.BUFFER=0]="BUFFER"})(en||(en={}));var nn;(function(i){i[i.LZ4_FRAME=0]="LZ4_FRAME",i[i.ZSTD=1]="ZSTD"})(nn||(nn={}));class oe{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 oe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+z),(e||new oe).__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):nn.LZ4_FRAME}method(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):en.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,nn.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,en.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,n){return oe.startBodyCompression(t),oe.addCodec(t,e),oe.addMethod(t,n),oe.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 Na=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()}},Jt=class Cn{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 Cn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+z),(e||new Cn).__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 Na).__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 oe).__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()}},je=class En{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 En).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+z),(e||new En).__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 Jt).__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 mi;(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"})(mi||(mi={}));let re=class Ot{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 Ot).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+z),(e||new Ot).__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):ei.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):mi.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 Y).__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,ei.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,mi.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,r,s,o){return Ot.startMessage(t),Ot.addVersion(t,e),Ot.addHeaderType(t,n),Ot.addHeader(t,r),Ot.addBodyLength(t,s),Ot.addCustomMetadata(t,o),Ot.endMessage(t)}};class $u extends F{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return we.startNull(e),we.endNull(e)}visitInt(t,e){return lt.startInt(e),lt.addBitWidth(e,t.bitWidth),lt.addIsSigned(e,t.isSigned),lt.endInt(e)}visitFloat(t,e){return xt.startFloatingPoint(e),xt.addPrecision(e,t.precision),xt.endFloatingPoint(e)}visitBinary(t,e){return be.startBinary(e),be.endBinary(e)}visitBool(t,e){return _e.startBool(e),_e.endBool(e)}visitUtf8(t,e){return Se.startUtf8(e),Se.endUtf8(e)}visitDecimal(t,e){return it.startDecimal(e),it.addScale(e,t.scale),it.addPrecision(e,t.precision),it.addBitWidth(e,t.bitWidth),it.endDecimal(e)}visitDate(t,e){return zi.startDate(e),zi.addUnit(e,t.unit),zi.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 ve.startList(e),ve.endList(e)}visitStruct(t,e){return Ie.startStruct_(e),Ie.endStruct_(e)}visitUnion(t,e){nt.startTypeIdsVector(e,t.typeIds.length);const n=nt.createTypeIdsVector(e,t.typeIds);return nt.startUnion(e),nt.addMode(e,t.mode),nt.addTypeIds(e,n),nt.endUnion(e)}visitDictionary(t,e){const n=this.visit(t.indices,e);return Kt.startDictionaryEncoding(e),Kt.addId(e,BigInt(t.id)),Kt.addIsOrdered(e,t.isOrdered),n!==void 0&&Kt.addIndexType(e,n),Kt.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 ji.startMap(e),ji.addKeysSorted(e,t.keysSorted),ji.endMap(e)}}const On=new $u;function Wu(i,t=new Map){return new C(Ju(i,t),$i(i.metadata),t)}function La(i){return new ut(i.count,Ua(i.columns),xa(i.columns))}function Yu(i){return new Pt(La(i.data),i.id,i.isDelta)}function Ju(i,t){return(i.fields||[]).filter(Boolean).map(e=>x.fromJSON(e,t))}function ms(i,t){return(i.children||[]).filter(Boolean).map(e=>x.fromJSON(e,t))}function Ua(i){return(i||[]).reduce((t,e)=>[...t,new ye(e.count,Hu(e.VALIDITY)),...Ua(e.children)],[])}function xa(i,t=[]){for(let e=-1,n=(i||[]).length;++e<n;){const r=i[e];r.VALIDITY&&t.push(new Et(t.length,r.VALIDITY.length)),r.TYPE_ID&&t.push(new Et(t.length,r.TYPE_ID.length)),r.OFFSET&&t.push(new Et(t.length,r.OFFSET.length)),r.DATA&&t.push(new Et(t.length,r.DATA.length)),t=xa(r.children,t)}return t}function Hu(i){return(i||[]).reduce((t,e)=>t+ +(e===0),0)}function Ku(i,t){let e,n,r,s,o,a;return!t||!(s=i.dictionary)?(o=_s(i,ms(i,t)),r=new x(i.name,o,i.nullable,$i(i.metadata))):t.has(e=s.id)?(n=(n=s.indexType)?bs(n):new ue,a=new Qt(t.get(e),n,e,s.isOrdered),r=new x(i.name,a,i.nullable,$i(i.metadata))):(n=(n=s.indexType)?bs(n):new ue,t.set(e,o=_s(i,ms(i,t))),a=new Qt(o,n,e,s.isOrdered),r=new x(i.name,a,i.nullable,$i(i.metadata))),r||null}function $i(i=[]){return new Map(i.map(({key:t,value:e})=>[t,e]))}function bs(i){return new Q(i.isSigned,i.bitWidth)}function _s(i,t){const e=i.type.name;switch(e){case"NONE":return new Vt;case"null":return new Vt;case"binary":return new ui;case"utf8":return new qe;case"bool":return new Ge;case"list":return new De((t||[])[0]);case"struct":return new q(t||[]);case"struct_":return new q(t||[])}switch(e){case"int":{const n=i.type;return new Q(n.isSigned,n.bitWidth)}case"floatingpoint":{const n=i.type;return new qt(H[n.precision])}case"decimal":{const n=i.type;return new hi(n.scale,n.precision,n.bitWidth)}case"date":{const n=i.type;return new Be(st[n.unit])}case"time":{const n=i.type;return new Rt(f[n.unit],n.bitWidth)}case"timestamp":{const n=i.type;return new Gt(f[n.unit],n.timezone)}case"interval":{const n=i.type;return new Ae(pt[n.unit])}case"duration":{const n=i.type;return new Zt(f[n.unit])}case"union":{const n=i.type,[r,...s]=(n.mode+"").toLowerCase(),o=r.toUpperCase()+s.join("");return new he($[o],n.typeIds||[],t||[])}case"fixedsizebinary":{const n=i.type;return new di(n.byteWidth)}case"fixedsizelist":{const n=i.type;return new Ze(n.listSize,(t||[])[0])}case"map":{const n=i.type;return new Qe((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var qu=ia,Gu=ti;class Z{static fromJSON(t,e){const n=new Z(0,K.V5,e);return n._createHeader=Zu(t,e),n}static decode(t){t=new Gu(L(t));const e=re.getRootAsMessage(t),n=e.bodyLength(),r=e.version(),s=e.headerType(),o=new Z(n,r,s);return o._createHeader=Qu(e,s),o}static encode(t){const e=new qu;let n=-1;return t.isSchema()?n=C.encode(e,t.header()):t.isRecordBatch()?n=ut.encode(e,t.header()):t.isDictionaryBatch()&&(n=Pt.encode(e,t.header())),re.startMessage(e),re.addVersion(e,K.V5),re.addHeader(e,n),re.addHeaderType(e,t.headerType),re.addBodyLength(e,BigInt(t.bodyLength)),re.finishMessageBuffer(e,re.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof C)return new Z(0,K.V5,R.Schema,t);if(t instanceof ut)return new Z(e,K.V5,R.RecordBatch,t);if(t instanceof Pt)return new Z(e,K.V5,R.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===R.Schema}isRecordBatch(){return this.headerType===R.RecordBatch}isDictionaryBatch(){return this.headerType===R.DictionaryBatch}constructor(t,e,n,r){this._version=e,this._headerType=n,this.body=new Uint8Array(0),r&&(this._createHeader=()=>r),this._bodyLength=Bt(t)}}class ut{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=Bt(t)}}class Pt{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=Bt(e)}}class Et{constructor(t,e){this.offset=Bt(t),this.length=Bt(e)}}class ye{constructor(t,e){this.length=Bt(t),this.nullCount=Bt(e)}}function Zu(i,t){return()=>{switch(t){case R.Schema:return C.fromJSON(i);case R.RecordBatch:return ut.fromJSON(i);case R.DictionaryBatch:return Pt.fromJSON(i)}throw new Error(`Unrecognized Message type: { name: ${R[t]}, type: ${t} }`)}}function Qu(i,t){return()=>{switch(t){case R.Schema:return C.decode(i.header(new Ft),new Map,i.version());case R.RecordBatch:return ut.decode(i.header(new Jt),i.version());case R.DictionaryBatch:return Pt.decode(i.header(new je),i.version())}throw new Error(`Unrecognized Message type: { name: ${R[t]}, type: ${t} }`)}}x.encode=lh;x.decode=ah;x.fromJSON=Ku;C.encode=ch;C.decode=Xu;C.fromJSON=Wu;ut.encode=uh;ut.decode=th;ut.fromJSON=La;Pt.encode=hh;Pt.decode=eh;Pt.fromJSON=Yu;ye.encode=dh;ye.decode=nh;Et.encode=fh;Et.decode=ih;function Xu(i,t=new Map,e=K.V5){const n=oh(i,t);return new C(n,Wi(i),t,e)}function th(i,t=K.V5){if(i.compression()!==null)throw new Error("Record batch compression not implemented");return new ut(i.length(),rh(i),sh(i,t))}function eh(i,t=K.V5){return new Pt(ut.decode(i.data(),t),i.id(),i.isDelta())}function ih(i){return new Et(i.offset(),i.length())}function nh(i){return new ye(i.length(),i.nullCount())}function rh(i){const t=[];for(let e,n=-1,r=-1,s=i.nodesLength();++n<s;)(e=i.nodes(n))&&(t[++r]=ye.decode(e));return t}function sh(i,t){const e=[];for(let n,r=-1,s=-1,o=i.buffersLength();++r<o;)(n=i.buffers(r))&&(t<K.V4&&(n.bb_pos+=8*(r+1)),e[++s]=Et.decode(n));return e}function oh(i,t){const e=[];for(let n,r=-1,s=-1,o=i.fieldsLength();++r<o;)(n=i.fields(r))&&(e[++s]=x.decode(n,t));return e}function vs(i,t){const e=[];for(let n,r=-1,s=-1,o=i.childrenLength();++r<o;)(n=i.children(r))&&(e[++s]=x.decode(n,t));return e}function ah(i,t){let e,n,r,s,o,a;return!t||!(a=i.dictionary())?(r=Is(i,vs(i,t)),n=new x(i.name(),r,i.nullable(),Wi(i))):t.has(e=Bt(a.id()))?(s=(s=a.indexType())?ws(s):new ue,o=new Qt(t.get(e),s,e,a.isOrdered()),n=new x(i.name(),o,i.nullable(),Wi(i))):(s=(s=a.indexType())?ws(s):new ue,t.set(e,r=Is(i,vs(i,t))),o=new Qt(r,s,e,a.isOrdered()),n=new x(i.name(),o,i.nullable(),Wi(i))),n||null}function Wi(i){const t=new Map;if(i)for(let e,n,r=-1,s=Math.trunc(i.customMetadataLength());++r<s;)(e=i.customMetadata(r))&&(n=e.key())!=null&&t.set(n,e.value());return t}function ws(i){return new Q(i.isSigned(),i.bitWidth())}function Is(i,t){const e=i.typeType();switch(e){case T.NONE:return new Vt;case T.Null:return new Vt;case T.Binary:return new ui;case T.Utf8:return new qe;case T.Bool:return new Ge;case T.List:return new De((t||[])[0]);case T.Struct_:return new q(t||[])}switch(e){case T.Int:{const n=i.type(new lt);return new Q(n.isSigned(),n.bitWidth())}case T.FloatingPoint:{const n=i.type(new xt);return new qt(n.precision())}case T.Decimal:{const n=i.type(new it);return new hi(n.scale(),n.precision(),n.bitWidth())}case T.Date:{const n=i.type(new zi);return new Be(n.unit())}case T.Time:{const n=i.type(new dt);return new Rt(n.unit(),n.bitWidth())}case T.Timestamp:{const n=i.type(new ft);return new Gt(n.unit(),n.timezone())}case T.Interval:{const n=i.type(new Ct);return new Ae(n.unit())}case T.Duration:{const n=i.type(new Nt);return new Zt(n.unit())}case T.Union:{const n=i.type(new nt);return new he(n.mode(),n.typeIdsArray()||[],t||[])}case T.FixedSizeBinary:{const n=i.type(new Lt);return new di(n.byteWidth())}case T.FixedSizeList:{const n=i.type(new Ut);return new Ze(n.listSize(),(t||[])[0])}case T.Map:{const n=i.type(new ji);return new Qe((t||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${T[e]}" (${e})`)}function ch(i,t){const e=t.fields.map(s=>x.encode(i,s));Ft.startFieldsVector(i,e.length);const n=Ft.createFieldsVector(i,e),r=t.metadata&&t.metadata.size>0?Ft.createCustomMetadataVector(i,[...t.metadata].map(([s,o])=>{const a=i.createString(`${s}`),c=i.createString(`${o}`);return Y.startKeyValue(i),Y.addKey(i,a),Y.addValue(i,c),Y.endKeyValue(i)})):-1;return Ft.startSchema(i),Ft.addFields(i,n),Ft.addEndianness(i,yh?ii.Little:ii.Big),r!==-1&&Ft.addCustomMetadata(i,r),Ft.endSchema(i)}function lh(i,t){let e=-1,n=-1,r=-1;const s=t.type;let o=t.typeId;y.isDictionary(s)?(o=s.dictionary.typeId,r=On.visit(s,i),n=On.visit(s.dictionary,i)):n=On.visit(s,i);const a=(s.children||[]).map(h=>x.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}`),M=i.createString(`${d}`);return Y.startKeyValue(i),Y.addKey(i,U),Y.addValue(i,M),Y.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),r!==-1&&ht.addDictionary(i,r),l!==-1&&ht.addCustomMetadata(i,l),ht.endField(i)}function uh(i,t){const e=t.nodes||[],n=t.buffers||[];Jt.startNodesVector(i,e.length);for(const o of e.slice().reverse())ye.encode(i,o);const r=i.endVector();Jt.startBuffersVector(i,n.length);for(const o of n.slice().reverse())Et.encode(i,o);const s=i.endVector();return Jt.startRecordBatch(i),Jt.addLength(i,BigInt(t.length)),Jt.addNodes(i,r),Jt.addBuffers(i,s),Jt.endRecordBatch(i)}function hh(i,t){const e=ut.encode(i,t.data);return je.startDictionaryBatch(i),je.addId(i,BigInt(t.id)),je.addIsDelta(i,t.isDelta),je.addData(i,e),je.endDictionaryBatch(i)}function dh(i,t){return Na.createFieldNode(i,BigInt(t.length),BigInt(t.nullCount))}function fh(i,t){return Ta.createBuffer(i,BigInt(t.offset),BigInt(t.length))}const yh=(()=>{const i=new ArrayBuffer(2);return new DataView(i).setInt16(0,256,!0),new Int16Array(i)[0]===256})(),qr=i=>`Expected ${R[i]} Message in stream, but was null or length 0.`,Gr=i=>`Header pointer of flatbuffer-encoded ${R[i]} Message is null or length 0.`,Ca=(i,t)=>`Expected to read ${i} metadata bytes, but only read ${t}.`,Ea=(i,t)=>`Expected to read ${i} bytes for message body, but only read ${t}.`;class Zr{constructor(t){this.source=t instanceof gi?t:new gi(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?j: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(qr(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=L(this.source.read(t));if(e.byteLength<t)throw new Error(Ea(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){const e=R.Schema,n=this.readMessage(e),r=n?.header();if(t&&!r)throw new Error(Gr(e));return r}readMetadataLength(){const t=this.source.read(bn),e=t&&new ti(t),n=e?.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(t){const e=this.source.read(t);if(!e)return j;if(e.byteLength<t)throw new Error(Ca(t,e.byteLength));return{done:!1,value:Z.decode(e)}}}class Va{constructor(t,e){this.source=t instanceof fe?t:Ts(t)?new Xi(t,e):new fe(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?j: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(qr(t));return e.value})}readMessageBody(t){return p(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);const e=L(yield this.source.read(t));if(e.byteLength<t)throw new Error(Ea(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=R.Schema,n=yield this.readMessage(e),r=n?.header();if(t&&!r)throw new Error(Gr(e));return r})}readMetadataLength(){return p(this,void 0,void 0,function*(){const t=yield this.source.read(bn),e=t&&new ti(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 j;if(e.byteLength<t)throw new Error(Ca(t,e.byteLength));return{done:!1,value:Z.decode(e)}})}}class Ra extends Zr{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof ys?t:new ys(t)}next(){const{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Z.fromJSON(t.schema,R.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,R.DictionaryBatch)}}if(this._batchIndex<t.batches.length){const e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:Z.fromJSON(e,R.RecordBatch)}}return this._body=[],j}readMessageBody(t){return e(this._body);function e(n){return(n||[]).reduce((r,s)=>[...r,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(qr(t));return e.value}readSchema(){const t=R.Schema,e=this.readMessage(t),n=e?.header();if(!e||!n)throw new Error(Gr(t));return n}}const bn=4,Vn="ARROW1",bi=new Uint8Array(Vn.length);for(let i=0;i<Vn.length;i+=1)bi[i]=Vn.codePointAt(i);function Qr(i,t=0){for(let e=-1,n=bi.length;++e<n;)if(bi[e]!==i[t+e])return!1;return!0}const Ti=bi.length,za=Ti+bn,ph=Ti*2+bn;class yt extends wr{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 ce(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 ct.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return ct.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 yt?t:Tn(t)?bh(t):Ts(t)?wh(t):ce(t)?p(this,void 0,void 0,function*(){return yield yt.from(yield t)}):Ns(t)||zn(t)||Ls(t)||Fe(t)?vh(new fe(t)):_h(new gi(t))}static readAll(t){return t instanceof yt?t.isSync()?Ss(t):Bs(t):Tn(t)||ArrayBuffer.isView(t)||si(t)||Ms(t)?Ss(t):Bs(t)}}class ri extends yt{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return wt(this,arguments,function*(){yield D(yield*Vi(ae(this[Symbol.iterator]())))})}}class _i extends yt{constructor(t){super(t),this._impl=t}readAll(){var t,e,n,r;return p(this,void 0,void 0,function*(){const s=new Array;try{for(var o=!0,a=ae(this),c;c=yield a.next(),t=c.done,!t;o=!0){r=c.value,o=!1;const l=r;s.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 s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class _n extends ri{constructor(t){super(t),this._impl=t}}class ja extends _i{constructor(t){super(t),this._impl=t}}class ka{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),r=m({type:new q(this.schema.fields),length:t.length,children:n});return new G(this.schema,r)}_loadDictionaryBatch(t,e){const{id:n,isDelta:r}=t,{dictionaries:s,schema:o}=this,a=s.get(n);if(r||!a){const c=o.dictionaries.get(n),l=this._loadVectors(t.data,e,[c]);return(a&&r?a.concat(new g(l)):new g(l)).memoize()}return a.memoize()}_loadVectors(t,e,n){return new ra(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}class rn extends ka{constructor(t,e){super(e),this._reader=Tn(t)?new Ra(this._handle=t):new Zr(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=$a(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):j}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):j}next(){if(this.closed)return j;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(),r=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,r)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),r=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Kr(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class sn extends ka{constructor(t,e){super(e),this._reader=new Va(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=$a(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):j})}return(t){return p(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):j})}next(){return p(this,void 0,void 0,function*(){if(this.closed)return j;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(),r=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,r)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),r=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Kr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return p(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class Pa extends rn{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 ps?t:new ps(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 r=this._reader.readMessage(R.RecordBatch);if(r?.isRecordBatch()){const s=r.header(),o=this._reader.readMessageBody(r.bodyLength);return this._loadRecordBatch(s,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 r=this._reader.readMessage(R.DictionaryBatch);if(r?.isDictionaryBatch()){const s=r.header(),o=this._reader.readMessageBody(r.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-za,n=t.readInt32(e),r=t.readAt(e-n,n);return pi.decode(r)}_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 gh extends sn{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,r=e[0]instanceof Map?e.shift():void 0;super(t instanceof Xi?t:new Xi(t,n),r)}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 r=yield this._reader.readMessage(R.RecordBatch);if(r?.isRecordBatch()){const s=r.header(),o=yield this._reader.readMessageBody(r.bodyLength);return this._loadRecordBatch(s,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 r=yield this._reader.readMessage(R.DictionaryBatch);if(r?.isDictionaryBatch()){const s=r.header(),o=yield this._reader.readMessageBody(r.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return p(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-za,n=yield t.readInt32(e),r=yield t.readAt(e-n,n);return pi.decode(r)})}_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 mh extends rn{constructor(t,e){super(t,e)}_loadVectors(t,e,n){return new Du(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}function $a(i,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:i.autoDestroy}function*Ss(i){const t=yt.from(i);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function Bs(i){return wt(this,arguments,function*(){const e=yield D(yt.from(i));try{if(!(yield D(e.open({autoDestroy:!1}))).closed)do yield yield D(e);while(!(yield D(e.reset().open())).closed)}finally{yield D(e.cancel())}})}function bh(i){return new ri(new mh(i))}function _h(i){const t=i.peek(Ti+7&-8);return t&&t.byteLength>=4?Qr(t)?new _n(new Pa(i.read())):new ri(new rn(i)):new ri(new rn(function*(){}()))}function vh(i){return p(this,void 0,void 0,function*(){const t=yield i.peek(Ti+7&-8);return t&&t.byteLength>=4?Qr(t)?new _n(new Pa(yield i.read())):new _i(new sn(i)):new _i(new sn(function(){return wt(this,arguments,function*(){})}()))})}function wh(i){return p(this,void 0,void 0,function*(){const{size:t}=yield i.stat(),e=new Xi(i,t);return t>=ph&&Qr(yield e.readAt(0,Ti+7&-8))?new ja(new gh(e)):new _i(new sn(e))})}class P extends F{static assemble(...t){const e=r=>r.flatMap(s=>Array.isArray(s)?e(s):s instanceof G?s.data.children:s.data),n=new P;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 ye(n,0));else{const{nullCount:r}=t;y.isNull(e)||It.call(this,r<=0?new Uint8Array(0):fi(t.offset,n,t.nullBitmap)),this.nodes.push(new ye(n,r))}}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 It(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 Ih(i){var t;const{type:e,length:n,typeIds:r,valueOffsets:s}=i;if(It.call(this,r),e.mode===$.Sparse)return Rn.call(this,i);if(e.mode===$.Dense){if(i.offset<=0)return It.call(this,s),Rn.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=r[d])!==void 0&&((h=a[l])===void 0&&(h=a[l]=s[d]),o[d]=s[d]-h,c[l]=((t=c[l])!==null&&t!==void 0?t:0)+1);It.call(this,o),this.visitMany(i.children.map((l,h)=>{const d=e.typeIds[h],U=a[d],M=c[d];return l.slice(U,Math.min(n,M))}))}}return this}function Sh(i){let t;return i.nullCount>=i.length?It.call(this,new Uint8Array(0)):(t=i.values)instanceof Uint8Array?It.call(this,fi(i.offset,i.length,t)):It.call(this,yi(i.values))}function ie(i){return It.call(this,i.values.subarray(0,i.length*i.stride))}function Wa(i){const{length:t,values:e,valueOffsets:n}=i,{[0]:r,[t]:s}=n,o=Math.min(s-r,e.byteLength-r);return It.call(this,kn(-r,t+1,n)),It.call(this,e.subarray(r,r+o)),this}function Xr(i){const{length:t,valueOffsets:e}=i;if(e){const{[0]:n,[t]:r}=e;return It.call(this,kn(-n,t+1,e)),this.visit(i.children[0].slice(n,r-n))}return this.visit(i.children[0])}function Rn(i){return this.visitMany(i.type.children.map((t,e)=>i.children[e]).filter(Boolean))[0]}P.prototype.visitBool=Sh;P.prototype.visitInt=ie;P.prototype.visitFloat=ie;P.prototype.visitUtf8=Wa;P.prototype.visitBinary=Wa;P.prototype.visitFixedSizeBinary=ie;P.prototype.visitDate=ie;P.prototype.visitTimestamp=ie;P.prototype.visitTime=ie;P.prototype.visitDecimal=ie;P.prototype.visitList=Xr;P.prototype.visitStruct=Rn;P.prototype.visitUnion=Ih;P.prototype.visitInterval=ie;P.prototype.visitDuration=ie;P.prototype.visitFixedSizeList=Xr;P.prototype.visitMap=Xr;class Bh extends F{visit(t){return t==null?void 0:super.visit(t)}visitNull({typeId:t}){return{name:T[t].toLowerCase()}}visitInt({typeId:t,bitWidth:e,isSigned:n}){return{name:T[t].toLowerCase(),bitWidth:e,isSigned:n}}visitFloat({typeId:t,precision:e}){return{name:T[t].toLowerCase(),precision:H[e]}}visitBinary({typeId:t}){return{name:T[t].toLowerCase()}}visitBool({typeId:t}){return{name:T[t].toLowerCase()}}visitUtf8({typeId:t}){return{name:T[t].toLowerCase()}}visitDecimal({typeId:t,scale:e,precision:n,bitWidth:r}){return{name:T[t].toLowerCase(),scale:e,precision:n,bitWidth:r}}visitDate({typeId:t,unit:e}){return{name:T[t].toLowerCase(),unit:st[e]}}visitTime({typeId:t,unit:e,bitWidth:n}){return{name:T[t].toLowerCase(),unit:f[e],bitWidth:n}}visitTimestamp({typeId:t,timezone:e,unit:n}){return{name:T[t].toLowerCase(),unit:f[n],timezone:e}}visitInterval({typeId:t,unit:e}){return{name:T[t].toLowerCase(),unit:pt[e]}}visitDuration({typeId:t,unit:e}){return{name:T[t].toLocaleLowerCase(),unit:f[e]}}visitList({typeId:t}){return{name:T[t].toLowerCase()}}visitStruct({typeId:t}){return{name:T[t].toLowerCase()}}visitUnion({typeId:t,mode:e,typeIds:n}){return{name:T[t].toLowerCase(),mode:$[e].toUpperCase(),typeIds:[...n]}}visitDictionary(t){return this.visit(t.dictionary)}visitFixedSizeBinary({typeId:t,byteWidth:e}){return{name:T[t].toLowerCase(),byteWidth:e}}visitFixedSizeList({typeId:t,listSize:e}){return{name:T[t].toLowerCase(),listSize:e}}visitMap({typeId:t,keysSorted:e}){return{name:T[t].toLowerCase(),keysSorted:e}}}class vn extends F{static assemble(...t){const e=new vn;return t.map(({schema:n,data:r})=>e.visitMany(n.fields,r.children))}visit({name:t},e){const{length:n}=e,{offset:r,nullCount:s,nullBitmap:o}=e,a=y.isDictionary(e.type)?e.type.indices:e.type,c=Object.assign([],e.buffers,{[bt.VALIDITY]:void 0});return Object.assign({name:t,count:n,VALIDITY:y.isNull(a)||y.isUnion(a)?void 0:s<=0?Array.from({length:n},()=>1):[...new Xe(o,r,n,null,mr)]},super.visit(e.clone(a,r,n,0,c)))}visitNull(){return{}}visitBool({values:t,offset:e,length:n}){return{DATA:[...new Xe(t,e,n,null,dn)]}}visitInt(t){return{DATA:t.type.bitWidth<64?[...t.values]:[...Ce(t.values,2)]}}visitFloat(t){return{DATA:[...t.values]}}visitUtf8(t){return{DATA:[...new g([t])],OFFSET:[...t.valueOffsets]}}visitBinary(t){return{DATA:[...As(new g([t]))],OFFSET:[...t.valueOffsets]}}visitFixedSizeBinary(t){return{DATA:[...As(new g([t]))]}}visitDate(t){return{DATA:t.type.unit===st.DAY?[...t.values]:[...Ce(t.values,2)]}}visitTimestamp(t){return{DATA:[...Ce(t.values,2)]}}visitTime(t){return{DATA:t.type.unit<f.MICROSECOND?[...t.values]:[...Ce(t.values,2)]}}visitDecimal(t){return{DATA:[...Ce(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===$.Dense?[...t.valueOffsets]:void 0,children:this.visitMany(t.type.children,t.children)}}visitInterval(t){return{DATA:[...t.values]}}visitDuration(t){return{DATA:[...Ce(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*As(i){for(const t of i)yield t.reduce((e,n)=>`${e}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*Ce(i,t){const e=new Uint32Array(i.buffer);for(let n=-1,r=e.length/t;++n<r;)yield`${vi.new(e.subarray((n+0)*t,(n+1)*t),!1)}`}class Ni extends wr{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 He,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,rt(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 ce(t)?t.then(e=>this.writeAll(e)):Fe(t)?is(this,t):es(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 He?this._sink=t:(this._sink=new He,t&&Qa(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&Xa(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||!tn(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 J&&!(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&&!tn(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof G?t instanceof Kr||this._writeRecordBatch(t):t instanceof J?this.writeAll(t.batches):si(t)&&this.writeAll(t)}_writeMessage(t,e=8){const n=e-1,r=Z.encode(t),s=r.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+n&~n,c=a-s-o;return t.headerType===R.RecordBatch?this._recordBatchBlocks.push(new jt(a,t.bodyLength,this._position)):t.headerType===R.DictionaryBatch&&this._dictionaryBlocks.push(new jt(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(r),this._writePadding(c)}_write(t){if(this._started){const e=L(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(bi)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:n,bufferRegions:r,buffers:s}=P.assemble(t),o=new ut(t.numRows,n,r),a=Z.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,n=!1){this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));const{byteLength:r,nodes:s,bufferRegions:o,buffers:a}=P.assemble(new g([t])),c=new ut(t.length,s,o),l=new Pt(c,e,n),h=Z.from(l,r);return this._writeMessage(h)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,n,r;for(let s=-1,o=t.length;++s<o;)(e=t[s])&&(n=e.byteLength)>0&&(this._write(e),(r=(n+7&-8)-n)>0&&this._writePadding(r));return this}_writeDictionaries(t){for(let[e,n]of t.dictionaries){let r=this._dictionaryDeltaOffsets.get(e)||0;if(r===0||(n=n?.slice(r)).length>0)for(const s of n.data)this._writeDictionaryBatch(s,e,r>0),r+=s.length}return this}}class Li extends Ni{static writeAll(t,e){const n=new Li(e);return ce(t)?t.then(r=>n.writeAll(r)):Fe(t)?is(n,t):es(n,t)}}class Ui extends Ni{static writeAll(t){const e=new Ui;return ce(t)?t.then(n=>e.writeAll(n)):Fe(t)?is(e,t):es(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const e=pi.encode(new pi(t,K.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}class ts extends Ni{static writeAll(t){return new ts().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(`${Ah(t,e,n)}`),this._dictionaryBlocks.push(new jt(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(`${Dh(this._recordBatches[t])}`),this._recordBatchBlocks.push(new jt(0,0,0));this._write(`
|
|
19
|
+
]`)}return this._schema&&this._write(`
|
|
20
|
+
}`),this._dictionaries=[],this._recordBatches=[],super.close()}}function es(i,t){let e=t;t instanceof J&&(e=t.batches,i.reset(void 0,t.schema));for(const n of e)i.write(n);return i.finish()}function is(i,t){var e,n,r,s,o,a,c;return p(this,void 0,void 0,function*(){try{for(e=!0,n=ae(t);r=yield n.next(),s=r.done,!s;e=!0){c=r.value,e=!1;const l=c;i.write(l)}}catch(l){o={error:l}}finally{try{!e&&!s&&(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 Bh;return{name:i,nullable:e,type:n.visit(t),children:(t.children||[]).map(r=>Ya(r)),dictionary:y.isDictionary(t)?{id:t.id,isOrdered:t.isOrdered,indexType:n.visit(t.indices)}:void 0}}function Ah(i,t,e=!1){const[n]=vn.assemble(new G({[t]:i}));return JSON.stringify({id:t,isDelta:e,data:{count:i.length,columns:n}},null,2)}function Dh(i){const[t]=vn.assemble(i);return JSON.stringify({count:i.numRows,columns:t},null,2)}function Oh(i,t){if(Fe(i))return Mh(i,t);if(si(i))return Fh(i,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function Fh(i,t){let e=null;const n=t?.type==="bytes"||!1,r=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(o){s(o,e||(e=i[Symbol.iterator]()))},pull(o){e?s(o,e):o.close()},cancel(){(e?.return&&e.return()||!0)&&(e=null)}}),Object.assign({highWaterMark:n?r:void 0},t));function s(o,a){let c,l=null,h=o.desiredSize||null;for(;!(l=a.next(n?h:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=L(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 Mh(i,t){let e=null;const n=t?.type==="bytes"||!1,r=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 s(o,e||(e=i[Symbol.asyncIterator]()))})},pull(o){return p(this,void 0,void 0,function*(){e?yield s(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?r:void 0},t));function s(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=L(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 Th(i){return new Nh(i)}class Nh{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;const{["readableStrategy"]:e,["writableStrategy"]:n,["queueingStrategy"]:r="count"}=t,s=Ka(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Oe(s),this._getSize=r!=="bytes"?Ds:Os;const{["highWaterMark"]:o=r==="bytes"?Math.pow(2,14):1e3}=Object.assign({},e),{["highWaterMark"]:a=r==="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:r!=="bytes"?Ds:Os}),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 Ds=i=>{var t;return(t=i?.length)!==null&&t!==void 0?t:0},Os=i=>{var t;return(t=i?.byteLength)!==null&&t!==void 0?t:0};function ns(i,t){const e=new He;let n=null;const r=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 s()))})},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:r};function s(){return p(this,void 0,void 0,function*(){return yield(yield yt.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 rs(i,t){const e=new this(i),n=new fe(e),r=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 s(o)})},start(o){return p(this,void 0,void 0,function*(){yield s(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(e,i),readable:r};function s(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 Ja(i){const t=yt.from(i);return ce(t)?t.then(e=>Ja(e)):t.isAsync()?t.readAll().then(e=>new J(e)):new J(t.readAll())}function Lh(i,t="stream"){return(t==="stream"?Li:Ui).writeAll(i).toUint8Array(!0)}const Uh=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Cc),Au),nu),el),Oc),eu),xc),{compareSchemas:tn,compareFields:Eu,compareTypes:Aa});ct.toDOMStream=Oh;X.throughDOM=Th;yt.throughDOM=ns;_n.throughDOM=ns;ri.throughDOM=ns;Ni.throughDOM=rs;Ui.throughDOM=rs;Li.throughDOM=rs;const Gh=Object.freeze(Object.defineProperty({__proto__:null,AsyncByteQueue:He,AsyncByteStream:fe,AsyncMessageReader:Va,AsyncRecordBatchFileReader:ja,AsyncRecordBatchStreamReader:_i,Binary:ui,BinaryBuilder:Br,Bool:Ge,BoolBuilder:sa,get BufferType(){return bt},Builder:X,ByteStream:gi,Data:E,DataType:y,DateBuilder:Si,DateDay:Ec,DateDayBuilder:Ar,DateMillisecond:oo,DateMillisecondBuilder:Dr,get DateUnit(){return st},Date_:Be,Decimal:hi,DecimalBuilder:Or,DenseUnion:Zc,DenseUnionBuilder:Ba,Dictionary:Qt,DictionaryBuilder:oa,Duration:Zt,DurationBuilder:Te,DurationMicrosecond:qc,DurationMicrosecondBuilder:Ur,DurationMillisecond:Kc,DurationMillisecondBuilder:Lr,DurationNanosecond:Gc,DurationNanosecondBuilder:xr,DurationSecond:Hc,DurationSecondBuilder:Nr,Field:x,FixedSizeBinary:di,FixedSizeBinaryBuilder:Fr,FixedSizeList:Ze,FixedSizeListBuilder:aa,Float:qt,Float16:so,Float16Builder:ca,Float32:Kn,Float32Builder:la,Float64:ln,Float64Builder:ua,FloatBuilder:Bi,Int:Q,Int16:$n,Int16Builder:da,Int32:ue,Int32Builder:fa,Int64:cn,Int64Builder:ya,Int8:Pn,Int8Builder:ha,IntBuilder:Wt,Interval:Ae,IntervalBuilder:Ai,IntervalDayTime:Yc,IntervalDayTimeBuilder:Mr,get IntervalUnit(){return pt},IntervalYearMonth:Jc,IntervalYearMonthBuilder:Tr,JSONMessageReader:Ra,List:De,ListBuilder:_a,MapBuilder:va,MapRow:wi,Map_:Qe,Message:Z,get MessageHeader(){return mi},MessageReader:Zr,get MetadataVersion(){return K},Null:Vt,NullBuilder:wa,get Precision(){return H},RecordBatch:G,RecordBatchFileReader:_n,RecordBatchFileWriter:Ui,RecordBatchJSONWriter:ts,RecordBatchReader:yt,RecordBatchStreamReader:ri,RecordBatchStreamWriter:Li,RecordBatchWriter:Ni,Schema:C,SparseUnion:Qc,SparseUnionBuilder:Sa,Struct:q,StructBuilder:Ia,StructRow:un,Table:J,Time:Rt,TimeBuilder:Le,TimeMicrosecond:zc,TimeMicrosecondBuilder:kr,TimeMillisecond:Rc,TimeMillisecondBuilder:jr,TimeNanosecond:jc,TimeNanosecondBuilder:Pr,TimeSecond:Vc,TimeSecondBuilder:zr,get TimeUnit(){return f},Timestamp:Gt,TimestampBuilder:Ne,TimestampMicrosecond:$c,TimestampMicrosecondBuilder:Vr,TimestampMillisecond:Pc,TimestampMillisecondBuilder:Er,TimestampNanosecond:Wc,TimestampNanosecondBuilder:Rr,TimestampSecond:kc,TimestampSecondBuilder:Cr,get Type(){return u},Uint16:Yn,Uint16Builder:ga,Uint32:Jn,Uint32Builder:ma,Uint64:Hn,Uint64Builder:ba,Uint8:Wn,Uint8Builder:pa,Union:he,UnionBuilder:gn,get UnionMode(){return $},Utf8:qe,Utf8Builder:$r,Vector:g,Visitor:F,builderThroughAsyncIterable:Ru,builderThroughIterable:Da,makeBuilder:Oe,makeData:m,makeTable:ku,makeVector:fn,tableFromArrays:Pu,tableFromIPC:Ja,tableFromJSON:Vu,tableToIPC:Lh,util:Uh,vectorFromArray:Hr},Symbol.toStringTag,{value:"Module"}));export{Gh as A,xh as _,ss as a,Eh as b,Ch as c,Ka as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as o}from"./index-Co8E2-FE.js";import"./cesium-DUOzBlqv.js";import"./arrow-CZ5kQ26f.js";import"./exporters-ChAtBmlj.js";import"./bcf-DOG9_WPX.js";import"./zip-DBEtpeu6.js";import"./drawing-2d-gWfpdfYe.js";import"./lens-CSASnhAL.js";import"./sandbox-DZiNLNMk.js";import"./server-client-BV8zHZ7Y.js";import"./ids-B4jTqB1O.js";const n=700;function v(s){const e=o.getState(),i=e.basketViews.find(t=>t.id===s);if(i){if(e.setDrawing2D(null),e.setDrawing2DPanelVisible(!1),e.updateDrawing2DDisplayOptions({show3DOverlay:!1}),e.clearEntitySelection(),e.restoreBasketEntities(i.entityRefs,s),i.viewpoint){const t=i.transitionMs??n;e.cameraCallbacks.applyViewpoint?.(i.viewpoint,!0,t)}if(i.section){const t=i.section;o.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=o.getState().sectionPlane;o.setState({sectionPlane:{...t,enabled:!1}}),e.activeTool==="section"&&e.setActiveTool("select")}}}export{v as activateBasketViewFromStore};
|