@synnaxlabs/pluto 0.41.0 → 0.42.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 (442) hide show
  1. package/dist/{Center-Dr9Np3yZ.js → Center-CNcAEDgS.js} +2 -2
  2. package/dist/{Center-sJghNsrv.cjs → Center-Map6aflE.cjs} +1 -1
  3. package/dist/ContextMenu-DmRPxhnI.cjs +1 -0
  4. package/dist/{ContextMenu-GUed89mt.js → ContextMenu-fLU0wr9S.js} +19 -20
  5. package/dist/DateTime-CP3OmEGY.cjs +1 -0
  6. package/dist/{DateTime-DEbT6v4l.js → DateTime-CWAcEwXO.js} +2 -2
  7. package/dist/{Divider-Bpe7zJig.js → Divider-BTLn5ucU.js} +103 -97
  8. package/dist/{Divider-CloQr3vQ.cjs → Divider-Dvb6dsgX.cjs} +4 -4
  9. package/dist/Dropdown-CaGzfZRa.cjs +1 -0
  10. package/dist/{Dropdown-4Cti-bbQ.js → Dropdown-nw8kRSbl.js} +110 -111
  11. package/dist/Haul-B8zGWk0I.cjs +1 -0
  12. package/dist/{Haul-Bw54Yj6J.js → Haul-Cnuzk7Z-.js} +37 -38
  13. package/dist/Item-BzrQqxRC.cjs +1 -0
  14. package/dist/{Item-9WCCzBv2.js → Item-FmwC-twg.js} +10 -11
  15. package/dist/{Keyboard-CZFi6COK.cjs → Keyboard-BfvjkBgh.cjs} +1 -1
  16. package/dist/{Keyboard-634856lT.js → Keyboard-Cevv7vrQ.js} +2 -2
  17. package/dist/{Link-fkoogssj.cjs → Link-DI7BZ5dL.cjs} +1 -1
  18. package/dist/{Link-BEheZd26.js → Link-Dljdu4e9.js} +1 -1
  19. package/dist/{Pack-D6Z6WuZl.cjs → Pack-lJqoOmHx.cjs} +1 -1
  20. package/dist/{Pack-DhZO_rza.js → Pack-to0DG2iP.js} +2 -2
  21. package/dist/Provider-BlM1x1cF.cjs +1 -0
  22. package/dist/{Provider-UAXPVomG.js → Provider-C_B463cg.js} +301 -292
  23. package/dist/{Space-DunsWl06.js → Space-C2oZDkE1.js} +1 -1
  24. package/dist/{Space-BtaH1buB.cjs → Space-DfcVsxz8.cjs} +1 -1
  25. package/dist/{Text-CaRMYy3U.js → Text-BXADoWYY.js} +54 -52
  26. package/dist/Text-BiYpGaEZ.js +35 -0
  27. package/dist/Text-BjHlLKsp.cjs +1 -0
  28. package/dist/{Text-3PiRcn8q.js → Text-CWiPrDI1.js} +75 -77
  29. package/dist/Text-DrIBbnml.cjs +1 -0
  30. package/dist/Text-ZJqK1cI3.cjs +4 -0
  31. package/dist/{Toggle-CZd8L4GI.js → Toggle-CeUVv58o.js} +102 -104
  32. package/dist/Toggle-CfwYy9fe.cjs +1 -0
  33. package/dist/{Video-4XQ1qozd.js → Video-BZ1XTEez.js} +1 -1
  34. package/dist/{Video-BM9uJLaQ.cjs → Video-C7YoF37-.cjs} +1 -1
  35. package/dist/WithIcon-DG7VJxsE.cjs +1 -0
  36. package/dist/WithIcon-pBZ7H9Lq.js +98 -0
  37. package/dist/align.cjs +1 -1
  38. package/dist/align.js +1 -1
  39. package/dist/button.cjs +1 -1
  40. package/dist/button.js +1 -1
  41. package/dist/color.cjs +1 -1
  42. package/dist/color.js +1 -1
  43. package/dist/css-B7c7_G5h.js +4746 -0
  44. package/dist/css-hg3QdDDt.cjs +15 -0
  45. package/dist/css.cjs +1 -1
  46. package/dist/css.js +2 -2
  47. package/dist/deep-B1etRzze.cjs +1 -0
  48. package/dist/deep-BytImVW-.js +102 -0
  49. package/dist/dimensions-Cz-q0Mok.cjs +1 -0
  50. package/dist/dimensions-DcjW7X3n.js +19 -0
  51. package/dist/dropdown.cjs +1 -1
  52. package/dist/dropdown.js +1 -1
  53. package/dist/eraser-BOx6Xhwn.cjs +11 -0
  54. package/dist/eraser-Bsb4kKS3.js +1148 -0
  55. package/dist/ether.cjs +1 -1
  56. package/dist/ether.js +67 -75
  57. package/dist/{external-CVGidiDt.js → external-1KJXZcr9.js} +2 -2
  58. package/dist/{external-DVajt6X6.cjs → external-BHHC7TQ_.cjs} +1 -1
  59. package/dist/external-BLEs2AYM.cjs +46 -0
  60. package/dist/external-BdVuZd3H.cjs +1 -0
  61. package/dist/external-BiBhgCdz.cjs +1 -0
  62. package/dist/external-C75Z9Zbn.cjs +1 -0
  63. package/dist/external-CEfSeJMr.js +432 -0
  64. package/dist/external-CLTPcWrI.cjs +1 -0
  65. package/dist/{external-C0ZRdtdj.js → external-CRNR1bD0.js} +28 -28
  66. package/dist/{external-CnxSp7fm.cjs → external-Cfj1plcw.cjs} +1 -1
  67. package/dist/{external-DNF8yEwq.js → external-Ck1rVwUu.js} +27 -28
  68. package/dist/external-Cni9ftkW.cjs +1 -0
  69. package/dist/{external-BlUic3Vz.js → external-DCcp3sQD.js} +7 -8
  70. package/dist/{external-B-Cao-ae.cjs → external-DCfs7IFi.cjs} +1 -1
  71. package/dist/external-DDD_nc3x.js +400 -0
  72. package/dist/external-DNT-gmZx.cjs +1 -0
  73. package/dist/{external-BY2AjzRx.js → external-DeCeUbqe.js} +20 -19
  74. package/dist/{external-BFOrrNde.js → external-DgSaeiBz.js} +3 -3
  75. package/dist/{external-kZf9CjYn.cjs → external-DhfASB4W.cjs} +37 -37
  76. package/dist/{external-BCUxzSzk.js → external-bkwgRzLc.js} +9 -10
  77. package/dist/{external-BIwhkj24.js → external-hgzjVlDR.js} +1996 -2011
  78. package/dist/external-pUEPQrp_.cjs +1 -0
  79. package/dist/{external-CH66YjTZ.js → external-qwaFowDe.js} +12 -13
  80. package/dist/{external-BbrPEGJw.js → external-sUHGRdqd.js} +2 -2
  81. package/dist/{font-DCE90lco.cjs → font-BFTKtIQk.cjs} +1 -1
  82. package/dist/{font-BXKdXsr5.js → font-Crn-D_ua.js} +2 -2
  83. package/dist/{fontString-BBvH9Ypy.cjs → fontString-DQLaRHQV.cjs} +1 -1
  84. package/dist/{fontString-C7Q9Laqk.js → fontString-DjnDxFrE.js} +1 -1
  85. package/dist/header.cjs +1 -1
  86. package/dist/header.js +1 -1
  87. package/dist/hooks-CM9HWxYc.js +296 -0
  88. package/dist/hooks-CTKCi-OE.cjs +1 -0
  89. package/dist/index.cjs +7 -7
  90. package/dist/index.js +8599 -8514
  91. package/dist/input.cjs +1 -1
  92. package/dist/input.js +1 -1
  93. package/dist/list.cjs +1 -1
  94. package/dist/list.js +1 -1
  95. package/dist/menu.cjs +1 -1
  96. package/dist/menu.js +1 -1
  97. package/dist/pluto.css +1 -1
  98. package/dist/provider-BDFfcHVT.js +12851 -0
  99. package/dist/provider-XPRFhwnl.cjs +58 -0
  100. package/dist/src/aether/aether/aether.d.ts +17 -18
  101. package/dist/src/aether/aether/aether.d.ts.map +1 -1
  102. package/dist/src/aether/aether/aether.spec.spec.d.ts +1 -5
  103. package/dist/src/aether/aether/aether.spec.spec.d.ts.map +1 -1
  104. package/dist/src/aether/main.d.ts.map +1 -1
  105. package/dist/src/aether/main.spec.d.ts +1 -5
  106. package/dist/src/aether/main.spec.d.ts.map +1 -1
  107. package/dist/src/aether/message.d.ts +11 -1
  108. package/dist/src/aether/message.d.ts.map +1 -1
  109. package/dist/src/alamos/aether/alamos.d.ts +19 -25
  110. package/dist/src/alamos/aether/alamos.d.ts.map +1 -1
  111. package/dist/src/button/Button.d.ts +2 -2
  112. package/dist/src/button/Button.d.ts.map +1 -1
  113. package/dist/src/button/color.d.ts +2 -2
  114. package/dist/src/button/color.d.ts.map +1 -1
  115. package/dist/src/channel/LinePlot.d.ts +4 -4
  116. package/dist/src/channel/LinePlot.d.ts.map +1 -1
  117. package/dist/src/color/BaseSwatch.d.ts +3 -3
  118. package/dist/src/color/BaseSwatch.d.ts.map +1 -1
  119. package/dist/src/color/GradientPicker.d.ts +1 -2
  120. package/dist/src/color/GradientPicker.d.ts.map +1 -1
  121. package/dist/src/color/Picker.d.ts +1 -1
  122. package/dist/src/color/Picker.d.ts.map +1 -1
  123. package/dist/src/color/Provider.d.ts +8 -100
  124. package/dist/src/color/Provider.d.ts.map +1 -1
  125. package/dist/src/color/external.d.ts +0 -4
  126. package/dist/src/color/external.d.ts.map +1 -1
  127. package/dist/src/css/color.d.ts +2 -2
  128. package/dist/src/css/color.d.ts.map +1 -1
  129. package/dist/src/divider/Divider.d.ts +2 -1
  130. package/dist/src/divider/Divider.d.ts.map +1 -1
  131. package/dist/src/ether.d.ts +0 -1
  132. package/dist/src/ether.d.ts.map +1 -1
  133. package/dist/src/form/Form.d.ts +1 -1
  134. package/dist/src/form/Form.d.ts.map +1 -1
  135. package/dist/src/haul/Haul.d.ts +7 -63
  136. package/dist/src/haul/Haul.d.ts.map +1 -1
  137. package/dist/src/hooks/useResize.d.ts.map +1 -1
  138. package/dist/src/index.d.ts +1 -0
  139. package/dist/src/index.d.ts.map +1 -1
  140. package/dist/src/input/Text.d.ts +4 -4
  141. package/dist/src/input/Text.d.ts.map +1 -1
  142. package/dist/src/mosaic/types.d.ts +6 -66
  143. package/dist/src/mosaic/types.d.ts.map +1 -1
  144. package/dist/src/pluto/Pluto.d.ts.map +1 -1
  145. package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
  146. package/dist/src/select/Multiple.d.ts +2 -3
  147. package/dist/src/select/Multiple.d.ts.map +1 -1
  148. package/dist/src/state/state.d.ts +1 -2
  149. package/dist/src/state/state.d.ts.map +1 -1
  150. package/dist/src/status/Circle.d.ts.map +1 -1
  151. package/dist/src/status/aether/aggregator.d.ts +34 -96
  152. package/dist/src/status/aether/aggregator.d.ts.map +1 -1
  153. package/dist/src/status/aether/types.d.ts +23 -27
  154. package/dist/src/status/aether/types.d.ts.map +1 -1
  155. package/dist/src/synnax/Provider.d.ts +4 -0
  156. package/dist/src/synnax/Provider.d.ts.map +1 -1
  157. package/dist/src/synnax/aether/provider.d.ts +54 -388
  158. package/dist/src/synnax/aether/provider.d.ts.map +1 -1
  159. package/dist/src/table/aether/Table.d.ts +58 -418
  160. package/dist/src/table/aether/Table.d.ts.map +1 -1
  161. package/dist/src/table/cells/Cells.d.ts +38 -153
  162. package/dist/src/table/cells/Cells.d.ts.map +1 -1
  163. package/dist/src/table/cells/Forms.d.ts.map +1 -1
  164. package/dist/src/table/cells/registry.d.ts +6 -3
  165. package/dist/src/table/cells/registry.d.ts.map +1 -1
  166. package/dist/src/tabs/Selector.d.ts.map +1 -1
  167. package/dist/src/tabs/types.d.ts +5 -38
  168. package/dist/src/tabs/types.d.ts.map +1 -1
  169. package/dist/src/tag/Tag.d.ts +3 -4
  170. package/dist/src/tag/Tag.d.ts.map +1 -1
  171. package/dist/src/telem/aether/context.d.ts +8 -8
  172. package/dist/src/telem/aether/context.d.ts.map +1 -1
  173. package/dist/src/telem/aether/factory.d.ts +6 -2
  174. package/dist/src/telem/aether/factory.d.ts.map +1 -1
  175. package/dist/src/telem/aether/noop.d.ts.map +1 -1
  176. package/dist/src/telem/aether/pipeline.d.ts +25 -215
  177. package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
  178. package/dist/src/telem/aether/provider.d.ts +7 -5
  179. package/dist/src/telem/aether/provider.d.ts.map +1 -1
  180. package/dist/src/telem/aether/remote.d.ts +62 -183
  181. package/dist/src/telem/aether/remote.d.ts.map +1 -1
  182. package/dist/src/telem/aether/static.d.ts +21 -74
  183. package/dist/src/telem/aether/static.d.ts.map +1 -1
  184. package/dist/src/telem/aether/telem.d.ts +60 -284
  185. package/dist/src/telem/aether/telem.d.ts.map +1 -1
  186. package/dist/src/telem/aether/transformers.d.ts +79 -321
  187. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  188. package/dist/src/telem/client/cache/cache.d.ts +1 -1
  189. package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
  190. package/dist/src/telem/client/cache/dynamic.d.ts +5 -5
  191. package/dist/src/telem/client/cache/dynamic.d.ts.map +1 -1
  192. package/dist/src/telem/client/cache/static.d.ts +3 -3
  193. package/dist/src/telem/client/cache/static.d.ts.map +1 -1
  194. package/dist/src/telem/client/cache/unary.d.ts +3 -3
  195. package/dist/src/telem/client/cache/unary.d.ts.map +1 -1
  196. package/dist/src/telem/client/client.d.ts +8 -12
  197. package/dist/src/telem/client/client.d.ts.map +1 -1
  198. package/dist/src/telem/client/external.d.ts +0 -1
  199. package/dist/src/telem/client/external.d.ts.map +1 -1
  200. package/dist/src/telem/client/reader.d.ts +28 -10
  201. package/dist/src/telem/client/reader.d.ts.map +1 -1
  202. package/dist/src/telem/client/reader.spec.d.ts +6 -1
  203. package/dist/src/telem/client/reader.spec.d.ts.map +1 -1
  204. package/dist/src/telem/client/streamer.d.ts +6 -6
  205. package/dist/src/telem/client/streamer.d.ts.map +1 -1
  206. package/dist/src/telem/client/streamer.spec.d.ts +2 -0
  207. package/dist/src/telem/client/streamer.spec.d.ts.map +1 -0
  208. package/dist/src/telem/control/Indicator.d.ts.map +1 -1
  209. package/dist/src/telem/control/aether/chip.d.ts +44 -232
  210. package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
  211. package/dist/src/telem/control/aether/controller.d.ts +36 -73
  212. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  213. package/dist/src/telem/control/aether/indicator.d.ts +49 -257
  214. package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
  215. package/dist/src/telem/control/aether/legend.d.ts +18 -132
  216. package/dist/src/telem/control/aether/legend.d.ts.map +1 -1
  217. package/dist/src/telem/control/aether/state.d.ts +10 -44
  218. package/dist/src/telem/control/aether/state.d.ts.map +1 -1
  219. package/dist/src/text/Text.d.ts +5 -4
  220. package/dist/src/text/Text.d.ts.map +1 -1
  221. package/dist/src/text/core/types.d.ts +17 -14
  222. package/dist/src/text/core/types.d.ts.map +1 -1
  223. package/dist/src/text/dimensions.d.ts +1 -0
  224. package/dist/src/text/dimensions.d.ts.map +1 -1
  225. package/dist/src/theming/aether/provider.d.ts +755 -5891
  226. package/dist/src/theming/aether/provider.d.ts.map +1 -1
  227. package/dist/src/theming/core/theme.d.ts +314 -1848
  228. package/dist/src/theming/core/theme.d.ts.map +1 -1
  229. package/dist/src/theming/css.d.ts.map +1 -1
  230. package/dist/src/tree/Tree.d.ts +1 -1
  231. package/dist/src/tree/Tree.d.ts.map +1 -1
  232. package/dist/src/tree/core.d.ts.map +1 -1
  233. package/dist/src/triggers/Provider.d.ts.map +1 -1
  234. package/dist/src/triggers/triggers.d.ts +248 -9
  235. package/dist/src/triggers/triggers.d.ts.map +1 -1
  236. package/dist/src/util/component.d.ts +7 -1
  237. package/dist/src/util/component.d.ts.map +1 -1
  238. package/dist/src/viewport/use.d.ts +8 -1
  239. package/dist/src/viewport/use.d.ts.map +1 -1
  240. package/dist/src/vis/axis/axis.d.ts +17 -48
  241. package/dist/src/vis/axis/axis.d.ts.map +1 -1
  242. package/dist/src/vis/axis/canvas.d.ts +17 -20
  243. package/dist/src/vis/axis/canvas.d.ts.map +1 -1
  244. package/dist/src/vis/axis/preciseTimeScale.d.ts +1 -2
  245. package/dist/src/vis/axis/preciseTimeScale.d.ts.map +1 -1
  246. package/dist/src/vis/axis/ticks.d.ts +11 -11
  247. package/dist/src/vis/axis/ticks.d.ts.map +1 -1
  248. package/dist/src/vis/button/aether/button.d.ts +10 -80
  249. package/dist/src/vis/button/aether/button.d.ts.map +1 -1
  250. package/dist/src/vis/canvas/Canvas.d.ts +2 -2
  251. package/dist/src/vis/canvas/Canvas.d.ts.map +1 -1
  252. package/dist/src/vis/canvas/aether/canvas.d.ts +45 -193
  253. package/dist/src/vis/canvas/aether/canvas.d.ts.map +1 -1
  254. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  255. package/dist/src/vis/diagram/aether/Diagram.d.ts +62 -469
  256. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  257. package/dist/src/vis/diagram/aether/types.d.ts +29 -249
  258. package/dist/src/vis/diagram/aether/types.d.ts.map +1 -1
  259. package/dist/src/vis/diagram/edge/Edge.d.ts +2 -3
  260. package/dist/src/vis/diagram/edge/Edge.d.ts.map +1 -1
  261. package/dist/src/vis/diagram/edge/connector/connector.d.ts +5 -8
  262. package/dist/src/vis/diagram/edge/connector/connector.d.ts.map +1 -1
  263. package/dist/src/vis/diagram/edge/paths.d.ts +3 -4
  264. package/dist/src/vis/diagram/edge/paths.d.ts.map +1 -1
  265. package/dist/src/vis/draw2d/canvas.d.ts +21 -3
  266. package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
  267. package/dist/src/vis/draw2d/index.d.ts +3 -4
  268. package/dist/src/vis/draw2d/index.d.ts.map +1 -1
  269. package/dist/src/vis/eraser/aether/eraser.d.ts +30 -170
  270. package/dist/src/vis/eraser/aether/eraser.d.ts.map +1 -1
  271. package/dist/src/vis/grid/grid.d.ts +14 -24
  272. package/dist/src/vis/grid/grid.d.ts.map +1 -1
  273. package/dist/src/vis/legend/Container.d.ts +42 -86
  274. package/dist/src/vis/legend/Container.d.ts.map +1 -1
  275. package/dist/src/vis/legend/Simple.d.ts +3 -4
  276. package/dist/src/vis/legend/Simple.d.ts.map +1 -1
  277. package/dist/src/vis/light/aether/light.d.ts +10 -80
  278. package/dist/src/vis/light/aether/light.d.ts.map +1 -1
  279. package/dist/src/vis/line/aether/line.d.ts +18 -101
  280. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  281. package/dist/src/vis/lineplot/Axis.d.ts.map +1 -1
  282. package/dist/src/vis/lineplot/LinePlot.d.ts +2 -3
  283. package/dist/src/vis/lineplot/LinePlot.d.ts.map +1 -1
  284. package/dist/src/vis/lineplot/aether/BoundQuerier.d.ts +35 -0
  285. package/dist/src/vis/lineplot/aether/BoundQuerier.d.ts.map +1 -0
  286. package/dist/src/vis/lineplot/aether/LinePlot.d.ts +82 -489
  287. package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
  288. package/dist/src/vis/lineplot/aether/XAxis.d.ts +51 -191
  289. package/dist/src/vis/lineplot/aether/XAxis.d.ts.map +1 -1
  290. package/dist/src/vis/lineplot/aether/YAxis.d.ts +49 -194
  291. package/dist/src/vis/lineplot/aether/YAxis.d.ts.map +1 -1
  292. package/dist/src/vis/lineplot/aether/axis.d.ts +27 -98
  293. package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
  294. package/dist/src/vis/lineplot/aether/external.d.ts +1 -0
  295. package/dist/src/vis/lineplot/aether/external.d.ts.map +1 -1
  296. package/dist/src/vis/lineplot/external.d.ts +1 -0
  297. package/dist/src/vis/lineplot/external.d.ts.map +1 -1
  298. package/dist/src/vis/lineplot/range/Provider.d.ts.map +1 -1
  299. package/dist/src/vis/lineplot/range/aether/annotation.d.ts +15 -52
  300. package/dist/src/vis/lineplot/range/aether/annotation.d.ts.map +1 -1
  301. package/dist/src/vis/lineplot/range/aether/provider.d.ts +43 -294
  302. package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +1 -1
  303. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts +17 -154
  304. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts.map +1 -1
  305. package/dist/src/vis/lineplot/useBoundQuerier.d.ts +11 -0
  306. package/dist/src/vis/lineplot/useBoundQuerier.d.ts.map +1 -0
  307. package/dist/src/vis/log/aether/Log.d.ts +82 -461
  308. package/dist/src/vis/log/aether/Log.d.ts.map +1 -1
  309. package/dist/src/vis/measure/aether/measure.d.ts +24 -249
  310. package/dist/src/vis/measure/aether/measure.d.ts.map +1 -1
  311. package/dist/src/vis/performance/Performance.d.ts +2 -0
  312. package/dist/src/vis/performance/Performance.d.ts.map +1 -0
  313. package/dist/src/vis/performance/aether/index.d.ts +2 -0
  314. package/dist/src/vis/performance/aether/index.d.ts.map +1 -0
  315. package/dist/src/vis/performance/aether/performance.d.ts +15 -0
  316. package/dist/src/vis/performance/aether/performance.d.ts.map +1 -0
  317. package/dist/src/vis/performance/index.d.ts +2 -0
  318. package/dist/src/vis/performance/index.d.ts.map +1 -0
  319. package/dist/src/vis/render/GLProgram.d.ts +1 -2
  320. package/dist/src/vis/render/GLProgram.d.ts.map +1 -1
  321. package/dist/src/vis/render/context.d.ts +1 -0
  322. package/dist/src/vis/render/context.d.ts.map +1 -1
  323. package/dist/src/vis/render/controller.d.ts +7 -12
  324. package/dist/src/vis/render/controller.d.ts.map +1 -1
  325. package/dist/src/vis/render/loop.d.ts +15 -5
  326. package/dist/src/vis/render/loop.d.ts.map +1 -1
  327. package/dist/src/vis/rule/Rule.d.ts +1 -1
  328. package/dist/src/vis/rule/Rule.d.ts.map +1 -1
  329. package/dist/src/vis/rule/aether/aether.d.ts +8 -57
  330. package/dist/src/vis/rule/aether/aether.d.ts.map +1 -1
  331. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  332. package/dist/src/vis/schematic/Symbols.d.ts +3 -4
  333. package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
  334. package/dist/src/vis/schematic/primitives/Primitives.d.ts +34 -35
  335. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
  336. package/dist/src/vis/schematic/registry.d.ts +96 -1
  337. package/dist/src/vis/schematic/registry.d.ts.map +1 -1
  338. package/dist/src/vis/setpoint/aether/setpoint.d.ts +16 -155
  339. package/dist/src/vis/setpoint/aether/setpoint.d.ts.map +1 -1
  340. package/dist/src/vis/text/atlas.d.ts +32 -0
  341. package/dist/src/vis/text/atlas.d.ts.map +1 -0
  342. package/dist/src/vis/text/index.d.ts +2 -0
  343. package/dist/src/vis/text/index.d.ts.map +1 -0
  344. package/dist/src/vis/toggle/aether/toggle.d.ts +16 -150
  345. package/dist/src/vis/toggle/aether/toggle.d.ts.map +1 -1
  346. package/dist/src/vis/value/aether/value.d.ts +144 -569
  347. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  348. package/dist/src/vis/value/use.d.ts +55 -199
  349. package/dist/src/vis/value/use.d.ts.map +1 -1
  350. package/dist/{state-Bd_8X2jl.cjs → state-_FFrG5nH.cjs} +1 -1
  351. package/dist/tabs.cjs +1 -1
  352. package/dist/tabs.js +1 -1
  353. package/dist/text.cjs +1 -1
  354. package/dist/text.js +2 -2
  355. package/dist/theming.cjs +1 -1
  356. package/dist/theming.js +2 -2
  357. package/dist/{toArray-Dvn9FA_3.js → toArray-B7nD2CTw.js} +1 -1
  358. package/dist/{toArray-DRKOku1s.cjs → toArray-BvVYuN_b.cjs} +1 -1
  359. package/dist/tree.cjs +1 -1
  360. package/dist/tree.js +1 -1
  361. package/dist/triggers.cjs +1 -1
  362. package/dist/triggers.js +1 -1
  363. package/dist/units-CKKNRQlP.cjs +1 -0
  364. package/dist/units-a8CggrTe.js +11 -0
  365. package/dist/{useClickOutside-BYjsXGgb.js → useClickOutside-CKMnqdvH.js} +29 -30
  366. package/dist/useClickOutside-CPAEkvf8.cjs +1 -0
  367. package/dist/{useDebouncedCallback-Dg4BDGP-.js → useDebouncedCallback-Cyd6pZ59.js} +1 -1
  368. package/dist/useDebouncedCallback-DsKlBI86.cjs +1 -0
  369. package/dist/{useMemoCompare-BEDaTIXL.js → useMemoCompare-B930TM0g.js} +2 -2
  370. package/dist/useMemoCompare-DprA41gC.cjs +1 -0
  371. package/dist/{useVirtualCursorDragWebKit-BixysrXI.js → useVirtualCursorDragWebKit-BrSOJpYY.js} +22 -23
  372. package/dist/useVirtualCursorDragWebKit-Cvp93Pya.cjs +1 -0
  373. package/dist/value-B7u8K1CW.cjs +57 -0
  374. package/dist/value-BdZLWVof.js +5974 -0
  375. package/dist/video.cjs +1 -1
  376. package/dist/video.js +1 -1
  377. package/package.json +9 -8
  378. package/dist/ContextMenu-DCxj35_j.cjs +0 -1
  379. package/dist/DateTime-D6J8sRSH.cjs +0 -1
  380. package/dist/Dropdown-C7Im-qW-.cjs +0 -1
  381. package/dist/Haul-hv7TLQ7N.cjs +0 -1
  382. package/dist/Item-piF6rFAm.cjs +0 -1
  383. package/dist/Provider-DNTq46b0.cjs +0 -1
  384. package/dist/Text-BTEov6di.cjs +0 -1
  385. package/dist/Text-DNspRcte.js +0 -36
  386. package/dist/Text-DylGoRKw.cjs +0 -4
  387. package/dist/Text-X_BHez8W.cjs +0 -1
  388. package/dist/Toggle-BKKBcuTj.cjs +0 -1
  389. package/dist/WithIcon-CC-RSx6r.js +0 -93
  390. package/dist/WithIcon-Dn8eAoMj.cjs +0 -1
  391. package/dist/aggregator-74jWxDne.cjs +0 -1
  392. package/dist/aggregator-DMvP8cai.js +0 -83
  393. package/dist/css-Cj2UCGXB.cjs +0 -1
  394. package/dist/css-Dyt-QnKy.js +0 -1199
  395. package/dist/deep-Cvb4bVYY.js +0 -105
  396. package/dist/deep-ICSlPm58.cjs +0 -1
  397. package/dist/dimensions-Cc0z-IDd.js +0 -18
  398. package/dist/dimensions-Djqdrqi0.cjs +0 -1
  399. package/dist/eraser-9-LOWZvk.cjs +0 -11
  400. package/dist/eraser-BjtEI-1I.js +0 -823
  401. package/dist/external-B-UNCzPY.cjs +0 -1
  402. package/dist/external-B18FBGpk.cjs +0 -1
  403. package/dist/external-BG1mV1W8.cjs +0 -1
  404. package/dist/external-BWeX0nyq.js +0 -399
  405. package/dist/external-BbmpRAH3.cjs +0 -1
  406. package/dist/external-D2vS6j9c.cjs +0 -46
  407. package/dist/external-DHmQqAfL.js +0 -435
  408. package/dist/external-DRGfSFQT.cjs +0 -1
  409. package/dist/external-DX4m-5qT.cjs +0 -1
  410. package/dist/external-DlywBW-S.cjs +0 -1
  411. package/dist/hooks-BQJQyGWV.js +0 -293
  412. package/dist/hooks-ClXSlga9.cjs +0 -1
  413. package/dist/index-CSKP1UPN.js +0 -2343
  414. package/dist/index-Ch3utIMa.cjs +0 -15
  415. package/dist/provider-CH0eoGfz.js +0 -10358
  416. package/dist/provider-D054LCpB.cjs +0 -53
  417. package/dist/src/color/core/color.d.ts +0 -143
  418. package/dist/src/color/core/color.d.ts.map +0 -1
  419. package/dist/src/color/core/color.spec.d.ts +0 -2
  420. package/dist/src/color/core/color.spec.d.ts.map +0 -1
  421. package/dist/src/color/core/external.d.ts +0 -5
  422. package/dist/src/color/core/external.d.ts.map +0 -1
  423. package/dist/src/color/core/gradient.d.ts +0 -58
  424. package/dist/src/color/core/gradient.d.ts.map +0 -1
  425. package/dist/src/color/core/index.d.ts +0 -2
  426. package/dist/src/color/core/index.d.ts.map +0 -1
  427. package/dist/src/color/core/palette.d.ts +0 -74
  428. package/dist/src/color/core/palette.d.ts.map +0 -1
  429. package/dist/src/color/core/transformColorsToHex.d.ts +0 -6
  430. package/dist/src/color/core/transformColorsToHex.d.ts.map +0 -1
  431. package/dist/src/telem/client/types.d.ts +0 -20
  432. package/dist/src/telem/client/types.d.ts.map +0 -1
  433. package/dist/transformColorsToHex-DE7uEs1w.cjs +0 -1
  434. package/dist/transformColorsToHex-UBrryWh5.js +0 -14
  435. package/dist/units-DjoHPrqM.cjs +0 -1
  436. package/dist/units-MBd0L3ff.js +0 -8
  437. package/dist/useClickOutside-4k9PAT_i.cjs +0 -1
  438. package/dist/useDebouncedCallback-BBsAgC9k.cjs +0 -1
  439. package/dist/useMemoCompare-DORTZbzY.cjs +0 -1
  440. package/dist/useVirtualCursorDragWebKit-BSafZVD_.cjs +0 -1
  441. package/dist/value-CudL8z5e.js +0 -5957
  442. package/dist/value-DT0qJqgQ.cjs +0 -57
@@ -0,0 +1,15 @@
1
+ "use strict";var Qn=Object.defineProperty;var ei=(r,e,t)=>e in r?Qn(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Re=(r,e,t)=>ei(r,typeof e!="symbol"?e+"":e,t);const a=require("zod"),Je=a.z.tuple([a.z.number(),a.z.number()]);a.z.tuple([a.z.bigint(),a.z.bigint()]);const kt=a.z.object({width:a.z.number(),height:a.z.number()}),ti=a.z.object({signedWidth:a.z.number(),signedHeight:a.z.number()}),ri=["width","height"];a.z.enum(ri);const ni=["start","center","end"],ii=["signedWidth","signedHeight"];a.z.enum(ii);const Ne=a.z.object({x:a.z.number(),y:a.z.number()}),Nr=a.z.object({clientX:a.z.number(),clientY:a.z.number()}),Dt=["x","y"],Pt=a.z.enum(Dt),Ur=["top","right","bottom","left"],si=a.z.enum(Ur),Xe=["left","right"],Ft=a.z.enum(Xe),Qe=["top","bottom"],_t=a.z.enum(Qe),qt=["center"],yt=a.z.enum(qt),oi=[...Ur,...qt],et=a.z.enum(oi);a.z.enum(ni);const ai=["first","last"];a.z.enum(ai);const Br=a.z.object({lower:a.z.number(),upper:a.z.number()}),ui=a.z.object({lower:a.z.bigint(),upper:a.z.bigint()});a.z.union([Br,Je]);a.z.union([ui,Je]);const li=a.z.enum([...Pt.options,...et.options]),hi=a.z.union([Pt,et,a.z.instanceof(String)]),X=r=>typeof r=="bigint"||r instanceof BigInt,$e=(r,e)=>X(r)?r.valueOf()-BigInt(e.valueOf().valueOf()):r.valueOf()-Number(e.valueOf()),Er=(r,e)=>X(r)?r.valueOf()+BigInt(e.valueOf().valueOf()):r+Number(e.valueOf()),ci=(r,e,t=1e-4)=>Math.abs(r-e)<t,mt=(r,e)=>X(r)?r===BigInt(e.valueOf().valueOf()):r===Number(e.valueOf()),fi=r=>{const e=10**Math.floor(Math.log10(r));return Math.round(r/e)*e},zr=(r,e)=>X(r)?r.valueOf()<BigInt(e.valueOf())?r:BigInt(e.valueOf()):r.valueOf()<Number(e.valueOf())?r:Number(e.valueOf()),di=(r,e)=>X(r)?r.valueOf()>BigInt(e.valueOf())?r:BigInt(e.valueOf()):r.valueOf()>Number(e.valueOf())?r:Number(e.valueOf()),Ar=r=>X(r)||r instanceof BigInt?r.valueOf()<0n?-r:r:r.valueOf()<0?-r:r,Q=(r,e)=>X(r)?r.valueOf()*BigInt(e.valueOf()):r.valueOf()*Number(e.valueOf()),gi=(r,e)=>X(r)?r.valueOf()/BigInt(e.valueOf()):r.valueOf()/Number(e.valueOf()),m=(r,e)=>{const t={};if(typeof r=="number"||typeof r=="bigint")e!=null?(t.lower=r,t.upper=e):(t.lower=typeof r=="bigint"?0n:0,t.upper=r);else if(Array.isArray(r)){if(r.length!==2)throw new Error("bounds: expected array of length 2");[t.lower,t.upper]=r}else return wt(r);return wt(t)},pi=Object.freeze({lower:0,upper:0}),yi=Object.freeze({lower:-1/0,upper:1/0}),mi=Object.freeze({lower:0,upper:1}),wi=Object.freeze({lower:-1,upper:1}),bi=(r,e)=>{if(r==null&&e==null)return!0;if(r==null||e==null)return!1;const t=m(r),n=m(e);return(t==null?void 0:t.lower)===(n==null?void 0:n.lower)&&(t==null?void 0:t.upper)===(n==null?void 0:n.upper)},wt=r=>r.lower>r.upper?{lower:r.upper,upper:r.lower}:r,bt=(r,e)=>{const t=m(r);return e<t.lower?t.lower:e>=t.upper?t.upper-(typeof t.upper=="number"?1:1n):e},M=(r,e)=>{const t=m(r);if(typeof e=="number"||typeof e=="bigint")return e>=t.lower&&e<t.upper;const n=m(e);return n.lower>=t.lower&&n.upper<=t.upper},vi=(r,e)=>{const t=m(r),n=m(e);return t.lower===n.lower?!0:n.upper===t.lower||n.lower===t.upper?!1:M(t,n.upper)||M(t,n.lower)||M(n,t.upper)||M(n,t.lower)},Me=r=>{const e=m(r);return e.upper-e.lower},$i=r=>{const e=m(r);return typeof e.lower=="bigint"?e.lower===0n&&e.upper===0n:e.lower===0&&e.upper===0},xi=r=>{const e=Me(r);return typeof e=="number"?e===0:e===0n},Oi=r=>{const e=m(r);return typeof e.lower=="bigint"?!0:Number.isFinite(e.lower)&&Number.isFinite(e.upper)},Ti=r=>{const e=m(r);return(e.upper+e.lower)/2},Mr=r=>({lower:Math.min(...r.map(e=>m(e).lower)),upper:Math.max(...r.map(e=>m(e).upper))}),Si=r=>({lower:Math.max(...r.map(e=>m(e).lower)),upper:Math.min(...r.map(e=>m(e).upper))}),Ii=r=>{const e=m(r),t=typeof e.lower=="bigint";return Array.from({length:Number(Me(r))},(n,i)=>t?e.lower+BigInt(i):e.lower+i)},vt=(r,e)=>{const t=r.map(s=>m(s)),n=t.findIndex(s=>M(s,e)||e<s.lower);if(n===-1)return{index:r.length,position:0};const i=t[n];return M(i,e)?{index:n,position:Number(e-i.lower)}:{index:n,position:0}},ht={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},Ni=(r,e)=>{const t=r.map(f=>m(f)),n=m(e);if(t.length===0)return ht;const i=vt(t,n.lower),s=vt(t,n.upper);if(i.index===r.length)return{...ht,insertInto:r.length};if(s.index===0)return{...ht,removeAfter:s.position};if(i.index===s.index)return i.position!==0&&s.position!==0?null:{removeAfter:s.position,removeBefore:i.position,insertInto:i.index,deleteInBetween:0};let o=s.index-i.index,u=i.index,h=$e(Number(Me(t[i.index])),i.position);return i.position!==0?(o-=1,u+=1):h=0,{removeBefore:h,removeAfter:s.position,insertInto:u,deleteInBetween:o}},Cr=(r,e,t)=>{const n=r.map(u=>m(u)),i=t>0?1:t<0?-1:0;if(i===0)return e;let s=t,o=e;for(;mt(s,0)===!1;){const u=n.findIndex(h=>i>0?o>=h.lower&&o<h.upper:o>h.lower&&o<=h.upper);if(u!==-1){const h=n[u];let f;if(i>0?f=$e(h.upper,o):f=$e(o,h.lower),f>0){const g=zr(Ar(s),f);if(o=Er(o,i>0?g:-g),s=$e(s,i>0?g:-g),mt(s,0))return o;continue}}if(i>0){const h=n.filter(f=>f.lower>o);if(h.length>0)o=h[0].lower;else return o}else{const h=n.filter(f=>f.upper<o);if(h.length>0)o=h[h.length-1].upper;else return o}}return o},Lr=(r,e,t)=>{const n=r.map(o=>m(o));if(e===t)return typeof e=="bigint"?0n:0;const i=e<t?m([e,t]):m([t,e]);let s=typeof e=="bigint"?0n:0;for(const o of n){const u=o.lower>i.lower?o.lower:i.lower,h=o.upper<i.upper?o.upper:i.upper;if(u<h){const f=h-u;s=s+f}}return s},Ui=Object.freeze(Object.defineProperty({__proto__:null,CLIP:wi,DECIMAL:mi,INFINITE:yi,ZERO:pi,bounds:Br,buildInsertionPlan:Ni,clamp:bt,construct:m,contains:M,distance:Lr,equals:bi,findInsertPosition:vt,isFinite:Oi,isZero:$i,linspace:Ii,makeValid:wt,max:Mr,mean:Ti,min:Si,overlapsWith:vi,span:Me,spanIsZero:xi,traverse:Cr},Symbol.toStringTag,{value:"Module"})),Rr=li,W=r=>Dt.includes(r)?r:Qe.includes(r)?"y":"x",Bi=r=>W(r)==="x"?"y":"x",Ei=r=>W(r)==="x"?"width":"height",zi=r=>W(r)==="x"?"left":"top",Ai=r=>Rr.safeParse(r).success,Mi=r=>W(r)==="x"?"signedWidth":"signedHeight",jr=Object.freeze(Object.defineProperty({__proto__:null,construct:W,crude:Rr,dimension:Ei,direction:Pt,isDirection:Ai,location:zi,signedDimension:Mi,swap:Bi},Symbol.toStringTag,{value:"Module"})),Ci=r=>{const e=r.replace(/_[a-z]/g,t=>t[1].toUpperCase());return e.length>1&&e[0]===e[0].toUpperCase()&&e[1]===e[1].toUpperCase()||e.length===0?e:e[0].toLowerCase()+e.slice(1)},Wt=r=>{const e=(t,n=$t)=>{if(typeof t=="string")return r(t);if(Array.isArray(t))return t.map(o=>e(o,n));if(!ct(t))return t;n=Ri(n);const i={},s=t;return Object.keys(s).forEach(o=>{let u=s[o];const h=r(o);n.recursive&&(ct(u)?cr(u,n.keepTypesOnRecursion)||(u=e(u,n)):n.recursiveInArray&&hr(u)&&(u=[...u].map(f=>{let g=f;return ct(f)?cr(g,n.keepTypesOnRecursion)||(g=e(f,n)):hr(f)&&(g=e({key:f},n).key),g}))),i[h]=u}),i};return e},tt=Wt(Ci),Li=r=>r.replace(/([a-z0-9])([A-Z])/g,(e,t,n)=>`${t}_${n.toLowerCase()}`),Yt=Wt(Li),kr=r=>r.length===0?r:r[0].toUpperCase()+r.slice(1),$t={recursive:!0,recursiveInArray:!0,keepTypesOnRecursion:[Number,String,Uint8Array]},Ri=(r=$t)=>(r.recursive==null?r=$t:r.recursiveInArray??(r.recursiveInArray=!1),r),hr=r=>r!=null&&Array.isArray(r),ct=r=>r!=null&&typeof r=="object"&&!Array.isArray(r),cr=(r,e)=>(e||[]).some(t=>r instanceof t),ji=r=>r.replace(/\s+/g,"-").replace(/([a-z0-9])([A-Z])/g,(e,t,n)=>`${t}-${n.toLowerCase()}`).toLowerCase(),ki=Wt(ji),Di=Object.freeze(Object.defineProperty({__proto__:null,camelToSnake:Yt,capitalize:kr,snakeToCamel:tt,toKebab:ki},Symbol.toStringTag,{value:"Module"})),Pi=Ft,Fi=_t,_i=yt,qi={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},Wi={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},Yi=hi,J=r=>r instanceof String||!Dt.includes(r)?r:r==="x"?"left":"top",Dr=r=>qi[J(r)],Vi=r=>Wi[J(r)],Ue=r=>{const e=J(r);return e==="top"||e==="bottom"?"y":"x"},Pr=a.z.object({x:Ft.or(yt),y:_t.or(yt)}),Fr=a.z.object({x:Ft,y:_t}),oe=Object.freeze({x:"left",y:"top"}),Vt=Object.freeze({x:"right",y:"top"}),rt=Object.freeze({x:"left",y:"bottom"}),Zt=Object.freeze({x:"right",y:"bottom"}),nt=Object.freeze({x:"center",y:"center"}),Ht=Object.freeze({x:"center",y:"top"}),Gt=Object.freeze({x:"center",y:"bottom"}),Kt=Object.freeze({x:"right",y:"center"}),Jt=Object.freeze({x:"left",y:"center"}),_r=Object.freeze([Jt,Kt,Ht,Gt,oe,Vt,rt,Zt,nt]),it=(r,e)=>r.x===e.x&&r.y===e.y,qr=(r,e)=>{if(typeof e=="object"){let t=!0;return"x"in e&&(r.x===e.x||(t=!1)),"y"in e&&(r.y===e.y||(t=!1)),t}return r.x===e||r.y===e},Wr=r=>[r.x,r.y],_e=r=>Ue(J(r))==="x",Zi=r=>Ue(J(r))==="y",Hi=r=>`${r.x}${kr(r.y)}`,Gi=(r,e)=>{let t,n;if(typeof r=="object"&&"x"in r?(t=r.x,n=r.y):(t=J(r),n=J(e??r)),Ue(t)===Ue(n)&&t!=="center"&&n!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${t.toString()} - ${n.toString()}`);const i={...nt};return t==="center"?_e(n)?[i.x,i.y]=[n,t]:[i.x,i.y]=[t,n]:n==="center"?_e(t)?[i.x,i.y]=[t,n]:[i.x,i.y]=[n,t]:_e(t)?[i.x,i.y]=[t,n]:[i.x,i.y]=[n,t],i},Yr=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:Gt,BOTTOM_LEFT:rt,BOTTOM_RIGHT:Zt,CENTER:nt,CENTER_LEFT:Jt,CENTER_LOCATIONS:qt,CENTER_RIGHT:Kt,TOP_CENTER:Ht,TOP_LEFT:oe,TOP_RIGHT:Vt,XY_LOCATIONS:_r,X_LOCATIONS:Xe,Y_LOCATIONS:Qe,center:_i,construct:J,constructXY:Gi,corner:Fr,crude:Yi,direction:Ue,isX:_e,isY:Zi,location:et,outer:si,rotate90:Vi,swap:Dr,x:Pi,xy:Pr,xyCouple:Wr,xyEquals:it,xyMatches:qr,xyToString:Hi,y:Fi},Symbol.toStringTag,{value:"Module"})),xt=a.z.union([a.z.number(),Ne,Je,kt,ti,Nr]),S=(r,e)=>{if(typeof r=="string"){if(e===void 0)throw new Error("The y coordinate must be given.");return r==="x"?{x:e,y:0}:{x:0,y:e}}return typeof r=="number"?{x:r,y:e??r}:Array.isArray(r)?{x:r[0],y:r[1]}:"signedWidth"in r?{x:r.signedWidth,y:r.signedHeight}:"clientX"in r?{x:r.clientX,y:r.clientY}:"width"in r?{x:r.width,y:r.height}:{x:r.x,y:r.y}},k=Object.freeze({x:0,y:0}),Vr=Object.freeze({x:1,y:1}),Ki=Object.freeze({x:1/0,y:1/0}),Ji=Object.freeze({x:NaN,y:NaN}),Ge=(r,e,t=0)=>{const n=S(r),i=S(e);return t===0?n.x===i.x&&n.y===i.y:Math.abs(n.x-i.x)<=t&&Math.abs(n.y-i.y)<=t},Xi=r=>Ge(r,k),Xt=(r,e,t)=>{const n=S(r),i=S(e,t);return{x:n.x*i.x,y:n.y*i.y}},Zr=(r,e)=>{const t=S(r);return{x:t.x+e,y:t.y}},Hr=(r,e)=>{const t=S(r);return{x:t.x,y:t.y+e}},Be=(r,e,t,...n)=>typeof e=="string"&&typeof t=="number"?e==="x"?Zr(r,t):Hr(r,t):[r,e,t??k,...n].reduce((i,s)=>{const o=S(s);return{x:i.x+o.x,y:i.y+o.y}},k),Qi=(r,e,t)=>{const n=S(r);return e==="x"?{x:t,y:n.y}:{x:n.x,y:t}},es=(r,e)=>{const t=S(r),n=S(e);return Math.sqrt((t.x-n.x)**2+(t.y-n.y)**2)},ts=(r,e)=>{const t=S(r),n=S(e);return{x:n.x-t.x,y:n.y-t.y}},rs=r=>{const e=S(r);return Number.isNaN(e.x)||Number.isNaN(e.y)},ns=r=>{const e=S(r);return Number.isFinite(e.x)&&Number.isFinite(e.y)},is=r=>{const e=S(r);return[e.x,e.y]},ss=r=>{const e=S(r);return{left:e.x,top:e.y}},Ot=(r,e=0)=>{const t=S(r);return{x:Number(t.x.toFixed(e)),y:Number(t.y.toFixed(e))}},fe=(r,e)=>{const t=S(r),n=S(e);return{x:t.x-n.x,y:t.y-n.y}},de=r=>{const e=S(r),t=Math.hypot(e.x,e.y);return t===0?{x:0,y:0}:{x:-e.y/t,y:e.x/t}},Gr=r=>{const e=S(r),t=Math.hypot(e.x,e.y);return t===0?{x:0,y:0}:{x:e.x/t,y:e.y/t}},Kr=(...r)=>{const e=r.reduce((t,n)=>Be(t,n),k);return Xt(e,1/r.length)},os=(r,e)=>{const t=[];for(let n=0;n<r.length;n++){const i=r[n];let s,o,u,h;if(n===0){const f=r[n+1],g=fe(f,i);o=de(g),u=o,h=e}else if(n===r.length-1){const f=r[n-1],g=fe(i,f);s=de(g),u=s,h=e}else{const f=r[n-1],g=r[n+1],d=fe(i,f),B=fe(g,i);s=de(d),o=de(B);const A=Math.acos((d.x*B.x+d.y*B.y)/(Math.hypot(d.x,d.y)*Math.hypot(B.x,B.y))),ue=Math.sin(A/2);ue===0?h=e:h=e/ue,u=Gr(Kr(s,o))}t.push(Xt(u,h))}return t},as=r=>{const e=S(r);return{x:e.y,y:e.x}},us=Object.freeze(Object.defineProperty({__proto__:null,INFINITY:Ki,NAN:Ji,ONE:Vr,ZERO:k,average:Kr,calculateMiters:os,clientXY:Nr,construct:S,couple:is,crudeZ:xt,css:ss,distance:es,equals:Ge,isFinite:ns,isNan:rs,isZero:Xi,normal:de,normalize:Gr,scale:Xt,set:Qi,sub:fe,swap:as,translate:Be,translateX:Zr,translateY:Hr,translation:ts,truncate:Ot,xy:Ne},Symbol.toStringTag,{value:"Module"})),je=a.z.union([a.z.number(),a.z.string()]),ls=a.z.object({top:je,left:je,width:je,height:je}),hs=a.z.object({left:a.z.number(),top:a.z.number(),right:a.z.number(),bottom:a.z.number()}),cs=a.z.object({one:Ne,two:Ne,root:Fr}),Jr={one:k,two:k,root:oe},fs={one:k,two:Vr,root:rt},Xr=(r,e)=>({one:r.one,two:r.two,root:e??r.root}),T=(r,e,t=0,n=0,i)=>{const s={one:{...k},two:{...k},root:i??oe};if(typeof r=="number"){if(typeof e!="number")throw new Error("Box constructor called with invalid arguments");return s.one={x:r,y:e},s.two={x:s.one.x+t,y:s.one.y+n},s}return"one"in r&&"two"in r&&"root"in r?{...r,root:i??r.root}:("getBoundingClientRect"in r&&(r=r.getBoundingClientRect()),"left"in r?(s.one={x:r.left,y:r.top},s.two={x:r.right,y:r.bottom},s):(s.one=r,e==null?s.two={x:s.one.x+t,y:s.one.y+n}:typeof e=="number"?s.two={x:s.one.x+e,y:s.one.y+t}:"width"in e?s.two={x:s.one.x+e.width,y:s.one.y+e.height}:"signedWidth"in e?s.two={x:s.one.x+e.signedWidth,y:s.one.y+e.signedHeight}:s.two=e,s))},ds=(r,e,t)=>{const n=T(r);if(typeof e=="string"){if(t==null)throw new Error("Invalid arguments for resize");const i=W(e);return T(n.one,void 0,i==="x"?t:_(n),i==="y"?t:q(n),n.root)}return T(n.one,e,void 0,void 0,n.root)},gs=(r,e,t=!0)=>{const n=T(r);let i=(s,o)=>s<o;return t&&(i=(s,o)=>s<=o),"one"in e?i(H(n),H(e))&&i(te(e),te(n))&&i(G(n),G(e))&&i(re(e),re(n)):i(H(n),e.x)&&i(e.x,te(n))&&i(G(n),e.y)&&i(e.y,re(n))},ps=(r,e)=>Ge(r.one,e.one)&&Ge(r.two,e.two)&&it(r.root,e.root),Qr=r=>({width:_(r),height:q(r)}),ys=r=>({signedWidth:st(r),signedHeight:ot(r)}),ms=r=>({top:G(r),left:H(r),width:_(r),height:q(r)}),Qt=(r,e,t=!1)=>{const n=W(e)==="y"?ot(r):st(r);return t?n:Math.abs(n)},D=(r,e)=>{const t=T(r);return{x:e.x==="center"?Tt(t).x:ne(t,e.x),y:e.y==="center"?Tt(t).y:ne(t,e.y)}},ne=(r,e)=>{const t=T(r),n=Wr(t.root).includes(e)?Math.min:Math.max;return Xe.includes(e)?n(t.one.x,t.two.x):n(t.one.y,t.two.y)},ws=r=>r.one.x===r.two.x&&r.one.y===r.two.y,_=r=>Qt(r,"x"),q=r=>Qt(r,"y"),st=r=>{const e=T(r);return e.two.x-e.one.x},ot=r=>{const e=T(r);return e.two.y-e.one.y},en=r=>D(r,oe),bs=r=>D(r,Ht),vs=r=>D(r,Vt),$s=r=>D(r,rt),xs=r=>D(r,Gt),Os=r=>D(r,Zt),Ts=r=>D(r,Jt),Ss=r=>D(r,Kt),te=r=>ne(r,"right"),re=r=>ne(r,"bottom"),H=r=>ne(r,"left"),G=r=>ne(r,"top"),Tt=r=>Be(en(r),{x:st(r)/2,y:ot(r)/2}),er=r=>{const e=T(r);return e.root.x==="left"?H(e):te(e)},tr=r=>{const e=T(r);return e.root.y==="top"?G(e):re(e)},Is=r=>({x:er(r),y:tr(r)}),qe=r=>{const e=T(r);return{lower:e.one.x,upper:e.two.x}},We=r=>{const e=T(r);return{lower:e.one.y,upper:e.two.y}},Ns=(r,e)=>Xr(r,e),Us=(r,e)=>{const t=T(r),n=Xe.includes(e)?"x":Qe.includes(e)?"y":null;if(n===null)throw new Error(`Invalid location: ${e}`);const i=e==="top"||e==="left"?Math.min:Math.max,s={...t.one},o={...t.two};return s[n]=i(t.one[n],t.two[n]),o[n]=i(t.one[n],t.two[n]),[s,o]},Bs=(r,e)=>{const t=T(r),n=T(e),i=er(n)+(_(n)-_(t))/2,s=tr(n)+(q(n)-q(t))/2;return T({x:i,y:s},Qr(t))},tn=r=>typeof r!="object"||r==null?!1:"one"in r&&"two"in r&&"root"in r,Es=r=>_(r)/q(r),zs=(r,e,t)=>{if(typeof e=="string"){if(t==null)throw new Error("Undefined amount passed into box.translate");const i=W(e);e=S(i,t)}const n=T(r);return T(Be(n.one,e),Be(n.two,e),void 0,void 0,n.root)},rn=(r,e)=>{const t=Math.max(H(r),H(e)),n=Math.max(G(r),G(e)),i=Math.min(te(r),te(e)),s=Math.min(re(r),re(e));return t>i||n>s?Jr:T({x:t,y:n},{x:i,y:s},void 0,void 0,r.root)},nn=r=>_(r)*q(r),As=(r,e)=>{const t=T(r);return T(Ot(t.one,e),Ot(t.two,e),void 0,void 0,t.root)},sn=(r,e,t,n,i,s)=>{const o={x:r,y:e},u={x:r+t,y:e+n};return i.x!==s.x&&(i.x==="center"?(o.x-=t/2,u.x-=t/2):(o.x-=t,u.x-=t)),i.y!==s.y&&(i.y==="center"?(o.y-=n/2,u.y-=n/2):(o.y-=n,u.y-=n)),T(o,u,void 0,void 0,s)},Ms=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:fs,ZERO:Jr,area:nn,areaIsZero:ws,aspect:Es,bottom:re,bottomCenter:xs,bottomLeft:$s,bottomRight:Os,box:cs,center:Tt,centerLeft:Ts,centerRight:Ss,construct:T,constructWithAlternateRoot:sn,contains:gs,copy:Xr,css:ms,cssBox:ls,dim:Qt,dims:Qr,domRect:hs,edgePoints:Us,equals:ps,height:q,intersection:rn,isBox:tn,left:H,loc:ne,positionInCenter:Bs,reRoot:Ns,resize:ds,right:te,root:Is,signedDims:ys,signedHeight:ot,signedWidth:st,top:G,topCenter:bs,topLeft:en,topRight:vs,translate:zs,truncate:As,width:_,x:er,xBounds:qe,xyLoc:D,y:tr,yBounds:We},Symbol.toStringTag,{value:"Module"})),on=a.z.object({signedWidth:a.z.number(),signedHeight:a.z.number()}),Cs=a.z.union([kt,on,Ne,Je]),Ls={width:0,height:0},Rs={width:1,height:1},C=(r,e)=>typeof r=="number"?{width:r,height:e??r}:Array.isArray(r)?{width:r[0],height:r[1]}:"x"in r?{width:r.x,height:r.y}:"signedWidth"in r?{width:r.signedWidth,height:r.signedHeight}:{...r},js=(r,e)=>{if(e==null)return!1;const t=C(r),n=C(e);return t.width===n.width&&t.height===n.height},ks=r=>{const e=C(r);return{width:e.height,height:e.width}},Ds=r=>{const e=C(r);return`0 0 ${e.width} ${e.height}`},Ps=r=>{const e=C(r);return[e.width,e.height]},Fs=r=>({width:Math.max(...r.map(e=>C(e).width)),height:Math.max(...r.map(e=>C(e).height))}),_s=r=>({width:Math.min(...r.map(e=>C(e).width)),height:Math.min(...r.map(e=>C(e).height))}),qs=(r,e)=>{const t=C(r);return{width:t.width*e,height:t.height*e}},Ws=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:Rs,ZERO:Ls,construct:C,couple:Ps,crude:Cs,dimensions:kt,equals:js,max:Fs,min:_s,scale:qs,signed:on,svgViewBox:Ds,swap:ks},Symbol.toStringTag,{value:"Module"}));var Ys=Object.defineProperty,Vs=(r,e,t)=>e in r?Ys(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,F=(r,e,t)=>Vs(r,typeof e!="symbol"?e+"":e,t);const an=(r,e,t)=>e!==void 0&&r<e?e:t!==void 0&&r>t?t:r,Zs=a.z.object({offset:xt,scale:xt}),Hs=a.z.object({offset:a.z.number(),scale:a.z.number()}),Gs=r=>(e,t,n,i)=>t==="dimension"?[e,n]:[e,i?n-r:n+r],Ks=r=>(e,t,n,i)=>[e,i?n/r:n*r],Js=r=>(e,t,n)=>{if(e===null)return[r,n];const{lower:i,upper:s}=e,{lower:o,upper:u}=r,h=s-i,f=u-o;if(t==="dimension")return[r,n*(f/h)];const g=(n-i)*(f/h)+o;return[r,g]},Xs=r=>(e,t,n)=>[r,n],Qs=()=>(r,e,t)=>{if(r===null)throw new Error("cannot invert without bounds");if(e==="dimension")return[r,t];const{lower:n,upper:i}=r;return[r,i-(t-n)]},eo=r=>(e,t,n)=>{const{lower:i,upper:s}=r;return n=an(n,i,s),[e,n]},St=class ge{constructor(){F(this,"ops",[]),F(this,"currBounds",null),F(this,"currType",null),F(this,"reversed",!1),this.ops=[]}static translate(e){return new ge().translate(e)}static magnify(e){return new ge().magnify(e)}static scale(e,t){return new ge().scale(e,t)}translate(e){const t=this.new(),n=Gs(e);return n.type="translate",t.ops.push(n),t}magnify(e){const t=this.new(),n=Ks(e);return n.type="magnify",t.ops.push(n),t}scale(e,t){const n=m(e,t),i=this.new(),s=Js(n);return s.type="scale",i.ops.push(s),i}clamp(e,t){const n=m(e,t),i=this.new(),s=eo(n);return s.type="clamp",i.ops.push(s),i}reBound(e,t){const n=m(e,t),i=this.new(),s=Xs(n);return s.type="re-bound",i.ops.push(s),i}invert(){const e=Qs();e.type="invert";const t=this.new();return t.ops.push(e),t}pos(e){return this.exec("position",e)}dim(e){return this.exec("dimension",e)}new(){const e=new ge;return e.ops=this.ops.slice(),e.reversed=this.reversed,e}exec(e,t){return this.currBounds=null,this.ops.reduce(([n,i],s)=>s(n,e,i,this.reversed),[null,t])[1]}reverse(){const e=this.new();e.ops.reverse();const t=[];return e.ops.forEach((n,i)=>{if(n.type==="scale"||t.some(([o,u])=>i>=o&&i<=u))return;const s=e.ops.findIndex((o,u)=>o.type==="scale"&&u>i);s!==-1&&t.push([i,s])}),t.forEach(([n,i])=>{const s=e.ops.slice(n,i);s.unshift(e.ops[i]),e.ops.splice(n,i-n+1,...s)}),e.reversed=!e.reversed,e}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}};F(St,"IDENTITY",new St);let It=St;const Nt=class P{constructor(e=new It,t=new It,n=null){F(this,"x"),F(this,"y"),F(this,"currRoot"),this.x=e,this.y=t,this.currRoot=n}static translate(e,t){return new P().translate(e,t)}static translateX(e){return new P().translateX(e)}static translateY(e){return new P().translateY(e)}static clamp(e){return new P().clamp(e)}static magnify(e){return new P().magnify(e)}static scale(e){return new P().scale(e)}static reBound(e){return new P().reBound(e)}translate(e,t){const n=S(e,t),i=this.copy();return i.x=this.x.translate(n.x),i.y=this.y.translate(n.y),i}translateX(e){const t=this.copy();return t.x=this.x.translate(e),t}translateY(e){const t=this.copy();return t.y=this.y.translate(e),t}magnify(e){const t=this.copy();return t.x=this.x.magnify(e.x),t.y=this.y.magnify(e.y),t}scale(e){const t=this.copy();if(tn(e)){const n=this.currRoot;return t.currRoot=e.root,n!=null&&!it(n,e.root)&&(n.x!==e.root.x&&(t.x=t.x.invert()),n.y!==e.root.y&&(t.y=t.y.invert())),t.x=t.x.scale(qe(e)),t.y=t.y.scale(We(e)),t}return t.x=t.x.scale(e.width),t.y=t.y.scale(e.height),t}reBound(e){const t=this.copy();return t.x=this.x.reBound(qe(e)),t.y=this.y.reBound(We(e)),t}clamp(e){const t=this.copy();return t.x=this.x.clamp(qe(e)),t.y=this.y.clamp(We(e)),t}copy(){const e=new P;return e.currRoot=this.currRoot,e.x=this.x,e.y=this.y,e}reverse(){const e=this.copy();return e.x=this.x.reverse(),e.y=this.y.reverse(),e}pos(e){return{x:this.x.pos(e.x),y:this.y.pos(e.y)}}dim(e){return{x:this.x.dim(e.x),y:this.y.dim(e.y)}}box(e){return T(this.pos(e.one),this.pos(e.two),0,0,this.currRoot??e.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}};F(Nt,"IDENTITY",new Nt);let to=Nt;const ro=Object.freeze(Object.defineProperty({__proto__:null,Scale:It,XY:to,crudeXYTransform:Zs,transform:Hs},Symbol.toStringTag,{value:"Module"}));function un(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var i=r.length;for(e=0;e<i;e++)r[e]&&(t=un(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function ln(){for(var r,e,t=0,n="",i=arguments.length;t<i;t++)(r=arguments[t])&&(e=un(r))&&(n&&(n+=" "),n+=e);return n}const no=ln,fr="-",dr="__",ke="--",rr=r=>{const e=(...t)=>no(...t);return e.B=t=>r+fr+t,e.E=t=>r+dr+t,e.M=t=>r+ke+t,e.BM=(t,n)=>e.B(t)+ke+n,e.BE=(t,n)=>e.B(t)+dr+n,e.BEM=(t,n,i)=>e.BE(t,n)+ke+i,e.extend=t=>rr(e.B(t)),e.var=t=>ke+r+fr+t,e},at=r=>r!=null&&typeof r=="object"&&!Array.isArray(r);var io=Object.defineProperty,so=(r,e,t)=>e in r?io(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ie=(r,e,t)=>so(r,typeof e!="symbol"?e+"":e,t);function oo(r){const e=r.length;let t=0,n=0;for(;n<e;){let i=r.charCodeAt(n++);if((i&4294967168)===0){t++;continue}else if((i&4294965248)===0)t+=2;else{if(i>=55296&&i<=56319&&n<e){const s=r.charCodeAt(n);(s&64512)===56320&&(++n,i=((i&1023)<<10)+(s&1023)+65536)}(i&4294901760)===0?t+=3:t+=4}}return t}function ao(r,e,t){const n=r.length;let i=t,s=0;for(;s<n;){let o=r.charCodeAt(s++);if((o&4294967168)===0){e[i++]=o;continue}else if((o&4294965248)===0)e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&s<n){const u=r.charCodeAt(s);(u&64512)===56320&&(++s,o=((o&1023)<<10)+(u&1023)+65536)}(o&4294901760)===0?(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128):(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128)}e[i++]=o&63|128}}const uo=new TextEncoder,lo=50;function ho(r,e,t){uo.encodeInto(r,e.subarray(t))}function co(r,e,t){r.length>lo?ho(r,e,t):ao(r,e,t)}const fo=4096;function hn(r,e,t){let n=e;const i=n+t,s=[];let o="";for(;n<i;){const u=r[n++];if((u&128)===0)s.push(u);else if((u&224)===192){const h=r[n++]&63;s.push((u&31)<<6|h)}else if((u&240)===224){const h=r[n++]&63,f=r[n++]&63;s.push((u&31)<<12|h<<6|f)}else if((u&248)===240){const h=r[n++]&63,f=r[n++]&63,g=r[n++]&63;let d=(u&7)<<18|h<<12|f<<6|g;d>65535&&(d-=65536,s.push(d>>>10&1023|55296),d=56320|d&1023),s.push(d)}else s.push(u);s.length>=fo&&(o+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(o+=String.fromCharCode(...s)),o}const go=new TextDecoder,po=200;function yo(r,e,t){const n=r.subarray(e,e+t);return go.decode(n)}function mo(r,e,t){return t>po?yo(r,e,t):hn(r,e,t)}let De=class{constructor(e,t){this.type=e,this.data=t}},j=class Ut extends Error{constructor(e){super(e);const t=Object.create(Ut.prototype);Object.setPrototypeOf(this,t),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:Ut.name})}};const le=4294967295;function wo(r,e,t){const n=t/4294967296,i=t;r.setUint32(e,n),r.setUint32(e+4,i)}function cn(r,e,t){const n=Math.floor(t/4294967296),i=t;r.setUint32(e,n),r.setUint32(e+4,i)}function fn(r,e){const t=r.getInt32(e),n=r.getUint32(e+4);return t*4294967296+n}function bo(r,e){const t=r.getUint32(e),n=r.getUint32(e+4);return t*4294967296+n}const vo=-1,$o=4294967296-1,xo=17179869184-1;function Oo({sec:r,nsec:e}){if(r>=0&&e>=0&&r<=xo)if(e===0&&r<=$o){const t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,r),t}else{const t=r/4294967296,n=r&4294967295,i=new Uint8Array(8),s=new DataView(i.buffer);return s.setUint32(0,e<<2|t&3),s.setUint32(4,n),i}else{const t=new Uint8Array(12),n=new DataView(t.buffer);return n.setUint32(0,e),cn(n,4,r),t}}function To(r){const e=r.getTime(),t=Math.floor(e/1e3),n=(e-t*1e3)*1e6,i=Math.floor(n/1e9);return{sec:t+i,nsec:n-i*1e9}}function So(r){if(r instanceof Date){const e=To(r);return Oo(e)}else return null}function Io(r){const e=new DataView(r.buffer,r.byteOffset,r.byteLength);switch(r.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const t=e.getUint32(0),n=e.getUint32(4),i=(t&3)*4294967296+n,s=t>>>2;return{sec:i,nsec:s}}case 12:{const t=fn(e,4),n=e.getUint32(0);return{sec:t,nsec:n}}default:throw new j(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${r.length}`)}}function No(r){const e=Io(r);return new Date(e.sec*1e3+e.nsec/1e6)}const Uo={type:vo,encode:So,decode:No};let Ee=class{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(Uo)}register({type:e,encode:t,decode:n}){if(e>=0)this.encoders[e]=t,this.decoders[e]=n;else{const i=-1-e;this.builtInEncoders[i]=t,this.builtInDecoders[i]=n}}tryToEncode(e,t){for(let n=0;n<this.builtInEncoders.length;n++){const i=this.builtInEncoders[n];if(i!=null){const s=i(e,t);if(s!=null){const o=-1-n;return new De(o,s)}}}for(let n=0;n<this.encoders.length;n++){const i=this.encoders[n];if(i!=null){const s=i(e,t);if(s!=null){const o=n;return new De(o,s)}}}return e instanceof De?e:null}decode(e,t,n){const i=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return i?i(e,t,n):new De(t,e)}};Ee.defaultCodec=new Ee;function Bo(r){return r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer}function Bt(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):Bo(r)?new Uint8Array(r):Uint8Array.from(r)}const Eo=100,zo=2048;let Ao=class dn{constructor(e){this.entered=!1,this.extensionCodec=(e==null?void 0:e.extensionCodec)??Ee.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.maxDepth=(e==null?void 0:e.maxDepth)??Eo,this.initialBufferSize=(e==null?void 0:e.initialBufferSize)??zo,this.sortKeys=(e==null?void 0:e.sortKeys)??!1,this.forceFloat32=(e==null?void 0:e.forceFloat32)??!1,this.ignoreUndefined=(e==null?void 0:e.ignoreUndefined)??!1,this.forceIntegerToFloat=(e==null?void 0:e.forceIntegerToFloat)??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new dn({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw new Error(`Too deep objects in depth ${t}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){const t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(t*2)}resizeBuffer(e){const t=new ArrayBuffer(e),n=new Uint8Array(t),i=new DataView(t);n.set(this.bytes),this.view=i,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const t=oo(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),co(e,this.bytes,this.pos),this.pos+=t}encodeObject(e,t){const n=this.extensionCodec.tryToEncode(e,this.context);if(n!=null)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,t);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<4294967296)this.writeU8(198),this.writeU32(t);else throw new Error(`Too large binary: ${t}`);const n=Bt(e);this.writeU8a(n)}encodeArray(e,t){const n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else if(n<4294967296)this.writeU8(221),this.writeU32(n);else throw new Error(`Too large array: ${n}`);for(const i of e)this.doEncode(i,t+1)}countWithoutUndefined(e,t){let n=0;for(const i of t)e[i]!==void 0&&n++;return n}encodeMap(e,t){const n=Object.keys(e);this.sortKeys&&n.sort();const i=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(const s of n){const o=e[s];this.ignoreUndefined&&o===void 0||(this.encodeString(s),this.doEncode(o,t+1))}}encodeExtension(e){if(typeof e.data=="function"){const n=e.data(this.pos+6),i=n.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(n);return}const t=e.data.length;if(t===1)this.writeU8(212);else if(t===2)this.writeU8(213);else if(t===4)this.writeU8(214);else if(t===8)this.writeU8(215);else if(t===16)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<4294967296)this.writeU8(201),this.writeU32(t);else throw new Error(`Too large extension object: ${t}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),wo(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),cn(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function pe(r,e){return new Ao(e).encodeSharedRef(r)}function ft(r){return`${r<0?"-":""}0x${Math.abs(r).toString(16).padStart(2,"0")}`}const Mo=16,Co=16;class Lo{constructor(e=Mo,t=Co){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,n){const i=this.caches[n-1];e:for(const s of i){const o=s.bytes;for(let u=0;u<n;u++)if(o[u]!==e[t+u])continue e;return s.str}return null}store(e,t){const n=this.caches[e.length-1],i={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=i:n.push(i)}decode(e,t,n){const i=this.find(e,t,n);if(i!=null)return this.hit++,i;this.miss++;const s=hn(e,t,n),o=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(o,s),s}}const Et="array",xe="map_key",gn="map_value",Ro=r=>{if(typeof r=="string"||typeof r=="number")return r;throw new j("The type of key must be string or number but "+typeof r)};class jo{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const t=this.getUninitializedStateFromPool();t.type=Et,t.position=0,t.size=e,t.array=new Array(e)}pushMapState(e){const t=this.getUninitializedStateFromPool();t.type=xe,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===Et){const t=e;t.size=0,t.array=void 0,t.position=0,t.type=void 0}if(e.type===xe||e.type===gn){const t=e;t.size=0,t.map=void 0,t.readCount=0,t.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const he=-1,nr=new DataView(new ArrayBuffer(0)),ko=new Uint8Array(nr.buffer);try{nr.getInt8(0)}catch(r){if(!(r instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const gr=new RangeError("Insufficient data"),Do=new Lo;let Po=class pn{constructor(e){this.totalPos=0,this.pos=0,this.view=nr,this.bytes=ko,this.headByte=he,this.stack=new jo,this.entered=!1,this.extensionCodec=(e==null?void 0:e.extensionCodec)??Ee.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.rawStrings=(e==null?void 0:e.rawStrings)??!1,this.maxStrLength=(e==null?void 0:e.maxStrLength)??le,this.maxBinLength=(e==null?void 0:e.maxBinLength)??le,this.maxArrayLength=(e==null?void 0:e.maxArrayLength)??le,this.maxMapLength=(e==null?void 0:e.maxMapLength)??le,this.maxExtLength=(e==null?void 0:e.maxExtLength)??le,this.keyDecoder=(e==null?void 0:e.keyDecoder)!==void 0?e.keyDecoder:Do,this.mapKeyConverter=(e==null?void 0:e.mapKeyConverter)??Ro}clone(){return new pn({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=he,this.stack.reset()}setBuffer(e){const t=Bt(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===he&&!this.hasRemaining(1))this.setBuffer(e);else{const t=this.bytes.subarray(this.pos),n=Bt(e),i=new Uint8Array(t.length+n.length);i.set(t),i.set(n,t.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:t,pos:n}=this;return new RangeError(`Extra ${t.byteLength-n} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let t=!1,n;for await(const u of e){if(t)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(u);try{n=this.doDecodeSync(),t=!0}catch(h){if(!(h instanceof RangeError))throw h}this.totalPos+=this.pos}if(t){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return n}const{headByte:i,pos:s,totalPos:o}=this;throw new RangeError(`Insufficient data in parsing ${ft(i)} at ${o} (${s} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,t){if(this.entered){yield*this.clone().decodeMultiAsync(e,t);return}try{this.entered=!0;let n=t,i=-1;for await(const s of e){if(t&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(i=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(o){if(!(o instanceof RangeError))throw o}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){const i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else t={}}else if(e<160){const i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else t=[]}else{const i=e-160;t=this.decodeString(i,0)}else if(e===192)t=null;else if(e===194)t=!1;else if(e===195)t=!0;else if(e===202)t=this.readF32();else if(e===203)t=this.readF64();else if(e===204)t=this.readU8();else if(e===205)t=this.readU16();else if(e===206)t=this.readU32();else if(e===207)this.useBigInt64?t=this.readU64AsBigInt():t=this.readU64();else if(e===208)t=this.readI8();else if(e===209)t=this.readI16();else if(e===210)t=this.readI32();else if(e===211)this.useBigInt64?t=this.readI64AsBigInt():t=this.readI64();else if(e===217){const i=this.lookU8();t=this.decodeString(i,1)}else if(e===218){const i=this.lookU16();t=this.decodeString(i,2)}else if(e===219){const i=this.lookU32();t=this.decodeString(i,4)}else if(e===220){const i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else t=[]}else if(e===221){const i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else t=[]}else if(e===222){const i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else t={}}else if(e===223){const i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else t={}}else if(e===196){const i=this.lookU8();t=this.decodeBinary(i,1)}else if(e===197){const i=this.lookU16();t=this.decodeBinary(i,2)}else if(e===198){const i=this.lookU32();t=this.decodeBinary(i,4)}else if(e===212)t=this.decodeExtension(1,0);else if(e===213)t=this.decodeExtension(2,0);else if(e===214)t=this.decodeExtension(4,0);else if(e===215)t=this.decodeExtension(8,0);else if(e===216)t=this.decodeExtension(16,0);else if(e===199){const i=this.lookU8();t=this.decodeExtension(i,1)}else if(e===200){const i=this.lookU16();t=this.decodeExtension(i,2)}else if(e===201){const i=this.lookU32();t=this.decodeExtension(i,4)}else throw new j(`Unrecognized type byte: ${ft(e)}`);this.complete();const n=this.stack;for(;n.length>0;){const i=n.top();if(i.type===Et)if(i.array[i.position]=t,i.position++,i.position===i.size)t=i.array,n.release(i);else continue e;else if(i.type===xe){if(t==="__proto__")throw new j("The key __proto__ is not allowed");i.key=this.mapKeyConverter(t),i.type=gn;continue e}else if(i.map[i.key]=t,i.readCount++,i.readCount===i.size)t=i.map,n.release(i);else{i.key=null,i.type=xe;continue e}}return t}}readHeadByte(){return this.headByte===he&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=he}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new j(`Unrecognized array type byte: ${ft(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new j(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new j(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){var n;if(e>this.maxStrLength)throw new j(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw gr;const i=this.pos+t;let s;return this.stateIsMapKey()&&(n=this.keyDecoder)!=null&&n.canBeCached(e)?s=this.keyDecoder.decode(this.bytes,i,e):s=mo(this.bytes,i,e),this.pos+=t+e,s}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===xe:!1}decodeBinary(e,t){if(e>this.maxBinLength)throw new j(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw gr;const n=this.pos+t,i=this.bytes.subarray(n,n+e);return this.pos+=t+e,i}decodeExtension(e,t){if(e>this.maxExtLength)throw new j(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const n=this.view.getInt8(this.pos+t),i=this.decodeBinary(e,t+1);return this.extensionCodec.decode(i,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=bo(this.view,this.pos);return this.pos+=8,e}readI64(){const e=fn(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function yn(r,e){return new Po(e).decode(r)}let Fo=class{constructor(){ie(this,"contentType","application/json"),ie(this,"decoder"),ie(this,"encoder"),this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e))}decode(e,t){return this.decodeString(this.decoder.decode(e),t)}decodeString(e,t){const n=JSON.parse(e),i=tt(n);return t!=null?t.parse(i):i}encodeString(e){const t=Yt(e);return JSON.stringify(t,(n,i)=>ArrayBuffer.isView(i)?Array.from(i):at(i)&&"encode_value"in i?typeof i.value=="bigint"?i.value.toString():i.value:typeof i=="bigint"?i.toString():i)}static registerCustomType(){}},_o=class{constructor(){ie(this,"contentType","text/csv")}encode(e){const t=this.encodeString(e);return new TextEncoder().encode(t)}decode(e,t){const n=new TextDecoder().decode(e);return this.decodeString(n,t)}encodeString(e){if(!Array.isArray(e)||e.length===0||!at(e[0]))throw new Error("Payload must be an array of objects");const t=Object.keys(e[0]),n=[t.join(",")];return e.forEach(i=>{const s=t.map(o=>JSON.stringify(i[o]??""));n.push(s.join(","))}),n.join(`
2
+ `)}decodeString(e,t){const[n,...i]=e.trim().split(`
3
+ `).map(u=>u.trim());if(n.length===0)return t!=null?t.parse({}):{};const s=n.split(",").map(u=>u.trim()),o={};return s.forEach(u=>{o[u]=[]}),i.forEach(u=>{const h=u.split(",").map(f=>f.trim());s.forEach((f,g)=>{const d=this.parseValue(h[g]);d!=null&&o[f].push(d)})}),t!=null?t.parse(o):o}parseValue(e){if(e==null||e.length===0)return null;const t=Number(e);return isNaN(t)?e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e:t}static registerCustomType(){}},qo=class{constructor(){ie(this,"contentType","text/plain")}encode(e){return new TextEncoder().encode(e)}decode(e,t){const n=new TextDecoder().decode(e);return t!=null?t.parse(n):n}};const Z=new Ee;Z.register({type:0,encode:r=>{if(ArrayBuffer.isView(r)){const e=Array.from(r);return pe(e,{extensionCodec:Z})}return at(r)&&"encode_value"in r?typeof r.value=="bigint"?pe(r.value.toString(),{extensionCodec:Z}):pe(r.value,{extensionCodec:Z}):typeof r=="bigint"?pe(r.toString(),{extensionCodec:Z}):null},decode:r=>yn(r,{extensionCodec:Z})});let Wo=class{constructor(){ie(this,"contentType","application/msgpack")}encode(e){const t=Yt(e);return pe(t,{extensionCodec:Z}).slice()}decode(e,t){const n=yn(e,{extensionCodec:Z}),i=tt(n);return t!=null?t.parse(i):i}static registerCustomType(){}};const Ye=new Fo;new _o;new qo;new Wo;const zt=r=>[...new Set(r)],Yo=(r,e,t=!0)=>{const n=new Map;return r.forEach(i=>{const s=e(i);if(n.has(s)){if(t)return;n.delete(s)}n.set(s,i)}),Array.from(n.values())},Vo=Object.freeze(Object.defineProperty({__proto__:null,by:Yo,unique:zt},Symbol.toStringTag,{value:"Module"})),mn=r=>r!=null&&typeof r=="object"&&"toString"in r,Zo=r=>{if(mn(r))return(r==null?void 0:r.toString().length)===0;switch(typeof r){case"string":return r.length===0;case"number":return r===0;case"bigint":return r===0n;case"boolean":return!r;case"undefined":return!0;case"object":return!0}},ut=(r,e=!1)=>{const t=mn(r)?"stringer":typeof r;let n;switch(t){case"string":n=(i,s)=>i.localeCompare(s);break;case"stringer":n=(i,s)=>i.toString().localeCompare(s.toString());break;case"number":n=(i,s)=>Number(i)-Number(s);break;case"bigint":n=(i,s)=>BigInt(i)-BigInt(s)>0n?1:-1;break;case"boolean":n=(i,s)=>Number(i)-Number(s);break;case"undefined":n=()=>0;break;default:return console.warn(`sortFunc: unknown type ${t}`),()=>-1}return e?bn(n):n},Ho=(r,e,t)=>{const n=ut(e[r],t);return(i,s)=>n(i[r],s[r])},Go=(r,e)=>r.length!==e.length?r.length-e.length:r.every((t,n)=>t===e[n])?0:-1,wn=(r,e)=>{if(r.length!==e.length)return r.length-e.length;if(r.length===0)return 0;const t=ut(r[0]),n=[...r].sort(t),i=[...e].sort(t);return n.every((s,o)=>s===i[o])?0:-1},Ko=(r,e)=>{const t=zt(r),n=zt(e);return wn(t,n)},Jo=(r,e)=>r===e?0:r==="first"&&e==="last"?1:-1,bn=r=>(e,t)=>r(t,e),ae=0,Ve=-1,Ze=1,vn=r=>r<ae,$n=r=>r>ae,Xo=r=>r>=ae,xn=r=>r===ae,Qo=(r,e)=>{const t=/([a-zA-Z]+)|(\d+)/g,n=r.replace(/[\s_.-]+/g,"").match(t),i=e.replace(/[\s_.-]+/g,"").match(t);if(!n||!i)return 0;for(let s=0;s<Math.min(n.length,i.length);s++){const o=n[s],u=i[s];if(isNaN(Number(o))&&isNaN(Number(u))){const h=o.localeCompare(u);if(h!==0)return h}else if(!isNaN(Number(o))&&!isNaN(Number(u))){const h=Number(o)-Number(u);if(h!==0)return h}else return isNaN(Number(o))?-1:1}return n.length-i.length},ea=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:ae,GREATER_THAN:Ze,LESS_THAN:Ve,isEqualTo:xn,isGreaterThan:$n,isGreaterThanEqual:Xo,isLessThan:vn,newF:ut,newFieldF:Ho,order:Jo,primitiveArrays:Go,reverseF:bn,stringsWithNumbers:Qo,uniqueUnorderedPrimitiveArrays:Ko,unorderedPrimitiveArrays:wn},Symbol.toStringTag,{value:"Module"}));var ta=Object.defineProperty,ra=(r,e,t)=>e in r?ta(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,l=(r,e,t)=>ra(r,typeof e!="symbol"?e+"":e,t);let na=(r,e=21)=>(t=e)=>{let n="",i=t|0;for(;i--;)n+=r[Math.random()*r.length|0];return n};const ia="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",sa=na(ia,11),On=()=>sa(),oa=Object.freeze(Object.defineProperty({__proto__:null,create:On},Symbol.toStringTag,{value:"Module"})),aa=a.z.enum(["static","dynamic"]),Tn=(r,e)=>{const t=new $(e);if(![O.DAY,O.HOUR,O.MINUTE,O.SECOND,O.MILLISECOND,O.MICROSECOND,O.NANOSECOND].some(i=>i.equals(t)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const n=r.valueOf()%t.valueOf();return r instanceof $?new $(n):new O(n)},b=class p{constructor(e,t="UTC"){if(l(this,"value"),l(this,"encodeValue",!0),e==null)this.value=p.now().valueOf();else if(e instanceof Date)this.value=BigInt(e.getTime())*p.MILLISECOND.valueOf();else if(typeof e=="string")this.value=p.parseDateTimeString(e,t).valueOf();else if(Array.isArray(e))this.value=p.parseDate(e);else{let n=BigInt(0);e instanceof Number&&(e=e.valueOf()),t==="local"&&(n=p.utcOffset.valueOf()),typeof e=="number"&&(isFinite(e)?e=Math.trunc(e):(isNaN(e)&&(e=0),e===1/0?e=p.MAX:e=p.MIN)),this.value=BigInt(e.valueOf())+n}}static parseDate([e=1970,t=1,n=1]){const i=new Date(e,t-1,n,0,0,0,0);return new p(BigInt(i.getTime())*p.MILLISECOND.valueOf()).truncate(p.DAY).valueOf()}valueOf(){return this.value}static parseTimeString(e,t="UTC"){const[n,i,s]=e.split(":");let o="00",u="00";s!=null&&([o,u]=s.split("."));let h=p.hours(parseInt(n??"00")).add(p.minutes(parseInt(i??"00"))).add(p.seconds(parseInt(o??"00"))).add(p.milliseconds(parseInt(u??"00")));return t==="local"&&(h=h.add(p.utcOffset)),h.valueOf()}static parseDateTimeString(e,t="UTC"){if(!e.includes("/")&&!e.includes("-"))return p.parseTimeString(e,t);const n=new Date(e);return e.includes(":")||n.setUTCHours(0,0,0,0),new p(BigInt(n.getTime())*p.MILLISECOND.valueOf(),t).valueOf()}fString(e="ISO",t="UTC"){switch(e){case"ISODate":return this.toISOString(t).slice(0,10);case"ISOTime":return this.toISOString(t).slice(11,23);case"time":return this.timeString(!1,t);case"preciseTime":return this.timeString(!0,t);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,t)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,t)}`;default:return this.toISOString(t)}}toISOString(e="UTC"){return e==="UTC"?this.date().toISOString():this.sub(p.utcOffset).date().toISOString()}timeString(e=!1,t="UTC"){const n=this.toISOString(t);return e?n.slice(11,23):n.slice(11,19)}dateString(){const e=this.date(),t=e.toLocaleString("default",{month:"short"}),n=e.toLocaleString("default",{day:"numeric"});return`${t} ${n}`}static get utcOffset(){return new O(BigInt(new Date().getTimezoneOffset())*p.MINUTE.valueOf())}static since(e){return new p().span(e)}date(){return new Date(this.milliseconds)}equals(e){return this.valueOf()===new p(e).valueOf()}span(e){return this.range(e).span}range(e){return new K(this,e).makeValid()}spanRange(e){return this.range(this.add(e)).makeValid()}get isZero(){return this.valueOf()===BigInt(0)}after(e){return this.valueOf()>new p(e).valueOf()}afterEq(e){return this.valueOf()>=new p(e).valueOf()}before(e){return this.valueOf()<new p(e).valueOf()}beforeEq(e){return this.valueOf()<=new p(e).valueOf()}add(e){return new p(this.valueOf()+BigInt(e.valueOf()))}sub(e){return new p(this.valueOf()-BigInt(e.valueOf()))}get hours(){return Number(this.valueOf())/Number(O.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(O.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(O.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(O.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(p.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(p.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getFullYear()}setYear(e){const t=this.date();return t.setFullYear(e),new p(t)}get month(){return this.date().getUTCMonth()}setMonth(e){const t=this.date();return t.setUTCMonth(e),new p(t)}get day(){return this.date().getUTCDate()}setDay(e){const t=this.date();return t.setUTCDate(e),new p(t)}get hour(){return this.date().getUTCHours()}setHour(e){const t=this.date();return t.setUTCHours(e),new p(t,"UTC")}get minute(){return this.date().getMinutes()}setMinute(e){const t=this.date();return t.setUTCMinutes(e),new p(t)}get second(){return this.date().getSeconds()}setSecond(e){const t=this.date();return t.setUTCSeconds(e),new p(t)}get millisecond(){return this.date().getMilliseconds()}setMillisecond(e){const t=this.date();return t.setMilliseconds(e),new p(t)}toString(){return this.date().toISOString()}remainder(e){return Tn(this,e)}get isToday(){return this.truncate(O.DAY).equals(p.now().truncate(O.DAY))}truncate(e){return this.sub(this.remainder(e))}static now(){return new p(new Date)}static max(...e){let t=p.MIN;for(const n of e){const i=new p(n);i.after(t)&&(t=i)}return t}static min(...e){let t=p.MAX;for(const n of e){const i=new p(n);i.before(t)&&(t=i)}return t}static nanoseconds(e,t="UTC"){return new p(e,t)}static microseconds(e,t="UTC"){return p.nanoseconds(e*1e3,t)}static milliseconds(e,t="UTC"){return p.microseconds(e*1e3,t)}static seconds(e,t="UTC"){return p.milliseconds(e*1e3,t)}static minutes(e,t="UTC"){return p.seconds(e*60,t)}static hours(e,t="UTC"){return p.minutes(e*60,t)}static days(e,t="UTC"){return p.hours(e*24,t)}};l(b,"NANOSECOND",b.nanoseconds(1)),l(b,"MICROSECOND",b.microseconds(1)),l(b,"MILLISECOND",b.milliseconds(1)),l(b,"SECOND",b.seconds(1)),l(b,"MINUTE",b.minutes(1)),l(b,"HOUR",b.hours(1)),l(b,"DAY",b.days(1)),l(b,"MAX",new b((1n<<63n)-1n)),l(b,"MIN",new b(0)),l(b,"ZERO",new b(0)),l(b,"z",a.z.union([a.z.object({value:a.z.bigint()}).transform(r=>new b(r.value)),a.z.string().transform(r=>new b(BigInt(r))),a.z.instanceof(Number).transform(r=>new b(r)),a.z.number().transform(r=>new b(r)),a.z.instanceof(b)]));let $=b;const v=class y{constructor(e){l(this,"value"),l(this,"encodeValue",!0),typeof e=="number"&&(e=Math.trunc(e.valueOf())),this.value=BigInt(e.valueOf())}static fromSeconds(e){return e instanceof y?e:e instanceof At?e.period:e instanceof $?new y(e):["number","bigint"].includes(typeof e)?y.seconds(e):new y(e)}static fromMilliseconds(e){return e instanceof y?e:e instanceof At?e.period:e instanceof $?new y(e):["number","bigint"].includes(typeof e)?y.milliseconds(e):new y(e)}encode(){return this.value.toString()}valueOf(){return this.value}lessThan(e){return this.valueOf()<new y(e).valueOf()}greaterThan(e){return this.valueOf()>new y(e).valueOf()}lessThanOrEqual(e){return this.valueOf()<=new y(e).valueOf()}greaterThanOrEqual(e){return this.valueOf()>=new y(e).valueOf()}remainder(e){return Tn(this,e)}truncate(e){return new y(BigInt(Math.trunc(Number(this.valueOf()/e.valueOf())))*e.valueOf())}toString(){const e=this.truncate(y.DAY),t=this.truncate(y.HOUR),n=this.truncate(y.MINUTE),i=this.truncate(y.SECOND),s=this.truncate(y.MILLISECOND),o=this.truncate(y.MICROSECOND),u=this.truncate(y.NANOSECOND),h=e,f=t.sub(e),g=n.sub(t),d=i.sub(n),B=s.sub(i),A=o.sub(s),ue=u.sub(o);let Y="";return h.isZero||(Y+=`${h.days}d `),f.isZero||(Y+=`${f.hours}h `),g.isZero||(Y+=`${g.minutes}m `),d.isZero||(Y+=`${d.seconds}s `),B.isZero||(Y+=`${B.milliseconds}ms `),A.isZero||(Y+=`${A.microseconds}µs `),ue.isZero||(Y+=`${ue.nanoseconds}ns`),Y.trim()}mult(e){return new y(this.valueOf()*BigInt(e))}get days(){return Number(this.valueOf())/Number(y.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(y.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(y.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(y.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(y.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(y.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===BigInt(0)}equals(e){return this.valueOf()===new y(e).valueOf()}add(e){return new y(this.valueOf()+new y(e).valueOf())}sub(e){return new y(this.valueOf()-new y(e).valueOf())}static nanoseconds(e=1){return new y(e)}static microseconds(e=1){return y.nanoseconds(Q(e,1e3))}static milliseconds(e=1){return y.microseconds(Q(e,1e3))}static seconds(e=1){return y.milliseconds(Q(e,1e3))}static minutes(e=1){return y.seconds(Q(e,60))}static hours(e){return y.minutes(Q(e,60))}static days(e){return y.hours(Q(e,24))}};l(v,"NANOSECOND",v.nanoseconds(1)),l(v,"MICROSECOND",v.microseconds(1)),l(v,"MILLISECOND",v.milliseconds(1)),l(v,"SECOND",v.seconds(1)),l(v,"MINUTE",v.minutes(1)),l(v,"HOUR",v.hours(1)),l(v,"DAY",v.days(1)),l(v,"MAX",new v((1n<<63n)-1n)),l(v,"MIN",new v(0)),l(v,"ZERO",new v(0)),l(v,"z",a.z.union([a.z.object({value:a.z.bigint()}).transform(r=>new v(r.value)),a.z.string().transform(r=>new v(BigInt(r))),a.z.instanceof(Number).transform(r=>new v(r)),a.z.number().transform(r=>new v(r)),a.z.instanceof(v)]));let O=v;const ye=class He extends Number{constructor(e){e instanceof Number?super(e.valueOf()):super(e)}toString(){return`${this.valueOf()} Hz`}equals(e){return this.valueOf()===new He(e).valueOf()}get period(){return O.seconds(1/this.valueOf())}sampleCount(e){return new O(e).seconds*this.valueOf()}byteCount(e,t){return this.sampleCount(e)*new z(t).valueOf()}span(e){return O.seconds(e/this.valueOf())}byteSpan(e,t){return this.span(e.valueOf()/t.valueOf())}static hz(e){return new He(e)}static khz(e){return He.hz(e*1e3)}};l(ye,"z",a.z.union([a.z.number().transform(r=>new ye(r)),a.z.instanceof(Number).transform(r=>new ye(r)),a.z.instanceof(ye)]));let At=ye;const U=class extends Number{constructor(e){e instanceof Number?super(e.valueOf()):super(e)}length(e){return e.valueOf()/this.valueOf()}size(e){return new ze(e*this.valueOf())}};l(U,"UNKNOWN",new U(0)),l(U,"BIT128",new U(16)),l(U,"BIT64",new U(8)),l(U,"BIT32",new U(4)),l(U,"BIT16",new U(2)),l(U,"BIT8",new U(1)),l(U,"z",a.z.union([a.z.number().transform(r=>new U(r)),a.z.instanceof(Number).transform(r=>new U(r)),a.z.instanceof(U)]));let z=U;const L=class me{constructor(e,t){l(this,"start"),l(this,"end"),typeof e=="object"&&"start"in e?(this.start=new $(e.start),this.end=new $(e.end)):(this.start=new $(e),this.end=new $(t))}get span(){return new O(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new me(this.end,this.start)}get numericBounds(){return{lower:Number(this.start.valueOf()),upper:Number(this.end.valueOf())}}equals(e,t=O.ZERO){if(t.isZero)return this.start.equals(e.start)&&this.end.equals(e.end);let n=this.start.sub(e.start).valueOf(),i=this.end.sub(e.end).valueOf();return n<0&&(n=-n),i<0&&(i=-i),n<=t.valueOf()&&i<=t.valueOf()}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(e,t=O.ZERO){e=e.makeValid();const n=this.makeValid();if(this.equals(e))return!0;if(e.end.equals(n.start)||n.end.equals(e.start))return!1;const i=$.max(n.start,e.start),s=$.min(n.end,e.end);return s.before(i)?!1:new O(s.sub(i)).greaterThanOrEqual(t)}contains(e){return e instanceof me?this.contains(e.start)&&this.contains(e.end):this.start.beforeEq(e)&&this.end.after(e)}boundBy(e){const t=new me(this.start,this.end);return e.start.after(this.start)&&(t.start=e.start),e.start.after(this.end)&&(t.end=e.start),e.end.before(this.end)&&(t.end=e.end),e.end.before(this.start)&&(t.start=e.end),t}static max(...e){return new me($.min(...e.map(t=>t.start)),$.max(...e.map(t=>t.end)))}};l(L,"MAX",new L($.MIN,$.MAX)),l(L,"MIN",new L($.MAX,$.MIN)),l(L,"ZERO",new L($.ZERO,$.ZERO)),l(L,"z",a.z.union([a.z.object({start:$.z,end:$.z}).transform(r=>new L(r.start,r.end)),a.z.instanceof(L)]));let K=L;const c=class I{constructor(e){if(l(this,"value"),l(this,"encodeValue",!0),e instanceof I||typeof e=="string"||typeof e.valueOf()=="string"){this.value=e.valueOf();return}const t=I.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);if(t!=null){this.value=t.valueOf();return}throw this.value=I.UNKNOWN.valueOf(),new Error(`unable to find data type for ${e.toString()}`)}valueOf(){return this.value}get Array(){const e=I.ARRAY_CONSTRUCTORS.get(this.toString());if(e==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return e}equals(e){return this.valueOf()===e.valueOf()}matches(...e){return e.some(t=>this.equals(t))}toString(){return this.valueOf()}get isVariable(){return this.equals(I.JSON)||this.equals(I.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(I.UUID)}get isInteger(){const e=this.toString();return e.startsWith("int")||e.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const e=I.DENSITIES.get(this.toString());if(e==null)throw new Error(`unable to find density for ${this.valueOf()}`);return e}get isUnsigned(){return this.equals(I.UINT8)||this.equals(I.UINT16)||this.equals(I.UINT32)||this.equals(I.UINT64)}get isSigned(){return this.equals(I.INT8)||this.equals(I.INT16)||this.equals(I.INT32)||this.equals(I.INT64)}canSafelyCastTo(e){return this.equals(e)?!0:!this.isNumeric||!e.isNumeric||this.isVariable||e.isVariable||this.isUnsigned&&e.isSigned?!1:this.isFloat?e.isFloat&&this.density.valueOf()<=e.density.valueOf():this.equals(I.INT32)&&e.equals(I.FLOAT64)||this.equals(I.INT8)&&e.equals(I.FLOAT32)?!0:this.isInteger&&e.isInteger?this.density.valueOf()<=e.density.valueOf()&&this.isUnsigned===e.isUnsigned:!1}canCastTo(e){return this.isNumeric&&e.isNumeric?!0:this.equals(e)}toJSON(){return this.toString()}get usesBigInt(){return I.BIG_INT_TYPES.some(e=>e.equals(this))}};l(c,"UNKNOWN",new c("unknown")),l(c,"FLOAT64",new c("float64")),l(c,"FLOAT32",new c("float32")),l(c,"INT64",new c("int64")),l(c,"INT32",new c("int32")),l(c,"INT16",new c("int16")),l(c,"INT8",new c("int8")),l(c,"UINT64",new c("uint64")),l(c,"UINT32",new c("uint32")),l(c,"UINT16",new c("uint16")),l(c,"UINT8",new c("uint8")),l(c,"BOOLEAN",c.UINT8),l(c,"TIMESTAMP",new c("timestamp")),l(c,"UUID",new c("uuid")),l(c,"STRING",new c("string")),l(c,"JSON",new c("json")),l(c,"ARRAY_CONSTRUCTORS",new Map([[c.UINT8.toString(),Uint8Array],[c.UINT16.toString(),Uint16Array],[c.UINT32.toString(),Uint32Array],[c.UINT64.toString(),BigUint64Array],[c.FLOAT32.toString(),Float32Array],[c.FLOAT64.toString(),Float64Array],[c.INT8.toString(),Int8Array],[c.INT16.toString(),Int16Array],[c.INT32.toString(),Int32Array],[c.INT64.toString(),BigInt64Array],[c.TIMESTAMP.toString(),BigInt64Array],[c.STRING.toString(),Uint8Array],[c.JSON.toString(),Uint8Array],[c.UUID.toString(),Uint8Array]])),l(c,"ARRAY_CONSTRUCTOR_DATA_TYPES",new Map([[Uint8Array.name,c.UINT8],[Uint16Array.name,c.UINT16],[Uint32Array.name,c.UINT32],[BigUint64Array.name,c.UINT64],[Float32Array.name,c.FLOAT32],[Float64Array.name,c.FLOAT64],[Int8Array.name,c.INT8],[Int16Array.name,c.INT16],[Int32Array.name,c.INT32],[BigInt64Array.name,c.INT64]])),l(c,"DENSITIES",new Map([[c.UINT8.toString(),z.BIT8],[c.UINT16.toString(),z.BIT16],[c.UINT32.toString(),z.BIT32],[c.UINT64.toString(),z.BIT64],[c.FLOAT32.toString(),z.BIT32],[c.FLOAT64.toString(),z.BIT64],[c.INT8.toString(),z.BIT8],[c.INT16.toString(),z.BIT16],[c.INT32.toString(),z.BIT32],[c.INT64.toString(),z.BIT64],[c.TIMESTAMP.toString(),z.BIT64],[c.STRING.toString(),z.UNKNOWN],[c.JSON.toString(),z.UNKNOWN],[c.UUID.toString(),z.BIT128]])),l(c,"ALL",[c.UNKNOWN,c.FLOAT64,c.FLOAT32,c.INT64,c.INT32,c.INT16,c.INT8,c.UINT64,c.UINT32,c.UINT16,c.UINT8,c.TIMESTAMP,c.UUID,c.STRING,c.JSON]),l(c,"BIG_INT_TYPES",[c.INT64,c.UINT64,c.TIMESTAMP]),l(c,"z",a.z.union([a.z.string().transform(r=>new c(r)),a.z.instanceof(c)]));let w=c;const E=class N extends Number{constructor(e){super(e.valueOf())}largerThan(e){return this.valueOf()>e.valueOf()}smallerThan(e){return this.valueOf()<e.valueOf()}add(e){return N.bytes(this.valueOf()+e.valueOf())}sub(e){return N.bytes(this.valueOf()-e.valueOf())}truncate(e){return new N(Math.trunc(this.valueOf()/e.valueOf())*e.valueOf())}remainder(e){return N.bytes(this.valueOf()%e.valueOf())}get gigabytes(){return this.valueOf()/N.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/N.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/N.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/N.TERABYTE.valueOf()}toString(){const e=this.truncate(N.TERABYTE),t=this.truncate(N.GIGABYTE),n=this.truncate(N.MEGABYTE),i=this.truncate(N.KILOBYTE),s=this.truncate(N.BYTE),o=e,u=t.sub(e),h=n.sub(t),f=i.sub(n),g=s.sub(i);let d="";return o.isZero||(d+=`${o.terabytes}TB `),u.isZero||(d+=`${u.gigabytes}GB `),h.isZero||(d+=`${h.megabytes}MB `),f.isZero||(d+=`${f.kilobytes}KB `),(!g.isZero||d==="")&&(d+=`${g.valueOf()}B`),d.trim()}static bytes(e=1){return new N(e)}static kilobytes(e=1){return N.bytes(e.valueOf()*1e3)}static megabytes(e=1){return N.kilobytes(e.valueOf()*1e3)}static gigabytes(e=1){return N.megabytes(e.valueOf()*1e3)}static terabytes(e){return N.gigabytes(e.valueOf()*1e3)}get isZero(){return this.valueOf()===0}};l(E,"BYTE",new E(1)),l(E,"KILOBYTE",E.kilobytes(1)),l(E,"MEGABYTE",E.megabytes(1)),l(E,"GIGABYTE",E.gigabytes(1)),l(E,"TERABYTE",E.terabytes(1)),l(E,"ZERO",new E(0)),l(E,"z",a.z.union([a.z.number().transform(r=>new E(r)),a.z.instanceof(E)]));let ze=E;const ua=a.z.union([a.z.instanceof(Uint8Array),a.z.instanceof(Uint16Array),a.z.instanceof(Uint32Array),a.z.instanceof(BigUint64Array),a.z.instanceof(Float32Array),a.z.instanceof(Float64Array),a.z.instanceof(Int8Array),a.z.instanceof(Int16Array),a.z.instanceof(Int32Array),a.z.instanceof(BigInt64Array)]),Sn=r=>{const e=typeof r;return e==="string"||e==="number"||e==="boolean"||e==="bigint"||r instanceof $||r instanceof O||r instanceof Date},la=(r,e,t,n=0)=>r.usesBigInt&&!e.usesBigInt?Number(t)-Number(n):!r.usesBigInt&&e.usesBigInt?BigInt(t.valueOf())-BigInt(n.valueOf()):we(t,-n).valueOf(),we=(r,e)=>e==0?r:r==0?e:typeof r=="bigint"&&typeof e=="bigint"||typeof r=="number"&&typeof e=="number"?r+e:Number(r)+Number(e),ha=r=>r==null?!1:Array.isArray(r)||r instanceof ArrayBuffer||ArrayBuffer.isView(r)&&!(r instanceof DataView)||r instanceof Nn?!0:Sn(r),V=-1,Mt={[Symbol.iterator]:()=>Mt,next:()=>({done:!0,value:void 0})},ca=a.z.string().transform(r=>new Uint8Array(atob(r).split("").map(e=>e.charCodeAt(0))).buffer),fa=a.z.union([a.z.null(),a.z.undefined()]).transform(()=>new Uint8Array().buffer),Ct=10,In=(r,e)=>{if(r==="string"&&!e.isVariable)throw new Error(`cannot convert series of type ${e.toString()} to string`);if(r==="number"&&!e.isNumeric)throw new Error(`cannot convert series of type ${e.toString()} to number`);if(r==="bigint"&&!e.usesBigInt)throw new Error(`cannot convert series of type ${e.toString()} to bigint`)},be=class R{constructor(e){l(this,"key",""),l(this,"isSynnaxSeries",!0),l(this,"dataType"),l(this,"sampleOffset"),l(this,"gl"),l(this,"_data"),l(this,"timeRange",K.ZERO),l(this,"alignment",0n),l(this,"_cachedMin"),l(this,"_cachedMax"),l(this,"writePos",V),l(this,"_refCount",0),l(this,"_cachedLength"),l(this,"_cachedIndexes"),ha(e)&&(e={data:e});const{dataType:t,timeRange:n,sampleOffset:i=0,glBufferUsage:s="static",alignment:o=0n,key:u=On()}=e,h=e.data??[];if(h instanceof R||typeof h=="object"&&"isSynnaxSeries"in h&&h.isSynnaxSeries===!0){const d=h;this.key=d.key,this.dataType=d.dataType,this.sampleOffset=d.sampleOffset,this.gl=d.gl,this._data=d._data,this.timeRange=d.timeRange,this.alignment=d.alignment,this._cachedMin=d._cachedMin,this._cachedMax=d._cachedMax,this.writePos=d.writePos,this._refCount=d._refCount,this._cachedLength=d._cachedLength;return}const f=Sn(h),g=Array.isArray(h);if(t!=null)this.dataType=new w(t);else{if(h instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(g||f){let d=h;if(!f){if(h.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");d=h[0]}if(typeof d=="string")this.dataType=w.STRING;else if(typeof d=="number")this.dataType=w.FLOAT64;else if(typeof d=="bigint")this.dataType=w.INT64;else if(typeof d=="boolean")this.dataType=w.BOOLEAN;else if(d instanceof $||d instanceof Date||d instanceof $)this.dataType=w.TIMESTAMP;else if(typeof d=="object")this.dataType=w.JSON;else throw new Error(`cannot infer data type of ${typeof d} when constructing a Series from a JS array`)}else this.dataType=new w(h)}if(!g&&!f)this._data=h;else{let d=f?[h]:h;const B=d[0];(B instanceof $||B instanceof Date||B instanceof O)&&(d=d.map(A=>new $(A).valueOf())),this.dataType.equals(w.STRING)?(this._cachedLength=d.length,this._data=new TextEncoder().encode(`${d.join(`
4
+ `)}
5
+ `).buffer):this.dataType.equals(w.JSON)?(this._cachedLength=d.length,this._data=new TextEncoder().encode(`${d.map(A=>Ye.encodeString(A)).join(`
6
+ `)}
7
+ `).buffer):this.dataType.usesBigInt&&typeof B=="number"?this._data=new this.dataType.Array(d.map(A=>BigInt(Math.round(A)))).buffer:!this.dataType.usesBigInt&&typeof B=="bigint"?this._data=new this.dataType.Array(d.map(A=>Number(A))).buffer:this._data=new this.dataType.Array(d).buffer}this.key=u,this.alignment=o,this.sampleOffset=i??0,this.timeRange=n??K.ZERO,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:s}}static alloc({capacity:e,dataType:t,...n}){if(e===0)throw new Error("[Series] - cannot allocate an array of length 0");const i=new new w(t).Array(e),s=new R({data:i.buffer,dataType:t,...n});return s.writePos=0,s}static createTimestamps(e,t,n){const i=n.spanRange(t.span(e)),s=new BigInt64Array(e);for(let o=0;o<e;o++)s[o]=BigInt(n.add(t.span(o)).valueOf());return new R({data:s,dataType:w.TIMESTAMP,timeRange:i})}get refCount(){return this._refCount}static fromStrings(e,t){const n=new TextEncoder().encode(`${e.join(`
8
+ `)}
9
+ `);return new R({data:n,dataType:w.STRING,timeRange:t})}static fromJSON(e,t){const n=new TextEncoder().encode(`${e.map(i=>Ye.encodeString(i)).join(`
10
+ `)}
11
+ `);return new R({data:n,dataType:w.JSON,timeRange:t})}acquire(e){this._refCount++,e!=null&&this.updateGLBuffer(e)}release(){if(this._refCount<=0){console.warn("attempted to release a series with a negative reference count");return}this._refCount--,this._refCount===0&&this.gl.control!=null&&this.maybeGarbageCollectGLBuffer(this.gl.control)}write(e){if(!e.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(e):this.writeFixed(e)}writeVariable(e){if(this.writePos===V)return 0;const t=this.byteCapacity.valueOf()-this.writePos,n=e.subBytes(0,t);return this.writeToUnderlyingData(n),this.writePos+=n.byteLength.valueOf(),this._cachedLength!=null&&(this._cachedLength+=n.length,this.calculateCachedLength()),n.length}writeFixed(e){if(this.writePos===V)return 0;const t=this.capacity-this.writePos,n=e.sub(0,t);return this.writeToUnderlyingData(n),this._cachedLength=void 0,this.maybeRecomputeMinMax(n),this.writePos+=n.length,n.length}writeToUnderlyingData(e){this.underlyingData.set(e.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===V?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){if(!this.dataType.matches(w.STRING,w.UUID))throw new Error("cannot convert non-string series to strings");return new TextDecoder().decode(this.underlyingData).split(`
12
+ `).slice(0,-1)}toUUIDs(){if(!this.dataType.equals(w.UUID))throw new Error("cannot convert non-uuid series to uuids");const e=w.UUID.density.valueOf(),t=Array(this.length);for(let n=0;n<this.length;n++){const i=this.underlyingData.slice(n*e,(n+1)*e),s=Array.from(new Uint8Array(i.buffer),o=>o.toString(16).padStart(2,"0")).join("").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5");t[n]=s}return t}parseJSON(e){if(!this.dataType.equals(w.JSON))throw new Error("cannot parse non-JSON series as JSON");return new TextDecoder().decode(this.underlyingData).split(`
13
+ `).slice(0,-1).map(t=>e.parse(Ye.decodeString(t)))}get byteCapacity(){return new ze(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===V?this.byteCapacity:this.dataType.isVariable?new ze(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this._cachedLength!=null?this._cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===V?this.data.length:this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let e=0;const t=[0];return this.data.forEach((n,i)=>{n===Ct&&(e++,t.push(i+1))}),this._cachedIndexes=t,this._cachedLength=e,e}convert(e,t=0){if(this.dataType.equals(e))return this;const n=new e.Array(this.length);for(let i=0;i<this.length;i++)n[i]=la(this.dataType,e,this.data[i],t);return new R({data:n.buffer,dataType:e,timeRange:this.timeRange,sampleOffset:t,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(w.TIMESTAMP))this._cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const e=this.data;this._cachedMax=e.reduce((t,n)=>t>n?t:n)}else{const e=this.data;this._cachedMax=e.reduce((t,n)=>t>n?t:n)}return this._cachedMax}get max(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this._cachedMax??(this._cachedMax=this.calcRawMax()),we(this._cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(w.TIMESTAMP))this._cachedMin=this.data[0];else if(this.dataType.usesBigInt){const e=this.data;this._cachedMin=e.reduce((t,n)=>t<n?t:n)}else{const e=this.data;this._cachedMin=e.reduce((t,n)=>t<n?t:n)}return this._cachedMin}get min(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this._cachedMin??(this._cachedMin=this.calcRawMin()),we(this._cachedMin,this.sampleOffset))}get bounds(){return m(Number(this.min),Number(this.max))}maybeRecomputeMinMax(e){if(this._cachedMin!=null){const t=e._cachedMin??e.calcRawMin();t<this._cachedMin&&(this._cachedMin=t)}if(this._cachedMax!=null){const t=e._cachedMax??e.calcRawMax();t>this._cachedMax&&(this._cachedMax=t)}}enrich(){this.max,this.min}get range(){return we(this.max,-this.min)}atAlignment(e,t){const n=Number(e-this.alignment);if(n<0||n>=this.length){if(t===!0)throw new Error(`[series] - no value at index ${n}`);return}return this.at(n,t)}at(e,t){if(this.dataType.isVariable)return this.atVariable(e,t??!1);e<0&&(e=this.length+e);const n=this.data[e];if(n==null){if(t===!0)throw new Error(`[series] - no value at index ${e}`);return}return we(n,this.sampleOffset)}atVariable(e,t){let n=0,i=0;if(this._cachedIndexes!=null)n=this._cachedIndexes[e],i=this._cachedIndexes[e+1]-1;else{e<0&&(e=this.length+e);for(let o=0;o<this.data.length;o++)if(this.data[o]===Ct){if(e===0){i=o;break}n=o+1,e--}if(i===0&&(i=this.data.length),n>=i||e>0){if(t)throw new Error(`[series] - no value at index ${e}`);return}}const s=this.data.slice(n,i);return this.dataType.equals(w.STRING)?new TextDecoder().decode(s):tt(JSON.parse(new TextDecoder().decode(s)))}binarySearch(e){let t=0,n=this.length-1;const i=ut(e);for(;t<=n;){const s=Math.floor((t+n)/2),o=i(this.at(s,!0),e);if(o===0)return s;o<0?t=s+1:n=s-1}return t}updateGLBuffer(e){if(this.gl.control=e,!this.dataType.equals(w.FLOAT32)&&!this.dataType.equals(w.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:t,bufferUsage:n,prevBuffer:i}=this.gl;if(t==null&&(this.gl.buffer=e.createBuffer()),this.writePos!==i)if(e.bindBuffer(e.ARRAY_BUFFER,this.gl.buffer),this.writePos!==V){i===0&&e.bufferData(e.ARRAY_BUFFER,this.byteCapacity.valueOf(),e.STATIC_DRAW);const s=this.dataType.density.size(i).valueOf(),o=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);e.bufferSubData(e.ARRAY_BUFFER,s,o.buffer),this.gl.prevBuffer=this.writePos}else e.bufferData(e.ARRAY_BUFFER,this.buffer,n==="static"?e.STATIC_DRAW:e.DYNAMIC_DRAW),this.gl.prevBuffer=V}as(e){return In(e,this.dataType),this}get digest(){var e;return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:xr(this.alignmentBounds.lower),upper:xr(this.alignmentBounds.upper)},timeRange:(e=this.timeRange)==null?void 0:e.toString(),length:this.length,capacity:this.capacity}}get memInfo(){return{key:this.key,length:this.length,byteLength:this.byteLength,glBuffer:this.gl.buffer!=null}}get alignmentBounds(){return m(this.alignment,this.alignment+BigInt(this.length))}maybeGarbageCollectGLBuffer(e){this.gl.buffer!=null&&(e.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const e=new da(this);return this.dataType.equals(w.JSON)?new ga(e):e}return new pa(this)}slice(e,t){return this.sliceSub(!1,e,t)}sub(e,t){return this.sliceSub(!0,e,t)}subIterator(e,t){return new pr(this,e,t??this.length)}subAlignmentIterator(e,t){return new pr(this,Number(e-this.alignment),Number(t-this.alignment))}subBytes(e,t){if(e>=0&&(t==null||t>=this.byteLength.valueOf()))return this;const n=this.data.subarray(e,t);return new R({data:n,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(e)})}sliceSub(e,t,n){if(t<=0&&(n==null||n>=this.length))return this;let i;return e?i=this.data.subarray(t,n):i=this.data.slice(t,n),new R({data:i,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(t)})}reAlign(e){return new R({data:this.buffer,dataType:this.dataType,timeRange:K.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:e})}toString(){var e,t;let n=`${this.dataType.toString()} ${this.length} [`;if(this.length<=10)n+=Array.from(this).map(i=>i.toString());else{for(let i=0;i<5;i++)n+=`${(e=this.at(i))==null?void 0:e.toString()}`,i<4&&(n+=",");n+="...";for(let i=-5;i<0;i++)n+=(t=this.at(i))==null?void 0:t.toString(),i<-1&&(n+=",")}return n+="]",n}};l(be,"crudeZ",a.z.object({timeRange:K.z.optional(),dataType:w.z,alignment:a.z.coerce.bigint().optional(),data:a.z.union([ca,fa,a.z.instanceof(ArrayBuffer),a.z.instanceof(Uint8Array)]),glBufferUsage:aa.optional().default("static").optional()})),l(be,"z",be.crudeZ.transform(r=>new be(r)));let Nn=be,pr=class{constructor(e,t,n){l(this,"series"),l(this,"end"),l(this,"index"),this.series=e;const i=m(0,e.length);this.end=bt(i,n),this.index=bt(i,t)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}},da=class{constructor(e){if(l(this,"series"),l(this,"index"),l(this,"decoder"),!e.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=e,this.index=0,this.decoder=new TextDecoder}next(){const e=this.index,t=this.series.data;for(;this.index<t.length&&t[this.index]!==Ct;)this.index++;const n=this.index;return e===n?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(e,n))})}[Symbol.iterator](){return this}};var yr,mr;const Un=class Bn{constructor(e){l(this,"wrapped"),l(this,yr,"JSONSeriesIterator"),this.wrapped=e}next(){const e=this.wrapped.next();return e.done===!0?{done:!0,value:void 0}:{done:!1,value:Ye.decodeString(e.value,Bn.SCHEMA)}}[(mr=Symbol.iterator,yr=Symbol.toStringTag,mr)](){return this}};l(Un,"SCHEMA",a.z.record(a.z.string(),a.z.unknown()));let ga=Un;var wr,br;class pa{constructor(e){l(this,"series"),l(this,"index"),l(this,wr,"SeriesIterator"),this.series=e,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[(br=Symbol.iterator,wr=Symbol.toStringTag,br)](){return this}}class ya{constructor(e=[]){if(l(this,"series"),e.length!==0){const t=e[0].dataType;for(let n=1;n<e.length;n++)if(!e[n].dataType.equals(t))throw new Error("[multi-series] - series must have the same data type")}this.series=e}as(e){return In(e,this.dataType),this}get dataType(){return this.series.length===0?w.UNKNOWN:this.series[0].dataType}get timeRange(){return this.series.length===0?K.ZERO:new K(this.series[0].timeRange.start,this.series[this.series.length-1].timeRange.end)}get alignment(){return this.series.length===0?0n:this.series[0].alignment}get alignmentBounds(){return this.series.length===0?m(0n,0n):m(this.series[0].alignmentBounds.lower,this.series[this.series.length-1].alignmentBounds.upper)}push(e){"isSynnaxSeries"in e&&e.isSynnaxSeries?this.series.push(e):this.series.push(...e.series)}get length(){return this.series.reduce((e,t)=>e+t.length,0)}atAlignment(e,t){if(this.series.length===0){if(t)throw new Error(`[series] - no value at alignment ${e}`);return}for(const n of this.series)if(M(n.alignmentBounds,e))return n.atAlignment(e,t);if(t)throw new Error(`[series] - no value at alignment ${e}`)}at(e,t=!1){e<0&&(e=this.length+e);for(const n of this.series){if(e<n.length)return n.at(e,t);e-=n.length}if(t)throw new Error(`[series] - no value at index ${e}`)}subIterator(e,t){return new dt(this,e,t??this.length)}subAlignmentIterator(e,t){if(e>=this.alignmentBounds.upper||t<=this.alignmentBounds.lower)return Mt;let n=0;for(let s=0;s<this.series.length;s++){const o=this.series[s];if(e<o.alignment)break;if(e>=o.alignmentBounds.upper)n+=o.length;else if(M(o.alignmentBounds,e)){n+=Number(e-o.alignment);break}}let i=0;for(let s=0;s<this.series.length;s++){const o=this.series[s];if(t<o.alignment)break;if(t>=o.alignmentBounds.upper)i+=o.length;else if(M(o.alignmentBounds,t)){i+=Number(t-o.alignment);break}}return new dt(this,n,i)}subAlignmentSpanIterator(e,t){if(e>=this.alignmentBounds.upper)return Mt;let n=0;for(let i=0;i<this.series.length;i++){const s=this.series[i];if(e<s.alignment)break;if(e>=s.alignmentBounds.upper)n+=s.length;else if(M(s.alignmentBounds,e)){n+=Number(e-s.alignment);break}}return new dt(this,n,n+t)}updateGLBuffer(e){this.series.forEach(t=>t.updateGLBuffer(e))}get bounds(){return Mr(this.series.map(e=>e.bounds))}get byteLength(){return new ze(this.series.reduce((e,t)=>e+t.byteLength.valueOf(),0))}get data(){const e=new this.dataType.Array(this.length);let t=0;for(const n of this.series)e.set(n.data,t),t+=n.length;return new this.dataType.Array(e.buffer)}traverseAlignment(e,t){const n=this.series.map(i=>i.alignmentBounds);return Cr(n,e,t)}acquire(){this.series.forEach(e=>e.acquire())}release(){this.series.forEach(e=>e.release())}distance(e,t){const n=this.series.map(i=>i.alignmentBounds);return Lr(n,e,t)}parseJSON(e){if(!this.dataType.equals(w.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.series.flatMap(t=>t.parseJSON(e))}[Symbol.iterator](){return this.series.length===0?{next(){return{done:!0,value:void 0}}}:new ma(this.series)}}var vr,$r;let ma=class{constructor(e){l(this,"series"),l(this,"seriesIndex"),l(this,"internal"),l(this,vr,"MultiSeriesIterator"),this.series=e,this.seriesIndex=0,this.internal=e[0][Symbol.iterator]()}next(){const e=this.internal.next();return e.done===!1?e:this.seriesIndex===this.series.length-1?{done:!0,value:void 0}:(this.internal=this.series[++this.seriesIndex][Symbol.iterator](),this.next())}[($r=Symbol.iterator,vr=Symbol.toStringTag,$r)](){return this}},dt=class{constructor(e,t,n){l(this,"series"),l(this,"index"),l(this,"end"),this.series=e,this.end=n,this.index=t}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}};const xr=r=>{const e=r>>32n,t=r&0xffffffffn;return{domain:e,sample:t}},En=(r,e,t=".")=>{const n=r.split(t);return n.map((i,s)=>{const o=e(i,s,n);return o==null?null:typeof o=="string"?o:o.join(t)}).filter(i=>i!=null).join(t)},ir=(r,e,t={optional:!1,separator:"."})=>{t.separator??(t.separator=".");const{optional:n,getter:i=(u,h)=>u[h]}=t,s=e.split(t.separator);if(s.length===1&&s[0]==="")return r;let o=r;for(const u of s){const h=i(o,u);if(h==null){if(n)return null;throw new Error(`Path ${e} does not exist. ${u} is null`)}o=h}return o},wa=(r,e,t)=>{const n=e.split(".");let i=r;for(let s=0;s<n.length-1;s++){const o=n[s];i[o]??(i[o]={}),i=i[o]}try{i[n[n.length-1]]=t}catch(s){throw console.error("failed to set value",t,"at path",e,"on object",r),s}},ba=(r,e)=>{const t=e.split(".");let n=r;for(let i=0;i<t.length-1;i++){const s=t[i];if(n[s]==null)return;n=n[s]}if(Array.isArray(n)){const i=parseInt(t[t.length-1]);if(isNaN(i))return;n.splice(i,1);return}delete n[t[t.length-1]]},va=(r,e)=>{const t=r.split(".");return e<0?t[t.length+e]:t[e]},$a=(r,e)=>{try{return ir(r,e),!0}catch{return!1}},xa=(r,e)=>{if(e.length===0)return!0;const t=r.split("."),n=e.split(".");if(n.length>t.length)return!1;for(let i=0;i<n.length;i++){const s=t[i],o=n[i];if(o!=="*"&&s!==o)return!1}return!0};a.z.object({key:a.z.string(),value:a.z.string()});const Oa=a.z.record(a.z.union([a.z.number(),a.z.string(),a.z.symbol()]),a.z.unknown()),zn=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",Ta=zn(),An=["macOS","Windows","Linux"],Sa=["macos","windows","linux"],Ia={macos:"macOS",windows:"Windows",linux:"Linux"},Na=a.z.enum(An).or(a.z.enum(Sa).transform(r=>Ia[r])),Ua=()=>{if(typeof window>"u")return;const r=window.navigator.userAgent.toLowerCase();if(r.includes("mac"))return"macOS";if(r.includes("win"))return"Windows";if(r.includes("linux"))return"Linux"};let gt;const Ba=(r={})=>{const{force:e,default:t}=r;return e??gt??(gt=Ua(),gt??t)},Ea=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:An,RUNTIME:Ta,detect:zn,getOS:Ba,osZ:Na},Symbol.toStringTag,{value:"Module"}));var za=Object.defineProperty,Aa=(r,e,t)=>e in r?za(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ve=(r,e,t)=>Aa(r,typeof e!="symbol"?e+"":e,t);const Ma=(...r)=>r.map(Mn).join(""),Mn=r=>(r.endsWith("/")||(r+="/"),r.startsWith("/")&&(r=r.slice(1)),r),Ca=r=>r.endsWith("/")?r.slice(0,-1):r,Or=class Lt{constructor({host:e,port:t,protocol:n="",pathPrefix:i=""}){ve(this,"protocol"),ve(this,"host"),ve(this,"port"),ve(this,"path"),this.protocol=n,this.host=e,this.port=t,this.path=Mn(i)}replace(e){return new Lt({host:e.host??this.host,port:e.port??this.port,protocol:e.protocol??this.protocol,pathPrefix:e.pathPrefix??this.path})}child(e){return new Lt({...this,pathPrefix:Ma(this.path,e)})}toString(){return Ca(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}};ve(Or,"UNKNOWN",new Or({host:"unknown",port:0}));const La=-128,Ra=127,ja=a.z.number().int().min(La).max(Ra),ka=-32768,Da=32767,Pa=a.z.number().int().min(ka).max(Da),Fa=-2147483648,_a=2147483647,qa=a.z.number().int().min(Fa).max(_a),Wa=-9223372036854775808n,Ya=9223372036854775807n,Va=a.z.bigint().min(Wa).max(Ya),Za=255,Ha=a.z.number().int().min(0).max(Za),Ga=65535,Ka=a.z.number().int().min(0).max(Ga),Ja=4294967295,Xa=a.z.number().int().min(0).max(Ja),Qa=18446744073709551615n,eu=a.z.bigint().min(0n).max(Qa),Cn=r=>En(r,(e,t,n)=>{const i=t===n.length-1,s=!isNaN(parseInt(e)),o=!isNaN(parseInt(n[t+1]));return s&&(e="element"),i||o?e:[e,"shape"]}),Tr=(r,e)=>{if(r==null)return null;const t=r[e];return t==null&&typeof r=="object"&&"sourceType"in r?r.sourceType()[e]:t},tu=(r,e,t)=>ir(Tr(r,"shape"),Cn(e),{...t,getter:Tr}),ru=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:tu,getFieldSchemaPath:Cn,int16:Pa,int32:qa,int64:Va,int8:ja,uint16:Ka,uint32:Xa,uint64:eu,uint8:Ha},Symbol.toStringTag,{value:"Module"}));var nu=Object.defineProperty,iu=(r,e,t)=>e in r?nu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ee=(r,e,t)=>iu(r,typeof e!="symbol"?e+"":e,t);const su=2,ou=3,au=2,uu=(r,e)=>{if(Number.isNaN(r)||!Number.isFinite(r))return r;const t=Me(e);if(t==0)return r;let n;t>=1e3?n=su:t>=1?n=ou:n=Math.ceil(-Math.log10(t))+au;const i=10**n;return Math.round(r*i)/i},lu=Object.freeze(Object.defineProperty({__proto__:null,abs:Ar,add:Er,closeTo:ci,div:gi,equal:mt,max:di,min:zr,mult:Q,roundBySpan:uu,roundToNearestMagnitude:fi,sub:$e},Symbol.toStringTag,{value:"Module"}));a.z.object({baseInterval:O.z.optional(),maxRetries:a.z.number().optional(),scale:a.z.number().optional()});const hu=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,sr=a.z.string().regex(hu),se=a.z.number().min(0).max(255),cu=a.z.number().min(0).max(1),or=a.z.tuple([se,se,se,cu]),Ln=a.z.tuple([se,se,se]),fu=r=>Ce.safeParse(r).success,du=r=>or.safeParse(r).success,gu=r=>{if(r==null)return;const e=Ce.safeParse(r);if(e.success)return kn(e.data);if(typeof r=="string")return r;throw e.error},x=(r,e=1)=>{if(typeof r=="string")return Ou(r,e);if(Array.isArray(r)){if(r.length<3||r.length>4)throw new Error(`Invalid color: [${r.join(", ")}]`);return r.length===3?[...r,e]:r}throw new Error(`Invalid color: ${JSON.stringify(r)}`)},Rn=(r,e)=>{if(r==null||e==null)return!1;const t=x(r),n=x(e);return t.every((i,s)=>i===n[s])},jn=r=>{if(r==null)return;const[e,t,n,i]=x(r);return`#${Pe(e)}${Pe(t)}${Pe(n)}${i===1?"":Pe(i*255)}`},kn=r=>{const[e,t,n,i]=x(r);return`rgba(${e}, ${t}, ${n}, ${i})`},pu=r=>`rgb(${Dn(r)})`,Dn=r=>{const[e,t,n]=x(r);return`${e}, ${t}, ${n}`},yu=r=>[...ar(r),Ie(r)],ar=r=>[Oe(r)/255,Te(r)/255,Se(r)/255],Oe=r=>x(r)[0],Te=r=>x(r)[1],Se=r=>x(r)[2],Ie=r=>x(r)[3],mu=r=>Rn(ur,r),wu=r=>Iu(x(r)),bu=(r,e)=>{const[t,n,i]=x(r);if(e>100)throw new Error(`Color opacity must be between 0 and 100, got ${e}`);return e>1&&(e/=100),[t,n,i,e]},Ke=r=>{const[e,t,n]=ar(r).map(i=>i<=.03928?i/12.92:((i+.055)/1.055)**2.4);return Number((.2126*e+.7152*t+.0722*n).toFixed(3))},vu=r=>{const[e,t,n]=ar(r);return 1-(Math.max(e,t,n)-Math.min(e,t,n))},Rt=(r,e)=>{const t=x(r),n=x(e),i=Ke(t),s=Ke(n);return(Math.max(i,s)+.5)/(Math.min(i,s)+.5)},$u=(r,...e)=>{if(e.length===0)throw new Error("[Color.pickByContrast] - must provide at least one color");const t=x(r),[n]=e.map(i=>x(i)).sort((i,s)=>Rt(t,s)-Rt(t,i));return n},Pn=r=>Ke(r)<.5,xu=r=>!Pn(r),Ce=a.z.union([sr,or,Ln]).transform(r=>x(r)),Ou=(r,e=1)=>{if(!sr.safeParse(r).success)throw new Error(`Invalid hex color: ${r}`);return r=Tu(r),[Fe(r,0),Fe(r,2),Fe(r,4),r.length===8?Fe(r,6)/255:e]},ur=[0,0,0,0],Pe=r=>Math.floor(r).toString(16).padStart(2,"0"),Fe=(r,e)=>parseInt(r.slice(e,e+2),16),Tu=r=>r.startsWith("#")?r.slice(1):r,Su=r=>{let[e,t,n]=r;const i=r[3];e/=360,t/=100,n/=100;let s,o,u;if(t===0)s=o=u=n;else{const h=n<.5?n*(1+t):n+t-n*t,f=2*n-h;s=pt(f,h,e+1/3),o=pt(f,h,e),u=pt(f,h,e-1/3)}return[Math.round(s*255),Math.round(o*255),Math.round(u*255),i]},pt=(r,e,t)=>(t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r),Iu=r=>{let[e,t,n]=r;const i=r[3];e/=255,t/=255,n/=255;const s=Math.max(e,t,n),o=Math.min(e,t,n);let u,h,f=(s+o)/2;if(s===o)u=h=0;else{const g=s-o;h=f>.5?g/(2-s-o):g/(s+o),s===e?u=(t-n)/g+(t<n?6:0):s===t?u=(n-e)/g+2:u=(e-t)/g+4,u/=6}return u*=360,h*=100,f*=100,[Math.round(u),Math.round(h),Math.round(f),i]},Fn=a.z.union([sr,or,a.z.string(),Ln]),Nu=x("#000000"),Uu=x("#ffffff"),_n=a.z.object({key:a.z.string(),color:Fn,position:a.z.number(),switched:a.z.boolean().optional()}),Bu=a.z.array(_n),Eu=(r,e)=>{if(r.length===0)return ur;if(r=r.slice().sort((t,n)=>t.position-n.position),e<=r[0].position)return x(r[0].color);if(e>=r[r.length-1].position)return x(r[r.length-1].color);for(let t=0;t<r.length-1;t++){const n=r[t],i=r[t+1];if(e>=n.position&&e<=i.position){if(e===n.position)return x(n.color);if(e===i.position)return x(i.color);const s=(e-n.position)/(i.position-n.position),o=x(n.color),u=x(i.color),h=Math.round(Oe(o)+s*(Oe(u)-Oe(o))),f=Math.round(Te(o)+s*(Te(u)-Te(o))),g=Math.round(Se(o)+s*(Se(u)-Se(o))),d=Ie(o)+s*(Ie(u)-Ie(o));return x([h,f,g,d])}}return x(r[r.length-1].color)},zu=a.z.object({key:a.z.string(),name:a.z.string(),color:Ce}),Au=a.z.object({key:a.z.string(),name:a.z.string(),swatches:a.z.array(zu)}),qn=r=>{const e=Ce.safeParse(r);if(e.success)return jn(e.data);if(typeof r=="object"&&r!=null){const t=Array.isArray(r)?[]:{};for(const n of Object.keys(r))t[n]=qn(r[n]);return t}return r},Mu=Object.freeze(Object.defineProperty({__proto__:null,BLACK:Nu,WHITE:Uu,ZERO:ur,aValue:Ie,bValue:Se,colorZ:Ce,construct:x,contrast:Rt,crudeZ:Fn,cssString:gu,equals:Rn,fromGradient:Eu,fromHSLA:Su,gValue:Te,gradientZ:Bu,grayness:vu,hex:jn,hsla:wu,isColor:du,isCrude:fu,isDark:Pn,isLight:xu,isZero:mu,luminance:Ke,paletteZ:Au,pickByContrast:$u,rValue:Oe,rgbCSS:pu,rgbString:Dn,rgba1:yu,rgbaCSS:kn,setAlpha:bu,stopZ:_n,transformColorsToHex:qn},Symbol.toStringTag,{value:"Module"})),Wn=a.z.number().int().min(0).max(255),Yn=255,Vn=0,Cu={lower:Vn,upper:Yn+1},Zn=a.z.object({name:a.z.string(),key:a.z.string()}),Ae=r=>a.z.object({subject:Zn,resource:r,authority:Wn}),Lu=(...r)=>e=>e.filter(t=>{let n=!1;return t.to!=null&&(n=r.includes(t.to.resource)),t.from!=null&&!n&&(n=r.includes(t.from.resource)),n}),Hn=a.z.object({from:Ae(a.z.any()),to:a.z.null()}),Gn=a.z.object({from:a.z.null(),to:Ae(a.z.any())}),Ru=a.z.union([Hn,Gn,a.z.object({from:Ae(a.z.any()),to:Ae(a.z.any())})]),ju=Object.freeze(Object.defineProperty({__proto__:null,ABSOLUTE_AUTHORITY:Yn,AUTHORITY_BOUNDS:Cu,ZERO_AUTHORITY:Vn,acquireZ:Gn,authorityZ:Wn,filterTransfersByChannelKey:Lu,releaseZ:Hn,stateZ:Ae,subjectZ:Zn,transferZ:Ru},Symbol.toStringTag,{value:"Module"})),ku=r=>Object.getOwnPropertySymbols(globalThis).includes(r),Du=(r,e)=>{const t=Symbol.for(r);if(!ku(t)){const n=e();Object.defineProperty(globalThis,t,{value:n})}return()=>globalThis[t]},Pu=r=>e=>e!=null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"?e.type.startsWith(r):e instanceof Error?e.message.startsWith(r):typeof e!="string"?!1:e.startsWith(r),lr=r=>{var e;return e=class extends Error{constructor(t,n){super(t,n),ee(this,"discriminator",e.discriminator),ee(this,"type",e.TYPE),ee(this,"matches",e.matches),this.name=e.TYPE}static sub(t){return lr(`${r}.${t}`)}},ee(e,"discriminator","FreighterError"),ee(e,"TYPE",r),ee(e,"matches",Pu(r)),e},Fu=r=>{if(r==null||typeof r!="object")return!1;const e=r;if(e.discriminator!=="FreighterError")return!1;if(!("type"in e))throw new Error(`Freighter error is missing its type property: ${JSON.stringify(e)}`);return!0},ce="unknown",Sr="nil";class _u{constructor(){ee(this,"providers",[])}register(e){this.providers.push(e)}encode(e){if(e==null)return{type:Sr,data:""};if(Fu(e))for(const t of this.providers){const n=t.encode(e);if(n!=null)return n}if(e instanceof Error)return{type:ce,data:e.message};if(typeof e=="string")return{type:ce,data:e};try{return{type:ce,data:JSON.stringify(e)}}catch{return{type:ce,data:"unable to encode error information"}}}decode(e){if(e==null||e.type===Sr)return null;if(e.type===ce)return new Ir(e.data);for(const t of this.providers){const n=t.decode(e);if(n!=null)return n}return new Ir(e.data)}}Du("synnax-error-registry",()=>new _u);class Ir extends lr("unknown"){}a.z.object({type:a.z.string(),data:a.z.string()});class Sl extends lr("canceled"){}const qu=r=>r?-1:1;a.object({jsonrpc:a.string(),id:a.number().optional(),method:a.string().optional(),params:a.unknown().optional(),result:a.unknown().optional()});const jt=a.z.string().regex(/^\d+\.\d+\.\d+$/),Le=(r,e,t={})=>{t.checkMajor??(t.checkMajor=!0),t.checkMinor??(t.checkMinor=!0),t.checkPatch??(t.checkPatch=!0);const n=jt.parse(r),i=jt.parse(e),[s,o,u]=n.split(".").map(Number),[h,f,g]=i.split(".").map(Number);if(t.checkMajor){if(s<h)return Ve;if(s>h)return Ze}if(t.checkMinor){if(o<f)return Ve;if(o>f)return Ze}if(t.checkPatch){if(u<g)return Ve;if(u>g)return Ze}return ae},Wu=(r,e,t={})=>xn(Le(r,e,t)),Kn=(r,e,t={})=>$n(Le(r,e,t)),Yu=(r,e,t={})=>vn(Le(r,e,t)),Vu=({name:r,migrate:e})=>t=>{try{const n=e(t);return console.log(`${r} migrated: ${t.version} -> ${n.version}`),n}catch(n){throw console.log(`${r} failed to migrate from ${t.version}`),console.error(n),n}},Zu=({name:r,migrations:e,targetSchema:t,defaultVersion:n,def:i})=>{const s=Object.keys(e).sort(Le).pop();if(s==null)return f=>{if(f.version??(f.version=n),f.version!==i.version)return console.log(`${r} version ${f.version} is newer than latest version of ${i.version}.
14
+ Returning default instead.
15
+ `),i;try{return t!=null?t.parse(f):f}catch(g){return console.log(`${r} failed to parse default. Exiting with default`),console.error(g),i}};const o=Object.keys(e).length;let u=!1;const h=f=>{try{if(o===0||Kn(f.version,s))return console.log(u?`${r} ${f.version} now up to date`:`${r} version ${f.version} is up to date with target version ${i.version}`),f;const g=f.version,d=e[g],B=d(f);return u=!0,h(B)}catch(g){return console.log(`${r} failed to migrate from ${f.version} to ${s}`),console.error(g),i}};return f=>{try{if(f.version==null)if(n!=null)console.log(`${r} version is null. Setting version to default of ${n}`),f.version=n;else return console.log(`${r} version is null and no default version set. Exiting with default`),i;return h(f)}catch(g){return console.log(`${r} failed to parse final result. Exiting with default`),console.error(g),i}}},Hu=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:Le,createMigration:Vu,migrator:Zu,semVerNewer:Kn,semVerOlder:Yu,semVerZ:jt,versionsEqual:Wu},Symbol.toStringTag,{value:"Module"})),Jn=["standard","scientific","engineering"],Gu=a.z.enum(Jn),Ku=(r,e,t)=>{if(Number.isNaN(r))return"NaN";if(r===1/0)return"∞";if(r===-1/0)return"-∞";if(t==="standard")return r.toFixed(e);if(r===0)return e===0?"0ᴇ0":`0.${"0".repeat(e)}ᴇ0`;let n;return t==="scientific"?n=Math.floor(Math.log10(Math.abs(r))):n=Math.floor(Math.log10(Math.abs(r))/3)*3,`${(r/10**n).toFixed(e)}ᴇ${n}`},Ju=Object.freeze(Object.defineProperty({__proto__:null,NOTATIONS:Jn,notationZ:Gu,stringifyNumber:Ku},Symbol.toStringTag,{value:"Module"})),Xu=r=>{if(r===void 0||typeof r=="string"||typeof r=="number")return r;if(r.toString===void 0)throw new Error("invalid renderer");return r.toString()},Qu=r=>Array.isArray(r)?[...r]:typeof r=="object"&&r!==null?{...r}:r,el=new Error("request for lock canceled");var tl=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function u(g){try{f(n.next(g))}catch(d){o(d)}}function h(g){try{f(n.throw(g))}catch(d){o(d)}}function f(g){g.done?s(g.value):i(g.value).then(u,h)}f((n=n.apply(r,e||[])).next())})};class rl{constructor(e,t=el){this._value=e,this._cancelError=t,this._queue=[],this._weightedWaiters=[]}acquire(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((n,i)=>{const s={resolve:n,reject:i,weight:e,priority:t},o=Xn(this._queue,u=>t<=u.priority);o===-1&&e<=this._value?this._dispatchItem(s):this._queue.splice(o+1,0,s)})}runExclusive(e){return tl(this,arguments,void 0,function*(t,n=1,i=0){const[s,o]=yield this.acquire(n,i);try{return yield t(s)}finally{o()}})}waitForUnlock(e=1,t=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,t)?Promise.resolve():new Promise(n=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),nl(this._weightedWaiters[e-1],{resolve:n,priority:t})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const t=this._value;this._value-=e.weight,e.resolve([t,this._newReleaser(e.weight)])}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){const t=this._weightedWaiters[e-1];t&&(t.forEach(n=>n.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let t=this._value;t>0;t--){const n=this._weightedWaiters[t-1];if(!n)continue;const i=n.findIndex(s=>s.priority<=e);(i===-1?n:n.splice(0,i)).forEach(s=>s.resolve())}}}_couldLockImmediately(e,t){return(this._queue.length===0||this._queue[0].priority<t)&&e<=this._value}}function nl(r,e){const t=Xn(r,n=>e.priority<=n.priority);r.splice(t+1,0,e)}function Xn(r,e){for(let t=r.length-1;t>=0;t--)if(e(r[t]))return t;return-1}var il=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function u(g){try{f(n.next(g))}catch(d){o(d)}}function h(g){try{f(n.throw(g))}catch(d){o(d)}}function f(g){g.done?s(g.value):i(g.value).then(u,h)}f((n=n.apply(r,e||[])).next())})};class sl{constructor(e){this._semaphore=new rl(1,e)}acquire(){return il(this,arguments,void 0,function*(e=0){const[,t]=yield this._semaphore.acquire(1,e);return t})}runExclusive(e,t=0){return this._semaphore.runExclusive(()=>e(),1,t)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class lt extends sl{static new(e){return new lt(e)}constructor(e){super(),Object.assign(this,e)}}const ol=r=>new lt(r),al=Object.freeze(Object.defineProperty({__proto__:null,mutex:lt,newMutex:ol},Symbol.toStringTag,{value:"Module"}));class ul{constructor(e=""){Re(this,"rows",[]);Re(this,"columns",[]);Re(this,"prefix");this.prefix=e}row(e,t,n){const{prefix:i}=this;return this.rows.push({startLabel:i+e,endLabel:i+t,size:n}),this}col(e,t,n){const{prefix:i}=this;return this.columns.push({startLabel:i+e,endLabel:i+t,size:n}),this}build(){return{display:"grid",gridTemplateRows:this.rows.map((e,t)=>{let n=t===0?"[":"";return n+=`${e.startLabel}] ${e.size}${typeof e.size=="number"?"px":""} [${e.endLabel}`,n+=t===this.rows.length-1?"]":"",n}).join(" "),gridTemplateColumns:this.columns.map((e,t)=>{let n=t===0?"[":"";return n+=`${e.startLabel}] ${e.size}${typeof e.size=="number"?"px":""} [${e.endLabel}`,n+=t===this.columns.length-1?"]":"",n}).join(" ")}}}const ll=(r,e)=>Object.entries(e).forEach(([t,n])=>n!=null&&r.style.setProperty(t,`${n}`)),hl=(r,e)=>Array.from(r.style).forEach(t=>{t.startsWith(e)&&r.style.removeProperty(t)}),cl=r=>{const e=rr(r);return e.visible=t=>e.M(t?"visible":"hidden"),e.expanded=t=>e.M(t?"expanded":"collapsed"),e.loc=t=>e.M(Yr.construct(t)),e.disabled=t=>t===!0&&e.M("disabled"),e.align=t=>e.M(t),e.dir=t=>t!=null&&e.M(jr.construct(t)),e.size=t=>typeof t=="string"&&e.M(t),e.sharp=t=>t!==!1&&e.M("sharp"),e.rounded=t=>t!==!1&&e.M("rounded"),e.bordered=t=>typeof t=="boolean"?t&&e.M("bordered"):t!=null?e.M(`bordered-${t.toString()}`):e.M("bordered"),e.selected=t=>t&&e.M("selected"),e.altColor=t=>t&&e.M("alt-color"),e.editable=t=>t&&e.M("editable"),e.noSelect=e.M("no-select"),e.noWrap=t=>t&&e.M("no-wrap"),e.applyVars=ll,e.removeVars=hl,e.newGridBuilder=t=>new ul(t),e.dropRegion=t=>t&&e.B("haul-drop-region"),e.px=t=>`${t}px`,e.inheritDims=(t=!0)=>t&&e.M("inherit-dims"),e.shade=t=>t!=null&&e.M(`shade-${t}`),e.shadeVar=t=>{if(t!=null)return`var(--${r}-gray-l${t})`},e.levelSizeVar=t=>`var(--${r}-${t}-size)`,e},fl=cl("pluto");exports.$=_r;exports.$$1=At;exports.$t=Ms;exports.$t$1=ya;exports.A=K;exports.B=it;exports.Bt=qu;exports.CSS=fl;exports.D=qr;exports.Dt=ju;exports.Et=nn;exports.F=ea;exports.G=Ui;exports.Gt=Qu;exports.Ht=Hu;exports.J=us;exports.Jt=Ju;exports.K=Yr;exports.Kt=al;exports.L=ru;exports.Lt=oa;exports.Mt=sn;exports.O=O;exports.P=Dr;exports.R=ze;exports.S=Ea;exports.T=oe;exports.Y=an;exports.Yt=Xu;exports._=Ws;exports.b=ro;exports.bt=rn;exports.c=ir;exports.c$1=Vo;exports.c$2=T;exports.clsx=ln;exports.d=Di;exports.f=wa;exports.f$1=_;exports.g=jr;exports.g$1=$a;exports.g$2=w;exports.h=ba;exports.i=et;exports.k=Nn;exports.m=$;exports.m$1=Oa;exports.newBEM=rr;exports.o=at;exports.p=va;exports.qt=ua;exports.qt$1=lu;exports.t=W;exports.u=En;exports.w=Pr;exports.w$1=q;exports.w$2=Zo;exports.x=nt;exports.y=xa;exports.y$1=D;exports.y$2=z;exports.zt=Mu;
package/dist/css.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./css-Cj2UCGXB.cjs"),t=require("./units-DjoHPrqM.cjs");exports.CSS=e.CSS;exports.newBEM=e.newBEM;exports.createHexOpacityVariants=t.createHexOpacityVariants;exports.unitProperty=t.unitProperty;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./css-hg3QdDDt.cjs"),t=require("./units-CKKNRQlP.cjs");exports.CSS=e.CSS;exports.newBEM=e.newBEM;exports.createHexOpacityVariants=t.createHexOpacityVariants;exports.unitProperty=t.unitProperty;
package/dist/css.js CHANGED
@@ -1,5 +1,5 @@
1
- import { C as e, n as t } from "./css-Dyt-QnKy.js";
2
- import { c as s, u as n } from "./units-MBd0L3ff.js";
1
+ import { C as e, n as t } from "./css-B7c7_G5h.js";
2
+ import { c as s, u as n } from "./units-a8CggrTe.js";
3
3
  export {
4
4
  e as CSS,
5
5
  s as createHexOpacityVariants,
@@ -0,0 +1 @@
1
+ "use strict";const i=require("./css-hg3QdDDt.cjs"),b=e=>JSON.parse(JSON.stringify(e)),g=(e,...s)=>(s.forEach(a=>{let t=e;const f=a.split(".");f.forEach((n,r)=>{r===f.length-1?delete t[n]:n in t&&(t=t[n])})}),e),j=(e,s,a="")=>{const t={},f=(n,r,l)=>{if(typeof n!=typeof r||n===null||r===null){t[l]=[n,r];return}if(typeof n=="object"&&typeof r=="object")if(Array.isArray(n)&&Array.isArray(r)){if(n.length!==r.length){t[l]=[n,r];return}for(let o=0;o<n.length;o++)f(n[o],r[o],`${l}[${o}]`)}else new Set([...Object.keys(n),...Object.keys(r)]).forEach(o=>{f(n[o],r[o],l!==""?`${l}.${o}`:o)});else n!==r&&(t[l]=[n,r])};return f(e,s,a),t},u=(e,s)=>{const a=Array.isArray(e),t=Array.isArray(s);if(a!==t)return!1;if(a&&t){const r=e,l=s;if(r.length!==l.length)return!1;for(let o=0;o<r.length;o++)if(!u(r[o],l[o]))return!1;return!0}if(e==null||s==null||typeof e!="object"||typeof s!="object")return e===s;if("equals"in e)return e.equals(s);const f=Object.keys(e),n=Object.keys(s);if(f.length!==n.length)return!1;for(const r of f){const l=e[r],o=s[r];if(typeof l=="object"&&typeof o=="object"){if(!u(l,o))return!1}else if(l!==o)return!1}return!0},p=(e,s)=>{if(typeof e!="object"||e==null)return e===s;const a=Object.keys(e),t=Object.keys(s);if(t.length>a.length)return!1;for(const f of t){const n=e[f],r=s[f];if(typeof n=="object"&&typeof r=="object"){if(!p(n,r))return!1}else if(n!==r)return!1}return!0},y=(e,...s)=>{if(s.length===0)return e;const a=s.shift();if(i.o(e)&&i.o(a))for(const t in a)try{i.o(a[t])?(t in e||Object.assign(e,{[t]:{}}),y(e[t],a[t])):Object.assign(e,{[t]:a[t]})}catch(f){throw f instanceof TypeError?new TypeError(`.${t}: ${f.message}`):f}return y(e,...s)},O=(e,s,a)=>{const t=(f,n,r)=>{for(const l in n){const o=n[l],c=r.shape;if(c!=null&&c[l]){const h=c[l].safeParse(o);h.success&&(f[l]=h.data)}else typeof o=="object"&&!Array.isArray(o)&&o!==null&&r&&r.shape&&r.shape[l]&&(f[l]||(f[l]={}),t(f[l],o,r.shape[l]))}return f};return t({...e},s,a)},A=Object.freeze(Object.defineProperty({__proto__:null,copy:b,deleteD:g,difference:j,element:i.p,equal:u,get:i.c,has:i.g$1,override:y,overrideValidItems:O,partialEqual:p,pathsMatch:i.y,remove:i.h,set:i.f,transformPath:i.u},Symbol.toStringTag,{value:"Module"}));exports._=A;
@@ -0,0 +1,102 @@
1
+ import { u as b, f as g, h as j, y as O, a as A, c as $, p as d, o as c } from "./css-B7c7_G5h.js";
2
+ const m = (e) => JSON.parse(JSON.stringify(e)), k = (e, ...s) => (s.forEach((f) => {
3
+ let t = e;
4
+ const a = f.split(".");
5
+ a.forEach((n, r) => {
6
+ r === a.length - 1 ? delete t[n] : n in t && (t = t[n]);
7
+ });
8
+ }), e), E = (e, s, f = "") => {
9
+ const t = {}, a = (n, r, l) => {
10
+ if (typeof n != typeof r || n === null || r === null) {
11
+ t[l] = [n, r];
12
+ return;
13
+ }
14
+ if (typeof n == "object" && typeof r == "object")
15
+ if (Array.isArray(n) && Array.isArray(r)) {
16
+ if (n.length !== r.length) {
17
+ t[l] = [n, r];
18
+ return;
19
+ }
20
+ for (let o = 0; o < n.length; o++) a(n[o], r[o], `${l}[${o}]`);
21
+ } else
22
+ (/* @__PURE__ */ new Set([...Object.keys(n), ...Object.keys(r)])).forEach((o) => {
23
+ a(n[o], r[o], l !== "" ? `${l}.${o}` : o);
24
+ });
25
+ else n !== r && (t[l] = [n, r]);
26
+ };
27
+ return a(e, s, f), t;
28
+ }, u = (e, s) => {
29
+ const f = Array.isArray(e), t = Array.isArray(s);
30
+ if (f !== t) return !1;
31
+ if (f && t) {
32
+ const r = e, l = s;
33
+ if (r.length !== l.length) return !1;
34
+ for (let o = 0; o < r.length; o++) if (!u(r[o], l[o])) return !1;
35
+ return !0;
36
+ }
37
+ if (e == null || s == null || typeof e != "object" || typeof s != "object")
38
+ return e === s;
39
+ if ("equals" in e) return e.equals(s);
40
+ const a = Object.keys(e), n = Object.keys(s);
41
+ if (a.length !== n.length) return !1;
42
+ for (const r of a) {
43
+ const l = e[r], o = s[r];
44
+ if (typeof l == "object" && typeof o == "object") {
45
+ if (!u(l, o)) return !1;
46
+ } else if (l !== o) return !1;
47
+ }
48
+ return !0;
49
+ }, h = (e, s) => {
50
+ if (typeof e != "object" || e == null) return e === s;
51
+ const f = Object.keys(e), t = Object.keys(s);
52
+ if (t.length > f.length) return !1;
53
+ for (const a of t) {
54
+ const n = e[a], r = s[a];
55
+ if (typeof n == "object" && typeof r == "object") {
56
+ if (!h(n, r)) return !1;
57
+ } else if (n !== r) return !1;
58
+ }
59
+ return !0;
60
+ }, y = (e, ...s) => {
61
+ if (s.length === 0) return e;
62
+ const f = s.shift();
63
+ if (c(e) && c(f))
64
+ for (const t in f)
65
+ try {
66
+ c(f[t]) ? (t in e || Object.assign(e, { [t]: {} }), y(e[t], f[t])) : Object.assign(e, { [t]: f[t] });
67
+ } catch (a) {
68
+ throw a instanceof TypeError ? new TypeError(`.${t}: ${a.message}`) : a;
69
+ }
70
+ return y(e, ...s);
71
+ }, q = (e, s, f) => {
72
+ const t = (a, n, r) => {
73
+ for (const l in n) {
74
+ const o = n[l], i = r.shape;
75
+ if (i != null && i[l]) {
76
+ const p = i[l].safeParse(o);
77
+ p.success && (a[l] = p.data);
78
+ } else typeof o == "object" && !Array.isArray(o) && o !== null && r && r.shape && r.shape[l] && (a[l] || (a[l] = {}), t(a[l], o, r.shape[l]));
79
+ }
80
+ return a;
81
+ };
82
+ return t({ ...e }, s, f);
83
+ }, _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
84
+ __proto__: null,
85
+ copy: m,
86
+ deleteD: k,
87
+ difference: E,
88
+ element: d,
89
+ equal: u,
90
+ get: $,
91
+ has: A,
92
+ override: y,
93
+ overrideValidItems: q,
94
+ partialEqual: h,
95
+ pathsMatch: O,
96
+ remove: j,
97
+ set: g,
98
+ transformPath: b
99
+ }, Symbol.toStringTag, { value: "Module" }));
100
+ export {
101
+ _
102
+ };
@@ -0,0 +1 @@
1
+ "use strict";const i=require("./css-hg3QdDDt.cjs");let e=null;const u=()=>(e??(e=document.createElement("canvas")),e),c=(t,a,n)=>{if(i.S.RUNTIME==="node")return{width:0,height:0};n??(n=u().getContext("2d")),n.font=a;const o=n.measureText(t);return s(o)},s=t=>({width:Math.trunc(Math.abs(t.actualBoundingBoxLeft)+Math.abs(t.actualBoundingBoxRight)),height:Math.trunc(Math.abs(t.actualBoundingBoxAscent)+Math.abs(t.actualBoundingBoxDescent))});exports.dimensions=c;exports.dimensionsFromMetrics=s;
@@ -0,0 +1,19 @@
1
+ import { S as s } from "./css-B7c7_G5h.js";
2
+ let a = null;
3
+ const u = () => (a ?? (a = document.createElement("canvas")), a), h = (t, e, n) => {
4
+ if (s.RUNTIME === "node") return { width: 0, height: 0 };
5
+ n ?? (n = u().getContext("2d")), n.font = e;
6
+ const o = n.measureText(t);
7
+ return i(o);
8
+ }, i = (t) => ({
9
+ width: Math.trunc(
10
+ Math.abs(t.actualBoundingBoxLeft) + Math.abs(t.actualBoundingBoxRight)
11
+ ),
12
+ height: Math.trunc(
13
+ Math.abs(t.actualBoundingBoxAscent) + Math.abs(t.actualBoundingBoxDescent)
14
+ )
15
+ });
16
+ export {
17
+ i as a,
18
+ h as d
19
+ };
package/dist/dropdown.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Dropdown-C7Im-qW-.cjs");exports.Dropdown=o.Dropdown;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Dropdown-CaGzfZRa.cjs");exports.Dropdown=o.Dropdown;
package/dist/dropdown.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as p } from "./Dropdown-4Cti-bbQ.js";
1
+ import { D as p } from "./Dropdown-nw8kRSbl.js";
2
2
  export {
3
3
  p as Dropdown
4
4
  };
@@ -0,0 +1,11 @@
1
+ "use strict";var V=Object.defineProperty;var K=(o,t,e)=>t in o?V(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var h=(o,t,e)=>K(o,typeof t!="symbol"?t+"":t,e);const n=require("./css-hg3QdDDt.cjs"),m=require("zod"),f=require("./provider-XPRFhwnl.cjs"),k=require("./dimensions-Cz-q0Mok.cjs"),F=m.z.object({include:m.z.string().array().optional(),exclude:m.z.string().array().optional(),level:m.z.enum(f.g.LOG_LEVELS).optional().default("info")}),A="alamos-provider";class S extends f.Composite{constructor(){super(...arguments);h(this,"schema",F)}afterUpdate(e){if(e.getOptional(A)!=null)return;const i=[],{include:r,exclude:a,level:c}=this.state;(r!=null||a!=null)&&i.push(f.g.logLevelKeyFiler({include:r,exclude:a})),c!=null&&i.push(f.g.logThresholdFilter(c)),i.length===0&&i.push(()=>!1),this.internal.ins=new f.g.Instrumentation({key:"aether",logger:new f.g.Logger({filters:i})}),e.set(A,this.internal.ins)}}h(S,"TYPE","alamos.Provider");const q=(o,t)=>{const e=o.get(A);if(e==null)throw new Error("No instrumentation provider");return t==null?e:e.child(t)},Z={[S.TYPE]:S},C=(o,t)=>n.$t.construct(n.$t.left(o)-t.x,n.$t.top(o)-t.y,n.$t.width(o)+t.x*2,n.$t.height(o)+t.y*2);class T{constructor(t,e,s,i=n.b.XY.IDENTITY){h(this,"scale_");h(this,"wrapped");h(this,"atlasRegistry");h(this,"cachedFont",null);h(this,"cachedFillStyle",null);h(this,"cachedStrokeStyle",null);h(this,"cachedLineWidth",null);h(this,"cachedGlobalAlpha",null);h(this,"cachedTextAlign",null);h(this,"cachedTextBaseline",null);h(this,"cachedLineCap",null);h(this,"cachedLineJoin",null);h(this,"cachedMiterLimit",null);h(this,"dpr");this.wrapped=t,this.scale_=i,this.atlasRegistry=e,this.dpr=s}get fontStretch(){return this.wrapped.fontStretch}set fontStretch(t){this.wrapped.fontStretch=t}get fontVariantCaps(){return this.wrapped.fontVariantCaps}set fontVariantCaps(t){this.wrapped.fontVariantCaps=t}isContextLost(){return this.wrapped.isContextLost()}get wordSpacing(){return this.wrapped.wordSpacing}set wordSpacing(t){this.wrapped.wordSpacing=t}get letterSpacing(){return this.wrapped.letterSpacing}set letterSpacing(t){this.wrapped.letterSpacing=t}get textRendering(){return this.wrapped.textRendering}set textRendering(t){this.wrapped.textRendering=t}reset(){this.wrapped.reset()}applyScale(t){return new T(this,this.atlasRegistry,this.dpr,t)}get canvas(){return this.wrapped.canvas}get miterLimit(){return this.cachedMiterLimit??this.wrapped.miterLimit}set miterLimit(t){const e=this.scale_.x.dim(t);e!==this.cachedMiterLimit&&(this.cachedMiterLimit=e,this.wrapped.miterLimit=e)}get globalAlpha(){return this.cachedGlobalAlpha??this.wrapped.globalAlpha}set globalAlpha(t){t!==this.cachedGlobalAlpha&&(this.cachedGlobalAlpha=t,this.wrapped.globalAlpha=t)}get globalCompositeOperation(){return this.wrapped.globalCompositeOperation}set globalCompositeOperation(t){this.wrapped.globalCompositeOperation=t}get fillStyle(){return this.cachedFillStyle??this.wrapped.fillStyle}set fillStyle(t){t!==this.cachedFillStyle&&(this.cachedFillStyle=t,this.wrapped.fillStyle=t)}get strokeStyle(){return this.cachedStrokeStyle??this.wrapped.strokeStyle}set strokeStyle(t){t!==this.cachedStrokeStyle&&(this.cachedStrokeStyle=t,this.wrapped.strokeStyle=t)}drawImage(t,e,s,i,r,a,c,p,d){this.wrapped.drawImage(t,e,s,i,r,a!=null?this.scale_.x.pos(a):a,c!=null?this.scale_.y.pos(c):c,p!=null?this.scale_.x.dim(p):p,d!=null?this.scale_.y.dim(d):d)}beginPath(){this.wrapped.beginPath()}clip(t,e){this.wrapped.clip(t,e)}fill(t,e){if(t==null)return this.wrapped.fill();this.wrapped.fill(t,e)}isPointInPath(t,e,s,i){return this.wrapped.isPointInPath(t,e,s,i)}isPointInStroke(t,e,s){return this.wrapped.isPointInStroke(t,e,s)}stroke(t){if(t==null)return this.wrapped.stroke();this.wrapped.stroke(t)}createConicGradient(t,e,s){return this.wrapped.createConicGradient(t,e,s)}createLinearGradient(t,e,s,i){return this.wrapped.createLinearGradient(t,e,s,i)}createPattern(t,e){return this.wrapped.createPattern(t,e)}createRadialGradient(t,e,s,i,r,a){return this.wrapped.createRadialGradient(t,e,s,i,r,a)}get filter(){return this.wrapped.filter}set filter(t){this.wrapped.filter=t}createImageData(t,e,s){return this.wrapped.createImageData(t,e,s)}getImageData(t,e,s,i,r){return this.wrapped.getImageData(t,e,s,i,r)}putImageData(t,e,s,i,r,a,c){this.wrapped.putImageData(t,e,s,i,r,a,c)}get imageSmoothingEnabled(){return this.wrapped.imageSmoothingEnabled}set imageSmoothingEnabled(t){this.wrapped.imageSmoothingEnabled=t}get imageSmoothingQuality(){return this.wrapped.imageSmoothingQuality}set imageSmoothingQuality(t){this.wrapped.imageSmoothingQuality=t}arc(t,e,s,i,r,a){this.wrapped.arc(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),i,r,a)}arcTo(t,e,s,i,r){this.wrapped.arcTo(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.pos(s),this.scale_.y.pos(i),this.scale_.x.dim(r))}bezierCurveTo(t,e,s,i,r,a){this.wrapped.bezierCurveTo(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.pos(s),this.scale_.y.pos(i),this.scale_.x.pos(r),this.scale_.y.pos(a))}closePath(){this.wrapped.closePath()}ellipse(t,e,s,i,r,a,c,p){this.wrapped.ellipse(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i),r,a,c,p)}lineTo(t,e){this.wrapped.lineTo(this.scale_.x.pos(t),this.scale_.y.pos(e))}moveTo(t,e){this.wrapped.moveTo(this.scale_.x.pos(t),this.scale_.y.pos(e))}quadraticCurveTo(t,e,s,i){this.wrapped.quadraticCurveTo(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.pos(s),this.scale_.y.pos(i))}rect(t,e,s,i){this.wrapped.rect(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i))}roundRect(t,e,s,i,r){this.wrapped.roundRect(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i),typeof r=="number"?this.scale_.x.dim(r):r)}get lineCap(){return this.cachedLineCap??this.wrapped.lineCap}set lineCap(t){t!==this.cachedLineCap&&(this.cachedLineCap=t,this.wrapped.lineCap=t)}get lineDashOffset(){return this.wrapped.lineDashOffset}set lineDashOffset(t){this.wrapped.lineDashOffset=this.scale_.x.dim(t)}get lineJoin(){return this.cachedLineJoin??this.wrapped.lineJoin}set lineJoin(t){t!==this.cachedLineJoin&&(this.cachedLineJoin=t,this.wrapped.lineJoin=t)}get lineWidth(){return this.cachedLineWidth??this.wrapped.lineWidth}set lineWidth(t){const e=this.scale_.x.dim(t);e!==this.cachedLineWidth&&(this.cachedLineWidth=e,this.wrapped.lineWidth=e)}getLineDash(){return this.wrapped.getLineDash()}setLineDash(t){const e=Array.from(t).map(s=>this.scale_.x.dim(s));this.wrapped.setLineDash(e)}clearRect(t,e,s,i){this.wrapped.clearRect(t,e,s,i)}fillRect(t,e,s,i){this.wrapped.fillRect(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i))}strokeRect(t,e,s,i){this.wrapped.strokeRect(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i))}get shadowBlur(){return this.wrapped.shadowBlur}set shadowBlur(t){this.wrapped.shadowBlur=t}get shadowColor(){return this.wrapped.shadowColor}set shadowColor(t){this.wrapped.shadowColor=t}get shadowOffsetX(){return this.wrapped.shadowOffsetX}set shadowOffsetX(t){this.wrapped.shadowOffsetX=t}get shadowOffsetY(){return this.wrapped.shadowOffsetY}restore(){this.cachedFillStyle=null,this.cachedStrokeStyle=null,this.cachedLineWidth=null,this.cachedGlobalAlpha=null,this.cachedTextAlign=null,this.cachedTextBaseline=null,this.cachedLineCap=null,this.cachedLineJoin=null,this.cachedMiterLimit=null,this.cachedFont=null,this.wrapped.restore()}save(){this.wrapped.save()}fillText(t,e,s,i,r={}){const{useAtlas:a}=r;if(a==!0){this.atlasRegistry.get({font:this.font,textColor:this.fillStyle,dpr:this.dpr}).fillText(this,t,e,s);return}this.wrapped.fillText(t,this.scale_.x.pos(e),this.scale_.y.pos(s),i!=null?this.scale_.x.dim(i):void 0)}atlasMeasureText(t){return this.atlasRegistry.get({font:this.font,textColor:this.fillStyle,dpr:this.dpr}).measureText(t)}measureText(t){return this.wrapped.measureText(t)}textDimensions(t,e={}){const{useAtlas:s}=e;let i;return s?i=this.atlasMeasureText(t):i=k.dimensionsFromMetrics(this.measureText(t)),i}strokeText(t,e,s,i){this.wrapped.strokeText(t,this.scale_.x.pos(e),this.scale_.y.pos(s),i!=null?this.scale_.x.dim(i):void 0)}get direction(){return this.wrapped.direction}set direction(t){this.wrapped.direction=t}get font(){return this.cachedFont!=null?this.cachedFont:this.wrapped.font}set font(t){t!==this.cachedFont&&(this.cachedFont=t,this.wrapped.font=this.cachedFont)}get fontKerning(){return this.wrapped.fontKerning}set fontKerning(t){this.wrapped.fontKerning=t}get textAlign(){return this.cachedTextAlign??this.wrapped.textAlign}set textAlign(t){t!==this.cachedTextAlign&&(this.cachedTextAlign=t,this.wrapped.textAlign=t)}get textBaseline(){return this.cachedTextBaseline??this.wrapped.textBaseline}set textBaseline(t){t!==this.cachedTextBaseline&&(this.cachedTextBaseline=t,this.wrapped.textBaseline=t)}getTransform(){return this.wrapped.getTransform()}resetTransform(){this.wrapped.resetTransform()}rotate(t){this.wrapped.rotate(t)}scale(t,e){this.wrapped.scale(t,e),this.dpr=t}scissor(t,e=n.J.ZERO){const s=new H(this.scale_);return t=C(t,e),s.rect(...n.J.couple(n.$t.topLeft(t)),...n._.couple(n.$t.dims(t))),this.save(),this.clip(s.getPath()),()=>this.restore()}setTransform(t,e,s,i,r,a){this.wrapped.setTransform(t,e,s,i,r,a)}transform(t,e,s,i,r,a){this.wrapped.transform(t,e,s,i,r,a)}translate(t,e){this.wrapped.translate(t,e)}}class H{constructor(t=n.b.XY.IDENTITY,e){h(this,"scale_");h(this,"path");this.scale_=t,e instanceof Path2D||typeof e=="string"?this.path=new Path2D(e):this.path=new Path2D}addPath(t,e){this.path.addPath(t,e)}arc(t,e,s,i,r,a){this.path.arc(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),i,r,a)}arcTo(t,e,s,i,r){this.path.arcTo(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.pos(s),this.scale_.y.pos(i),this.scale_.x.dim(r))}bezierCurveTo(t,e,s,i,r,a){this.path.bezierCurveTo(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.pos(s),this.scale_.y.pos(i),this.scale_.x.pos(r),this.scale_.y.pos(a))}closePath(){this.path.closePath()}ellipse(t,e,s,i,r,a,c,p){this.path.ellipse(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i),r,a,c,p)}lineTo(t,e){this.path.lineTo(this.scale_.x.pos(t),this.scale_.y.pos(e))}moveTo(t,e){this.path.moveTo(this.scale_.x.pos(t),this.scale_.y.pos(e))}quadraticCurveTo(t,e,s,i){this.path.quadraticCurveTo(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.pos(s),this.scale_.y.pos(i))}rect(t,e,s,i){this.path.rect(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i))}roundRect(t,e,s,i,r){const a=this.scaleRadii(r);this.path.roundRect(this.scale_.x.pos(t),this.scale_.y.pos(e),this.scale_.x.dim(s),this.scale_.y.dim(i),a)}scaleRadii(t){return t==null?t:typeof t=="number"?this.scale_.x.dim(t):Array.isArray(t)?t.map(e=>this.scaleRadius(e)):this.scaleRadius(t)}scaleRadius(t){return typeof t=="number"?this.scale_.x.dim(t):{x:this.scale_.x.dim(t.x??0),y:this.scale_.y.dim(t.y??0)}}getPath(){return this.path}}const Q=`precision mediump float;
2
+
3
+ void main(void) {
4
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
5
+ }
6
+ `,j=`attribute vec4 a_position;
7
+
8
+ void main(void) {
9
+ gl_Position = a_position;
10
+ }
11
+ `,D=o=>new Error(`failed to compile webgl program: ${o}`),tt=new Error("null shader encountered");let B=class{constructor(t,e,s){h(this,"renderCtx");h(this,"prog");h(this,"vertShader");h(this,"fragShader");h(this,"uniformLocCache",new Map);this.renderCtx=t;const i=t.gl.createProgram();if(i==null)throw D("failed to create program");this.prog=i,this.vertShader=e,this.fragShader=s,this.compile()}setAsActive(){return this.renderCtx.gl.useProgram(this.prog),()=>this.renderCtx.gl.useProgram(null)}uniformXY(t,e){this.renderCtx.gl.uniform2fv(this.getUniformLoc(t),n.J.couple(e))}uniformColor(t,e){this.renderCtx.gl.uniform4fv(this.getUniformLoc(t),n.zt.rgba1(e))}getUniformLoc(t){const e=this.uniformLocCache.get(t);if(e!=null)return e;const s=this.renderCtx.gl.getUniformLocation(this.prog,t);if(s==null)throw new Error(`unexpected missing uniform ${t}`);return this.uniformLocCache.set(t,s),s}compile(){const t=this.renderCtx.gl;this.compileShader(this.vertShader,t.VERTEX_SHADER),this.compileShader(this.fragShader,t.FRAGMENT_SHADER),t.linkProgram(this.prog)}compileShader(t,e){const s=this.renderCtx.gl,i=s.createShader(e);if(i==null)throw tt;if(s.shaderSource(i,t),s.compileShader(i),!s.getShaderParameter(i,s.COMPILE_STATUS)){const a=s.getShaderInfoLog(i);throw s.deleteShader(i),D(a??"unknown")}s.attachShader(this.prog,i)}};const et=new Float32Array([0,0,0,0,0,0]);class st extends B{constructor(e){super(e,j,Q);h(this,"positionBuffer");const s=e.gl.createBuffer();if(s==null)throw new f.Qt("webgl: failed to create buffer");this.positionBuffer=s,e.gl.bindBuffer(e.gl.ARRAY_BUFFER,this.positionBuffer),e.gl.bufferData(e.gl.ARRAY_BUFFER,et,e.gl.STATIC_DRAW)}exec(){const{gl:e}=this.renderCtx,s=e.getAttribLocation(this.prog,"a_position");e.bindBuffer(e.ARRAY_BUFFER,this.positionBuffer);const i=e.createVertexArray();e.bindVertexArray(i),e.enableVertexAttribArray(s),e.vertexAttribPointer(s,2,e.FLOAT,!1,0,0),this.setAsActive(),e.drawArrays(e.TRIANGLES,0,3)}}const it=new Error("request for lock canceled");var rt=function(o,t,e,s){function i(r){return r instanceof e?r:new e(function(a){a(r)})}return new(e||(e=Promise))(function(r,a){function c(l){try{d(s.next(l))}catch(u){a(u)}}function p(l){try{d(s.throw(l))}catch(u){a(u)}}function d(l){l.done?r(l.value):i(l.value).then(c,p)}d((s=s.apply(o,t||[])).next())})};class at{constructor(t,e=it){this._value=t,this._cancelError=e,this._queue=[],this._weightedWaiters=[]}acquire(t=1,e=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise((s,i)=>{const r={resolve:s,reject:i,weight:t,priority:e},a=G(this._queue,c=>e<=c.priority);a===-1&&t<=this._value?this._dispatchItem(r):this._queue.splice(a+1,0,r)})}runExclusive(t){return rt(this,arguments,void 0,function*(e,s=1,i=0){const[r,a]=yield this.acquire(s,i);try{return yield e(r)}finally{a()}})}waitForUnlock(t=1,e=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return this._couldLockImmediately(t,e)?Promise.resolve():new Promise(s=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),nt(this._weightedWaiters[t-1],{resolve:s,priority:e})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatchQueue()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatchQueue()}cancel(){this._queue.forEach(t=>t.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(t){const e=this._value;this._value-=t.weight,t.resolve([e,this._newReleaser(t.weight)])}_newReleaser(t){let e=!1;return()=>{e||(e=!0,this.release(t))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let t=this._value;t>0;t--){const e=this._weightedWaiters[t-1];e&&(e.forEach(s=>s.resolve()),this._weightedWaiters[t-1]=[])}else{const t=this._queue[0].priority;for(let e=this._value;e>0;e--){const s=this._weightedWaiters[e-1];if(!s)continue;const i=s.findIndex(r=>r.priority<=t);(i===-1?s:s.splice(0,i)).forEach(r=>r.resolve())}}}_couldLockImmediately(t,e){return(this._queue.length===0||this._queue[0].priority<e)&&t<=this._value}}function nt(o,t){const e=G(o,s=>t.priority<=s.priority);o.splice(e+1,0,t)}function G(o,t){for(let e=o.length-1;e>=0;e--)if(t(o[e]))return e;return-1}var ht=function(o,t,e,s){function i(r){return r instanceof e?r:new e(function(a){a(r)})}return new(e||(e=Promise))(function(r,a){function c(l){try{d(s.next(l))}catch(u){a(u)}}function p(l){try{d(s.throw(l))}catch(u){a(u)}}function d(l){l.done?r(l.value):i(l.value).then(c,p)}d((s=s.apply(o,t||[])).next())})};class M{constructor(t){this._semaphore=new at(1,t)}acquire(){return ht(this,arguments,void 0,function*(t=0){const[,e]=yield this._semaphore.acquire(1,t);return e})}runExclusive(t,e=0){return this._semaphore.runExclusive(()=>t(),1,e)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(t=0){return this._semaphore.waitForUnlock(1,t)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}const P={high:1,low:0};class Y{constructor({afterRender:t,instrumentation:e=f.g.Instrumentation.NOOP}){h(this,"mutex",new M);h(this,"requests",new Map);h(this,"cleanup",new Map);h(this,"afterRender");h(this,"instrumentation");h(this,"count",0);this.afterRender=t,this.instrumentation=e,this.start()}set(t){const e=this.requests.get(t.key);if(e==null)this.requests.set(t.key,t);else{const s=P[t.priority]>=P[e.priority],i=t.canvases.length>=e.canvases.length;s&&i&&this.requests.set(t.key,t)}}render(){var r;const{requests:t}=this;if(t.size===0)return;const e=this.instrumentation.T.bench("render-cycle"),s=this.instrumentation.T.bench("render-cycle-cleanup");this.runCleanupsSync(),s();const i=this.instrumentation.T.bench("render-cycle-render");this.renderSync(),i(),e(),this.requests.clear(),(r=this.afterRender)==null||r.call(this)}runCleanupsSync(){const{cleanup:t,requests:e}=this;t.forEach((s,i)=>{const r=e.get(i);r!=null&&(s(r),t.delete(i))})}renderSync(){const{requests:t}=this;t.forEach(e=>{try{const s=e.render();s!=null&&this.cleanup.set(e.key,s)}catch(s){console.error(s)}})}async start(){const t=()=>{try{this.render()}catch(e){console.error(e)}requestAnimationFrame(t)};requestAnimationFrame(t)}}const y=2,v=class v{constructor(t){h(this,"atlas");h(this,"charDims");h(this,"dpr");h(this,"charMap");const{font:e,dpr:s,characters:i=v.DEFAULT_CHARS,textColor:r}=t;this.dpr=s,this.charMap=new Map;const a=n.c$1.unique(Array.from(i)),p=new OffscreenCanvas(1,1).getContext("2d");p.font=e;const d=p.measureText("0");this.charDims=k.dimensionsFromMetrics(d),this.charDims.width+=y,this.charDims.height+=y;const l=a.length,u=this.charDims.width,_=this.charDims.height,x=Math.ceil(Math.sqrt(l)),W=Math.ceil(l/x);this.atlas=new OffscreenCanvas(u*x*this.dpr,_*(W+1)*this.dpr);const w=this.atlas.getContext("2d");w.scale(this.dpr,this.dpr),w.font=e,w.textBaseline="alphabetic",w.textAlign="left",w.fillStyle=n.zt.hex(r),w.clearRect(0,0,this.atlas.width,this.atlas.height),a.forEach((O,L)=>{const J=L%x,U=Math.floor(L/x),N=J*u,X=(U+1)*_;w.fillText(O,N,X),this.charMap.set(O,L)})}fillText(t,e,s,i){const{width:r,height:a}=this.charDims,c=Math.ceil(Math.sqrt(this.charMap.size));for(let p=0;p<e.length;p++){const d=e[p],l=this.charMap.get(d);if(l===void 0)continue;const u=l%c,_=Math.floor(l/c);t.drawImage(this.atlas,u*r*this.dpr,_*a*this.dpr+y,r*this.dpr,a*this.dpr,s+p*r,i-a-y/this.dpr,r,a)}}measureText(t){return{width:t.length*this.charDims.width,height:this.charDims.height}}};h(v,"DEFAULT_CHARS","0123456789.:-umsNa∞ᴇ");let b=v;class ot{constructor(){h(this,"atlases");this.atlases=new Map}get(t){const e=`${t.font}-${n.zt.hex(t.textColor)}-${t.dpr}-${t.characters}`;if(this.atlases.has(e))return this.atlases.get(e);const s=new b(t);return this.atlases.set(e,s),s}}const I=o=>(o.textRendering="optimizeSpeed",o.imageSmoothingEnabled=!1,o),g=class g{constructor(t,e,s,i,r){h(this,"glCanvas");h(this,"upper2dCanvas");h(this,"lower2dCanvas");h(this,"gl");h(this,"lower2d");h(this,"upper2d");h(this,"region");h(this,"dpr");h(this,"loop");h(this,"clearProgram");h(this,"os");h(this,"instrumentation");this.upper2dCanvas=s,this.lower2dCanvas=e,this.glCanvas=t,this.os=i,this.instrumentation=r,this.dpr=1;const a=this.lower2dCanvas.getContext("2d");if(a==null)throw new Error("Could not get 2D context");const c=new ot;this.lower2d=I(new T(a,c,this.dpr));const p=this.upper2dCanvas.getContext("2d");if(p==null)throw new Error("Could not get 2D context");this.upper2d=I(new T(p,c,this.dpr));const d={preserveDrawingBuffer:!0,powerPreference:"high-performance",stencil:!1,depth:!1},l=this.glCanvas.getContext("webgl2",d);if(l==null)throw new Error("Could not get WebGL context");l.disable(l.DEPTH_TEST),l.disable(l.STENCIL_TEST),l.disable(l.CULL_FACE),l.disable(l.DITHER),this.gl=l,this.glCanvas.oncontextlost=console.error;const u=()=>{this.gl.flush(),this.gl.finish()};this.loop=new Y({afterRender:u,instrumentation:this.instrumentation}),this.region=n.$t.ZERO,this.os==="Windows"&&(this.clearProgram=new st(this))}static create(t,e,s,i,r){const a=q(t,"render_context"),c=new g(e,s,i,r,a);return t.set(g.CONTEXT_KEY,c),c}static useOptional(t){return t.getOptional(g.CONTEXT_KEY)}static use(t){return t.get(g.CONTEXT_KEY)}update(t){t.set(g.CONTEXT_KEY,this)}resize(t,e){n.$t.equals(this.region,t)&&this.dpr===e||(this.region=t,this.dpr=e,this.resizeCanvas(this.glCanvas),this.resizeCanvas(this.upper2dCanvas),this.resizeCanvas(this.lower2dCanvas),this.lower2d.scale(this.dpr,this.dpr),this.upper2d.scale(this.dpr,this.dpr),this.gl.viewport(0,0,n.$t.width(t)*e,n.$t.height(t)*e))}resizeCanvas(t){t.width=n.$t.width(this.region)*this.dpr,t.height=n.$t.height(this.region)*this.dpr}get aspect(){return n.$t.aspect(this.region)}scaleRegion(t){return new n.b.XY(n.b.Scale.scale(0,1).scale(n.$t.width(t)).translate(n.$t.left(t)).reBound(n.$t.width(this.region)).scale(-1,1),n.b.Scale.scale(0,1).scale(n.$t.height(t)).invert().translate(n.$t.top(t)).reBound(n.$t.height(this.region)).scale(-1,1).invert())}scissor(t,e=n.J.ZERO,s){const i=[];return s.includes("upper2d")&&i.push(this.upper2d.scissor(t,e)),s.includes("lower2d")&&i.push(this.lower2d.scissor(t,e)),s.includes("gl")&&i.push(this.scissorGL(t,e)),()=>i.forEach(r=>r())}scissorGL(t,e=n.J.ZERO){return this.gl.enable(this.gl.SCISSOR_TEST),t=C(t,e),this.gl.scissor(n.$t.left(t)*this.dpr,(n.$t.height(this.region)-n.$t.bottom(t))*this.dpr,n.$t.width(t)*this.dpr,n.$t.height(t)*this.dpr),()=>this.gl.disable(this.gl.SCISSOR_TEST)}erase(t,e=n.J.ZERO,...s){e=n.J.construct(e),s.length===0&&(s=["upper2d","lower2d","gl"]),s.includes("upper2d")&&this.eraseCanvas(this.upper2d,t,e),s.includes("lower2d")&&this.eraseCanvas(this.lower2d,t,e),s.includes("gl")&&this.eraseGL(t,e)}eraseGL(t,e=n.J.ZERO){var r;const{gl:s}=this,i=this.scissorGL(C(t,e));s.clearColor(...n.zt.rgba1(n.zt.ZERO)),s.clear(s.COLOR_BUFFER_BIT),this.os==="Windows"&&((r=this.clearProgram)==null||r.exec()),i()}eraseCanvas(t,e,s=n.J.ZERO){const i=C(e,s);t.clearRect(...n.J.couple(n.$t.topLeft(i)),...n._.couple(n.$t.dims(i)))}};h(g,"CONTEXT_KEY",n.CSS.B("render-context"));let E=g;const z=m.z.object({region:n.$t.box,enabled:m.z.boolean().optional().default(!1)}),$=["gl","lower2d","upper2d"];class R extends f.Leaf{constructor(){super(...arguments);h(this,"schema",z)}afterUpdate(e){this.deleted||(this.internal.renderCtx=E.use(e),this.renderOnLifecycleChange())}afterDelete(){this.renderOnLifecycleChange()}renderOnLifecycleChange(){this.internal.renderCtx.loop.set({key:`${this.type}-${this.key}`,render:this.render.bind(this),priority:"high",canvases:$})}render(){this.deleted||!this.state.enabled||this.internal.renderCtx.erase(this.state.region,n.J.construct(0),...$)}}h(R,"TYPE","eraser");const lt={[R.TYPE]:R};exports.Context=E;exports.Eraser=R;exports.GLProgram=B;exports.Loop=Y;exports.Mutex=M;exports.Provider=S;exports.REGISTRY=lt;exports.REGISTRY$1=Z;exports.eraserStateZ=z;exports.providerStateZ=F;exports.useInstrumentation=q;