@reearth/core 0.0.7-alpha.6 → 0.0.7-alpha.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (512) hide show
  1. package/LICENSE +177 -0
  2. package/dist/core.js +70987 -60888
  3. package/dist/core.umd.cjs +666 -680
  4. package/dist/{index-DqatWUTw.js → index-CUJ6HGQn.js} +1021 -908
  5. package/dist/index.d.ts +157 -71
  6. package/package.json +88 -74
  7. package/src/Map/ClusteredLayers/index.tsx +1 -1
  8. package/src/Map/Geoid/index.tsx +68 -0
  9. package/src/Map/Geoid/types.ts +8 -0
  10. package/src/Map/Layer/hooks.ts +7 -4
  11. package/src/Map/Layer/index.tsx +3 -1
  12. package/src/Map/Layers/hooks.ts +35 -8
  13. package/src/Map/Layers/index.tsx +13 -2
  14. package/src/Map/Layers/keys.ts +1 -0
  15. package/src/Map/Sketch/hooks.ts +454 -411
  16. package/src/Map/Sketch/index.tsx +68 -21
  17. package/src/Map/Sketch/sketchMachine.ts +427 -102
  18. package/src/Map/Sketch/sketchMachine.typegen.ts +58 -1
  19. package/src/Map/Sketch/types.ts +10 -20
  20. package/src/Map/Sketch/usePluginSketchLayer.ts +105 -0
  21. package/src/Map/Sketch/useSketch.ts +558 -0
  22. package/src/Map/Sketch/useSketchFeature.ts +198 -0
  23. package/src/Map/SpatialId/constants.ts +21 -0
  24. package/src/Map/SpatialId/hooks.ts +448 -0
  25. package/src/Map/SpatialId/index.tsx +63 -0
  26. package/src/Map/SpatialId/types.ts +68 -0
  27. package/src/Map/SpatialId/utils.ts +65 -0
  28. package/src/Map/hooks.ts +54 -8
  29. package/src/Map/index.tsx +42 -9
  30. package/src/Map/ref.ts +32 -3
  31. package/src/Map/types/index.ts +39 -3
  32. package/src/Map/types/viewerProperty.ts +10 -0
  33. package/src/Map/useTimelineManager.ts +4 -10
  34. package/src/Map/utils.ts +1 -1
  35. package/src/Visualizer/Error.tsx +4 -1
  36. package/src/Visualizer/context.tsx +5 -5
  37. package/src/Visualizer/coreContext.tsx +3 -1
  38. package/src/Visualizer/hooks.ts +56 -22
  39. package/src/Visualizer/index.stories.tsx +15 -0
  40. package/src/Visualizer/index.tsx +25 -6
  41. package/src/Visualizer/useViewport.ts +1 -1
  42. package/src/engines/Cesium/Feature/Box/hooks/box.ts +4 -4
  43. package/src/engines/Cesium/Feature/Box/hooks/edge.ts +1 -1
  44. package/src/engines/Cesium/Feature/Box/hooks/side.ts +1 -1
  45. package/src/engines/Cesium/Feature/Box/utils.ts +6 -0
  46. package/src/engines/Cesium/Feature/Ellipse/index.stories.tsx +0 -1
  47. package/src/engines/Cesium/Feature/Frustum/getFieldOfView.ts +2 -0
  48. package/src/engines/Cesium/Feature/Frustum/index.stories.tsx +0 -1
  49. package/src/engines/Cesium/Feature/HeatMap/HeatmapMesh.tsx +1 -1
  50. package/src/engines/Cesium/Feature/Marker/index.tsx +1 -1
  51. package/src/engines/Cesium/Feature/Model/index.stories.tsx +1 -2
  52. package/src/engines/Cesium/Feature/Model/index.tsx +3 -3
  53. package/src/engines/Cesium/Feature/PhotoOverlay/hooks.ts +2 -2
  54. package/src/engines/Cesium/Feature/PhotoOverlay/index.tsx +3 -1
  55. package/src/engines/Cesium/Feature/Polygon/index.stories.tsx +0 -1
  56. package/src/engines/Cesium/Feature/Polygon/index.tsx +6 -4
  57. package/src/engines/Cesium/Feature/Raster/index.stories.tsx +0 -1
  58. package/src/engines/Cesium/Feature/Raster/mvt.ts +2 -1
  59. package/src/engines/Cesium/Feature/Resource/index.stories.tsx +0 -1
  60. package/src/engines/Cesium/Feature/Resource/index.tsx +1 -27
  61. package/src/engines/Cesium/Feature/Resource/utils.ts +86 -91
  62. package/src/engines/Cesium/Feature/Tileset/hooks.ts +136 -71
  63. package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +0 -1
  64. package/src/engines/Cesium/Feature/Tileset/index.tsx +1 -1
  65. package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +2 -2
  66. package/src/engines/Cesium/Feature/Tileset/useDrawClipping.ts +2 -2
  67. package/src/engines/Cesium/Feature/context.ts +1 -0
  68. package/src/engines/Cesium/Feature/index.tsx +9 -5
  69. package/src/engines/Cesium/Feature/utils.tsx +20 -12
  70. package/src/engines/Cesium/PostProcesses/hbao/AmbientOcclusion.tsx +7 -4
  71. package/src/engines/Cesium/Sketch/ControlPoint.tsx +128 -24
  72. package/src/engines/Cesium/Sketch/ExtrudedControlPoints.tsx +70 -25
  73. package/src/engines/Cesium/Sketch/ExtrudedMeasurement.tsx +3 -1
  74. package/src/engines/Cesium/Sketch/ExtrudedPolygonEntity.tsx +14 -14
  75. package/src/engines/Cesium/Sketch/PolylineEntity.tsx +7 -4
  76. package/src/engines/Cesium/Sketch/SurfaceAddingPoints.tsx +60 -0
  77. package/src/engines/Cesium/Sketch/SurfaceControlPoints.tsx +126 -35
  78. package/src/engines/Cesium/Sketch/constants.ts +5 -0
  79. package/src/engines/Cesium/Sketch/index.tsx +68 -29
  80. package/src/engines/Cesium/SpatialId/CoordinateIndicator.tsx +28 -0
  81. package/src/engines/Cesium/SpatialId/SpatialIdSpace.tsx +33 -0
  82. package/src/engines/Cesium/SpatialId/VerticalSpaceIndicator.tsx +32 -0
  83. package/src/engines/Cesium/SpatialId/index.ts +3 -0
  84. package/src/engines/Cesium/common.ts +55 -18
  85. package/src/engines/Cesium/core/Clock.tsx +1 -1
  86. package/src/engines/Cesium/core/Globe/index.tsx +73 -0
  87. package/src/engines/Cesium/core/Globe/useTerrainProviderPromise.ts +79 -0
  88. package/src/engines/Cesium/core/Imagery.test.ts +29 -11
  89. package/src/engines/Cesium/core/Imagery.tsx +22 -6
  90. package/src/engines/Cesium/core/Indicator/Indicator.tsx +2 -2
  91. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +13 -6
  92. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryLayer.tsx +2 -1
  93. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryProvider.ts +3 -4
  94. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +14 -2
  95. package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/helpers.ts +1 -1
  96. package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +10 -1
  97. package/src/engines/Cesium/core/presets.ts +24 -28
  98. package/src/engines/Cesium/helpers/getGeometryFromEntity.ts +55 -0
  99. package/src/engines/Cesium/hooks/useCamera.ts +2 -2
  100. package/src/engines/Cesium/hooks/useCameraLimiter.ts +1 -1
  101. package/src/engines/Cesium/hooks/useEngineRef.ts +52 -5
  102. package/src/engines/Cesium/hooks/useExplicitRender.ts +2 -2
  103. package/src/engines/Cesium/hooks/useInstance.ts +1 -1
  104. package/src/engines/Cesium/hooks/useLayerDragDrop.ts +3 -3
  105. package/src/engines/Cesium/hooks/useLayerSelectWithRect.ts +2 -2
  106. package/src/engines/Cesium/hooks/useOverrideGlobeShader/useOverrideGlobeShader.ts +115 -67
  107. package/src/engines/Cesium/hooks/useViewerProperty.ts +1 -1
  108. package/src/engines/Cesium/hooks.ts +55 -14
  109. package/src/engines/Cesium/index.stories.tsx +0 -1
  110. package/src/engines/Cesium/index.tsx +20 -6
  111. package/src/engines/Cesium/pickMany.ts +2 -0
  112. package/src/engines/Cesium/types.ts +1 -1
  113. package/src/engines/Cesium/utils/mouse.ts +1 -1
  114. package/src/engines/Cesium/utils/utils.ts +1 -1
  115. package/src/mantle/atoms/compute.test.ts +4 -4
  116. package/src/mantle/atoms/compute.ts +8 -4
  117. package/src/mantle/compat/forward.ts +1 -1
  118. package/src/mantle/data/geojson.ts +53 -22
  119. package/src/mantle/data/georss.ts +2 -2
  120. package/src/mantle/data/gml.ts +2 -2
  121. package/src/mantle/data/gpx.ts +2 -2
  122. package/src/mantle/data/shapefile/parseZip.ts +1 -0
  123. package/src/mantle/evaluator/simple/expression/expression.test.ts +72 -0
  124. package/src/mantle/evaluator/simple/expression/node.ts +10 -12
  125. package/src/mantle/types/appearance.ts +4 -2
  126. package/src/mantle/types/index.ts +3 -0
  127. package/src/{Visualizer → shared}/interactionMode.ts +3 -2
  128. package/src/test/setup.ts +1 -1
  129. package/src/test/utils.tsx +1 -1
  130. package/src/types/modules.d.ts +96 -0
  131. package/src/utils/StringMatcher.ts +1 -1
  132. package/src/utils/image.ts +2 -12
  133. package/src/utils/use-delayed-count.ts +1 -1
  134. package/src/utils/use-dnd/drop.ts +1 -1
  135. package/src/utils/util.ts +1 -1
  136. package/src/utils/value.ts +2 -2
  137. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +0 -1
  138. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +0 -1
  139. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +0 -1
  140. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +0 -1
  141. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +0 -1
  142. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +0 -1
  143. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +0 -1
  144. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +0 -1
  145. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +0 -1
  146. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +0 -1
  147. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +0 -1
  148. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +0 -1
  149. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +0 -1
  150. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +0 -1
  151. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +0 -1
  152. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +0 -1
  153. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +0 -1
  154. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +0 -1
  155. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +0 -1
  156. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +0 -1
  157. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +0 -1
  158. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +0 -1
  159. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +0 -1
  160. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +0 -1
  161. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +0 -1
  162. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +0 -1
  163. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +0 -1
  164. package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +0 -1
  165. package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
  166. package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
  167. package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
  168. package/dist/cesium/Assets/Images/ion-credit.png +0 -0
  169. package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
  170. package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
  171. package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
  172. package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
  173. package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
  174. package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
  175. package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
  176. package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
  177. package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
  178. package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
  179. package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
  180. package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
  181. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
  182. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
  183. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
  184. package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
  185. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
  186. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
  187. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
  188. package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
  189. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
  190. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
  191. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
  192. package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
  193. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
  194. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
  195. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
  196. package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
  197. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
  198. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
  199. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
  200. package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
  201. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
  202. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
  203. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
  204. package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
  205. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
  206. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
  207. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
  208. package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
  209. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
  210. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
  211. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
  212. package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
  213. package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +0 -14
  214. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
  215. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
  216. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
  217. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
  218. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
  219. package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
  220. package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
  221. package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
  222. package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
  223. package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
  224. package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
  225. package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
  226. package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
  227. package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
  228. package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
  229. package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
  230. package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
  231. package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
  232. package/dist/cesium/Assets/Textures/maki/building.png +0 -0
  233. package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
  234. package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
  235. package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
  236. package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
  237. package/dist/cesium/Assets/Textures/maki/car.png +0 -0
  238. package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
  239. package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
  240. package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
  241. package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
  242. package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
  243. package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
  244. package/dist/cesium/Assets/Textures/maki/city.png +0 -0
  245. package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
  246. package/dist/cesium/Assets/Textures/maki/college.png +0 -0
  247. package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
  248. package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
  249. package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
  250. package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
  251. package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
  252. package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
  253. package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
  254. package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
  255. package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
  256. package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
  257. package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
  258. package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
  259. package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
  260. package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
  261. package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
  262. package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
  263. package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
  264. package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
  265. package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
  266. package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
  267. package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
  268. package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
  269. package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
  270. package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
  271. package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
  272. package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
  273. package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
  274. package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
  275. package/dist/cesium/Assets/Textures/maki/library.png +0 -0
  276. package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
  277. package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
  278. package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
  279. package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
  280. package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
  281. package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
  282. package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
  283. package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
  284. package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
  285. package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
  286. package/dist/cesium/Assets/Textures/maki/music.png +0 -0
  287. package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
  288. package/dist/cesium/Assets/Textures/maki/park.png +0 -0
  289. package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
  290. package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
  291. package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
  292. package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
  293. package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
  294. package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
  295. package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
  296. package/dist/cesium/Assets/Textures/maki/police.png +0 -0
  297. package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
  298. package/dist/cesium/Assets/Textures/maki/post.png +0 -0
  299. package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
  300. package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
  301. package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
  302. package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
  303. package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
  304. package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
  305. package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
  306. package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
  307. package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
  308. package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
  309. package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
  310. package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
  311. package/dist/cesium/Assets/Textures/maki/school.png +0 -0
  312. package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
  313. package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
  314. package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
  315. package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
  316. package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
  317. package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
  318. package/dist/cesium/Assets/Textures/maki/square.png +0 -0
  319. package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
  320. package/dist/cesium/Assets/Textures/maki/star.png +0 -0
  321. package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
  322. package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
  323. package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
  324. package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
  325. package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
  326. package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
  327. package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
  328. package/dist/cesium/Assets/Textures/maki/town.png +0 -0
  329. package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
  330. package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
  331. package/dist/cesium/Assets/Textures/maki/village.png +0 -0
  332. package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
  333. package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
  334. package/dist/cesium/Assets/Textures/maki/water.png +0 -0
  335. package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
  336. package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
  337. package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
  338. package/dist/cesium/Assets/Textures/pin.svg +0 -1
  339. package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
  340. package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
  341. package/dist/cesium/Assets/approximateTerrainHeights.json +0 -1
  342. package/dist/cesium/ThirdParty/Workers/package.json +0 -1
  343. package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +0 -1
  344. package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +0 -1
  345. package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +0 -1
  346. package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
  347. package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
  348. package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +0 -1
  349. package/dist/cesium/Widgets/Animation/Animation.css +0 -127
  350. package/dist/cesium/Widgets/Animation/lighter.css +0 -70
  351. package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +0 -108
  352. package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +0 -22
  353. package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +0 -102
  354. package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +0 -113
  355. package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +0 -124
  356. package/dist/cesium/Widgets/CesiumWidget/lighter.css +0 -14
  357. package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +0 -8
  358. package/dist/cesium/Widgets/Geocoder/Geocoder.css +0 -70
  359. package/dist/cesium/Widgets/Geocoder/lighter.css +0 -17
  360. package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +0 -27
  361. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
  362. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
  363. package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
  364. package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
  365. package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
  366. package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
  367. package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
  368. package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
  369. package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
  370. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
  371. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
  372. package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
  373. package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
  374. package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
  375. package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
  376. package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
  377. package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
  378. package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
  379. package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
  380. package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +0 -84
  381. package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +0 -76
  382. package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +0 -76
  383. package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +0 -76
  384. package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +0 -120
  385. package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +0 -129
  386. package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +0 -76
  387. package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +0 -135
  388. package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +0 -74
  389. package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
  390. package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
  391. package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
  392. package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
  393. package/dist/cesium/Widgets/InfoBox/InfoBox.css +0 -92
  394. package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +0 -178
  395. package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +0 -93
  396. package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +0 -38
  397. package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +0 -15
  398. package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +0 -38
  399. package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +0 -56
  400. package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +0 -20
  401. package/dist/cesium/Widgets/Timeline/Timeline.css +0 -103
  402. package/dist/cesium/Widgets/Timeline/lighter.css +0 -23
  403. package/dist/cesium/Widgets/VRButton/VRButton.css +0 -8
  404. package/dist/cesium/Widgets/Viewer/Viewer.css +0 -107
  405. package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +0 -16
  406. package/dist/cesium/Widgets/lighter.css +0 -237
  407. package/dist/cesium/Widgets/lighterShared.css +0 -46
  408. package/dist/cesium/Widgets/shared.css +0 -103
  409. package/dist/cesium/Widgets/widgets.css +0 -1346
  410. package/dist/cesium/Workers/chunk-2YD5QWGR.js +0 -28
  411. package/dist/cesium/Workers/chunk-3T4KR75X.js +0 -26
  412. package/dist/cesium/Workers/chunk-46KFVW24.js +0 -26
  413. package/dist/cesium/Workers/chunk-4EI6PP43.js +0 -28
  414. package/dist/cesium/Workers/chunk-4RS52VIY.js +0 -26
  415. package/dist/cesium/Workers/chunk-4YLYA3DC.js +0 -26
  416. package/dist/cesium/Workers/chunk-5ENAGXBI.js +0 -26
  417. package/dist/cesium/Workers/chunk-5VIB3TI5.js +0 -26
  418. package/dist/cesium/Workers/chunk-6NGZLDFZ.js +0 -26
  419. package/dist/cesium/Workers/chunk-6RGNWVZ2.js +0 -27
  420. package/dist/cesium/Workers/chunk-7AZZVJ52.js +0 -26
  421. package/dist/cesium/Workers/chunk-AMXAQQEL.js +0 -26
  422. package/dist/cesium/Workers/chunk-AQW44ZPC.js +0 -26
  423. package/dist/cesium/Workers/chunk-CPCMDW6Z.js +0 -26
  424. package/dist/cesium/Workers/chunk-DNL2WDRL.js +0 -26
  425. package/dist/cesium/Workers/chunk-ERW7V247.js +0 -26
  426. package/dist/cesium/Workers/chunk-EYRIA4TP.js +0 -26
  427. package/dist/cesium/Workers/chunk-F7RQIJML.js +0 -26
  428. package/dist/cesium/Workers/chunk-FPZMU6QP.js +0 -26
  429. package/dist/cesium/Workers/chunk-FZDVQW7A.js +0 -26
  430. package/dist/cesium/Workers/chunk-GAZ2U4FO.js +0 -26
  431. package/dist/cesium/Workers/chunk-I44IOOT4.js +0 -26
  432. package/dist/cesium/Workers/chunk-IALXUAD4.js +0 -26
  433. package/dist/cesium/Workers/chunk-IXBUEUZL.js +0 -26
  434. package/dist/cesium/Workers/chunk-J3GCYV5K.js +0 -26
  435. package/dist/cesium/Workers/chunk-KGSZTFHZ.js +0 -26
  436. package/dist/cesium/Workers/chunk-KKKPU2CI.js +0 -26
  437. package/dist/cesium/Workers/chunk-KTEJE5KE.js +0 -26
  438. package/dist/cesium/Workers/chunk-KYZ3DYY6.js +0 -26
  439. package/dist/cesium/Workers/chunk-L2QG4MRI.js +0 -26
  440. package/dist/cesium/Workers/chunk-MCE3KFYN.js +0 -26
  441. package/dist/cesium/Workers/chunk-MMLDGXML.js +0 -26
  442. package/dist/cesium/Workers/chunk-MTBRPBDQ.js +0 -26
  443. package/dist/cesium/Workers/chunk-OKT6VBRK.js +0 -26
  444. package/dist/cesium/Workers/chunk-PHYDKLSY.js +0 -26
  445. package/dist/cesium/Workers/chunk-PWPX3224.js +0 -26
  446. package/dist/cesium/Workers/chunk-QHOVE6WG.js +0 -26
  447. package/dist/cesium/Workers/chunk-QJ6MBL22.js +0 -26
  448. package/dist/cesium/Workers/chunk-QKO6VIG2.js +0 -26
  449. package/dist/cesium/Workers/chunk-QVEE4QL2.js +0 -26
  450. package/dist/cesium/Workers/chunk-RXQOQZ7S.js +0 -26
  451. package/dist/cesium/Workers/chunk-S3ZKQKMM.js +0 -26
  452. package/dist/cesium/Workers/chunk-SFEUMZSK.js +0 -26
  453. package/dist/cesium/Workers/chunk-T75MW4X3.js +0 -26
  454. package/dist/cesium/Workers/chunk-TVO2A75R.js +0 -66
  455. package/dist/cesium/Workers/chunk-UHR36K45.js +0 -27
  456. package/dist/cesium/Workers/chunk-UKJCDZOR.js +0 -26
  457. package/dist/cesium/Workers/chunk-VKVIYER6.js +0 -26
  458. package/dist/cesium/Workers/chunk-VPIQWTRZ.js +0 -26
  459. package/dist/cesium/Workers/chunk-XSX5HRFC.js +0 -26
  460. package/dist/cesium/Workers/chunk-Z5WQQHSL.js +0 -26
  461. package/dist/cesium/Workers/chunk-Z7B2VEL5.js +0 -26
  462. package/dist/cesium/Workers/combineGeometry.js +0 -26
  463. package/dist/cesium/Workers/createBoxGeometry.js +0 -26
  464. package/dist/cesium/Workers/createBoxOutlineGeometry.js +0 -26
  465. package/dist/cesium/Workers/createCircleGeometry.js +0 -26
  466. package/dist/cesium/Workers/createCircleOutlineGeometry.js +0 -26
  467. package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +0 -26
  468. package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +0 -26
  469. package/dist/cesium/Workers/createCorridorGeometry.js +0 -26
  470. package/dist/cesium/Workers/createCorridorOutlineGeometry.js +0 -26
  471. package/dist/cesium/Workers/createCylinderGeometry.js +0 -26
  472. package/dist/cesium/Workers/createCylinderOutlineGeometry.js +0 -26
  473. package/dist/cesium/Workers/createEllipseGeometry.js +0 -26
  474. package/dist/cesium/Workers/createEllipseOutlineGeometry.js +0 -26
  475. package/dist/cesium/Workers/createEllipsoidGeometry.js +0 -26
  476. package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +0 -26
  477. package/dist/cesium/Workers/createFrustumGeometry.js +0 -26
  478. package/dist/cesium/Workers/createFrustumOutlineGeometry.js +0 -26
  479. package/dist/cesium/Workers/createGeometry.js +0 -26
  480. package/dist/cesium/Workers/createGroundPolylineGeometry.js +0 -26
  481. package/dist/cesium/Workers/createPlaneGeometry.js +0 -26
  482. package/dist/cesium/Workers/createPlaneOutlineGeometry.js +0 -26
  483. package/dist/cesium/Workers/createPolygonGeometry.js +0 -26
  484. package/dist/cesium/Workers/createPolygonOutlineGeometry.js +0 -26
  485. package/dist/cesium/Workers/createPolylineGeometry.js +0 -26
  486. package/dist/cesium/Workers/createPolylineVolumeGeometry.js +0 -26
  487. package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +0 -26
  488. package/dist/cesium/Workers/createRectangleGeometry.js +0 -26
  489. package/dist/cesium/Workers/createRectangleOutlineGeometry.js +0 -26
  490. package/dist/cesium/Workers/createSimplePolylineGeometry.js +0 -26
  491. package/dist/cesium/Workers/createSphereGeometry.js +0 -26
  492. package/dist/cesium/Workers/createSphereOutlineGeometry.js +0 -26
  493. package/dist/cesium/Workers/createTaskProcessorWorker.js +0 -26
  494. package/dist/cesium/Workers/createVectorTileClampedPolylines.js +0 -26
  495. package/dist/cesium/Workers/createVectorTileGeometries.js +0 -26
  496. package/dist/cesium/Workers/createVectorTilePoints.js +0 -26
  497. package/dist/cesium/Workers/createVectorTilePolygons.js +0 -26
  498. package/dist/cesium/Workers/createVectorTilePolylines.js +0 -26
  499. package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -26
  500. package/dist/cesium/Workers/createVerticesFromHeightmap.js +0 -26
  501. package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -26
  502. package/dist/cesium/Workers/createWallGeometry.js +0 -26
  503. package/dist/cesium/Workers/createWallOutlineGeometry.js +0 -26
  504. package/dist/cesium/Workers/decodeDraco.js +0 -26
  505. package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +0 -26
  506. package/dist/cesium/Workers/decodeI3S.js +0 -26
  507. package/dist/cesium/Workers/transcodeKTX2.js +0 -56
  508. package/dist/cesium/Workers/transferTypedArrayTest.js +0 -26
  509. package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +0 -26
  510. package/src/engines/Cesium/core/Globe.tsx +0 -104
  511. /package/src/{Visualizer → shared}/featureFlags.ts +0 -0
  512. /package/src/{Map/Sketch/utils.ts → utils/use-window-event.ts} +0 -0
@@ -1,21 +1,20 @@
1
- window.CESIUM_BASE_URL = "/cesium/";
2
- var oe = typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {}, P = [], M = [], Qt = typeof Uint8Array < "u" ? Uint8Array : Array, je = !1;
3
- function at() {
1
+ var ie = typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {}, P = [], F = [], Qt = typeof Uint8Array < "u" ? Uint8Array : Array, je = !1;
2
+ function lt() {
4
3
  je = !0;
5
4
  for (var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = 0, r = t.length; e < r; ++e)
6
- P[e] = t[e], M[t.charCodeAt(e)] = e;
7
- M[45] = 62, M[95] = 63;
5
+ P[e] = t[e], F[t.charCodeAt(e)] = e;
6
+ F[45] = 62, F[95] = 63;
8
7
  }
9
8
  function Ht(t) {
10
- je || at();
9
+ je || lt();
11
10
  var e, r, n, i, o, s, f = t.length;
12
11
  if (f % 4 > 0)
13
12
  throw new Error("Invalid string. Length must be a multiple of 4");
14
13
  o = t[f - 2] === "=" ? 2 : t[f - 1] === "=" ? 1 : 0, s = new Qt(f * 3 / 4 - o), n = o > 0 ? f - 4 : f;
15
14
  var l = 0;
16
15
  for (e = 0, r = 0; e < n; e += 4, r += 3)
17
- i = M[t.charCodeAt(e)] << 18 | M[t.charCodeAt(e + 1)] << 12 | M[t.charCodeAt(e + 2)] << 6 | M[t.charCodeAt(e + 3)], s[l++] = i >> 16 & 255, s[l++] = i >> 8 & 255, s[l++] = i & 255;
18
- return o === 2 ? (i = M[t.charCodeAt(e)] << 2 | M[t.charCodeAt(e + 1)] >> 4, s[l++] = i & 255) : o === 1 && (i = M[t.charCodeAt(e)] << 10 | M[t.charCodeAt(e + 1)] << 4 | M[t.charCodeAt(e + 2)] >> 2, s[l++] = i >> 8 & 255, s[l++] = i & 255), s;
16
+ i = F[t.charCodeAt(e)] << 18 | F[t.charCodeAt(e + 1)] << 12 | F[t.charCodeAt(e + 2)] << 6 | F[t.charCodeAt(e + 3)], s[l++] = i >> 16 & 255, s[l++] = i >> 8 & 255, s[l++] = i & 255;
17
+ return o === 2 ? (i = F[t.charCodeAt(e)] << 2 | F[t.charCodeAt(e + 1)] >> 4, s[l++] = i & 255) : o === 1 && (i = F[t.charCodeAt(e)] << 10 | F[t.charCodeAt(e + 1)] << 4 | F[t.charCodeAt(e + 2)] >> 2, s[l++] = i >> 8 & 255, s[l++] = i & 255), s;
19
18
  }
20
19
  function Gt(t) {
21
20
  return P[t >> 18 & 63] + P[t >> 12 & 63] + P[t >> 6 & 63] + P[t & 63];
@@ -25,13 +24,13 @@ function Zt(t, e, r) {
25
24
  n = (t[o] << 16) + (t[o + 1] << 8) + t[o + 2], i.push(Gt(n));
26
25
  return i.join("");
27
26
  }
28
- function Qe(t) {
29
- je || at();
27
+ function He(t) {
28
+ je || lt();
30
29
  for (var e, r = t.length, n = r % 3, i = "", o = [], s = 16383, f = 0, l = r - n; f < l; f += s)
31
30
  o.push(Zt(t, f, f + s > l ? l : f + s));
32
31
  return n === 1 ? (e = t[r - 1], i += P[e >> 2], i += P[e << 4 & 63], i += "==") : n === 2 && (e = (t[r - 2] << 8) + t[r - 1], i += P[e >> 10], i += P[e >> 4 & 63], i += P[e << 2 & 63], i += "="), o.push(i), o.join("");
33
32
  }
34
- function be(t, e, r, n, i) {
33
+ function ve(t, e, r, n, i) {
35
34
  var o, s, f = i * 8 - n - 1, l = (1 << f) - 1, u = l >> 1, h = -7, c = r ? i - 1 : 0, g = r ? -1 : 1, v = t[e + c];
36
35
  for (c += g, o = v & (1 << -h) - 1, v >>= -h, h += f; h > 0; o = o * 256 + t[e + c], c += g, h -= 8)
37
36
  ;
@@ -46,7 +45,7 @@ function be(t, e, r, n, i) {
46
45
  }
47
46
  return (v ? -1 : 1) * s * Math.pow(2, o - n);
48
47
  }
49
- function lt(t, e, r, n, i, o) {
48
+ function ut(t, e, r, n, i, o) {
50
49
  var s, f, l, u = o * 8 - i - 1, h = (1 << u) - 1, c = h >> 1, g = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, v = n ? 0 : o - 1, A = n ? 1 : -1, x = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
51
50
  for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (f = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -s)) < 1 && (s--, l *= 2), s + c >= 1 ? e += g / l : e += g * Math.pow(2, 1 - c), e * l >= 2 && (s++, l /= 2), s + c >= h ? (f = 0, s = h) : s + c >= 1 ? (f = (e * l - 1) * Math.pow(2, i), s = s + c) : (f = e * Math.pow(2, c - 1) * Math.pow(2, i), s = 0)); i >= 8; t[r + v] = f & 255, v += A, f /= 256, i -= 8)
52
51
  ;
@@ -54,16 +53,16 @@ function lt(t, e, r, n, i, o) {
54
53
  ;
55
54
  t[r + v - A] |= x * 128;
56
55
  }
57
- var Xt = {}.toString, ut = Array.isArray || function(t) {
56
+ var Xt = {}.toString, ht = Array.isArray || function(t) {
58
57
  return Xt.call(t) == "[object Array]";
59
58
  }, Kt = 50;
60
- a.TYPED_ARRAY_SUPPORT = oe.TYPED_ARRAY_SUPPORT !== void 0 ? oe.TYPED_ARRAY_SUPPORT : !0;
61
- we();
62
- function we() {
59
+ a.TYPED_ARRAY_SUPPORT = ie.TYPED_ARRAY_SUPPORT !== void 0 ? ie.TYPED_ARRAY_SUPPORT : !0;
60
+ _e();
61
+ function _e() {
63
62
  return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
64
63
  }
65
- function $(t, e) {
66
- if (we() < e)
64
+ function q(t, e) {
65
+ if (_e() < e)
67
66
  throw new RangeError("Invalid typed array length");
68
67
  return a.TYPED_ARRAY_SUPPORT ? (t = new Uint8Array(e), t.__proto__ = a.prototype) : (t === null && (t = new a(e)), t.length = e), t;
69
68
  }
@@ -77,35 +76,35 @@ function a(t, e, r) {
77
76
  );
78
77
  return $e(this, t);
79
78
  }
80
- return ht(this, t, e, r);
79
+ return ct(this, t, e, r);
81
80
  }
82
81
  a.poolSize = 8192;
83
82
  a._augment = function(t) {
84
83
  return t.__proto__ = a.prototype, t;
85
84
  };
86
- function ht(t, e, r, n) {
85
+ function ct(t, e, r, n) {
87
86
  if (typeof e == "number")
88
87
  throw new TypeError('"value" argument must not be a number');
89
88
  return typeof ArrayBuffer < "u" && e instanceof ArrayBuffer ? rr(t, e, r, n) : typeof e == "string" ? tr(t, e, r) : nr(t, e);
90
89
  }
91
90
  a.from = function(t, e, r) {
92
- return ht(null, t, e, r);
91
+ return ct(null, t, e, r);
93
92
  };
94
93
  a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype, a.__proto__ = Uint8Array, typeof Symbol < "u" && Symbol.species && a[Symbol.species]);
95
- function ct(t) {
94
+ function dt(t) {
96
95
  if (typeof t != "number")
97
96
  throw new TypeError('"size" argument must be a number');
98
97
  if (t < 0)
99
98
  throw new RangeError('"size" argument must not be negative');
100
99
  }
101
100
  function er(t, e, r, n) {
102
- return ct(e), e <= 0 ? $(t, e) : r !== void 0 ? typeof n == "string" ? $(t, e).fill(r, n) : $(t, e).fill(r) : $(t, e);
101
+ return dt(e), e <= 0 ? q(t, e) : r !== void 0 ? typeof n == "string" ? q(t, e).fill(r, n) : q(t, e).fill(r) : q(t, e);
103
102
  }
104
103
  a.alloc = function(t, e, r) {
105
104
  return er(null, t, e, r);
106
105
  };
107
106
  function $e(t, e) {
108
- if (ct(e), t = $(t, e < 0 ? 0 : qe(e) | 0), !a.TYPED_ARRAY_SUPPORT)
107
+ if (dt(e), t = q(t, e < 0 ? 0 : qe(e) | 0), !a.TYPED_ARRAY_SUPPORT)
109
108
  for (var r = 0; r < e; ++r)
110
109
  t[r] = 0;
111
110
  return t;
@@ -119,14 +118,14 @@ a.allocUnsafeSlow = function(t) {
119
118
  function tr(t, e, r) {
120
119
  if ((typeof r != "string" || r === "") && (r = "utf8"), !a.isEncoding(r))
121
120
  throw new TypeError('"encoding" must be a valid string encoding');
122
- var n = dt(e, r) | 0;
123
- t = $(t, n);
121
+ var n = pt(e, r) | 0;
122
+ t = q(t, n);
124
123
  var i = t.write(e, r);
125
124
  return i !== n && (t = t.slice(0, i)), t;
126
125
  }
127
126
  function Be(t, e) {
128
127
  var r = e.length < 0 ? 0 : qe(e.length) | 0;
129
- t = $(t, r);
128
+ t = q(t, r);
130
129
  for (var n = 0; n < r; n += 1)
131
130
  t[n] = e[n] & 255;
132
131
  return t;
@@ -141,30 +140,29 @@ function rr(t, e, r, n) {
141
140
  function nr(t, e) {
142
141
  if (j(e)) {
143
142
  var r = qe(e.length) | 0;
144
- return t = $(t, r), t.length === 0 || e.copy(t, 0, 0, r), t;
143
+ return t = q(t, r), t.length === 0 || e.copy(t, 0, 0, r), t;
145
144
  }
146
145
  if (e) {
147
146
  if (typeof ArrayBuffer < "u" && e.buffer instanceof ArrayBuffer || "length" in e)
148
- return typeof e.length != "number" || xr(e.length) ? $(t, 0) : Be(t, e);
149
- if (e.type === "Buffer" && ut(e.data))
147
+ return typeof e.length != "number" || xr(e.length) ? q(t, 0) : Be(t, e);
148
+ if (e.type === "Buffer" && ht(e.data))
150
149
  return Be(t, e.data);
151
150
  }
152
151
  throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
153
152
  }
154
153
  function qe(t) {
155
- if (t >= we())
156
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + we().toString(16) + " bytes");
154
+ if (t >= _e())
155
+ throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + _e().toString(16) + " bytes");
157
156
  return t | 0;
158
157
  }
159
- a.isBuffer = T;
158
+ a.isBuffer = L;
160
159
  function j(t) {
161
160
  return !!(t != null && t._isBuffer);
162
161
  }
163
162
  a.compare = function(e, r) {
164
163
  if (!j(e) || !j(r))
165
164
  throw new TypeError("Arguments must be Buffers");
166
- if (e === r)
167
- return 0;
165
+ if (e === r) return 0;
168
166
  for (var n = e.length, i = r.length, o = 0, s = Math.min(n, i); o < s; ++o)
169
167
  if (e[o] !== r[o]) {
170
168
  n = e[o], i = r[o];
@@ -191,7 +189,7 @@ a.isEncoding = function(e) {
191
189
  }
192
190
  };
193
191
  a.concat = function(e, r) {
194
- if (!ut(e))
192
+ if (!ht(e))
195
193
  throw new TypeError('"list" argument must be an Array of Buffers');
196
194
  if (e.length === 0)
197
195
  return a.alloc(0);
@@ -208,15 +206,14 @@ a.concat = function(e, r) {
208
206
  }
209
207
  return i;
210
208
  };
211
- function dt(t, e) {
209
+ function pt(t, e) {
212
210
  if (j(t))
213
211
  return t.length;
214
212
  if (typeof ArrayBuffer < "u" && typeof ArrayBuffer.isView == "function" && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer))
215
213
  return t.byteLength;
216
214
  typeof t != "string" && (t = "" + t);
217
215
  var r = t.length;
218
- if (r === 0)
219
- return 0;
216
+ if (r === 0) return 0;
220
217
  for (var n = !1; ; )
221
218
  switch (e) {
222
219
  case "ascii":
@@ -226,7 +223,7 @@ function dt(t, e) {
226
223
  case "utf8":
227
224
  case "utf-8":
228
225
  case void 0:
229
- return ye(t).length;
226
+ return we(t).length;
230
227
  case "ucs2":
231
228
  case "ucs-2":
232
229
  case "utf16le":
@@ -235,14 +232,13 @@ function dt(t, e) {
235
232
  case "hex":
236
233
  return r >>> 1;
237
234
  case "base64":
238
- return vt(t).length;
235
+ return bt(t).length;
239
236
  default:
240
- if (n)
241
- return ye(t).length;
237
+ if (n) return we(t).length;
242
238
  e = ("" + e).toLowerCase(), n = !0;
243
239
  }
244
240
  }
245
- a.byteLength = dt;
241
+ a.byteLength = pt;
246
242
  function ir(t, e, r) {
247
243
  var n = !1;
248
244
  if ((e === void 0 || e < 0) && (e = 0), e > this.length || ((r === void 0 || r > this.length) && (r = this.length), r <= 0) || (r >>>= 0, e >>>= 0, r <= e))
@@ -253,7 +249,7 @@ function ir(t, e, r) {
253
249
  return pr(this, e, r);
254
250
  case "utf8":
255
251
  case "utf-8":
256
- return gt(this, e, r);
252
+ return _t(this, e, r);
257
253
  case "ascii":
258
254
  return cr(this, e, r);
259
255
  case "latin1":
@@ -267,13 +263,12 @@ function ir(t, e, r) {
267
263
  case "utf-16le":
268
264
  return mr(this, e, r);
269
265
  default:
270
- if (n)
271
- throw new TypeError("Unknown encoding: " + t);
266
+ if (n) throw new TypeError("Unknown encoding: " + t);
272
267
  t = (t + "").toLowerCase(), n = !0;
273
268
  }
274
269
  }
275
270
  a.prototype._isBuffer = !0;
276
- function X(t, e, r) {
271
+ function K(t, e, r) {
277
272
  var n = t[e];
278
273
  t[e] = t[r], t[r] = n;
279
274
  }
@@ -282,7 +277,7 @@ a.prototype.swap16 = function() {
282
277
  if (e % 2 !== 0)
283
278
  throw new RangeError("Buffer size must be a multiple of 16-bits");
284
279
  for (var r = 0; r < e; r += 2)
285
- X(this, r, r + 1);
280
+ K(this, r, r + 1);
286
281
  return this;
287
282
  };
288
283
  a.prototype.swap32 = function() {
@@ -290,7 +285,7 @@ a.prototype.swap32 = function() {
290
285
  if (e % 4 !== 0)
291
286
  throw new RangeError("Buffer size must be a multiple of 32-bits");
292
287
  for (var r = 0; r < e; r += 4)
293
- X(this, r, r + 3), X(this, r + 1, r + 2);
288
+ K(this, r, r + 3), K(this, r + 1, r + 2);
294
289
  return this;
295
290
  };
296
291
  a.prototype.swap64 = function() {
@@ -298,16 +293,15 @@ a.prototype.swap64 = function() {
298
293
  if (e % 8 !== 0)
299
294
  throw new RangeError("Buffer size must be a multiple of 64-bits");
300
295
  for (var r = 0; r < e; r += 8)
301
- X(this, r, r + 7), X(this, r + 1, r + 6), X(this, r + 2, r + 5), X(this, r + 3, r + 4);
296
+ K(this, r, r + 7), K(this, r + 1, r + 6), K(this, r + 2, r + 5), K(this, r + 3, r + 4);
302
297
  return this;
303
298
  };
304
299
  a.prototype.toString = function() {
305
300
  var e = this.length | 0;
306
- return e === 0 ? "" : arguments.length === 0 ? gt(this, 0, e) : ir.apply(this, arguments);
301
+ return e === 0 ? "" : arguments.length === 0 ? _t(this, 0, e) : ir.apply(this, arguments);
307
302
  };
308
303
  a.prototype.equals = function(e) {
309
- if (!j(e))
310
- throw new TypeError("Argument must be a Buffer");
304
+ if (!j(e)) throw new TypeError("Argument must be a Buffer");
311
305
  return this === e ? !0 : a.compare(this, e) === 0;
312
306
  };
313
307
  a.prototype.inspect = function() {
@@ -325,8 +319,7 @@ a.prototype.compare = function(e, r, n, i, o) {
325
319
  return -1;
326
320
  if (r >= n)
327
321
  return 1;
328
- if (r >>>= 0, n >>>= 0, i >>>= 0, o >>>= 0, this === e)
329
- return 0;
322
+ if (r >>>= 0, n >>>= 0, i >>>= 0, o >>>= 0, this === e) return 0;
330
323
  for (var s = o - i, f = n - r, l = Math.min(s, f), u = this.slice(i, o), h = e.slice(r, n), c = 0; c < l; ++c)
331
324
  if (u[c] !== h[c]) {
332
325
  s = u[c], f = h[c];
@@ -334,25 +327,21 @@ a.prototype.compare = function(e, r, n, i, o) {
334
327
  }
335
328
  return s < f ? -1 : f < s ? 1 : 0;
336
329
  };
337
- function pt(t, e, r, n, i) {
338
- if (t.length === 0)
339
- return -1;
330
+ function mt(t, e, r, n, i) {
331
+ if (t.length === 0) return -1;
340
332
  if (typeof r == "string" ? (n = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, isNaN(r) && (r = i ? 0 : t.length - 1), r < 0 && (r = t.length + r), r >= t.length) {
341
- if (i)
342
- return -1;
333
+ if (i) return -1;
343
334
  r = t.length - 1;
344
335
  } else if (r < 0)
345
- if (i)
346
- r = 0;
347
- else
348
- return -1;
336
+ if (i) r = 0;
337
+ else return -1;
349
338
  if (typeof e == "string" && (e = a.from(e, n)), j(e))
350
- return e.length === 0 ? -1 : He(t, e, r, n, i);
339
+ return e.length === 0 ? -1 : Ge(t, e, r, n, i);
351
340
  if (typeof e == "number")
352
- return e = e & 255, a.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf == "function" ? i ? Uint8Array.prototype.indexOf.call(t, e, r) : Uint8Array.prototype.lastIndexOf.call(t, e, r) : He(t, [e], r, n, i);
341
+ return e = e & 255, a.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf == "function" ? i ? Uint8Array.prototype.indexOf.call(t, e, r) : Uint8Array.prototype.lastIndexOf.call(t, e, r) : Ge(t, [e], r, n, i);
353
342
  throw new TypeError("val must be string, number or Buffer");
354
343
  }
355
- function He(t, e, r, n, i) {
344
+ function Ge(t, e, r, n, i) {
356
345
  var o = 1, s = t.length, f = e.length;
357
346
  if (n !== void 0 && (n = String(n).toLowerCase(), n === "ucs2" || n === "ucs-2" || n === "utf16le" || n === "utf-16le")) {
358
347
  if (t.length < 2 || e.length < 2)
@@ -367,8 +356,7 @@ function He(t, e, r, n, i) {
367
356
  var h = -1;
368
357
  for (u = r; u < s; u++)
369
358
  if (l(t, u) === l(e, h === -1 ? 0 : u - h)) {
370
- if (h === -1 && (h = u), u - h + 1 === f)
371
- return h * o;
359
+ if (h === -1 && (h = u), u - h + 1 === f) return h * o;
372
360
  } else
373
361
  h !== -1 && (u -= u - h), h = -1;
374
362
  } else
@@ -378,8 +366,7 @@ function He(t, e, r, n, i) {
378
366
  c = !1;
379
367
  break;
380
368
  }
381
- if (c)
382
- return u;
369
+ if (c) return u;
383
370
  }
384
371
  return -1;
385
372
  }
@@ -387,41 +374,39 @@ a.prototype.includes = function(e, r, n) {
387
374
  return this.indexOf(e, r, n) !== -1;
388
375
  };
389
376
  a.prototype.indexOf = function(e, r, n) {
390
- return pt(this, e, r, n, !0);
377
+ return mt(this, e, r, n, !0);
391
378
  };
392
379
  a.prototype.lastIndexOf = function(e, r, n) {
393
- return pt(this, e, r, n, !1);
380
+ return mt(this, e, r, n, !1);
394
381
  };
395
382
  function or(t, e, r, n) {
396
383
  r = Number(r) || 0;
397
384
  var i = t.length - r;
398
385
  n ? (n = Number(n), n > i && (n = i)) : n = i;
399
386
  var o = e.length;
400
- if (o % 2 !== 0)
401
- throw new TypeError("Invalid hex string");
387
+ if (o % 2 !== 0) throw new TypeError("Invalid hex string");
402
388
  n > o / 2 && (n = o / 2);
403
389
  for (var s = 0; s < n; ++s) {
404
390
  var f = parseInt(e.substr(s * 2, 2), 16);
405
- if (isNaN(f))
406
- return s;
391
+ if (isNaN(f)) return s;
407
392
  t[r + s] = f;
408
393
  }
409
394
  return s;
410
395
  }
411
396
  function sr(t, e, r, n) {
412
- return Se(ye(e, t.length - r), t, r, n);
397
+ return Ee(we(e, t.length - r), t, r, n);
413
398
  }
414
- function mt(t, e, r, n) {
415
- return Se(vr(e), t, r, n);
399
+ function gt(t, e, r, n) {
400
+ return Ee(vr(e), t, r, n);
416
401
  }
417
402
  function fr(t, e, r, n) {
418
- return mt(t, e, r, n);
403
+ return gt(t, e, r, n);
419
404
  }
420
405
  function ar(t, e, r, n) {
421
- return Se(vt(e), t, r, n);
406
+ return Ee(bt(e), t, r, n);
422
407
  }
423
408
  function lr(t, e, r, n) {
424
- return Se(br(e, t.length - r), t, r, n);
409
+ return Ee(br(e, t.length - r), t, r, n);
425
410
  }
426
411
  a.prototype.write = function(e, r, n, i) {
427
412
  if (r === void 0)
@@ -446,7 +431,7 @@ a.prototype.write = function(e, r, n, i) {
446
431
  case "utf-8":
447
432
  return sr(this, e, r, n);
448
433
  case "ascii":
449
- return mt(this, e, r, n);
434
+ return gt(this, e, r, n);
450
435
  case "latin1":
451
436
  case "binary":
452
437
  return fr(this, e, r, n);
@@ -458,8 +443,7 @@ a.prototype.write = function(e, r, n, i) {
458
443
  case "utf-16le":
459
444
  return lr(this, e, r, n);
460
445
  default:
461
- if (s)
462
- throw new TypeError("Unknown encoding: " + i);
446
+ if (s) throw new TypeError("Unknown encoding: " + i);
463
447
  i = ("" + i).toLowerCase(), s = !0;
464
448
  }
465
449
  };
@@ -470,9 +454,9 @@ a.prototype.toJSON = function() {
470
454
  };
471
455
  };
472
456
  function ur(t, e, r) {
473
- return e === 0 && r === t.length ? Qe(t) : Qe(t.slice(e, r));
457
+ return e === 0 && r === t.length ? He(t) : He(t.slice(e, r));
474
458
  }
475
- function gt(t, e, r) {
459
+ function _t(t, e, r) {
476
460
  r = Math.min(t.length, r);
477
461
  for (var n = [], i = e; i < r; ) {
478
462
  var o = t[i], s = null, f = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
@@ -496,15 +480,15 @@ function gt(t, e, r) {
496
480
  }
497
481
  return hr(n);
498
482
  }
499
- var Ge = 4096;
483
+ var Ze = 4096;
500
484
  function hr(t) {
501
485
  var e = t.length;
502
- if (e <= Ge)
486
+ if (e <= Ze)
503
487
  return String.fromCharCode.apply(String, t);
504
488
  for (var r = "", n = 0; n < e; )
505
489
  r += String.fromCharCode.apply(
506
490
  String,
507
- t.slice(n, n += Ge)
491
+ t.slice(n, n += Ze)
508
492
  );
509
493
  return r;
510
494
  }
@@ -548,89 +532,84 @@ a.prototype.slice = function(e, r) {
548
532
  }
549
533
  return i;
550
534
  };
551
- function I(t, e, r) {
552
- if (t % 1 !== 0 || t < 0)
553
- throw new RangeError("offset is not uint");
554
- if (t + e > r)
555
- throw new RangeError("Trying to access beyond buffer length");
535
+ function O(t, e, r) {
536
+ if (t % 1 !== 0 || t < 0) throw new RangeError("offset is not uint");
537
+ if (t + e > r) throw new RangeError("Trying to access beyond buffer length");
556
538
  }
557
539
  a.prototype.readUIntLE = function(e, r, n) {
558
- e = e | 0, r = r | 0, n || I(e, r, this.length);
540
+ e = e | 0, r = r | 0, n || O(e, r, this.length);
559
541
  for (var i = this[e], o = 1, s = 0; ++s < r && (o *= 256); )
560
542
  i += this[e + s] * o;
561
543
  return i;
562
544
  };
563
545
  a.prototype.readUIntBE = function(e, r, n) {
564
- e = e | 0, r = r | 0, n || I(e, r, this.length);
546
+ e = e | 0, r = r | 0, n || O(e, r, this.length);
565
547
  for (var i = this[e + --r], o = 1; r > 0 && (o *= 256); )
566
548
  i += this[e + --r] * o;
567
549
  return i;
568
550
  };
569
551
  a.prototype.readUInt8 = function(e, r) {
570
- return r || I(e, 1, this.length), this[e];
552
+ return r || O(e, 1, this.length), this[e];
571
553
  };
572
554
  a.prototype.readUInt16LE = function(e, r) {
573
- return r || I(e, 2, this.length), this[e] | this[e + 1] << 8;
555
+ return r || O(e, 2, this.length), this[e] | this[e + 1] << 8;
574
556
  };
575
557
  a.prototype.readUInt16BE = function(e, r) {
576
- return r || I(e, 2, this.length), this[e] << 8 | this[e + 1];
558
+ return r || O(e, 2, this.length), this[e] << 8 | this[e + 1];
577
559
  };
578
560
  a.prototype.readUInt32LE = function(e, r) {
579
- return r || I(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
561
+ return r || O(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
580
562
  };
581
563
  a.prototype.readUInt32BE = function(e, r) {
582
- return r || I(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
564
+ return r || O(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
583
565
  };
584
566
  a.prototype.readIntLE = function(e, r, n) {
585
- e = e | 0, r = r | 0, n || I(e, r, this.length);
567
+ e = e | 0, r = r | 0, n || O(e, r, this.length);
586
568
  for (var i = this[e], o = 1, s = 0; ++s < r && (o *= 256); )
587
569
  i += this[e + s] * o;
588
570
  return o *= 128, i >= o && (i -= Math.pow(2, 8 * r)), i;
589
571
  };
590
572
  a.prototype.readIntBE = function(e, r, n) {
591
- e = e | 0, r = r | 0, n || I(e, r, this.length);
573
+ e = e | 0, r = r | 0, n || O(e, r, this.length);
592
574
  for (var i = r, o = 1, s = this[e + --i]; i > 0 && (o *= 256); )
593
575
  s += this[e + --i] * o;
594
576
  return o *= 128, s >= o && (s -= Math.pow(2, 8 * r)), s;
595
577
  };
596
578
  a.prototype.readInt8 = function(e, r) {
597
- return r || I(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
579
+ return r || O(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
598
580
  };
599
581
  a.prototype.readInt16LE = function(e, r) {
600
- r || I(e, 2, this.length);
582
+ r || O(e, 2, this.length);
601
583
  var n = this[e] | this[e + 1] << 8;
602
584
  return n & 32768 ? n | 4294901760 : n;
603
585
  };
604
586
  a.prototype.readInt16BE = function(e, r) {
605
- r || I(e, 2, this.length);
587
+ r || O(e, 2, this.length);
606
588
  var n = this[e + 1] | this[e] << 8;
607
589
  return n & 32768 ? n | 4294901760 : n;
608
590
  };
609
591
  a.prototype.readInt32LE = function(e, r) {
610
- return r || I(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
592
+ return r || O(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
611
593
  };
612
594
  a.prototype.readInt32BE = function(e, r) {
613
- return r || I(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
595
+ return r || O(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
614
596
  };
615
597
  a.prototype.readFloatLE = function(e, r) {
616
- return r || I(e, 4, this.length), be(this, e, !0, 23, 4);
598
+ return r || O(e, 4, this.length), ve(this, e, !0, 23, 4);
617
599
  };
618
600
  a.prototype.readFloatBE = function(e, r) {
619
- return r || I(e, 4, this.length), be(this, e, !1, 23, 4);
601
+ return r || O(e, 4, this.length), ve(this, e, !1, 23, 4);
620
602
  };
621
603
  a.prototype.readDoubleLE = function(e, r) {
622
- return r || I(e, 8, this.length), be(this, e, !0, 52, 8);
604
+ return r || O(e, 8, this.length), ve(this, e, !0, 52, 8);
623
605
  };
624
606
  a.prototype.readDoubleBE = function(e, r) {
625
- return r || I(e, 8, this.length), be(this, e, !1, 52, 8);
607
+ return r || O(e, 8, this.length), ve(this, e, !1, 52, 8);
626
608
  };
627
609
  function N(t, e, r, n, i, o) {
628
- if (!j(t))
629
- throw new TypeError('"buffer" argument must be a Buffer instance');
630
- if (e > i || e < o)
631
- throw new RangeError('"value" argument is out of bounds');
632
- if (r + n > t.length)
633
- throw new RangeError("Index out of range");
610
+ if (!j(t)) throw new TypeError('"buffer" argument must be a Buffer instance');
611
+ if (e > i || e < o) throw new RangeError('"value" argument is out of bounds');
612
+ if (r + n > t.length) throw new RangeError("Index out of range");
634
613
  }
635
614
  a.prototype.writeUIntLE = function(e, r, n, i) {
636
615
  if (e = +e, r = r | 0, n = n | 0, !i) {
@@ -655,27 +634,27 @@ a.prototype.writeUIntBE = function(e, r, n, i) {
655
634
  a.prototype.writeUInt8 = function(e, r, n) {
656
635
  return e = +e, r = r | 0, n || N(this, e, r, 1, 255, 0), a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), this[r] = e & 255, r + 1;
657
636
  };
658
- function xe(t, e, r, n) {
637
+ function be(t, e, r, n) {
659
638
  e < 0 && (e = 65535 + e + 1);
660
639
  for (var i = 0, o = Math.min(t.length - r, 2); i < o; ++i)
661
640
  t[r + i] = (e & 255 << 8 * (n ? i : 1 - i)) >>> (n ? i : 1 - i) * 8;
662
641
  }
663
642
  a.prototype.writeUInt16LE = function(e, r, n) {
664
- return e = +e, r = r | 0, n || N(this, e, r, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) : xe(this, e, r, !0), r + 2;
643
+ return e = +e, r = r | 0, n || N(this, e, r, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) : be(this, e, r, !0), r + 2;
665
644
  };
666
645
  a.prototype.writeUInt16BE = function(e, r, n) {
667
- return e = +e, r = r | 0, n || N(this, e, r, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 8, this[r + 1] = e & 255) : xe(this, e, r, !1), r + 2;
646
+ return e = +e, r = r | 0, n || N(this, e, r, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 8, this[r + 1] = e & 255) : be(this, e, r, !1), r + 2;
668
647
  };
669
- function Ee(t, e, r, n) {
648
+ function xe(t, e, r, n) {
670
649
  e < 0 && (e = 4294967295 + e + 1);
671
650
  for (var i = 0, o = Math.min(t.length - r, 4); i < o; ++i)
672
651
  t[r + i] = e >>> (n ? i : 3 - i) * 8 & 255;
673
652
  }
674
653
  a.prototype.writeUInt32LE = function(e, r, n) {
675
- return e = +e, r = r | 0, n || N(this, e, r, 4, 4294967295, 0), a.TYPED_ARRAY_SUPPORT ? (this[r + 3] = e >>> 24, this[r + 2] = e >>> 16, this[r + 1] = e >>> 8, this[r] = e & 255) : Ee(this, e, r, !0), r + 4;
654
+ return e = +e, r = r | 0, n || N(this, e, r, 4, 4294967295, 0), a.TYPED_ARRAY_SUPPORT ? (this[r + 3] = e >>> 24, this[r + 2] = e >>> 16, this[r + 1] = e >>> 8, this[r] = e & 255) : xe(this, e, r, !0), r + 4;
676
655
  };
677
656
  a.prototype.writeUInt32BE = function(e, r, n) {
678
- return e = +e, r = r | 0, n || N(this, e, r, 4, 4294967295, 0), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 24, this[r + 1] = e >>> 16, this[r + 2] = e >>> 8, this[r + 3] = e & 255) : Ee(this, e, r, !1), r + 4;
657
+ return e = +e, r = r | 0, n || N(this, e, r, 4, 4294967295, 0), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 24, this[r + 1] = e >>> 16, this[r + 2] = e >>> 8, this[r + 3] = e & 255) : xe(this, e, r, !1), r + 4;
679
658
  };
680
659
  a.prototype.writeIntLE = function(e, r, n, i) {
681
660
  if (e = +e, r = r | 0, !i) {
@@ -701,50 +680,45 @@ a.prototype.writeInt8 = function(e, r, n) {
701
680
  return e = +e, r = r | 0, n || N(this, e, r, 1, 127, -128), a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), this[r] = e & 255, r + 1;
702
681
  };
703
682
  a.prototype.writeInt16LE = function(e, r, n) {
704
- return e = +e, r = r | 0, n || N(this, e, r, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) : xe(this, e, r, !0), r + 2;
683
+ return e = +e, r = r | 0, n || N(this, e, r, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) : be(this, e, r, !0), r + 2;
705
684
  };
706
685
  a.prototype.writeInt16BE = function(e, r, n) {
707
- return e = +e, r = r | 0, n || N(this, e, r, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 8, this[r + 1] = e & 255) : xe(this, e, r, !1), r + 2;
686
+ return e = +e, r = r | 0, n || N(this, e, r, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 8, this[r + 1] = e & 255) : be(this, e, r, !1), r + 2;
708
687
  };
709
688
  a.prototype.writeInt32LE = function(e, r, n) {
710
- return e = +e, r = r | 0, n || N(this, e, r, 4, 2147483647, -2147483648), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8, this[r + 2] = e >>> 16, this[r + 3] = e >>> 24) : Ee(this, e, r, !0), r + 4;
689
+ return e = +e, r = r | 0, n || N(this, e, r, 4, 2147483647, -2147483648), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8, this[r + 2] = e >>> 16, this[r + 3] = e >>> 24) : xe(this, e, r, !0), r + 4;
711
690
  };
712
691
  a.prototype.writeInt32BE = function(e, r, n) {
713
- return e = +e, r = r | 0, n || N(this, e, r, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 24, this[r + 1] = e >>> 16, this[r + 2] = e >>> 8, this[r + 3] = e & 255) : Ee(this, e, r, !1), r + 4;
692
+ return e = +e, r = r | 0, n || N(this, e, r, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 24, this[r + 1] = e >>> 16, this[r + 2] = e >>> 8, this[r + 3] = e & 255) : xe(this, e, r, !1), r + 4;
714
693
  };
715
- function _t(t, e, r, n, i, o) {
716
- if (r + n > t.length)
717
- throw new RangeError("Index out of range");
718
- if (r < 0)
719
- throw new RangeError("Index out of range");
694
+ function wt(t, e, r, n, i, o) {
695
+ if (r + n > t.length) throw new RangeError("Index out of range");
696
+ if (r < 0) throw new RangeError("Index out of range");
720
697
  }
721
- function wt(t, e, r, n, i) {
722
- return i || _t(t, e, r, 4), lt(t, e, r, n, 23, 4), r + 4;
698
+ function yt(t, e, r, n, i) {
699
+ return i || wt(t, e, r, 4), ut(t, e, r, n, 23, 4), r + 4;
723
700
  }
724
701
  a.prototype.writeFloatLE = function(e, r, n) {
725
- return wt(this, e, r, !0, n);
702
+ return yt(this, e, r, !0, n);
726
703
  };
727
704
  a.prototype.writeFloatBE = function(e, r, n) {
728
- return wt(this, e, r, !1, n);
705
+ return yt(this, e, r, !1, n);
729
706
  };
730
- function yt(t, e, r, n, i) {
731
- return i || _t(t, e, r, 8), lt(t, e, r, n, 52, 8), r + 8;
707
+ function vt(t, e, r, n, i) {
708
+ return i || wt(t, e, r, 8), ut(t, e, r, n, 52, 8), r + 8;
732
709
  }
733
710
  a.prototype.writeDoubleLE = function(e, r, n) {
734
- return yt(this, e, r, !0, n);
711
+ return vt(this, e, r, !0, n);
735
712
  };
736
713
  a.prototype.writeDoubleBE = function(e, r, n) {
737
- return yt(this, e, r, !1, n);
714
+ return vt(this, e, r, !1, n);
738
715
  };
739
716
  a.prototype.copy = function(e, r, n, i) {
740
- if (n || (n = 0), !i && i !== 0 && (i = this.length), r >= e.length && (r = e.length), r || (r = 0), i > 0 && i < n && (i = n), i === n || e.length === 0 || this.length === 0)
741
- return 0;
717
+ if (n || (n = 0), !i && i !== 0 && (i = this.length), r >= e.length && (r = e.length), r || (r = 0), i > 0 && i < n && (i = n), i === n || e.length === 0 || this.length === 0) return 0;
742
718
  if (r < 0)
743
719
  throw new RangeError("targetStart out of bounds");
744
- if (n < 0 || n >= this.length)
745
- throw new RangeError("sourceStart out of bounds");
746
- if (i < 0)
747
- throw new RangeError("sourceEnd out of bounds");
720
+ if (n < 0 || n >= this.length) throw new RangeError("sourceStart out of bounds");
721
+ if (i < 0) throw new RangeError("sourceEnd out of bounds");
748
722
  i > this.length && (i = this.length), e.length - r < i - n && (i = e.length - r + n);
749
723
  var o = i - n, s;
750
724
  if (this === e && n < r && r < i)
@@ -771,8 +745,7 @@ a.prototype.fill = function(e, r, n, i) {
771
745
  throw new TypeError("encoding must be a string");
772
746
  if (typeof i == "string" && !a.isEncoding(i))
773
747
  throw new TypeError("Unknown encoding: " + i);
774
- } else
775
- typeof e == "number" && (e = e & 255);
748
+ } else typeof e == "number" && (e = e & 255);
776
749
  if (r < 0 || this.length < r || this.length < n)
777
750
  throw new RangeError("Out of range index");
778
751
  if (n <= r)
@@ -783,7 +756,7 @@ a.prototype.fill = function(e, r, n, i) {
783
756
  for (s = r; s < n; ++s)
784
757
  this[s] = e;
785
758
  else {
786
- var f = j(e) ? e : ye(new a(e, i).toString()), l = f.length;
759
+ var f = j(e) ? e : we(new a(e, i).toString()), l = f.length;
787
760
  for (s = 0; s < n - r; ++s)
788
761
  this[s + r] = f[s % l];
789
762
  }
@@ -791,8 +764,7 @@ a.prototype.fill = function(e, r, n, i) {
791
764
  };
792
765
  var gr = /[^+\/0-9A-Za-z-_]/g;
793
766
  function _r(t) {
794
- if (t = wr(t).replace(gr, ""), t.length < 2)
795
- return "";
767
+ if (t = wr(t).replace(gr, ""), t.length < 2) return "";
796
768
  for (; t.length % 4 !== 0; )
797
769
  t = t + "=";
798
770
  return t;
@@ -803,7 +775,7 @@ function wr(t) {
803
775
  function yr(t) {
804
776
  return t < 16 ? "0" + t.toString(16) : t.toString(16);
805
777
  }
806
- function ye(t, e) {
778
+ function we(t, e) {
807
779
  e = e || 1 / 0;
808
780
  for (var r, n = t.length, i = null, o = [], s = 0; s < n; ++s) {
809
781
  if (r = t.charCodeAt(s), r > 55295 && r < 57344) {
@@ -823,30 +795,25 @@ function ye(t, e) {
823
795
  continue;
824
796
  }
825
797
  r = (i - 55296 << 10 | r - 56320) + 65536;
826
- } else
827
- i && (e -= 3) > -1 && o.push(239, 191, 189);
798
+ } else i && (e -= 3) > -1 && o.push(239, 191, 189);
828
799
  if (i = null, r < 128) {
829
- if ((e -= 1) < 0)
830
- break;
800
+ if ((e -= 1) < 0) break;
831
801
  o.push(r);
832
802
  } else if (r < 2048) {
833
- if ((e -= 2) < 0)
834
- break;
803
+ if ((e -= 2) < 0) break;
835
804
  o.push(
836
805
  r >> 6 | 192,
837
806
  r & 63 | 128
838
807
  );
839
808
  } else if (r < 65536) {
840
- if ((e -= 3) < 0)
841
- break;
809
+ if ((e -= 3) < 0) break;
842
810
  o.push(
843
811
  r >> 12 | 224,
844
812
  r >> 6 & 63 | 128,
845
813
  r & 63 | 128
846
814
  );
847
815
  } else if (r < 1114112) {
848
- if ((e -= 4) < 0)
849
- break;
816
+ if ((e -= 4) < 0) break;
850
817
  o.push(
851
818
  r >> 18 | 240,
852
819
  r >> 12 & 63 | 128,
@@ -868,10 +835,10 @@ function br(t, e) {
868
835
  r = t.charCodeAt(s), n = r >> 8, i = r % 256, o.push(i), o.push(n);
869
836
  return o;
870
837
  }
871
- function vt(t) {
838
+ function bt(t) {
872
839
  return Ht(_r(t));
873
840
  }
874
- function Se(t, e, r, n) {
841
+ function Ee(t, e, r, n) {
875
842
  for (var i = 0; i < n && !(i + r >= e.length || i >= t.length); ++i)
876
843
  e[i + r] = t[i];
877
844
  return i;
@@ -879,16 +846,16 @@ function Se(t, e, r, n) {
879
846
  function xr(t) {
880
847
  return t !== t;
881
848
  }
882
- function T(t) {
883
- return t != null && (!!t._isBuffer || bt(t) || Er(t));
849
+ function L(t) {
850
+ return t != null && (!!t._isBuffer || xt(t) || Er(t));
884
851
  }
885
- function bt(t) {
852
+ function xt(t) {
886
853
  return !!t.constructor && typeof t.constructor.isBuffer == "function" && t.constructor.isBuffer(t);
887
854
  }
888
855
  function Er(t) {
889
- return typeof t.readFloatLE == "function" && typeof t.slice == "function" && bt(t.slice(0, 0));
856
+ return typeof t.readFloatLE == "function" && typeof t.slice == "function" && xt(t.slice(0, 0));
890
857
  }
891
- var Sr;
858
+ var Oe;
892
859
  function H() {
893
860
  }
894
861
  H.prototype = /* @__PURE__ */ Object.create(null);
@@ -902,52 +869,52 @@ p.prototype._events = void 0;
902
869
  p.prototype._maxListeners = void 0;
903
870
  p.defaultMaxListeners = 10;
904
871
  p.init = function() {
905
- this.domain = null, p.usingDomains && Sr.active, (!this._events || this._events === Object.getPrototypeOf(this)._events) && (this._events = new H(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
872
+ this.domain = null, p.usingDomains && Oe.active && !(this instanceof Oe.Domain) && (this.domain = Oe.active), (!this._events || this._events === Object.getPrototypeOf(this)._events) && (this._events = new H(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
906
873
  };
907
874
  p.prototype.setMaxListeners = function(e) {
908
875
  if (typeof e != "number" || e < 0 || isNaN(e))
909
876
  throw new TypeError('"n" argument must be a positive number');
910
877
  return this._maxListeners = e, this;
911
878
  };
912
- function xt(t) {
879
+ function Et(t) {
913
880
  return t._maxListeners === void 0 ? p.defaultMaxListeners : t._maxListeners;
914
881
  }
915
882
  p.prototype.getMaxListeners = function() {
916
- return xt(this);
883
+ return Et(this);
917
884
  };
918
- function Rr(t, e, r) {
885
+ function Sr(t, e, r) {
919
886
  if (e)
920
887
  t.call(r);
921
888
  else
922
- for (var n = t.length, i = ue(t, n), o = 0; o < n; ++o)
889
+ for (var n = t.length, i = ae(t, n), o = 0; o < n; ++o)
923
890
  i[o].call(r);
924
891
  }
925
- function Ir(t, e, r, n) {
892
+ function Rr(t, e, r, n) {
926
893
  if (e)
927
894
  t.call(r, n);
928
895
  else
929
- for (var i = t.length, o = ue(t, i), s = 0; s < i; ++s)
896
+ for (var i = t.length, o = ae(t, i), s = 0; s < i; ++s)
930
897
  o[s].call(r, n);
931
898
  }
932
- function Or(t, e, r, n, i) {
899
+ function Ir(t, e, r, n, i) {
933
900
  if (e)
934
901
  t.call(r, n, i);
935
902
  else
936
- for (var o = t.length, s = ue(t, o), f = 0; f < o; ++f)
903
+ for (var o = t.length, s = ae(t, o), f = 0; f < o; ++f)
937
904
  s[f].call(r, n, i);
938
905
  }
939
- function Cr(t, e, r, n, i, o) {
906
+ function Or(t, e, r, n, i, o) {
940
907
  if (e)
941
908
  t.call(r, n, i, o);
942
909
  else
943
- for (var s = t.length, f = ue(t, s), l = 0; l < s; ++l)
910
+ for (var s = t.length, f = ae(t, s), l = 0; l < s; ++l)
944
911
  f[l].call(r, n, i, o);
945
912
  }
946
- function Ar(t, e, r, n) {
913
+ function Cr(t, e, r, n) {
947
914
  if (e)
948
915
  t.apply(r, n);
949
916
  else
950
- for (var i = t.length, o = ue(t, i), s = 0; s < i; ++s)
917
+ for (var i = t.length, o = ae(t, i), s = 0; s < i; ++s)
951
918
  o[s].apply(r, n);
952
919
  }
953
920
  p.prototype.emit = function(e) {
@@ -971,26 +938,28 @@ p.prototype.emit = function(e) {
971
938
  return !1;
972
939
  var c = typeof n == "function";
973
940
  switch (i = arguments.length, i) {
941
+ // fast cases
974
942
  case 1:
975
- Rr(n, c, this);
943
+ Sr(n, c, this);
976
944
  break;
977
945
  case 2:
978
- Ir(n, c, this, arguments[1]);
946
+ Rr(n, c, this, arguments[1]);
979
947
  break;
980
948
  case 3:
981
- Or(n, c, this, arguments[1], arguments[2]);
949
+ Ir(n, c, this, arguments[1], arguments[2]);
982
950
  break;
983
951
  case 4:
984
- Cr(n, c, this, arguments[1], arguments[2], arguments[3]);
952
+ Or(n, c, this, arguments[1], arguments[2], arguments[3]);
985
953
  break;
954
+ // slower
986
955
  default:
987
956
  for (o = new Array(i - 1), s = 1; s < i; s++)
988
957
  o[s - 1] = arguments[s];
989
- Ar(n, c, this, o);
958
+ Cr(n, c, this, o);
990
959
  }
991
960
  return !0;
992
961
  };
993
- function Et(t, e, r, n) {
962
+ function St(t, e, r, n) {
994
963
  var i, o, s;
995
964
  if (typeof r != "function")
996
965
  throw new TypeError('"listener" argument must be a function');
@@ -1000,24 +969,24 @@ function Et(t, e, r, n) {
1000
969
  r.listener ? r.listener : r
1001
970
  ), o = t._events), s = o[e]) : (o = t._events = new H(), t._eventsCount = 0), !s)
1002
971
  s = o[e] = r, ++t._eventsCount;
1003
- else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), !s.warned && (i = xt(t), i && i > 0 && s.length > i)) {
972
+ else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), !s.warned && (i = Et(t), i && i > 0 && s.length > i)) {
1004
973
  s.warned = !0;
1005
974
  var f = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + e + " listeners added. Use emitter.setMaxListeners() to increase limit");
1006
- f.name = "MaxListenersExceededWarning", f.emitter = t, f.type = e, f.count = s.length, Lr(f);
975
+ f.name = "MaxListenersExceededWarning", f.emitter = t, f.type = e, f.count = s.length, Ar(f);
1007
976
  }
1008
977
  return t;
1009
978
  }
1010
- function Lr(t) {
979
+ function Ar(t) {
1011
980
  typeof console.warn == "function" ? console.warn(t) : console.log(t);
1012
981
  }
1013
982
  p.prototype.addListener = function(e, r) {
1014
- return Et(this, e, r, !1);
983
+ return St(this, e, r, !1);
1015
984
  };
1016
985
  p.prototype.on = p.prototype.addListener;
1017
986
  p.prototype.prependListener = function(e, r) {
1018
- return Et(this, e, r, !0);
987
+ return St(this, e, r, !0);
1019
988
  };
1020
- function St(t, e, r) {
989
+ function Rt(t, e, r) {
1021
990
  var n = !1;
1022
991
  function i() {
1023
992
  t.removeListener(e, i), n || (n = !0, r.apply(t, arguments));
@@ -1027,12 +996,12 @@ function St(t, e, r) {
1027
996
  p.prototype.once = function(e, r) {
1028
997
  if (typeof r != "function")
1029
998
  throw new TypeError('"listener" argument must be a function');
1030
- return this.on(e, St(this, e, r)), this;
999
+ return this.on(e, Rt(this, e, r)), this;
1031
1000
  };
1032
1001
  p.prototype.prependOnceListener = function(e, r) {
1033
1002
  if (typeof r != "function")
1034
1003
  throw new TypeError('"listener" argument must be a function');
1035
- return this.prependListener(e, St(this, e, r)), this;
1004
+ return this.prependListener(e, Rt(this, e, r)), this;
1036
1005
  };
1037
1006
  p.prototype.removeListener = function(e, r) {
1038
1007
  var n, i, o, s, f;
@@ -1083,13 +1052,13 @@ p.prototype.removeAllListeners = function(e) {
1083
1052
  };
1084
1053
  p.prototype.listeners = function(e) {
1085
1054
  var r, n, i = this._events;
1086
- return i ? (r = i[e], r ? typeof r == "function" ? n = [r.listener || r] : n = Nr(r) : n = []) : n = [], n;
1055
+ return i ? (r = i[e], r ? typeof r == "function" ? n = [r.listener || r] : n = Lr(r) : n = []) : n = [], n;
1087
1056
  };
1088
1057
  p.listenerCount = function(t, e) {
1089
- return typeof t.listenerCount == "function" ? t.listenerCount(e) : Rt.call(t, e);
1058
+ return typeof t.listenerCount == "function" ? t.listenerCount(e) : It.call(t, e);
1090
1059
  };
1091
- p.prototype.listenerCount = Rt;
1092
- function Rt(t) {
1060
+ p.prototype.listenerCount = It;
1061
+ function It(t) {
1093
1062
  var e = this._events;
1094
1063
  if (e) {
1095
1064
  var r = e[t];
@@ -1108,29 +1077,29 @@ function Tr(t, e) {
1108
1077
  t[r] = t[n];
1109
1078
  t.pop();
1110
1079
  }
1111
- function ue(t, e) {
1080
+ function ae(t, e) {
1112
1081
  for (var r = new Array(e); e--; )
1113
1082
  r[e] = t[e];
1114
1083
  return r;
1115
1084
  }
1116
- function Nr(t) {
1085
+ function Lr(t) {
1117
1086
  for (var e = new Array(t.length), r = 0; r < e.length; ++r)
1118
1087
  e[r] = t[r].listener || t[r];
1119
1088
  return e;
1120
1089
  }
1121
- function It() {
1090
+ function Ot() {
1122
1091
  throw new Error("setTimeout has not been defined");
1123
1092
  }
1124
- function Ot() {
1093
+ function Ct() {
1125
1094
  throw new Error("clearTimeout has not been defined");
1126
1095
  }
1127
- var Y = It, W = Ot;
1128
- typeof oe.setTimeout == "function" && (Y = setTimeout);
1129
- typeof oe.clearTimeout == "function" && (W = clearTimeout);
1130
- function Ct(t) {
1096
+ var Y = Ot, W = Ct;
1097
+ typeof ie.setTimeout == "function" && (Y = setTimeout);
1098
+ typeof ie.clearTimeout == "function" && (W = clearTimeout);
1099
+ function At(t) {
1131
1100
  if (Y === setTimeout)
1132
1101
  return setTimeout(t, 0);
1133
- if ((Y === It || !Y) && setTimeout)
1102
+ if ((Y === Ot || !Y) && setTimeout)
1134
1103
  return Y = setTimeout, setTimeout(t, 0);
1135
1104
  try {
1136
1105
  return Y(t, 0);
@@ -1142,10 +1111,10 @@ function Ct(t) {
1142
1111
  }
1143
1112
  }
1144
1113
  }
1145
- function Dr(t) {
1114
+ function Nr(t) {
1146
1115
  if (W === clearTimeout)
1147
1116
  return clearTimeout(t);
1148
- if ((W === Ot || !W) && clearTimeout)
1117
+ if ((W === Ct || !W) && clearTimeout)
1149
1118
  return W = clearTimeout, clearTimeout(t);
1150
1119
  try {
1151
1120
  return W(t);
@@ -1157,28 +1126,28 @@ function Dr(t) {
1157
1126
  }
1158
1127
  }
1159
1128
  }
1160
- var q = [], ie = !1, K, ge = -1;
1161
- function Fr() {
1162
- !ie || !K || (ie = !1, K.length ? q = K.concat(q) : ge = -1, q.length && At());
1129
+ var z = [], ne = !1, ee, me = -1;
1130
+ function Dr() {
1131
+ !ne || !ee || (ne = !1, ee.length ? z = ee.concat(z) : me = -1, z.length && Tt());
1163
1132
  }
1164
- function At() {
1165
- if (!ie) {
1166
- var t = Ct(Fr);
1167
- ie = !0;
1168
- for (var e = q.length; e; ) {
1169
- for (K = q, q = []; ++ge < e; )
1170
- K && K[ge].run();
1171
- ge = -1, e = q.length;
1133
+ function Tt() {
1134
+ if (!ne) {
1135
+ var t = At(Dr);
1136
+ ne = !0;
1137
+ for (var e = z.length; e; ) {
1138
+ for (ee = z, z = []; ++me < e; )
1139
+ ee && ee[me].run();
1140
+ me = -1, e = z.length;
1172
1141
  }
1173
- K = null, ie = !1, Dr(t);
1142
+ ee = null, ne = !1, Nr(t);
1174
1143
  }
1175
1144
  }
1176
- function D(t) {
1145
+ function B(t) {
1177
1146
  var e = new Array(arguments.length - 1);
1178
1147
  if (arguments.length > 1)
1179
1148
  for (var r = 1; r < arguments.length; r++)
1180
1149
  e[r - 1] = arguments[r];
1181
- q.push(new Lt(t, e)), q.length === 1 && !ie && Ct(At);
1150
+ z.push(new Lt(t, e)), z.length === 1 && !ne && At(Tt);
1182
1151
  }
1183
1152
  function Lt(t, e) {
1184
1153
  this.fun = t, this.array = e;
@@ -1186,58 +1155,10 @@ function Lt(t, e) {
1186
1155
  Lt.prototype.run = function() {
1187
1156
  this.fun.apply(null, this.array);
1188
1157
  };
1189
- var Mr = "browser", Br = "browser", Ur = !0, kr = {}, Pr = [], jr = "", $r = {}, qr = {}, zr = {};
1190
- function ee() {
1191
- }
1192
- var Vr = ee, Jr = ee, Yr = ee, Wr = ee, Qr = ee, Hr = ee, Gr = ee;
1193
- function Zr(t) {
1194
- throw new Error("process.binding is not supported");
1195
- }
1196
- function Xr() {
1197
- return "/";
1198
- }
1199
- function Kr(t) {
1200
- throw new Error("process.chdir is not supported");
1201
- }
1202
- function en() {
1203
- return 0;
1204
- }
1205
- var ne = oe.performance || {}, tn = ne.now || ne.mozNow || ne.msNow || ne.oNow || ne.webkitNow || function() {
1206
- return (/* @__PURE__ */ new Date()).getTime();
1207
- };
1208
- function rn(t) {
1209
- var e = tn.call(ne) * 1e-3, r = Math.floor(e), n = Math.floor(e % 1 * 1e9);
1210
- return t && (r = r - t[0], n = n - t[1], n < 0 && (r--, n += 1e9)), [r, n];
1211
- }
1212
- var nn = /* @__PURE__ */ new Date();
1213
- function on() {
1214
- var t = /* @__PURE__ */ new Date(), e = t - nn;
1215
- return e / 1e3;
1216
- }
1217
- var _e = {
1218
- nextTick: D,
1219
- title: Mr,
1220
- browser: Ur,
1221
- env: kr,
1222
- argv: Pr,
1223
- version: jr,
1224
- versions: $r,
1225
- on: Vr,
1226
- addListener: Jr,
1227
- once: Yr,
1228
- off: Wr,
1229
- removeListener: Qr,
1230
- removeAllListeners: Hr,
1231
- emit: Gr,
1232
- binding: Zr,
1233
- cwd: Xr,
1234
- chdir: Kr,
1235
- umask: en,
1236
- hrtime: rn,
1237
- platform: Br,
1238
- release: qr,
1239
- config: zr,
1240
- uptime: on
1158
+ var Fr = {}, se = ie.performance || {};
1159
+ se.now || se.mozNow || se.msNow || se.oNow || se.webkitNow;
1160
+ var ge = {
1161
+ env: Fr
1241
1162
  }, Ue;
1242
1163
  typeof Object.create == "function" ? Ue = function(e, r) {
1243
1164
  e.super_ = r, e.prototype = Object.create(r.prototype, {
@@ -1254,18 +1175,16 @@ typeof Object.create == "function" ? Ue = function(e, r) {
1254
1175
  };
1255
1176
  n.prototype = r.prototype, e.prototype = new n(), e.prototype.constructor = e;
1256
1177
  };
1257
- var se = Ue, sn = /%[sdj%]/g;
1258
- function fn(t) {
1178
+ var oe = Ue, Mr = /%[sdj%]/g;
1179
+ function Br(t) {
1259
1180
  if (!Ve(t)) {
1260
1181
  for (var e = [], r = 0; r < arguments.length; r++)
1261
1182
  e.push(G(arguments[r]));
1262
1183
  return e.join(" ");
1263
1184
  }
1264
- for (var r = 1, n = arguments, i = n.length, o = String(t).replace(sn, function(f) {
1265
- if (f === "%%")
1266
- return "%";
1267
- if (r >= i)
1268
- return f;
1185
+ for (var r = 1, n = arguments, i = n.length, o = String(t).replace(Mr, function(f) {
1186
+ if (f === "%%") return "%";
1187
+ if (r >= i) return f;
1269
1188
  switch (f) {
1270
1189
  case "%s":
1271
1190
  return String(n[r++]);
@@ -1281,47 +1200,47 @@ function fn(t) {
1281
1200
  return f;
1282
1201
  }
1283
1202
  }), s = n[r]; r < i; s = n[++r])
1284
- ze(s) || !he(s) ? o += " " + s : o += " " + G(s);
1203
+ ze(s) || !le(s) ? o += " " + s : o += " " + G(s);
1285
1204
  return o;
1286
1205
  }
1287
- function Tt(t, e) {
1288
- if (Q(oe.process))
1206
+ function Nt(t, e) {
1207
+ if (Q(ie.process))
1289
1208
  return function() {
1290
- return Tt(t, e).apply(this, arguments);
1209
+ return Nt(t, e).apply(this, arguments);
1291
1210
  };
1292
- if (_e.noDeprecation === !0)
1211
+ if (ge.noDeprecation === !0)
1293
1212
  return t;
1294
1213
  var r = !1;
1295
1214
  function n() {
1296
1215
  if (!r) {
1297
- if (_e.throwDeprecation)
1216
+ if (ge.throwDeprecation)
1298
1217
  throw new Error(e);
1299
- _e.traceDeprecation ? console.trace(e) : console.error(e), r = !0;
1218
+ ge.traceDeprecation ? console.trace(e) : console.error(e), r = !0;
1300
1219
  }
1301
1220
  return t.apply(this, arguments);
1302
1221
  }
1303
1222
  return n;
1304
1223
  }
1305
- var me = {}, Ce;
1306
- function an(t) {
1307
- if (Q(Ce) && (Ce = _e.env.NODE_DEBUG || ""), t = t.toUpperCase(), !me[t])
1224
+ var pe = {}, Ce;
1225
+ function Ur(t) {
1226
+ if (Q(Ce) && (Ce = ge.env.NODE_DEBUG || ""), t = t.toUpperCase(), !pe[t])
1308
1227
  if (new RegExp("\\b" + t + "\\b", "i").test(Ce)) {
1309
1228
  var e = 0;
1310
- me[t] = function() {
1311
- var r = fn.apply(null, arguments);
1229
+ pe[t] = function() {
1230
+ var r = Br.apply(null, arguments);
1312
1231
  console.error("%s %d: %s", t, e, r);
1313
1232
  };
1314
1233
  } else
1315
- me[t] = function() {
1234
+ pe[t] = function() {
1316
1235
  };
1317
- return me[t];
1236
+ return pe[t];
1318
1237
  }
1319
1238
  function G(t, e) {
1320
1239
  var r = {
1321
1240
  seen: [],
1322
- stylize: un
1241
+ stylize: Pr
1323
1242
  };
1324
- return arguments.length >= 3 && (r.depth = arguments[2]), arguments.length >= 4 && (r.colors = arguments[3]), Nt(e) ? r.showHidden = e : e && _n(r, e), Q(r.showHidden) && (r.showHidden = !1), Q(r.depth) && (r.depth = 2), Q(r.colors) && (r.colors = !1), Q(r.customInspect) && (r.customInspect = !0), r.colors && (r.stylize = ln), ve(r, t, r.depth);
1243
+ return arguments.length >= 3 && (r.depth = arguments[2]), arguments.length >= 4 && (r.colors = arguments[3]), Dt(e) ? r.showHidden = e : e && Yr(r, e), Q(r.showHidden) && (r.showHidden = !1), Q(r.depth) && (r.depth = 2), Q(r.colors) && (r.colors = !1), Q(r.customInspect) && (r.customInspect = !0), r.colors && (r.stylize = kr), ye(r, t, r.depth);
1325
1244
  }
1326
1245
  G.colors = {
1327
1246
  bold: [1, 22],
@@ -1349,69 +1268,69 @@ G.styles = {
1349
1268
  // "name": intentionally not styling
1350
1269
  regexp: "red"
1351
1270
  };
1352
- function ln(t, e) {
1271
+ function kr(t, e) {
1353
1272
  var r = G.styles[e];
1354
1273
  return r ? "\x1B[" + G.colors[r][0] + "m" + t + "\x1B[" + G.colors[r][1] + "m" : t;
1355
1274
  }
1356
- function un(t, e) {
1275
+ function Pr(t, e) {
1357
1276
  return t;
1358
1277
  }
1359
- function hn(t) {
1278
+ function jr(t) {
1360
1279
  var e = {};
1361
1280
  return t.forEach(function(r, n) {
1362
1281
  e[r] = !0;
1363
1282
  }), e;
1364
1283
  }
1365
- function ve(t, e, r) {
1284
+ function ye(t, e, r) {
1366
1285
  if (t.customInspect && e && Ne(e.inspect) && // Filter out the util module, it's inspect function is special
1367
1286
  e.inspect !== G && // Also filter out any prototype objects using the circular check.
1368
1287
  !(e.constructor && e.constructor.prototype === e)) {
1369
1288
  var n = e.inspect(r, t);
1370
- return Ve(n) || (n = ve(t, n, r)), n;
1289
+ return Ve(n) || (n = ye(t, n, r)), n;
1371
1290
  }
1372
- var i = cn(t, e);
1291
+ var i = $r(t, e);
1373
1292
  if (i)
1374
1293
  return i;
1375
- var o = Object.keys(e), s = hn(o);
1376
- if (t.showHidden && (o = Object.getOwnPropertyNames(e)), Te(e) && (o.indexOf("message") >= 0 || o.indexOf("description") >= 0))
1294
+ var o = Object.keys(e), s = jr(o);
1295
+ if (t.showHidden && (o = Object.getOwnPropertyNames(e)), Le(e) && (o.indexOf("message") >= 0 || o.indexOf("description") >= 0))
1377
1296
  return Ae(e);
1378
1297
  if (o.length === 0) {
1379
1298
  if (Ne(e)) {
1380
1299
  var f = e.name ? ": " + e.name : "";
1381
1300
  return t.stylize("[Function" + f + "]", "special");
1382
1301
  }
1383
- if (Le(e))
1302
+ if (Te(e))
1384
1303
  return t.stylize(RegExp.prototype.toString.call(e), "regexp");
1385
- if (Ze(e))
1304
+ if (Xe(e))
1386
1305
  return t.stylize(Date.prototype.toString.call(e), "date");
1387
- if (Te(e))
1306
+ if (Le(e))
1388
1307
  return Ae(e);
1389
1308
  }
1390
1309
  var l = "", u = !1, h = ["{", "}"];
1391
- if (mn(e) && (u = !0, h = ["[", "]"]), Ne(e)) {
1310
+ if (Vr(e) && (u = !0, h = ["[", "]"]), Ne(e)) {
1392
1311
  var c = e.name ? ": " + e.name : "";
1393
1312
  l = " [Function" + c + "]";
1394
1313
  }
1395
- if (Le(e) && (l = " " + RegExp.prototype.toString.call(e)), Ze(e) && (l = " " + Date.prototype.toUTCString.call(e)), Te(e) && (l = " " + Ae(e)), o.length === 0 && (!u || e.length == 0))
1314
+ if (Te(e) && (l = " " + RegExp.prototype.toString.call(e)), Xe(e) && (l = " " + Date.prototype.toUTCString.call(e)), Le(e) && (l = " " + Ae(e)), o.length === 0 && (!u || e.length == 0))
1396
1315
  return h[0] + l + h[1];
1397
1316
  if (r < 0)
1398
- return Le(e) ? t.stylize(RegExp.prototype.toString.call(e), "regexp") : t.stylize("[Object]", "special");
1317
+ return Te(e) ? t.stylize(RegExp.prototype.toString.call(e), "regexp") : t.stylize("[Object]", "special");
1399
1318
  t.seen.push(e);
1400
1319
  var g;
1401
- return u ? g = dn(t, e, r, s, o) : g = o.map(function(v) {
1320
+ return u ? g = qr(t, e, r, s, o) : g = o.map(function(v) {
1402
1321
  return ke(t, e, r, s, v, u);
1403
- }), t.seen.pop(), pn(g, l, h);
1322
+ }), t.seen.pop(), zr(g, l, h);
1404
1323
  }
1405
- function cn(t, e) {
1324
+ function $r(t, e) {
1406
1325
  if (Q(e))
1407
1326
  return t.stylize("undefined", "undefined");
1408
1327
  if (Ve(e)) {
1409
1328
  var r = "'" + JSON.stringify(e).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
1410
1329
  return t.stylize(r, "string");
1411
1330
  }
1412
- if (gn(e))
1331
+ if (Jr(e))
1413
1332
  return t.stylize("" + e, "number");
1414
- if (Nt(e))
1333
+ if (Dt(e))
1415
1334
  return t.stylize("" + e, "boolean");
1416
1335
  if (ze(e))
1417
1336
  return t.stylize("null", "null");
@@ -1419,9 +1338,9 @@ function cn(t, e) {
1419
1338
  function Ae(t) {
1420
1339
  return "[" + Error.prototype.toString.call(t) + "]";
1421
1340
  }
1422
- function dn(t, e, r, n, i) {
1341
+ function qr(t, e, r, n, i) {
1423
1342
  for (var o = [], s = 0, f = e.length; s < f; ++s)
1424
- Dt(e, String(s)) ? o.push(ke(
1343
+ Ft(e, String(s)) ? o.push(ke(
1425
1344
  t,
1426
1345
  e,
1427
1346
  r,
@@ -1442,7 +1361,7 @@ function dn(t, e, r, n, i) {
1442
1361
  }
1443
1362
  function ke(t, e, r, n, i, o) {
1444
1363
  var s, f, l;
1445
- if (l = Object.getOwnPropertyDescriptor(e, i) || { value: e[i] }, l.get ? l.set ? f = t.stylize("[Getter/Setter]", "special") : f = t.stylize("[Getter]", "special") : l.set && (f = t.stylize("[Setter]", "special")), Dt(n, i) || (s = "[" + i + "]"), f || (t.seen.indexOf(l.value) < 0 ? (ze(r) ? f = ve(t, l.value, null) : f = ve(t, l.value, r - 1), f.indexOf(`
1364
+ if (l = Object.getOwnPropertyDescriptor(e, i) || { value: e[i] }, l.get ? l.set ? f = t.stylize("[Getter/Setter]", "special") : f = t.stylize("[Getter]", "special") : l.set && (f = t.stylize("[Setter]", "special")), Ft(n, i) || (s = "[" + i + "]"), f || (t.seen.indexOf(l.value) < 0 ? (ze(r) ? f = ye(t, l.value, null) : f = ye(t, l.value, r - 1), f.indexOf(`
1446
1365
  `) > -1 && (o ? f = f.split(`
1447
1366
  `).map(function(u) {
1448
1367
  return " " + u;
@@ -1459,7 +1378,7 @@ function ke(t, e, r, n, i, o) {
1459
1378
  }
1460
1379
  return s + ": " + f;
1461
1380
  }
1462
- function pn(t, e, r) {
1381
+ function zr(t, e, r) {
1463
1382
  var n = t.reduce(function(i, o) {
1464
1383
  return o.indexOf(`
1465
1384
  `) >= 0, i + o.replace(/\u001b\[\d\d?m/g, "").length + 1;
@@ -1468,16 +1387,16 @@ function pn(t, e, r) {
1468
1387
  `) + " " + t.join(`,
1469
1388
  `) + " " + r[1] : r[0] + e + " " + t.join(", ") + " " + r[1];
1470
1389
  }
1471
- function mn(t) {
1390
+ function Vr(t) {
1472
1391
  return Array.isArray(t);
1473
1392
  }
1474
- function Nt(t) {
1393
+ function Dt(t) {
1475
1394
  return typeof t == "boolean";
1476
1395
  }
1477
1396
  function ze(t) {
1478
1397
  return t === null;
1479
1398
  }
1480
- function gn(t) {
1399
+ function Jr(t) {
1481
1400
  return typeof t == "number";
1482
1401
  }
1483
1402
  function Ve(t) {
@@ -1486,17 +1405,17 @@ function Ve(t) {
1486
1405
  function Q(t) {
1487
1406
  return t === void 0;
1488
1407
  }
1489
- function Le(t) {
1490
- return he(t) && Je(t) === "[object RegExp]";
1408
+ function Te(t) {
1409
+ return le(t) && Je(t) === "[object RegExp]";
1491
1410
  }
1492
- function he(t) {
1411
+ function le(t) {
1493
1412
  return typeof t == "object" && t !== null;
1494
1413
  }
1495
- function Ze(t) {
1496
- return he(t) && Je(t) === "[object Date]";
1414
+ function Xe(t) {
1415
+ return le(t) && Je(t) === "[object Date]";
1497
1416
  }
1498
- function Te(t) {
1499
- return he(t) && (Je(t) === "[object Error]" || t instanceof Error);
1417
+ function Le(t) {
1418
+ return le(t) && (Je(t) === "[object Error]" || t instanceof Error);
1500
1419
  }
1501
1420
  function Ne(t) {
1502
1421
  return typeof t == "function";
@@ -1504,14 +1423,13 @@ function Ne(t) {
1504
1423
  function Je(t) {
1505
1424
  return Object.prototype.toString.call(t);
1506
1425
  }
1507
- function _n(t, e) {
1508
- if (!e || !he(e))
1509
- return t;
1426
+ function Yr(t, e) {
1427
+ if (!e || !le(e)) return t;
1510
1428
  for (var r = Object.keys(e), n = r.length; n--; )
1511
1429
  t[r[n]] = e[r[n]];
1512
1430
  return t;
1513
1431
  }
1514
- function Dt(t, e) {
1432
+ function Ft(t, e) {
1515
1433
  return Object.prototype.hasOwnProperty.call(t, e);
1516
1434
  }
1517
1435
  function te() {
@@ -1535,22 +1453,19 @@ te.prototype.clear = function() {
1535
1453
  this.head = this.tail = null, this.length = 0;
1536
1454
  };
1537
1455
  te.prototype.join = function(t) {
1538
- if (this.length === 0)
1539
- return "";
1456
+ if (this.length === 0) return "";
1540
1457
  for (var e = this.head, r = "" + e.data; e = e.next; )
1541
1458
  r += t + e.data;
1542
1459
  return r;
1543
1460
  };
1544
1461
  te.prototype.concat = function(t) {
1545
- if (this.length === 0)
1546
- return a.alloc(0);
1547
- if (this.length === 1)
1548
- return this.head.data;
1462
+ if (this.length === 0) return a.alloc(0);
1463
+ if (this.length === 1) return this.head.data;
1549
1464
  for (var e = a.allocUnsafe(t >>> 0), r = this.head, n = 0; r; )
1550
1465
  r.data.copy(e, n), n += r.data.length, r = r.next;
1551
1466
  return e;
1552
1467
  };
1553
- var wn = a.isEncoding || function(t) {
1468
+ var Wr = a.isEncoding || function(t) {
1554
1469
  switch (t && t.toLowerCase()) {
1555
1470
  case "hex":
1556
1471
  case "utf8":
@@ -1568,29 +1483,29 @@ var wn = a.isEncoding || function(t) {
1568
1483
  return !1;
1569
1484
  }
1570
1485
  };
1571
- function yn(t) {
1572
- if (t && !wn(t))
1486
+ function Qr(t) {
1487
+ if (t && !Wr(t))
1573
1488
  throw new Error("Unknown encoding: " + t);
1574
1489
  }
1575
- function ce(t) {
1576
- switch (this.encoding = (t || "utf8").toLowerCase().replace(/[-_]/, ""), yn(t), this.encoding) {
1490
+ function ue(t) {
1491
+ switch (this.encoding = (t || "utf8").toLowerCase().replace(/[-_]/, ""), Qr(t), this.encoding) {
1577
1492
  case "utf8":
1578
1493
  this.surrogateSize = 3;
1579
1494
  break;
1580
1495
  case "ucs2":
1581
1496
  case "utf16le":
1582
- this.surrogateSize = 2, this.detectIncompleteChar = bn;
1497
+ this.surrogateSize = 2, this.detectIncompleteChar = Gr;
1583
1498
  break;
1584
1499
  case "base64":
1585
- this.surrogateSize = 3, this.detectIncompleteChar = xn;
1500
+ this.surrogateSize = 3, this.detectIncompleteChar = Zr;
1586
1501
  break;
1587
1502
  default:
1588
- this.write = vn;
1503
+ this.write = Hr;
1589
1504
  return;
1590
1505
  }
1591
1506
  this.charBuffer = new a(6), this.charReceived = 0, this.charLength = 0;
1592
1507
  }
1593
- ce.prototype.write = function(t) {
1508
+ ue.prototype.write = function(t) {
1594
1509
  for (var e = ""; this.charLength; ) {
1595
1510
  var r = t.length >= this.charLength - this.charReceived ? this.charLength - this.charReceived : t.length;
1596
1511
  if (t.copy(this.charBuffer, this.charReceived, 0, r), this.charReceived += r, this.charReceived < this.charLength)
@@ -1615,7 +1530,7 @@ ce.prototype.write = function(t) {
1615
1530
  }
1616
1531
  return e;
1617
1532
  };
1618
- ce.prototype.detectIncompleteChar = function(t) {
1533
+ ue.prototype.detectIncompleteChar = function(t) {
1619
1534
  for (var e = t.length >= 3 ? 3 : t.length; e > 0; e--) {
1620
1535
  var r = t[t.length - e];
1621
1536
  if (e == 1 && r >> 5 == 6) {
@@ -1633,7 +1548,7 @@ ce.prototype.detectIncompleteChar = function(t) {
1633
1548
  }
1634
1549
  this.charReceived = e;
1635
1550
  };
1636
- ce.prototype.end = function(t) {
1551
+ ue.prototype.end = function(t) {
1637
1552
  var e = "";
1638
1553
  if (t && t.length && (e = this.write(t)), this.charReceived) {
1639
1554
  var r = this.charReceived, n = this.charBuffer, i = this.encoding;
@@ -1641,53 +1556,52 @@ ce.prototype.end = function(t) {
1641
1556
  }
1642
1557
  return e;
1643
1558
  };
1644
- function vn(t) {
1559
+ function Hr(t) {
1645
1560
  return t.toString(this.encoding);
1646
1561
  }
1647
- function bn(t) {
1562
+ function Gr(t) {
1648
1563
  this.charReceived = t.length % 2, this.charLength = this.charReceived ? 2 : 0;
1649
1564
  }
1650
- function xn(t) {
1565
+ function Zr(t) {
1651
1566
  this.charReceived = t.length % 3, this.charLength = this.charReceived ? 3 : 0;
1652
1567
  }
1653
- E.ReadableState = Ft;
1654
- var y = an("stream");
1655
- se(E, p);
1656
- function En(t, e, r) {
1568
+ E.ReadableState = Mt;
1569
+ var y = Ur("stream");
1570
+ oe(E, p);
1571
+ function Xr(t, e, r) {
1657
1572
  if (typeof t.prependListener == "function")
1658
1573
  return t.prependListener(e, r);
1659
1574
  !t._events || !t._events[e] ? t.on(e, r) : Array.isArray(t._events[e]) ? t._events[e].unshift(r) : t._events[e] = [r, t._events[e]];
1660
1575
  }
1661
- function Sn(t, e) {
1576
+ function Kr(t, e) {
1662
1577
  return t.listeners(e).length;
1663
1578
  }
1664
- function Ft(t, e) {
1665
- t = t || {}, this.objectMode = !!t.objectMode, e instanceof B && (this.objectMode = this.objectMode || !!t.readableObjectMode);
1579
+ function Mt(t, e) {
1580
+ t = t || {}, this.objectMode = !!t.objectMode, e instanceof M && (this.objectMode = this.objectMode || !!t.readableObjectMode);
1666
1581
  var r = t.highWaterMark, n = this.objectMode ? 16 : 16 * 1024;
1667
- this.highWaterMark = r || r === 0 ? r : n, this.highWaterMark = ~~this.highWaterMark, this.buffer = new te(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.defaultEncoding = t.defaultEncoding || "utf8", this.ranOut = !1, this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, t.encoding && (this.decoder = new ce(t.encoding), this.encoding = t.encoding);
1582
+ this.highWaterMark = r || r === 0 ? r : n, this.highWaterMark = ~~this.highWaterMark, this.buffer = new te(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.defaultEncoding = t.defaultEncoding || "utf8", this.ranOut = !1, this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, t.encoding && (this.decoder = new ue(t.encoding), this.encoding = t.encoding);
1668
1583
  }
1669
1584
  function E(t) {
1670
- if (!(this instanceof E))
1671
- return new E(t);
1672
- this._readableState = new Ft(t, this), this.readable = !0, t && typeof t.read == "function" && (this._read = t.read), p.call(this);
1585
+ if (!(this instanceof E)) return new E(t);
1586
+ this._readableState = new Mt(t, this), this.readable = !0, t && typeof t.read == "function" && (this._read = t.read), p.call(this);
1673
1587
  }
1674
1588
  E.prototype.push = function(t, e) {
1675
1589
  var r = this._readableState;
1676
- return !r.objectMode && typeof t == "string" && (e = e || r.defaultEncoding, e !== r.encoding && (t = a.from(t, e), e = "")), Mt(this, r, t, e, !1);
1590
+ return !r.objectMode && typeof t == "string" && (e = e || r.defaultEncoding, e !== r.encoding && (t = a.from(t, e), e = "")), Bt(this, r, t, e, !1);
1677
1591
  };
1678
1592
  E.prototype.unshift = function(t) {
1679
1593
  var e = this._readableState;
1680
- return Mt(this, e, t, "", !0);
1594
+ return Bt(this, e, t, "", !0);
1681
1595
  };
1682
1596
  E.prototype.isPaused = function() {
1683
1597
  return this._readableState.flowing === !1;
1684
1598
  };
1685
- function Mt(t, e, r, n, i) {
1686
- var o = On(e, r);
1599
+ function Bt(t, e, r, n, i) {
1600
+ var o = rn(e, r);
1687
1601
  if (o)
1688
1602
  t.emit("error", o);
1689
1603
  else if (r === null)
1690
- e.reading = !1, Cn(t, e);
1604
+ e.reading = !1, nn(t, e);
1691
1605
  else if (e.objectMode || r && r.length > 0)
1692
1606
  if (e.ended && !i) {
1693
1607
  var s = new Error("stream.push() after EOF");
@@ -1697,61 +1611,60 @@ function Mt(t, e, r, n, i) {
1697
1611
  t.emit("error", f);
1698
1612
  } else {
1699
1613
  var l;
1700
- e.decoder && !i && !n && (r = e.decoder.write(r), l = !e.objectMode && r.length === 0), i || (e.reading = !1), l || (e.flowing && e.length === 0 && !e.sync ? (t.emit("data", r), t.read(0)) : (e.length += e.objectMode ? 1 : r.length, i ? e.buffer.unshift(r) : e.buffer.push(r), e.needReadable && Re(t))), An(t, e);
1614
+ e.decoder && !i && !n && (r = e.decoder.write(r), l = !e.objectMode && r.length === 0), i || (e.reading = !1), l || (e.flowing && e.length === 0 && !e.sync ? (t.emit("data", r), t.read(0)) : (e.length += e.objectMode ? 1 : r.length, i ? e.buffer.unshift(r) : e.buffer.push(r), e.needReadable && Se(t))), on(t, e);
1701
1615
  }
1702
- else
1703
- i || (e.reading = !1);
1704
- return Rn(e);
1616
+ else i || (e.reading = !1);
1617
+ return en(e);
1705
1618
  }
1706
- function Rn(t) {
1619
+ function en(t) {
1707
1620
  return !t.ended && (t.needReadable || t.length < t.highWaterMark || t.length === 0);
1708
1621
  }
1709
1622
  E.prototype.setEncoding = function(t) {
1710
- return this._readableState.decoder = new ce(t), this._readableState.encoding = t, this;
1623
+ return this._readableState.decoder = new ue(t), this._readableState.encoding = t, this;
1711
1624
  };
1712
- var Xe = 8388608;
1713
- function In(t) {
1714
- return t >= Xe ? t = Xe : (t--, t |= t >>> 1, t |= t >>> 2, t |= t >>> 4, t |= t >>> 8, t |= t >>> 16, t++), t;
1625
+ var Ke = 8388608;
1626
+ function tn(t) {
1627
+ return t >= Ke ? t = Ke : (t--, t |= t >>> 1, t |= t >>> 2, t |= t >>> 4, t |= t >>> 8, t |= t >>> 16, t++), t;
1715
1628
  }
1716
- function Ke(t, e) {
1717
- return t <= 0 || e.length === 0 && e.ended ? 0 : e.objectMode ? 1 : t !== t ? e.flowing && e.length ? e.buffer.head.data.length : e.length : (t > e.highWaterMark && (e.highWaterMark = In(t)), t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0, 0));
1629
+ function et(t, e) {
1630
+ return t <= 0 || e.length === 0 && e.ended ? 0 : e.objectMode ? 1 : t !== t ? e.flowing && e.length ? e.buffer.head.data.length : e.length : (t > e.highWaterMark && (e.highWaterMark = tn(t)), t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0, 0));
1718
1631
  }
1719
1632
  E.prototype.read = function(t) {
1720
1633
  y("read", t), t = parseInt(t, 10);
1721
1634
  var e = this._readableState, r = t;
1722
1635
  if (t !== 0 && (e.emittedReadable = !1), t === 0 && e.needReadable && (e.length >= e.highWaterMark || e.ended))
1723
- return y("read: emitReadable", e.length, e.ended), e.length === 0 && e.ended ? De(this) : Re(this), null;
1724
- if (t = Ke(t, e), t === 0 && e.ended)
1636
+ return y("read: emitReadable", e.length, e.ended), e.length === 0 && e.ended ? De(this) : Se(this), null;
1637
+ if (t = et(t, e), t === 0 && e.ended)
1725
1638
  return e.length === 0 && De(this), null;
1726
1639
  var n = e.needReadable;
1727
- y("need readable", n), (e.length === 0 || e.length - t < e.highWaterMark) && (n = !0, y("length less than watermark", n)), e.ended || e.reading ? (n = !1, y("reading or ended", n)) : n && (y("do read"), e.reading = !0, e.sync = !0, e.length === 0 && (e.needReadable = !0), this._read(e.highWaterMark), e.sync = !1, e.reading || (t = Ke(r, e)));
1640
+ y("need readable", n), (e.length === 0 || e.length - t < e.highWaterMark) && (n = !0, y("length less than watermark", n)), e.ended || e.reading ? (n = !1, y("reading or ended", n)) : n && (y("do read"), e.reading = !0, e.sync = !0, e.length === 0 && (e.needReadable = !0), this._read(e.highWaterMark), e.sync = !1, e.reading || (t = et(r, e)));
1728
1641
  var i;
1729
- return t > 0 ? i = Bt(t, e) : i = null, i === null ? (e.needReadable = !0, t = 0) : e.length -= t, e.length === 0 && (e.ended || (e.needReadable = !0), r !== t && e.ended && De(this)), i !== null && this.emit("data", i), i;
1642
+ return t > 0 ? i = Ut(t, e) : i = null, i === null ? (e.needReadable = !0, t = 0) : e.length -= t, e.length === 0 && (e.ended || (e.needReadable = !0), r !== t && e.ended && De(this)), i !== null && this.emit("data", i), i;
1730
1643
  };
1731
- function On(t, e) {
1644
+ function rn(t, e) {
1732
1645
  var r = null;
1733
- return !T(e) && typeof e != "string" && e !== null && e !== void 0 && !t.objectMode && (r = new TypeError("Invalid non-string/buffer chunk")), r;
1646
+ return !L(e) && typeof e != "string" && e !== null && e !== void 0 && !t.objectMode && (r = new TypeError("Invalid non-string/buffer chunk")), r;
1734
1647
  }
1735
- function Cn(t, e) {
1648
+ function nn(t, e) {
1736
1649
  if (!e.ended) {
1737
1650
  if (e.decoder) {
1738
1651
  var r = e.decoder.end();
1739
1652
  r && r.length && (e.buffer.push(r), e.length += e.objectMode ? 1 : r.length);
1740
1653
  }
1741
- e.ended = !0, Re(t);
1654
+ e.ended = !0, Se(t);
1742
1655
  }
1743
1656
  }
1744
- function Re(t) {
1657
+ function Se(t) {
1745
1658
  var e = t._readableState;
1746
- e.needReadable = !1, e.emittedReadable || (y("emitReadable", e.flowing), e.emittedReadable = !0, e.sync ? D(et, t) : et(t));
1659
+ e.needReadable = !1, e.emittedReadable || (y("emitReadable", e.flowing), e.emittedReadable = !0, e.sync ? B(tt, t) : tt(t));
1747
1660
  }
1748
- function et(t) {
1661
+ function tt(t) {
1749
1662
  y("emit readable"), t.emit("readable"), Ye(t);
1750
1663
  }
1751
- function An(t, e) {
1752
- e.readingMore || (e.readingMore = !0, D(Ln, t, e));
1664
+ function on(t, e) {
1665
+ e.readingMore || (e.readingMore = !0, B(sn, t, e));
1753
1666
  }
1754
- function Ln(t, e) {
1667
+ function sn(t, e) {
1755
1668
  for (var r = e.length; !e.reading && !e.flowing && !e.ended && e.length < e.highWaterMark && (y("maybeReadMore read 0"), t.read(0), r !== e.length); )
1756
1669
  r = e.length;
1757
1670
  e.readingMore = !1;
@@ -1774,14 +1687,14 @@ E.prototype.pipe = function(t, e) {
1774
1687
  }
1775
1688
  n.pipesCount += 1, y("pipe count=%d opts=%j", n.pipesCount, e);
1776
1689
  var i = !e || e.end !== !1, o = i ? f : h;
1777
- n.endEmitted ? D(o) : r.once("end", o), t.on("unpipe", s);
1690
+ n.endEmitted ? B(o) : r.once("end", o), t.on("unpipe", s);
1778
1691
  function s(S) {
1779
1692
  y("onunpipe"), S === r && h();
1780
1693
  }
1781
1694
  function f() {
1782
1695
  y("onend"), t.end();
1783
1696
  }
1784
- var l = Tn(r);
1697
+ var l = fn(r);
1785
1698
  t.on("drain", l);
1786
1699
  var u = !1;
1787
1700
  function h() {
@@ -1792,26 +1705,26 @@ E.prototype.pipe = function(t, e) {
1792
1705
  function g(S) {
1793
1706
  y("ondata"), c = !1;
1794
1707
  var b = t.write(S);
1795
- b === !1 && !c && ((n.pipesCount === 1 && n.pipes === t || n.pipesCount > 1 && Ut(n.pipes, t) !== -1) && !u && (y("false write response, pause", r._readableState.awaitDrain), r._readableState.awaitDrain++, c = !0), r.pause());
1708
+ b === !1 && !c && ((n.pipesCount === 1 && n.pipes === t || n.pipesCount > 1 && kt(n.pipes, t) !== -1) && !u && (y("false write response, pause", r._readableState.awaitDrain), r._readableState.awaitDrain++, c = !0), r.pause());
1796
1709
  }
1797
1710
  function v(S) {
1798
- y("onerror", S), F(), t.removeListener("error", v), Sn(t, "error") === 0 && t.emit("error", S);
1711
+ y("onerror", S), D(), t.removeListener("error", v), Kr(t, "error") === 0 && t.emit("error", S);
1799
1712
  }
1800
- En(t, "error", v);
1713
+ Xr(t, "error", v);
1801
1714
  function A() {
1802
- t.removeListener("finish", x), F();
1715
+ t.removeListener("finish", x), D();
1803
1716
  }
1804
1717
  t.once("close", A);
1805
1718
  function x() {
1806
- y("onfinish"), t.removeListener("close", A), F();
1719
+ y("onfinish"), t.removeListener("close", A), D();
1807
1720
  }
1808
1721
  t.once("finish", x);
1809
- function F() {
1722
+ function D() {
1810
1723
  y("unpipe"), r.unpipe(t);
1811
1724
  }
1812
1725
  return t.emit("pipe", r), n.flowing || (y("pipe resume"), r.resume()), t;
1813
1726
  };
1814
- function Tn(t) {
1727
+ function fn(t) {
1815
1728
  return function() {
1816
1729
  var e = t._readableState;
1817
1730
  y("pipeOnDrain", e.awaitDrain), e.awaitDrain && e.awaitDrain--, e.awaitDrain === 0 && t.listeners("data").length && (e.flowing = !0, Ye(t));
@@ -1819,8 +1732,7 @@ function Tn(t) {
1819
1732
  }
1820
1733
  E.prototype.unpipe = function(t) {
1821
1734
  var e = this._readableState;
1822
- if (e.pipesCount === 0)
1823
- return this;
1735
+ if (e.pipesCount === 0) return this;
1824
1736
  if (e.pipesCount === 1)
1825
1737
  return t && t !== e.pipes ? this : (t || (t = e.pipes), e.pipes = null, e.pipesCount = 0, e.flowing = !1, t && t.emit("unpipe", this), this);
1826
1738
  if (!t) {
@@ -1830,7 +1742,7 @@ E.prototype.unpipe = function(t) {
1830
1742
  r[i].emit("unpipe", this);
1831
1743
  return this;
1832
1744
  }
1833
- var o = Ut(e.pipes, t);
1745
+ var o = kt(e.pipes, t);
1834
1746
  return o === -1 ? this : (e.pipes.splice(o, 1), e.pipesCount -= 1, e.pipesCount === 1 && (e.pipes = e.pipes[0]), t.emit("unpipe", this), this);
1835
1747
  };
1836
1748
  E.prototype.on = function(t, e) {
@@ -1839,22 +1751,22 @@ E.prototype.on = function(t, e) {
1839
1751
  this._readableState.flowing !== !1 && this.resume();
1840
1752
  else if (t === "readable") {
1841
1753
  var n = this._readableState;
1842
- !n.endEmitted && !n.readableListening && (n.readableListening = n.needReadable = !0, n.emittedReadable = !1, n.reading ? n.length && Re(this) : D(Nn, this));
1754
+ !n.endEmitted && !n.readableListening && (n.readableListening = n.needReadable = !0, n.emittedReadable = !1, n.reading ? n.length && Se(this) : B(an, this));
1843
1755
  }
1844
1756
  return r;
1845
1757
  };
1846
1758
  E.prototype.addListener = E.prototype.on;
1847
- function Nn(t) {
1759
+ function an(t) {
1848
1760
  y("readable nexttick read 0"), t.read(0);
1849
1761
  }
1850
1762
  E.prototype.resume = function() {
1851
1763
  var t = this._readableState;
1852
- return t.flowing || (y("resume"), t.flowing = !0, Dn(this, t)), this;
1764
+ return t.flowing || (y("resume"), t.flowing = !0, ln(this, t)), this;
1853
1765
  };
1854
- function Dn(t, e) {
1855
- e.resumeScheduled || (e.resumeScheduled = !0, D(Fn, t, e));
1766
+ function ln(t, e) {
1767
+ e.resumeScheduled || (e.resumeScheduled = !0, B(un, t, e));
1856
1768
  }
1857
- function Fn(t, e) {
1769
+ function un(t, e) {
1858
1770
  e.reading || (y("resume read 0"), t.read(0)), e.resumeScheduled = !1, e.awaitDrain = 0, t.emit("resume"), Ye(t), e.flowing && !e.reading && t.read(0);
1859
1771
  }
1860
1772
  E.prototype.pause = function() {
@@ -1880,30 +1792,29 @@ E.prototype.wrap = function(t) {
1880
1792
  }
1881
1793
  });
1882
1794
  for (var i in t)
1883
- this[i] === void 0 && typeof t[i] == "function" && (this[i] = /* @__PURE__ */ function(s) {
1795
+ this[i] === void 0 && typeof t[i] == "function" && (this[i] = /* @__PURE__ */ (function(s) {
1884
1796
  return function() {
1885
1797
  return t[s].apply(t, arguments);
1886
1798
  };
1887
- }(i));
1799
+ })(i));
1888
1800
  var o = ["error", "close", "destroy", "pause", "resume"];
1889
- return Pn(o, function(s) {
1801
+ return mn(o, function(s) {
1890
1802
  t.on(s, n.emit.bind(n, s));
1891
1803
  }), n._read = function(s) {
1892
1804
  y("wrapped _read", s), r && (r = !1, t.resume());
1893
1805
  }, n;
1894
1806
  };
1895
- E._fromList = Bt;
1896
- function Bt(t, e) {
1897
- if (e.length === 0)
1898
- return null;
1807
+ E._fromList = Ut;
1808
+ function Ut(t, e) {
1809
+ if (e.length === 0) return null;
1899
1810
  var r;
1900
- return e.objectMode ? r = e.buffer.shift() : !t || t >= e.length ? (e.decoder ? r = e.buffer.join("") : e.buffer.length === 1 ? r = e.buffer.head.data : r = e.buffer.concat(e.length), e.buffer.clear()) : r = Mn(t, e.buffer, e.decoder), r;
1811
+ return e.objectMode ? r = e.buffer.shift() : !t || t >= e.length ? (e.decoder ? r = e.buffer.join("") : e.buffer.length === 1 ? r = e.buffer.head.data : r = e.buffer.concat(e.length), e.buffer.clear()) : r = hn(t, e.buffer, e.decoder), r;
1901
1812
  }
1902
- function Mn(t, e, r) {
1813
+ function hn(t, e, r) {
1903
1814
  var n;
1904
- return t < e.head.data.length ? (n = e.head.data.slice(0, t), e.head.data = e.head.data.slice(t)) : t === e.head.data.length ? n = e.shift() : n = r ? Bn(t, e) : Un(t, e), n;
1815
+ return t < e.head.data.length ? (n = e.head.data.slice(0, t), e.head.data = e.head.data.slice(t)) : t === e.head.data.length ? n = e.shift() : n = r ? cn(t, e) : dn(t, e), n;
1905
1816
  }
1906
- function Bn(t, e) {
1817
+ function cn(t, e) {
1907
1818
  var r = e.head, n = 1, i = r.data;
1908
1819
  for (t -= i.length; r = r.next; ) {
1909
1820
  var o = r.data, s = t > o.length ? o.length : t;
@@ -1915,7 +1826,7 @@ function Bn(t, e) {
1915
1826
  }
1916
1827
  return e.length -= n, i;
1917
1828
  }
1918
- function Un(t, e) {
1829
+ function dn(t, e) {
1919
1830
  var r = a.allocUnsafe(t), n = e.head, i = 1;
1920
1831
  for (n.data.copy(r), t -= n.data.length; n = n.next; ) {
1921
1832
  var o = n.data, s = t > o.length ? o.length : t;
@@ -1929,42 +1840,40 @@ function Un(t, e) {
1929
1840
  }
1930
1841
  function De(t) {
1931
1842
  var e = t._readableState;
1932
- if (e.length > 0)
1933
- throw new Error('"endReadable()" called on non-empty stream');
1934
- e.endEmitted || (e.ended = !0, D(kn, e, t));
1843
+ if (e.length > 0) throw new Error('"endReadable()" called on non-empty stream');
1844
+ e.endEmitted || (e.ended = !0, B(pn, e, t));
1935
1845
  }
1936
- function kn(t, e) {
1846
+ function pn(t, e) {
1937
1847
  !t.endEmitted && t.length === 0 && (t.endEmitted = !0, e.readable = !1, e.emit("end"));
1938
1848
  }
1939
- function Pn(t, e) {
1849
+ function mn(t, e) {
1940
1850
  for (var r = 0, n = t.length; r < n; r++)
1941
1851
  e(t[r], r);
1942
1852
  }
1943
- function Ut(t, e) {
1853
+ function kt(t, e) {
1944
1854
  for (var r = 0, n = t.length; r < n; r++)
1945
- if (t[r] === e)
1946
- return r;
1855
+ if (t[r] === e) return r;
1947
1856
  return -1;
1948
1857
  }
1949
1858
  C.WritableState = We;
1950
- se(C, p);
1951
- function jn() {
1859
+ oe(C, p);
1860
+ function gn() {
1952
1861
  }
1953
- function $n(t, e, r) {
1862
+ function _n(t, e, r) {
1954
1863
  this.chunk = t, this.encoding = e, this.callback = r, this.next = null;
1955
1864
  }
1956
1865
  function We(t, e) {
1957
1866
  Object.defineProperty(this, "buffer", {
1958
- get: Tt(function() {
1867
+ get: Nt(function() {
1959
1868
  return this.getBuffer();
1960
1869
  }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")
1961
- }), t = t || {}, this.objectMode = !!t.objectMode, e instanceof B && (this.objectMode = this.objectMode || !!t.writableObjectMode);
1870
+ }), t = t || {}, this.objectMode = !!t.objectMode, e instanceof M && (this.objectMode = this.objectMode || !!t.writableObjectMode);
1962
1871
  var r = t.highWaterMark, n = this.objectMode ? 16 : 16 * 1024;
1963
1872
  this.highWaterMark = r || r === 0 ? r : n, this.highWaterMark = ~~this.highWaterMark, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1;
1964
1873
  var i = t.decodeStrings === !1;
1965
1874
  this.decodeStrings = !i, this.defaultEncoding = t.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(o) {
1966
- Qn(e, o);
1967
- }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new $t(this);
1875
+ Sn(e, o);
1876
+ }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new qt(this);
1968
1877
  }
1969
1878
  We.prototype.getBuffer = function() {
1970
1879
  for (var e = this.bufferedRequest, r = []; e; )
@@ -1972,24 +1881,23 @@ We.prototype.getBuffer = function() {
1972
1881
  return r;
1973
1882
  };
1974
1883
  function C(t) {
1975
- if (!(this instanceof C) && !(this instanceof B))
1976
- return new C(t);
1884
+ if (!(this instanceof C) && !(this instanceof M)) return new C(t);
1977
1885
  this._writableState = new We(t, this), this.writable = !0, t && (typeof t.write == "function" && (this._write = t.write), typeof t.writev == "function" && (this._writev = t.writev)), p.call(this);
1978
1886
  }
1979
1887
  C.prototype.pipe = function() {
1980
1888
  this.emit("error", new Error("Cannot pipe, not readable"));
1981
1889
  };
1982
- function qn(t, e) {
1890
+ function wn(t, e) {
1983
1891
  var r = new Error("write after end");
1984
- t.emit("error", r), D(e, r);
1892
+ t.emit("error", r), B(e, r);
1985
1893
  }
1986
- function zn(t, e, r, n) {
1894
+ function yn(t, e, r, n) {
1987
1895
  var i = !0, o = !1;
1988
- return r === null ? o = new TypeError("May not write null values to stream") : !a.isBuffer(r) && typeof r != "string" && r !== void 0 && !e.objectMode && (o = new TypeError("Invalid non-string/buffer chunk")), o && (t.emit("error", o), D(n, o), i = !1), i;
1896
+ return r === null ? o = new TypeError("May not write null values to stream") : !a.isBuffer(r) && typeof r != "string" && r !== void 0 && !e.objectMode && (o = new TypeError("Invalid non-string/buffer chunk")), o && (t.emit("error", o), B(n, o), i = !1), i;
1989
1897
  }
1990
1898
  C.prototype.write = function(t, e, r) {
1991
1899
  var n = this._writableState, i = !1;
1992
- return typeof e == "function" && (r = e, e = null), a.isBuffer(t) ? e = "buffer" : e || (e = n.defaultEncoding), typeof r != "function" && (r = jn), n.ended ? qn(this, r) : zn(this, n, t, r) && (n.pendingcb++, i = Jn(this, n, t, e, r)), i;
1900
+ return typeof e == "function" && (r = e, e = null), a.isBuffer(t) ? e = "buffer" : e || (e = n.defaultEncoding), typeof r != "function" && (r = gn), n.ended ? wn(this, r) : yn(this, n, t, r) && (n.pendingcb++, i = bn(this, n, t, e, r)), i;
1993
1901
  };
1994
1902
  C.prototype.cork = function() {
1995
1903
  var t = this._writableState;
@@ -1997,24 +1905,23 @@ C.prototype.cork = function() {
1997
1905
  };
1998
1906
  C.prototype.uncork = function() {
1999
1907
  var t = this._writableState;
2000
- t.corked && (t.corked--, !t.writing && !t.corked && !t.finished && !t.bufferProcessing && t.bufferedRequest && kt(this, t));
1908
+ t.corked && (t.corked--, !t.writing && !t.corked && !t.finished && !t.bufferProcessing && t.bufferedRequest && Pt(this, t));
2001
1909
  };
2002
1910
  C.prototype.setDefaultEncoding = function(e) {
2003
- if (typeof e == "string" && (e = e.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e + "").toLowerCase()) > -1))
2004
- throw new TypeError("Unknown encoding: " + e);
1911
+ if (typeof e == "string" && (e = e.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + e);
2005
1912
  return this._writableState.defaultEncoding = e, this;
2006
1913
  };
2007
- function Vn(t, e, r) {
1914
+ function vn(t, e, r) {
2008
1915
  return !t.objectMode && t.decodeStrings !== !1 && typeof e == "string" && (e = a.from(e, r)), e;
2009
1916
  }
2010
- function Jn(t, e, r, n, i) {
2011
- r = Vn(e, r, n), a.isBuffer(r) && (n = "buffer");
1917
+ function bn(t, e, r, n, i) {
1918
+ r = vn(e, r, n), a.isBuffer(r) && (n = "buffer");
2012
1919
  var o = e.objectMode ? 1 : r.length;
2013
1920
  e.length += o;
2014
1921
  var s = e.length < e.highWaterMark;
2015
1922
  if (s || (e.needDrain = !0), e.writing || e.corked) {
2016
1923
  var f = e.lastBufferedRequest;
2017
- e.lastBufferedRequest = new $n(r, n, i), f ? f.next = e.lastBufferedRequest : e.bufferedRequest = e.lastBufferedRequest, e.bufferedRequestCount += 1;
1924
+ e.lastBufferedRequest = new _n(r, n, i), f ? f.next = e.lastBufferedRequest : e.bufferedRequest = e.lastBufferedRequest, e.bufferedRequestCount += 1;
2018
1925
  } else
2019
1926
  Pe(t, e, !1, o, r, n, i);
2020
1927
  return s;
@@ -2022,28 +1929,27 @@ function Jn(t, e, r, n, i) {
2022
1929
  function Pe(t, e, r, n, i, o, s) {
2023
1930
  e.writelen = n, e.writecb = s, e.writing = !0, e.sync = !0, r ? t._writev(i, e.onwrite) : t._write(i, o, e.onwrite), e.sync = !1;
2024
1931
  }
2025
- function Yn(t, e, r, n, i) {
2026
- --e.pendingcb, r ? D(i, n) : i(n), t._writableState.errorEmitted = !0, t.emit("error", n);
1932
+ function xn(t, e, r, n, i) {
1933
+ --e.pendingcb, r ? B(i, n) : i(n), t._writableState.errorEmitted = !0, t.emit("error", n);
2027
1934
  }
2028
- function Wn(t) {
1935
+ function En(t) {
2029
1936
  t.writing = !1, t.writecb = null, t.length -= t.writelen, t.writelen = 0;
2030
1937
  }
2031
- function Qn(t, e) {
1938
+ function Sn(t, e) {
2032
1939
  var r = t._writableState, n = r.sync, i = r.writecb;
2033
- if (Wn(r), e)
2034
- Yn(t, r, n, e, i);
1940
+ if (En(r), e) xn(t, r, n, e, i);
2035
1941
  else {
2036
- var o = Pt(r);
2037
- !o && !r.corked && !r.bufferProcessing && r.bufferedRequest && kt(t, r), n ? D(tt, t, r, o, i) : tt(t, r, o, i);
1942
+ var o = jt(r);
1943
+ !o && !r.corked && !r.bufferProcessing && r.bufferedRequest && Pt(t, r), n ? B(rt, t, r, o, i) : rt(t, r, o, i);
2038
1944
  }
2039
1945
  }
2040
- function tt(t, e, r, n) {
2041
- r || Hn(t, e), e.pendingcb--, n(), jt(t, e);
1946
+ function rt(t, e, r, n) {
1947
+ r || Rn(t, e), e.pendingcb--, n(), $t(t, e);
2042
1948
  }
2043
- function Hn(t, e) {
1949
+ function Rn(t, e) {
2044
1950
  e.length === 0 && e.needDrain && (e.needDrain = !1, t.emit("drain"));
2045
1951
  }
2046
- function kt(t, e) {
1952
+ function Pt(t, e) {
2047
1953
  e.bufferProcessing = !0;
2048
1954
  var r = e.bufferedRequest;
2049
1955
  if (t._writev && r && r.next) {
@@ -2051,7 +1957,7 @@ function kt(t, e) {
2051
1957
  o.entry = r;
2052
1958
  for (var s = 0; r; )
2053
1959
  i[s] = r, r = r.next, s += 1;
2054
- Pe(t, e, !0, e.length, i, "", o.finish), e.pendingcb++, e.lastBufferedRequest = null, o.next ? (e.corkedRequestsFree = o.next, o.next = null) : e.corkedRequestsFree = new $t(e);
1960
+ Pe(t, e, !0, e.length, i, "", o.finish), e.pendingcb++, e.lastBufferedRequest = null, o.next ? (e.corkedRequestsFree = o.next, o.next = null) : e.corkedRequestsFree = new qt(e);
2055
1961
  } else {
2056
1962
  for (; r; ) {
2057
1963
  var f = r.chunk, l = r.encoding, u = r.callback, h = e.objectMode ? 1 : f.length;
@@ -2068,22 +1974,22 @@ C.prototype._write = function(t, e, r) {
2068
1974
  C.prototype._writev = null;
2069
1975
  C.prototype.end = function(t, e, r) {
2070
1976
  var n = this._writableState;
2071
- typeof t == "function" ? (r = t, t = null, e = null) : typeof e == "function" && (r = e, e = null), t != null && this.write(t, e), n.corked && (n.corked = 1, this.uncork()), !n.ending && !n.finished && Gn(this, n, r);
1977
+ typeof t == "function" ? (r = t, t = null, e = null) : typeof e == "function" && (r = e, e = null), t != null && this.write(t, e), n.corked && (n.corked = 1, this.uncork()), !n.ending && !n.finished && In(this, n, r);
2072
1978
  };
2073
- function Pt(t) {
1979
+ function jt(t) {
2074
1980
  return t.ending && t.length === 0 && t.bufferedRequest === null && !t.finished && !t.writing;
2075
1981
  }
2076
- function rt(t, e) {
1982
+ function nt(t, e) {
2077
1983
  e.prefinished || (e.prefinished = !0, t.emit("prefinish"));
2078
1984
  }
2079
- function jt(t, e) {
2080
- var r = Pt(e);
2081
- return r && (e.pendingcb === 0 ? (rt(t, e), e.finished = !0, t.emit("finish")) : rt(t, e)), r;
1985
+ function $t(t, e) {
1986
+ var r = jt(e);
1987
+ return r && (e.pendingcb === 0 ? (nt(t, e), e.finished = !0, t.emit("finish")) : nt(t, e)), r;
2082
1988
  }
2083
- function Gn(t, e, r) {
2084
- e.ending = !0, jt(t, e), r && (e.finished ? D(r) : t.once("finish", r)), e.ended = !0, t.writable = !1;
1989
+ function In(t, e, r) {
1990
+ e.ending = !0, $t(t, e), r && (e.finished ? B(r) : t.once("finish", r)), e.ended = !0, t.writable = !1;
2085
1991
  }
2086
- function $t(t) {
1992
+ function qt(t) {
2087
1993
  var e = this;
2088
1994
  this.next = null, this.entry = null, this.finish = function(r) {
2089
1995
  var n = e.entry;
@@ -2094,52 +2000,49 @@ function $t(t) {
2094
2000
  t.corkedRequestsFree ? t.corkedRequestsFree.next = e : t.corkedRequestsFree = e;
2095
2001
  };
2096
2002
  }
2097
- se(B, E);
2098
- var nt = Object.keys(C.prototype);
2099
- for (var Fe = 0; Fe < nt.length; Fe++) {
2100
- var Me = nt[Fe];
2101
- B.prototype[Me] || (B.prototype[Me] = C.prototype[Me]);
2003
+ oe(M, E);
2004
+ var it = Object.keys(C.prototype);
2005
+ for (var Fe = 0; Fe < it.length; Fe++) {
2006
+ var Me = it[Fe];
2007
+ M.prototype[Me] || (M.prototype[Me] = C.prototype[Me]);
2102
2008
  }
2103
- function B(t) {
2104
- if (!(this instanceof B))
2105
- return new B(t);
2106
- E.call(this, t), C.call(this, t), t && t.readable === !1 && (this.readable = !1), t && t.writable === !1 && (this.writable = !1), this.allowHalfOpen = !0, t && t.allowHalfOpen === !1 && (this.allowHalfOpen = !1), this.once("end", Zn);
2009
+ function M(t) {
2010
+ if (!(this instanceof M)) return new M(t);
2011
+ E.call(this, t), C.call(this, t), t && t.readable === !1 && (this.readable = !1), t && t.writable === !1 && (this.writable = !1), this.allowHalfOpen = !0, t && t.allowHalfOpen === !1 && (this.allowHalfOpen = !1), this.once("end", On);
2107
2012
  }
2108
- function Zn() {
2109
- this.allowHalfOpen || this._writableState.ended || D(Xn, this);
2013
+ function On() {
2014
+ this.allowHalfOpen || this._writableState.ended || B(Cn, this);
2110
2015
  }
2111
- function Xn(t) {
2016
+ function Cn(t) {
2112
2017
  t.end();
2113
2018
  }
2114
- se(k, B);
2115
- function Kn(t) {
2019
+ oe(k, M);
2020
+ function An(t) {
2116
2021
  this.afterTransform = function(e, r) {
2117
- return ei(t, e, r);
2022
+ return Tn(t, e, r);
2118
2023
  }, this.needTransform = !1, this.transforming = !1, this.writecb = null, this.writechunk = null, this.writeencoding = null;
2119
2024
  }
2120
- function ei(t, e, r) {
2025
+ function Tn(t, e, r) {
2121
2026
  var n = t._transformState;
2122
2027
  n.transforming = !1;
2123
2028
  var i = n.writecb;
2124
- if (!i)
2125
- return t.emit("error", new Error("no writecb in Transform class"));
2029
+ if (!i) return t.emit("error", new Error("no writecb in Transform class"));
2126
2030
  n.writechunk = null, n.writecb = null, r != null && t.push(r), i(e);
2127
2031
  var o = t._readableState;
2128
2032
  o.reading = !1, (o.needReadable || o.length < o.highWaterMark) && t._read(o.highWaterMark);
2129
2033
  }
2130
2034
  function k(t) {
2131
- if (!(this instanceof k))
2132
- return new k(t);
2133
- B.call(this, t), this._transformState = new Kn(this);
2035
+ if (!(this instanceof k)) return new k(t);
2036
+ M.call(this, t), this._transformState = new An(this);
2134
2037
  var e = this;
2135
2038
  this._readableState.needReadable = !0, this._readableState.sync = !1, t && (typeof t.transform == "function" && (this._transform = t.transform), typeof t.flush == "function" && (this._flush = t.flush)), this.once("prefinish", function() {
2136
2039
  typeof this._flush == "function" ? this._flush(function(r) {
2137
- it(e, r);
2138
- }) : it(e);
2040
+ ot(e, r);
2041
+ }) : ot(e);
2139
2042
  });
2140
2043
  }
2141
2044
  k.prototype.push = function(t, e) {
2142
- return this._transformState.needTransform = !1, B.prototype.push.call(this, t, e);
2045
+ return this._transformState.needTransform = !1, M.prototype.push.call(this, t, e);
2143
2046
  };
2144
2047
  k.prototype._transform = function(t, e, r) {
2145
2048
  throw new Error("Not implemented");
@@ -2155,36 +2058,32 @@ k.prototype._read = function(t) {
2155
2058
  var e = this._transformState;
2156
2059
  e.writechunk !== null && e.writecb && !e.transforming ? (e.transforming = !0, this._transform(e.writechunk, e.writeencoding, e.afterTransform)) : e.needTransform = !0;
2157
2060
  };
2158
- function it(t, e) {
2159
- if (e)
2160
- return t.emit("error", e);
2061
+ function ot(t, e) {
2062
+ if (e) return t.emit("error", e);
2161
2063
  var r = t._writableState, n = t._transformState;
2162
- if (r.length)
2163
- throw new Error("Calling transform done when ws.length != 0");
2164
- if (n.transforming)
2165
- throw new Error("Calling transform done when still transforming");
2064
+ if (r.length) throw new Error("Calling transform done when ws.length != 0");
2065
+ if (n.transforming) throw new Error("Calling transform done when still transforming");
2166
2066
  return t.push(null);
2167
2067
  }
2168
- se(le, k);
2169
- function le(t) {
2170
- if (!(this instanceof le))
2171
- return new le(t);
2068
+ oe(fe, k);
2069
+ function fe(t) {
2070
+ if (!(this instanceof fe)) return new fe(t);
2172
2071
  k.call(this, t);
2173
2072
  }
2174
- le.prototype._transform = function(t, e, r) {
2073
+ fe.prototype._transform = function(t, e, r) {
2175
2074
  r(null, t);
2176
2075
  };
2177
- se(z, p);
2178
- z.Readable = E;
2179
- z.Writable = C;
2180
- z.Duplex = B;
2181
- z.Transform = k;
2182
- z.PassThrough = le;
2183
- z.Stream = z;
2184
- function z() {
2076
+ oe(V, p);
2077
+ V.Readable = E;
2078
+ V.Writable = C;
2079
+ V.Duplex = M;
2080
+ V.Transform = k;
2081
+ V.PassThrough = fe;
2082
+ V.Stream = V;
2083
+ function V() {
2185
2084
  p.call(this);
2186
2085
  }
2187
- z.prototype.pipe = function(t, e) {
2086
+ V.prototype.pipe = function(t, e) {
2188
2087
  var r = this;
2189
2088
  function n(h) {
2190
2089
  t.writable && t.write(h) === !1 && r.pause && r.pause();
@@ -2211,7 +2110,7 @@ z.prototype.pipe = function(t, e) {
2211
2110
  }
2212
2111
  return r.on("end", u), r.on("close", u), t.on("close", u), t.emit("pipe", r), t;
2213
2112
  };
2214
- const qt = function(t) {
2113
+ const zt = function(t) {
2215
2114
  return typeof t == "object" && t !== null && !Array.isArray(t);
2216
2115
  };
2217
2116
  class m extends Error {
@@ -2220,11 +2119,11 @@ class m extends Error {
2220
2119
  for (const o of i)
2221
2120
  for (const s in o) {
2222
2121
  const f = o[s];
2223
- this[s] = T(f) ? f.toString(n.encoding) : f == null ? f : JSON.parse(JSON.stringify(f));
2122
+ this[s] = L(f) ? f.toString(n.encoding) : f == null ? f : JSON.parse(JSON.stringify(f));
2224
2123
  }
2225
2124
  }
2226
2125
  }
2227
- const zt = function(t) {
2126
+ const Vt = function(t) {
2228
2127
  const e = [];
2229
2128
  for (let r = 0, n = t.length; r < n; r++) {
2230
2129
  const i = t[r];
@@ -2232,7 +2131,7 @@ const zt = function(t) {
2232
2131
  e[r] = { disabled: !0 };
2233
2132
  else if (typeof i == "string")
2234
2133
  e[r] = { name: i };
2235
- else if (qt(i)) {
2134
+ else if (zt(i)) {
2236
2135
  if (typeof i.name != "string")
2237
2136
  throw new m("CSV_OPTION_COLUMNS_MISSING_NAME", [
2238
2137
  "Option columns missing name:",
@@ -2249,12 +2148,12 @@ const zt = function(t) {
2249
2148
  }
2250
2149
  return e;
2251
2150
  };
2252
- class ot {
2151
+ class st {
2253
2152
  constructor(e = 100) {
2254
2153
  this.size = e, this.length = 0, this.buf = a.allocUnsafe(e);
2255
2154
  }
2256
2155
  prepend(e) {
2257
- if (T(e)) {
2156
+ if (L(e)) {
2258
2157
  const r = this.length + e.length;
2259
2158
  if (r >= this.size && (this.resize(), r >= this.size))
2260
2159
  throw Error("INVALID_BUFFER_STATE");
@@ -2290,7 +2189,7 @@ class ot {
2290
2189
  this.length = 0;
2291
2190
  }
2292
2191
  }
2293
- const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
2192
+ const Ln = 12, Nn = 13, Dn = 10, Fn = 32, Mn = 9, Bn = function(t) {
2294
2193
  return {
2295
2194
  bomSkipped: !1,
2296
2195
  bufBytesStart: 0,
@@ -2300,10 +2199,10 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
2300
2199
  error: void 0,
2301
2200
  enabled: t.from_line === 1,
2302
2201
  escaping: !1,
2303
- escapeIsQuote: T(t.escape) && T(t.quote) && a.compare(t.escape, t.quote) === 0,
2202
+ escapeIsQuote: L(t.escape) && L(t.quote) && a.compare(t.escape, t.quote) === 0,
2304
2203
  // columns can be `false`, `true`, `Array`
2305
2204
  expectedRecordLength: Array.isArray(t.columns) ? t.columns.length : void 0,
2306
- field: new ot(20),
2205
+ field: new st(20),
2307
2206
  firstLineToHeaders: t.cast_first_line_to_header,
2308
2207
  needMoreDataSize: Math.max(
2309
2208
  // Skip if the remaining buffer smaller than comment
@@ -2315,58 +2214,73 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
2315
2214
  previousBuf: void 0,
2316
2215
  quoting: !1,
2317
2216
  stop: !1,
2318
- rawBuffer: new ot(100),
2217
+ rawBuffer: new st(100),
2319
2218
  record: [],
2320
2219
  recordHasError: !1,
2321
2220
  record_length: 0,
2322
2221
  recordDelimiterMaxLength: t.record_delimiter.length === 0 ? 0 : Math.max(...t.record_delimiter.map((e) => e.length)),
2323
- trimChars: [a.from(" ", t.encoding)[0], a.from(" ", t.encoding)[0]],
2222
+ trimChars: [
2223
+ a.from(" ", t.encoding)[0],
2224
+ a.from(" ", t.encoding)[0]
2225
+ ],
2324
2226
  wasQuoting: !1,
2325
2227
  wasRowDelimiter: !1,
2326
2228
  timchars: [
2327
- a.from(a.from([ri], "utf8").toString(), t.encoding),
2328
- a.from(a.from([ni], "utf8").toString(), t.encoding),
2329
- a.from(a.from([ti], "utf8").toString(), t.encoding),
2330
- a.from(a.from([ii], "utf8").toString(), t.encoding),
2331
- a.from(a.from([oi], "utf8").toString(), t.encoding)
2229
+ a.from(a.from([Nn], "utf8").toString(), t.encoding),
2230
+ a.from(a.from([Dn], "utf8").toString(), t.encoding),
2231
+ a.from(a.from([Ln], "utf8").toString(), t.encoding),
2232
+ a.from(a.from([Fn], "utf8").toString(), t.encoding),
2233
+ a.from(a.from([Mn], "utf8").toString(), t.encoding)
2332
2234
  ]
2333
2235
  };
2334
- }, fi = function(t) {
2236
+ }, Un = function(t) {
2335
2237
  return t.replace(/([A-Z])/g, function(e, r) {
2336
2238
  return "_" + r.toLowerCase();
2337
2239
  });
2338
- }, st = function(t) {
2240
+ }, ft = function(t) {
2339
2241
  const e = {};
2340
2242
  for (const n in t)
2341
- e[fi(n)] = t[n];
2243
+ e[Un(n)] = t[n];
2342
2244
  if (e.encoding === void 0 || e.encoding === !0)
2343
2245
  e.encoding = "utf8";
2344
2246
  else if (e.encoding === null || e.encoding === !1)
2345
2247
  e.encoding = null;
2346
2248
  else if (typeof e.encoding != "string" && e.encoding !== null)
2347
- throw new m("CSV_INVALID_OPTION_ENCODING", [
2348
- "Invalid option encoding:",
2349
- "encoding must be a string or null to return a buffer,",
2350
- `got ${JSON.stringify(e.encoding)}`
2351
- ], e);
2249
+ throw new m(
2250
+ "CSV_INVALID_OPTION_ENCODING",
2251
+ [
2252
+ "Invalid option encoding:",
2253
+ "encoding must be a string or null to return a buffer,",
2254
+ `got ${JSON.stringify(e.encoding)}`
2255
+ ],
2256
+ e
2257
+ );
2352
2258
  if (e.bom === void 0 || e.bom === null || e.bom === !1)
2353
2259
  e.bom = !1;
2354
2260
  else if (e.bom !== !0)
2355
- throw new m("CSV_INVALID_OPTION_BOM", [
2356
- "Invalid option bom:",
2357
- "bom must be true,",
2358
- `got ${JSON.stringify(e.bom)}`
2359
- ], e);
2261
+ throw new m(
2262
+ "CSV_INVALID_OPTION_BOM",
2263
+ [
2264
+ "Invalid option bom:",
2265
+ "bom must be true,",
2266
+ `got ${JSON.stringify(e.bom)}`
2267
+ ],
2268
+ e
2269
+ );
2360
2270
  if (e.cast_function = null, e.cast === void 0 || e.cast === null || e.cast === !1 || e.cast === "")
2361
2271
  e.cast = void 0;
2362
2272
  else if (typeof e.cast == "function")
2363
2273
  e.cast_function = e.cast, e.cast = !0;
2364
2274
  else if (e.cast !== !0)
2365
- throw new m("CSV_INVALID_OPTION_CAST", [
2366
- "Invalid option cast:",
2367
- "cast must be true or a function,",
2368
- `got ${JSON.stringify(e.cast)}`
2369
- ], e);
2275
+ throw new m(
2276
+ "CSV_INVALID_OPTION_CAST",
2277
+ [
2278
+ "Invalid option cast:",
2279
+ "cast must be true or a function,",
2280
+ `got ${JSON.stringify(e.cast)}`
2281
+ ],
2282
+ e
2283
+ );
2370
2284
  if (e.cast_date === void 0 || e.cast_date === null || e.cast_date === !1 || e.cast_date === "")
2371
2285
  e.cast_date = !1;
2372
2286
  else if (e.cast_date === !0)
@@ -2375,246 +2289,357 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
2375
2289
  return isNaN(i) ? n : new Date(i);
2376
2290
  };
2377
2291
  else if (typeof e.cast_date != "function")
2378
- throw new m("CSV_INVALID_OPTION_CAST_DATE", [
2379
- "Invalid option cast_date:",
2380
- "cast_date must be true or a function,",
2381
- `got ${JSON.stringify(e.cast_date)}`
2382
- ], e);
2383
- if (e.cast_first_line_to_header = null, e.columns === !0)
2292
+ throw new m(
2293
+ "CSV_INVALID_OPTION_CAST_DATE",
2294
+ [
2295
+ "Invalid option cast_date:",
2296
+ "cast_date must be true or a function,",
2297
+ `got ${JSON.stringify(e.cast_date)}`
2298
+ ],
2299
+ e
2300
+ );
2301
+ if (e.cast_first_line_to_header = void 0, e.columns === !0)
2384
2302
  e.cast_first_line_to_header = void 0;
2385
2303
  else if (typeof e.columns == "function")
2386
2304
  e.cast_first_line_to_header = e.columns, e.columns = !0;
2387
2305
  else if (Array.isArray(e.columns))
2388
- e.columns = zt(e.columns);
2306
+ e.columns = Vt(e.columns);
2389
2307
  else if (e.columns === void 0 || e.columns === null || e.columns === !1)
2390
2308
  e.columns = !1;
2391
2309
  else
2392
- throw new m("CSV_INVALID_OPTION_COLUMNS", [
2393
- "Invalid option columns:",
2394
- "expect an array, a function or true,",
2395
- `got ${JSON.stringify(e.columns)}`
2396
- ], e);
2310
+ throw new m(
2311
+ "CSV_INVALID_OPTION_COLUMNS",
2312
+ [
2313
+ "Invalid option columns:",
2314
+ "expect an array, a function or true,",
2315
+ `got ${JSON.stringify(e.columns)}`
2316
+ ],
2317
+ e
2318
+ );
2397
2319
  if (e.group_columns_by_name === void 0 || e.group_columns_by_name === null || e.group_columns_by_name === !1)
2398
2320
  e.group_columns_by_name = !1;
2399
2321
  else {
2400
2322
  if (e.group_columns_by_name !== !0)
2401
- throw new m("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME", [
2402
- "Invalid option group_columns_by_name:",
2403
- "expect an boolean,",
2404
- `got ${JSON.stringify(e.group_columns_by_name)}`
2405
- ], e);
2323
+ throw new m(
2324
+ "CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",
2325
+ [
2326
+ "Invalid option group_columns_by_name:",
2327
+ "expect an boolean,",
2328
+ `got ${JSON.stringify(e.group_columns_by_name)}`
2329
+ ],
2330
+ e
2331
+ );
2406
2332
  if (e.columns === !1)
2407
- throw new m("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME", [
2408
- "Invalid option group_columns_by_name:",
2409
- "the `columns` mode must be activated."
2410
- ], e);
2333
+ throw new m(
2334
+ "CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",
2335
+ [
2336
+ "Invalid option group_columns_by_name:",
2337
+ "the `columns` mode must be activated."
2338
+ ],
2339
+ e
2340
+ );
2411
2341
  }
2412
2342
  if (e.comment === void 0 || e.comment === null || e.comment === !1 || e.comment === "")
2413
2343
  e.comment = null;
2414
- else if (typeof e.comment == "string" && (e.comment = a.from(e.comment, e.encoding)), !T(e.comment))
2415
- throw new m("CSV_INVALID_OPTION_COMMENT", [
2416
- "Invalid option comment:",
2417
- "comment must be a buffer or a string,",
2418
- `got ${JSON.stringify(e.comment)}`
2419
- ], e);
2344
+ else if (typeof e.comment == "string" && (e.comment = a.from(e.comment, e.encoding)), !L(e.comment))
2345
+ throw new m(
2346
+ "CSV_INVALID_OPTION_COMMENT",
2347
+ [
2348
+ "Invalid option comment:",
2349
+ "comment must be a buffer or a string,",
2350
+ `got ${JSON.stringify(e.comment)}`
2351
+ ],
2352
+ e
2353
+ );
2420
2354
  if (e.comment_no_infix === void 0 || e.comment_no_infix === null || e.comment_no_infix === !1)
2421
2355
  e.comment_no_infix = !1;
2422
2356
  else if (e.comment_no_infix !== !0)
2423
- throw new m("CSV_INVALID_OPTION_COMMENT", [
2424
- "Invalid option comment_no_infix:",
2425
- "value must be a boolean,",
2426
- `got ${JSON.stringify(e.comment_no_infix)}`
2427
- ], e);
2357
+ throw new m(
2358
+ "CSV_INVALID_OPTION_COMMENT",
2359
+ [
2360
+ "Invalid option comment_no_infix:",
2361
+ "value must be a boolean,",
2362
+ `got ${JSON.stringify(e.comment_no_infix)}`
2363
+ ],
2364
+ e
2365
+ );
2428
2366
  const r = JSON.stringify(e.delimiter);
2429
2367
  if (Array.isArray(e.delimiter) || (e.delimiter = [e.delimiter]), e.delimiter.length === 0)
2430
- throw new m("CSV_INVALID_OPTION_DELIMITER", [
2431
- "Invalid option delimiter:",
2432
- "delimiter must be a non empty string or buffer or array of string|buffer,",
2433
- `got ${r}`
2434
- ], e);
2435
- if (e.delimiter = e.delimiter.map(function(n) {
2436
- if (n == null || n === !1)
2437
- return a.from(",", e.encoding);
2438
- if (typeof n == "string" && (n = a.from(n, e.encoding)), !T(n) || n.length === 0)
2439
- throw new m("CSV_INVALID_OPTION_DELIMITER", [
2368
+ throw new m(
2369
+ "CSV_INVALID_OPTION_DELIMITER",
2370
+ [
2440
2371
  "Invalid option delimiter:",
2441
2372
  "delimiter must be a non empty string or buffer or array of string|buffer,",
2442
2373
  `got ${r}`
2443
- ], e);
2374
+ ],
2375
+ e
2376
+ );
2377
+ if (e.delimiter = e.delimiter.map(function(n) {
2378
+ if (n == null || n === !1)
2379
+ return a.from(",", e.encoding);
2380
+ if (typeof n == "string" && (n = a.from(n, e.encoding)), !L(n) || n.length === 0)
2381
+ throw new m(
2382
+ "CSV_INVALID_OPTION_DELIMITER",
2383
+ [
2384
+ "Invalid option delimiter:",
2385
+ "delimiter must be a non empty string or buffer or array of string|buffer,",
2386
+ `got ${r}`
2387
+ ],
2388
+ e
2389
+ );
2444
2390
  return n;
2445
- }), e.escape === void 0 || e.escape === !0 ? e.escape = a.from('"', e.encoding) : typeof e.escape == "string" ? e.escape = a.from(e.escape, e.encoding) : (e.escape === null || e.escape === !1) && (e.escape = null), e.escape !== null && !T(e.escape))
2446
- throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);
2391
+ }), e.escape === void 0 || e.escape === !0 ? e.escape = a.from('"', e.encoding) : typeof e.escape == "string" ? e.escape = a.from(e.escape, e.encoding) : (e.escape === null || e.escape === !1) && (e.escape = null), e.escape !== null && !L(e.escape))
2392
+ throw new Error(
2393
+ `Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`
2394
+ );
2447
2395
  if (e.from === void 0 || e.from === null)
2448
2396
  e.from = 1;
2449
2397
  else if (typeof e.from == "string" && /\d+/.test(e.from) && (e.from = parseInt(e.from)), Number.isInteger(e.from)) {
2450
2398
  if (e.from < 0)
2451
- throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(t.from)}`);
2399
+ throw new Error(
2400
+ `Invalid Option: from must be a positive integer, got ${JSON.stringify(t.from)}`
2401
+ );
2452
2402
  } else
2453
- throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);
2403
+ throw new Error(
2404
+ `Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`
2405
+ );
2454
2406
  if (e.from_line === void 0 || e.from_line === null)
2455
2407
  e.from_line = 1;
2456
2408
  else if (typeof e.from_line == "string" && /\d+/.test(e.from_line) && (e.from_line = parseInt(e.from_line)), Number.isInteger(e.from_line)) {
2457
2409
  if (e.from_line <= 0)
2458
- throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(t.from_line)}`);
2410
+ throw new Error(
2411
+ `Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(t.from_line)}`
2412
+ );
2459
2413
  } else
2460
- throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(t.from_line)}`);
2414
+ throw new Error(
2415
+ `Invalid Option: from_line must be an integer, got ${JSON.stringify(t.from_line)}`
2416
+ );
2461
2417
  if (e.ignore_last_delimiters === void 0 || e.ignore_last_delimiters === null)
2462
2418
  e.ignore_last_delimiters = !1;
2463
2419
  else if (typeof e.ignore_last_delimiters == "number")
2464
2420
  e.ignore_last_delimiters = Math.floor(e.ignore_last_delimiters), e.ignore_last_delimiters === 0 && (e.ignore_last_delimiters = !1);
2465
2421
  else if (typeof e.ignore_last_delimiters != "boolean")
2466
- throw new m("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS", [
2467
- "Invalid option `ignore_last_delimiters`:",
2468
- "the value must be a boolean value or an integer,",
2469
- `got ${JSON.stringify(e.ignore_last_delimiters)}`
2470
- ], e);
2422
+ throw new m(
2423
+ "CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",
2424
+ [
2425
+ "Invalid option `ignore_last_delimiters`:",
2426
+ "the value must be a boolean value or an integer,",
2427
+ `got ${JSON.stringify(e.ignore_last_delimiters)}`
2428
+ ],
2429
+ e
2430
+ );
2471
2431
  if (e.ignore_last_delimiters === !0 && e.columns === !1)
2472
- throw new m("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS", [
2473
- "The option `ignore_last_delimiters`",
2474
- "requires the activation of the `columns` option"
2475
- ], e);
2432
+ throw new m(
2433
+ "CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",
2434
+ [
2435
+ "The option `ignore_last_delimiters`",
2436
+ "requires the activation of the `columns` option"
2437
+ ],
2438
+ e
2439
+ );
2476
2440
  if (e.info === void 0 || e.info === null || e.info === !1)
2477
2441
  e.info = !1;
2478
2442
  else if (e.info !== !0)
2479
- throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);
2443
+ throw new Error(
2444
+ `Invalid Option: info must be true, got ${JSON.stringify(e.info)}`
2445
+ );
2480
2446
  if (e.max_record_size === void 0 || e.max_record_size === null || e.max_record_size === !1)
2481
2447
  e.max_record_size = 0;
2482
- else if (!(Number.isInteger(e.max_record_size) && e.max_record_size >= 0))
2483
- if (typeof e.max_record_size == "string" && /\d+/.test(e.max_record_size))
2484
- e.max_record_size = parseInt(e.max_record_size);
2485
- else
2486
- throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);
2448
+ else if (!(Number.isInteger(e.max_record_size) && e.max_record_size >= 0)) if (typeof e.max_record_size == "string" && /\d+/.test(e.max_record_size))
2449
+ e.max_record_size = parseInt(e.max_record_size);
2450
+ else
2451
+ throw new Error(
2452
+ `Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`
2453
+ );
2487
2454
  if (e.objname === void 0 || e.objname === null || e.objname === !1)
2488
2455
  e.objname = void 0;
2489
- else if (T(e.objname)) {
2456
+ else if (L(e.objname)) {
2490
2457
  if (e.objname.length === 0)
2491
2458
  throw new Error("Invalid Option: objname must be a non empty buffer");
2492
2459
  e.encoding === null || (e.objname = e.objname.toString(e.encoding));
2493
2460
  } else if (typeof e.objname == "string") {
2494
2461
  if (e.objname.length === 0)
2495
2462
  throw new Error("Invalid Option: objname must be a non empty string");
2496
- } else if (typeof e.objname != "number")
2497
- throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);
2463
+ } else if (typeof e.objname != "number") throw new Error(
2464
+ `Invalid Option: objname must be a string or a buffer, got ${e.objname}`
2465
+ );
2498
2466
  if (e.objname !== void 0) {
2499
2467
  if (typeof e.objname == "number") {
2500
2468
  if (e.columns !== !1)
2501
- throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field");
2469
+ throw Error(
2470
+ "Invalid Option: objname index cannot be combined with columns or be defined as a field"
2471
+ );
2502
2472
  } else if (e.columns === !1)
2503
- throw Error("Invalid Option: objname field must be combined with columns or be defined as an index");
2473
+ throw Error(
2474
+ "Invalid Option: objname field must be combined with columns or be defined as an index"
2475
+ );
2504
2476
  }
2505
2477
  if (e.on_record === void 0 || e.on_record === null)
2506
2478
  e.on_record = void 0;
2507
2479
  else if (typeof e.on_record != "function")
2508
- throw new m("CSV_INVALID_OPTION_ON_RECORD", [
2509
- "Invalid option `on_record`:",
2510
- "expect a function,",
2511
- `got ${JSON.stringify(e.on_record)}`
2512
- ], e);
2480
+ throw new m(
2481
+ "CSV_INVALID_OPTION_ON_RECORD",
2482
+ [
2483
+ "Invalid option `on_record`:",
2484
+ "expect a function,",
2485
+ `got ${JSON.stringify(e.on_record)}`
2486
+ ],
2487
+ e
2488
+ );
2489
+ if (e.on_skip !== void 0 && e.on_skip !== null && typeof e.on_skip != "function")
2490
+ throw new Error(
2491
+ `Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`
2492
+ );
2513
2493
  if (e.quote === null || e.quote === !1 || e.quote === "")
2514
2494
  e.quote = null;
2515
- else if (e.quote === void 0 || e.quote === !0 ? e.quote = a.from('"', e.encoding) : typeof e.quote == "string" && (e.quote = a.from(e.quote, e.encoding)), !T(e.quote))
2516
- throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);
2495
+ else if (e.quote === void 0 || e.quote === !0 ? e.quote = a.from('"', e.encoding) : typeof e.quote == "string" && (e.quote = a.from(e.quote, e.encoding)), !L(e.quote))
2496
+ throw new Error(
2497
+ `Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`
2498
+ );
2517
2499
  if (e.raw === void 0 || e.raw === null || e.raw === !1)
2518
2500
  e.raw = !1;
2519
2501
  else if (e.raw !== !0)
2520
- throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);
2502
+ throw new Error(
2503
+ `Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`
2504
+ );
2521
2505
  if (e.record_delimiter === void 0)
2522
2506
  e.record_delimiter = [];
2523
- else if (typeof e.record_delimiter == "string" || T(e.record_delimiter)) {
2507
+ else if (typeof e.record_delimiter == "string" || L(e.record_delimiter)) {
2524
2508
  if (e.record_delimiter.length === 0)
2525
- throw new m("CSV_INVALID_OPTION_RECORD_DELIMITER", [
2526
- "Invalid option `record_delimiter`:",
2527
- "value must be a non empty string or buffer,",
2528
- `got ${JSON.stringify(e.record_delimiter)}`
2529
- ], e);
2509
+ throw new m(
2510
+ "CSV_INVALID_OPTION_RECORD_DELIMITER",
2511
+ [
2512
+ "Invalid option `record_delimiter`:",
2513
+ "value must be a non empty string or buffer,",
2514
+ `got ${JSON.stringify(e.record_delimiter)}`
2515
+ ],
2516
+ e
2517
+ );
2530
2518
  e.record_delimiter = [e.record_delimiter];
2531
2519
  } else if (!Array.isArray(e.record_delimiter))
2532
- throw new m("CSV_INVALID_OPTION_RECORD_DELIMITER", [
2533
- "Invalid option `record_delimiter`:",
2534
- "value must be a string, a buffer or array of string|buffer,",
2535
- `got ${JSON.stringify(e.record_delimiter)}`
2536
- ], e);
2537
- if (e.record_delimiter = e.record_delimiter.map(function(n, i) {
2538
- if (typeof n != "string" && !T(n))
2539
- throw new m("CSV_INVALID_OPTION_RECORD_DELIMITER", [
2520
+ throw new m(
2521
+ "CSV_INVALID_OPTION_RECORD_DELIMITER",
2522
+ [
2540
2523
  "Invalid option `record_delimiter`:",
2541
- "value must be a string, a buffer or array of string|buffer",
2542
- `at index ${i},`,
2543
- `got ${JSON.stringify(n)}`
2544
- ], e);
2524
+ "value must be a string, a buffer or array of string|buffer,",
2525
+ `got ${JSON.stringify(e.record_delimiter)}`
2526
+ ],
2527
+ e
2528
+ );
2529
+ if (e.record_delimiter = e.record_delimiter.map(function(n, i) {
2530
+ if (typeof n != "string" && !L(n))
2531
+ throw new m(
2532
+ "CSV_INVALID_OPTION_RECORD_DELIMITER",
2533
+ [
2534
+ "Invalid option `record_delimiter`:",
2535
+ "value must be a string, a buffer or array of string|buffer",
2536
+ `at index ${i},`,
2537
+ `got ${JSON.stringify(n)}`
2538
+ ],
2539
+ e
2540
+ );
2545
2541
  if (n.length === 0)
2546
- throw new m("CSV_INVALID_OPTION_RECORD_DELIMITER", [
2547
- "Invalid option `record_delimiter`:",
2548
- "value must be a non empty string or buffer",
2549
- `at index ${i},`,
2550
- `got ${JSON.stringify(n)}`
2551
- ], e);
2542
+ throw new m(
2543
+ "CSV_INVALID_OPTION_RECORD_DELIMITER",
2544
+ [
2545
+ "Invalid option `record_delimiter`:",
2546
+ "value must be a non empty string or buffer",
2547
+ `at index ${i},`,
2548
+ `got ${JSON.stringify(n)}`
2549
+ ],
2550
+ e
2551
+ );
2552
2552
  return typeof n == "string" && (n = a.from(n, e.encoding)), n;
2553
- }), typeof e.relax_column_count != "boolean")
2554
- if (e.relax_column_count === void 0 || e.relax_column_count === null)
2555
- e.relax_column_count = !1;
2556
- else
2557
- throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);
2558
- if (typeof e.relax_column_count_less != "boolean")
2559
- if (e.relax_column_count_less === void 0 || e.relax_column_count_less === null)
2560
- e.relax_column_count_less = !1;
2561
- else
2562
- throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);
2563
- if (typeof e.relax_column_count_more != "boolean")
2564
- if (e.relax_column_count_more === void 0 || e.relax_column_count_more === null)
2565
- e.relax_column_count_more = !1;
2566
- else
2567
- throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);
2568
- if (typeof e.relax_quotes != "boolean")
2569
- if (e.relax_quotes === void 0 || e.relax_quotes === null)
2570
- e.relax_quotes = !1;
2571
- else
2572
- throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);
2573
- if (typeof e.skip_empty_lines != "boolean")
2574
- if (e.skip_empty_lines === void 0 || e.skip_empty_lines === null)
2575
- e.skip_empty_lines = !1;
2576
- else
2577
- throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);
2578
- if (typeof e.skip_records_with_empty_values != "boolean")
2579
- if (e.skip_records_with_empty_values === void 0 || e.skip_records_with_empty_values === null)
2580
- e.skip_records_with_empty_values = !1;
2581
- else
2582
- throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);
2583
- if (typeof e.skip_records_with_error != "boolean")
2584
- if (e.skip_records_with_error === void 0 || e.skip_records_with_error === null)
2585
- e.skip_records_with_error = !1;
2586
- else
2587
- throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);
2553
+ }), typeof e.relax_column_count != "boolean") if (e.relax_column_count === void 0 || e.relax_column_count === null)
2554
+ e.relax_column_count = !1;
2555
+ else
2556
+ throw new Error(
2557
+ `Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`
2558
+ );
2559
+ if (typeof e.relax_column_count_less != "boolean") if (e.relax_column_count_less === void 0 || e.relax_column_count_less === null)
2560
+ e.relax_column_count_less = !1;
2561
+ else
2562
+ throw new Error(
2563
+ `Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`
2564
+ );
2565
+ if (typeof e.relax_column_count_more != "boolean") if (e.relax_column_count_more === void 0 || e.relax_column_count_more === null)
2566
+ e.relax_column_count_more = !1;
2567
+ else
2568
+ throw new Error(
2569
+ `Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`
2570
+ );
2571
+ if (typeof e.relax_quotes != "boolean") if (e.relax_quotes === void 0 || e.relax_quotes === null)
2572
+ e.relax_quotes = !1;
2573
+ else
2574
+ throw new Error(
2575
+ `Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`
2576
+ );
2577
+ if (typeof e.skip_empty_lines != "boolean") if (e.skip_empty_lines === void 0 || e.skip_empty_lines === null)
2578
+ e.skip_empty_lines = !1;
2579
+ else
2580
+ throw new Error(
2581
+ `Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`
2582
+ );
2583
+ if (typeof e.skip_records_with_empty_values != "boolean") if (e.skip_records_with_empty_values === void 0 || e.skip_records_with_empty_values === null)
2584
+ e.skip_records_with_empty_values = !1;
2585
+ else
2586
+ throw new Error(
2587
+ `Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`
2588
+ );
2589
+ if (typeof e.skip_records_with_error != "boolean") if (e.skip_records_with_error === void 0 || e.skip_records_with_error === null)
2590
+ e.skip_records_with_error = !1;
2591
+ else
2592
+ throw new Error(
2593
+ `Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`
2594
+ );
2588
2595
  if (e.rtrim === void 0 || e.rtrim === null || e.rtrim === !1)
2589
2596
  e.rtrim = !1;
2590
2597
  else if (e.rtrim !== !0)
2591
- throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);
2598
+ throw new Error(
2599
+ `Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`
2600
+ );
2592
2601
  if (e.ltrim === void 0 || e.ltrim === null || e.ltrim === !1)
2593
2602
  e.ltrim = !1;
2594
2603
  else if (e.ltrim !== !0)
2595
- throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);
2604
+ throw new Error(
2605
+ `Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`
2606
+ );
2596
2607
  if (e.trim === void 0 || e.trim === null || e.trim === !1)
2597
2608
  e.trim = !1;
2598
2609
  else if (e.trim !== !0)
2599
- throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);
2610
+ throw new Error(
2611
+ `Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`
2612
+ );
2600
2613
  if (e.trim === !0 && t.ltrim !== !1 ? e.ltrim = !0 : e.ltrim !== !0 && (e.ltrim = !1), e.trim === !0 && t.rtrim !== !1 ? e.rtrim = !0 : e.rtrim !== !0 && (e.rtrim = !1), e.to === void 0 || e.to === null)
2601
2614
  e.to = -1;
2602
- else if (typeof e.to == "string" && /\d+/.test(e.to) && (e.to = parseInt(e.to)), Number.isInteger(e.to)) {
2603
- if (e.to <= 0)
2604
- throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(t.to)}`);
2605
- } else
2606
- throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(t.to)}`);
2615
+ else if (e.to !== -1)
2616
+ if (typeof e.to == "string" && /\d+/.test(e.to) && (e.to = parseInt(e.to)), Number.isInteger(e.to)) {
2617
+ if (e.to <= 0)
2618
+ throw new Error(
2619
+ `Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(t.to)}`
2620
+ );
2621
+ } else
2622
+ throw new Error(
2623
+ `Invalid Option: to must be an integer, got ${JSON.stringify(t.to)}`
2624
+ );
2607
2625
  if (e.to_line === void 0 || e.to_line === null)
2608
2626
  e.to_line = -1;
2609
- else if (typeof e.to_line == "string" && /\d+/.test(e.to_line) && (e.to_line = parseInt(e.to_line)), Number.isInteger(e.to_line)) {
2610
- if (e.to_line <= 0)
2611
- throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(t.to_line)}`);
2612
- } else
2613
- throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(t.to_line)}`);
2627
+ else if (e.to_line !== -1)
2628
+ if (typeof e.to_line == "string" && /\d+/.test(e.to_line) && (e.to_line = parseInt(e.to_line)), Number.isInteger(e.to_line)) {
2629
+ if (e.to_line <= 0)
2630
+ throw new Error(
2631
+ `Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(t.to_line)}`
2632
+ );
2633
+ } else
2634
+ throw new Error(
2635
+ `Invalid Option: to_line must be an integer, got ${JSON.stringify(t.to_line)}`
2636
+ );
2614
2637
  return e;
2615
- }, ft = function(t) {
2616
- return t.every((e) => e == null || e.toString && e.toString().trim() === "");
2617
- }, ai = 13, li = 10, re = {
2638
+ }, at = function(t) {
2639
+ return t.every(
2640
+ (e) => e == null || e.toString && e.toString().trim() === ""
2641
+ );
2642
+ }, kn = 13, Pn = 10, re = {
2618
2643
  // Note, the following are equals:
2619
2644
  // Buffer.from("\ufeff")
2620
2645
  // Buffer.from([239, 187, 191])
@@ -2624,7 +2649,7 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
2624
2649
  // Buffer.from "\ufeff", 'utf16le
2625
2650
  // Buffer.from([255, 254])
2626
2651
  utf16le: a.from([255, 254])
2627
- }, ui = function(t = {}) {
2652
+ }, jn = function(t = {}) {
2628
2653
  const e = {
2629
2654
  bytes: 0,
2630
2655
  comment_lines: 0,
@@ -2632,15 +2657,14 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
2632
2657
  invalid_field_length: 0,
2633
2658
  lines: 1,
2634
2659
  records: 0
2635
- }, r = st(t);
2660
+ }, r = ft(t);
2636
2661
  return {
2637
2662
  info: e,
2638
2663
  original_options: t,
2639
2664
  options: r,
2640
- state: si(r),
2665
+ state: Bn(r),
2641
2666
  __needMoreData: function(n, i, o) {
2642
- if (o)
2643
- return !1;
2667
+ if (o) return !1;
2644
2668
  const { encoding: s, escape: f, quote: l } = this.options, { quoting: u, needMoreDataSize: h, recordDelimiterMaxLength: c } = this.state, g = i - n - 1, v = Math.max(
2645
2669
  h,
2646
2670
  // Skip if the remaining buffer smaller than record delimiter
@@ -2660,19 +2684,31 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
2660
2684
  },
2661
2685
  // Central parser implementation
2662
2686
  parse: function(n, i, o, s) {
2663
- const { bom: f, comment_no_infix: l, encoding: u, from_line: h, ltrim: c, max_record_size: g, raw: v, relax_quotes: A, rtrim: x, skip_empty_lines: F, to: S, to_line: b } = this.options;
2664
- let { comment: _, escape: L, quote: U, record_delimiter: Ie } = this.options;
2665
- const { bomSkipped: Vt, previousBuf: de, rawBuffer: Jt, escapeIsQuote: Yt } = this.state;
2687
+ const {
2688
+ bom: f,
2689
+ comment_no_infix: l,
2690
+ encoding: u,
2691
+ from_line: h,
2692
+ ltrim: c,
2693
+ max_record_size: g,
2694
+ raw: v,
2695
+ relax_quotes: A,
2696
+ rtrim: x,
2697
+ skip_empty_lines: D,
2698
+ to: S,
2699
+ to_line: b
2700
+ } = this.options;
2701
+ let { comment: _, escape: T, quote: U, record_delimiter: Re } = this.options;
2702
+ const { bomSkipped: Jt, previousBuf: he, rawBuffer: Yt, escapeIsQuote: Wt } = this.state;
2666
2703
  let w;
2667
- if (de === void 0)
2704
+ if (he === void 0)
2668
2705
  if (n === void 0) {
2669
2706
  s();
2670
2707
  return;
2671
2708
  } else
2672
2709
  w = n;
2673
- else
2674
- de !== void 0 && n === void 0 ? w = de : w = a.concat([de, n]);
2675
- if (Vt === !1)
2710
+ else he !== void 0 && n === void 0 ? w = he : w = a.concat([he, n]);
2711
+ if (Jt === !1)
2676
2712
  if (f === !1)
2677
2713
  this.state.bomSkipped = !0;
2678
2714
  else if (w.length < 3) {
@@ -2683,116 +2719,142 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
2683
2719
  } else {
2684
2720
  for (const R in re)
2685
2721
  if (re[R].compare(w, 0, re[R].length) === 0) {
2686
- const V = re[R].length;
2687
- this.state.bufBytesStart += V, w = w.slice(V), this.options = st({ ...this.original_options, encoding: R }), { comment: _, escape: L, quote: U } = this.options;
2722
+ const J = re[R].length;
2723
+ this.state.bufBytesStart += J, w = w.slice(J);
2724
+ const ce = ft({
2725
+ ...this.original_options,
2726
+ encoding: R
2727
+ });
2728
+ for (const I in ce)
2729
+ this.options[I] = ce[I];
2730
+ ({ comment: _, escape: T, quote: U } = this.options);
2688
2731
  break;
2689
2732
  }
2690
2733
  this.state.bomSkipped = !0;
2691
2734
  }
2692
- const Oe = w.length;
2735
+ const Ie = w.length;
2693
2736
  let d;
2694
- for (d = 0; d < Oe && !this.__needMoreData(d, Oe, i); d++) {
2737
+ for (d = 0; d < Ie && !this.__needMoreData(d, Ie, i); d++) {
2695
2738
  if (this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1), b !== -1 && this.info.lines > b) {
2696
2739
  this.state.stop = !0, s();
2697
2740
  return;
2698
2741
  }
2699
- this.state.quoting === !1 && Ie.length === 0 && this.__autoDiscoverRecordDelimiter(w, d) && (Ie = this.options.record_delimiter);
2742
+ this.state.quoting === !1 && Re.length === 0 && this.__autoDiscoverRecordDelimiter(
2743
+ w,
2744
+ d
2745
+ ) && (Re = this.options.record_delimiter);
2700
2746
  const R = w[d];
2701
- if (v === !0 && Jt.append(R), (R === ai || R === li) && this.state.wasRowDelimiter === !1 && (this.state.wasRowDelimiter = !0), this.state.escaping === !0)
2747
+ if (v === !0 && Yt.append(R), (R === kn || R === Pn) && this.state.wasRowDelimiter === !1 && (this.state.wasRowDelimiter = !0), this.state.escaping === !0)
2702
2748
  this.state.escaping = !1;
2703
2749
  else {
2704
- if (L !== null && this.state.quoting === !0 && this.__isEscape(w, d, R) && d + L.length < Oe)
2705
- if (Yt) {
2706
- if (this.__isQuote(w, d + L.length)) {
2707
- this.state.escaping = !0, d += L.length - 1;
2750
+ if (T !== null && this.state.quoting === !0 && this.__isEscape(w, d, R) && d + T.length < Ie)
2751
+ if (Wt) {
2752
+ if (this.__isQuote(w, d + T.length)) {
2753
+ this.state.escaping = !0, d += T.length - 1;
2708
2754
  continue;
2709
2755
  }
2710
2756
  } else {
2711
- this.state.escaping = !0, d += L.length - 1;
2757
+ this.state.escaping = !0, d += T.length - 1;
2712
2758
  continue;
2713
2759
  }
2714
2760
  if (this.state.commenting === !1 && this.__isQuote(w, d))
2715
2761
  if (this.state.quoting === !0) {
2716
- const O = w[d + U.length], fe = x && this.__isCharTrimable(w, d + U.length), Z = _ !== null && this.__compareBytes(_, w, d + U.length, O), J = this.__isDelimiter(w, d + U.length, O), pe = Ie.length === 0 ? this.__autoDiscoverRecordDelimiter(w, d + U.length) : this.__isRecordDelimiter(O, w, d + U.length);
2717
- if (L !== null && this.__isEscape(w, d, R) && this.__isQuote(w, d + L.length))
2718
- d += L.length - 1;
2719
- else if (!O || J || pe || Z || fe) {
2762
+ const I = w[d + U.length], Z = x && this.__isCharTrimable(w, d + U.length), $ = _ !== null && this.__compareBytes(_, w, d + U.length, I), X = this.__isDelimiter(
2763
+ w,
2764
+ d + U.length,
2765
+ I
2766
+ ), de = Re.length === 0 ? this.__autoDiscoverRecordDelimiter(w, d + U.length) : this.__isRecordDelimiter(I, w, d + U.length);
2767
+ if (T !== null && this.__isEscape(w, d, R) && this.__isQuote(w, d + T.length))
2768
+ d += T.length - 1;
2769
+ else if (!I || X || de || $ || Z) {
2720
2770
  this.state.quoting = !1, this.state.wasQuoting = !0, d += U.length - 1;
2721
2771
  continue;
2722
2772
  } else if (A === !1) {
2723
- const ae = this.__error(
2724
- new m("CSV_INVALID_CLOSING_QUOTE", [
2725
- "Invalid Closing Quote:",
2726
- `got "${String.fromCharCode(O)}"`,
2727
- `at line ${this.info.lines}`,
2728
- "instead of delimiter, record delimiter, trimable character",
2729
- "(if activated) or comment"
2730
- ], this.options, this.__infoField())
2773
+ const Qe = this.__error(
2774
+ new m(
2775
+ "CSV_INVALID_CLOSING_QUOTE",
2776
+ [
2777
+ "Invalid Closing Quote:",
2778
+ `got "${String.fromCharCode(I)}"`,
2779
+ `at line ${this.info.lines}`,
2780
+ "instead of delimiter, record delimiter, trimable character",
2781
+ "(if activated) or comment"
2782
+ ],
2783
+ this.options,
2784
+ this.__infoField()
2785
+ )
2731
2786
  );
2732
- if (ae !== void 0)
2733
- return ae;
2787
+ if (Qe !== void 0) return Qe;
2734
2788
  } else
2735
2789
  this.state.quoting = !1, this.state.wasQuoting = !0, this.state.field.prepend(U), d += U.length - 1;
2736
2790
  } else if (this.state.field.length !== 0) {
2737
2791
  if (A === !1) {
2738
- const O = this.__infoField(), fe = Object.keys(re).map((J) => re[J].equals(this.state.field.toString()) ? J : !1).filter(Boolean)[0], Z = this.__error(
2739
- new m("INVALID_OPENING_QUOTE", [
2740
- "Invalid Opening Quote:",
2741
- `a quote is found on field ${JSON.stringify(O.column)} at line ${O.lines}, value is ${JSON.stringify(this.state.field.toString(u))}`,
2742
- fe ? `(${fe} bom)` : void 0
2743
- ], this.options, O, {
2744
- field: this.state.field
2745
- })
2792
+ const I = this.__infoField(), Z = Object.keys(re).map(
2793
+ (X) => re[X].equals(this.state.field.toString()) ? X : !1
2794
+ ).filter(Boolean)[0], $ = this.__error(
2795
+ new m(
2796
+ "INVALID_OPENING_QUOTE",
2797
+ [
2798
+ "Invalid Opening Quote:",
2799
+ `a quote is found on field ${JSON.stringify(I.column)} at line ${I.lines}, value is ${JSON.stringify(this.state.field.toString(u))}`,
2800
+ Z ? `(${Z} bom)` : void 0
2801
+ ],
2802
+ this.options,
2803
+ I,
2804
+ {
2805
+ field: this.state.field
2806
+ }
2807
+ )
2746
2808
  );
2747
- if (Z !== void 0)
2748
- return Z;
2809
+ if ($ !== void 0) return $;
2749
2810
  }
2750
2811
  } else {
2751
2812
  this.state.quoting = !0, d += U.length - 1;
2752
2813
  continue;
2753
2814
  }
2754
2815
  if (this.state.quoting === !1) {
2755
- const O = this.__isRecordDelimiter(R, w, d);
2756
- if (O !== 0) {
2816
+ const I = this.__isRecordDelimiter(
2817
+ R,
2818
+ w,
2819
+ d
2820
+ );
2821
+ if (I !== 0) {
2757
2822
  if (this.state.commenting && this.state.wasQuoting === !1 && this.state.record.length === 0 && this.state.field.length === 0)
2758
2823
  this.info.comment_lines++;
2759
2824
  else {
2760
2825
  if (this.state.enabled === !1 && this.info.lines + (this.state.wasRowDelimiter === !0 ? 1 : 0) >= h) {
2761
- this.state.enabled = !0, this.__resetField(), this.__resetRecord(), d += O - 1;
2826
+ this.state.enabled = !0, this.__resetField(), this.__resetRecord(), d += I - 1;
2762
2827
  continue;
2763
2828
  }
2764
- if (F === !0 && this.state.wasQuoting === !1 && this.state.record.length === 0 && this.state.field.length === 0) {
2765
- this.info.empty_lines++, d += O - 1;
2829
+ if (D === !0 && this.state.wasQuoting === !1 && this.state.record.length === 0 && this.state.field.length === 0) {
2830
+ this.info.empty_lines++, d += I - 1;
2766
2831
  continue;
2767
2832
  }
2768
2833
  this.info.bytes = this.state.bufBytesStart + d;
2769
- const pe = this.__onField();
2770
- if (pe !== void 0)
2771
- return pe;
2772
- this.info.bytes = this.state.bufBytesStart + d + O;
2773
- const ae = this.__onRecord(o);
2774
- if (ae !== void 0)
2775
- return ae;
2834
+ const X = this.__onField();
2835
+ if (X !== void 0) return X;
2836
+ this.info.bytes = this.state.bufBytesStart + d + I;
2837
+ const de = this.__onRecord(o);
2838
+ if (de !== void 0) return de;
2776
2839
  if (S !== -1 && this.info.records >= S) {
2777
2840
  this.state.stop = !0, s();
2778
2841
  return;
2779
2842
  }
2780
2843
  }
2781
- this.state.commenting = !1, d += O - 1;
2844
+ this.state.commenting = !1, d += I - 1;
2782
2845
  continue;
2783
2846
  }
2784
2847
  if (this.state.commenting)
2785
2848
  continue;
2786
- if ((_ === null ? 0 : this.__compareBytes(_, w, d, R)) !== 0 && (l === !1 || this.state.field.length === 0)) {
2849
+ if (_ !== null && (l === !1 || this.state.record.length === 0 && this.state.field.length === 0) && this.__compareBytes(_, w, d, R) !== 0) {
2787
2850
  this.state.commenting = !0;
2788
2851
  continue;
2789
2852
  }
2790
2853
  const Z = this.__isDelimiter(w, d, R);
2791
2854
  if (Z !== 0) {
2792
2855
  this.info.bytes = this.state.bufBytesStart + d;
2793
- const J = this.__onField();
2794
- if (J !== void 0)
2795
- return J;
2856
+ const $ = this.__onField();
2857
+ if ($ !== void 0) return $;
2796
2858
  d += Z - 1;
2797
2859
  continue;
2798
2860
  }
@@ -2800,89 +2862,122 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
2800
2862
  }
2801
2863
  if (this.state.commenting === !1 && g !== 0 && this.state.record_length + this.state.field.length > g)
2802
2864
  return this.__error(
2803
- new m("CSV_MAX_RECORD_SIZE", [
2804
- "Max Record Size:",
2805
- "record exceed the maximum number of tolerated bytes",
2806
- `of ${g}`,
2807
- `at line ${this.info.lines}`
2808
- ], this.options, this.__infoField())
2865
+ new m(
2866
+ "CSV_MAX_RECORD_SIZE",
2867
+ [
2868
+ "Max Record Size:",
2869
+ "record exceed the maximum number of tolerated bytes",
2870
+ `of ${g}`,
2871
+ `at line ${this.info.lines}`
2872
+ ],
2873
+ this.options,
2874
+ this.__infoField()
2875
+ )
2809
2876
  );
2810
- const V = c === !1 || this.state.quoting === !0 || this.state.field.length !== 0 || !this.__isCharTrimable(w, d), Wt = x === !1 || this.state.wasQuoting === !1;
2811
- if (V === !0 && Wt === !0)
2877
+ const J = c === !1 || this.state.quoting === !0 || this.state.field.length !== 0 || !this.__isCharTrimable(w, d), ce = x === !1 || this.state.wasQuoting === !1;
2878
+ if (J === !0 && ce === !0)
2812
2879
  this.state.field.append(R);
2813
2880
  else {
2814
2881
  if (x === !0 && !this.__isCharTrimable(w, d))
2815
2882
  return this.__error(
2816
- new m("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE", [
2817
- "Invalid Closing Quote:",
2818
- "found non trimable byte after quote",
2819
- `at line ${this.info.lines}`
2820
- ], this.options, this.__infoField())
2883
+ new m(
2884
+ "CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",
2885
+ [
2886
+ "Invalid Closing Quote:",
2887
+ "found non trimable byte after quote",
2888
+ `at line ${this.info.lines}`
2889
+ ],
2890
+ this.options,
2891
+ this.__infoField()
2892
+ )
2821
2893
  );
2822
- V === !1 && (d += this.__isCharTrimable(w, d) - 1);
2894
+ J === !1 && (d += this.__isCharTrimable(w, d) - 1);
2823
2895
  continue;
2824
2896
  }
2825
2897
  }
2826
2898
  if (i === !0)
2827
2899
  if (this.state.quoting === !0) {
2828
2900
  const R = this.__error(
2829
- new m("CSV_QUOTE_NOT_CLOSED", [
2830
- "Quote Not Closed:",
2831
- `the parsing is finished with an opening quote at line ${this.info.lines}`
2832
- ], this.options, this.__infoField())
2901
+ new m(
2902
+ "CSV_QUOTE_NOT_CLOSED",
2903
+ [
2904
+ "Quote Not Closed:",
2905
+ `the parsing is finished with an opening quote at line ${this.info.lines}`
2906
+ ],
2907
+ this.options,
2908
+ this.__infoField()
2909
+ )
2833
2910
  );
2834
- if (R !== void 0)
2835
- return R;
2911
+ if (R !== void 0) return R;
2836
2912
  } else if (this.state.wasQuoting === !0 || this.state.record.length !== 0 || this.state.field.length !== 0) {
2837
2913
  this.info.bytes = this.state.bufBytesStart + d;
2838
2914
  const R = this.__onField();
2839
- if (R !== void 0)
2840
- return R;
2841
- const V = this.__onRecord(o);
2842
- if (V !== void 0)
2843
- return V;
2844
- } else
2845
- this.state.wasRowDelimiter === !0 ? this.info.empty_lines++ : this.state.commenting === !0 && this.info.comment_lines++;
2915
+ if (R !== void 0) return R;
2916
+ const J = this.__onRecord(o);
2917
+ if (J !== void 0) return J;
2918
+ } else this.state.wasRowDelimiter === !0 ? this.info.empty_lines++ : this.state.commenting === !0 && this.info.comment_lines++;
2846
2919
  else
2847
2920
  this.state.bufBytesStart += d, this.state.previousBuf = w.slice(d);
2848
2921
  this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1);
2849
2922
  },
2850
2923
  __onRecord: function(n) {
2851
- const { columns: i, group_columns_by_name: o, encoding: s, info: f, from: l, relax_column_count: u, relax_column_count_less: h, relax_column_count_more: c, raw: g, skip_records_with_empty_values: v } = this.options, { enabled: A, record: x } = this.state;
2924
+ const {
2925
+ columns: i,
2926
+ group_columns_by_name: o,
2927
+ encoding: s,
2928
+ info: f,
2929
+ from: l,
2930
+ relax_column_count: u,
2931
+ relax_column_count_less: h,
2932
+ relax_column_count_more: c,
2933
+ raw: g,
2934
+ skip_records_with_empty_values: v
2935
+ } = this.options, { enabled: A, record: x } = this.state;
2852
2936
  if (A === !1)
2853
2937
  return this.__resetRecord();
2854
- const F = x.length;
2938
+ const D = x.length;
2855
2939
  if (i === !0) {
2856
- if (v === !0 && ft(x)) {
2940
+ if (v === !0 && at(x)) {
2857
2941
  this.__resetRecord();
2858
2942
  return;
2859
2943
  }
2860
2944
  return this.__firstLineToColumns(x);
2861
2945
  }
2862
- if (i === !1 && this.info.records === 0 && (this.state.expectedRecordLength = F), F !== this.state.expectedRecordLength) {
2863
- const S = i === !1 ? new m("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH", [
2864
- "Invalid Record Length:",
2865
- `expect ${this.state.expectedRecordLength},`,
2866
- `got ${F} on line ${this.info.lines}`
2867
- ], this.options, this.__infoField(), {
2868
- record: x
2869
- }) : new m("CSV_RECORD_INCONSISTENT_COLUMNS", [
2870
- "Invalid Record Length:",
2871
- `columns length is ${i.length},`,
2872
- // rename columns
2873
- `got ${F} on line ${this.info.lines}`
2874
- ], this.options, this.__infoField(), {
2875
- record: x
2876
- });
2877
- if (u === !0 || h === !0 && F < this.state.expectedRecordLength || c === !0 && F > this.state.expectedRecordLength)
2946
+ if (i === !1 && this.info.records === 0 && (this.state.expectedRecordLength = D), D !== this.state.expectedRecordLength) {
2947
+ const S = i === !1 ? new m(
2948
+ "CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",
2949
+ [
2950
+ "Invalid Record Length:",
2951
+ `expect ${this.state.expectedRecordLength},`,
2952
+ `got ${D} on line ${this.info.lines}`
2953
+ ],
2954
+ this.options,
2955
+ this.__infoField(),
2956
+ {
2957
+ record: x
2958
+ }
2959
+ ) : new m(
2960
+ "CSV_RECORD_INCONSISTENT_COLUMNS",
2961
+ [
2962
+ "Invalid Record Length:",
2963
+ `columns length is ${i.length},`,
2964
+ // rename columns
2965
+ `got ${D} on line ${this.info.lines}`
2966
+ ],
2967
+ this.options,
2968
+ this.__infoField(),
2969
+ {
2970
+ record: x
2971
+ }
2972
+ );
2973
+ if (u === !0 || h === !0 && D < this.state.expectedRecordLength || c === !0 && D > this.state.expectedRecordLength)
2878
2974
  this.info.invalid_field_length++, this.state.error = S;
2879
2975
  else {
2880
2976
  const b = this.__error(S);
2881
- if (b)
2882
- return b;
2977
+ if (b) return b;
2883
2978
  }
2884
2979
  }
2885
- if (v === !0 && ft(x)) {
2980
+ if (v === !0 && at(x)) {
2886
2981
  this.__resetRecord();
2887
2982
  return;
2888
2983
  }
@@ -2894,19 +2989,19 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
2894
2989
  const { objname: S } = this.options;
2895
2990
  if (i !== !1) {
2896
2991
  const b = {};
2897
- for (let _ = 0, L = x.length; _ < L; _++)
2992
+ for (let _ = 0, T = x.length; _ < T; _++)
2898
2993
  i[_] === void 0 || i[_].disabled || (o === !0 && b[i[_].name] !== void 0 ? Array.isArray(b[i[_].name]) ? b[i[_].name] = b[i[_].name].concat(x[_]) : b[i[_].name] = [b[i[_].name], x[_]] : b[i[_].name] = x[_]);
2899
2994
  if (g === !0 || f === !0) {
2900
2995
  const _ = Object.assign(
2901
2996
  { record: b },
2902
2997
  g === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
2903
2998
  f === !0 ? { info: this.__infoRecord() } : {}
2904
- ), L = this.__push(
2999
+ ), T = this.__push(
2905
3000
  S === void 0 ? _ : [b[S], _],
2906
3001
  n
2907
3002
  );
2908
- if (L)
2909
- return L;
3003
+ if (T)
3004
+ return T;
2910
3005
  } else {
2911
3006
  const _ = this.__push(
2912
3007
  S === void 0 ? b : [b[S], b],
@@ -2943,15 +3038,21 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
2943
3038
  const o = i === void 0 ? n : i.call(null, n);
2944
3039
  if (!Array.isArray(o))
2945
3040
  return this.__error(
2946
- new m("CSV_INVALID_COLUMN_MAPPING", [
2947
- "Invalid Column Mapping:",
2948
- "expect an array from column function,",
2949
- `got ${JSON.stringify(o)}`
2950
- ], this.options, this.__infoField(), {
2951
- headers: o
2952
- })
3041
+ new m(
3042
+ "CSV_INVALID_COLUMN_MAPPING",
3043
+ [
3044
+ "Invalid Column Mapping:",
3045
+ "expect an array from column function,",
3046
+ `got ${JSON.stringify(o)}`
3047
+ ],
3048
+ this.options,
3049
+ this.__infoField(),
3050
+ {
3051
+ headers: o
3052
+ }
3053
+ )
2953
3054
  );
2954
- const s = zt(o);
3055
+ const s = Vt(o);
2955
3056
  this.state.expectedRecordLength = s.length, this.options.columns = s, this.__resetRecord();
2956
3057
  return;
2957
3058
  } catch (o) {
@@ -2968,8 +3069,7 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
2968
3069
  let u = this.state.field.toString(i);
2969
3070
  if (o === !0 && l === !1 && (u = u.trimRight()), n === !0) {
2970
3071
  const [h, c] = this.__cast(u);
2971
- if (h !== void 0)
2972
- return h;
3072
+ if (h !== void 0) return h;
2973
3073
  u = c;
2974
3074
  }
2975
3075
  this.state.record.push(u), s !== 0 && typeof u == "string" && (this.state.record_length += u.length), this.__resetField();
@@ -3015,14 +3115,12 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
3015
3115
  __isCharTrimable: function(n, i) {
3016
3116
  return ((s, f) => {
3017
3117
  const { timchars: l } = this.state;
3018
- e:
3019
- for (let u = 0; u < l.length; u++) {
3020
- const h = l[u];
3021
- for (let c = 0; c < h.length; c++)
3022
- if (h[c] !== s[f + c])
3023
- continue e;
3024
- return h.length;
3025
- }
3118
+ e: for (let u = 0; u < l.length; u++) {
3119
+ const h = l[u];
3120
+ for (let c = 0; c < h.length; c++)
3121
+ if (h[c] !== s[f + c]) continue e;
3122
+ return h.length;
3123
+ }
3026
3124
  return 0;
3027
3125
  })(n, i);
3028
3126
  },
@@ -3036,12 +3134,10 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
3036
3134
  return n - parseFloat(n) + 1 >= 0;
3037
3135
  },
3038
3136
  __compareBytes: function(n, i, o, s) {
3039
- if (n[0] !== s)
3040
- return 0;
3137
+ if (n[0] !== s) return 0;
3041
3138
  const f = n.length;
3042
3139
  for (let l = 1; l < f; l++)
3043
- if (n[l] !== i[o + l])
3044
- return 0;
3140
+ if (n[l] !== i[o + l]) return 0;
3045
3141
  return f;
3046
3142
  },
3047
3143
  __isDelimiter: function(n, i, o) {
@@ -3050,36 +3146,32 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
3050
3146
  return 0;
3051
3147
  if (f !== !1 && typeof f == "number" && this.state.record.length === f - 1)
3052
3148
  return 0;
3053
- e:
3054
- for (let l = 0; l < s.length; l++) {
3055
- const u = s[l];
3056
- if (u[0] === o) {
3057
- for (let h = 1; h < u.length; h++)
3058
- if (u[h] !== n[i + h])
3059
- continue e;
3060
- return u.length;
3061
- }
3149
+ e: for (let l = 0; l < s.length; l++) {
3150
+ const u = s[l];
3151
+ if (u[0] === o) {
3152
+ for (let h = 1; h < u.length; h++)
3153
+ if (u[h] !== n[i + h]) continue e;
3154
+ return u.length;
3062
3155
  }
3156
+ }
3063
3157
  return 0;
3064
3158
  },
3065
3159
  __isRecordDelimiter: function(n, i, o) {
3066
3160
  const { record_delimiter: s } = this.options, f = s.length;
3067
- e:
3068
- for (let l = 0; l < f; l++) {
3069
- const u = s[l], h = u.length;
3070
- if (u[0] === n) {
3071
- for (let c = 1; c < h; c++)
3072
- if (u[c] !== i[o + c])
3073
- continue e;
3074
- return u.length;
3075
- }
3161
+ e: for (let l = 0; l < f; l++) {
3162
+ const u = s[l], h = u.length;
3163
+ if (u[0] === n) {
3164
+ for (let c = 1; c < h; c++)
3165
+ if (u[c] !== i[o + c])
3166
+ continue e;
3167
+ return u.length;
3076
3168
  }
3169
+ }
3077
3170
  return 0;
3078
3171
  },
3079
3172
  __isEscape: function(n, i, o) {
3080
3173
  const { escape: s } = this.options;
3081
- if (s === null)
3082
- return !1;
3174
+ if (s === null) return !1;
3083
3175
  const f = s.length;
3084
3176
  if (s[0] === o) {
3085
3177
  for (let l = 0; l < f; l++)
@@ -3091,8 +3183,7 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
3091
3183
  },
3092
3184
  __isQuote: function(n, i) {
3093
3185
  const { quote: o } = this.options;
3094
- if (o === null)
3095
- return !1;
3186
+ if (o === null) return !1;
3096
3187
  const s = o.length;
3097
3188
  for (let f = 0; f < s; f++)
3098
3189
  if (o[f] !== n[i + f])
@@ -3108,20 +3199,27 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
3108
3199
  `, o),
3109
3200
  a.from("\r", o)
3110
3201
  ];
3111
- e:
3112
- for (let f = 0; f < s.length; f++) {
3113
- const l = s[f].length;
3114
- for (let u = 0; u < l; u++)
3115
- if (s[f][u] !== n[i + u])
3116
- continue e;
3117
- return this.options.record_delimiter.push(s[f]), this.state.recordDelimiterMaxLength = s[f].length, s[f].length;
3118
- }
3202
+ e: for (let f = 0; f < s.length; f++) {
3203
+ const l = s[f].length;
3204
+ for (let u = 0; u < l; u++)
3205
+ if (s[f][u] !== n[i + u])
3206
+ continue e;
3207
+ return this.options.record_delimiter.push(s[f]), this.state.recordDelimiterMaxLength = s[f].length, s[f].length;
3208
+ }
3119
3209
  return 0;
3120
3210
  },
3121
3211
  __error: function(n) {
3122
3212
  const { encoding: i, raw: o, skip_records_with_error: s } = this.options, f = typeof n == "string" ? new Error(n) : n;
3123
3213
  if (s) {
3124
- this.state.recordHasError = !0, this.options.on_skip !== void 0 && this.options.on_skip(f, o ? this.state.rawBuffer.toString(i) : void 0);
3214
+ if (this.state.recordHasError = !0, this.options.on_skip !== void 0)
3215
+ try {
3216
+ this.options.on_skip(
3217
+ f,
3218
+ o ? this.state.rawBuffer.toString(i) : void 0
3219
+ );
3220
+ } catch (l) {
3221
+ return l;
3222
+ }
3125
3223
  return;
3126
3224
  } else
3127
3225
  return f;
@@ -3152,52 +3250,66 @@ const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
3152
3250
  }
3153
3251
  };
3154
3252
  };
3155
- class hi extends k {
3253
+ class $n extends k {
3156
3254
  constructor(e = {}) {
3157
- super({ readableObjectMode: !0, ...e, encoding: null }), this.api = ui(e), this.api.options.on_skip = (r, n) => {
3158
- this.emit("skip", r, n);
3159
- }, this.state = this.api.state, this.options = this.api.options, this.info = this.api.info;
3255
+ super({ readableObjectMode: !0, ...e, encoding: null }), this.api = jn({
3256
+ on_skip: (r, n) => {
3257
+ this.emit("skip", r, n);
3258
+ },
3259
+ ...e
3260
+ }), this.state = this.api.state, this.options = this.api.options, this.info = this.api.info;
3160
3261
  }
3161
3262
  // Implementation of `Transform._transform`
3162
3263
  _transform(e, r, n) {
3163
3264
  if (this.state.stop === !0)
3164
3265
  return;
3165
- const i = this.api.parse(e, !1, (o) => {
3166
- this.push(o);
3167
- }, () => {
3168
- this.push(null), this.end(), this.destroy();
3169
- });
3266
+ const i = this.api.parse(
3267
+ e,
3268
+ !1,
3269
+ (o) => {
3270
+ this.push(o);
3271
+ },
3272
+ () => {
3273
+ this.push(null), this.end(), this.on("end", this.destroy);
3274
+ }
3275
+ );
3170
3276
  i !== void 0 && (this.state.stop = !0), n(i);
3171
3277
  }
3172
3278
  // Implementation of `Transform._flush`
3173
3279
  _flush(e) {
3174
3280
  if (this.state.stop === !0)
3175
3281
  return;
3176
- const r = this.api.parse(void 0, !0, (n) => {
3177
- this.push(n);
3178
- }, () => {
3179
- this.push(null), this.on("end", this.destroy);
3180
- });
3282
+ const r = this.api.parse(
3283
+ void 0,
3284
+ !0,
3285
+ (n) => {
3286
+ this.push(n);
3287
+ },
3288
+ () => {
3289
+ this.push(null), this.on("end", this.destroy);
3290
+ }
3291
+ );
3181
3292
  e(r);
3182
3293
  }
3183
3294
  }
3184
- const ci = function() {
3295
+ const qn = function() {
3185
3296
  let t, e, r;
3186
3297
  for (const i in arguments) {
3187
3298
  const o = arguments[i], s = typeof o;
3188
- if (t === void 0 && (typeof o == "string" || T(o)))
3299
+ if (t === void 0 && (typeof o == "string" || L(o)))
3189
3300
  t = o;
3190
- else if (e === void 0 && qt(o))
3301
+ else if (e === void 0 && zt(o))
3191
3302
  e = o;
3192
3303
  else if (r === void 0 && s === "function")
3193
3304
  r = o;
3194
3305
  else
3195
- throw new m("CSV_INVALID_ARGUMENT", [
3196
- "Invalid argument:",
3197
- `got ${JSON.stringify(o)} at index ${i}`
3198
- ], e || {});
3306
+ throw new m(
3307
+ "CSV_INVALID_ARGUMENT",
3308
+ ["Invalid argument:", `got ${JSON.stringify(o)} at index ${i}`],
3309
+ e || {}
3310
+ );
3199
3311
  }
3200
- const n = new hi(e);
3312
+ const n = new $n(e);
3201
3313
  if (r) {
3202
3314
  const i = e === void 0 || e.objname === void 0 ? [] : {};
3203
3315
  n.on("readable", function() {
@@ -3220,6 +3332,7 @@ const ci = function() {
3220
3332
  };
3221
3333
  export {
3222
3334
  m as CsvError,
3223
- hi as Parser,
3224
- ci as parse
3335
+ $n as Parser,
3336
+ ft as normalize_options,
3337
+ qn as parse
3225
3338
  };