@genome-spy/core 0.72.0 → 0.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/LICENSE +1 -1
  2. package/dist/bundle/AbortablePromiseCache-3gHJdF3E.js +96 -0
  3. package/dist/bundle/browser-BTgw5ieH.js +126 -0
  4. package/dist/bundle/chunk-DmhlhrBa.js +11 -0
  5. package/dist/bundle/esm-BDFRLEuD.js +1248 -0
  6. package/dist/bundle/esm-BygJiwh0.js +573 -0
  7. package/dist/bundle/esm-CGX-qz1d.js +155 -0
  8. package/dist/bundle/esm-CgfVIRJ-.js +121 -0
  9. package/dist/bundle/esm-CuMSzCHy.js +298 -0
  10. package/dist/bundle/esm-DMXpJXM4.js +369 -0
  11. package/dist/bundle/esm-DQiq2Zhd.js +1426 -0
  12. package/dist/bundle/esm-DtE8VqAv.js +1015 -0
  13. package/dist/bundle/esm-sIoQYZ21.js +461 -0
  14. package/dist/bundle/index.es.js +21078 -24556
  15. package/dist/bundle/index.js +379 -383
  16. package/dist/bundle/parquetRead-DG_-F5j5.js +1609 -0
  17. package/dist/schema.json +13349 -7082
  18. package/dist/src/config/axisConfig.d.ts +16 -0
  19. package/dist/src/config/axisConfig.d.ts.map +1 -0
  20. package/dist/src/config/axisConfig.js +84 -0
  21. package/dist/src/config/defaultConfig.d.ts +3 -0
  22. package/dist/src/config/defaultConfig.d.ts.map +1 -0
  23. package/dist/src/config/defaultConfig.js +38 -0
  24. package/dist/src/config/defaults/axisDefaults.d.ts +5 -0
  25. package/dist/src/config/defaults/axisDefaults.d.ts.map +1 -0
  26. package/dist/src/config/defaults/axisDefaults.js +72 -0
  27. package/dist/src/config/defaults/markDefaults.d.ts +15 -0
  28. package/dist/src/config/defaults/markDefaults.d.ts.map +1 -0
  29. package/dist/src/config/defaults/markDefaults.js +121 -0
  30. package/dist/src/config/defaults/scaleDefaults.d.ts +5 -0
  31. package/dist/src/config/defaults/scaleDefaults.d.ts.map +1 -0
  32. package/dist/src/config/defaults/scaleDefaults.js +18 -0
  33. package/dist/src/config/defaults/titleDefaults.d.ts +5 -0
  34. package/dist/src/config/defaults/titleDefaults.d.ts.map +1 -0
  35. package/dist/src/config/defaults/titleDefaults.js +47 -0
  36. package/dist/src/config/defaults/viewDefaults.d.ts +3 -0
  37. package/dist/src/config/defaults/viewDefaults.d.ts.map +1 -0
  38. package/dist/src/config/defaults/viewDefaults.js +2 -0
  39. package/dist/src/config/markConfig.d.ts +8 -0
  40. package/dist/src/config/markConfig.d.ts.map +1 -0
  41. package/dist/src/config/markConfig.js +27 -0
  42. package/dist/src/config/mergeConfig.d.ts +8 -0
  43. package/dist/src/config/mergeConfig.d.ts.map +1 -0
  44. package/dist/src/config/mergeConfig.js +81 -0
  45. package/dist/src/config/resolveConfig.d.ts +22 -0
  46. package/dist/src/config/resolveConfig.d.ts.map +1 -0
  47. package/dist/src/config/resolveConfig.js +32 -0
  48. package/dist/src/config/scaleConfig.d.ts +40 -0
  49. package/dist/src/config/scaleConfig.d.ts.map +1 -0
  50. package/dist/src/config/scaleConfig.js +220 -0
  51. package/dist/src/config/styleUtils.d.ts +6 -0
  52. package/dist/src/config/styleUtils.d.ts.map +1 -0
  53. package/dist/src/config/styleUtils.js +10 -0
  54. package/dist/src/config/themes.d.ts +15 -0
  55. package/dist/src/config/themes.d.ts.map +1 -0
  56. package/dist/src/config/themes.js +293 -0
  57. package/dist/src/config/titleConfig.d.ts +12 -0
  58. package/dist/src/config/titleConfig.d.ts.map +1 -0
  59. package/dist/src/config/titleConfig.js +42 -0
  60. package/dist/src/config/viewConfig.d.ts +7 -0
  61. package/dist/src/config/viewConfig.d.ts.map +1 -0
  62. package/dist/src/config/viewConfig.js +29 -0
  63. package/dist/src/data/flowNode.d.ts +22 -1
  64. package/dist/src/data/flowNode.d.ts.map +1 -1
  65. package/dist/src/data/flowNode.js +37 -1
  66. package/dist/src/data/formats/bed.d.ts +8 -0
  67. package/dist/src/data/formats/bed.d.ts.map +1 -0
  68. package/dist/src/data/formats/bed.js +58 -0
  69. package/dist/src/data/formats/bedpe.d.ts +8 -0
  70. package/dist/src/data/formats/bedpe.d.ts.map +1 -0
  71. package/dist/src/data/formats/bedpe.js +164 -0
  72. package/dist/src/data/formats/fasta.d.ts.map +1 -1
  73. package/dist/src/data/formats/fasta.js +4 -0
  74. package/dist/src/data/formats/parquet.d.ts.map +1 -1
  75. package/dist/src/data/formats/parquet.js +4 -0
  76. package/dist/src/data/sources/dataSourceFactory.d.ts +2 -13
  77. package/dist/src/data/sources/dataSourceFactory.d.ts.map +1 -1
  78. package/dist/src/data/sources/dataSourceFactory.js +5 -141
  79. package/dist/src/data/sources/dataUtils.d.ts +16 -0
  80. package/dist/src/data/sources/dataUtils.d.ts.map +1 -1
  81. package/dist/src/data/sources/dataUtils.js +53 -3
  82. package/dist/src/data/sources/lazy/axisGenomeSource.d.ts.map +1 -1
  83. package/dist/src/data/sources/lazy/axisGenomeSource.js +11 -0
  84. package/dist/src/data/sources/lazy/axisTickSource.d.ts +1 -1
  85. package/dist/src/data/sources/lazy/axisTickSource.d.ts.map +1 -1
  86. package/dist/src/data/sources/lazy/axisTickSource.js +19 -8
  87. package/dist/src/data/sources/lazy/bamSource.d.ts.map +1 -1
  88. package/dist/src/data/sources/lazy/bamSource.js +11 -0
  89. package/dist/src/data/sources/lazy/bigBedSource.d.ts.map +1 -1
  90. package/dist/src/data/sources/lazy/bigBedSource.js +12 -1
  91. package/dist/src/data/sources/lazy/bigWigSource.d.ts.map +1 -1
  92. package/dist/src/data/sources/lazy/bigWigSource.js +11 -0
  93. package/dist/src/data/sources/lazy/gff3Source.d.ts.map +1 -1
  94. package/dist/src/data/sources/lazy/gff3Source.js +12 -1
  95. package/dist/src/data/sources/lazy/indexedFastaSource.d.ts.map +1 -1
  96. package/dist/src/data/sources/lazy/indexedFastaSource.js +11 -0
  97. package/dist/src/data/sources/lazy/lazyDataSourceRegistry.d.ts +27 -0
  98. package/dist/src/data/sources/lazy/lazyDataSourceRegistry.d.ts.map +1 -0
  99. package/dist/src/data/sources/lazy/lazyDataSourceRegistry.js +65 -0
  100. package/dist/src/data/sources/lazy/registerBuiltInLazySources.d.ts +2 -0
  101. package/dist/src/data/sources/lazy/registerBuiltInLazySources.d.ts.map +1 -0
  102. package/dist/src/data/sources/lazy/registerBuiltInLazySources.js +8 -0
  103. package/dist/src/data/sources/lazy/singleAxisLazySource.d.ts.map +1 -1
  104. package/dist/src/data/sources/lazy/singleAxisLazySource.js +11 -2
  105. package/dist/src/data/sources/lazy/vcfSource.d.ts.map +1 -1
  106. package/dist/src/data/sources/lazy/vcfSource.js +11 -0
  107. package/dist/src/data/sources/urlSource.d.ts +4 -0
  108. package/dist/src/data/sources/urlSource.d.ts.map +1 -1
  109. package/dist/src/data/sources/urlSource.js +138 -16
  110. package/dist/src/data/transforms/aggregate.d.ts +1 -0
  111. package/dist/src/data/transforms/aggregate.d.ts.map +1 -1
  112. package/dist/src/data/transforms/aggregate.js +30 -8
  113. package/dist/src/data/transforms/aggregateOps.d.ts.map +1 -1
  114. package/dist/src/data/transforms/aggregateOps.js +12 -1
  115. package/dist/src/data/transforms/coverage.js +2 -2
  116. package/dist/src/data/transforms/filter.js +1 -1
  117. package/dist/src/data/transforms/filterScoredLabels.d.ts +6 -0
  118. package/dist/src/data/transforms/filterScoredLabels.d.ts.map +1 -1
  119. package/dist/src/data/transforms/filterScoredLabels.js +9 -0
  120. package/dist/src/data/transforms/measureText.d.ts +1 -0
  121. package/dist/src/data/transforms/measureText.d.ts.map +1 -1
  122. package/dist/src/data/transforms/measureText.js +14 -5
  123. package/dist/src/data/transforms/pileup.d.ts.map +1 -1
  124. package/dist/src/data/transforms/pileup.js +1 -2
  125. package/dist/src/data/transforms/regexFold.d.ts.map +1 -1
  126. package/dist/src/data/transforms/regexFold.js +0 -1
  127. package/dist/src/embedFactory.d.ts +13 -0
  128. package/dist/src/embedFactory.d.ts.map +1 -0
  129. package/dist/src/embedFactory.js +127 -0
  130. package/dist/src/encoder/accessor.d.ts +3 -12
  131. package/dist/src/encoder/accessor.d.ts.map +1 -1
  132. package/dist/src/encoder/accessor.js +10 -65
  133. package/dist/src/encoder/encoder.d.ts +51 -8
  134. package/dist/src/encoder/encoder.d.ts.map +1 -1
  135. package/dist/src/encoder/encoder.js +179 -55
  136. package/dist/src/fonts/bmFontManager.js +1 -1
  137. package/dist/src/full.d.ts +2 -0
  138. package/dist/src/full.d.ts.map +1 -0
  139. package/dist/src/full.js +2 -0
  140. package/dist/src/genome/assemblyPreflight.d.ts +31 -0
  141. package/dist/src/genome/assemblyPreflight.d.ts.map +1 -0
  142. package/dist/src/genome/assemblyPreflight.js +99 -0
  143. package/dist/src/genome/genome.d.ts +10 -2
  144. package/dist/src/genome/genome.d.ts.map +1 -1
  145. package/dist/src/genome/genome.js +20 -2
  146. package/dist/src/genome/genomeStore.d.ts +34 -3
  147. package/dist/src/genome/genomeStore.d.ts.map +1 -1
  148. package/dist/src/genome/genomeStore.js +409 -18
  149. package/dist/src/genome/rootGenomeConfig.d.ts +26 -0
  150. package/dist/src/genome/rootGenomeConfig.d.ts.map +1 -0
  151. package/dist/src/genome/rootGenomeConfig.js +98 -0
  152. package/dist/src/genome/scaleLocus.d.ts.map +1 -1
  153. package/dist/src/genome/scaleLocus.js +26 -7
  154. package/dist/src/genomeSpy/cursorManager.d.ts +69 -0
  155. package/dist/src/genomeSpy/cursorManager.d.ts.map +1 -0
  156. package/dist/src/genomeSpy/cursorManager.js +131 -0
  157. package/dist/src/genomeSpy/headlessBootstrap.d.ts +113 -0
  158. package/dist/src/genomeSpy/headlessBootstrap.d.ts.map +1 -0
  159. package/dist/src/genomeSpy/headlessBootstrap.js +246 -0
  160. package/dist/src/genomeSpy/interactionController.d.ts +10 -1
  161. package/dist/src/genomeSpy/interactionController.d.ts.map +1 -1
  162. package/dist/src/genomeSpy/interactionController.js +448 -40
  163. package/dist/src/genomeSpy/interactionDispatcher.d.ts +50 -0
  164. package/dist/src/genomeSpy/interactionDispatcher.d.ts.map +1 -0
  165. package/dist/src/genomeSpy/interactionDispatcher.js +203 -0
  166. package/dist/src/genomeSpy/renderCoordinator.js +1 -1
  167. package/dist/src/genomeSpy/viewContextFactory.d.ts +4 -2
  168. package/dist/src/genomeSpy/viewContextFactory.d.ts.map +1 -1
  169. package/dist/src/genomeSpy/viewContextFactory.js +12 -4
  170. package/dist/src/genomeSpy/viewDataInit.d.ts.map +1 -1
  171. package/dist/src/genomeSpy/viewDataInit.js +7 -3
  172. package/dist/src/genomeSpy.d.ts +1 -114
  173. package/dist/src/genomeSpy.d.ts.map +1 -1
  174. package/dist/src/genomeSpy.js +7 -614
  175. package/dist/src/genomeSpyBase.d.ts +133 -0
  176. package/dist/src/genomeSpyBase.d.ts.map +1 -0
  177. package/dist/src/genomeSpyBase.js +719 -0
  178. package/dist/src/gl/arrayBuilder.d.ts.map +1 -1
  179. package/dist/src/gl/arrayBuilder.js +0 -3
  180. package/dist/src/gl/canvasSizeHelper.d.ts +74 -0
  181. package/dist/src/gl/canvasSizeHelper.d.ts.map +1 -0
  182. package/dist/src/gl/canvasSizeHelper.js +203 -0
  183. package/dist/src/gl/colorUtils.d.ts.map +1 -1
  184. package/dist/src/gl/colorUtils.js +3 -0
  185. package/dist/src/gl/dataToVertices.d.ts.map +1 -1
  186. package/dist/src/gl/dataToVertices.js +13 -8
  187. package/dist/src/gl/glslScaleGenerator.d.ts +2 -2
  188. package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
  189. package/dist/src/gl/glslScaleGenerator.js +5 -7
  190. package/dist/src/gl/webGLHelper.d.ts +25 -11
  191. package/dist/src/gl/webGLHelper.d.ts.map +1 -1
  192. package/dist/src/gl/webGLHelper.js +59 -33
  193. package/dist/src/index.d.ts +3 -9
  194. package/dist/src/index.d.ts.map +1 -1
  195. package/dist/src/index.js +5 -111
  196. package/dist/src/marks/__snapshots__/shaderSnapshot.test.js.snap +4462 -0
  197. package/dist/src/marks/link.d.ts.map +1 -1
  198. package/dist/src/marks/link.js +5 -26
  199. package/dist/src/marks/mark.d.ts +8 -1
  200. package/dist/src/marks/mark.d.ts.map +1 -1
  201. package/dist/src/marks/mark.js +67 -21
  202. package/dist/src/marks/markUtils.d.ts +18 -1
  203. package/dist/src/marks/markUtils.d.ts.map +1 -1
  204. package/dist/src/marks/markUtils.js +52 -4
  205. package/dist/src/marks/point.d.ts.map +1 -1
  206. package/dist/src/marks/point.js +6 -26
  207. package/dist/src/marks/rect.d.ts.map +1 -1
  208. package/dist/src/marks/rect.js +13 -21
  209. package/dist/src/marks/rule.d.ts +7 -2
  210. package/dist/src/marks/rule.d.ts.map +1 -1
  211. package/dist/src/marks/rule.js +125 -16
  212. package/dist/src/marks/text.d.ts.map +1 -1
  213. package/dist/src/marks/text.js +5 -47
  214. package/dist/src/minimal.d.ts +8 -0
  215. package/dist/src/minimal.d.ts.map +1 -0
  216. package/dist/src/minimal.js +21 -0
  217. package/dist/src/paramRuntime/viewParamRuntime.d.ts +19 -0
  218. package/dist/src/paramRuntime/viewParamRuntime.d.ts.map +1 -1
  219. package/dist/src/paramRuntime/viewParamRuntime.js +35 -0
  220. package/dist/src/scale/scale.d.ts.map +1 -1
  221. package/dist/src/scale/scale.js +13 -7
  222. package/dist/src/scales/axisResolution.d.ts.map +1 -1
  223. package/dist/src/scales/axisResolution.js +9 -5
  224. package/dist/src/scales/domainPlanner.d.ts +58 -7
  225. package/dist/src/scales/domainPlanner.d.ts.map +1 -1
  226. package/dist/src/scales/domainPlanner.js +395 -40
  227. package/dist/src/scales/indexLikeDomainUtils.d.ts +29 -0
  228. package/dist/src/scales/indexLikeDomainUtils.d.ts.map +1 -0
  229. package/dist/src/scales/indexLikeDomainUtils.js +67 -0
  230. package/dist/src/scales/resolutionMemberOrder.d.ts +15 -0
  231. package/dist/src/scales/resolutionMemberOrder.d.ts.map +1 -0
  232. package/dist/src/scales/resolutionMemberOrder.js +22 -0
  233. package/dist/src/scales/scaleInstanceManager.d.ts +2 -1
  234. package/dist/src/scales/scaleInstanceManager.d.ts.map +1 -1
  235. package/dist/src/scales/scaleInstanceManager.js +10 -11
  236. package/dist/src/scales/scaleInteractionController.d.ts.map +1 -1
  237. package/dist/src/scales/scaleInteractionController.js +59 -18
  238. package/dist/src/scales/scalePropsResolver.d.ts +3 -1
  239. package/dist/src/scales/scalePropsResolver.d.ts.map +1 -1
  240. package/dist/src/scales/scalePropsResolver.js +83 -6
  241. package/dist/src/scales/scaleResolution.d.ts +39 -0
  242. package/dist/src/scales/scaleResolution.d.ts.map +1 -1
  243. package/dist/src/scales/scaleResolution.js +504 -82
  244. package/dist/src/scales/scaleResolutionTestUtils.d.ts +21 -0
  245. package/dist/src/scales/scaleResolutionTestUtils.d.ts.map +1 -0
  246. package/dist/src/scales/scaleResolutionTestUtils.js +37 -0
  247. package/dist/src/scales/scaleRules.d.ts.map +1 -1
  248. package/dist/src/scales/scaleRules.js +16 -2
  249. package/dist/src/scales/selectionDomainUtils.d.ts +52 -0
  250. package/dist/src/scales/selectionDomainUtils.d.ts.map +1 -0
  251. package/dist/src/scales/selectionDomainUtils.js +194 -0
  252. package/dist/src/scales/zoomDomainUtils.d.ts +18 -0
  253. package/dist/src/scales/zoomDomainUtils.d.ts.map +1 -0
  254. package/dist/src/scales/zoomDomainUtils.js +69 -0
  255. package/dist/src/screenshotHarness.d.ts +16 -0
  256. package/dist/src/screenshotHarness.d.ts.map +1 -0
  257. package/dist/src/screenshotHarness.js +241 -0
  258. package/dist/src/singlePageApp.js +1 -1
  259. package/dist/src/spec/axis.d.ts +41 -30
  260. package/dist/src/spec/channel.d.ts +15 -9
  261. package/dist/src/spec/config.d.ts +264 -0
  262. package/dist/src/spec/data.d.ts +30 -3
  263. package/dist/src/spec/decoration.d.ts +51 -0
  264. package/dist/src/spec/exampleFiles.d.ts +12 -0
  265. package/dist/src/spec/exampleFiles.d.ts.map +1 -0
  266. package/dist/src/spec/exampleFiles.js +52 -0
  267. package/dist/src/spec/font.d.ts +1 -1
  268. package/dist/src/spec/genome.d.ts +22 -2
  269. package/dist/src/spec/mark.d.ts +97 -13
  270. package/dist/src/spec/parameter.d.ts +62 -5
  271. package/dist/src/spec/root.d.ts +34 -1
  272. package/dist/src/spec/scale.d.ts +46 -5
  273. package/dist/src/spec/title.d.ts +13 -2
  274. package/dist/src/spec/tooltip.d.ts +1 -1
  275. package/dist/src/spec/transform.d.ts +39 -4
  276. package/dist/src/spec/view.d.ts +67 -19
  277. package/dist/src/styles/genome-spy.css +63 -55
  278. package/dist/src/styles/genome-spy.css.d.ts +1 -1
  279. package/dist/src/styles/genome-spy.css.d.ts.map +1 -1
  280. package/dist/src/styles/genome-spy.css.js +31 -22
  281. package/dist/src/testSetup.d.ts +2 -0
  282. package/dist/src/testSetup.d.ts.map +1 -0
  283. package/dist/src/testSetup.js +5 -0
  284. package/dist/src/tooltip/dataTooltipHandler.js +66 -11
  285. package/dist/src/tooltip/tooltipContext.d.ts.map +1 -1
  286. package/dist/src/tooltip/tooltipContext.js +3 -2
  287. package/dist/src/types/embedApi.d.ts +26 -0
  288. package/dist/src/types/encoder.d.ts +17 -15
  289. package/dist/src/types/scaleResolutionApi.d.ts +20 -0
  290. package/dist/src/types/viewContext.d.ts +23 -1
  291. package/dist/src/utils/expression.d.ts +2 -2
  292. package/dist/src/utils/expression.d.ts.map +1 -1
  293. package/dist/src/utils/expression.js +63 -8
  294. package/dist/src/utils/field.d.ts.map +1 -1
  295. package/dist/src/utils/field.js +0 -1
  296. package/dist/src/utils/inertia.d.ts.map +1 -1
  297. package/dist/src/utils/inertia.js +0 -1
  298. package/dist/src/utils/inferSpecBaseUrl.d.ts +14 -0
  299. package/dist/src/utils/inferSpecBaseUrl.d.ts.map +1 -0
  300. package/dist/src/utils/inferSpecBaseUrl.js +73 -0
  301. package/dist/src/utils/inputBinding.d.ts +1 -1
  302. package/dist/src/utils/interaction.d.ts +109 -0
  303. package/dist/src/utils/interaction.d.ts.map +1 -0
  304. package/dist/src/utils/interaction.js +200 -0
  305. package/dist/src/utils/interactionEvent.d.ts +62 -33
  306. package/dist/src/utils/interactionEvent.d.ts.map +1 -1
  307. package/dist/src/utils/interactionEvent.js +86 -48
  308. package/dist/src/utils/kWayMerge.js +1 -1
  309. package/dist/src/utils/mergeObjects.d.ts.map +1 -1
  310. package/dist/src/utils/mergeObjects.js +0 -2
  311. package/dist/src/utils/radixSort.d.ts.map +1 -1
  312. package/dist/src/utils/radixSort.js +0 -2
  313. package/dist/src/utils/throttle.d.ts.map +1 -1
  314. package/dist/src/utils/throttle.js +0 -2
  315. package/dist/src/utils/ui/tooltip.d.ts +1 -0
  316. package/dist/src/utils/ui/tooltip.d.ts.map +1 -1
  317. package/dist/src/utils/ui/tooltip.js +1 -0
  318. package/dist/src/utils/url.js +1 -1
  319. package/dist/src/view/axisGridView.d.ts +1 -1
  320. package/dist/src/view/axisGridView.d.ts.map +1 -1
  321. package/dist/src/view/axisGridView.js +2 -47
  322. package/dist/src/view/axisView.d.ts +2 -3
  323. package/dist/src/view/axisView.d.ts.map +1 -1
  324. package/dist/src/view/axisView.js +251 -106
  325. package/dist/src/view/concatView.d.ts +2 -1
  326. package/dist/src/view/concatView.d.ts.map +1 -1
  327. package/dist/src/view/concatView.js +4 -2
  328. package/dist/src/view/containerMutationHelper.d.ts +3 -0
  329. package/dist/src/view/containerMutationHelper.d.ts.map +1 -1
  330. package/dist/src/view/containerMutationHelper.js +12 -1
  331. package/dist/src/view/dataReadiness.d.ts +2 -2
  332. package/dist/src/view/dataReadiness.d.ts.map +1 -1
  333. package/dist/src/view/dataReadiness.js +63 -58
  334. package/dist/src/view/facetView.d.ts +1 -1
  335. package/dist/src/view/facetView.js +4 -4
  336. package/dist/src/view/flowBuilder.js +2 -2
  337. package/dist/src/view/gridView/gridChild.d.ts +13 -0
  338. package/dist/src/view/gridView/gridChild.d.ts.map +1 -1
  339. package/dist/src/view/gridView/gridChild.js +247 -49
  340. package/dist/src/view/gridView/gridView.d.ts.map +1 -1
  341. package/dist/src/view/gridView/gridView.js +296 -99
  342. package/dist/src/view/gridView/keyboardZoomController.d.ts +2 -2
  343. package/dist/src/view/gridView/keyboardZoomController.d.ts.map +1 -1
  344. package/dist/src/view/gridView/keyboardZoomController.js +1 -1
  345. package/dist/src/view/gridView/scrollbar.d.ts.map +1 -1
  346. package/dist/src/view/gridView/scrollbar.js +4 -2
  347. package/dist/src/view/gridView/selectionRect.d.ts +4 -0
  348. package/dist/src/view/gridView/selectionRect.d.ts.map +1 -1
  349. package/dist/src/view/gridView/selectionRect.js +20 -1
  350. package/dist/src/view/gridView/separatorView.d.ts +1 -0
  351. package/dist/src/view/gridView/separatorView.d.ts.map +1 -1
  352. package/dist/src/view/gridView/separatorView.js +9 -0
  353. package/dist/src/view/interactionRouting.d.ts +20 -0
  354. package/dist/src/view/interactionRouting.d.ts.map +1 -0
  355. package/dist/src/view/interactionRouting.js +53 -0
  356. package/dist/src/view/layerView.d.ts.map +1 -1
  357. package/dist/src/view/layerView.js +12 -9
  358. package/dist/src/view/layout/grid.js +1 -1
  359. package/dist/src/view/renderingContext/bufferedViewRenderingContext.d.ts.map +1 -1
  360. package/dist/src/view/renderingContext/bufferedViewRenderingContext.js +0 -2
  361. package/dist/src/view/testUtils.d.ts +17 -3
  362. package/dist/src/view/testUtils.d.ts.map +1 -1
  363. package/dist/src/view/testUtils.js +62 -69
  364. package/dist/src/view/title.d.ts +8 -1
  365. package/dist/src/view/title.d.ts.map +1 -1
  366. package/dist/src/view/title.js +66 -76
  367. package/dist/src/view/unitView.d.ts +1 -1
  368. package/dist/src/view/unitView.d.ts.map +1 -1
  369. package/dist/src/view/unitView.js +67 -17
  370. package/dist/src/view/view.d.ts +76 -30
  371. package/dist/src/view/view.d.ts.map +1 -1
  372. package/dist/src/view/view.js +136 -47
  373. package/dist/src/view/viewFactory.d.ts +11 -3
  374. package/dist/src/view/viewFactory.d.ts.map +1 -1
  375. package/dist/src/view/viewFactory.js +37 -11
  376. package/dist/src/view/viewUtils.d.ts.map +1 -1
  377. package/dist/src/view/viewUtils.js +41 -5
  378. package/dist/src/view/zoom.d.ts +15 -3
  379. package/dist/src/view/zoom.d.ts.map +1 -1
  380. package/dist/src/view/zoom.js +375 -80
  381. package/package.json +20 -10
  382. package/dist/bundle/AbortablePromiseCache-Dj0vzLnp.js +0 -149
  383. package/dist/bundle/browser-0iNU5Wit.js +0 -138
  384. package/dist/bundle/index-BYsZN7b0.js +0 -1597
  385. package/dist/bundle/index-C3kClAEN.js +0 -1771
  386. package/dist/bundle/index-C7wOh6y1.js +0 -657
  387. package/dist/bundle/index-CRaQAuki.js +0 -326
  388. package/dist/bundle/index-D9v1PCj9.js +0 -507
  389. package/dist/bundle/index-GDOuv_D5.js +0 -266
  390. package/dist/bundle/index-Gt44EOIH.js +0 -628
  391. package/dist/bundle/inflate-GtwLkvSP.js +0 -1048
  392. package/dist/bundle/parquetRead-BnAGCa4_.js +0 -1663
  393. package/dist/bundle/unzip-Bac01w6X.js +0 -1492
  394. package/dist/src/config/scaleDefaults.d.ts +0 -8
  395. package/dist/src/config/scaleDefaults.d.ts.map +0 -1
  396. package/dist/src/config/scaleDefaults.js +0 -45
@@ -1,1771 +0,0 @@
1
- import { RemoteFile as Re, LocalFile as De } from "./browser-0iNU5Wit.js";
2
- import { A as ue } from "./AbortablePromiseCache-Dj0vzLnp.js";
3
- import { i as Ne } from "./inflate-GtwLkvSP.js";
4
- const fe = BigInt(32);
5
- function Le(t, r, e) {
6
- const n = +!!e, i = +!e;
7
- return BigInt(t.getInt32(r, e) * i + t.getInt32(r + 4, e) * n) << fe | BigInt(t.getUint32(r, e) * n + t.getUint32(r + 4, e) * i);
8
- }
9
- function Me(t, r, e) {
10
- const n = t.getUint32(r, e), i = t.getUint32(r + 4, e), o = +!!e, s = +!e;
11
- return BigInt(n * s + i * o) << fe | BigInt(n * o + i * s);
12
- }
13
- "getBigInt64" in DataView || (DataView.prototype.getBigInt64 = function(t, r) {
14
- return Le(this, t, r);
15
- });
16
- "getBigUint64" in DataView || (DataView.prototype.getBigUint64 = function(t, r) {
17
- return Me(this, t, r);
18
- });
19
- var J = function(t, r) {
20
- return J = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
21
- e.__proto__ = n;
22
- } || function(e, n) {
23
- for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
24
- }, J(t, r);
25
- };
26
- function X(t, r) {
27
- if (typeof r != "function" && r !== null)
28
- throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
29
- J(t, r);
30
- function e() {
31
- this.constructor = t;
32
- }
33
- t.prototype = r === null ? Object.create(r) : (e.prototype = r.prototype, new e());
34
- }
35
- function He(t, r, e, n) {
36
- function i(o) {
37
- return o instanceof e ? o : new e(function(s) {
38
- s(o);
39
- });
40
- }
41
- return new (e || (e = Promise))(function(o, s) {
42
- function u(h) {
43
- try {
44
- c(n.next(h));
45
- } catch (d) {
46
- s(d);
47
- }
48
- }
49
- function a(h) {
50
- try {
51
- c(n.throw(h));
52
- } catch (d) {
53
- s(d);
54
- }
55
- }
56
- function c(h) {
57
- h.done ? o(h.value) : i(h.value).then(u, a);
58
- }
59
- c((n = n.apply(t, r || [])).next());
60
- });
61
- }
62
- function le(t, r) {
63
- var e = { label: 0, sent: function() {
64
- if (o[0] & 1) throw o[1];
65
- return o[1];
66
- }, trys: [], ops: [] }, n, i, o, s = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
67
- return s.next = u(0), s.throw = u(1), s.return = u(2), typeof Symbol == "function" && (s[Symbol.iterator] = function() {
68
- return this;
69
- }), s;
70
- function u(c) {
71
- return function(h) {
72
- return a([c, h]);
73
- };
74
- }
75
- function a(c) {
76
- if (n) throw new TypeError("Generator is already executing.");
77
- for (; s && (s = 0, c[0] && (e = 0)), e; ) try {
78
- if (n = 1, i && (o = c[0] & 2 ? i.return : c[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, c[1])).done) return o;
79
- switch (i = 0, o && (c = [c[0] & 2, o.value]), c[0]) {
80
- case 0:
81
- case 1:
82
- o = c;
83
- break;
84
- case 4:
85
- return e.label++, { value: c[1], done: !1 };
86
- case 5:
87
- e.label++, i = c[1], c = [0];
88
- continue;
89
- case 7:
90
- c = e.ops.pop(), e.trys.pop();
91
- continue;
92
- default:
93
- if (o = e.trys, !(o = o.length > 0 && o[o.length - 1]) && (c[0] === 6 || c[0] === 2)) {
94
- e = 0;
95
- continue;
96
- }
97
- if (c[0] === 3 && (!o || c[1] > o[0] && c[1] < o[3])) {
98
- e.label = c[1];
99
- break;
100
- }
101
- if (c[0] === 6 && e.label < o[1]) {
102
- e.label = o[1], o = c;
103
- break;
104
- }
105
- if (o && e.label < o[2]) {
106
- e.label = o[2], e.ops.push(c);
107
- break;
108
- }
109
- o[2] && e.ops.pop(), e.trys.pop();
110
- continue;
111
- }
112
- c = r.call(t, e);
113
- } catch (h) {
114
- c = [6, h], i = 0;
115
- } finally {
116
- n = o = 0;
117
- }
118
- if (c[0] & 5) throw c[1];
119
- return { value: c[0] ? c[1] : void 0, done: !0 };
120
- }
121
- }
122
- function N(t) {
123
- var r = typeof Symbol == "function" && Symbol.iterator, e = r && t[r], n = 0;
124
- if (e) return e.call(t);
125
- if (t && typeof t.length == "number") return {
126
- next: function() {
127
- return t && n >= t.length && (t = void 0), { value: t && t[n++], done: !t };
128
- }
129
- };
130
- throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined.");
131
- }
132
- function Z(t, r) {
133
- var e = typeof Symbol == "function" && t[Symbol.iterator];
134
- if (!e) return t;
135
- var n = e.call(t), i, o = [], s;
136
- try {
137
- for (; (r === void 0 || r-- > 0) && !(i = n.next()).done; ) o.push(i.value);
138
- } catch (u) {
139
- s = { error: u };
140
- } finally {
141
- try {
142
- i && !i.done && (e = n.return) && e.call(n);
143
- } finally {
144
- if (s) throw s.error;
145
- }
146
- }
147
- return o;
148
- }
149
- function K(t, r, e) {
150
- if (e || arguments.length === 2) for (var n = 0, i = r.length, o; n < i; n++)
151
- (o || !(n in r)) && (o || (o = Array.prototype.slice.call(r, 0, n)), o[n] = r[n]);
152
- return t.concat(o || Array.prototype.slice.call(r));
153
- }
154
- function z(t) {
155
- return this instanceof z ? (this.v = t, this) : new z(t);
156
- }
157
- function $e(t, r, e) {
158
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
159
- var n = e.apply(t, r || []), i, o = [];
160
- return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), u("next"), u("throw"), u("return", s), i[Symbol.asyncIterator] = function() {
161
- return this;
162
- }, i;
163
- function s(f) {
164
- return function(m) {
165
- return Promise.resolve(m).then(f, d);
166
- };
167
- }
168
- function u(f, m) {
169
- n[f] && (i[f] = function(l) {
170
- return new Promise(function(B, w) {
171
- o.push([f, l, B, w]) > 1 || a(f, l);
172
- });
173
- }, m && (i[f] = m(i[f])));
174
- }
175
- function a(f, m) {
176
- try {
177
- c(n[f](m));
178
- } catch (l) {
179
- b(o[0][3], l);
180
- }
181
- }
182
- function c(f) {
183
- f.value instanceof z ? Promise.resolve(f.value.v).then(h, d) : b(o[0][2], f);
184
- }
185
- function h(f) {
186
- a("next", f);
187
- }
188
- function d(f) {
189
- a("throw", f);
190
- }
191
- function b(f, m) {
192
- f(m), o.shift(), o.length && a(o[0][0], o[0][1]);
193
- }
194
- }
195
- function je(t) {
196
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
197
- var r = t[Symbol.asyncIterator], e;
198
- return r ? r.call(t) : (t = typeof N == "function" ? N(t) : t[Symbol.iterator](), e = {}, n("next"), n("throw"), n("return"), e[Symbol.asyncIterator] = function() {
199
- return this;
200
- }, e);
201
- function n(o) {
202
- e[o] = t[o] && function(s) {
203
- return new Promise(function(u, a) {
204
- s = t[o](s), i(u, a, s.done, s.value);
205
- });
206
- };
207
- }
208
- function i(o, s, u, a) {
209
- Promise.resolve(a).then(function(c) {
210
- o({ value: c, done: u });
211
- }, s);
212
- }
213
- }
214
- function O(t) {
215
- return typeof t == "function";
216
- }
217
- function he(t) {
218
- var r = function(n) {
219
- Error.call(n), n.stack = new Error().stack;
220
- }, e = t(r);
221
- return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
222
- }
223
- var q = he(function(t) {
224
- return function(e) {
225
- t(this), this.message = e ? e.length + ` errors occurred during unsubscription:
226
- ` + e.map(function(n, i) {
227
- return i + 1 + ") " + n.toString();
228
- }).join(`
229
- `) : "", this.name = "UnsubscriptionError", this.errors = e;
230
- };
231
- });
232
- function ne(t, r) {
233
- if (t) {
234
- var e = t.indexOf(r);
235
- 0 <= e && t.splice(e, 1);
236
- }
237
- }
238
- var ee = (function() {
239
- function t(r) {
240
- this.initialTeardown = r, this.closed = !1, this._parentage = null, this._finalizers = null;
241
- }
242
- return t.prototype.unsubscribe = function() {
243
- var r, e, n, i, o;
244
- if (!this.closed) {
245
- this.closed = !0;
246
- var s = this._parentage;
247
- if (s)
248
- if (this._parentage = null, Array.isArray(s))
249
- try {
250
- for (var u = N(s), a = u.next(); !a.done; a = u.next()) {
251
- var c = a.value;
252
- c.remove(this);
253
- }
254
- } catch (l) {
255
- r = { error: l };
256
- } finally {
257
- try {
258
- a && !a.done && (e = u.return) && e.call(u);
259
- } finally {
260
- if (r) throw r.error;
261
- }
262
- }
263
- else
264
- s.remove(this);
265
- var h = this.initialTeardown;
266
- if (O(h))
267
- try {
268
- h();
269
- } catch (l) {
270
- o = l instanceof q ? l.errors : [l];
271
- }
272
- var d = this._finalizers;
273
- if (d) {
274
- this._finalizers = null;
275
- try {
276
- for (var b = N(d), f = b.next(); !f.done; f = b.next()) {
277
- var m = f.value;
278
- try {
279
- ie(m);
280
- } catch (l) {
281
- o = o ?? [], l instanceof q ? o = K(K([], Z(o)), Z(l.errors)) : o.push(l);
282
- }
283
- }
284
- } catch (l) {
285
- n = { error: l };
286
- } finally {
287
- try {
288
- f && !f.done && (i = b.return) && i.call(b);
289
- } finally {
290
- if (n) throw n.error;
291
- }
292
- }
293
- }
294
- if (o)
295
- throw new q(o);
296
- }
297
- }, t.prototype.add = function(r) {
298
- var e;
299
- if (r && r !== this)
300
- if (this.closed)
301
- ie(r);
302
- else {
303
- if (r instanceof t) {
304
- if (r.closed || r._hasParent(this))
305
- return;
306
- r._addParent(this);
307
- }
308
- (this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(r);
309
- }
310
- }, t.prototype._hasParent = function(r) {
311
- var e = this._parentage;
312
- return e === r || Array.isArray(e) && e.includes(r);
313
- }, t.prototype._addParent = function(r) {
314
- var e = this._parentage;
315
- this._parentage = Array.isArray(e) ? (e.push(r), e) : e ? [e, r] : r;
316
- }, t.prototype._removeParent = function(r) {
317
- var e = this._parentage;
318
- e === r ? this._parentage = null : Array.isArray(e) && ne(e, r);
319
- }, t.prototype.remove = function(r) {
320
- var e = this._finalizers;
321
- e && ne(e, r), r instanceof t && r._removeParent(this);
322
- }, t.EMPTY = (function() {
323
- var r = new t();
324
- return r.closed = !0, r;
325
- })(), t;
326
- })();
327
- ee.EMPTY;
328
- function de(t) {
329
- return t instanceof ee || t && "closed" in t && O(t.remove) && O(t.add) && O(t.unsubscribe);
330
- }
331
- function ie(t) {
332
- O(t) ? t() : t.unsubscribe();
333
- }
334
- var Ge = {
335
- Promise: void 0
336
- }, We = {
337
- setTimeout: function(t, r) {
338
- for (var e = [], n = 2; n < arguments.length; n++)
339
- e[n - 2] = arguments[n];
340
- return setTimeout.apply(void 0, K([t, r], Z(e)));
341
- },
342
- clearTimeout: function(t) {
343
- return clearTimeout(t);
344
- },
345
- delegate: void 0
346
- };
347
- function me(t) {
348
- We.setTimeout(function() {
349
- throw t;
350
- });
351
- }
352
- function oe() {
353
- }
354
- function qe(t) {
355
- t();
356
- }
357
- var te = (function(t) {
358
- X(r, t);
359
- function r(e) {
360
- var n = t.call(this) || this;
361
- return n.isStopped = !1, e ? (n.destination = e, de(e) && e.add(n)) : n.destination = Je, n;
362
- }
363
- return r.create = function(e, n, i) {
364
- return new $(e, n, i);
365
- }, r.prototype.next = function(e) {
366
- this.isStopped || this._next(e);
367
- }, r.prototype.error = function(e) {
368
- this.isStopped || (this.isStopped = !0, this._error(e));
369
- }, r.prototype.complete = function() {
370
- this.isStopped || (this.isStopped = !0, this._complete());
371
- }, r.prototype.unsubscribe = function() {
372
- this.closed || (this.isStopped = !0, t.prototype.unsubscribe.call(this), this.destination = null);
373
- }, r.prototype._next = function(e) {
374
- this.destination.next(e);
375
- }, r.prototype._error = function(e) {
376
- try {
377
- this.destination.error(e);
378
- } finally {
379
- this.unsubscribe();
380
- }
381
- }, r.prototype._complete = function() {
382
- try {
383
- this.destination.complete();
384
- } finally {
385
- this.unsubscribe();
386
- }
387
- }, r;
388
- })(ee), Ye = (function() {
389
- function t(r) {
390
- this.partialObserver = r;
391
- }
392
- return t.prototype.next = function(r) {
393
- var e = this.partialObserver;
394
- if (e.next)
395
- try {
396
- e.next(r);
397
- } catch (n) {
398
- M(n);
399
- }
400
- }, t.prototype.error = function(r) {
401
- var e = this.partialObserver;
402
- if (e.error)
403
- try {
404
- e.error(r);
405
- } catch (n) {
406
- M(n);
407
- }
408
- else
409
- M(r);
410
- }, t.prototype.complete = function() {
411
- var r = this.partialObserver;
412
- if (r.complete)
413
- try {
414
- r.complete();
415
- } catch (e) {
416
- M(e);
417
- }
418
- }, t;
419
- })(), $ = (function(t) {
420
- X(r, t);
421
- function r(e, n, i) {
422
- var o = t.call(this) || this, s;
423
- return O(e) || !e ? s = {
424
- next: e ?? void 0,
425
- error: n ?? void 0,
426
- complete: i ?? void 0
427
- } : s = e, o.destination = new Ye(s), o;
428
- }
429
- return r;
430
- })(te);
431
- function M(t) {
432
- me(t);
433
- }
434
- function Qe(t) {
435
- throw t;
436
- }
437
- var Je = {
438
- closed: !0,
439
- next: oe,
440
- error: Qe,
441
- complete: oe
442
- }, re = (function() {
443
- return typeof Symbol == "function" && Symbol.observable || "@@observable";
444
- })();
445
- function ge(t) {
446
- return t;
447
- }
448
- function Ze(t) {
449
- return t.length === 0 ? ge : t.length === 1 ? t[0] : function(e) {
450
- return t.reduce(function(n, i) {
451
- return i(n);
452
- }, e);
453
- };
454
- }
455
- var _ = (function() {
456
- function t(r) {
457
- r && (this._subscribe = r);
458
- }
459
- return t.prototype.lift = function(r) {
460
- var e = new t();
461
- return e.source = this, e.operator = r, e;
462
- }, t.prototype.subscribe = function(r, e, n) {
463
- var i = this, o = Xe(r) ? r : new $(r, e, n);
464
- return qe(function() {
465
- var s = i, u = s.operator, a = s.source;
466
- o.add(u ? u.call(o, a) : a ? i._subscribe(o) : i._trySubscribe(o));
467
- }), o;
468
- }, t.prototype._trySubscribe = function(r) {
469
- try {
470
- return this._subscribe(r);
471
- } catch (e) {
472
- r.error(e);
473
- }
474
- }, t.prototype.forEach = function(r, e) {
475
- var n = this;
476
- return e = se(e), new e(function(i, o) {
477
- var s = new $({
478
- next: function(u) {
479
- try {
480
- r(u);
481
- } catch (a) {
482
- o(a), s.unsubscribe();
483
- }
484
- },
485
- error: o,
486
- complete: i
487
- });
488
- n.subscribe(s);
489
- });
490
- }, t.prototype._subscribe = function(r) {
491
- var e;
492
- return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(r);
493
- }, t.prototype[re] = function() {
494
- return this;
495
- }, t.prototype.pipe = function() {
496
- for (var r = [], e = 0; e < arguments.length; e++)
497
- r[e] = arguments[e];
498
- return Ze(r)(this);
499
- }, t.prototype.toPromise = function(r) {
500
- var e = this;
501
- return r = se(r), new r(function(n, i) {
502
- var o;
503
- e.subscribe(function(s) {
504
- return o = s;
505
- }, function(s) {
506
- return i(s);
507
- }, function() {
508
- return n(o);
509
- });
510
- });
511
- }, t.create = function(r) {
512
- return new t(r);
513
- }, t;
514
- })();
515
- function se(t) {
516
- var r;
517
- return (r = t ?? Ge.Promise) !== null && r !== void 0 ? r : Promise;
518
- }
519
- function Ke(t) {
520
- return t && O(t.next) && O(t.error) && O(t.complete);
521
- }
522
- function Xe(t) {
523
- return t && t instanceof te || Ke(t) && de(t);
524
- }
525
- function et(t) {
526
- return O(t?.lift);
527
- }
528
- function R(t) {
529
- return function(r) {
530
- if (et(r))
531
- return r.lift(function(e) {
532
- try {
533
- return t(e, this);
534
- } catch (n) {
535
- this.error(n);
536
- }
537
- });
538
- throw new TypeError("Unable to lift unknown Observable type");
539
- };
540
- }
541
- function L(t, r, e, n, i) {
542
- return new tt(t, r, e, n, i);
543
- }
544
- var tt = (function(t) {
545
- X(r, t);
546
- function r(e, n, i, o, s, u) {
547
- var a = t.call(this, e) || this;
548
- return a.onFinalize = s, a.shouldUnsubscribe = u, a._next = n ? function(c) {
549
- try {
550
- n(c);
551
- } catch (h) {
552
- e.error(h);
553
- }
554
- } : t.prototype._next, a._error = o ? function(c) {
555
- try {
556
- o(c);
557
- } catch (h) {
558
- e.error(h);
559
- } finally {
560
- this.unsubscribe();
561
- }
562
- } : t.prototype._error, a._complete = i ? function() {
563
- try {
564
- i();
565
- } catch (c) {
566
- e.error(c);
567
- } finally {
568
- this.unsubscribe();
569
- }
570
- } : t.prototype._complete, a;
571
- }
572
- return r.prototype.unsubscribe = function() {
573
- var e;
574
- if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
575
- var n = this.closed;
576
- t.prototype.unsubscribe.call(this), !n && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
577
- }
578
- }, r;
579
- })(te), rt = new _(function(t) {
580
- return t.complete();
581
- });
582
- function nt(t) {
583
- return t && O(t.schedule);
584
- }
585
- function ye(t) {
586
- return t[t.length - 1];
587
- }
588
- function it(t) {
589
- return nt(ye(t)) ? t.pop() : void 0;
590
- }
591
- function ot(t, r) {
592
- return typeof ye(t) == "number" ? t.pop() : r;
593
- }
594
- var be = (function(t) {
595
- return t && typeof t.length == "number" && typeof t != "function";
596
- });
597
- function pe(t) {
598
- return O(t?.then);
599
- }
600
- function we(t) {
601
- return O(t[re]);
602
- }
603
- function ve(t) {
604
- return Symbol.asyncIterator && O(t?.[Symbol.asyncIterator]);
605
- }
606
- function Se(t) {
607
- return new TypeError("You provided " + (t !== null && typeof t == "object" ? "an invalid object" : "'" + t + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
608
- }
609
- function st() {
610
- return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
611
- }
612
- var xe = st();
613
- function Ie(t) {
614
- return O(t?.[xe]);
615
- }
616
- function Be(t) {
617
- return $e(this, arguments, function() {
618
- var e, n, i, o;
619
- return le(this, function(s) {
620
- switch (s.label) {
621
- case 0:
622
- e = t.getReader(), s.label = 1;
623
- case 1:
624
- s.trys.push([1, , 9, 10]), s.label = 2;
625
- case 2:
626
- return [4, z(e.read())];
627
- case 3:
628
- return n = s.sent(), i = n.value, o = n.done, o ? [4, z(void 0)] : [3, 5];
629
- case 4:
630
- return [2, s.sent()];
631
- case 5:
632
- return [4, z(i)];
633
- case 6:
634
- return [4, s.sent()];
635
- case 7:
636
- return s.sent(), [3, 2];
637
- case 8:
638
- return [3, 10];
639
- case 9:
640
- return e.releaseLock(), [7];
641
- case 10:
642
- return [2];
643
- }
644
- });
645
- });
646
- }
647
- function Ue(t) {
648
- return O(t?.getReader);
649
- }
650
- function D(t) {
651
- if (t instanceof _)
652
- return t;
653
- if (t != null) {
654
- if (we(t))
655
- return ct(t);
656
- if (be(t))
657
- return at(t);
658
- if (pe(t))
659
- return ut(t);
660
- if (ve(t))
661
- return Oe(t);
662
- if (Ie(t))
663
- return ft(t);
664
- if (Ue(t))
665
- return lt(t);
666
- }
667
- throw Se(t);
668
- }
669
- function ct(t) {
670
- return new _(function(r) {
671
- var e = t[re]();
672
- if (O(e.subscribe))
673
- return e.subscribe(r);
674
- throw new TypeError("Provided object does not correctly implement Symbol.observable");
675
- });
676
- }
677
- function at(t) {
678
- return new _(function(r) {
679
- for (var e = 0; e < t.length && !r.closed; e++)
680
- r.next(t[e]);
681
- r.complete();
682
- });
683
- }
684
- function ut(t) {
685
- return new _(function(r) {
686
- t.then(function(e) {
687
- r.closed || (r.next(e), r.complete());
688
- }, function(e) {
689
- return r.error(e);
690
- }).then(null, me);
691
- });
692
- }
693
- function ft(t) {
694
- return new _(function(r) {
695
- var e, n;
696
- try {
697
- for (var i = N(t), o = i.next(); !o.done; o = i.next()) {
698
- var s = o.value;
699
- if (r.next(s), r.closed)
700
- return;
701
- }
702
- } catch (u) {
703
- e = { error: u };
704
- } finally {
705
- try {
706
- o && !o.done && (n = i.return) && n.call(i);
707
- } finally {
708
- if (e) throw e.error;
709
- }
710
- }
711
- r.complete();
712
- });
713
- }
714
- function Oe(t) {
715
- return new _(function(r) {
716
- ht(t, r).catch(function(e) {
717
- return r.error(e);
718
- });
719
- });
720
- }
721
- function lt(t) {
722
- return Oe(Be(t));
723
- }
724
- function ht(t, r) {
725
- var e, n, i, o;
726
- return He(this, void 0, void 0, function() {
727
- var s, u;
728
- return le(this, function(a) {
729
- switch (a.label) {
730
- case 0:
731
- a.trys.push([0, 5, 6, 11]), e = je(t), a.label = 1;
732
- case 1:
733
- return [4, e.next()];
734
- case 2:
735
- if (n = a.sent(), !!n.done) return [3, 4];
736
- if (s = n.value, r.next(s), r.closed)
737
- return [2];
738
- a.label = 3;
739
- case 3:
740
- return [3, 1];
741
- case 4:
742
- return [3, 11];
743
- case 5:
744
- return u = a.sent(), i = { error: u }, [3, 11];
745
- case 6:
746
- return a.trys.push([6, , 9, 10]), n && !n.done && (o = e.return) ? [4, o.call(e)] : [3, 8];
747
- case 7:
748
- a.sent(), a.label = 8;
749
- case 8:
750
- return [3, 10];
751
- case 9:
752
- if (i) throw i.error;
753
- return [7];
754
- case 10:
755
- return [7];
756
- case 11:
757
- return r.complete(), [2];
758
- }
759
- });
760
- });
761
- }
762
- function V(t, r, e, n, i) {
763
- n === void 0 && (n = 0), i === void 0 && (i = !1);
764
- var o = r.schedule(function() {
765
- e(), i ? t.add(this.schedule(null, n)) : this.unsubscribe();
766
- }, n);
767
- if (t.add(o), !i)
768
- return o;
769
- }
770
- function ke(t, r) {
771
- return r === void 0 && (r = 0), R(function(e, n) {
772
- e.subscribe(L(n, function(i) {
773
- return V(n, t, function() {
774
- return n.next(i);
775
- }, r);
776
- }, function() {
777
- return V(n, t, function() {
778
- return n.complete();
779
- }, r);
780
- }, function(i) {
781
- return V(n, t, function() {
782
- return n.error(i);
783
- }, r);
784
- }));
785
- });
786
- }
787
- function Ee(t, r) {
788
- return r === void 0 && (r = 0), R(function(e, n) {
789
- n.add(t.schedule(function() {
790
- return e.subscribe(n);
791
- }, r));
792
- });
793
- }
794
- function dt(t, r) {
795
- return D(t).pipe(Ee(r), ke(r));
796
- }
797
- function mt(t, r) {
798
- return D(t).pipe(Ee(r), ke(r));
799
- }
800
- function gt(t, r) {
801
- return new _(function(e) {
802
- var n = 0;
803
- return r.schedule(function() {
804
- n === t.length ? e.complete() : (e.next(t[n++]), e.closed || this.schedule());
805
- });
806
- });
807
- }
808
- function yt(t, r) {
809
- return new _(function(e) {
810
- var n;
811
- return V(e, r, function() {
812
- n = t[xe](), V(e, r, function() {
813
- var i, o, s;
814
- try {
815
- i = n.next(), o = i.value, s = i.done;
816
- } catch (u) {
817
- e.error(u);
818
- return;
819
- }
820
- s ? e.complete() : e.next(o);
821
- }, 0, !0);
822
- }), function() {
823
- return O(n?.return) && n.return();
824
- };
825
- });
826
- }
827
- function Te(t, r) {
828
- if (!t)
829
- throw new Error("Iterable cannot be null");
830
- return new _(function(e) {
831
- V(e, r, function() {
832
- var n = t[Symbol.asyncIterator]();
833
- V(e, r, function() {
834
- n.next().then(function(i) {
835
- i.done ? e.complete() : e.next(i.value);
836
- });
837
- }, 0, !0);
838
- });
839
- });
840
- }
841
- function bt(t, r) {
842
- return Te(Be(t), r);
843
- }
844
- function pt(t, r) {
845
- if (t != null) {
846
- if (we(t))
847
- return dt(t, r);
848
- if (be(t))
849
- return gt(t, r);
850
- if (pe(t))
851
- return mt(t, r);
852
- if (ve(t))
853
- return Te(t, r);
854
- if (Ie(t))
855
- return yt(t, r);
856
- if (Ue(t))
857
- return bt(t, r);
858
- }
859
- throw Se(t);
860
- }
861
- function wt(t, r) {
862
- return r ? pt(t, r) : D(t);
863
- }
864
- var vt = he(function(t) {
865
- return function() {
866
- t(this), this.name = "EmptyError", this.message = "no elements in sequence";
867
- };
868
- });
869
- function _e(t, r) {
870
- return new Promise(function(e, n) {
871
- var i = new $({
872
- next: function(o) {
873
- e(o), i.unsubscribe();
874
- },
875
- error: n,
876
- complete: function() {
877
- n(new vt());
878
- }
879
- });
880
- t.subscribe(i);
881
- });
882
- }
883
- function Ce(t, r) {
884
- return R(function(e, n) {
885
- var i = 0;
886
- e.subscribe(L(n, function(o) {
887
- n.next(t.call(r, o, i++));
888
- }));
889
- });
890
- }
891
- function St(t, r, e, n, i, o, s, u) {
892
- var a = [], c = 0, h = 0, d = !1, b = function() {
893
- d && !a.length && !c && r.complete();
894
- }, f = function(l) {
895
- return c < n ? m(l) : a.push(l);
896
- }, m = function(l) {
897
- c++;
898
- var B = !1;
899
- D(e(l, h++)).subscribe(L(r, function(w) {
900
- r.next(w);
901
- }, function() {
902
- B = !0;
903
- }, void 0, function() {
904
- if (B)
905
- try {
906
- c--;
907
- for (var w = function() {
908
- var S = a.shift();
909
- s || m(S);
910
- }; a.length && c < n; )
911
- w();
912
- b();
913
- } catch (S) {
914
- r.error(S);
915
- }
916
- }));
917
- };
918
- return t.subscribe(L(r, f, function() {
919
- d = !0, b();
920
- })), function() {
921
- };
922
- }
923
- function Pe(t, r, e) {
924
- return e === void 0 && (e = 1 / 0), O(r) ? Pe(function(n, i) {
925
- return Ce(function(o, s) {
926
- return r(n, o, i, s);
927
- })(D(t(n, i)));
928
- }, e) : (typeof r == "number" && (e = r), R(function(n, i) {
929
- return St(n, i, t, e);
930
- }));
931
- }
932
- function xt(t) {
933
- return t === void 0 && (t = 1 / 0), Pe(ge, t);
934
- }
935
- function It() {
936
- for (var t = [], r = 0; r < arguments.length; r++)
937
- t[r] = arguments[r];
938
- var e = it(t), n = ot(t, 1 / 0), i = t;
939
- return i.length ? i.length === 1 ? D(i[0]) : xt(n)(wt(i, e)) : rt;
940
- }
941
- function Bt(t, r, e, n, i) {
942
- return function(o, s) {
943
- var u = e, a = r, c = 0;
944
- o.subscribe(L(s, function(h) {
945
- var d = c++;
946
- a = u ? t(a, h, d) : (u = !0, h);
947
- }, (function() {
948
- u && s.next(a), s.complete();
949
- })));
950
- };
951
- }
952
- function Ve(t, r) {
953
- return R(Bt(t, r, arguments.length >= 2, !1, !0));
954
- }
955
- var Ut = function(t, r) {
956
- return t.push(r), t;
957
- };
958
- function Ot() {
959
- return R(function(t, r) {
960
- Ve(Ut, [])(t).subscribe(r);
961
- });
962
- }
963
- function kt(t) {
964
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
965
- }
966
- var Y, ce;
967
- function Et() {
968
- if (ce) return Y;
969
- ce = 1;
970
- class t {
971
- constructor(e = {}) {
972
- if (!(e.maxSize && e.maxSize > 0))
973
- throw new TypeError("`maxSize` must be a number greater than 0");
974
- this.maxSize = e.maxSize, this.cache = /* @__PURE__ */ new Map(), this.oldCache = /* @__PURE__ */ new Map(), this._size = 0;
975
- }
976
- _set(e, n) {
977
- this.cache.set(e, n), this._size++, this._size >= this.maxSize && (this._size = 0, this.oldCache = this.cache, this.cache = /* @__PURE__ */ new Map());
978
- }
979
- get(e) {
980
- if (this.cache.has(e))
981
- return this.cache.get(e);
982
- if (this.oldCache.has(e)) {
983
- const n = this.oldCache.get(e);
984
- return this.oldCache.delete(e), this._set(e, n), n;
985
- }
986
- }
987
- set(e, n) {
988
- return this.cache.has(e) ? this.cache.set(e, n) : this._set(e, n), this;
989
- }
990
- has(e) {
991
- return this.cache.has(e) || this.oldCache.has(e);
992
- }
993
- peek(e) {
994
- if (this.cache.has(e))
995
- return this.cache.get(e);
996
- if (this.oldCache.has(e))
997
- return this.oldCache.get(e);
998
- }
999
- delete(e) {
1000
- const n = this.cache.delete(e);
1001
- return n && this._size--, this.oldCache.delete(e) || n;
1002
- }
1003
- clear() {
1004
- this.cache.clear(), this.oldCache.clear(), this._size = 0;
1005
- }
1006
- *keys() {
1007
- for (const [e] of this)
1008
- yield e;
1009
- }
1010
- *values() {
1011
- for (const [, e] of this)
1012
- yield e;
1013
- }
1014
- *[Symbol.iterator]() {
1015
- for (const e of this.cache)
1016
- yield e;
1017
- for (const e of this.oldCache) {
1018
- const [n] = e;
1019
- this.cache.has(n) || (yield e);
1020
- }
1021
- }
1022
- get size() {
1023
- let e = 0;
1024
- for (const n of this.oldCache.keys())
1025
- this.cache.has(n) || e++;
1026
- return this._size + e;
1027
- }
1028
- }
1029
- return Y = t, Y;
1030
- }
1031
- var Tt = Et();
1032
- const Ae = /* @__PURE__ */ kt(Tt);
1033
- class F {
1034
- ranges;
1035
- constructor(r) {
1036
- this.ranges = r;
1037
- }
1038
- get min() {
1039
- return this.ranges[0].min;
1040
- }
1041
- get max() {
1042
- return this.ranges.at(-1).max;
1043
- }
1044
- contains(r) {
1045
- for (const e of this.ranges)
1046
- if (e.min <= r && e.max >= r)
1047
- return !0;
1048
- return !1;
1049
- }
1050
- isContiguous() {
1051
- return this.ranges.length > 1;
1052
- }
1053
- getRanges() {
1054
- return this.ranges.map((r) => new F([{ min: r.min, max: r.max }]));
1055
- }
1056
- toString() {
1057
- return this.ranges.map((r) => `[${r.min}-${r.max}]`).join(",");
1058
- }
1059
- union(r) {
1060
- const e = [...this.getRanges(), ...r.getRanges()].sort((o, s) => o.min < s.min ? -1 : o.min > s.min ? 1 : o.max < s.max ? -1 : s.max > o.max ? 1 : 0), n = [];
1061
- let i = e[0];
1062
- for (const o of e)
1063
- o.min > i.max + 1 ? (n.push(i), i = o) : o.max > i.max && (i = new F([{ min: i.min, max: o.max }]));
1064
- return n.push(i), n.length === 1 ? n[0] : new F(n);
1065
- }
1066
- }
1067
- function _t(t) {
1068
- return Ne(t.subarray(2), void 0);
1069
- }
1070
- class Ct extends Error {
1071
- code;
1072
- constructor(r) {
1073
- super(r), this.code = "ERR_ABORTED";
1074
- }
1075
- }
1076
- function Pt(t) {
1077
- t.sort((i, o) => i.offset - o.offset);
1078
- const r = [];
1079
- let e, n;
1080
- for (const i of t)
1081
- e && n && i.offset - n <= 2e3 ? (e.length = e.length + i.length - n + i.offset, e.blocks.push(i)) : r.push(e = {
1082
- blocks: [i],
1083
- length: i.length,
1084
- offset: i.offset
1085
- }), n = e.offset + e.length;
1086
- return r;
1087
- }
1088
- function H(t) {
1089
- if (t && t.aborted)
1090
- if (typeof DOMException > "u") {
1091
- const r = new Ct("aborted");
1092
- throw r.code = "ERR_ABORTED", r;
1093
- } else
1094
- throw new DOMException("aborted", "AbortError");
1095
- }
1096
- const Vt = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0;
1097
- function Q(t, r, e, n) {
1098
- return t < n && r >= e;
1099
- }
1100
- class ze {
1101
- bbi;
1102
- refsByName;
1103
- cirTreeOffset;
1104
- isCompressed;
1105
- blockType;
1106
- cirTreePromise;
1107
- featureCache = new ue({
1108
- cache: new Ae({ maxSize: 1e3 }),
1109
- fill: async ({ length: r, offset: e }, n) => this.bbi.read(r, e, { signal: n })
1110
- });
1111
- constructor(r, e, n, i, o) {
1112
- if (this.bbi = r, this.refsByName = e, this.cirTreeOffset = n, this.isCompressed = i, this.blockType = o, !(n >= 0))
1113
- throw new Error("invalid cirTreeOffset!");
1114
- }
1115
- async readWigData(r, e, n, i, o) {
1116
- try {
1117
- const s = this.refsByName[r];
1118
- s === void 0 && i.complete();
1119
- const u = { chrId: s, start: e, end: n };
1120
- this.cirTreePromise || (this.cirTreePromise = this.bbi.read(48, this.cirTreeOffset, o));
1121
- const a = await this.cirTreePromise, h = new DataView(a.buffer).getUint32(4, !0);
1122
- let d = [], b = 0;
1123
- const f = (w, S, x) => {
1124
- try {
1125
- const p = w.subarray(S), g = new DataView(p.buffer, p.byteOffset, p.length);
1126
- let y = 0;
1127
- const U = g.getUint8(y);
1128
- y += 2;
1129
- const T = g.getUint16(y, !0);
1130
- if (y += 2, U === 1) {
1131
- const k = [];
1132
- for (let I = 0; I < T; I++) {
1133
- const E = g.getUint32(y, !0);
1134
- y += 4;
1135
- const C = g.getUint32(y, !0);
1136
- y += 4;
1137
- const P = g.getUint32(y, !0);
1138
- y += 4;
1139
- const j = g.getUint32(y, !0);
1140
- y += 4;
1141
- const G = Number(g.getBigUint64(y, !0));
1142
- y += 8;
1143
- const W = Number(g.getBigUint64(y, !0));
1144
- y += 8, k.push({
1145
- startChrom: E,
1146
- startBase: C,
1147
- endBase: j,
1148
- endChrom: P,
1149
- blockOffset: G,
1150
- blockSize: W,
1151
- offset: y
1152
- });
1153
- }
1154
- d = d.concat(k.filter((I) => m(I)).map((I) => ({
1155
- offset: I.blockOffset,
1156
- length: I.blockSize
1157
- })));
1158
- } else if (U === 0) {
1159
- const k = [];
1160
- for (let E = 0; E < T; E++) {
1161
- const C = g.getUint32(y, !0);
1162
- y += 4;
1163
- const P = g.getUint32(y, !0);
1164
- y += 4;
1165
- const j = g.getUint32(y, !0);
1166
- y += 4;
1167
- const G = g.getUint32(y, !0);
1168
- y += 4;
1169
- const W = Number(g.getBigUint64(y, !0));
1170
- y += 8, k.push({
1171
- startChrom: C,
1172
- startBase: P,
1173
- endChrom: j,
1174
- endBase: G,
1175
- blockOffset: W,
1176
- offset: y
1177
- });
1178
- }
1179
- const I = k.filter((E) => m(E)).map((E) => E.blockOffset);
1180
- I.length > 0 && B(I, x + 1);
1181
- }
1182
- } catch (v) {
1183
- i.error(v);
1184
- }
1185
- }, m = (w) => {
1186
- const { startChrom: S, startBase: x, endChrom: v, endBase: p } = w;
1187
- return (S < s || S === s && x <= n) && (v > s || v === s && p >= e);
1188
- }, l = async (w, S, x) => {
1189
- try {
1190
- const v = S.max - S.min, p = S.min, g = await this.featureCache.get(`${v}_${p}`, { length: v, offset: p }, o?.signal);
1191
- for (const y of w)
1192
- S.contains(y) && (f(g, y - p, x), b -= 1, b === 0 && this.readFeatures(i, d, {
1193
- ...o,
1194
- request: u
1195
- }).catch((U) => {
1196
- i.error(U);
1197
- }));
1198
- } catch (v) {
1199
- i.error(v);
1200
- }
1201
- }, B = (w, S) => {
1202
- try {
1203
- b += w.length;
1204
- const x = 4 + h * 32;
1205
- let v = new F([
1206
- {
1207
- min: w[0],
1208
- max: w[0] + x
1209
- }
1210
- ]);
1211
- for (let p = 1; p < w.length; p += 1) {
1212
- const g = new F([
1213
- {
1214
- min: w[p],
1215
- max: w[p] + x
1216
- }
1217
- ]);
1218
- v = v.union(g);
1219
- }
1220
- v.getRanges().map((p) => l(w, p, S));
1221
- } catch (x) {
1222
- i.error(x);
1223
- }
1224
- };
1225
- B([this.cirTreeOffset + 48], 1);
1226
- return;
1227
- } catch (s) {
1228
- i.error(s);
1229
- }
1230
- }
1231
- parseSummaryBlock(r, e, n) {
1232
- const i = [];
1233
- let o = e;
1234
- const s = new DataView(r.buffer, r.byteOffset, r.length);
1235
- for (; o < r.byteLength; ) {
1236
- const u = s.getUint32(o, !0);
1237
- o += 4;
1238
- const a = s.getUint32(o, !0);
1239
- o += 4;
1240
- const c = s.getUint32(o, !0);
1241
- o += 4;
1242
- const h = s.getUint32(o, !0);
1243
- o += 4;
1244
- const d = s.getFloat32(o, !0);
1245
- o += 4;
1246
- const b = s.getFloat32(o, !0);
1247
- o += 4;
1248
- const f = s.getFloat32(o, !0);
1249
- o += 4, o += 4, (!n || u === n.chrId && Q(a, c, n.start, n.end)) && i.push({
1250
- start: a,
1251
- end: c,
1252
- maxScore: b,
1253
- minScore: d,
1254
- summary: !0,
1255
- score: f / (h || 1)
1256
- });
1257
- }
1258
- return i;
1259
- }
1260
- parseBigBedBlock(r, e, n, i) {
1261
- const o = [];
1262
- let s = e;
1263
- const u = r, a = new DataView(u.buffer, u.byteOffset, u.length);
1264
- for (; s < r.byteLength; ) {
1265
- const c = s, h = a.getUint32(s, !0);
1266
- s += 4;
1267
- const d = a.getInt32(s, !0);
1268
- s += 4;
1269
- const b = a.getInt32(s, !0);
1270
- s += 4;
1271
- let f = s;
1272
- for (; f < r.length && r[f] !== 0; f++)
1273
- ;
1274
- const m = r.subarray(s, f), l = Vt?.decode(m) ?? m.toString();
1275
- s = f + 1, o.push({
1276
- chromId: h,
1277
- start: d,
1278
- end: b,
1279
- rest: l,
1280
- uniqueId: `bb-${n + c}`
1281
- });
1282
- }
1283
- return i ? o.filter((c) => Q(c.start, c.end, i.start, i.end)) : o;
1284
- }
1285
- parseBigWigBlock(r, e, n) {
1286
- const i = r.subarray(e), o = new DataView(i.buffer, i.byteOffset, i.length);
1287
- let s = 0;
1288
- s += 4;
1289
- const u = o.getInt32(s, !0);
1290
- s += 8;
1291
- const a = o.getUint32(s, !0);
1292
- s += 4;
1293
- const c = o.getUint32(s, !0);
1294
- s += 4;
1295
- const h = o.getUint8(s);
1296
- s += 2;
1297
- const d = o.getUint16(s, !0);
1298
- s += 2;
1299
- const b = new Array(d);
1300
- switch (h) {
1301
- case 1: {
1302
- for (let f = 0; f < d; f++) {
1303
- const m = o.getInt32(s, !0);
1304
- s += 4;
1305
- const l = o.getInt32(s, !0);
1306
- s += 4;
1307
- const B = o.getFloat32(s, !0);
1308
- s += 4, b[f] = {
1309
- start: m,
1310
- end: l,
1311
- score: B
1312
- };
1313
- }
1314
- break;
1315
- }
1316
- case 2: {
1317
- for (let f = 0; f < d; f++) {
1318
- const m = o.getInt32(s, !0);
1319
- s += 4;
1320
- const l = o.getFloat32(s, !0);
1321
- s += 4, b[f] = {
1322
- score: l,
1323
- start: m,
1324
- end: m + c
1325
- };
1326
- }
1327
- break;
1328
- }
1329
- case 3: {
1330
- for (let f = 0; f < d; f++) {
1331
- const m = o.getFloat32(s, !0);
1332
- s += 4;
1333
- const l = u + f * a;
1334
- b[f] = {
1335
- score: m,
1336
- start: l,
1337
- end: l + c
1338
- };
1339
- }
1340
- break;
1341
- }
1342
- }
1343
- return n ? b.filter((f) => Q(f.start, f.end, n.start, n.end)) : b;
1344
- }
1345
- async readFeatures(r, e, n = {}) {
1346
- try {
1347
- const { blockType: i, isCompressed: o } = this, { signal: s, request: u } = n, a = Pt(e);
1348
- H(s), await Promise.all(a.map(async (c) => {
1349
- H(s);
1350
- const { length: h, offset: d } = c, b = await this.featureCache.get(`${h}_${d}`, c, s);
1351
- for (const f of c.blocks) {
1352
- H(s);
1353
- let m = b.subarray(f.offset - c.offset);
1354
- switch (o && (m = _t(m)), H(s), i) {
1355
- case "summary": {
1356
- r.next(this.parseSummaryBlock(m, 0, u));
1357
- break;
1358
- }
1359
- case "bigwig": {
1360
- r.next(this.parseBigWigBlock(m, 0, u));
1361
- break;
1362
- }
1363
- case "bigbed": {
1364
- r.next(this.parseBigBedBlock(m, 0, f.offset * 256, u));
1365
- break;
1366
- }
1367
- default:
1368
- console.warn(`Don't know what to do with ${i}`);
1369
- }
1370
- }
1371
- })), r.complete();
1372
- } catch (i) {
1373
- r.error(i);
1374
- }
1375
- }
1376
- }
1377
- const At = -2003829722, ae = -2021002517;
1378
- function A(t) {
1379
- return new DataView(t.buffer, t.byteOffset, t.length);
1380
- }
1381
- class Fe {
1382
- bbi;
1383
- headerP;
1384
- renameRefSeqs;
1385
- getHeader(r) {
1386
- return this.headerP || (this.headerP = this._getHeader(r).catch((e) => {
1387
- throw this.headerP = void 0, e;
1388
- })), this.headerP;
1389
- }
1390
- /*
1391
- * @param filehandle - a filehandle from generic-filehandle2
1392
- *
1393
- * @param path - a Local file path as a string
1394
- *
1395
- * @param url - a URL string
1396
- *
1397
- * @param renameRefSeqs - an optional method to rename the internal reference
1398
- * sequences using a mapping function
1399
- */
1400
- constructor(r) {
1401
- const { filehandle: e, renameRefSeqs: n = (s) => s, path: i, url: o } = r;
1402
- if (this.renameRefSeqs = n, e)
1403
- this.bbi = e;
1404
- else if (o)
1405
- this.bbi = new Re(o);
1406
- else if (i)
1407
- this.bbi = new De(i);
1408
- else
1409
- throw new Error("no file given");
1410
- }
1411
- async _getHeader(r) {
1412
- const e = await this._getMainHeader(r), n = await this._readChromTree(e, r);
1413
- return {
1414
- ...e,
1415
- ...n
1416
- };
1417
- }
1418
- async _getMainHeader(r, e = 2e3) {
1419
- const n = await this.bbi.read(e, 0, r), i = A(n), o = i.getInt32(0, !0);
1420
- if (o !== At && o !== ae)
1421
- throw new Error("not a BigWig/BigBed file");
1422
- let s = 0;
1423
- const u = i.getInt32(s, !0);
1424
- s += 4;
1425
- const a = i.getUint16(s, !0);
1426
- s += 2;
1427
- const c = i.getUint16(s, !0);
1428
- s += 2;
1429
- const h = Number(i.getBigUint64(s, !0));
1430
- s += 8;
1431
- const d = Number(i.getBigUint64(s, !0));
1432
- s += 8;
1433
- const b = Number(i.getBigUint64(s, !0));
1434
- s += 8;
1435
- const f = i.getUint16(s, !0);
1436
- s += 2;
1437
- const m = i.getUint16(s, !0);
1438
- s += 2;
1439
- const l = Number(i.getBigUint64(s, !0));
1440
- s += 8;
1441
- const B = Number(i.getBigUint64(s, !0));
1442
- s += 8;
1443
- const w = i.getUint32(s, !0);
1444
- s += 4;
1445
- const S = Number(i.getBigUint64(s, !0));
1446
- s += 8;
1447
- const x = [];
1448
- for (let y = 0; y < c; y++) {
1449
- const U = i.getUint32(s, !0);
1450
- s += 4;
1451
- const T = i.getUint32(s, !0);
1452
- s += 4;
1453
- const k = Number(i.getBigUint64(s, !0));
1454
- s += 8;
1455
- const I = Number(i.getBigUint64(s, !0));
1456
- s += 8, x.push({
1457
- reductionLevel: U,
1458
- reserved: T,
1459
- dataOffset: k,
1460
- indexOffset: I
1461
- });
1462
- }
1463
- const v = u === ae ? "bigbed" : "bigwig";
1464
- if (l > e || B > e - 40)
1465
- return this._getMainHeader(r, e * 2);
1466
- let p;
1467
- if (B) {
1468
- const y = n.subarray(B);
1469
- let U = 0;
1470
- const T = A(y), k = Number(T.getBigUint64(U, !0));
1471
- U += 8;
1472
- const I = T.getFloat64(U, !0);
1473
- U += 8;
1474
- const E = T.getFloat64(U, !0);
1475
- U += 8;
1476
- const C = T.getFloat64(U, !0);
1477
- U += 8;
1478
- const P = T.getFloat64(U, !0);
1479
- U += 8, p = {
1480
- scoreMin: I,
1481
- scoreMax: E,
1482
- scoreSum: C,
1483
- scoreSumSquares: P,
1484
- basesCovered: k
1485
- };
1486
- } else
1487
- throw new Error("no stats");
1488
- const g = new TextDecoder("utf8");
1489
- return {
1490
- zoomLevels: x,
1491
- magic: u,
1492
- extHeaderOffset: S,
1493
- numZoomLevels: c,
1494
- fieldCount: f,
1495
- totalSummary: p,
1496
- definedFieldCount: m,
1497
- uncompressBufSize: w,
1498
- asOffset: l,
1499
- chromTreeOffset: h,
1500
- totalSummaryOffset: B,
1501
- unzoomedDataOffset: d,
1502
- unzoomedIndexOffset: b,
1503
- fileType: v,
1504
- version: a,
1505
- autoSql: l ? g.decode(n.subarray(l, n.indexOf(0, l))) : ""
1506
- };
1507
- }
1508
- async _readChromTree(r, e) {
1509
- const n = [], i = {}, o = r.chromTreeOffset, s = A(await this.bbi.read(32, o, e));
1510
- let u = 0;
1511
- u += 4, u += 4;
1512
- const a = s.getUint32(u, !0);
1513
- u += 4;
1514
- const c = s.getUint32(u, !0);
1515
- u += 4, u += 8;
1516
- const h = new TextDecoder("utf8"), d = async (b) => {
1517
- const f = await this.bbi.read(4, b), m = A(f);
1518
- let l = 0;
1519
- const B = m.getUint8(l);
1520
- l += 1, l += 1;
1521
- const w = m.getUint16(l, !0);
1522
- if (l += 2, B) {
1523
- const S = await this.bbi.read(w * (a + c), b + l), x = A(S);
1524
- l = 0;
1525
- for (let v = 0; v < w; v++) {
1526
- const p = h.decode(S.subarray(l, l + a)).replaceAll("\0", "");
1527
- l += a;
1528
- const g = x.getUint32(l, !0);
1529
- l += 4;
1530
- const y = x.getUint32(l, !0);
1531
- l += 4, i[this.renameRefSeqs(p)] = g, n[g] = {
1532
- name: p,
1533
- id: g,
1534
- length: y
1535
- };
1536
- }
1537
- } else {
1538
- const S = [], x = A(await this.bbi.read(w * (a + 8), b + l));
1539
- l = 0;
1540
- for (let v = 0; v < w; v++) {
1541
- l += a;
1542
- const p = Number(x.getBigUint64(l, !0));
1543
- l += 8, S.push(d(p));
1544
- }
1545
- await Promise.all(S);
1546
- }
1547
- };
1548
- return await d(o + 32), {
1549
- refsByName: i,
1550
- refsByNumber: n
1551
- };
1552
- }
1553
- /*
1554
- * fetches the "unzoomed" view of the bigwig data. this is the default for bigbed
1555
- * @param abortSignal - a signal to optionally abort this operation
1556
- */
1557
- async getUnzoomedView(r) {
1558
- const { unzoomedIndexOffset: e, refsByName: n, uncompressBufSize: i, fileType: o } = await this.getHeader(r);
1559
- return new ze(this.bbi, n, e, i > 0, o);
1560
- }
1561
- /**
1562
- * Gets features from a BigWig file
1563
- *
1564
- * @param refName - The chromosome name
1565
- *
1566
- * @param start - The start of a region
1567
- *
1568
- * @param end - The end of a region
1569
- *
1570
- * @param opts - An object containing basesPerSpan (e.g. pixels per basepair)
1571
- * or scale used to infer the zoomLevel to use
1572
- */
1573
- async getFeatureStream(r, e, n, i) {
1574
- await this.getHeader(i);
1575
- const o = this.renameRefSeqs(r);
1576
- let s;
1577
- const { basesPerSpan: u, scale: a } = i || {};
1578
- return u ? s = await this.getView(1 / u, i) : a ? s = await this.getView(a, i) : s = await this.getView(1, i), new _((c) => {
1579
- s.readWigData(o, e, n, c, i).catch((h) => {
1580
- c.error(h);
1581
- });
1582
- });
1583
- }
1584
- async getFeatures(r, e, n, i) {
1585
- const o = await this.getFeatureStream(r, e, n, i);
1586
- return (await _e(o.pipe(Ot()))).flat();
1587
- }
1588
- }
1589
- class Nt extends Fe {
1590
- /**
1591
- * Retrieves a BlockView of a specific zoomLevel
1592
- *
1593
- * @param scale - number
1594
- *
1595
- * @param opts - An object containing basesPerSpan (e.g. pixels per basepair)
1596
- * or scale used to infer the zoomLevel to use
1597
- */
1598
- async getView(r, e) {
1599
- const { zoomLevels: n, refsByName: i, uncompressBufSize: o } = await this.getHeader(e), s = 1 / r, u = n.length - 1;
1600
- for (let a = u; a >= 0; a -= 1) {
1601
- const c = n[a];
1602
- if (c && c.reductionLevel <= 2 * s)
1603
- return new ze(this.bbi, i, c.indexOffset, o > 0, "summary");
1604
- }
1605
- return this.getUnzoomedView(e);
1606
- }
1607
- }
1608
- function zt(t) {
1609
- return t.filter((r) => !!r);
1610
- }
1611
- class Lt extends Fe {
1612
- readIndicesCache = new ue({
1613
- cache: new Ae({ maxSize: 1 }),
1614
- fill: (r, e) => this._readIndices({ ...r, signal: e })
1615
- });
1616
- readIndices(r = {}) {
1617
- const { signal: e, ...n } = r;
1618
- return this.readIndicesCache.get(JSON.stringify(n), r, e);
1619
- }
1620
- /*
1621
- * retrieve unzoomed view for any scale
1622
- */
1623
- async getView(r, e) {
1624
- return this.getUnzoomedView(e);
1625
- }
1626
- /*
1627
- * parse the bigbed extraIndex fields
1628
- *
1629
- *
1630
- * @return a Promise for an array of Index data structure since there can be
1631
- * multiple extraIndexes in a bigbed, see bedToBigBed documentation
1632
- */
1633
- async _readIndices(r) {
1634
- const { extHeaderOffset: e } = await this.getHeader(r), n = await this.bbi.read(64, e), i = new DataView(n.buffer, n.byteOffset, n.length);
1635
- let o = 0;
1636
- o += 2;
1637
- const s = i.getUint16(o, !0);
1638
- o += 2;
1639
- const u = Number(i.getBigUint64(o, !0));
1640
- if (o += 8, s === 0)
1641
- return [];
1642
- const a = 20, c = a * s, h = await this.bbi.read(c, u), d = [];
1643
- for (let b = 0; b < s; b += 1) {
1644
- const f = h.subarray(b * a), m = new DataView(f.buffer, f.byteOffset, f.length);
1645
- let l = 0;
1646
- const B = m.getInt16(l, !0);
1647
- l += 2;
1648
- const w = m.getInt16(l, !0);
1649
- l += 2;
1650
- const S = Number(m.getBigUint64(l, !0));
1651
- l += 12;
1652
- const x = m.getInt16(l, !0);
1653
- d.push({
1654
- type: B,
1655
- fieldcount: w,
1656
- offset: S,
1657
- field: x
1658
- });
1659
- }
1660
- return d;
1661
- }
1662
- /*
1663
- * perform a search in the bigbed extraIndex to find which blocks in the
1664
- * bigbed data to look for the actual feature data
1665
- *
1666
- * @param name - the name to search for
1667
- *
1668
- * @param opts - a SearchOptions argument with optional signal
1669
- *
1670
- * @return a Promise for an array of bigbed block Loc entries
1671
- */
1672
- async searchExtraIndexBlocks(r, e = {}) {
1673
- const n = await this.readIndices(e);
1674
- if (n.length === 0)
1675
- return [];
1676
- const i = new TextDecoder("utf8"), o = n.map(async (s) => {
1677
- const { offset: u, field: a } = s, c = await this.bbi.read(32, u, e), h = new DataView(c.buffer, c.byteOffset, c.length);
1678
- let d = 0;
1679
- d += 4;
1680
- const b = h.getInt32(d, !0);
1681
- d += 4;
1682
- const f = h.getInt32(d, !0);
1683
- d += 4;
1684
- const m = h.getInt32(d, !0);
1685
- d += 4, d += 8;
1686
- const l = async (B) => {
1687
- const w = B, S = 4 + b * (f + m), v = await this.bbi.read(S, w, e), p = new DataView(v.buffer, v.byteOffset, v.length);
1688
- let g = 0;
1689
- const y = p.getInt8(g);
1690
- g += 2;
1691
- const U = p.getInt16(g, !0);
1692
- g += 2;
1693
- const T = [];
1694
- if (y === 0) {
1695
- const k = [];
1696
- for (let E = 0; E < U; E++) {
1697
- const C = i.decode(v.subarray(g, g + f)).replaceAll("\0", "");
1698
- g += f;
1699
- const P = Number(p.getBigUint64(g, !0));
1700
- g += 8, k.push({
1701
- key: C,
1702
- offset: P
1703
- });
1704
- }
1705
- let I = 0;
1706
- for (const { key: E, offset: C } of k) {
1707
- if (r.localeCompare(E) < 0 && I)
1708
- return l(I);
1709
- I = C;
1710
- }
1711
- return l(I);
1712
- } else if (y === 1) {
1713
- for (let k = 0; k < U; k++) {
1714
- const I = i.decode(v.subarray(g, g + f)).replaceAll("\0", "");
1715
- g += f;
1716
- const E = Number(p.getBigUint64(g, !0));
1717
- g += 8;
1718
- const C = p.getUint32(g, !0);
1719
- g += 4;
1720
- const P = p.getUint32(g, !0);
1721
- g += 4, T.push({
1722
- key: I,
1723
- offset: E,
1724
- length: C,
1725
- reserved: P
1726
- });
1727
- }
1728
- for (const k of T)
1729
- if (k.key === r)
1730
- return {
1731
- ...k,
1732
- field: a
1733
- };
1734
- return;
1735
- }
1736
- };
1737
- return l(u + 32);
1738
- });
1739
- return zt(await Promise.all(o));
1740
- }
1741
- /*
1742
- * retrieve the features from the bigbed data that were found through the
1743
- * lookup of the extraIndex note that there can be multiple extraIndex, see
1744
- * the BigBed specification and the -extraIndex argument to bedToBigBed
1745
- *
1746
- * @param name - the name to search for
1747
- *
1748
- * @param opts - options object with optional AboutSignal
1749
- *
1750
- * @return array of Feature
1751
- */
1752
- async searchExtraIndex(r, e = {}) {
1753
- const n = await this.searchExtraIndexBlocks(r, e);
1754
- if (n.length === 0)
1755
- return [];
1756
- const i = await this.getUnzoomedView(e), o = n.map((u) => new _((a) => {
1757
- i.readFeatures(a, [u], e).catch((c) => {
1758
- a.error(c);
1759
- });
1760
- }).pipe(Ve((a, c) => a.concat(c)), Ce((a) => {
1761
- for (const c of a)
1762
- c.field = u.field;
1763
- return a;
1764
- })));
1765
- return (await _e(It(...o))).filter((u) => u.rest?.split(" ")[(u.field || 0) - 3] === r);
1766
- }
1767
- }
1768
- export {
1769
- Lt as BigBed,
1770
- Nt as BigWig
1771
- };