@synnaxlabs/pluto 0.23.0 → 0.25.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 (493) hide show
  1. package/dist/{Animated-DPIV1IH6.js → Animated-BpuQZROI.js} +3 -3
  2. package/dist/{Animated-DjcnDVGC.cjs → Animated-DqAjXT8r.cjs} +1 -1
  3. package/dist/{Keyboard-BLHHROrq.js → Keyboard-BTyEk3pg.js} +3 -3
  4. package/dist/{Keyboard-CJLEUbYu.cjs → Keyboard-GDYsV4-x.cjs} +1 -1
  5. package/dist/{LinePlot-C9MVJErC.js → LinePlot-CQAK-dkX.js} +4110 -3906
  6. package/dist/LinePlot-DnLLplw_.cjs +66 -0
  7. package/dist/{Link-BsqVxj6V.js → Link-BrhOiMiE.js} +2 -2
  8. package/dist/Link-CpMcH9c1.cjs +1 -0
  9. package/dist/List-BS57aL1n.js +22 -0
  10. package/dist/List-Dux7qweq.cjs +1 -0
  11. package/dist/{Pack-mkZBsSIU.js → Pack-CCCsIeot.js} +6 -6
  12. package/dist/{Pack-CBNcamuh.cjs → Pack-_i2cfPYc.cjs} +1 -1
  13. package/dist/{Toggle-W4K3cLf7.js → Toggle-CpLFBHo7.js} +17239 -17153
  14. package/dist/Toggle-DlNzb7nt.cjs +143 -0
  15. package/dist/{Video-C2EYBKLN.js → Video-Bi9kFIHV.js} +2 -2
  16. package/dist/{Video-Kb-c-N69.cjs → Video-THwAEuOy.cjs} +1 -1
  17. package/dist/{aggregator-BZJAV5yZ.js → aggregator-CoD5WrqU.js} +5151 -5636
  18. package/dist/aggregator-D47lwtdn.cjs +51 -0
  19. package/dist/align.cjs +1 -1
  20. package/dist/align.js +1 -1
  21. package/dist/button.cjs +1 -1
  22. package/dist/button.js +1 -1
  23. package/dist/color.cjs +1 -1
  24. package/dist/color.js +1 -1
  25. package/dist/css-CC1MhhH7.cjs +1 -0
  26. package/dist/css-Ce6IGevn.js +1042 -0
  27. package/dist/css.cjs +1 -1
  28. package/dist/css.js +2 -2
  29. package/dist/dropdown.cjs +1 -1
  30. package/dist/dropdown.js +1 -1
  31. package/dist/ether.cjs +1 -1
  32. package/dist/ether.js +9 -9
  33. package/dist/{external-DjjMU4Z6.cjs → external-B7RXnD0a.cjs} +1 -1
  34. package/dist/external-B815mDB0.cjs +1 -0
  35. package/dist/external-BxBMVx6g.js +97 -0
  36. package/dist/{external-CduvGaPN.js → external-C6v1z0ty.js} +37 -51
  37. package/dist/{external-XoJlPNFB.js → external-C8CIAjMj.js} +2 -2
  38. package/dist/external-CLwP0eXe.cjs +1 -0
  39. package/dist/{external-mlV4Onnq.cjs → external-CMk1k986.cjs} +1 -1
  40. package/dist/external-CUJXIrxM.cjs +1 -0
  41. package/dist/{external-0w2SHXg_.js → external-CXrgzQf5.js} +2 -2
  42. package/dist/external-Cv5GChi6.js +344 -0
  43. package/dist/{external-BKWizK6o.cjs → external-DMYExlt2.cjs} +1 -1
  44. package/dist/{external-WGyRiKbb.js → external-DQ4EhNBA.js} +32 -32
  45. package/dist/external-DRvtVPhp.cjs +1 -0
  46. package/dist/external-DShO9063.js +74 -0
  47. package/dist/external-DU5Xqqld.cjs +1 -0
  48. package/dist/external-D_WKlwCh.js +231 -0
  49. package/dist/{external-DlCoToEB.cjs → external-DjSiwSCE.cjs} +1 -1
  50. package/dist/external-Dm3eiIEN.cjs +1 -0
  51. package/dist/external-Do75w1Zt.cjs +1 -0
  52. package/dist/{external-DsNtnR-y.cjs → external-DqnUE4mV.cjs} +1 -1
  53. package/dist/external-DyTzmzSc.js +93 -0
  54. package/dist/{external-BB2SaR1o.js → external-NHkWeW29.js} +1 -1
  55. package/dist/external-NeMo53nv.js +271 -0
  56. package/dist/{external-TNsi3_BK.js → external-e0OPlFyY.js} +26 -26
  57. package/dist/header.cjs +1 -1
  58. package/dist/header.js +1 -1
  59. package/dist/index.cjs +1 -1
  60. package/dist/index.js +4937 -4262
  61. package/dist/input.cjs +1 -1
  62. package/dist/input.js +1 -1
  63. package/dist/{jsx-runtime-DqxPLdyS.js → jsx-runtime-B6kdoens.js} +225 -214
  64. package/dist/jsx-runtime-Cek9Ww4S.cjs +30 -0
  65. package/dist/list.cjs +1 -1
  66. package/dist/list.js +1 -1
  67. package/dist/menu.cjs +1 -1
  68. package/dist/menu.js +1 -1
  69. package/dist/src/accordion/Accordion.d.ts +2 -2
  70. package/dist/src/aether/aether/aether.d.ts +5 -5
  71. package/dist/src/aether/main.d.ts +4 -4
  72. package/dist/src/aether/main.d.ts.map +1 -1
  73. package/dist/src/aether/test/test.d.ts +1 -1
  74. package/dist/src/aether/test/test.d.ts.map +1 -1
  75. package/dist/src/alamos/Provider.d.ts +3 -3
  76. package/dist/src/alamos/aether/alamos.d.ts +2 -2
  77. package/dist/src/alamos/aether/alamos.d.ts.map +1 -1
  78. package/dist/src/align/Center.d.ts +1 -1
  79. package/dist/src/align/Center.d.ts.map +1 -1
  80. package/dist/src/align/Pack.d.ts +1 -1
  81. package/dist/src/align/Pack.d.ts.map +1 -1
  82. package/dist/src/align/Space.d.ts +3 -3
  83. package/dist/src/align/Space.d.ts.map +1 -1
  84. package/dist/src/button/Button.d.ts +15 -11
  85. package/dist/src/button/Button.d.ts.map +1 -1
  86. package/dist/src/button/Icon.d.ts +2 -2
  87. package/dist/src/button/Link.d.ts +3 -3
  88. package/dist/src/button/Link.d.ts.map +1 -1
  89. package/dist/src/button/Toggle.d.ts +8 -8
  90. package/dist/src/button/color.d.ts +2 -2
  91. package/dist/src/button/color.d.ts.map +1 -1
  92. package/dist/src/channel/AliasProvider.d.ts +2 -2
  93. package/dist/src/channel/AliasProvider.d.ts.map +1 -1
  94. package/dist/src/channel/LinePlot.d.ts +11 -8
  95. package/dist/src/channel/LinePlot.d.ts.map +1 -1
  96. package/dist/src/channel/Select.d.ts +2 -2
  97. package/dist/src/color/Picker/Picker.d.ts +2 -2
  98. package/dist/src/color/Swatch/Swatch.d.ts +4 -4
  99. package/dist/src/color/core/color.d.ts +7 -0
  100. package/dist/src/color/core/color.d.ts.map +1 -1
  101. package/dist/src/css/color.d.ts.map +1 -1
  102. package/dist/src/css/css.d.ts +4 -4
  103. package/dist/src/css/css.d.ts.map +1 -1
  104. package/dist/src/css/vars.d.ts.map +1 -1
  105. package/dist/src/dialog/index.d.ts +2 -0
  106. package/dist/src/dialog/index.d.ts.map +1 -0
  107. package/dist/src/dialog/use.d.ts +28 -0
  108. package/dist/src/dialog/use.d.ts.map +1 -0
  109. package/dist/src/divider/Divider.d.ts +2 -2
  110. package/dist/src/divider/Divider.d.ts.map +1 -1
  111. package/dist/src/dropdown/Dropdown.d.ts +8 -30
  112. package/dist/src/dropdown/Dropdown.d.ts.map +1 -1
  113. package/dist/src/form/Field.d.ts +35 -0
  114. package/dist/src/form/Field.d.ts.map +1 -0
  115. package/dist/src/form/Form.d.ts +19 -49
  116. package/dist/src/form/Form.d.ts.map +1 -1
  117. package/dist/src/form/external.d.ts +1 -0
  118. package/dist/src/form/external.d.ts.map +1 -1
  119. package/dist/src/generic/Generic.d.ts +1 -1
  120. package/dist/src/generic/Generic.d.ts.map +1 -1
  121. package/dist/src/hardware/device/Select.d.ts +2 -2
  122. package/dist/src/haul/Haul.d.ts +84 -3
  123. package/dist/src/haul/Haul.d.ts.map +1 -1
  124. package/dist/src/header/Actions.d.ts +1 -1
  125. package/dist/src/header/ButtonTitle.d.ts +1 -1
  126. package/dist/src/header/Header.d.ts +2 -2
  127. package/dist/src/header/Title.d.ts +1 -1
  128. package/dist/src/hooks/effect.d.ts.map +1 -1
  129. package/dist/src/hooks/ref.d.ts +3 -3
  130. package/dist/src/hooks/ref.d.ts.map +1 -1
  131. package/dist/src/hooks/useCursorDrag/types.d.ts +1 -1
  132. package/dist/src/hooks/useCursorDrag/useCursorDrag.d.ts +2 -2
  133. package/dist/src/hooks/useDebouncedCallback.d.ts.map +1 -1
  134. package/dist/src/hooks/useFilter.d.ts +1 -1
  135. package/dist/src/hooks/useFilter.d.ts.map +1 -1
  136. package/dist/src/hooks/useRequiredContext.d.ts.map +1 -1
  137. package/dist/src/hooks/useResize.d.ts +1 -1
  138. package/dist/src/hooks/useResize.d.ts.map +1 -1
  139. package/dist/src/hooks/useTransforms.d.ts.map +1 -1
  140. package/dist/src/hooks/useUniqueKey.d.ts.map +1 -1
  141. package/dist/src/icon/Icon.d.ts +14 -0
  142. package/dist/src/icon/Icon.d.ts.map +1 -0
  143. package/dist/src/icon/index.d.ts +2 -0
  144. package/dist/src/icon/index.d.ts.map +1 -0
  145. package/dist/src/index.d.ts +6 -0
  146. package/dist/src/index.d.ts.map +1 -1
  147. package/dist/src/input/Date.d.ts +1 -1
  148. package/dist/src/input/Date.d.ts.map +1 -1
  149. package/dist/src/input/DateTime.d.ts +1 -1
  150. package/dist/src/input/DragButton.d.ts +3 -3
  151. package/dist/src/input/HelpText.d.ts +2 -2
  152. package/dist/src/input/Item.d.ts +2 -2
  153. package/dist/src/input/Numeric.d.ts +3 -3
  154. package/dist/src/input/Numeric.d.ts.map +1 -1
  155. package/dist/src/input/Switch.d.ts.map +1 -1
  156. package/dist/src/input/Text.d.ts +2 -0
  157. package/dist/src/input/Text.d.ts.map +1 -1
  158. package/dist/src/input/TextArea.d.ts +1 -1
  159. package/dist/src/input/Time.d.ts +2 -2
  160. package/dist/src/input/Time.d.ts.map +1 -1
  161. package/dist/src/input/types.d.ts +2 -2
  162. package/dist/src/list/Column.d.ts +7 -6
  163. package/dist/src/list/Column.d.ts.map +1 -1
  164. package/dist/src/list/Core.d.ts +4 -4
  165. package/dist/src/list/Core.d.ts.map +1 -1
  166. package/dist/src/list/Data.d.ts +5 -3
  167. package/dist/src/list/Data.d.ts.map +1 -1
  168. package/dist/src/list/Filter.d.ts +4 -4
  169. package/dist/src/list/Filter.d.ts.map +1 -1
  170. package/dist/src/list/Hover.d.ts +1 -1
  171. package/dist/src/list/Hover.d.ts.map +1 -1
  172. package/dist/src/list/Item.d.ts +3 -3
  173. package/dist/src/list/Item.d.ts.map +1 -1
  174. package/dist/src/list/List.d.ts +1 -1
  175. package/dist/src/list/List.d.ts.map +1 -1
  176. package/dist/src/list/Search.d.ts +3 -3
  177. package/dist/src/list/Search.d.ts.map +1 -1
  178. package/dist/src/list/Selector.d.ts +3 -9
  179. package/dist/src/list/Selector.d.ts.map +1 -1
  180. package/dist/src/list/types.d.ts.map +1 -1
  181. package/dist/src/list/useSelect.d.ts +6 -2
  182. package/dist/src/list/useSelect.d.ts.map +1 -1
  183. package/dist/src/memo/useMemoCompare.d.ts +1 -1
  184. package/dist/src/memo/useMemoCompare.d.ts.map +1 -1
  185. package/dist/src/menu/ContextMenu.d.ts +2 -2
  186. package/dist/src/menu/Item.d.ts +7 -7
  187. package/dist/src/menu/Item.d.ts.map +1 -1
  188. package/dist/src/menu/Menu.d.ts +7 -5
  189. package/dist/src/menu/Menu.d.ts.map +1 -1
  190. package/dist/src/mock/MockGLBufferController.d.ts +1 -1
  191. package/dist/src/modal/Modal.d.ts +8 -0
  192. package/dist/src/modal/Modal.d.ts.map +1 -0
  193. package/dist/src/modal/index.d.ts +2 -0
  194. package/dist/src/modal/index.d.ts.map +1 -0
  195. package/dist/src/mosaic/Mosaic.d.ts +6 -5
  196. package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
  197. package/dist/src/mosaic/tree.d.ts +3 -2
  198. package/dist/src/mosaic/tree.d.ts.map +1 -1
  199. package/dist/src/mosaic/types.d.ts +63 -1
  200. package/dist/src/mosaic/types.d.ts.map +1 -1
  201. package/dist/src/mosaic/use.d.ts +1 -1
  202. package/dist/src/nav/Bar.d.ts +2 -2
  203. package/dist/src/nav/Bar.d.ts.map +1 -1
  204. package/dist/src/nav/Drawer.d.ts +3 -3
  205. package/dist/src/note/Note.d.ts +1 -1
  206. package/dist/src/note/Note.d.ts.map +1 -1
  207. package/dist/src/observe/index.d.ts +2 -0
  208. package/dist/src/observe/index.d.ts.map +1 -0
  209. package/dist/src/observe/use.d.ts +19 -0
  210. package/dist/src/observe/use.d.ts.map +1 -0
  211. package/dist/src/os/Controls/Controls.d.ts +2 -2
  212. package/dist/src/os/Controls/Mac.d.ts +1 -1
  213. package/dist/src/os/Controls/Windows.d.ts +2 -2
  214. package/dist/src/os/Controls/Windows.d.ts.map +1 -1
  215. package/dist/src/os/Controls/types.d.ts +1 -1
  216. package/dist/src/os/use.d.ts.map +1 -1
  217. package/dist/src/pluto/Pluto.d.ts +8 -8
  218. package/dist/src/portal/Portal.d.ts +0 -1
  219. package/dist/src/portal/Portal.d.ts.map +1 -1
  220. package/dist/src/ranger/SelectLabel.d.ts +2 -2
  221. package/dist/src/ranger/TimeRangeChip.d.ts +4 -3
  222. package/dist/src/ranger/TimeRangeChip.d.ts.map +1 -1
  223. package/dist/src/resize/Core.d.ts +1 -1
  224. package/dist/src/resize/Multiple.d.ts +2 -2
  225. package/dist/src/resize/Single.d.ts +2 -2
  226. package/dist/src/select/Button.d.ts +8 -8
  227. package/dist/src/select/Button.d.ts.map +1 -1
  228. package/dist/src/select/ClearButton.d.ts +1 -1
  229. package/dist/src/select/ClearButton.d.ts.map +1 -1
  230. package/dist/src/select/DataType.d.ts +1 -1
  231. package/dist/src/select/DataType.d.ts.map +1 -1
  232. package/dist/src/select/Direction.d.ts +2 -2
  233. package/dist/src/select/List.d.ts +6 -5
  234. package/dist/src/select/List.d.ts.map +1 -1
  235. package/dist/src/select/Multiple.d.ts +10 -9
  236. package/dist/src/select/Multiple.d.ts.map +1 -1
  237. package/dist/src/select/Select.spec.d.ts.map +1 -1
  238. package/dist/src/select/Single.d.ts +9 -7
  239. package/dist/src/select/Single.d.ts.map +1 -1
  240. package/dist/src/state/state.d.ts +2 -1
  241. package/dist/src/state/state.d.ts.map +1 -1
  242. package/dist/src/status/Aggregator.d.ts +4 -4
  243. package/dist/src/status/Circle.d.ts +2 -2
  244. package/dist/src/status/Notification.d.ts +4 -4
  245. package/dist/src/status/Notification.d.ts.map +1 -1
  246. package/dist/src/status/Text.d.ts +2 -2
  247. package/dist/src/status/Text.d.ts.map +1 -1
  248. package/dist/src/status/aether/aggregator.d.ts +3 -3
  249. package/dist/src/status/aether/aggregator.d.ts.map +1 -1
  250. package/dist/src/status/aether/types.d.ts +1 -1
  251. package/dist/src/steps/Steps.d.ts +2 -2
  252. package/dist/src/synnax/Provider.d.ts +2 -2
  253. package/dist/src/synnax/Provider.d.ts.map +1 -1
  254. package/dist/src/synnax/aether/provider.d.ts +14 -14
  255. package/dist/src/synnax/aether/provider.d.ts.map +1 -1
  256. package/dist/src/tabs/Selector.d.ts +6 -12
  257. package/dist/src/tabs/Selector.d.ts.map +1 -1
  258. package/dist/src/tabs/Tabs.d.ts +8 -13
  259. package/dist/src/tabs/Tabs.d.ts.map +1 -1
  260. package/dist/src/tabs/external.d.ts +1 -0
  261. package/dist/src/tabs/external.d.ts.map +1 -1
  262. package/dist/src/tabs/types.d.ts +54 -0
  263. package/dist/src/tabs/types.d.ts.map +1 -0
  264. package/dist/src/tag/Tag.d.ts +3 -3
  265. package/dist/src/telem/Provider.d.ts +1 -1
  266. package/dist/src/telem/aether/context.d.ts +4 -4
  267. package/dist/src/telem/aether/context.d.ts.map +1 -1
  268. package/dist/src/telem/aether/factory.d.ts +1 -1
  269. package/dist/src/telem/aether/factory.d.ts.map +1 -1
  270. package/dist/src/telem/aether/noop.d.ts +1 -1
  271. package/dist/src/telem/aether/pipeline.d.ts +3 -3
  272. package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
  273. package/dist/src/telem/aether/provider.d.ts +6 -6
  274. package/dist/src/telem/aether/remote.d.ts +3 -3
  275. package/dist/src/telem/aether/remote.d.ts.map +1 -1
  276. package/dist/src/telem/aether/static.d.ts +3 -3
  277. package/dist/src/telem/aether/telem.d.ts +3 -3
  278. package/dist/src/telem/aether/transformers.d.ts +3 -3
  279. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  280. package/dist/src/telem/client/cache/cache.d.ts +3 -3
  281. package/dist/src/telem/client/cache/static.d.ts +1 -1
  282. package/dist/src/telem/client/cache/unary.d.ts +3 -3
  283. package/dist/src/telem/client/client.d.ts +4 -5
  284. package/dist/src/telem/client/client.d.ts.map +1 -1
  285. package/dist/src/telem/client/reader.d.ts +4 -4
  286. package/dist/src/telem/client/streamer.d.ts +4 -4
  287. package/dist/src/telem/client/types.d.ts +1 -1
  288. package/dist/src/telem/control/Chip.d.ts +3 -3
  289. package/dist/src/telem/control/Chip.d.ts.map +1 -1
  290. package/dist/src/telem/control/Controller.d.ts +4 -4
  291. package/dist/src/telem/control/Indicator.d.ts +3 -3
  292. package/dist/src/telem/control/Legend.d.ts +1 -1
  293. package/dist/src/telem/control/Legend.d.ts.map +1 -1
  294. package/dist/src/telem/control/StateProvider.d.ts +3 -3
  295. package/dist/src/telem/control/aether/chip.d.ts +3 -3
  296. package/dist/src/telem/control/aether/controller.d.ts +8 -8
  297. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  298. package/dist/src/telem/control/aether/indicator.d.ts +3 -3
  299. package/dist/src/telem/control/aether/legend.d.ts +3 -3
  300. package/dist/src/telem/control/aether/state.d.ts +5 -5
  301. package/dist/src/telem/test/mock.d.ts +2 -2
  302. package/dist/src/testutil/dom.d.ts.map +1 -1
  303. package/dist/src/text/DateTime.d.ts +5 -5
  304. package/dist/src/text/DateTime.d.ts.map +1 -1
  305. package/dist/src/text/Editable.d.ts +8 -7
  306. package/dist/src/text/Editable.d.ts.map +1 -1
  307. package/dist/src/text/Keyboard.d.ts +3 -3
  308. package/dist/src/text/Keyboard.d.ts.map +1 -1
  309. package/dist/src/text/Link.d.ts +3 -3
  310. package/dist/src/text/Link.d.ts.map +1 -1
  311. package/dist/src/text/SelectLevel.d.ts +2 -2
  312. package/dist/src/text/Text.d.ts +4 -4
  313. package/dist/src/text/Text.d.ts.map +1 -1
  314. package/dist/src/text/WithIcon.d.ts +5 -5
  315. package/dist/src/text/WithIcon.d.ts.map +1 -1
  316. package/dist/src/text/core/types.d.ts +1 -1
  317. package/dist/src/text/dimensions.d.ts.map +1 -1
  318. package/dist/src/theming/Provider.d.ts +4 -4
  319. package/dist/src/theming/Provider.d.ts.map +1 -1
  320. package/dist/src/theming/aether/provider.d.ts +2 -2
  321. package/dist/src/theming/aether/provider.d.ts.map +1 -1
  322. package/dist/src/theming/core/fontString.d.ts +2 -2
  323. package/dist/src/theming/core/fontString.d.ts.map +1 -1
  324. package/dist/src/theming/core/theme.d.ts +1 -1
  325. package/dist/src/theming/css.d.ts.map +1 -1
  326. package/dist/src/theming/font.d.ts.map +1 -1
  327. package/dist/src/tooltip/Config.d.ts +1 -1
  328. package/dist/src/tooltip/Dialog.d.ts +2 -2
  329. package/dist/src/tooltip/Dialog.d.ts.map +1 -1
  330. package/dist/src/tooltip/wrap.d.ts +1 -1
  331. package/dist/src/tooltip/wrap.d.ts.map +1 -1
  332. package/dist/src/tree/Tree.d.ts +16 -11
  333. package/dist/src/tree/Tree.d.ts.map +1 -1
  334. package/dist/src/tree/core.d.ts +2 -1
  335. package/dist/src/tree/core.d.ts.map +1 -1
  336. package/dist/src/triggers/Provider.d.ts +2 -2
  337. package/dist/src/triggers/Status.d.ts +1 -1
  338. package/dist/src/triggers/Text.d.ts +4 -4
  339. package/dist/src/triggers/Text.d.ts.map +1 -1
  340. package/dist/src/triggers/hooks.d.ts +4 -4
  341. package/dist/src/triggers/hooks.d.ts.map +1 -1
  342. package/dist/src/triggers/triggers.d.ts +3 -2
  343. package/dist/src/triggers/triggers.d.ts.map +1 -1
  344. package/dist/src/triggers/useDrag.d.ts +2 -2
  345. package/dist/src/util/children.d.ts +2 -2
  346. package/dist/src/util/children.d.ts.map +1 -1
  347. package/dist/src/util/component.d.ts +1 -1
  348. package/dist/src/util/component.d.ts.map +1 -1
  349. package/dist/src/util/renderProp.d.ts +1 -1
  350. package/dist/src/util/renderProp.d.ts.map +1 -1
  351. package/dist/src/util/rootElement.d.ts +2 -0
  352. package/dist/src/util/rootElement.d.ts.map +1 -0
  353. package/dist/src/util/zod.d.ts.map +1 -1
  354. package/dist/src/viewport/Mask.d.ts.map +1 -1
  355. package/dist/src/viewport/SelectMode.d.ts +2 -2
  356. package/dist/src/viewport/use.d.ts +4 -2
  357. package/dist/src/viewport/use.d.ts.map +1 -1
  358. package/dist/src/vis/axis/axis.d.ts +3 -3
  359. package/dist/src/vis/axis/canvas.d.ts +2 -2
  360. package/dist/src/vis/axis/ticks.d.ts +1 -1
  361. package/dist/src/vis/button/aether/button.d.ts +2 -2
  362. package/dist/src/vis/button/use.d.ts +1 -1
  363. package/dist/src/vis/canvas/Canvas.d.ts +2 -2
  364. package/dist/src/vis/canvas/Canvas.d.ts.map +1 -1
  365. package/dist/src/vis/canvas/aether/canvas.d.ts +25 -25
  366. package/dist/src/vis/diagram/Diagram.d.ts +6 -6
  367. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  368. package/dist/src/vis/diagram/aether/Diagram.d.ts +41 -41
  369. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  370. package/dist/src/vis/diagram/aether/types.d.ts +331 -0
  371. package/dist/src/vis/diagram/aether/types.d.ts.map +1 -0
  372. package/dist/src/vis/diagram/align.d.ts +1 -1
  373. package/dist/src/vis/diagram/align.d.ts.map +1 -1
  374. package/dist/src/vis/diagram/edge/Edge.d.ts +4 -4
  375. package/dist/src/vis/diagram/edge/Edge.d.ts.map +1 -1
  376. package/dist/src/vis/diagram/edge/connector/connector.d.ts +12 -4
  377. package/dist/src/vis/diagram/edge/connector/connector.d.ts.map +1 -1
  378. package/dist/src/vis/diagram/external.d.ts +1 -1
  379. package/dist/src/vis/diagram/external.d.ts.map +1 -1
  380. package/dist/src/vis/diagram/util.d.ts +1 -1
  381. package/dist/src/vis/diagram/util.d.ts.map +1 -1
  382. package/dist/src/vis/draw2d/index.d.ts +4 -4
  383. package/dist/src/vis/eraser/aether/eraser.d.ts +26 -26
  384. package/dist/src/vis/eraser/use.d.ts +2 -2
  385. package/dist/src/vis/legend/Container.d.ts +101 -7
  386. package/dist/src/vis/legend/Container.d.ts.map +1 -1
  387. package/dist/src/vis/legend/Simple.d.ts +2 -2
  388. package/dist/src/vis/line/Line.d.ts +2 -2
  389. package/dist/src/vis/line/Line.d.ts.map +1 -1
  390. package/dist/src/vis/line/aether/line.d.ts +10 -9
  391. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  392. package/dist/src/vis/lineplot/Axis.d.ts +5 -5
  393. package/dist/src/vis/lineplot/Axis.d.ts.map +1 -1
  394. package/dist/src/vis/lineplot/Legend.d.ts +2 -2
  395. package/dist/src/vis/lineplot/Line.d.ts +1 -1
  396. package/dist/src/vis/lineplot/Line.d.ts.map +1 -1
  397. package/dist/src/vis/lineplot/LinePlot.d.ts +7 -7
  398. package/dist/src/vis/lineplot/LinePlot.d.ts.map +1 -1
  399. package/dist/src/vis/lineplot/Title.d.ts +2 -2
  400. package/dist/src/vis/lineplot/Title.d.ts.map +1 -1
  401. package/dist/src/vis/lineplot/Viewport.d.ts +1 -1
  402. package/dist/src/vis/lineplot/aether/LinePlot.d.ts +57 -57
  403. package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
  404. package/dist/src/vis/lineplot/aether/XAxis.d.ts +4 -3
  405. package/dist/src/vis/lineplot/aether/XAxis.d.ts.map +1 -1
  406. package/dist/src/vis/lineplot/aether/YAxis.d.ts +5 -4
  407. package/dist/src/vis/lineplot/aether/YAxis.d.ts.map +1 -1
  408. package/dist/src/vis/lineplot/aether/axis.d.ts +6 -6
  409. package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
  410. package/dist/src/vis/lineplot/aether/grid.d.ts +1 -1
  411. package/dist/src/vis/lineplot/aether/grid.d.ts.map +1 -1
  412. package/dist/src/vis/lineplot/range/Annotation.d.ts +2 -2
  413. package/dist/src/vis/lineplot/range/Annotation.d.ts.map +1 -1
  414. package/dist/src/vis/lineplot/range/Provider.d.ts +2 -2
  415. package/dist/src/vis/lineplot/range/Provider.d.ts.map +1 -1
  416. package/dist/src/vis/lineplot/range/aether/annotation.d.ts +4 -4
  417. package/dist/src/vis/lineplot/range/aether/provider.d.ts +19 -19
  418. package/dist/src/vis/lineplot/tooltip/Tooltip.d.ts +2 -2
  419. package/dist/src/vis/lineplot/tooltip/Tooltip.d.ts.map +1 -1
  420. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts +6 -6
  421. package/dist/src/vis/measure/Measure.d.ts +1 -2
  422. package/dist/src/vis/measure/Measure.d.ts.map +1 -1
  423. package/dist/src/vis/measure/aether/measure.d.ts +7 -7
  424. package/dist/src/vis/render/GLProgram.d.ts +2 -2
  425. package/dist/src/vis/render/clear/program.d.ts +1 -1
  426. package/dist/src/vis/render/context.d.ts +4 -7
  427. package/dist/src/vis/render/context.d.ts.map +1 -1
  428. package/dist/src/vis/render/eraser.d.ts +3 -3
  429. package/dist/src/vis/render/performance.d.ts +11 -0
  430. package/dist/src/vis/render/performance.d.ts.map +1 -0
  431. package/dist/src/vis/render/util.d.ts.map +1 -1
  432. package/dist/src/vis/rule/Rule.d.ts +2 -2
  433. package/dist/src/vis/rule/Rule.d.ts.map +1 -1
  434. package/dist/src/vis/rule/aether/aether.d.ts +5 -5
  435. package/dist/src/vis/schematic/Forms.d.ts +1 -0
  436. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  437. package/dist/src/vis/schematic/Labeled.d.ts +2 -2
  438. package/dist/src/vis/schematic/Labeled.d.ts.map +1 -1
  439. package/dist/src/vis/schematic/SelectOrientation.d.ts +3 -3
  440. package/dist/src/vis/schematic/Symbols.d.ts +113 -19
  441. package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
  442. package/dist/src/vis/schematic/primitives/Primitives.d.ts +27 -3
  443. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
  444. package/dist/src/vis/schematic/registry.d.ts +5 -6
  445. package/dist/src/vis/schematic/registry.d.ts.map +1 -1
  446. package/dist/src/vis/toggle/aether/toggle.d.ts +5 -5
  447. package/dist/src/vis/toggle/use.d.ts +1 -1
  448. package/dist/src/vis/value/aether/value.d.ts +43 -43
  449. package/dist/src/vis/value/use.d.ts +12 -12
  450. package/dist/src/worker/Context.d.ts +1 -1
  451. package/dist/src/worker/Context.d.ts.map +1 -1
  452. package/dist/style.css +1 -1
  453. package/dist/tabs.cjs +1 -1
  454. package/dist/tabs.js +1 -1
  455. package/dist/text.cjs +1 -1
  456. package/dist/text.js +2 -2
  457. package/dist/theming.cjs +1 -1
  458. package/dist/theming.js +2 -2
  459. package/dist/tree.cjs +1 -1
  460. package/dist/tree.js +1 -1
  461. package/dist/triggers.cjs +1 -1
  462. package/dist/triggers.js +1 -1
  463. package/dist/{units-BsHX82D_.cjs → units-CoE6Mywf.cjs} +1 -1
  464. package/dist/{units-DechjShe.js → units-DlP7zkaE.js} +1 -1
  465. package/dist/video.cjs +1 -1
  466. package/dist/video.js +1 -1
  467. package/package.json +23 -24
  468. package/dist/LinePlot-DkAUE5Nq.cjs +0 -68
  469. package/dist/Link-C3NUk5cp.cjs +0 -1
  470. package/dist/List-BbB1S5Vo.cjs +0 -1
  471. package/dist/List-DPugi06W.js +0 -22
  472. package/dist/Toggle-BBGPiXIA.cjs +0 -188
  473. package/dist/aggregator-DueF6Q-Z.cjs +0 -45
  474. package/dist/css-DZx3bWkH.cjs +0 -1
  475. package/dist/css-TXuXKs3A.js +0 -1364
  476. package/dist/external-B-CtJFCn.js +0 -96
  477. package/dist/external-B39SmpRo.js +0 -201
  478. package/dist/external-BbnWD0Pc.js +0 -66
  479. package/dist/external-BphNoXuB.js +0 -92
  480. package/dist/external-CsPOXIEm.cjs +0 -1
  481. package/dist/external-CyiLaYmg.js +0 -322
  482. package/dist/external-CztU6wom.cjs +0 -1
  483. package/dist/external-D1NnASGa.cjs +0 -1
  484. package/dist/external-DrS33VU5.cjs +0 -1
  485. package/dist/external-WzX6JA2j.cjs +0 -1
  486. package/dist/external-fg-pJfZR.js +0 -260
  487. package/dist/external-vZfda3xX.cjs +0 -1
  488. package/dist/external-vgqH7hLg.cjs +0 -1
  489. package/dist/jsx-runtime-fmb_vB8K.cjs +0 -25
  490. package/dist/src/util/case.d.ts +0 -2
  491. package/dist/src/util/case.d.ts.map +0 -1
  492. package/dist/src/vis/diagram/types.d.ts +0 -73
  493. package/dist/src/vis/diagram/types.d.ts.map +0 -1
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var Zo=Object.defineProperty;var Fo=(e,t,s)=>t in e?Zo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ne=(e,t,s)=>(Fo(e,typeof t!="symbol"?t+"":t,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-fmb_vB8K.cjs"),x=require("react"),u=require("./Toggle-BBGPiXIA.cjs"),l=require("./css-DZx3bWkH.cjs"),Ae=require("./external-BKWizK6o.cjs"),k=require("./aggregator-DueF6Q-Z.cjs"),O=require("./Pack-CBNcamuh.cjs"),qo=require("./external-DsNtnR-y.cjs"),Ho=require("./external-mlV4Onnq.cjs"),Go=require("./Animated-DjcnDVGC.cjs"),j=require("./LinePlot-DkAUE5Nq.cjs"),Rt=require("./external-DlCoToEB.cjs"),te=require("./external-vZfda3xX.cjs"),Ct=require("./external-DrS33VU5.cjs"),Yo=require("./external-CsPOXIEm.cjs"),ds=require("react-dom"),Ce=require("./external-CztU6wom.cjs"),ps=require("./units-BsHX82D_.cjs"),ms=require("zod"),xe=require("./external-D1NnASGa.cjs"),Q=require("./external-WzX6JA2j.cjs"),Uo=require("./external-DjjMU4Z6.cjs"),Wo=require("./external-vgqH7hLg.cjs"),Xo=require("./Video-Kb-c-N69.cjs"),fs=({variant:e,...t})=>n.jsxRuntimeExports.jsx(u.pt.Circle,{color:u.variantColors[e],...t}),Jo=({status:{key:e,time:t,count:s,message:o,description:r,variant:i},silence:c,actions:a,className:d,...p})=>n.jsxRuntimeExports.jsxs(O.Space,{className:l.CSS(l.CSS.B("notification"),d),direction:"y",empty:!0,...p,children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",size:"small",children:[n.jsxRuntimeExports.jsx(fs,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),n.jsxRuntimeExports.jsx(u.Text,{level:"small",shade:7,children:`x${s}`}),n.jsxRuntimeExports.jsx(u.DateTime,{className:l.CSS(l.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),n.jsxRuntimeExports.jsx(u.Icon,{className:l.CSS(l.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>c(e),children:n.jsxRuntimeExports.jsx(u.pt.Close,{})})]}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",align:"start",className:l.CSS(l.CSS.BE("notification","content")),size:"small",children:[n.jsxRuntimeExports.jsx(u.Text,{className:l.CSS(l.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:o}),r!=null&&n.jsxRuntimeExports.jsx(u.Text,{className:l.CSS(l.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),a!=null&&n.jsxRuntimeExports.jsx(O.Space,{direction:"x",align:"center",justify:"end",className:l.CSS(l.CSS.BE("notification","actions")),children:k.A(a).map(m=>n.jsxRuntimeExports.jsx(Ko,{action:m},m.key))})]},t.toString()),Ko=({action:e})=>{if(!x.isValidElement(e)){const t=e;return n.jsxRuntimeExports.jsx(u.Button,{...t})}return e},Qo=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:u.Aggregator,Circle:fs,Notification:Jo,Text:u.Text$2,VARIANTS:k.VARIANTS,specZ:k.specZ$1,useAggregator:u.useAggregator,useContext:u.useContext$2,useNotifications:u.useNotifications,variantZ:k.variantZ},Symbol.toStringTag,{value:"Module"})),er=Object.freeze(Object.defineProperty({__proto__:null,Config:u.Config,Context:u.Context,Dialog:u.Dialog$1,chooseLocation:u.chooseLocation,formatTip:u.formatTip,useConfig:u.useConfig,wrap:u.wrap},Symbol.toStringTag,{value:"Module"})),qe=e=>e.preventDefault(),Qe=x.forwardRef(({location:e,style:t,size:s,className:o,children:r,onDragStart:i,sizeUnits:c="px",showHandle:a=!0,...d},p)=>{const m=l.J.construct(e),f=l.J.direction(m),h=l.f.dimension(f);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("resize"),l.CSS.loc(m),l.CSS.dir(f),o),style:{[h]:`${s}${c}`,...t},ref:p,...d,children:[r,a&&n.jsxRuntimeExports.jsx("div",{draggable:!0,className:l.CSS(l.CSS.BE("resize","handle"),l.CSS.bordered(l.J.swap(m))),onDragStart:i,onDrag:qe,onDragEnd:qe})]})});Qe.displayName="Resize.Core";const yt=({onResize:e,count:t,initialSizes:s=[],minSize:o=100,direction:r="x"})=>{const i=x.useRef(null),[c,a]=x.useState({sizeDistribution:tr(s,t),root:null}),d=x.useCallback((f,h,E)=>{if(i.current==null)return;const g=l.To.dim(l.To.construct(i.current),r);a(S=>ut(S,g,f,o,h,E))},[o,a,r]);x.useEffect(()=>e==null?void 0:e(c.sizeDistribution),[c.sizeDistribution,e]);const p=x.useCallback((f,h)=>{f.preventDefault();const E=r==="x"?"clientX":"clientY",g=C=>d(h,C[E]),S=()=>{a(C=>({...C,root:null})),document.removeEventListener("mousemove",g)};a(C=>({...C,root:f[E]})),document.addEventListener("mousemove",g),document.addEventListener("mouseup",S,{once:!0})},[a,r,ut]);return{setSize:x.useCallback((f,h)=>d(f,void 0,h),[ut]),props:{direction:r,sizeDistribution:c.sizeDistribution,onDragHandle:p,ref:i}}},et=x.forwardRef(({direction:e="x",children:t,sizeDistribution:s,onDragHandle:o,className:r,...i},c)=>{const a=l.f.construct(e),d=x.Children.toArray(t);return s=sr(s),n.jsxRuntimeExports.jsx(O.Space,{...i,ref:c,direction:a,className:l.CSS(l.CSS.B("resize-multiple"),r),empty:!0,grow:!0,children:d.map((p,m)=>n.jsxRuntimeExports.jsx(Qe,{onDragStart:f=>o(f,m),location:l.f.location(a),size:s[m]*100,sizeUnits:"%",showHandle:m!==d.length-1,children:p},m))})});et.displayName="Resize.Multiple";const tr=(e,t)=>{const s=e.reduce((r,i)=>r+i,0),o=t-e.length;if(o<=0)return e.slice(0,t).map(r=>r/s);if(e.every(r=>r<=1)){const r=1-s;return[...e,...Array(o).fill(r/o)]}return e.map(()=>1/t)},at=.001,sr=e=>e.every(t=>l.L.closeTo(t,1/e.length),at)?e.map((t,s)=>s%2===0?t+at:s===e.length-1?t:t-at):e,ut=(e,t,s,o,r,i)=>{const c=js(e,t,s,r,i),[a,d]=nr(e.sizeDistribution,s,c,o/t),p=d?r??null:e.root;return{...e,sizeDistribution:a,root:p}},js=(e,t,s,o,r)=>{let i;if(r!=null)r>1&&(r=r/t),i=r-e.sizeDistribution[s];else if(o!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(o-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},nr=(e,t,s,o)=>{let r=t;for(;r>0&&e[r]+s<=o;)r--;const i=e[r]+s,c=or(r,e,o,s),a=e[c]-s;return i<o||a<o?[e,!1]:[e.map((d,p)=>p===r?i:p===c?a:d),!0]},or=(e,t,s,o)=>(e===t.length-1?lr:rr)(e,t,s,o),rr=(e,t,s,o)=>{let r=e+1;for(;r<t.length-1&&t[r]-o<=s;)r++;return r},lr=(e,t,s,o)=>{let r=e-1;for(;r>0&&t[r]-o<=s;)r--;return r},tt=({onMove:e,onStart:t,onEnd:s})=>x.useCallback(o=>{o.preventDefault();const r=l.q.construct(o),i=u.mouseKey(o.button);t==null||t(r,i,o);const c=d=>{if(d.buttons===0)return a(d);const p=l.q.construct(d);e==null||e(l.To.construct(r,p),i,d)};window.addEventListener("mousemove",c);const a=d=>{window.removeEventListener("mousemove",c);const p=l.q.construct(d);s==null||s(l.To.construct(r,p),i,d)};window.addEventListener("mouseup",a,{once:!0})},[e,t,s]),xt=2,hs=({onCollapse:e,onResize:t,location:s="left",minSize:o=100,maxSize:r=1/0,initialSize:i=200,collapseThreshold:c=1/0,className:a,...d})=>{const[p,m]=x.useState(l.Y(i,o,r)),f=x.useRef(null),h=l.J.construct(s),E=x.useCallback(b=>{if(f.current===null)return 0;const R=l.To.dim(b,l.J.direction(h),!0)*(1-2*Number(["bottom","right"].includes(h))),w=f.current+R,T=l.Y(w,o,r);return(T-w)/o>c?xt:T},[h,o,r,c]),g=x.useRef(null),S=x.useCallback(b=>{const R=E(b);m(R),g.current!=null&&(t==null||t(R,l.To.construct(g.current)))},[t,E]),C=x.useCallback(()=>m(b=>(f.current=b,b)),[m]),v=x.useCallback(b=>E(b)===xt&&(e==null?void 0:e()),[e,E]);x.useEffect(()=>m(b=>{const R=l.Y(b,o,r);return f.current=R,R}),[o,r]);const y=tt({onMove:S,onStart:C,onEnd:v});return n.jsxRuntimeExports.jsx(Qe,{ref:g,location:h,size:p,onDragStart:y,className:l.clsx(a,l.CSS.expanded(p!==xt)),...d})},ir=Object.freeze(Object.defineProperty({__proto__:null,Core:Qe,Multiple:et,Single:hs,calculateDiffPercentage:js,useMultiple:yt},Symbol.toStringTag,{value:"Module"})),Ve="y",qt=28,cr=32,ar=40,ur=.5,xr=({data:e,...t})=>{const{setSize:s,props:{sizeDistribution:o,ref:r,...i}}=yt({direction:Ve,count:e.length,minSize:qt}),c=a=>{if(r.current==null)return;const d=l.To.dim(l.To.construct(r.current),Ve);o[a]<ar/d?s(a,e[a].initialSize??ur):s(a,qt+1)};return n.jsxRuntimeExports.jsx(et,{empty:!0,className:l.CSS.B("accordion"),sizeDistribution:o,ref:r,...t,...i,children:e.map((a,d)=>x.createElement(mr,{...a,key:a.key,index:d,direction:Ve,onExpand:c,parent:r,size:o[d]}))})},dr=n.jsxRuntimeExports.jsx(u.pt.Caret.Down,{"aria-label":"contract"}),pr=n.jsxRuntimeExports.jsx(u.pt.Caret.Right,{"aria-label":"expand"}),mr=({index:e,name:t,content:s,actions:o,size:r,parent:i,onExpand:c})=>{let a=!0;if(i.current!=null){const p=l.To.dim(l.To.construct(i.current),Ve);a=r*p>cr}const d=a?dr:pr;return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs(Ae.Header,{level:"p",className:l.CSS.expanded(a),empty:!0,children:[n.jsxRuntimeExports.jsx(Ae.ButtonTitle,{startIcon:d,onClick:()=>c(e),children:t}),o!=null&&n.jsxRuntimeExports.jsx(Ae.Actions,{children:o})]}),s]})},fr=Object.freeze(Object.defineProperty({__proto__:null,Accordion:xr},Symbol.toStringTag,{value:"Module"})),bt=x.createContext(j.ZERO_CONTEXT_VALUE),ye=()=>x.useContext(bt).synnax,jr=()=>x.useContext(bt).state,Ht={connected:"success",connecting:"info",disconnected:"info",failed:"error"},gs=u.wrap$1(j.Provider.TYPE,({aetherKey:e,connParams:t,children:s})=>{const[o,r,i]=u.useCombinedStateAndRef(j.ZERO_CONTEXT_VALUE),[{path:c},,a]=u.use$3({aetherKey:e,type:j.Provider.TYPE,schema:j.Provider.stateZ,initialState:{props:t??null,state:null}}),d=u.useAggregator(),p=x.useCallback(m=>{i.current.state.status!==m.status&&d({variant:Ht[m.status],message:m.message??l.Ke.capitalize(m.status)}),r(f=>({...f,state:m}))},[d]);return u.useAsyncEffect(async()=>{if(o.synnax!=null&&o.synnax.close(),t==null)return r(j.ZERO_CONTEXT_VALUE);const m=new k.yd({...t,connectivityPollFrequency:k.A$1.seconds(5)});r({synnax:m,state:{clusterKey:"",status:"connecting",message:"Connecting..."}});const f=await m.connectivity.check();return r({synnax:m,state:f}),d({variant:Ht[f.status],message:f.message??f.status.toUpperCase()}),m.connectivity.onChange(p),a({props:t,state:f}),()=>{m.close(),r(j.ZERO_CONTEXT_VALUE),a({props:null,state:null})}},[t,p]),n.jsxRuntimeExports.jsx(bt.Provider,{value:o,children:n.jsxRuntimeExports.jsx(u.Composite,{path:c,children:s})})}),hr=Object.freeze(Object.defineProperty({__proto__:null,Provider:gs,use:ye,useConnectionState:jr},Symbol.toStringTag,{value:"Module"})),be=x.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),Es=()=>x.useContext(be),Ss=e=>{const{aliases:t}=x.useContext(be);return t[e]??null},st=()=>{const{aliases:e}=x.useContext(be);return e},vt=(e,t="")=>{const{getName:s}=x.useContext(be),[o,r]=x.useState(t);return u.useAsyncEffect(async()=>{const i=await s(e);i!=null&&r(i)},[e,s]),o},wt=()=>{const{activeRange:e}=x.useContext(be);return e??void 0},Rs=({activeRange:e,children:t})=>{const s=ye(),[o,r]=x.useState({}),i=x.useCallback(d=>{r(p=>{const m={...p};return d.forEach(({variant:f,key:h,value:E})=>{const g=Number(h.split("---")[1]);f==="delete"?delete m[g]:m[E.channel]=E.alias}),m})},[r]),c=x.useCallback(async(d,p)=>{if(s==null||e==null)return;await(await s.ranges.retrieve(e)).setAlias(d,p)},[s,e]),a=x.useCallback(async d=>{if(s==null||d===0)return;const p=o[d];return p??(await s.channels.retrieve(d)).name},[o,s]);return u.useAsyncEffect(async()=>{if(s==null||e==null){r({});return}const d=await s.ranges.retrieve(e),p=await d.listAliases();r(p);const m=await d.openAliasTracker(),f=m.onChange(i);return()=>{f(),m.close()}},[s,e]),n.jsxRuntimeExports.jsx(be.Provider,{value:{aliases:o,activeRange:e,setAlias:e!=null?c:null,getName:a},children:t})},gr=({channelKey:e,value:t,shadow:s,className:o,...r})=>{const[i,c]=x.useState(!1),{setAlias:a}=Es(),d=Ss(e),p=vt(e);let m=n.jsxRuntimeExports.jsx(u.pt.Rename,{});i?m=n.jsxRuntimeExports.jsx(u.pt.Loading,{}):d===t&&(m=n.jsxRuntimeExports.jsx(u.pt.Check,{}));const f=a!=null&&!i&&d!==t&&e!==0,h=()=>{f&&(async()=>(c(!0),await a(e,t),c(!1)))()},E=()=>{var S;d!=null&&((S=r.onChange)==null||S.call(r,d))},g=()=>e===0?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):a==null?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):d===t?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Alias synced with this label"}):n.jsxRuntimeExports.jsxs(u.Text,{level:"small",children:["Sync alias for ",p," with this label"]});return n.jsxRuntimeExports.jsxs(u.Text$1,{value:t,...r,children:[f&&n.jsxRuntimeExports.jsx(u.Icon,{onClick:E,tooltip:n.jsxRuntimeExports.jsxs(u.Text,{level:"small",children:["Set ",p," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:n.jsxRuntimeExports.jsx(u.pt.Sync,{})}),n.jsxRuntimeExports.jsx(u.Icon,{onClick:h,disabled:!f,tooltip:n.jsxRuntimeExports.jsx(g,{}),tooltipLocation:{y:"top"},variant:"outlined",children:m})]})},oe="channel";var se;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(se||(se={}));function Er({color:e,dimensions:t,lineWidth:s}){return x.createElement("path",{stroke:e,strokeWidth:s,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function Sr({color:e,radius:t}){return x.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const Rr={[se.Dots]:"#91919a",[se.Lines]:"#eee",[se.Cross]:"#e2e2e2"},Cr={[se.Dots]:1,[se.Lines]:1,[se.Cross]:6},yr=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Cs({id:e,variant:t=se.Dots,gap:s=20,size:o,lineWidth:r=1,offset:i=2,color:c,style:a,className:d}){const p=x.useRef(null),{transform:m,patternId:f}=j.useStore(yr,j.shallow$1),h=c||Rr[t],E=o||Cr[t],g=t===se.Dots,S=t===se.Cross,C=Array.isArray(s)?s:[s,s],v=[C[0]*m[2]||1,C[1]*m[2]||1],y=E*m[2],b=S?[y,y]:v,R=g?[y/i,y/i]:[b[0]/i,b[1]/i];return x.createElement("svg",{className:j.cc(["react-flow__background",d]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background"},x.createElement("pattern",{id:f+e,x:m[0]%v[0],y:m[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`},g?x.createElement(Sr,{color:h,radius:y/i}):x.createElement(Er,{dimensions:b,color:h,lineWidth:r})),x.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}Cs.displayName="Background";var br=x.memo(Cs);const vr={region:l.To.ZERO,dpr:1,os:k.w$1.getOS()},wr={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},Tr=u.wrap$1(j.Canvas.TYPE,({children:e,resizeDebounce:t=100,aetherKey:s,className:o,...r})=>{const[{path:i},{bootstrapped:c,dpr:a},d]=u.use$3({aetherKey:s,type:j.Canvas.TYPE,schema:j.canvasStateZ,initialState:vr}),p=x.useRef({...wr}),m=x.useCallback(E=>{p.current.bootstrapped&&d(()=>({bootstrapped:!0,region:E,dpr:window.devicePixelRatio,os:k.w$1.getOS({default:"Windows"})}))},[d]),f=u.useResize(m,{debounce:t});x.useEffect(()=>{const E=()=>{window.devicePixelRatio!==a&&d(g=>({...g,dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",E,{once:!0})},[a]);const h=x.useCallback(E=>{if(f(E),E==null)return;E.className.includes("gl")?p.current.gl=E:E.className.includes("upper2d")?p.current.upper2d=E:p.current.lower2d=E;const{gl:g,lower2d:S,upper2d:C,bootstrapped:v}=p.current;if(g==null||S==null||C==null||v)return;p.current.bootstrapped=!0;const y=g.transferControlToOffscreen(),b=C.transferControlToOffscreen(),R=S.transferControlToOffscreen();d({glCanvas:y,upper2dCanvas:b,lower2dCanvas:R,bootstrap:!0,bootstrapped:!1,region:l.To.construct(g),dpr:window.devicePixelRatio,os:k.w$1.getOS({default:"Windows"})},[y,b,R])},[d]);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("canvas-container"),o),...r,children:[n.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","lower2d"))}),n.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","gl"))}),n.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","upper2d"))}),n.jsxRuntimeExports.jsx(u.Composite,{path:i,children:c&&e})]})}),Tt=(e,t)=>u.useResize(x.useCallback((s,o)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(l.k.XY.translate(l.q.scale(l.To.topLeft(r),-1)).box(s),o)},[e]),t),kr=Object.freeze(Object.defineProperty({__proto__:null,Canvas:Tr,useRegion:Tt},Symbol.toStringTag,{value:"Module"})),ys=x.createContext(null),de=e=>{const t=x.useContext(ys);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},bs=e=>{const t=de("Viewport"),{addViewportHandler:s}=t;x.useEffect(()=>s(e),[s,e])},nt=(e,t)=>{const{setGridEntry:s,removeGridEntry:o}=de(t),{key:r}=e;return u.useEffectCompare(()=>{l.J.outer.parse(e.loc),s(e)},([a],[d])=>k._.equal(a,d),[e]),x.useEffect(()=>()=>o(r),[]),{gridArea:l.f.swap(l.J.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},vs=u.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:s=0,clearOverScan:o=l.q.ZERO,children:r,hold:i=!1,onHold:c,...a})=>{const[d,p]=x.useState([]),m=u.useMemoDeepEqualProps({clearOverScan:o,hold:i}),[{path:f},{grid:h},E]=u.use$3({aetherKey:e,type:j.LinePlot.TYPE,schema:j.linePlotStateZ,initialState:{container:l.To.ZERO,viewport:l.To.DECIMAL,grid:{},...m}});x.useEffect(()=>E(L=>({...L,...m})),[m]);const g=x.useRef(new Map),S=x.useCallback(L=>(g.current.set(L,null),()=>g.current.delete(L)),[g]),C=x.useCallback(L=>{const{mode:_,box:M,stage:D}=L;(_==="pan"&&D!=="start"||_==="zoom"||_==="zoomReset"&&D==="start")&&E(V=>({...V,viewport:M})),g.current.forEach((V,U)=>U(L))},[E]),v=x.useCallback(L=>E(_=>({..._,container:L})),[E]),y=Tt(v,{debounce:s}),b=x.useCallback(L=>E(_=>({..._,grid:{..._.grid,[L.key]:L}})),[E]),R=x.useCallback(L=>E(_=>{const{[L]:M,...D}=_.grid;return{..._,grid:D}}),[E]),w=x.useCallback(L=>{p(_=>[..._.filter(({key:M})=>M!==L.key),L])},[p,C]),T=x.useCallback(L=>p(_=>_.filter(({key:M})=>M!==L)),[w]),$=x.useMemo(()=>Pr(h),[h]),P=x.useCallback(L=>{E(_=>({..._,hold:L})),c==null||c(L)},[E,c]),B=x.useMemo(()=>({lines:d,setGridEntry:b,removeGridEntry:R,setLine:w,removeLine:T,setViewport:C,addViewportHandler:S,setHold:P}),[d,b,R,w,T,C,S,P]);return n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("line-plot"),style:{...t,...$},ref:y,...a,children:n.jsxRuntimeExports.jsx(ys.Provider,{value:B,children:n.jsxRuntimeExports.jsx(u.Composite,{path:f,children:r})})})}),Pr=e=>{const t=l.CSS.newGridBuilder();return j.filterGridEntries("top",e).forEach(({key:s,size:o})=>t.row(`axis-start-${s}`,`axis-end-${s}`,o)),t.row("plot-start","plot-end","minmax(0, 1fr)"),j.filterGridEntries("bottom",e).forEach(({key:s,size:o})=>t.row(`axis-start-${s}`,`axis-end-${s}`,o)),j.filterGridEntries("left",e).forEach(({key:s,size:o})=>t.col(`axis-start-${s}`,`axis-end-${s}`,o)),t.col("plot-start","plot-end","minmax(0, 1fr)"),j.filterGridEntries("right",e).forEach(({key:s,size:o})=>t.col(`axis-start-${s}`,`axis-end-${s}`,o)),t.build()},kt=e=>{const t=e==="x"?"bottom":"left",s=e==="x"?j.XAxis.TYPE:j.YAxis.TYPE,o=`${e}-axis`;return u.wrap$1(s,({aetherKey:r,children:i,location:c=t,label:a="",labelLevel:d="small",labelDirection:p=e,onLabelChange:m,color:f,labelSize:h,showGrid:E,type:g,bounds:S,className:C,tickSpacing:v,autoBounds:y,autoBoundUpdateInterval:b,onAutoBoundsChange:R,style:w,...T})=>{const $=((a==null?void 0:a.length)??0)>0,P=u.useMemoDeepEqualProps({location:c,showGrid:E,type:g,bounds:S,label:a,labelDirection:p,tickSpacing:v,autoBounds:y,autoBoundUpdateInterval:b}),[{path:B},{size:L,labelSize:_,...M},D]=u.use$3({aetherKey:r,type:s,schema:j.coreAxisStateZ,initialState:P});x.useEffect(()=>D(K=>({...K,...P})),[P]),x.useEffect(()=>{const{lower:K,upper:G}=j.parseAutoBounds(M.autoBounds);M.bounds!=null&&(K&&(S==null?void 0:S.lower)!==M.bounds.lower||G&&(S==null?void 0:S.upper)!==M.bounds.upper)&&(R==null||R(M.bounds))},[M.autoBounds,M.bounds]);const V=nt({loc:c,key:`${s}-${r}`,size:L+_,order:"last"},"XAxis"),U=u.useTypography(d).toString(),Z=x.useRef(0);return x.useEffect(()=>{if(e==="y"){if(a==null)return;let G=k.dimensions(a,U)[l.f.dimension(l.f.construct(p))];G>0&&(G+=6),D(Le=>({...Le,labelSize:G}))}else{const G=k.dimensions(a,U).height+12,Le=Z.current;j.withinSizeThreshold(Le,G)||(Z.current=G,D(ct=>({...ct,labelSize:G})))}},[a,p,U]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(C,l.CSS.B("axis"),l.CSS.B(o),l.CSS.loc(c)),style:{...w,...V},align:"center",justify:e==="x"?"end":"start",direction:l.f.swap(e),...T,children:$&&n.jsxRuntimeExports.jsx(u.MaybeEditable,{className:l.CSS(l.CSS.BE("axis","label"),l.CSS.dir(p)),value:a,onChange:m,level:d})}),n.jsxRuntimeExports.jsx(u.Composite,{path:B,children:i})]})})},ws=kt("x"),Ts=kt("y"),Gt=(e,t)=>{if(t.current==null)return{display:"none"};const s={},o=l.To.construct(t.current.parentElement),r=l.To.construct(t.current);return e.x>.8?s.right=`${(1-e.x)*l.To.width(o)-l.To.width(r)}px`:e.x<.2?s.left=`${e.x*l.To.width(o)}px`:s.left=`${e.x*100}%`,e.y>.8?s.bottom=`${(1-e.y)*l.To.height(o)-l.To.height(r)}px`:e.y<.2?s.top=`${e.y*l.To.height(o)}px`:s.top=`${e.y*100}%`,s},ks=x.memo(({className:e,value:t,onChange:s,style:o,draggable:r=!0,...i})=>{const[c,a]=k.usePurePassthrough({value:t,onChange:s,initial:l.q.construct(.1,.01)}),d=x.useRef(c),p=u.useSyncedRef(r===!1),m=x.useRef(null),[f,h]=x.useState({});c!==null&&(o={...o,...f});const E=x.useCallback(C=>{m.current=C,h(Gt(l.q.construct(c),m))},[]),g=x.useCallback(C=>{var T;if(((T=m.current)==null?void 0:T.parentElement)==null)return d.current;const v=l.To.construct(m.current.parentElement),y=l.To.reRoot(l.To.DECIMAL,l.J.TOP_LEFT),b=l.k.XY.scale(v).scale(y),R=b.box(l.To.construct(m.current));return l.k.XY.clamp(l.To.construct(l.To.topLeft(y),{width:l.To.width(y)-l.To.width(R),height:l.To.height(y)-l.To.height(R)})).pos(l.q.translate(l.q.construct(d.current),l.To.signedDims(b.box(C))))},[]),S=tt({onMove:x.useCallback(C=>{if(p.current)return;const v=g(C);h(Gt(l.q.construct(v),m))},[a]),onEnd:x.useCallback(C=>{p.current||(d.current=g(C))},[])});return n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(e,l.CSS.B("legend")),bordered:!0,rounded:!0,style:o,onDragStart:S,draggable:r,ref:E,...i,onDrag:qe,onDragEnd:qe,empty:!0})});ks.displayName="Legend.Container";const Ps=({data:e=[],onEntryChange:t,position:s,onPositionChange:o,...r})=>{const[i,c]=x.useState(!1);return e.length===0?null:n.jsxRuntimeExports.jsx(ks,{...r,draggable:!i,value:s,onChange:o,children:e.sort((a,d)=>a.label.localeCompare(d.label)).map(({key:a,color:d,label:p})=>n.jsxRuntimeExports.jsxs(O.Space,{style:{cursor:"pointer"},direction:"x",align:"center",children:[n.jsxRuntimeExports.jsx(Rt.Swatch,{value:d,onChange:m=>t==null?void 0:t({key:a,color:m,label:p}),onVisibleChange:c,draggable:!1,size:"small"}),n.jsxRuntimeExports.jsx(u.MaybeEditable,{level:"small",value:p,onChange:m=>t==null?void 0:t({key:a,color:d,label:m}),noWrap:!0})]},a))})},Ls=({className:e,style:t,onLineChange:s,...o})=>{const{lines:r}=de("Legend");return de("Legend"),n.jsxRuntimeExports.jsx(Ps,{data:r,onEntryChange:s,...o})},Ms=u.wrap$1("Line",({aetherKey:e,...t})=>{const[,,s]=u.use$3({aetherKey:e,type:j.Line.TYPE,schema:j.stateZ,initialState:t}),o=u.useMemoDeepEqualProps(t);return x.useLayoutEffect(()=>s(o),[o]),null}),Lr=Object.freeze(Object.defineProperty({__proto__:null,Line:Ms},Symbol.toStringTag,{value:"Module"})),Pt=u.wrap$1("Line",({aetherKey:e,color:t,label:s="",...o})=>{const{setLine:r,removeLine:i}=de("Line");return x.useEffect(()=>(r({key:e,color:t,label:s}),()=>i(e)),[s,t]),n.jsxRuntimeExports.jsx(Ms,{aetherKey:e,color:t,label:s,...o})}),$s=({level:e="h2",...t})=>{const s=u.useUniqueKey(),o=u.useTypography(e),r=nt({key:s,size:(o.lineHeight+2)*o.baseSize,loc:"top",order:"first"},"Title");return n.jsxRuntimeExports.jsx(O.Space,{justify:"center",align:"center",style:r,children:n.jsxRuntimeExports.jsx(u.MaybeEditable,{...t,level:e})})},Ns=u.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=u.use$3({aetherKey:e,type:j.Tooltip.TYPE,schema:j.tooltipStateZ,initialState:{position:null}}),s=x.useRef(null),o=x.useCallback(i=>{const c=document.querySelector(".pluto-canvas-container");if(c==null)return;const a=l.To.topLeft(c);t({position:l.q.translation(a,l.q.construct(i))})},[t]),r=x.useCallback(()=>t({position:null}),[t]);return x.useEffect(()=>{if(s.current===null)return;const i=s.current.parentElement;if(i!=null)return i.addEventListener("mousemove",o),i.addEventListener("mouseleave",r),()=>{i.removeEventListener("mousemove",o),i.removeEventListener("mouseleave",r)}},[o]),n.jsxRuntimeExports.jsx("span",{ref:s})}),Mr=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Ns},Symbol.toStringTag,{value:"Module"})),$r={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Lt=x.forwardRef(({className:e,mode:t,maskBox:s,children:o,style:r,...i},c)=>n.jsxRuntimeExports.jsxs("div",{ref:c,className:l.CSS(l.CSS.noSelect,l.CSS.BE("viewport-mask","container"),e),style:{cursor:$r[t],...r},...i,children:[n.jsxRuntimeExports.jsx("div",{style:{...l.To.css(s),display:l.To.areaIsZero(s)?"none":"block"},className:l.CSS.BE("viewport-mask","selection")}),o]}));Lt.displayName="ZoomPanMask";const Nr=k.g.ALL.filter(e=>e!==k.g.UNKNOWN).map(e=>({key:e.toString(),name:l.Ke.capitalize(e.toString())})),_r=[{key:"name",name:"Name"}],Br=e=>n.jsxRuntimeExports.jsx(te.DropdownButton,{...e,data:Nr,columns:_r,entryRenderKey:"name"}),Or=[{key:"x",icon:n.jsxRuntimeExports.jsx(u.pt.Arrow.Right,{})},{key:"y",icon:n.jsxRuntimeExports.jsx(u.pt.Arrow.Down,{})}],Dr=({key:e,entry:t,onClick:s,selected:o})=>n.jsxRuntimeExports.jsx(u.Icon,{variant:o?"filled":"outlined",onClick:s,children:t.icon},e),zr=({children:e=Dr,...t})=>n.jsxRuntimeExports.jsx(te.Button,{...t,allowMultiple:!1,data:Or,children:e}),_s=e=>n.jsxRuntimeExports.jsx(u.Icon,{className:l.CSS.BE("select","clear"),variant:"outlined",...e,children:n.jsxRuntimeExports.jsx(u.pt.Close,{"aria-label":"clear"})}),He=({children:e="",size:t="medium",color:s,icon:o,onClose:r,className:i,onDragStart:c,...a})=>{const d=l.cssString(s);o==null&&s!=null&&(o=n.jsxRuntimeExports.jsx(u.pt.Circle,{fill:d}));const p=r==null?void 0:n.jsxRuntimeExports.jsx(u.Icon,{"aria-label":"close",size:t,className:l.CSS.BE("tag","close"),onClick:m=>{m.stopPropagation(),r()},children:n.jsxRuntimeExports.jsx(u.pt.Close,{})});return n.jsxRuntimeExports.jsx(u.WithIcon,{startIcon:o,endIcon:p,className:l.CSS(i,l.CSS.B("tag"),r!=null&&l.CSS.BM("tag","closeable")),level:k.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:c,...a,children:e})},Ar=Object.freeze(Object.defineProperty({__proto__:null,Tag:He},Symbol.toStringTag,{value:"Module"})),ot=({onChange:e,value:t,className:s,data:o,columns:r=[],entryRenderKey:i="key",emptyContent:c,searcher:a,renderTag:d,placeholder:p,onTagDragStart:m,allowMultiple:f,allowNone:h,replaceOnSingle:E,onTagDragEnd:g,style:S,...C})=>{const{visible:v,open:y,close:b}=u.use$1(),[R,w]=x.useState([]),[T,$]=x.useState(!1),P=a!=null;u.useAsyncEffect(async()=>{$(!0),u.selectValueIsZero(t)&&w([]);const _=R.map(V=>V.key),M=k.A(t);if(k.S.unorderedPrimitiveArrays(_,M)===k.S.EQUAL)return;let D=[];if(P)try{D=await a.retrieve(M)}finally{$(!1)}else o!=null&&(D=o.filter(V=>M.includes(V.key)));w(D)},[a,P,t,o]);const B=x.useCallback((_,M)=>{_!=null&&(w(M.entries),e(k.A(_),M))},[e]),L=x.useMemo(()=>P?u.Search:Ce.Filter,[P]);return n.jsxRuntimeExports.jsx(te.Core,{close:b,open:y,data:o,emptyContent:c,visible:v,value:t,onChange:B,allowNone:h,replaceOnSingle:E,columns:r,allowMultiple:!0,...C,children:n.jsxRuntimeExports.jsx(L,{searcher:a,children:({onChange:_,value:M})=>n.jsxRuntimeExports.jsx(Vr,{value:M,selectedKeys:t,className:s,onChange:_,loading:T,selected:R,onFocus:y,entryRenderKey:i,visible:v,renderTag:d,placeholder:p,onTagDragStart:m,onTagDragEnd:g,style:S})})})},Vr=({selectedKeys:e,loading:t,selected:s,onChange:o,onFocus:r,visible:i,entryRenderKey:c,renderTag:a=u.componentRenderProp(Bs),placeholder:d="Select...",onTagDragStart:p,onTagDragEnd:m,value:f,className:h,...E})=>{const{onSelect:g,clear:S}=u.useSelectionUtils(),C=x.useRef(null);x.useLayoutEffect(()=>{var R;i&&((R=C.current)==null||R.focus())},[i,s]);const v=()=>{i||o(""),r==null||r()},y=()=>{i||r==null||r()},b=()=>{i||o("")};return n.jsxRuntimeExports.jsxs(u.Text$1,{ref:C,className:l.CSS(l.CSS.BE("select-multiple","input"),l.CSS.visible(i),h),onBlur:b,placeholder:d,value:f,onChange:o,onFocus:v,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:y,...E,children:[n.jsxRuntimeExports.jsx(O.Space,{direction:"x",className:l.CSS.BE("select-multiple","tags"),align:"center",grow:!0,children:k.A(e).map((R,w)=>{const T=s[w];return a({key:R,entryKey:R,entryRenderKey:c,loading:t,entry:T,onClose:()=>g==null?void 0:g(R),onDragStart:$=>p==null?void 0:p($,R),onDragEnd:$=>m==null?void 0:m($,R)})})}),n.jsxRuntimeExports.jsx(_s,{onClick:S})]})},Bs=({entryKey:e,entryRenderKey:t,entry:s,loading:o,...r})=>{let i=e;return s!=null&&(i=typeof t=="function"?t(s):s[t]),x.createElement(He,{size:"small",variant:"outlined",className:l.CSS(s==null&&!o&&l.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...r,key:e.toString()},k.Z(i))},rt=({onChange:e,value:t,entryRenderKey:s="key",columns:o,data:r,emptyContent:i,inputProps:c,allowNone:a=!0,searcher:d,className:p,variant:m,hideColumnHeader:f=!1,disabled:h,omit:E,...g})=>{const{visible:S,open:C,close:v}=u.use$1(),[y,b]=x.useState(null),R=d!=null;u.useAsyncEffect(async()=>{if(u.selectValueIsZero(t))return b(null);if((y==null?void 0:y.key)===t)return;let $=null;if(R)try{[$]=await d.retrieve([t])}finally{$??($=null)}else r!=null&&($=r.find(P=>P.key===t)??null);b($)},[d,t,r]);const w=x.useCallback(($,P)=>{Array.isArray($)||(b($==null?null:P.entries[0]),v(),e($,P))},[e,a]),T=x.useMemo(()=>R?u.Search:Ce.Filter,[R]);return n.jsxRuntimeExports.jsx(te.Core,{close:v,open:C,data:r,omit:E,emptyContent:i,allowMultiple:!1,visible:S,value:t,hideColumnHeader:f,onChange:w,allowNone:a,columns:o,...g,children:n.jsxRuntimeExports.jsx(T,{searcher:d,children:({onChange:$})=>n.jsxRuntimeExports.jsx(Ir,{variant:m,onChange:$,onFocus:C,selected:y,entryRenderKey:s,visible:S,allowNone:a,className:p,disabled:h})})})},Ir=({entryRenderKey:e,selected:t,visible:s,onChange:o,onFocus:r,allowNone:i=!0,placeholder:c="Select...",className:a,...d})=>{const{clear:p}=u.useSelectionUtils(),[m,f]=x.useState("");x.useEffect(()=>{if(!s){if(k.A$2(t==null?void 0:t.key))return f("");if(t!=null)return f(typeof e=="function"?e(t).toString():(t==null?void 0:t[e]).toString())}},[t,s,e]);const h=C=>{o(C),f(C)},E=()=>{f(""),r==null||r()},g=C=>{s||(C.preventDefault(),r==null||r())},S=()=>{f(""),p==null||p()};return n.jsxRuntimeExports.jsx(u.Text$1,{className:l.CSS(l.CSS.BE("select","input"),a),value:m,onChange:h,onFocus:E,style:{flexGrow:1},onClick:g,placeholder:c,...d,children:i&&n.jsxRuntimeExports.jsx(_s,{onClick:S})})},Zr=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:te.BaseButton,Button:te.Button,DataType:Br,Direction:zr,DropdownButton:te.DropdownButton,Multiple:ot,MultipleTag:Bs,Single:rt,defaultButton:te.defaultButton},Symbol.toStringTag,{value:"Module"})),Ie=6,Fr=2,Yt=5,qr=e=>l.To.width(e)<Yt&&l.To.height(e)<Yt,Hr=["zoom","pan","select","zoomReset"],Ze=[...Hr,"click"],Os=["zoom","select"],Fe={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},Ds={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},zs={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Mt={zoom:Fe,pan:Ds,select:zs,zoomReset:Fe,click:Fe},Gr=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([s,o])=>s==="defaultMode"?[s,o]:[s,o.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},Yr=l.To.construct(0,0,1,1,l.J.TOP_LEFT),Ur={width:30,height:50},As=({onChange:e,triggers:t,initial:s=Yr,threshold:o=Ur,ref:r})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[c,a]=x.useState(l.To.ZERO),[d,p]=x.useState(i),[m,f]=u.useStateRef(s),h=x.useRef(l.q.ZERO),E=x.useRef(null),g=l._.construct(o);x.useEffect(()=>f(()=>l.To.truncate(s,Ie)),[s]),x.useEffect(()=>p(i),[i]);const[S,C,v,y]=u.useMemoCompare(()=>{const P={...Mt[i],...t},B=u.flattenConfig(P),L=Gr(P);return[P,B,L,u.flattenConfig(L)]},u.compareModeConfigs,[t]),b=x.useCallback(({box:P,triggers:B,stage:L,cursor:_})=>{if(E.current==null)return;const M=u.determineMode(S,B),D=l.To.construct(E.current);if(M==null)return;if(M==="zoomReset")return a(l.To.ZERO),e==null||e({box:l.To.DECIMAL,mode:M,stage:L,cursor:_}),f(l.To.DECIMAL);const V=qr(P);if(L==="end"){if(V){M==="zoom"&&a(l.To.ZERO),e==null||e({box:m.current,mode:"click",stage:L,cursor:_});return}return f(Z=>{if(M==="pan"){const G=Ut(P,Z,D);return G===null||l.To.equals(G,Z)?Z:(e==null||e({box:G,mode:M,stage:L,cursor:_}),G)}const K=R(P,Z,D);return K===null?Z:(e==null||e({box:K,mode:M,stage:L,cursor:_}),M==="zoom"?(a(l.To.ZERO),K):l.To.truncate(Z,Ie))})}if(Os.includes(M))return V?void 0:a(l.k.XY.scale(D).clamp(D).translate({x:-l.To.left(D),y:-l.To.top(D)}).box(Wt(g,P,D)));if(a(Z=>l.To.areaIsZero(Z)?Z:l.To.ZERO),l.q.distance(_,h.current)<Fr)return;h.current=_;const U=Ut(P,m.current,D);e==null||e({box:U,mode:M,stage:L,cursor:_})},[a,p,e,S,o.height,o.width,f,E]);x.useImperativeHandle(r,()=>({reset:()=>{a(l.To.ZERO),f(l.To.DECIMAL),e==null||e({box:l.To.DECIMAL,mode:"zoomReset",stage:"start",cursor:l.q.ZERO})}}),[e]);const R=x.useCallback((P,B,L)=>l.To.truncate(jt(B,L).box(Wt(g,P,L)),Ie),[o]),w=u.useHeldRef({triggers:[["Control"]]}),T=u.useHeldRef({triggers:[["Alt"]]});x.useEffect(()=>{const P=B=>{if(E.current==null)return;let L=1;B.deltaY<0?L-=.035:L+=.035;const _=l.To.construct(E.current),M=l.q.construct(B);if(!l.To.contains(_,M)||B.target!==E.current)return;const V=jt(m.current,l.To.construct(E.current)).pos(l.q.construct(B));let Z=l.k.XY.magnify({x:w.current.held?1:L,y:T.current.held?1:L}).box(m.current);Z=l.To.translate(Z,{x:w.current.held?0:V.x*(1-L),y:T.current.held?0:V.y*(1-L)}),f(Z),e==null||e({stage:"end",box:Z,cursor:l.q.construct(B),mode:"zoom"})};return window.addEventListener("wheel",P),()=>window.removeEventListener("wheel",P)},[f,e]),Ct.useDrag({bound:E,onDrag:b,triggers:C,loose:!0});const $=x.useCallback(({triggers:P,stage:B})=>{if(B==="end")return p(i);const L=u.determineMode(v,P);L!=null&&p(L)},[v,i,e]);return u.use$2({triggers:y,callback:$,region:E}),{maskBox:c,ref:E,mode:d}},jt=(e,t)=>l.k.XY.scale(t).clamp(t).scale(e),Ut=(e,t,s)=>{let o=l.To.signedDims(jt(t,s).box(e));return o={signedWidth:-o.signedWidth,signedHeight:-o.signedHeight},l.To.truncate(l.k.XY.translate(l.q.construct(o)).box(t),Ie)},Wt=(e,t,s)=>l.To.height(t)<=e.height?l.To.construct(l.To.left(t),l.To.top(s),l.To.width(t),l.To.height(s)):l.To.width(t)<=e.width?l.To.construct(l.To.left(s),l.To.top(t),l.To.width(s),l.To.height(t)):t,Wr=({mode:e,triggers:t})=>n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",children:[n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:l.Ke.capitalize(e)}),n.jsxRuntimeExports.jsx(Ct.Text,{trigger:t[0],level:"small"})]}),Xr={zoom:n.jsxRuntimeExports.jsx(u.pt.Zoom,{}),pan:n.jsxRuntimeExports.jsx(u.pt.Pan,{}),select:n.jsxRuntimeExports.jsx(u.pt.Selection,{}),zoomReset:n.jsxRuntimeExports.jsx(u.pt.Expand,{}),click:n.jsxRuntimeExports.jsx(u.pt.Bolt,{})},Jr=({triggers:e,disable:t=["zoomReset","click"],...s})=>{const o=Object.entries(e).filter(([r])=>!t.includes(r)&&Ze.includes(r)).map(([r,i])=>({key:r,icon:Xr[r],tooltip:n.jsxRuntimeExports.jsx(Wr,{mode:r,triggers:i})})).sort((r,i)=>Ze.indexOf(r.key)-Ze.indexOf(i.key));return n.jsxRuntimeExports.jsx(te.Button,{...s,data:o,entryRenderKey:"icon",children:({title:r,entry:i,...c})=>x.createElement(u.Icon,{...c,key:i.key,variant:c.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},Kr=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Mt,MASK_MODES:Os,MODES:Ze,Mask:Lt,PAN_DEFAULT_TRIGGERS:Ds,SELECT_DEFAULT_TRIGGERS:zs,SelectMode:Jr,ZOOM_DEFAULT_TRIGGERS:Fe,use:As},Symbol.toStringTag,{value:"Module"})),Vs=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,$t=x.forwardRef(({children:e,initial:t=l.To.DECIMAL,onChange:s,...o},r)=>{const{setViewport:i}=de("Viewport");x.useLayoutEffect(()=>{i({box:t,mode:"zoom",cursor:l.q.ZERO,stage:"start"})},[i,t]);const c=x.useCallback(d=>{i(d),s==null||s(d)},[s,i]),a=As({onChange:c,initial:t,ref:r,...o});return n.jsxRuntimeExports.jsx(Lt,{className:l.CSS.BE("line-plot","viewport"),...a,children:e})});$t.displayName="Viewport";const Qr=Object.freeze(Object.defineProperty({__proto__:null,Legend:Ls,Line:Pt,LinePlot:vs,Title:$s,Tooltip:Mr,Viewport:$t,XAxis:ws,YAxis:Ts,axisFactory:kt,selectViewportEl:Vs,useContext:de,useGridEntry:nt,useViewport:bs},Symbol.toStringTag,{value:"Module"})),el=u.wrap$1("Tooltip",({aetherKey:e,...t})=>(u.use$3({aetherKey:e,type:j.Annotation.TYPE,schema:j.annotationStateZ,initialState:t}),null)),Is=u.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...s})=>{const{setViewport:o,setHold:r}=de("Range.Provider"),[,{hovered:i,count:c},a]=u.use$3({aetherKey:e,type:j.Provider$1.TYPE,schema:j.providerStateZ,initialState:{...s,cursor:null,hovered:null,count:0}}),d=nt({key:e,loc:"top",size:c>0?32:0,order:"last"},"Annotation.Provider"),p=u.useContextMenu(),m=u.useSyncedRef(p.visible),f=x.useCallback(h=>{const E=S=>{a(C=>({...C,cursor:{x:S.clientX,y:S.clientY}}))},g=h.currentTarget;g.addEventListener("mousemove",E),g.addEventListener("mouseleave",()=>{g.removeEventListener("mousemove",E),m.current||a(S=>({...S,cursor:null}))},{once:!0})},[a]);return n.jsxRuntimeExports.jsx(u.ContextMenu,{style:{...d,cursor:i!=null?"pointer":"default"},...p,menu:()=>t==null||i==null?null:t(i),children:n.jsxRuntimeExports.jsx(O.Space,{style:{width:"100%",height:"100%"},onClick:()=>{i!=null&&(o({box:l.To.construct({x:i.viewport.lower,y:0},{x:i.viewport.upper,y:1}),mode:"zoom",cursor:l.q.ZERO,stage:"start"}),r(!0))},onMouseEnter:f})})}),tl=Object.freeze(Object.defineProperty({__proto__:null,Annotation:el,Provider:Is},Symbol.toStringTag,{value:"Module"})),Zs={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},sl=u.flattenConfig(Zs),Fs=u.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=u.use$3({aetherKey:e,type:j.Measure.TYPE,schema:j.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=x.useRef(null),o=u.useHeldRef({triggers:sl,loose:!0}),r=x.useCallback(({mode:a,cursor:d})=>{if(a==="click"){const p=u.determineMode(Zs,o.current.triggers,!0);if(["one","two"].includes(p))return t(m=>({...m,[p]:d}));t(p==="clear"?m=>({...m,one:null,two:null}):m=>({...m,one:m.one??d,two:m.one!==null?d:m.two}))}},[t,o]);bs(r);const i=x.useCallback(a=>t(d=>({...d,hover:l.q.construct(a)})),[t]),c=x.useCallback(()=>{t(a=>({...a,hover:null}))},[t]);return x.useEffect(()=>{if(s.current===null)return;const a=s.current.parentElement;if(a!=null)return a.addEventListener("mousemove",i),a.addEventListener("mouseleave",c),()=>{a.removeEventListener("mousemove",i),a.removeEventListener("mouseleave",c)}},[r]),n.jsxRuntimeExports.jsx("span",{ref:s})}),nl=Object.freeze(Object.defineProperty({__proto__:null,Measure:Fs},Symbol.toStringTag,{value:"Module"})),Nt=u.wrap$1("Rule",({aetherKey:e,label:t,position:s,onLabelChange:o,onPositionChange:r,units:i="",color:c,lineWidth:a,lineDash:d})=>{const[p,m]=k.usePurePassthrough({value:t,onChange:o,initial:""}),[,{position:f,pixelPosition:h},E]=u.use$3({aetherKey:e,type:j.Rule.TYPE,schema:j.ruleStateZ,initialState:{color:c,dragging:!1,position:s,lineWidth:a,lineDash:d}});x.useEffect(()=>{if(f==null)return;if(s==null)return r==null?void 0:r(f);const R=l.C.construct(f+.01,f-.01);s!=null&&!l.C.contains(R,s)&&(r==null||r(Math.trunc(f*100)/100))},[f]);const g=x.useRef(h);h!==g.current&&(g.current=h);const S=x.useRef(h);x.useEffect(()=>{E(R=>({...R,position:s,color:c,lineWidth:a,lineDash:d}))},[s,c,a,d]);const C=tt({onStart:x.useCallback(()=>{E(R=>({...R,dragging:!0})),S.current=g.current},[]),onMove:R=>{E(w=>({...w,pixelPosition:(S.current??0)+l.To.signedHeight(R)}))},onEnd:x.useCallback(()=>{E(R=>({...R,dragging:!1})),S.current=h},[])}),v=x.useRef(null);if(f==null||h==null)return null;const y=Vs(v==null?void 0:v.current),b=n.jsxRuntimeExports.jsxs("div",{ref:v,className:l.CSS.B("rule"),style:{top:`calc(${h}px - 0.5rem)`},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("rule","drag-handle"),onDragStart:C,draggable:!0}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[n.jsxRuntimeExports.jsx(u.Editable,{level:"p",value:p,onChange:m}),n.jsxRuntimeExports.jsx(u.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${f.toFixed(2)} ${i}`})]})]});return y==null?b:ds.createPortal(b,y)}),ol=Object.freeze(Object.defineProperty({__proto__:null,Rule:Nt},Symbol.toStringTag,{value:"Module"})),qs=u.canDropOfType(oe),rl=({lines:e,axes:t,showTitle:s=!0,title:o="",onTitleChange:r,showLegend:i=!0,titleLevel:c="h4",onLineChange:a,onRuleChange:d,onAxisChannelDrop:p,onAxisChange:m,rules:f,enableTooltip:h=!0,enableMeasure:E=!1,initialViewport:g=l.To.DECIMAL,onViewportChange:S,viewportTriggers:C,annotationProvider:v,...y})=>{var $;const b=t.filter(({location:P})=>l.J.isY(P)),R=x.useRef(),w=u.usePrevious(e.length),T=u.usePrevious(y.hold);return(w===0&&e.length!==0||T===!0&&y.hold===!1)&&(($=R.current)==null||$.reset()),n.jsxRuntimeExports.jsxs(vs,{...y,children:[b.map((P,B)=>{const L=e.filter(D=>D.axes.x===P.key),_=t.filter(({location:D})=>l.J.isX(D)),M=f==null?void 0:f.filter(D=>[..._.map(({key:V})=>V),P.key].includes(D.axis));return n.jsxRuntimeExports.jsx(ll,{axis:P,index:B,lines:L,yAxes:_,rules:M,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:v},P.key)}),i&&n.jsxRuntimeExports.jsx(Ls,{onLineChange:a}),s&&n.jsxRuntimeExports.jsx($s,{value:o,onChange:r,level:c}),n.jsxRuntimeExports.jsxs($t,{initial:g,onChange:S,triggers:C,ref:R,children:[h&&n.jsxRuntimeExports.jsx(Ns,{}),E&&n.jsxRuntimeExports.jsx(Fs,{})]})]})},ll=({yAxes:e,lines:t,index:s,rules:o,onRuleChange:r,onAxisChannelDrop:i,onAxisChange:c,axis:{location:a,key:d,showGrid:p,...m},annotationProvider:f})=>{const h=u.useDrop({type:"Channel.LinePlot.XAxis",canDrop:qs,onDrop:x.useCallback(({items:g})=>{const S=u.filterByType(oe,g);return i==null||i(d,S.map(({key:C})=>C)),S},[d,i])}),E=o==null?void 0:o.filter(g=>g.axis===d);return n.jsxRuntimeExports.jsxs(ws,{...m,...h,location:a,showGrid:p??s===0,className:l.CSS(l.CSS.dropRegion(u.canDropOfType(oe)(u.useDraggingState()))),onAutoBoundsChange:g=>c==null?void 0:c({key:d,bounds:g}),children:[e.map((g,S)=>{const C=t.filter(y=>y.axes.y===g.key),v=o==null?void 0:o.filter(y=>y.axis===g.key);return n.jsxRuntimeExports.jsx(cl,{axis:{...g,showGrid:p??(s===0&&S===0)},lines:C,rules:v,onRuleChange:r,onAxisChannelDrop:i,onAxisChange:c},g.key)}),E==null?void 0:E.map(g=>x.createElement(Nt,{aetherKey:g.key,...g,key:g.key,onLabelChange:S=>r==null?void 0:r({key:g.key,label:S}),onPositionChange:S=>r==null?void 0:r({key:g.key,position:S})})),n.jsxRuntimeExports.jsx(Is,{...f})]})},il=({channels:{x:e,y:t}})=>`${e??0}-${t}`,cl=({lines:e,rules:t,onRuleChange:s,onAxisChannelDrop:o,onAxisChange:r,axis:{key:i,location:c,...a}})=>{const d=u.useDrop({type:"Channel.LinePlot.YAxis",canDrop:qs,onDrop:x.useCallback(({items:m})=>{const f=u.filterByType(oe,m);return o==null||o(i,f.map(({key:h})=>h)),f},[i,o])}),p=u.useDraggingState();return n.jsxRuntimeExports.jsxs(Ts,{...a,...d,location:c,className:l.CSS(l.CSS.dropRegion(u.canDropOfType(oe)(p))),onAutoBoundsChange:m=>r==null?void 0:r({key:i,bounds:m}),children:[e.map(m=>n.jsxRuntimeExports.jsx(al,{line:m},il(m))),t==null?void 0:t.map(m=>x.createElement(Nt,{aetherKey:m.key,...m,key:m.key,onLabelChange:f=>s==null?void 0:s({key:m.key,label:f}),onPositionChange:f=>s==null?void 0:s({key:m.key,position:f})}))]})},al=({line:e})=>e.variant==="static"?n.jsxRuntimeExports.jsx(xl,{line:e}):n.jsxRuntimeExports.jsx(ul,{line:e}),ul=({line:{key:e,timeSpan:t,channels:{x:s,y:o},...r}})=>{const i=Number(t.valueOf())*3,c=j.streamChannelData({timeSpan:t,channel:o,keepFor:i}),a=s!=null&&s!==0,d=j.streamChannelData({timeSpan:t,channel:a?s:o,useIndexOfChannel:!a,keepFor:i});return n.jsxRuntimeExports.jsx(Pt,{aetherKey:e,y:c,x:d,...r})},xl=({line:{timeRange:e,key:t,channels:{x:s,y:o},...r}})=>{const i=j.channelData({timeRange:e,channel:o}),c=s!=null&&s!==0,a=j.channelData({timeRange:e,channel:c?s:o,useIndexOfChannel:!c});return n.jsxRuntimeExports.jsx(Pt,{aetherKey:t,y:i,x:a,...r})},Xt=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],Ge=({items:e},t)=>{const s=u.filterByType(oe,e);return s.length>0&&!s.every(o=>t.includes(o.key))},Hs=["name","alias"],Gs=e=>{const t=st();return x.useMemo(()=>e.length===0?Xt:Xt.filter(s=>e.includes(s.key)),[e,t])},dl=({columns:e=Hs,onChange:t,className:s,value:o,searchOptions:r,...i})=>{const c=ye(),a=st(),d=Gs(e),p=wt(),m=u.useMemoDeepEqualProps(r),f=x.useMemo(()=>c==null?void 0:c.channels.newSearcherWithOptions({rangeKey:p,internal:!1,...m}),[c,p,m]),h=c!=null?void 0:n.jsxRuntimeExports.jsx(u.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:E,onDragEnd:g,...S}=u.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:x.useCallback(R=>Ge(R,k.A(o)),[o]),onDrop:x.useCallback(({items:R})=>{const w=u.filterByType(oe,R);if(w.length===0)return[];const T=k.n([...k.A(o),...w.map($=>$.key)]);return t(T,{clickedIndex:null,clicked:null,entries:[]}),w},[t,o])}),C=u.useDraggingState(),v=x.useCallback(({dropped:R})=>{t(k.A(o).filter(w=>!R.some(T=>T.key===w)),{clickedIndex:null,clicked:null,entries:[]})},[t,o]),y=x.useCallback((R,w)=>E([{key:w,type:oe}],v),[E,v]),b=x.useCallback(R=>a[R.key]??R.name,[a]);return n.jsxRuntimeExports.jsx(ot,{className:l.CSS(s,l.CSS.dropRegion(Ge(C,k.A(o)))),value:o,onTagDragStart:y,onTagDragEnd:g,searcher:f,onChange:t,columns:d,emptyContent:h,entryRenderKey:b,...S,...i})},Ne=({columns:e=Hs,onChange:t,value:s,className:o,data:r,searchOptions:i,...c})=>{const a=ye(),d=st(),p=Gs(e),m=wt(),f=u.useMemoDeepEqualProps(i),h=x.useMemo(()=>{if(!(r!=null&&r.length>0))return a==null?void 0:a.channels.newSearcherWithOptions({rangeKey:m,internal:!1,...f})},[a,m,r==null?void 0:r.length,f]),E=a!=null?void 0:n.jsxRuntimeExports.jsx(u.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),g=x.useId(),S=x.useMemo(()=>({key:g,type:"Channel.SelectMultiple"}),[g]),{startDrag:C,onDragEnd:v,...y}=u.useDragAndDrop({type:"Channel.SelectSingle",canDrop:x.useCallback(T=>Ge(T,k.o(s)),[s]),onDrop:x.useCallback(({items:T})=>{const $=u.filterByType(oe,T);return $.length===0?[]:(t($[0].key,{clickedIndex:null,clicked:null,entries:[]}),$)},[S,t])}),b=u.useDraggingState(),R=x.useCallback(()=>s!=null&&C([{type:oe,key:s}]),[C,s]),w=x.useCallback(T=>d[T.key]??T.name,[d]);return n.jsxRuntimeExports.jsx(rt,{data:r,className:l.CSS(o,l.CSS.dropRegion(Ge(b,k.o(s)))),value:s,onDragStart:R,onDragEnd:v,onChange:t,searcher:h,columns:p,emptyContent:E,entryRenderKey:w,...y,...c})},pl=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:gr,AliasProvider:Rs,LinePlot:rl,SelectMultiple:dl,SelectSingle:Ne,useActiveRange:wt,useAlias:Ss,useAliases:st,useContext:Es,useName:vt},Symbol.toStringTag,{value:"Module"})),Ys=e=>k.i(e,(t,s,o)=>{const r=s===o.length-1,i=!isNaN(parseInt(t)),c=!isNaN(parseInt(o[s+1]));return i&&(t="element"),r||c?t:[t,"shape"]}),Jt=(e,t)=>{if(e==null)return null;const s=e[t];return s==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:s},ml=(e,t,s)=>k.a(Jt(e,"shape"),Ys(t),s,{getter:Jt}),fl=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:ml,getFieldSchemaPath:Ys},Symbol.toStringTag,{value:"Module"})),_e=({path:e,optional:t=!1,onChange:s,defaultValue:o})=>{const r=pe(),{get:i,bind:c,set:a}=r,d=o!=null||(t??!1),[p,m]=x.useState(i({path:e,optional:d}));x.useLayoutEffect(()=>(m(i({path:e,optional:d})),c({path:e,onChange:m,listenToChildren:!1})),[e,c,m,d]);const f=x.useCallback(h=>{s==null||s(h,{...r,path:e}),a({path:e,value:h})},[e,a,s]);if(p==null){if(o!=null&&a({path:e,value:o}),!d)throw new Error(`Field state is null: ${e}`);return null}return{onChange:f,...p}},Us=(e,t=!1,s)=>{const{get:o,bind:r}=pe(s),[,i]=x.useState(0);return x.useLayoutEffect(()=>(i(c=>c+1),r({path:e,onChange:()=>i(c=>c+1)})),[e,r]),o({path:e,optional:t})??null},jl=(e,t=!1,s)=>{var c;const{get:o,bind:r}=pe(s),[,i]=x.useState(0);return x.useLayoutEffect(()=>(i(a=>a+1),r({path:e,onChange:()=>i(a=>a+1)})),[e,r]),((c=o({path:e,optional:t}))==null?void 0:c.value)??null},hl=e=>{var t,s;return((s=(t=Us(e,!0))==null?void 0:t.status)==null?void 0:s.variant)==="success"},gl=({path:e,ctx:t,onChange:s})=>{const o=pe(t);x.useLayoutEffect(()=>o.bind({path:e,onChange:r=>s(r,o),listenToChildren:!1}),[e,o])},El=({path:e,optional:t=!1})=>{const{bind:s,get:o}=pe(),[r,i]=x.useState(o({path:e,optional:t}));if(x.useLayoutEffect(()=>(i(o({path:e,optional:t})),s({path:e,onChange:c=>i({...c,value:k.D(c.value)}),listenToChildren:!0})),[e,s,o]),r==null&&!t)throw new Error("Field state is null");return(r==null?void 0:r.value)??null},Sl=({path:e,updateOnChildren:t=!1})=>{const{bind:s,get:o,set:r}=pe(),[i,c]=x.useState(o({path:e,optional:!1}).value);x.useLayoutEffect(()=>(c(o({path:e,optional:!1}).value),s({path:e,onChange:m=>c(k.D(m.value)),listenToChildren:t})),[e,s,o,c]);const a=x.useCallback(m=>{const f=k.D(o({path:e,optional:!1}).value);f.push(...k.A(m)),r({path:e,value:f})},[e,o,r]),d=x.useCallback(m=>{const f=o({path:e,optional:!1}).value,h=new Set(k.A(m));r({path:e,value:f.filter((E,g)=>!h.has(g))})},[e,i,o]),p=x.useCallback(m=>{const f=o({path:e,optional:!1}).value,h=new Set(k.A(m));r({path:e,value:f.filter((E,g)=>h.has(g))})},[e,i,o]);return{value:i,push:a,remove:d,keepOnly:p}},Rl=u.componentRenderProp(u.Text$1),re=({path:e,children:t=Rl,label:s,padHelpText:o=!0,visible:r=!0,hideIfNull:i=!1,optional:c,defaultValue:a,onChange:d,className:p,...m})=>{const f=_e({path:e,optional:c??i,onChange:d,defaultValue:a}),h=pe();if(f==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(s==null&&(s=l.Ke.capitalize(k._.element(e,-1))),r=typeof r=="function"?r(f,h):r,!r)return null;const E=f.touched?f.status.message:"",{onChange:g,value:S}=f;return n.jsxRuntimeExports.jsx(xe.Item,{padHelpText:o,helpText:E,helpTextVariant:f.status.variant,label:s,required:f.required,className:l.CSS(p,l.CSS.BE("field",e.split(".").join("-"))),...m,children:t({onChange:g,value:S})})},je=e=>({fieldKey:t,fieldProps:s,inputProps:o})=>{const r=({inputProps:i,path:c,fieldKey:a=t,...d})=>n.jsxRuntimeExports.jsx(re,{...s,...d,path:a?`${c}.${a}`:c,children:p=>n.jsxRuntimeExports.jsx(e,{...p,...o,...i})});return r.displayName=e.displayName,r},Ws=je(u.Numeric),Cl=Ws({}),Xs=je(u.Text$1),yl=Xs({}),Js=je(u.Switch$1),bl=Js({}),vl=je(rt),wl=je(ot),Tl=je(te.DropdownButton),_t=x.createContext({bind:()=>()=>{},set:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1}),pe=e=>{const t=x.useContext(_t);return e??t},Kt=e=>({key:e,variant:"success",message:""}),Qt=e=>e.code===ms.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",kl=({values:e,sync:t=!1,schema:s,onChange:o})=>{const r=x.useRef({state:e,status:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),i=u.useSyncedRef(s),c=u.useSyncedRef(o),a=x.useCallback(({path:g,onChange:S,listenToChildren:C=!1})=>{var R;const{parentListeners:v,listeners:y}=r.current,b=C?v:y;return b.has(g)||b.set(g,new Set),(R=b.get(g))==null||R.add(S),()=>{var w;return(w=b.get(g))==null?void 0:w.delete(S)}},[]),d=x.useCallback(({path:g,optional:S})=>{const{state:C,status:v,touched:y}=r.current,b=k._.get(C,g,S);if(b==null)return null;const R={value:b,status:v.get(g)??Kt(g),touched:y.has(g),required:!1};if(i.current==null)return R;const w=i.current,T=fl.getFieldSchema(w,g,!0);return T==null||(R.required=!T.isOptional()),R},[]),p=x.useCallback((g,S="")=>{const{status:C,listeners:v,touched:y}=r.current;if(g.success){const w=Array.from(C.keys());return C.clear(),w.forEach(T=>{var P;const $=d({path:T,optional:!0});$!=null&&((P=v.get(T))==null||P.forEach(B=>B($)))}),!0}let b=!0;const R=new Set(g.error.issues.map(w=>w.path.join(".")));return g.error.issues.forEach(w=>{var B;const T=w.path.join(".");if(!k._.pathsMatch(T,S))return;Qt(w)!=="warning"&&(b=!1),C.set(T,{key:T,variant:Qt(w),message:w.message}),y.add(T);let P=d({path:T,optional:!0});P==null&&(P={value:void 0,status:C.get(T)??Kt(T),touched:!1,required:!1}),(B=v.get(T))==null||B.forEach(L=>L(P))}),C.forEach((w,T)=>{var $;if(!R.has(T)){C.delete(T);const P=d({path:T,optional:!0});P!=null&&(($=v.get(T))==null||$.forEach(B=>B(P)))}}),b},[]),m=x.useCallback(g=>{if(i.current==null)return!0;const{state:S}=r.current,C=i.current.safeParse(S);return p(C,g)},[p]),f=x.useCallback(async g=>{if(i.current==null)return!0;const{state:S}=r.current,C=await i.current.safeParseAsync(S);return p(C,g)},[p]),h=x.useCallback(({path:g,value:S})=>{var R,w;const{state:C,touched:v,listeners:y,parentListeners:b}=r.current;v.add(g),g.length===0?r.current.state=S:k._.set(C,g,S);try{m()}catch{f()}(R=y.get(g))==null||R.forEach(T=>{const $=d({path:g,optional:!0});$!=null&&T($)}),b.forEach((T,$)=>{if(k._.pathsMatch(g,$)){const P=d({path:$,optional:!0});P!=null&&T.forEach(B=>B(P))}}),(w=c.current)==null||w.call(c,r.current.state)},[]),E=x.useCallback(g=>{const{state:S}=r.current;return k._.has(S,g)},[]);return x.useEffect(()=>{if(!t)return;const{listeners:g}=r.current;r.current.state=e,g.forEach((S,C)=>{const v=d({path:C,optional:!0});v!=null&&S.forEach(y=>y(v))})},[t,e]),x.useMemo(()=>({bind:a,set:h,get:d,validate:m,validateAsync:f,value:()=>r.current.state,has:E}),[a,h,d,m])},Pl=e=>n.jsxRuntimeExports.jsx(_t.Provider,{value:e,children:e.children}),Ll=Object.freeze(Object.defineProperty({__proto__:null,Context:_t,Field:re,Form:Pl,NumericField:Cl,SwitchField:bl,TextField:yl,buildButtonSelectField:Tl,buildNumericField:Ws,buildSelectMultiField:wl,buildSelectSingleField:vl,buildSwitchField:Js,buildTextField:Xs,fieldBuilder:je,use:kl,useChildFieldValues:El,useContext:pe,useField:_e,useFieldArray:Sl,useFieldListener:gl,useFieldState:Us,useFieldValid:hl,useFieldValue:jl},Symbol.toStringTag,{value:"Module"})),Ml=[{key:"name",name:"Name"},{key:"location",name:"Location"}],$l=({searchOptions:e,...t})=>{const s=ye();let o=s==null?void 0:s.hardware.devices;return e!=null&&s!=null&&(o=s.hardware.devices.newSearcherWithOptions(e)),n.jsxRuntimeExports.jsx(rt,{columns:Ml,searcher:o,entryRenderKey:"name",...t})},Nl=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:$l},Symbol.toStringTag,{value:"Module"})),Bt=new Error("Tab not found"),_l=new Error("Invalid Mosaic"),Ks=(e,t,s="center",o)=>{var d;if(e=he(e),o===void 0)return ht(e,t);const r=nn(e,o);if(s==="center")return(d=r.tabs)==null||d.push(t),r.selected=t.tabKey,e;if(r.tabs==null||r.tabs.length===0)return e;const[i,c,a]=Dl(s);if(r.direction=a,r[i]={key:0,tabs:[t],selected:t.tabKey},r[c]={key:0,tabs:r.tabs,selected:r.selected},r.first==null||r.last==null)throw _l;return r.first.key=r.key*2,r.last.key=r.key*2+1,r.tabs=void 0,r.size=void 0,r.selected=void 0,e},ht=(e,t)=>(e=he(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=ht(e.first,t):e.last!=null&&(e.last=ht(e.last,t)),e)),Ye=e=>{e=he(e);const t=[];if(e.tabs!=null&&(e.selected=Q.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[s,o]=Ye(e.first);e.first=s,t.push(...o)}if(e.last!=null){const[s,o]=Ye(e.last);e.last=s,t.push(...o)}return[e,t]},Ot=(e,t)=>{var r;e=he(e);const[,s]=Re(e,t);if(s==null)return[e,null];s.tabs=(r=s.tabs)==null?void 0:r.filter(i=>i.tabKey!==t),s.selected=Q.resetSelection(s.selected,s.tabs),e=Ol(e);const o=s.selected??Ue(e);return[e,o]},Ue=e=>e.selected!=null?e.selected:e.first!=null?Ue(e.first):e.last!=null?Ue(e.last):null,Qs=(e,t)=>{e=he(e);const[s,o]=Re(e,t);if(s==null||o==null)throw Bt;return o.selected=t,e},en=(e,t,s,o)=>{e=he(e);const[r,i]=Re(e,t);if(r==null||i==null)throw Bt;const[c,a]=Ot(e,t);return[Ks(c,r,s,o),a]},tn=(e,t,s)=>{const o=We(e,t);if(o==null)throw new Error("Node not found");return o.size=s,e},sn=(e,t,s)=>{e=he(e);const[,o]=Re(e,t);if((o==null?void 0:o.tabs)==null)throw Bt;return o.tabs=Q.rename(t,s,(o==null?void 0:o.tabs)??[]),e},Bl=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,nn=(e,t)=>{const s=We(e,t);if(s!=null)return s;const o=Math.floor(t/2);return o===0?e:nn(e,o)},Ol=e=>{let t=!0;for(;t;)[e,t]=gt(e);return e.first==null&&e.last==null&&(e.key=1),e},gt=e=>{if(e.first==null||e.last==null)return[e,!1];if(ts(e.first))return[es(e.last,!0),!0];if(ts(e.last))return[es(e.first,!1),!0];let[t,s]=[!1,!1];return[e.first,t]=gt(e.first),[e.last,s]=gt(e.last),[e,t||s]},es=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),ts=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Re=(e,t)=>{if(e.tabs!=null){const c=e.tabs.find(a=>a.tabKey===t);if(c!=null)return[c,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[s,o]=Re(e.first,t);if(s!=null&&o!=null)return[s,o];const[r,i]=Re(e.last,t);return[r,i]},We=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const s=We(e.first,t);return s??We(e.last,t)},Dl=e=>{switch(e){case"top":return["first","last","y"];case"left":return["first","last","x"];case"bottom":return["last","first","y"];case"right":return["last","first","x"];case"center":throw new Error("cannot split a center placed tab")}},he=e=>k._.copy(e),Xe=(e,t,s=[])=>(s.push(t(e)),e.first!=null&&Xe(e.first,t,s),e.last!=null&&Xe(e.last,t,s),s);class zl{constructor(t={}){ne(this,"parent");ne(this,"stub");ne(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([s,o])=>this.el.setAttribute(s,o))}mount(t,s){s!==this.stub&&(this.unmount(null),t.replaceChild(this.el,s),this.parent=t,this.stub=s)}unmount(t){t!=null&&t!==this.stub||this.parent==null||this.stub==null||(this.parent.replaceChild(this.stub,this.el),this.parent=void 0,this.stub=void 0)}}const Al=({node:e})=>{const t=x.createRef(),s=x.useRef(e);return x.useEffect(()=>{const o=t.current;if(o==null)return;const r=o.parentNode;if(r!=null)return e.mount(r,o),()=>{t.current!=null&&e.unmount(t.current)}},[]),x.useEffect(()=>{s.current!=null&&e!==s.current&&(s.current.unmount(t.current),s.current=e);const o=t.current;if(o==null)return;const r=o.parentNode;r!=null&&e.mount(r,o)},[e]),n.jsxRuntimeExports.jsx("div",{ref:t})},Vl=({node:e,children:t})=>ds.createPortal(t,e.el),on=x.memo(({children:e,...t})=>{const s=x.useRef(new Map),o=new Set,r=Xe(t.root,i=>{var d;if(i.selected==null)return null;let c=s.current.get(i.selected);const a=(d=i.tabs)==null?void 0:d.find(p=>p.tabKey===i.selected);return a==null?null:(c==null&&(c=new zl({style:"width: 100%; height: 100%; position: relative;"}),c.el.addEventListener("click",()=>{var p;return(p=t.onSelect)==null?void 0:p.call(t,a.tabKey)}),s.current.set(i.selected,c)),o.add(i.selected),n.jsxRuntimeExports.jsx(Vl,{node:c,children:e(a)},a.tabKey))});return s.current.forEach((i,c)=>!o.has(c)&&s.current.delete(c)),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[r,n.jsxRuntimeExports.jsx(Je,{portalNodes:s,...t})]})}),Je=x.memo(e=>{const{onResize:t,...s}=e,{root:{tabs:o,direction:r,first:i,last:c,key:a,size:d},emptyContent:p,...m}=s,f=x.useCallback(([g])=>t(a,g),[t]),{props:h}=yt({direction:r,onResize:f,count:2,initialSizes:d!=null?[d]:void 0});let E;return o!==void 0?E=n.jsxRuntimeExports.jsx(rn,{emptyContent:p,...s}):i!=null&&c!=null?E=n.jsxRuntimeExports.jsxs(et,{align:"stretch",className:l.CSS.BE("mosaic","resize"),...h,children:[n.jsxRuntimeExports.jsx(Je,{...m,root:i,onResize:t},i.key),n.jsxRuntimeExports.jsx(Je,{...m,root:c,onResize:t},c.key)]}):(E=null,console.warn("Mosaic tree is malformed")),a===1?n.jsxRuntimeExports.jsx(u.Provider$2,{children:E}):E});on.displayName="Mosaic";Je.displayName="Mosaic";const Ke="pluto-mosaic-tab-drop",Dt="pluto-mosaic-tab-create",Il=(e,t)=>{const s=u.filterByType(Ke,t).map(i=>i.key),o=e.filter(i=>!s.includes(i.tabKey)).length>0;return u.filterByType(Dt,t).length>0||s.length>0&&(o||e.length===0)},rn=x.memo(({root:e,onDrop:t,onCreate:s,portalNodes:o,activeTab:r,...i})=>{const{key:c,tabs:a}=e,[d,p]=x.useState(null),m=x.useCallback(({items:b})=>Il(a,b),[a]),f=x.useCallback(({items:b,event:R})=>{if(R==null)return[];p(null);const w=u.filterByType(Ke,b),T=a.length===0?"center":ns(ss(R));if(w.length>0){const P=w.map(({key:B})=>B)[0];t(c,P,T)}const $=u.filterByType(Dt,b);if($.length>0){const P=$.map(({key:B})=>B);s==null||s(c,T,P)}return w},[t,a.length]),h=x.useCallback(({event:b})=>{if(b==null)return;const R=a.length===0?"center":ns(ss(b));p(R)},[a.length]),{startDrag:E,...g}=u.useDragAndDrop({type:"Mosaic",canDrop:m,onDrop:f,onDragOver:h}),S=m(u.useDraggingState()),C=x.useCallback(()=>p(null),[]),v=x.useCallback((b,{tabKey:R})=>{E([{key:R,type:Ke,elementID:b.currentTarget.id}])},[E]),y=x.useCallback(()=>s==null?void 0:s(c,"center"),[c]);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS.BE("mosaic","leaf"),children:[n.jsxRuntimeExports.jsxs(Q.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:C,selected:e.selected,selectedAltColor:r===e.selected,onDragStart:v,onCreate:y,...i,...g,children:[n.jsxRuntimeExports.jsx(Al,{node:o.current.get(e.selected)}),S&&n.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),d!=null&&n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("mosaic","mask"),style:Zl[d]})]})});rn.displayName="MosaicTabLeaf";const Zl={top:{left:"0%",top:"0%",width:"100%",height:"50%"},bottom:{left:"0%",top:"50%",width:"100%",height:"50%"},left:{left:"0%",top:"0%",width:"50%",height:"100%"},right:{left:"50%",top:"0%",width:"50%",height:"100%"},center:{left:"0%",top:"0%",width:"100%",height:"100%"}},ss=e=>{const t=e.currentTarget.getBoundingClientRect(),s=e.clientX-t.left,o=e.clientY-t.top;return o<24?{px:.5,py:.5}:{px:s/t.width,py:o/t.height}},Fl=e=>e,ql=e=>1-e,ns=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[s,o]=[Fl(e),ql(e)];if(t>s&&t>o)return"bottom";if(t<s&&t<o)return"top";if(t>s&&t<o)return"left";if(t<s&&t>o)return"right";throw new Error("[bug] - invalid insert position")},Hl=({allowRename:e=!1,initialTree:t})=>{const[s,o]=x.useState(t);return x.useEffect(()=>o(Ye(t)[0]),[t]),{root:s,onDrop:(p,m,f)=>o(h=>en(h,m,f,p)[0]),onClose:p=>o(m=>Ot(m,p)[0]),onSelect:p=>o(m=>Qs(m,p)),onResize:(p,m)=>o(f=>tn(f,p,m)),onRename:e?(p,m)=>o(f=>sn(f,p,m)):void 0}},Gl=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Dt,HAUL_DROP_TYPE:Ke,Mosaic:on,autoSelectTabs:Ye,findSelected:Ue,insertTab:Ks,isEmpty:Bl,mapNodes:Xe,moveTab:en,removeTab:Ot,renameTab:sn,resizeNode:tn,selectTab:Qs,use:Hl},Symbol.toStringTag,{value:"Module"})),Yl=({location:e="left",size:t="9rem",className:s,style:o,...r})=>{const i=l.J.construct(e),c=l.J.direction(i),a=l.f.swap(c);return n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(l.CSS.B("navbar"),l.CSS.bordered(l.J.swap(i)),l.CSS.dir(a),l.CSS.loc(i),s),direction:a,style:{[l.f.dimension(c)]:t,...o},align:"center",empty:!0,...r})},Be=e=>({bordered:t=!1,className:s,...o})=>n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(l.CSS.BE("navbar","content"),e==="absolute-center"?l.CSS.M(e):l.CSS.align(e),e!==""&&t&&l.CSS.bordered(e),s),align:"center",...o}),ln=Be("start");ln.displayName="NavbarStart";const cn=Be("end");cn.displayName="NavbarEnd";const an=Be("center");an.displayName="NavbarCenter";const un=Be("");un.displayName="NavbarContent";const xn=Be("absolute-center");xn.displayName="NavbarAbsoluteCenter";const ve=Yl;ve.Start=ln;ve.Center=an;ve.End=cn;ve.AbsoluteCenter=xn;ve.Content=un;const zt=({aetherKey:e})=>{const[,{region:t},s]=u.use$3({aetherKey:e,type:j.Eraser$1.TYPE,schema:j.eraserStateZ,initialState:{region:l.To.ZERO,enabled:!0}}),o=u.useSyncedRef(t),r=x.useCallback(c=>{l.To.equals(c,o.current)||s(a=>({...a,region:c}))},[s]);return{setEnabled:x.useCallback(c=>s(a=>({...a,enabled:c})),[s]),erase:r}},Ul=u.wrap$1(j.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:s}=zt({aetherKey:e}),o=u.useResize(s);return n.jsxRuntimeExports.jsx("div",{ref:o,className:l.CSS(l.CSS.inheritDims()),children:t})}),Wl=Object.freeze(Object.defineProperty({__proto__:null,Eraser:Ul,use:zt},Symbol.toStringTag,{value:"Module"})),Xl=({items:e,initialKey:t})=>{const[s,o]=x.useState(t),r=c=>o(c===s?void 0:c),i=e.find(c=>c.key===s);return{onSelect:r,activeItem:i}},Jl=u.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:s,onSelect:o,location:r="left",collapseThreshold:i=.65,className:c,onResize:a,...d})=>{const p=l.J.direction(r),m=x.useCallback(()=>t!=null&&(o==null?void 0:o(t.key)),[o,t==null?void 0:t.key]),{erase:f,setEnabled:h}=zt({aetherKey:e}),E=x.useCallback((v,y)=>{a==null||a(v,y),f(y)},[a,f]);if(x.useLayoutEffect(()=>{h(t!=null)},[t,h]),t==null)return null;const{content:g,key:S,...C}=t;return n.jsxRuntimeExports.jsx(hs,{className:l.CSS(l.CSS.BE("navdrawer","content"),l.CSS.dir(p),c),collapseThreshold:i,onCollapse:m,location:r,onResize:E,...C,...d,children:t.content},S)}),Kl=Object.freeze(Object.defineProperty({__proto__:null,Bar:ve,Drawer:Jl,useDrawer:Xl},Symbol.toStringTag,{value:"Module"})),Ql=({variant:e,className:t,children:s,...o})=>n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(t,l.CSS.B("note"),l.CSS.M(e)),align:"stretch",empty:!0,...o,children:s}),ei=Object.freeze(Object.defineProperty({__proto__:null,Note:Ql},Symbol.toStringTag,{value:"Module"})),dt={Close:n.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),n.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:n.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:n.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),n.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},ti=({disabled:e=[],className:t,focused:s=!0,onMinimize:o,onMaximize:r,onFullscreen:i,onClose:c,...a})=>n.jsxRuntimeExports.jsxs(O.Space,{size:1.5,direction:"x",className:l.CSS(l.CSS.B("macos-controls"),!s&&l.CSS.BM("macos-controls","blurred"),t),...a,children:[n.jsxRuntimeExports.jsx(pt,{onClick:c,className:l.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:dt.Close}),n.jsxRuntimeExports.jsx(pt,{onClick:o,className:l.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:dt.Minimize}),n.jsxRuntimeExports.jsx(pt,{onClick:i,className:l.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:dt.Maximize})]}),pt=({className:e,disabled:t,...s})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("macos-control"),l.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),mt=({disabled:e=[],onMinimize:t,onMaximize:s,onClose:o,onFullscreen:r,...i})=>n.jsxRuntimeExports.jsxs(O.Pack,{...i,children:[n.jsxRuntimeExports.jsx(ft,{className:l.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:n.jsxRuntimeExports.jsx(u.pt.Subtract,{})}),n.jsxRuntimeExports.jsx(ft,{className:l.CSS.BM("windows-control","maximize"),onClick:s,disabled:e.includes("maximize"),children:n.jsxRuntimeExports.jsx(u.pt.Box,{})}),n.jsxRuntimeExports.jsx(ft,{onClick:o,className:l.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:n.jsxRuntimeExports.jsx(u.pt.Close,{})})]}),ft=({disabled:e=!1,className:t,...s})=>e?null:n.jsxRuntimeExports.jsx(u.Icon,{className:l.CSS(l.CSS.B("windows-control"),t),tabIndex:-1,...s}),dn=e=>k.w$1.getOS(e),si={MacOS:ti,Windows:mt,Linux:mt,Docker:mt},ni="Windows",oi=({forceOS:e,visibleIfOS:t,...s})=>{const o=dn({force:e,default:ni}),r=si[o];return t!=null&&t!==o?null:n.jsxRuntimeExports.jsx(r,{...s})},ri=Object.freeze(Object.defineProperty({__proto__:null,Controls:oi,use:dn},Symbol.toStringTag,{value:"Module"}));x.createContext({instrumentation:k.B.NOOP});const li=u.wrap$1(j.Provider$2.TYPE,({aetherKey:e,children:t,...s})=>{const o=u.useMemoDeepEqualProps(s),[{path:r},,i]=u.use$3({aetherKey:e,type:j.Provider$2.TYPE,schema:j.providerStateZ$1,initialState:o});return x.useEffect(()=>{i(o)},[o,i]),n.jsxRuntimeExports.jsx(u.Composite,{path:r,children:t})}),ii="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",pn=u.wrap$1(j.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:s}]=u.use$3({aetherKey:t,type:j.BaseProvider.TYPE,schema:j.providerStateZ$2,initialState:{}});return n.jsxRuntimeExports.jsx(u.Composite,{path:s,children:e})}),ci=Object.freeze(Object.defineProperty({__proto__:null,Provider:pn},Symbol.toStringTag,{value:"Module"})),ai=e=>{var t,s;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((s=e.data)==null?void 0:s.authority)===k.Dd.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},mn=u.wrap$1("Chip",({aetherKey:e,source:t,sink:s,className:o,...r})=>{const i=u.useMemoDeepEqualProps({source:t,sink:s}),[,{status:c},a]=u.use$3({aetherKey:e,type:j.Chip.TYPE,schema:j.chipStateZ,initialState:{triggered:!1,...i,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:k.m.now()}}});x.useEffect(()=>{a(E=>({...E,...i}))},[i,a]);const d=x.useCallback(()=>a(E=>({...E,triggered:!E.triggered})),[a]),{message:p,chipColor:m,buttonStyle:f,disabled:h}=ai(c);return n.jsxRuntimeExports.jsx(u.Icon,{variant:"text",className:l.CSS(l.CSS.B("control-chip"),o),disabled:h,onClick:d,tooltip:n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:p}),style:f,...r,children:n.jsxRuntimeExports.jsx(u.pt.Circle,{color:m})})}),fn=x.createContext({needsControlOf:[]}),jn=()=>x.useContext(fn),ui=u.wrap$1(j.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:s,...o})=>{const r=u.useMemoDeepEqualProps(o),[{path:i},{status:c,needsControlOf:a},d]=u.use$3({aetherKey:e,type:j.Controller$1.TYPE,schema:j.controllerStateZ,initialState:r});return x.useEffect(()=>{c!=null&&(s==null||s(c))},[c,s]),x.useEffect(()=>{d(p=>({...p,...r}))},[r,d]),x.useEffect(()=>()=>s==null?void 0:s("released"),[]),n.jsxRuntimeExports.jsxs(fn.Provider,{value:{needsControlOf:a},children:[n.jsxRuntimeExports.jsx(u.Composite,{path:i,children:t}),";"]})}),hn=u.wrap$1(j.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:s})=>{var d;const o=u.useMemoDeepEqualProps({colorSource:t,statusSource:s}),[,{color:r,status:i},c]=u.use$3({aetherKey:e,type:j.Indicator.TYPE,initialState:{...o,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:k.m.now()}},schema:j.indicatorStateZ});x.useEffect(()=>{c(p=>({...p,...o}))},[o,c]);let a;return((d=i.data)==null?void 0:d.color)!=null?a=l.Color.z.parse(i.data.color):r!=null&&!r.isZero?a=r:a="var(--pluto-gray-l8)",n.jsxRuntimeExports.jsxs(u.Dialog$1,{location:{x:"center",y:"bottom"},children:[n.jsxRuntimeExports.jsx(u.Text,{level:"p",children:i.message}),n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("indicator"),style:{backgroundColor:l.cssString(a),flexGrow:1}})]})}),xi=u.wrap$1(j.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:s}=jn(),[,{states:o},r]=u.use$3({aetherKey:e,type:j.Legend.TYPE,schema:j.legendStateZ,initialState:{states:[],needsControlOf:s}});x.useEffect(()=>{r(a=>({...a,needsControlOf:s}))},[s]);const c=k.n(o.map(a=>a.subject.key)).map(a=>{const d=o.find(p=>p.subject.key===a);if(d==null)throw new k.ze("Legend subject not found");return{key:d.subject.key,label:d.subject.name,color:d.subjectColor}});return n.jsxRuntimeExports.jsx(Ps,{data:c,...t})}),gn=u.wrap$1(j.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:s}]=u.use$3({aetherKey:e,type:j.StateProvider.TYPE,schema:j.stateProviderStateZ,initialState:{}});return n.jsxRuntimeExports.jsx(u.Composite,{path:s,children:t})}),di=Object.freeze(Object.defineProperty({__proto__:null,Chip:mn,Controller:ui,Indicator:hn,Legend:xi,StateProvider:gn,useContext:jn},Symbol.toStringTag,{value:"Module"})),En=e=>{const t=({disabled:s=!1,...o})=>s?o.children:n.jsxRuntimeExports.jsx(e,{...o});return t.displayName=e.displayName,t},pi=En(pn),mi=En(u.Provider$3),fi=({children:e,connParams:t,workerEnabled:s=!0,workerURL:o,theming:r,tooltip:i,triggers:c,alamos:a,haul:d,channelAlias:p,telem:m})=>n.jsxRuntimeExports.jsx(u.Provider$1,{...c,children:n.jsxRuntimeExports.jsx(u.Config,{...i,children:n.jsxRuntimeExports.jsx(u.Provider$2,{...d,children:n.jsxRuntimeExports.jsx(u.Provider$4,{url:o??ii,enabled:s,children:n.jsxRuntimeExports.jsx(mi,{workerKey:"vis",children:n.jsxRuntimeExports.jsx(li,{...a,children:n.jsxRuntimeExports.jsx(u.Aggregator,{children:n.jsxRuntimeExports.jsx(gs,{connParams:t,children:n.jsxRuntimeExports.jsx(Rs,{...p,children:n.jsxRuntimeExports.jsx(pi,{...m,children:n.jsxRuntimeExports.jsx(u.Provider,{...r,children:n.jsxRuntimeExports.jsx(gn,{children:e})})})})})})})})})})})}),ji=Object.freeze(Object.defineProperty({__proto__:null,Provider:fi},Symbol.toStringTag,{value:"Module"})),hi=({value:e})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress"),children:n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress-bar"),style:{width:`${e}%`}})}),gi=Object.freeze(Object.defineProperty({__proto__:null,Progress:hi},Symbol.toStringTag,{value:"Module"})),Ei=[{key:"color",name:"Color",width:50,render:e=>n.jsxRuntimeExports.jsx(u.pt.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Si=e=>{const t=ye();return n.jsxRuntimeExports.jsx(ot,{...e,searcher:t==null?void 0:t.labels,columns:Ei,renderTag:s=>s.entry==null?n.jsxRuntimeExports.jsx(He,{color:"gray",children:s.entryKey}):n.jsxRuntimeExports.jsx(He,{color:s.entry.color,children:s.entry.name})})},Ri=({timeRange:e})=>{const t=new k.m(e.start),s=t.isToday?"time":"dateTime",o=new k.m(e.end),r=o.equals(k.m.MAX),i=o.span(t)<k.w.DAY?"time":"dateTime";return n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",size:"small",className:l.CSS(l.CSS.B("time-range-chip")),align:"center",children:[t.isToday&&n.jsxRuntimeExports.jsx(u.Text,{level:"p",shade:7,weight:450,children:"Today"}),n.jsxRuntimeExports.jsx(u.DateTime,{level:"p",displayTZ:"local",format:s,shade:7,weight:450,children:t}),n.jsxRuntimeExports.jsx(u.pt.Arrow.Right,{color:"var(--pluto-text-color)"}),r?n.jsxRuntimeExports.jsx(u.Text,{level:"p",children:"Now"}):n.jsxRuntimeExports.jsx(u.DateTime,{level:"p",displayTZ:"local",format:i,shade:7,weight:450,children:o})]})},Ci=Object.freeze(Object.defineProperty({__proto__:null,SelectLabels:Si,TimeRangeChip:Ri},Symbol.toStringTag,{value:"Module"})),yi=({steps:e,value:t,onChange:s,...o})=>{const r=e.findIndex(i=>i.key===t);return n.jsxRuntimeExports.jsx(O.Space,{direction:"x",align:"center",className:l.CSS.B("steps"),...o,children:e.map((i,c)=>n.jsxRuntimeExports.jsxs(x.Fragment,{children:[n.jsxRuntimeExports.jsxs(u.Button,{onClick:()=>s(i.key),variant:"outlined",disabled:c>r,children:[c+1,". ",i.title]},i.key),c!==e.length-1&&n.jsxRuntimeExports.jsx(u.pt.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},bi=Object.freeze(Object.defineProperty({__proto__:null,Steps:yi},Symbol.toStringTag,{value:"Module"})),vi=(e,t="x")=>{if(e.length===0)return[];const s=l.J.construct(t),o=l.J.swap(s);return e.sort((r,i)=>l.To.loc(r.box,s)-l.To.loc(i.box,s)),e.forEach((r,i)=>{if(i===0)return;const a=e[i-1].handles.find(E=>E.orientation===o),d=r.handles.find(E=>E.orientation===s);if(a==null||d==null)return;const p=a.absolutePosition,m=d.absolutePosition,f=l.q.set(l.q.translation(m,p),t,0),h=l.q.translate(l.To.topLeft(r.box),f);r.box=l.To.construct(h,l.To.dims(r.box))}),e},os=({sourcePos:e,targetPos:t,next:s,prev:o})=>{const r=$e(e,...s);return l.q.distance(r,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",r),console.log("Actual target",t),console.log("Segments",s),console.log("Prev segments",o),!1)},rs=({sourceStumpTip:e,sourceOrientation:t,sourceBox:s,targetStumpTip:o,targetOrientation:r,targetBox:i})=>{if(!wi({sourcePos:e,sourceOrientation:t,targetPos:o}))return;const c=l.f.construct(t),a=l.f.swap(c);let d=me(a,o[a]-e[a]);const p=l.To.loc(s,d);if(l.J.swap(t)===r){const m=l.To.loc(i,l.J.swap(d));Math.abs(p-m)<ee&&(d=l.J.swap(d))}return{direction:a,length:p-e[a]+fe(d,ee)}},$e=(e,...t)=>{let s=e;for(const o of t)s=l.q.translate(s,o.direction,o.length);return s},Sn=(e,t,s,o)=>{try{let r=e;const i=[e,...t.map(h=>(r=l.q.translate(r,h.direction,h.length),r))];if(!o)return i;const c=t[0],a=me(c.direction,c.length),d=ls(a);i[0]=l.q.translate(i[0],{[c.direction]:-1*d*4*s,[l.f.swap(c.direction)]:0});const p=t[t.length-1],m=me(p.direction,p.length),f=ls(m);return i[i.length-1]=l.q.translate(i[i.length-1],{[p.direction]:f*4*s,[l.f.swap(p.direction)]:0}),i}catch{return[]}},ee=10,ls=e=>e==="top"||e==="left"?-1:1,fe=(e,t)=>e==="top"||e==="left"?-t:t,me=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ue=e=>me(e.direction,e.length),wi=({sourcePos:e,targetPos:t,sourceOrientation:s})=>{const o=l.f.construct(s),r=t[o]-e[o];return fe(s,r)<0},ze=e=>({direction:l.f.construct(e),length:fe(e,ee)}),is={top:ze("top"),bottom:ze("bottom"),left:ze("left"),right:ze("right")},Ti=4,ki=.25,lt=e=>Et(Pi(Et(e))),Pi=e=>{const t=[...e],s=e.findIndex((o,r)=>{const i=Math.abs(o.length);if(i<Ti){if(i<ki)return!0;if(r===0||r===e.length-1||e.length<=3)return!1;if(r+2<e.length){const c=t[r+2];if(c.direction!==o.direction)return!1;t[r+2]={...c,length:c.length+o.length}}else{const c=t[r-2];if(c.direction!==o.direction)return!1;t[r-2]={...c,length:c.length+o.length}}return!0}return!1});return s!==-1&&t.splice(s,1),t},Et=e=>{const t=[...e];return e.findIndex((o,r)=>{const i=t[r-1];if(r===0||o.direction!==i.direction)return!1;if(r===1){const c=r-1,a=r,d=ue(i),p=ue(o);if(d===p)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(i.length)===ee)return!1;const m=fe(d,ee),f=t[c].length-m,h=t[a].length+f;return Math.abs(h)<ee?!1:(t[c]={...t[c],length:m},t[a]={...t[a],length:h},!0)}if(r===e.length-1){const c=r,a=r-1,d=ue(o),p=ue(i);if(d===p)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(o.length)===ee)return!1;const m=fe(d,ee),f=t[c].length-m,h=t[a].length+f;return Math.abs(h)<ee?!1:(t[c]={...t[c],length:m},t[a]={...t[a],length:h},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?Et(t):t},Se=e=>lt(Li(e)),Li=({sourceBox:e,targetBox:t,sourcePos:s,targetPos:o,targetOrientation:r,sourceOrientation:i})=>{let c=i,a=r,d={...is[i]},p=$e(s,d);const m={...is[r]};let f=$e(o,m);const h=[d],E=rs({sourceStumpTip:p,sourceOrientation:i,sourceBox:e,targetStumpTip:f,targetOrientation:r,targetBox:t});E!=null&&(h.push(E),p=$e(p,E),c=ue(E),d=E);const g=rs({sourceStumpTip:f,sourceOrientation:a,sourceBox:t,targetStumpTip:p,targetOrientation:c,targetBox:e});g!=null&&(f=$e(f,g),a=me(g.direction,g.length));const S=()=>{g!=null&&(g.length*=-1,h.push(g)),m.length*=-1,h.push(m)};if(l.J.swap(c)===r){const w=l.f.construct(c),T=(f[w]-p[w])/2;h.push({direction:w,length:T});const $=l.f.swap(w);return h.push({direction:$,length:f[$]-p[$]}),h.push({direction:w,length:T}),S(),h}const C=f[d.direction]-p[d.direction];let v=l.f.swap(d.direction);const y=p[v]-f[v];let b;me(d.direction,C)===c&&me(v,y)===a?b={direction:d.direction,length:C}:(b={direction:v,length:f[v]-p[v]},v=l.f.swap(v)),h.push(b);const R={direction:v,length:f[v]-p[v]};return h.push(R),S(),h},Mi=e=>lt($i(e)),$i=({segments:e,index:t,magnitude:s})=>{const o=[...e],r=o[t],i=l.f.swap(r.direction),c=ue(r);if(t===0){o.unshift({direction:i,length:s});const a=fe(c,ee);o.unshift({direction:r.direction,length:a}),t+=2,o[t]={...o[t],length:o[t].length-a}}else o[t-1]={direction:o[t-1].direction,length:o[t-1].length+s};if(t===o.length-1){o.push({direction:i,length:-s});const a=fe(c,ee);o.push({direction:r.direction,length:a}),o[t]={...o[t],length:o[t].length-a}}else o[t+1]={direction:o[t+1].direction,length:o[t+1].length-s};return o},Ni=(e,t)=>{for(let s=e.length-1;s>=0;s--)if(t(e[s],s))return s;return-1},_i=(e,t,s=!1,...o)=>{const r=(i,c)=>!o.includes(c)&&t(i,c);return s?Ni(e,r):e.findIndex(r)},Bi=({delta:e,segments:t})=>lt(Rn(e,t,!1)),Oi=({delta:e,segments:t})=>lt(Rn(e,t,!0)),Rn=(e,t,s)=>{let o=[...t];return e.x!==0&&(o=as("x",e,o,s)),e.y!==0&&(o=as("y",e,o,s)),o},cs=(e,t,s)=>{if(t.direction!==e)return!1;const o={...t,length:t.length-s[e]},r=ue(t),i=ue(o);return Math.abs(o.length)>ee&&r===i},as=(e,t,s,o)=>{const r=l.f.swap(e),i=o?s.length-1:0,c=s[i];if(cs(e,c,t))return s[i]={...c,length:c.length-t[e]},s;const a=o?0:s.length-1,p=_i(s,f=>f.direction===e,o,i);if(p===a){const f=s[a];return cs(e,f,t)?(s[a]={...f,length:f.length-t[e]},s):(c.direction===e?s[i]={...c,length:c.length-t[e]}:s[a]={...f,length:f.length-t[e]},s)}if(p===-1)return s.length===1?s[0].direction===e?[{direction:e,length:s[0].length-t[e]}]:[{direction:r,length:s[0].length/2},{direction:e,length:-t[e]},{direction:r,length:s[0].length/2}]:c.direction===e?(s[i]={...c,length:c.length-t[e]},s):[{direction:r,length:s[0].length},{direction:e,length:-t[e]},...s.slice(1)];const m=s[p];return s[p]={...m,length:m.length-t[e]},s},At=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},X=(e,t)=>{const s=At(t),o=e.getNodes().find(r=>r.id===t);if(o==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return l.To.construct(o.position,l.To.dims(l.To.construct(s)))},Di=(e,t)=>it.fromFlow(e,t);class Cn{constructor(t,s){ne(this,"node_",null);ne(this,"position");ne(this,"orientation");this.position=t,this.orientation=s}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[schematic] - handle has no node");return this.node_}get absolutePosition(){return l.q.translate(l.To.topLeft(this.node.box),this.position)}}class it{constructor(t,s,o){ne(this,"key");ne(this,"box");ne(this,"handles");this.key=t,this.box=s,this.handles=o,o.forEach(r=>r.node=this)}static fromFlow(t,s){const o=X(s,t),r=At(t),i=r.getElementsByClassName("react-flow__handle"),c=l.To.construct(r),a=Array.from(i).map(d=>{const p=l.To.center(l.To.construct(d)),m=l.q.translation(l.To.topLeft(c),p),f=d.className.match(/react-flow__handle-(\w+)/);if(f==null)throw new Error("[schematic] - cannot find handle orientation");const h=l.J.construct(f[0]);return new Cn(m,h)});return new it(t,o,a)}}const zi=({fromX:e,fromY:t,toX:s,toY:o,fromPosition:r,toPosition:i,fromNode:c,connectionLineStyle:a,connectionStatus:d})=>{const p=document.querySelector(".react-flow__handle-connecting"),m=p==null?void 0:p.className.match(/react-flow__handle-(\w+)/);if(m!=null){const g=l.J.outer.safeParse(m[1]);g.success&&(i=g.data)}const f=Se({sourcePos:l.q.construct(e,t),targetPos:l.q.construct(s,o),sourceOrientation:r,targetOrientation:i,sourceBox:X(j.useReactFlow(),(c==null?void 0:c.id)??""),targetBox:X(j.useReactFlow(),(c==null?void 0:c.id)??"")}),h=j.useReactFlow(),E=Sn(l.q.construct(e,t),f,h.getZoom(),!1);return n.jsxRuntimeExports.jsx(j.BaseEdge,{path:yn(E),style:{...a,stroke:l.cssString(d==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},Ai=({id:e,source:t,target:s,sourcePosition:o,targetHandleId:r,targetPosition:i,style:c,segments:a=[],onSegmentsChange:d,color:p="var(--pluto-gray-l9)",selected:m=!1,...f})=>{const h=l.q.construct(f.sourceX,f.sourceY),E=x.useRef(h),g=l.q.equals(h,E.current),S=l.q.construct(f.targetX,f.targetY),C=x.useRef(S),v=l.q.equals(S,C.current),y=j.useReactFlow(),[b,R,w]=u.useCombinedStateAndRef(()=>a.length>0?a:Se({sourcePos:h,targetPos:S,sourceOrientation:o,targetOrientation:i,sourceBox:X(y,t),targetBox:X(y,s)})),T=x.useRef(i),$=x.useRef(o),P=u.useDebouncedCallback(d,100,[d]);if(!g||!v){let M=b;const D=l.q.translation(E.current,h),V=l.q.translation(S,C.current);l.q.equals(D,l.q.scale(V,-1),.001)?(E.current=h,C.current=S):(g?v||(M=Oi({delta:V,segments:M}),T.current!==i&&(T.current=i,M=Se({sourcePos:h,targetPos:S,sourceOrientation:o,targetOrientation:i,sourceBox:X(y,t),targetBox:X(y,s)})),os({sourcePos:h,targetPos:S,next:M,prev:b})||(M=Se({sourcePos:h,targetPos:S,sourceOrientation:o,targetOrientation:i,sourceBox:X(y,t),targetBox:X(y,s)})),C.current=S):(M=Bi({delta:D,segments:M}),$.current!==o&&($.current=o,M=Se({sourcePos:h,targetPos:S,sourceOrientation:o,targetOrientation:i,sourceBox:X(y,t),targetBox:X(y,s)})),os({sourcePos:h,targetPos:S,next:M,prev:b})||(M=Se({sourcePos:h,targetPos:S,sourceOrientation:o,targetOrientation:i,sourceBox:X(y,t),targetBox:X(y,s)})),E.current=h),P(M),R(M))}const B=x.useRef(null),L=tt({onStart:x.useCallback((M,D,V)=>{B.current={index:Number(V.currentTarget.id.split("-")[1]),segments:[...w.current]}},[]),onMove:x.useCallback(M=>{if(B.current==null)return;const D=Mi({segments:B.current.segments,index:B.current.index,magnitude:l.To.dim(M,l.f.swap(B.current.segments[B.current.index].direction),!0)/y.getZoom()});R(D)},[]),onEnd:x.useCallback(()=>d(w.current),[d])}),_=Sn(h,b,y.getZoom(),!0);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(j.BaseEdge,{path:yn(_),style:{...c,stroke:l.cssString(p)},...f}),m&&Vi(_).map((M,D)=>{const V=b[D].direction,U=l.f.swap(V),Z={[l.f.dimension(V)]:"18px",[l.f.dimension(U)]:"4px"},K={[V]:M[V]-9,[U]:M[U]-2};return n.jsxRuntimeExports.jsxs(x.Fragment,{children:[n.jsxRuntimeExports.jsx("rect",{className:l.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...Z,...K,rx:"2px",ry:"2px"}),n.jsxRuntimeExports.jsx("foreignObject",{x:M.x-9,y:M.y-9,width:"18px",height:"18px",children:n.jsxRuntimeExports.jsx("div",{id:`handle-${D}`,className:l.CSS(l.CSS.BE("diagram-edge-handle","dragger"),l.CSS.dir(V)),draggable:!0,onDragStart:L})})]},D)})]})},yn=e=>{let t="";const o=e.length+-1;for(let r=0;r<o;r++){const i=e[r%e.length],c=e[(r+1)%e.length],a=Math.min(6/Math.hypot(c.x-i.x,c.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-a)+c.x*a},${i.y*(1-a)+c.y*a}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-a)+c.x*a},${i.y*(1-a)+c.y*a}`),r===o-1?t+=`L${c.x},${c.y}`:r<o-1&&(t+=`L${i.x*a+c.x*(1-a)},${i.y*a+c.y*(1-a)}`)}return t},Vi=e=>e.slice(1).map((t,s)=>{const o=e[s];return l.q.construct((t.x+o.x)/2,(t.y+o.y)/2)}),Ii=({initialNodes:e,initialEdges:t,allowEdit:s=!0,initialViewport:o={position:l.q.ZERO,zoom:1}})=>{const[r,i]=x.useState(s),[c,a]=x.useState(e),[d,p]=x.useState(t),[m,f]=x.useState(o),[h,E]=x.useState(!1);return{viewport:m,onViewportChange:f,edges:d,nodes:c,onNodesChange:a,onEdgesChange:p,editable:r,onEditableChange:i,fitViewOnResize:h,setFitViewOnResize:E}},Zi=e=>e.source!==e.target,Fi={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},qi={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesUpdatable:!1,nodesFocusable:!1,edgeUpdaterRadius:0},bn={padding:0,maxZoom:1,minZoom:.5},Hi={hideAttribution:!0},vn=x.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Oe=()=>x.useContext(vn),wn=x.memo(({children:e})=>{const{registerNodeRenderer:t}=Oe();return x.useEffect(()=>t(e),[t,e]),null});wn.displayName="NodeRenderer";const Gi=["Backspace","Delete"],Yi=u.wrap$1(j.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:s,onEdgesChange:o,nodes:r,edges:i,onEditableChange:c,editable:a,viewport:d,triggers:p,onViewportChange:m,fitViewOnResize:f,setFitViewOnResize:h,...E})=>{const[{path:g},,S]=u.use$3({aetherKey:e,type:j.Diagram$1.TYPE,schema:j.diagramStateZ,initialState:{position:d.position,region:l.To.ZERO,zoom:d.zoom}}),C=u.use().colors.gray.l9.hex,v=u.useMemoCompare(()=>p??Mt.zoom,u.compareModeConfigs,[p]),{fitView:y}=j.useReactFlow(),b=Tt(x.useCallback(A=>{f&&y({maxZoom:1}),S(I=>({...I,region:A}))},[S,y,f])),R=x.useRef(null),w=x.useCallback(A=>{const I=R.current;I!=null&&I.x===A.x&&I.y===A.y&&I.zoom===A.zoom||(R.current=A,S(W=>({...W,position:A,zoom:A.zoom})),m(j.translateViewportBackward(A)))},[S,m]);j.useOnViewportChange({onStart:w,onChange:w,onEnd:w});const[T,$]=x.useState(()=>()=>null),P=x.useCallback(A=>$(()=>A),[]),B=x.useMemo(()=>({custom:({id:A,xPos:I,yPos:W,selected:Me})=>T({symbolKey:A,position:{x:I,y:W},selected:Me})}),[T]),L=x.useRef(i),_=x.useMemo(()=>(L.current=i,j.translateEdgesForward(i)),[i]),M=x.useRef(r),D=x.useMemo(()=>(M.current=r,j.translateNodesForward(r)),[r]),V=x.useCallback(A=>s(j.nodeConverter(M.current,I=>j.applyNodeChanges(A,I))),[s]),U=x.useCallback(A=>o(j.edgeConverter(L.current,I=>j.applyEdgeChanges(A,I),C)),[o,C]),Z=x.useCallback((A,I)=>o(j.edgeConverter(L.current,W=>j.updateEdge(A,I,W),C)),[]),K=x.useCallback(A=>{o(j.edgeConverter(L.current,I=>j.addEdge(A,I),C))},[o,C]),G=x.useCallback((A,I)=>{const W=[...L.current],Me=W.findIndex(Io=>Io.key===A);Me!==-1&&(W[Me]={...W[Me],segments:I},L.current=W,o(W))},[o]),Le=a?Fi:qi,ct=x.useMemo(()=>({default:A=>n.jsxRuntimeExports.jsx(Ai,{...A,segments:A.data.segments,color:A.data.color,onSegmentsChange:x.useCallback(I=>G(A.id,I),[A.id])},A.id)}),[G]),It=x.useRef(null);u.use$2({triggers:v.zoomReset,callback:x.useCallback(({stage:A,cursor:I})=>{const W=It.current;W==null||A!=="start"||!l.To.contains(W,I)||y()},[y])});const Zt=u.purgeMouse(v.select)[0]??null,Ft=u.purgeMouse(v.pan)[0]??null,Do=u.purgeMouse(v.zoom)[0]??null,zo={selectionOnDrag:Zt==null,panOnDrag:Ft==null,selectionKeyCode:Zt,panActivationKeyCode:Ft,zoomActivationKeyCode:Do},Ao=u.useCombinedRefs(It,b),Vo=x.useMemo(()=>({editable:a,onEditableChange:c,registerNodeRenderer:P,fitViewOnResize:f,setFitViewOnResize:h}),[a,c,P,f]);return n.jsxRuntimeExports.jsx(vn.Provider,{value:Vo,children:n.jsxRuntimeExports.jsx(u.Composite,{path:g,children:n.jsxRuntimeExports.jsx(j.ReactFlow,{...zo,className:l.CSS(l.CSS.B("diagram"),l.CSS.editable(a)),nodes:D,edges:_,nodeTypes:B,edgeTypes:ct,ref:Ao,fitView:!0,onNodesChange:V,onEdgesChange:U,onConnect:K,onEdgeUpdate:Z,defaultViewport:j.translateViewportForward(d),connectionLineComponent:zi,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:Zi,connectionMode:j.ConnectionMode.Loose,snapGrid:[3,3],fitViewOptions:bn,selectionMode:j.SelectionMode.Partial,proOptions:Hi,deleteKeyCode:Gi,...E,style:{[l.CSS.var("diagram-zoom")]:d.zoom,...E.style},...Le,children:t})})})}),Ui=()=>{const{editable:e}=Oe();return e?n.jsxRuntimeExports.jsx(br,{}):null},Wi=({children:e,...t})=>n.jsxRuntimeExports.jsx(O.Pack,{direction:"y",className:l.CSS.BE("diagram","controls"),...t,children:e}),Xi=({onClick:e,...t})=>{const{editable:s,onEditableChange:o}=Oe();return n.jsxRuntimeExports.jsx(u.ToggleIcon,{onChange:()=>o(!s),value:s,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:l.J.RIGHT_CENTER,tooltip:s?n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Disable edit mode"}):n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Enable edit mode"}),...t,children:s?n.jsxRuntimeExports.jsx(u.pt.EditOff,{}):n.jsxRuntimeExports.jsx(u.pt.Edit,{})})},Ji=({onClick:e,...t})=>{const{fitView:s}=j.useReactFlow(),{fitViewOnResize:o,setFitViewOnResize:r}=Oe();return n.jsxRuntimeExports.jsx(u.ToggleIcon,{onClick:i=>{s(bn),e==null||e(i)},value:o,onChange:i=>r(i),rightClickToggle:!0,tooltip:n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:l.J.RIGHT_CENTER,variant:"outlined",...t,children:n.jsxRuntimeExports.jsx(u.pt.Expand,{})})},Ki=e=>n.jsxRuntimeExports.jsx(j.ReactFlowProvider,{children:n.jsxRuntimeExports.jsx(Yi,{...e})}),Qi=Object.freeze(Object.defineProperty({__proto__:null,Background:Ui,Controls:Wi,Diagram:Ki,FitViewControl:Ji,HandleLayout:Cn,NodeLayout:it,NodeRenderer:wn,ToggleEditControl:Xi,alignNodes:vi,selectNode:At,selectNodeBox:X,selectNodeLayout:Di,use:Ii,useContext:Oe},Symbol.toStringTag,{value:"Module"})),ec=({value:e,onChange:t})=>{const{inner:s,outer:o}=e,r=i=>()=>t({...e,...i});return n.jsxRuntimeExports.jsxs(O.Space,{className:l.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(ae,{selected:o==="top",onClick:r({outer:"top"})}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(ae,{selected:o==="left",onClick:r({outer:"left"})}),n.jsxRuntimeExports.jsxs(O.Space,{className:l.CSS.B("value"),direction:"y",align:"center",justify:"center",empty:!0,children:[n.jsxRuntimeExports.jsx(ae,{className:l.CSS(l.CSS.dir("y")),selected:s==="top",onClick:r({inner:"top"})}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",justify:"center",children:[n.jsxRuntimeExports.jsx(ae,{selected:s==="left",onClick:r({inner:"left"})}),n.jsxRuntimeExports.jsx(ae,{selected:s==="right",onClick:r({inner:"right"})})]}),n.jsxRuntimeExports.jsx(ae,{className:l.CSS(l.CSS.dir("y")),selected:s==="bottom",onClick:r({inner:"bottom"})})]}),n.jsxRuntimeExports.jsx(ae,{selected:o==="right",onClick:r({outer:"right"})})]}),n.jsxRuntimeExports.jsx(ae,{selected:o==="bottom",onClick:r({outer:"bottom"})})]})},ae=({selected:e,className:t,...s})=>n.jsxRuntimeExports.jsx(u.Icon,{variant:"text",className:l.CSS(t,l.CSS.selected(e)),...s,children:n.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Vt=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],ie=({className:e,direction:t,...s})=>n.jsxRuntimeExports.jsx(O.Space,{direction:t,align:"stretch",className:l.CSS(l.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...s}),we=e=>n.jsxRuntimeExports.jsx(re,{label:"Orientation",padHelpText:!1,...e,children:({value:t,onChange:s})=>{var o;return n.jsxRuntimeExports.jsx(ec,{value:{inner:t.orientation??"top",outer:((o=t.label)==null?void 0:o.orientation)??"top"},onChange:r=>s({...t,orientation:r.inner,label:{...t.label,orientation:r.outer}})})}}),Te=({path:e})=>n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(re,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:t=>n.jsxRuntimeExports.jsx(u.Text$1,{selectOnFocus:!0,...t})}),n.jsxRuntimeExports.jsx(re,{path:e+".level",label:"Label Size",padHelpText:!1,children:t=>n.jsxRuntimeExports.jsx(te.SelectLevel,{...t})})]}),De=e=>n.jsxRuntimeExports.jsx(re,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:s,...o})=>n.jsxRuntimeExports.jsx(Rt.Swatch,{value:t??l.ZERO.setAlpha(1).rgba255,onChange:r=>s(r.rgba255),...o})}),Tn=({path:e})=>{var p,m;const{value:t,onChange:s}=_e({path:e}),o=j.sourcePipelinePropsZ.parse((p=t.source)==null?void 0:p.props),r=j.sinkPipelinePropsZ.parse((m=t.sink)==null?void 0:m.props),i=j.streamChannelValuePropsZ.parse(o.segments.valueStream.props),c=j.setChannelValuePropsZ.parse(r.segments.setter.props),a=f=>{f=f??0;const h=j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:f}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});s({...t,source:h})},d=f=>{f=f??0;const h=j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:f}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),E=j.authoritySource({channel:f}),g=j.acquireChannelControl({channel:f,authority:255});s({...t,sink:h,control:{...t.control,showChip:!0,chip:{sink:g,source:E},showIndicator:!0,indicator:{statusSource:E}}})};return n.jsxRuntimeExports.jsxs(ie,{direction:"x",grow:!0,align:"stretch",children:[n.jsxRuntimeExports.jsx(xe.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ne,{value:i.channel,onChange:a})}),n.jsxRuntimeExports.jsx(xe.Item,{label:"Output Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ne,{value:c.channel,onChange:d})})]})},ke=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(Tn,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(Te,{path:"label"}),n.jsxRuntimeExports.jsx(De,{path:"color",hideIfNull:!0,optional:!0})]}),n.jsxRuntimeExports.jsx(we,{path:""})]})}},[]),t=Q.useStatic({tabs:Vt,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},tc=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(Tn,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(Te,{path:"label"}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(De,{path:"color"}),n.jsxRuntimeExports.jsx(re,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,children:o=>n.jsxRuntimeExports.jsx(u.Switch$1,{...o})})]})]}),n.jsxRuntimeExports.jsx(we,{path:""})]})}},[]),t=Q.useStatic({tabs:Vt,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},le=()=>n.jsxRuntimeExports.jsxs(ie,{direction:"x",children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(Te,{path:"label"}),n.jsxRuntimeExports.jsx(De,{path:"color"})]}),n.jsxRuntimeExports.jsx(we,{path:""})]}),us={y:2,x:.25},xs={lower:0,upper:2e3},sc=()=>n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(Te,{path:"label"}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(De,{path:"color"}),n.jsxRuntimeExports.jsx(re,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>n.jsxRuntimeExports.jsx(u.Numeric,{value:e??200,dragScale:us,bounds:xs,...t})}),n.jsxRuntimeExports.jsx(re,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>n.jsxRuntimeExports.jsx(u.Numeric,{value:e??200,dragScale:us,bounds:xs,...t})})]})]}),n.jsxRuntimeExports.jsx(we,{path:""})]}),nc=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],oc=({path:e})=>{var f;const{value:t,onChange:s}=_e({path:e}),o=j.sourcePipelinePropsZ.parse((f=t.telem)==null?void 0:f.props),r=j.streamChannelValuePropsZ.parse(o.segments.valueStream.props),i=j.stringifyNumberProps.parse(o.segments.stringifier.props),c=j.rollingAverageProps.parse(o.segments.rollingAverage.props),a=h=>{const E=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:h??0}),stringifier:j.stringifyNumber({precision:i.precision??2}),rollingAverage:j.rollingAverage({windowSize:c.windowSize??1})},outlet:"stringifier"});s({...t,telem:E})},d=h=>{const E=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:r.channel}),stringifier:j.stringifyNumber({precision:h}),rollingAverage:j.rollingAverage({windowSize:c.windowSize})},outlet:"stringifier"});s({...t,telem:E})},p=h=>{const E=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:j.stringifyNumber({precision:i.precision??2}),valueStream:j.streamChannelValue({channel:r.channel}),rollingAverage:j.rollingAverage({windowSize:h})},outlet:"stringifier"});s({...t,telem:E})},m=vt(r.channel);return x.useEffect(()=>{s({...t,tooltip:[m]})},[m]),n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(xe.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ne,{value:r.channel,onChange:a})}),n.jsxRuntimeExports.jsx(xe.Item,{label:"Precision",align:"start",children:n.jsxRuntimeExports.jsx(u.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:d})}),n.jsxRuntimeExports.jsx(xe.Item,{label:"Averaging Window",align:"start",children:n.jsxRuntimeExports.jsx(u.Numeric,{value:c.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})},rc=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(oc,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(Te,{path:"label"}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(De,{path:"color"}),n.jsxRuntimeExports.jsx(re,{path:"units",label:"Units",align:"start",padHelpText:!1,children:o=>n.jsxRuntimeExports.jsx(u.Text$1,{...o})})]})]}),n.jsxRuntimeExports.jsx(we,{path:""})]})}},[]),t=Q.useStatic({tabs:nc,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},lc=({path:e})=>{var c;const{value:t,onChange:s}=_e({path:e}),o=j.sinkPipelinePropsZ.parse((c=t.sink)==null?void 0:c.props),r=j.setChannelValuePropsZ.parse(o.segments.setter.props),i=a=>{const d=j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:a}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),p=j.authoritySource({channel:a}),m=j.acquireChannelControl({channel:a,authority:255});s({...t,sink:d,control:{...t.control,showChip:!0,chip:{sink:m,source:p},showIndicator:!0,indicator:{statusSource:p}}})};return n.jsxRuntimeExports.jsx(ie,{direction:"y",children:n.jsxRuntimeExports.jsx(xe.Item,{label:"Output Channel",children:n.jsxRuntimeExports.jsx(Ne,{value:r.channel,onChange:i})})})},ic=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(lc,{path:""});default:return n.jsxRuntimeExports.jsxs(ie,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(O.Space,{direction:"y",grow:!0,children:n.jsxRuntimeExports.jsx(Te,{path:"label"})}),n.jsxRuntimeExports.jsx(we,{path:""})]})}},[]),t=Q.useStatic({tabs:Vt,content:e});return n.jsxRuntimeExports.jsx(Q.Tabs,{...t})},cc=({aetherKey:e,sink:t})=>{const s=u.useMemoDeepEqualProps({sink:t}),[,,o]=u.use$3({aetherKey:e,type:j.Button.TYPE,schema:j.buttonStateZ,initialState:{trigger:0,sink:t}});return x.useEffect(()=>{o(i=>({...i,...s}))},[s]),{click:x.useCallback(()=>{o(i=>({...i,trigger:i.trigger+1}))},[o])}},F=x.forwardRef(({label:e="",onChange:t,level:s="p",children:o,orientation:r="top",style:i,className:c,...a},d)=>n.jsxRuntimeExports.jsxs(O.Space,{style:{marginRight:r==="right"?1:0,marginTop:r==="top"?1:0,...i},size:2/3,direction:r,ref:d,className:l.CSS(l.CSS.B("symbol"),c),align:"center",justify:"center",...a,children:[e.length>0&&n.jsxRuntimeExports.jsx(u.Editable,{className:l.CSS.BE("symbol","label"),value:e,onChange:x.useCallback(p=>t({label:{label:p,level:s,orientation:r}}),[t,s]),level:s}),o]}));F.displayName="Labeled";const z=e=>n.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),ac=e=>n.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),uc=e=>n.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),St=e=>n.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),xc={left:{left:j.Position.Left,right:j.Position.Right,top:j.Position.Top,bottom:j.Position.Bottom},right:{left:j.Position.Right,right:j.Position.Left,top:j.Position.Bottom,bottom:j.Position.Top},top:{left:j.Position.Bottom,right:j.Position.Top,top:j.Position.Left,bottom:j.Position.Right},bottom:{left:j.Position.Top,right:j.Position.Bottom,top:j.Position.Right,bottom:j.Position.Left}},dc=(e,t)=>xc[t][e],pc=(e,t,s)=>s==="left"?{top:e,left:t}:s==="right"?{top:100-e,left:100-t}:s==="top"?{top:100-t,left:e}:{top:t,left:100-e},q=({children:e,orientation:t})=>{let s;try{s=j.useUpdateNodeInternals()}catch{return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{})}const o=x.useRef(null),r=x.useRef(!0);return x.useEffect(()=>{if(o.current==null)return;if(r.current){r.current=!1;return}const i=o.current.closest(".react-flow__node"),c=i==null?void 0:i.getAttribute("data-id");c!=null&&(s==null||s(c))},[t]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{ref:o}),e]})},N=({location:e,orientation:t,left:s,top:o,...r})=>{const i=pc(o,s,t);return n.jsxRuntimeExports.jsx(j.Handle$1,{position:dc(e,t),...r,type:"source",onClick:c=>c.stopPropagation(),className:(l.CSS.B("handle"),l.CSS.BE("handle",r.id)),style:{left:`${i.left}%`,top:`${i.top}%`}})},Pe=({className:e,enabled:t=!1,triggered:s=!1,orientation:o="left",color:r,...i})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("symbol-primitive"),l.CSS.B("symbol-primitive-toggle"),o!=null&&l.CSS.loc(o),t&&l.CSS.M("enabled"),s&&l.CSS.M("triggered"),e),color:l.cssString(r),...i}),J=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS(l.CSS.B("symbol-primitive"),e),...t}),mc=.8,Y=({dimensions:e,orientation:t="left",children:s,className:o,color:r,style:i={},scale:c=1,...a})=>{e=l.f.construct(t)==="y"?l._.swap(e):e;const p=l.cssString(r);return r!=null&&(i[l.CSS.var("symbol-color")]=new l.Color(r).rgbString),n.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:l._.svgViewBox(e),className:l.CSS(l.CSS.loc(t),o),fill:p,stroke:p,...a,style:{aspectRatio:`${e.width} / ${e.height}`,width:l._.scale(e,c*mc).width,...i},children:n.jsxRuntimeExports.jsx("g",{children:s})})},kn=({className:e,orientation:t,scale:s,color:o,...r})=>n.jsxRuntimeExports.jsxs(Pe,{...r,orientation:t,className:l.CSS(l.CSS.B("four-way-valve"),e),children:[n.jsxRuntimeExports.jsxs(q,{orientation:t,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:"left",left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:"left",left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(N,{location:"top",orientation:"left",left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(N,{location:"bottom",orientation:"left",left:50,top:100,id:"4"})]}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:87,height:87},color:o,scale:s,children:[n.jsxRuntimeExports.jsx(z,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),n.jsxRuntimeExports.jsx(z,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),Pn=({color:e,orientation:t="left",scale:s,...o})=>n.jsxRuntimeExports.jsxs(Pe,{...o,className:l.CSS(l.CSS.B("three-way-valve")),orientation:t,children:[n.jsxRuntimeExports.jsxs(q,{orientation:t,children:[n.jsxRuntimeExports.jsx(N,{location:"bottom",orientation:t,left:50,top:100,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"left",orientation:t,left:0,top:33,id:"2"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:t,left:100,top:33,id:"3"})]}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:87,height:64},color:e,orientation:t,scale:s,children:[n.jsxRuntimeExports.jsx(z,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),n.jsxRuntimeExports.jsx(z,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),Ln=({orientation:e="left",color:t,scale:s,...o})=>n.jsxRuntimeExports.jsxs(Pe,{...o,children:[n.jsxRuntimeExports.jsxs(q,{orientation:e,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:e,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:e,left:100,top:50,id:"2"})]}),n.jsxRuntimeExports.jsx(Y,{dimensions:{width:87,height:42},color:t,orientation:e,scale:s,children:n.jsxRuntimeExports.jsx(z,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),Mn=({className:e,color:t,orientation:s="left",normallyOpen:o=!1,scale:r,...i})=>n.jsxRuntimeExports.jsxs(Pe,{className:l.CSS(l.CSS.B("solenoid-valve"),o&&l.CSS.M("normally-open"),e),...i,children:[n.jsxRuntimeExports.jsxs(q,{orientation:s,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:s,left:1,top:69,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:s,left:99,top:69,id:"2"})]}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:87,height:69},color:t,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(z,{className:l.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),n.jsxRuntimeExports.jsx(z,{d:"M43.5 47L43.5 24.6177"}),n.jsxRuntimeExports.jsx(ac,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),$n=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{orientation:t,className:l.CSS(l.CSS.B("relief-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(q,{orientation:t,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:t,left:1,top:66,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:87,height:58},color:s,orientation:t,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),n.jsxRuntimeExports.jsx(z,{d:"M43.5 2L43.5 38",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Nn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{orientation:t,className:l.CSS(l.CSS.B("check-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(q,{orientation:t,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:t,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:45,height:43},color:s,orientation:t,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M43 2L43 40",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),_n=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(Pe,{...r,orientation:s,className:l.CSS(l.CSS.B("angled-valve"),t),children:[n.jsxRuntimeExports.jsxs(q,{orientation:s,children:[n.jsxRuntimeExports.jsx(N,{location:"bottom",orientation:s,left:33,top:100,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:s,left:100,top:35,id:"2"})]}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:64,height:64},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),n.jsxRuntimeExports.jsx(z,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"}),n.jsxRuntimeExports.jsx(z,{d:"M24.3461 18.5709L21.7484 19.88C20.9998 20.2572 20.3887 20.8601 20.0012 21.6035L19.3383 22.8756"})]})]}),Bn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(Pe,{...r,className:l.CSS(l.CSS.B("pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(q,{orientation:s,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:s,left:1,top:39,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:s,left:95,top:3,id:"2"})]}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:68,height:61},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(uc,{cx:"35",cy:"25",r:"23"}),n.jsxRuntimeExports.jsx(z,{d:"M50 41.5L56.7186 50.8314C57.6711 52.1544 56.7257 54 55.0955 54H14.9045C13.2743 54 12.3289 52.1544 13.2814 50.8314L20 41.5"}),n.jsxRuntimeExports.jsx(St,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),n.jsxRuntimeExports.jsx(St,{x1:"1",y1:"24",x2:"35",y2:"24"})]})]}),On=({className:e,color:t,orientation:s="left",scale:o,...r})=>{const i=l.cssString(t);return n.jsxRuntimeExports.jsxs(J,{...r,className:l.CSS(l.CSS.B("symbol"),e),children:[n.jsxRuntimeExports.jsx(q,{orientation:s,children:n.jsxRuntimeExports.jsx(N,{location:"left",orientation:s,left:2,top:50,id:"1"})}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:40,height:48},color:t,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),n.jsxRuntimeExports.jsx(z,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:i}),n.jsxRuntimeExports.jsx(z,{d:"M33 24H3",strokeLinecap:"round"})]})]})},Dn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(l.CSS.B("cap"),e),...r,children:[n.jsxRuntimeExports.jsx(q,{orientation:t,children:n.jsxRuntimeExports.jsx(N,{location:"left",orientation:t,left:0,top:50,id:"1"})}),n.jsxRuntimeExports.jsx(Y,{color:s,dimensions:{width:26,height:48},orientation:t,scale:o,children:n.jsxRuntimeExports.jsx(z,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),zn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(l.CSS.B("manual-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(q,{orientation:t,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:t,left:1,top:58,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:t,left:99,top:58,id:"2"})]}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:87,height:48},color:s,orientation:t,scale:o,children:[n.jsxRuntimeExports.jsx(St,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),n.jsxRuntimeExports.jsx(z,{d:"M19.64 2L66.68 2",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),An=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(l.CSS.B("filter"),e),...r,children:[n.jsxRuntimeExports.jsxs(q,{orientation:t,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:t,left:2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:t,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsx(Y,{dimensions:{width:52,height:34},orientation:t,color:s,scale:o,children:n.jsxRuntimeExports.jsx(z,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17M6 17H1M46 17H51"})})]}),fc=e=>typeof e=="number"?{topLeft:l.q.construct(e),topRight:l.q.construct(e),bottomLeft:l.q.construct(e),bottomRight:l.q.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:l.q.construct(e.topLeft),topRight:l.q.construct(e.topRight),bottomLeft:l.q.construct(e.bottomLeft),bottomRight:l.q.construct(e.bottomRight)}:e,jc=e=>{const{topLeft:t,topRight:s,bottomLeft:o,bottomRight:r}=e;return`${t.x}% ${s.x}% ${r.x}% ${o.x}% / ${t.y}% ${s.y}% ${r.y}% ${o.y}%`},hc={width:40,height:80},gc={x:50,y:10},Vn=({className:e,dimensions:t=hc,borderRadius:s=gc,color:o,...r})=>{const i=fc(s),c=u.use();return n.jsxRuntimeExports.jsx(J,{className:l.CSS(e,l.CSS.B("tank")),style:{...t,borderRadius:jc(i),borderColor:l.cssString(o??c.colors.gray.l9)},...r,children:n.jsxRuntimeExports.jsxs(q,{children:[n.jsxRuntimeExports.jsx(N,{location:"top",orientation:"left",left:50,top:0,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"top",orientation:"left",left:-.5,top:i.topLeft.y-1,id:"2"}),n.jsxRuntimeExports.jsx(N,{location:"top",orientation:"left",left:101,top:i.topRight.y-1,id:"3"}),n.jsxRuntimeExports.jsx(N,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),n.jsxRuntimeExports.jsx(N,{location:"bottom",orientation:"left",left:-.5,top:100-i.bottomLeft.y+1,id:"5"}),n.jsxRuntimeExports.jsx(N,{location:"bottom",orientation:"left",left:101,top:100-i.bottomRight.y+1,id:"6"}),n.jsxRuntimeExports.jsx(N,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},In=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(e,l.CSS.B("regulator")),...r,children:[n.jsxRuntimeExports.jsxs(q,{orientation:t,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:t,left:0,top:66,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:t,left:100,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:84,height:58},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M42 36.5L5.41845 16.8709C3.41989 15.7985 1 17.2463 1 19.5144V53.4856C1 55.7537 3.4199 57.2015 5.41846 56.1291L42 36.5ZM42 36.5L78.5815 16.8709C80.5801 15.7985 83 17.2463 83 19.5144V53.4856C83 55.7537 80.5801 57.2015 78.5815 56.1291L42 36.5Z"}),n.jsxRuntimeExports.jsx(z,{d:"M40 1.5H27.1522C24.8526 1.5 23.4081 3.9809 24.5432 5.98082L41.1303 35.2058C41.6373 36.099 43 35.7392 43 34.7122V4.5C43 2.84315 41.6569 1.5 40 1.5Z"})]})]}),Zn=({className:e,orientation:t="left",scale:s,color:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(l.CSS.B("orifice"),e),...r,children:[n.jsxRuntimeExports.jsxs(q,{orientation:t,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:t,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:t,left:100,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:70,height:34},orientation:t,color:o,scale:s,children:[n.jsxRuntimeExports.jsx(z,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Fn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(l.CSS.B("needle-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(q,{orientation:t,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:t,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:87,height:42},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:l.cssString(s)}),n.jsxRuntimeExports.jsx(z,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),qn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{orientation:t,className:l.CSS(l.CSS.B("angled-relief-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(q,{children:[n.jsxRuntimeExports.jsx(N,{location:"bottom",orientation:t,left:33,top:100,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:t,left:100,top:45,id:"2"})]}),n.jsxRuntimeExports.jsxs(Y,{dimensions:{width:64,height:79},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M20.75 2L20.75 38",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),n.jsxRuntimeExports.jsx(z,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"}),n.jsxRuntimeExports.jsx(z,{d:"M24.3461 33.5709L21.7484 34.88C20.9998 35.2572 20.3887 35.8601 20.0012 36.6035L19.3383 37.8756"})]})]}),Hn=({className:e,color:t,dimensions:s,orientation:o,units:r="psi",children:i,...c})=>{const a=l.cssString(t),d=u.use();let p="var(--pluto-gray-l0)";return t!=null&&(p=l.cssString(new l.Color(t).pickByContrast(d.colors.gray.l0,d.colors.gray.l9))),n.jsxRuntimeExports.jsxs(J,{className:l.CSS(l.CSS.B("value"),e),...c,style:{borderColor:a,height:s==null?void 0:s.height,width:"100%"},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","content"),style:{flexGrow:1,minWidth:s==null?void 0:s.width,inlineSize:80},children:i}),n.jsxRuntimeExports.jsxs(q,{orientation:o,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:"left",left:-2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:"left",left:102,top:50,id:"2"}),n.jsxRuntimeExports.jsx(N,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),n.jsxRuntimeExports.jsx(N,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","units"),style:{background:a},children:n.jsxRuntimeExports.jsx(u.Text,{level:"small",color:p,children:r})})]})},Gn=({enabled:e=!1,onClick:t,orientation:s="left"})=>n.jsxRuntimeExports.jsxs(J,{orientation:s,children:[n.jsxRuntimeExports.jsx(u.Switch$1,{value:e,onClick:t,onChange:()=>{}}),n.jsxRuntimeExports.jsxs(q,{orientation:s,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:s,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:s,left:100,top:50,id:"2"})]})]}),Yn=({onClick:e,orientation:t="left",label:s=""})=>n.jsxRuntimeExports.jsxs(J,{orientation:t,children:[n.jsxRuntimeExports.jsx(u.Button,{onClick:e,children:s}),n.jsxRuntimeExports.jsxs(q,{orientation:t,children:[n.jsxRuntimeExports.jsx(N,{location:"left",orientation:t,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(N,{location:"right",orientation:t,left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(N,{location:"top",orientation:t,left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(N,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),ge=({aetherKey:e,source:t,sink:s})=>{const o=u.useMemoDeepEqualProps({source:t,sink:s}),[,{triggered:r,enabled:i},c]=u.use$3({aetherKey:e,type:j.Toggle.TYPE,schema:j.toggleStateZ,initialState:{triggered:!1,enabled:!1,...o}});return x.useEffect(()=>{c(d=>({...d,...o}))},[o,c]),{toggle:x.useCallback(()=>c(d=>({...d,triggered:!d.triggered})),[c]),triggered:r,enabled:i}},Ec=j.Value.z.omit({font:!0}).partial({color:!0}).extend({level:k.levelZ.optional()}),Un=({aetherKey:e,box:t,telem:s,color:o,precision:r,minWidth:i,level:c="small"})=>{const a=u.useMemoDeepEqualProps({box:t,telem:s,color:o,precision:r,level:c,minWidth:i}),[,d,p]=u.use$3({aetherKey:e,type:j.Value.TYPE,schema:j.Value.z,initialState:a});return x.useLayoutEffect(()=>p(m=>({...m,...a})),[a]),{width:d.width??d.minWidth}},Sc=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:Ec,use:Un},Symbol.toStringTag,{value:"Module"})),Wn=e=>l.f.construct(e)==="x"?l.J.swap(e):e,Rc=e=>l.f.construct(e)==="y"?l.J.swap(e):e,ce=({showChip:e=!0,showIndicator:t=!0,indicator:s,orientation:o="left",chip:r,children:i,...c})=>n.jsxRuntimeExports.jsxs(O.Space,{direction:l.J.rotate90(o),align:"center",justify:"center",empty:!0,...c,children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:l.f.construct(o),align:"center",className:l.CSS(l.CSS.B("control-state")),size:"small",children:[e&&n.jsxRuntimeExports.jsx(mn,{size:"small",...r}),t&&n.jsxRuntimeExports.jsx(hn,{...s})]}),i]}),Xn=u.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:s,control:o,source:r,sink:i,orientation:c="left",color:a})=>{const{enabled:d,triggered:p,toggle:m}=ge({aetherKey:e,source:r,sink:i});return n.jsxRuntimeExports.jsx(F,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(ce,{...o,orientation:Wn(c),children:n.jsxRuntimeExports.jsx(Pn,{enabled:d,triggered:p,onClick:m,orientation:c,color:a})})})}),Jn=e=>n.jsxRuntimeExports.jsx(Pn,{...e}),Kn=u.wrap$1("Valve",({control:e,aetherKey:t,label:s,onChange:o,source:r,sink:i,orientation:c,color:a})=>{const{enabled:d,triggered:p,toggle:m}=ge({aetherKey:t,source:r,sink:i});return n.jsxRuntimeExports.jsx(F,{...s,onChange:o,children:n.jsxRuntimeExports.jsx(ce,{...e,orientation:c,children:n.jsxRuntimeExports.jsx(Ln,{enabled:d,triggered:p,onClick:m,orientation:c,color:a})})})}),Qn=e=>n.jsxRuntimeExports.jsx(Ln,{...e}),eo=u.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:s,orientation:o="left",normallyOpen:r,color:i,source:c,sink:a,control:d})=>{const{enabled:p,triggered:m,toggle:f}=ge({aetherKey:e,source:c,sink:a});return n.jsxRuntimeExports.jsx(F,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(ce,{...d,orientation:Rc(o),children:n.jsxRuntimeExports.jsx(Mn,{enabled:p,triggered:m,onClick:f,orientation:o,color:i,normallyOpen:r})})})}),to=e=>n.jsxRuntimeExports.jsx(Mn,{...e}),so=u.wrap$1("FourWayValve",({aetherKey:e,control:t,label:s,onChange:o,orientation:r,color:i,source:c,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ge({aetherKey:e,source:c,sink:a});return n.jsxRuntimeExports.jsx(F,{...s,onChange:o,children:n.jsxRuntimeExports.jsx(ce,{...t,orientation:r,children:n.jsxRuntimeExports.jsx(kn,{enabled:d,triggered:p,onClick:m,orientation:r,color:i})})})}),no=e=>n.jsxRuntimeExports.jsx(kn,{...e}),oo=u.wrap$1("AngleValve",({aetherKey:e,label:t,control:s,onChange:o,orientation:r="left",color:i,source:c,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ge({aetherKey:e,source:c,sink:a});return n.jsxRuntimeExports.jsx(F,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(ce,{...s,orientation:Wn(r),children:n.jsxRuntimeExports.jsx(_n,{enabled:d,triggered:p,onClick:m,orientation:r,color:i})})})}),ro=e=>n.jsxRuntimeExports.jsx(_n,{...e}),lo=u.wrap$1("Pump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:c,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ge({aetherKey:e,source:c,sink:a});return n.jsxRuntimeExports.jsx(F,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(ce,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(Bn,{enabled:d,triggered:p,onClick:m,orientation:r,color:i})})})}),io=e=>n.jsxRuntimeExports.jsx(Bn,{...e}),co=u.wrap$1("Tank",({label:e,onChange:t,orientation:s,color:o,dimensions:r,borderRadius:i})=>n.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Vn,{onResize:c=>t({dimensions:c}),orientation:s,color:o,dimensions:r,borderRadius:i})})),ao=e=>n.jsxRuntimeExports.jsx(Vn,{...e,dimensions:{width:25,height:50}}),uo=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:n.jsxRuntimeExports.jsx($n,{orientation:s,color:o})}),xo=e=>n.jsxRuntimeExports.jsx($n,{...e}),po=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(In,{orientation:s,color:o})}),mo=e=>n.jsxRuntimeExports.jsx(In,{...e}),fo=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(On,{orientation:s,color:o})}),jo=e=>n.jsxRuntimeExports.jsx(On,{...e}),ho=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Dn,{orientation:s,color:o})}),go=e=>n.jsxRuntimeExports.jsx(Dn,{...e}),Eo=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(zn,{orientation:s,color:o})}),So=e=>n.jsxRuntimeExports.jsx(zn,{...e}),Ro=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(An,{orientation:s,color:o})}),Co=e=>n.jsxRuntimeExports.jsx(An,{...e}),yo=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Fn,{orientation:s,color:o})}),bo=e=>n.jsxRuntimeExports.jsx(Fn,{...e}),vo=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Nn,{orientation:s,color:o})}),wo=e=>n.jsxRuntimeExports.jsx(Nn,{...e}),To=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Zn,{orientation:s,color:o})}),ko=e=>n.jsxRuntimeExports.jsx(Zn,{...e}),Po=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(qn,{orientation:s,color:o})}),Lo=e=>n.jsxRuntimeExports.jsx(qn,{...e}),Mo=u.wrap$1("Value",({aetherKey:e,label:t,level:s="p",position:o,className:r,textColor:i,color:c,telem:a,units:d,onChange:p,tooltip:m})=>{const f=u.useTypography(s),[h,E]=x.useState({outerBox:l.To.ZERO,labelBox:l.To.ZERO}),g=(f.lineHeight+.5)*f.baseSize+2,S=u.useResize(x.useCallback(b=>{const R=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);let w={...l.To.ZERO};R!=null&&(w=l.To.construct(R),w=l.To.resize(w,{width:l.To.width(w),height:l.To.height(w)})),E({outerBox:b,labelBox:w})},[]),{}),{zoom:C}=j.useInitialViewport(),v=yc({labelOrientation:(t==null?void 0:t.orientation)??"top",hasLabel:(t==null?void 0:t.label)!=null&&(t==null?void 0:t.label.length)>0,valueBoxHeight:g,position:o,zoom:C,...h}),{width:y}=Un({aetherKey:e,color:i,level:s,box:v,telem:a,minWidth:60});return n.jsxRuntimeExports.jsxs(u.Dialog$1,{location:{y:"top"},hide:m==null||m.length===0,children:[n.jsxRuntimeExports.jsx(O.Space,{direction:"y",children:m==null?void 0:m.map((b,R)=>n.jsxRuntimeExports.jsx(u.Text,{level:"small",children:b},R))}),n.jsxRuntimeExports.jsx(F,{className:l.CSS(r,l.CSS.B("value-labeled")),ref:S,onChange:p,...t,children:n.jsxRuntimeExports.jsx(Hn,{color:c,dimensions:{height:g,width:y},units:d})})]})}),Cc=.9,yc=({labelOrientation:e,outerBox:t,labelBox:s,valueBoxHeight:o,position:r,hasLabel:i,zoom:c})=>{const a=l.q.scale(l.To.dims(s),1/(Cc*c));return l.f.construct(e)==="x"&&(r=l.q.translate(r,"y",Math.max((a.y-o)/2-1,0))),i&&e==="left"?r=l.q.translate(r,"x",a.x+4):i&&e==="top"&&(r=l.q.translate(r,"y",a.y+4)),l.To.construct(r.x,r.y,l.To.width(t),o)},$o=({color:e})=>n.jsxRuntimeExports.jsx(Hn,{color:e,dimensions:{width:60,height:25},units:"psi",children:n.jsxRuntimeExports.jsx(u.Text,{level:"p",children:"50.00"})}),No=u.wrap$1("Switch",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:c,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=ge({aetherKey:e,source:c,sink:a});return n.jsxRuntimeExports.jsx(F,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(ce,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(Gn,{enabled:d,triggered:p,onClick:m,orientation:r,color:i})})})}),_o=e=>n.jsxRuntimeExports.jsx(Gn,{...e}),Bo=u.wrap$1("Button",({aetherKey:e,label:t,orientation:s,sink:o,control:r})=>{const{click:i}=cc({aetherKey:e,sink:o});return n.jsxRuntimeExports.jsx(ce,{...r,className:l.CSS.B("symbol"),orientation:s,children:n.jsxRuntimeExports.jsx(Yn,{label:t==null?void 0:t.label,onClick:i})})}),Oo=({label:e,...t})=>n.jsxRuntimeExports.jsx(Yn,{label:"Button",...t}),H=4,bc=2,vc=["threeWayValve","valve","solenoidValve","fourWayValve","angledValve","pump","tank","reliefValve","regulator","burstDisc","cap","manualValve","filter","needleValve","checkValve","orifice","angledReliefValve","value","button","switch"];ms.z.enum(vc);const Ee={source:j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:0}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"}),sink:j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:0}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},wc={name:"Three Way Valve",key:"threeWayValve",Form:ke,Symbol:Xn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Three Way Valve",level:"p",orientation:"top"},...Ee,orientation:"left"}),Preview:Jn,zIndex:H},Tc={name:"Valve",key:"valve",Form:ke,Symbol:Kn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Valve",level:"p",orientation:"top"},orientation:"left",...Ee}),Preview:Qn,zIndex:H},kc={name:"Pneumatic Valve",key:"solenoidValve",Form:tc,Symbol:eo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Pneumatic Valve",level:"p",orientation:"top"},orientation:"left",normallyOpen:!1,...Ee}),Preview:to,zIndex:H},Pc={name:"Four Way Valve",key:"fourWayValve",Form:ke,Symbol:so,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Four Way Valve",level:"p",orientation:"top"},orientation:"left",...Ee}),Preview:no,zIndex:H},Lc={name:"Angled Valve",key:"angledValve",Form:ke,Symbol:oo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Angled Valve",level:"p",orientation:"top"},orientation:"left",...Ee}),Preview:ro,zIndex:H},Mc={name:"Pump",key:"pump",Form:ke,Symbol:lo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Pump",level:"p",orientation:"top"},orientation:"left",...Ee}),Preview:io,zIndex:H},$c={name:"Tank",key:"tank",Form:sc,Symbol:co,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Tank",level:"p",orientation:"top"},dimensions:{width:100,height:200},orientation:"left"}),Preview:ao,zIndex:bc},Nc={name:"Relief Valve",key:"reliefValve",Form:le,Symbol:uo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Relief Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:xo,zIndex:H},_c={name:"Regulator",key:"regulator",Form:le,Symbol:po,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Regulator",level:"p",orientation:"top"},orientation:"left"}),Preview:mo,zIndex:H},Bc={name:"Burst Disc",key:"burstDisc",Form:le,Symbol:fo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Burst Disc",level:"p",orientation:"top"},orientation:"left"}),Preview:jo,zIndex:H},Oc={name:"Cap",key:"cap",Form:le,Symbol:ho,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Cap",level:"p",orientation:"top"},orientation:"left"}),Preview:go,zIndex:H},Dc={name:"Manual Valve",key:"manualValve",Form:le,Symbol:Eo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Manual Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:So,zIndex:H},zc={name:"Filter",key:"filter",Form:le,Symbol:Ro,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Filter",level:"p",orientation:"top"},orientation:"left"}),Preview:Co,zIndex:H},Ac={name:"Needle Valve",key:"needleValve",Form:le,Symbol:yo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Needle Valve",level:"p"},orientation:"left"}),Preview:bo,zIndex:H},Vc={name:"Check Valve",key:"checkValve",Form:le,Symbol:vo,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Check Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:wo,zIndex:H},Ic={name:"Orifice",key:"orifice",Form:le,Symbol:To,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Orifice",level:"p",orientation:"top"},orientation:"left"}),Preview:ko,zIndex:H},Zc={name:"Angled Relief Valve",key:"angledReliefValve",Form:le,Symbol:Po,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Angled Relief Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:Lo,zIndex:H},Fc={name:"Value",key:"value",Form:rc,Symbol:Mo,Preview:$o,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",label:{label:"Value",level:"p",orientation:"top"},orientation:"left",telem:j.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:0}),stringifier:j.stringifyNumber({precision:2}),rollingAverage:j.rollingAverage({windowSize:1})},outlet:"stringifier"})}),zIndex:H},qc={name:"Button",key:"button",Symbol:Bo,Form:ic,Preview:Oo,defaultProps:()=>({label:{label:"Button",level:"p",orientation:"top"},orientation:"left",sink:j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:0}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})}),zIndex:H},Hc={name:"Switch",key:"switch",Symbol:No,Preview:_o,Form:ke,defaultProps:()=>({label:{label:"Switch",level:"p",orientation:"top"},orientation:"left",...Ee}),zIndex:H},Gc={value:Fc,threeWayValve:wc,valve:Tc,solenoidValve:kc,fourWayValve:Pc,angledValve:Lc,pump:Mc,tank:$c,reliefValve:Nc,regulator:_c,burstDisc:Bc,cap:Oc,manualValve:Dc,filter:zc,needleValve:Ac,checkValve:Vc,orifice:Ic,angledReliefValve:Zc,button:qc,switch:Hc},Yc=Object.freeze(Object.defineProperty({__proto__:null,AngledReliefValve:Po,AngledReliefValvePreview:Lo,AngledValve:oo,AngledValvePreview:ro,BurstDisc:fo,BurstDiscPreview:jo,Button:Bo,ButtonPreview:Oo,Cap:ho,CapPreview:go,CheckValve:vo,CheckValvePreview:wo,ControlState:ce,Filter:Ro,FilterPreview:Co,FourWayValve:so,FourWayValvePreview:no,ManualValve:Eo,ManualValvePreview:So,NeedleValve:yo,NeedleValvePreview:bo,Orifice:To,OrificePreview:ko,Pump:lo,PumpPreview:io,Regulator:po,RegulatorPreview:mo,ReliefValve:uo,ReliefValvePreview:xo,SYMBOLS:Gc,SolenoidValve:eo,SolenoidValvePreview:to,Switch:No,SwitchPreview:_o,Tank:co,TankPreview:ao,ThreeWayValve:Xn,ThreeWayValvePreview:Jn,Value:Mo,ValuePreview:$o,Valve:Kn,ValvePreview:Qn},Symbol.toStringTag,{value:"Module"}));exports.Aether=u.main;exports.Divider=u.Divider$1;exports.Dropdown=u.Dropdown;exports.Haul=u.Haul;exports.Worker=u.Context$1;exports.compareArrayDeps=u.compareArrayDeps;exports.componentRenderProp=u.componentRenderProp;exports.isRenderProp=u.isRenderProp;exports.useAsyncEffect=u.useAsyncEffect;exports.useClickOutside=u.useClickOutside;exports.useCombinedRefs=u.useCombinedRefs;exports.useCombinedStateAndRef=u.useCombinedStateAndRef;exports.useDebouncedCallback=u.useDebouncedCallback;exports.useEffectCompare=u.useEffectCompare;exports.useMemoCompare=u.useMemoCompare;exports.useMemoDeepEqualProps=u.useMemoDeepEqualProps;exports.usePrevious=u.usePrevious;exports.useResize=u.useResize;exports.useStateRef=u.useStateRef;exports.useSyncedRef=u.useSyncedRef;exports.useTransforms=u.useTransforms;exports.CSS=l.CSS;exports.newBEM=l.newBEM;exports.Header=Ae.external;exports.DataType=k.g;exports.Density=k.I;exports.MultiSeries=k.lt;exports.Rate=k.q;exports.Series=k.N;exports.TimeRange=k.U;exports.TimeSpan=k.w;exports.TimeStamp=k.m;exports.state=k.state;exports.Generic=O.Generic;exports.Align=qo.external;exports.Button=Ho.external;exports.Caret=Go.Animated$1;exports.telem=j.external;exports.Color=Rt.external;exports.Text=te.external;exports.Triggers=Ct.external;exports.Menu=Yo.external;exports.List=Ce.external;exports.createFilterTransform=Ce.createFilterTransform;exports.fuseFilter=Ce.fuseFilter;exports.proxyMemo=Ce.proxyMemo;exports.createHexOpacityVariants=ps.createHexOpacityVariants;exports.unitProperty=ps.unitProperty;exports.Input=xe.external;exports.Tabs=Q.external;exports.Theming=Uo.external;exports.Tree=Wo.external;exports.Video=Xo.Video;exports.Accordion=fr;exports.Canvas=kr;exports.Channel=pl;exports.Control=di;exports.Device=Nl;exports.Diagram=Qi;exports.Eraser=Wl;exports.Form=Ll;exports.Line=Lr;exports.LinePlot=Qr;exports.Measure=nl;exports.Mosaic=Gl;exports.Nav=Kl;exports.Note=ei;exports.OS=ri;exports.Pluto=ji;exports.Progress=gi;exports.Range=tl;exports.Ranger=Ci;exports.Resize=ir;exports.Rule=ol;exports.Schematic=Yc;exports.Select=Zr;exports.Status=Qo;exports.Steps=bi;exports.Synnax=hr;exports.Tag=Ar;exports.Telem=ci;exports.Tooltip=er;exports.Value=Sc;exports.Viewport=Kr;
1
+ "use strict";var ro=Object.defineProperty;var oo=(e,t,s)=>t in e?ro(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var xe=(e,t,s)=>oo(e,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-Cek9Ww4S.cjs"),x=require("react"),c=require("./Toggle-DlNzb7nt.cjs"),l=require("./css-CC1MhhH7.cjs"),Oe=require("./external-DMYExlt2.cjs"),k=require("./aggregator-D47lwtdn.cjs"),O=require("./Pack-_i2cfPYc.cjs"),lo=require("./external-DqnUE4mV.cjs"),io=require("./external-CMk1k986.cjs"),co=require("./Animated-DqAjXT8r.cjs"),p=require("./LinePlot-DnLLplw_.cjs"),se=require("zod"),St=require("./external-DjSiwSCE.cjs"),re=require("./external-DU5Xqqld.cjs"),gt=require("./external-B815mDB0.cjs"),ao=require("./external-CUJXIrxM.cjs"),Et=require("react-dom"),be=require("./external-Do75w1Zt.cjs"),ls=require("./units-CoE6Mywf.cjs"),me=require("./external-DRvtVPhp.cjs"),X=require("./external-Dm3eiIEN.cjs"),uo=require("./external-B7RXnD0a.cjs"),xo=require("./external-CLwP0eXe.cjs"),po=require("./Video-THwAEuOy.cjs"),is=({variant:e,...t})=>n.jsxRuntimeExports.jsx(c.k0.Circle,{color:c.variantColors[e],...t}),mo=({status:{key:e,time:t,count:s,message:o,description:r,variant:i},silence:u,actions:a,className:d,children:j,...m})=>n.jsxRuntimeExports.jsxs(O.Space,{className:l.CSS(l.CSS.B("notification"),d),direction:"y",empty:!0,...m,children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",size:"small",children:[n.jsxRuntimeExports.jsx(is,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),n.jsxRuntimeExports.jsx(c.Text,{level:"small",shade:7,children:`x${s}`}),n.jsxRuntimeExports.jsx(c.DateTime,{className:l.CSS(l.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),n.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>u(e),children:n.jsxRuntimeExports.jsx(c.k0.Close,{})})]}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",align:"start",className:l.CSS(l.CSS.BE("notification","content")),size:"small",children:[j??n.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:o}),r!=null&&n.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),a!=null&&n.jsxRuntimeExports.jsx(O.Space,{direction:"x",align:"center",justify:"end",className:l.CSS(l.CSS.BE("notification","actions")),children:k.A(a).map(f=>n.jsxRuntimeExports.jsx(jo,{action:f},f.key))})]},t.toString()),jo=({action:e})=>{if(!x.isValidElement(e)){const t=e;return n.jsxRuntimeExports.jsx(c.Button,{...t})}return e},fo=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:c.Aggregator,Circle:is,Notification:mo,Text:c.Text$2,VARIANTS:k.VARIANTS,specZ:k.specZ$1,useAggregator:c.useAggregator,useContext:c.useContext$2,useNotifications:c.useNotifications,variantZ:k.variantZ},Symbol.toStringTag,{value:"Module"})),ho=Object.freeze(Object.defineProperty({__proto__:null,Config:c.Config,Context:c.Context,Dialog:c.Dialog$1,chooseLocation:c.chooseLocation,formatTip:c.formatTip,useConfig:c.useConfig,wrap:c.wrap},Symbol.toStringTag,{value:"Module"})),Ie=e=>e.preventDefault(),Xe=x.forwardRef(({location:e,style:t,size:s,className:o,children:r,onDragStart:i,sizeUnits:u="px",showHandle:a=!0,...d},j)=>{const m=l.J.construct(e),f=l.J.direction(m),S=l.g.dimension(f);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("resize"),l.CSS.loc(m),l.CSS.dir(f),o),style:{[S]:`${s}${u}`,...t},ref:j,...d,children:[r,a&&n.jsxRuntimeExports.jsx("div",{draggable:!0,className:l.CSS(l.CSS.BE("resize","handle"),l.CSS.bordered(l.J.swap(m))),onDragStart:i,onDrag:Ie,onDragEnd:Ie})]})});Xe.displayName="Resize.Core";const Rt=({onResize:e,count:t,initialSizes:s=[],minSize:o=100,direction:r="x"})=>{const i=x.useRef(null),[u,a]=x.useState({sizeDistribution:So(s,t),root:null}),d=x.useCallback((f,S,h)=>{if(i.current==null)return;const C=l.To.dim(l.To.construct(i.current),r);a(R=>it(R,C,f,o,S,h))},[o,a,r]);x.useEffect(()=>e==null?void 0:e(u.sizeDistribution),[u.sizeDistribution,e]);const j=x.useCallback((f,S)=>{f.preventDefault();const h=r==="x"?"clientX":"clientY",C=v=>d(S,v[h]),R=()=>{a(v=>({...v,root:null})),document.removeEventListener("mousemove",C)};a(v=>({...v,root:f[h]})),document.addEventListener("mousemove",C),document.addEventListener("mouseup",R,{once:!0})},[a,r,it]);return{setSize:x.useCallback((f,S)=>d(f,void 0,S),[it]),props:{direction:r,sizeDistribution:u.sizeDistribution,onDragHandle:j,ref:i}}},Je=x.forwardRef(({direction:e="x",children:t,sizeDistribution:s,onDragHandle:o,className:r,...i},u)=>{const a=l.g.construct(e),d=x.Children.toArray(t);return s=go(s),n.jsxRuntimeExports.jsx(O.Space,{...i,ref:u,direction:a,className:l.CSS(l.CSS.B("resize-multiple"),r),empty:!0,grow:!0,children:d.map((j,m)=>n.jsxRuntimeExports.jsx(Xe,{onDragStart:f=>o(f,m),location:l.g.location(a),size:s[m]*100,sizeUnits:"%",showHandle:m!==d.length-1,children:j},m))})});Je.displayName="Resize.Multiple";const So=(e,t)=>{const s=e.reduce((r,i)=>r+i,0),o=t-e.length;if(o<=0)return e.slice(0,t).map(r=>r/s);if(e.every(r=>r<=1)){const r=1-s;return[...e,...Array(o).fill(r/o)]}return e.map(()=>1/t)},lt=.001,go=e=>e.every(t=>l.C.closeTo(t,1/e.length),lt)?e.map((t,s)=>s%2===0?t+lt:s===e.length-1?t:t-lt):e,it=(e,t,s,o,r,i)=>{const u=cs(e,t,s,r,i),[a,d]=Eo(e.sizeDistribution,s,u,o/t),j=d?r??null:e.root;return{...e,sizeDistribution:a,root:j}},cs=(e,t,s,o,r)=>{let i;if(r!=null)r>1&&(r=r/t),i=r-e.sizeDistribution[s];else if(o!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(o-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},Eo=(e,t,s,o)=>{let r=t;for(;r>0&&e[r]+s<=o;)r--;const i=e[r]+s,u=Ro(r,e,o,s),a=e[u]-s;return i<o||a<o?[e,!1]:[e.map((d,j)=>j===r?i:j===u?a:d),!0]},Ro=(e,t,s,o)=>(e===t.length-1?yo:Co)(e,t,s,o),Co=(e,t,s,o)=>{let r=e+1;for(;r<t.length-1&&t[r]-o<=s;)r++;return r},yo=(e,t,s,o)=>{let r=e-1;for(;r>0&&t[r]-o<=s;)r--;return r},Ke=({onMove:e,onStart:t,onEnd:s})=>x.useCallback(o=>{o.preventDefault();const r=l.q.construct(o),i=c.mouseKey(o.button);t==null||t(r,i,o);const u=d=>{if(d.buttons===0)return a(d);const j=l.q.construct(d);e==null||e(l.To.construct(r,j),i,d)};window.addEventListener("mousemove",u);const a=d=>{window.removeEventListener("mousemove",u);const j=l.q.construct(d);s==null||s(l.To.construct(r,j),i,d)};window.addEventListener("mouseup",a,{once:!0})},[e,t,s]),ct=2,as=({onCollapse:e,onResize:t,location:s="left",minSize:o=100,maxSize:r=1/0,initialSize:i=200,collapseThreshold:u=1/0,className:a,...d})=>{const[j,m]=x.useState(l.j(i,o,r)),f=x.useRef(null),S=l.J.construct(s),h=x.useCallback(b=>{if(f.current===null)return 0;const E=l.To.dim(b,l.J.direction(S),!0)*(1-2*Number(["bottom","right"].includes(S))),y=f.current+E,M=l.j(y,o,r);return(M-y)/o>u?ct:M},[S,o,r,u]),C=x.useRef(null),R=x.useCallback(b=>{const E=h(b);m(E),C.current!=null&&(t==null||t(E,l.To.construct(C.current)))},[t,h]),v=x.useCallback(()=>m(b=>(f.current=b,b)),[m]),L=x.useCallback(b=>h(b)===ct&&(e==null?void 0:e()),[e,h]);x.useEffect(()=>m(b=>{const E=l.j(b,o,r);return f.current=E,E}),[o,r]);const g=Ke({onMove:R,onStart:v,onEnd:L});return n.jsxRuntimeExports.jsx(Xe,{ref:C,location:S,size:j,onDragStart:g,className:l.clsx(a,l.CSS.expanded(j!==ct)),...d})},bo=Object.freeze(Object.defineProperty({__proto__:null,Core:Xe,Multiple:Je,Single:as,calculateDiffPercentage:cs,useMultiple:Rt},Symbol.toStringTag,{value:"Module"})),Ve="y",Yt=28,vo=32,wo=40,To=.5,ko=({data:e,...t})=>{const{setSize:s,props:{sizeDistribution:o,ref:r,...i}}=Rt({direction:Ve,count:e.length,minSize:Yt}),u=a=>{if(r.current==null)return;const d=l.To.dim(l.To.construct(r.current),Ve);o[a]<wo/d?s(a,e[a].initialSize??To):s(a,Yt+1)};return n.jsxRuntimeExports.jsx(Je,{empty:!0,className:l.CSS.B("accordion"),sizeDistribution:o,ref:r,...t,...i,children:e.map((a,d)=>x.createElement(Mo,{...a,key:a.key,index:d,direction:Ve,onExpand:u,parent:r,size:o[d]}))})},Po=n.jsxRuntimeExports.jsx(c.k0.Caret.Down,{"aria-label":"contract"}),Lo=n.jsxRuntimeExports.jsx(c.k0.Caret.Right,{"aria-label":"expand"}),Mo=({index:e,name:t,content:s,actions:o,size:r,parent:i,onExpand:u})=>{let a=!0;if(i.current!=null){const j=l.To.dim(l.To.construct(i.current),Ve);a=r*j>vo}const d=a?Po:Lo;return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsxs(Oe.Header,{level:"p",className:l.CSS.expanded(a),empty:!0,children:[n.jsxRuntimeExports.jsx(Oe.ButtonTitle,{startIcon:d,onClick:()=>u(e),children:t}),o!=null&&n.jsxRuntimeExports.jsx(Oe.Actions,{children:o})]}),s]})},$o=Object.freeze(Object.defineProperty({__proto__:null,Accordion:ko},Symbol.toStringTag,{value:"Module"})),Ct=x.createContext(p.ZERO_CONTEXT_VALUE),ve=()=>x.useContext(Ct).synnax,No=()=>x.useContext(Ct).state,Gt={connected:"success",connecting:"info",disconnected:"info",failed:"error"},us=c.wrap$1(p.Provider.TYPE,({aetherKey:e,connParams:t,children:s})=>{const[o,r,i]=c.useCombinedStateAndRef(p.ZERO_CONTEXT_VALUE),[{path:u},,a]=c.use$3({aetherKey:e,type:p.Provider.TYPE,schema:p.Provider.stateZ,initialState:{props:t??null,state:null}}),d=c.useAggregator(),j=x.useCallback(m=>{i.current.state.status!==m.status&&d({variant:Gt[m.status],message:m.message??l.S.capitalize(m.status)}),r(f=>({...f,state:m}))},[d]);return c.useAsyncEffect(async()=>{if(o.synnax!=null&&o.synnax.close(),t==null)return r(p.ZERO_CONTEXT_VALUE);const m=new k.Zh({...t,connectivityPollFrequency:k.S.seconds(5)});r({synnax:m,state:{clusterKey:"",status:"connecting",message:"Connecting..."}});const f=await m.connectivity.check();return r({synnax:m,state:f}),d({variant:Gt[f.status],message:f.message??f.status.toUpperCase()}),m.connectivity.onChange(j),a({props:t,state:f}),()=>{m.close(),r(p.ZERO_CONTEXT_VALUE),a({props:null,state:null})}},[t,j]),n.jsxRuntimeExports.jsx(Ct.Provider,{value:o,children:n.jsxRuntimeExports.jsx(c.Composite,{path:u,children:s})})}),_o=Object.freeze(Object.defineProperty({__proto__:null,Provider:us,use:ve,useConnectionState:No},Symbol.toStringTag,{value:"Module"})),we=x.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),xs=()=>x.useContext(we),ds=e=>{const{aliases:t}=x.useContext(we);return t[e]??null},Qe=()=>{const{aliases:e}=x.useContext(we);return e},et=(e,t="")=>{const{getName:s}=x.useContext(we),[o,r]=x.useState(t);return c.useAsyncEffect(async()=>{const i=await s(e);i!=null&&r(i)},[e,s]),o??t},yt=()=>{const{activeRange:e}=x.useContext(we);return e??void 0},ps=({activeRange:e,children:t})=>{const s=ve(),[o,r]=x.useState({}),i=x.useCallback(d=>{r(j=>{const m={...j};return d.forEach(({variant:f,key:S,value:h})=>{const C=Number(S.split("---")[1]);f==="delete"?delete m[C]:m[h.channel]=h.alias}),m})},[r]),u=x.useCallback(async(d,j)=>{if(s==null||e==null)return;await(await s.ranges.retrieve(e)).setAlias(d,j)},[s,e]),a=x.useCallback(async d=>{if(s==null||d===0)return;const j=o[d];return j??(await s.channels.retrieve(d)).name},[o,s]);return c.useAsyncEffect(async()=>{if(s==null||e==null){r({});return}const d=await s.ranges.retrieve(e),j=await d.listAliases();r(j);const m=await d.openAliasTracker(),f=m.onChange(i);return()=>{f(),m.close()}},[s,e]),n.jsxRuntimeExports.jsx(we.Provider,{value:{aliases:o,activeRange:e,setAlias:e!=null?u:null,getName:a},children:t})},Bo=({channelKey:e,value:t,shadow:s,className:o,...r})=>{const[i,u]=x.useState(!1),{setAlias:a}=xs(),d=ds(e),j=et(e);let m=n.jsxRuntimeExports.jsx(c.k0.Rename,{});i?m=n.jsxRuntimeExports.jsx(c.k0.Loading,{}):d===t&&(m=n.jsxRuntimeExports.jsx(c.k0.Check,{}));const f=a!=null&&!i&&d!==t&&e!==0,S=()=>{f&&(async()=>(u(!0),await a(e,t),u(!1)))()},h=()=>{var R;d!=null&&((R=r.onChange)==null||R.call(r,d))},C=()=>e===0?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):a==null?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):d===t?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Alias synced with this label"}):n.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Sync alias for ",j," with this label"]});return n.jsxRuntimeExports.jsxs(c.Text$1,{value:t,...r,children:[f&&n.jsxRuntimeExports.jsx(c.Icon,{onClick:h,tooltip:n.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Set ",j," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:n.jsxRuntimeExports.jsx(c.k0.Sync,{})}),n.jsxRuntimeExports.jsx(c.Icon,{onClick:S,disabled:!f,tooltip:n.jsxRuntimeExports.jsx(C,{}),tooltipLocation:{y:"top"},variant:"outlined",children:m})]})},de="channel",zo=Object.freeze(Object.defineProperty({__proto__:null,Canvas:p.Canvas,axisStateZ:p.axisStateZ,newTickFactory:p.newTickFactory,tickFactoryProps:p.tickFactoryProps,tickType:p.tickType},Symbol.toStringTag,{value:"Module"})),Oo=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:p.AcquireChannelControl,AuthoritySource:p.AuthoritySource,Chip:p.Chip,Controller:p.Controller$1,Indicator:p.Indicator,Legend:p.Legend,REGISTRY:p.REGISTRY$11,STATUSES:p.STATUSES,SetChannelValue:p.SetChannelValue,StateProvider:p.StateProvider,acquireChannelControl:p.acquireChannelControl,acquireChannelControlPropsZ:p.acquireChannelControlPropsZ,authoritySource:p.authoritySource,authoritySourceProps:p.authoritySourceProps,chipStateZ:p.chipStateZ,controllerStateZ:p.controllerStateZ,indicatorStateZ:p.indicatorStateZ,legendStateZ:p.legendStateZ,setChannelValue:p.setChannelValue,setChannelValuePropsZ:p.setChannelValuePropsZ,stateProviderStateZ:p.stateProviderStateZ,statusZ:p.statusZ,sugaredStateZ:p.sugaredStateZ},Symbol.toStringTag,{value:"Module"}));var ce;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ce||(ce={}));function Vo({color:e,dimensions:t,lineWidth:s}){return x.createElement("path",{stroke:e,strokeWidth:s,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function Ao({color:e,radius:t}){return x.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const Do={[ce.Dots]:"#91919a",[ce.Lines]:"#eee",[ce.Cross]:"#e2e2e2"},Io={[ce.Dots]:1,[ce.Lines]:1,[ce.Cross]:6},Zo=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ms({id:e,variant:t=ce.Dots,gap:s=20,size:o,lineWidth:r=1,offset:i=2,color:u,style:a,className:d}){const j=x.useRef(null),{transform:m,patternId:f}=p.useStore(Zo,p.shallow$1),S=u||Do[t],h=o||Io[t],C=t===ce.Dots,R=t===ce.Cross,v=Array.isArray(s)?s:[s,s],L=[v[0]*m[2]||1,v[1]*m[2]||1],g=h*m[2],b=R?[g,g]:L,E=C?[g/i,g/i]:[b[0]/i,b[1]/i];return x.createElement("svg",{className:p.cc(["react-flow__background",d]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:j,"data-testid":"rf__background"},x.createElement("pattern",{id:f+e,x:m[0]%L[0],y:m[1]%L[1],width:L[0],height:L[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`},C?x.createElement(Ao,{color:S,radius:g/i}):x.createElement(Vo,{dimensions:b,color:S,lineWidth:r})),x.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}ms.displayName="Background";var Fo=x.memo(ms);const qo={region:l.To.ZERO,dpr:1,os:k.w.getOS()},Yo={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},Go=c.wrap$1(p.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:s,className:o,...r})=>{const[{path:i},{bootstrapped:u,dpr:a},d]=c.use$3({aetherKey:s,type:p.Canvas$1.TYPE,schema:p.canvasStateZ,initialState:qo}),j=x.useRef({...Yo}),m=x.useCallback(h=>{j.current.bootstrapped&&d(()=>({bootstrapped:!0,region:h,dpr:window.devicePixelRatio,os:k.w.getOS({default:"Windows"})}))},[d]),f=c.useResize(m,{debounce:t});x.useEffect(()=>{const h=()=>{window.devicePixelRatio!==a&&d(C=>({...C,dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",h,{once:!0})},[a]),x.useEffect(()=>{window.addEventListener("focus",()=>d(h=>({...h}))),window.addEventListener("blur",()=>d(h=>({...h})))},[d]);const S=x.useCallback(h=>{if(f(h),h==null)return;h.className.includes("gl")?j.current.gl=h:h.className.includes("upper2d")?j.current.upper2d=h:j.current.lower2d=h;const{gl:C,lower2d:R,upper2d:v,bootstrapped:L}=j.current;if(C==null||R==null||v==null||L)return;j.current.bootstrapped=!0;const g=C.transferControlToOffscreen(),b=v.transferControlToOffscreen(),E=R.transferControlToOffscreen();d({glCanvas:g,upper2dCanvas:b,lower2dCanvas:E,bootstrap:!0,bootstrapped:!1,region:l.To.construct(C),dpr:window.devicePixelRatio,os:k.w.getOS({default:"Windows"})},[g,b,E])},[d]);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("canvas-container"),o),...r,children:[n.jsxRuntimeExports.jsx("canvas",{ref:S,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","lower2d"))}),n.jsxRuntimeExports.jsx("canvas",{ref:S,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","gl"))}),n.jsxRuntimeExports.jsx("canvas",{ref:S,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","upper2d"))}),n.jsxRuntimeExports.jsx(c.Composite,{path:i,children:u&&e})]})}),bt=(e,t)=>c.useResize(x.useCallback((s,o)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(l.k.XY.translate(l.q.scale(l.To.topLeft(r),-1)).box(s),o)},[e]),t),Ho=Object.freeze(Object.defineProperty({__proto__:null,Canvas:Go,useRegion:bt},Symbol.toStringTag,{value:"Module"})),js=x.createContext(null),fe=e=>{const t=x.useContext(js);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},fs=e=>{const t=fe("Viewport"),{addViewportHandler:s}=t;x.useEffect(()=>s(e),[s,e])},tt=(e,t)=>{const{setGridEntry:s,removeGridEntry:o}=fe(t),{key:r}=e;return c.useEffectCompare(()=>{l.J.outer.parse(e.loc),s(e)},([a],[d])=>k._.equal(a,d),[e]),x.useEffect(()=>()=>o(r),[]),{gridArea:l.g.swap(l.J.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},hs=c.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:s=0,clearOverScan:o=l.q.ZERO,children:r,hold:i=!1,onHold:u,...a})=>{const[d,j]=x.useState([]),m=c.useMemoDeepEqualProps({clearOverScan:o,hold:i}),[{path:f},{grid:S},h]=c.use$3({aetherKey:e,type:p.LinePlot.TYPE,schema:p.linePlotStateZ,initialState:{container:l.To.ZERO,viewport:l.To.DECIMAL,grid:{},...m}});x.useEffect(()=>h(w=>({...w,...m})),[m]);const C=x.useRef(new Map),R=x.useCallback(w=>(C.current.set(w,null),()=>C.current.delete(w)),[C]),v=x.useCallback(w=>{const{mode:N,box:T,stage:B}=w;(N==="pan"&&B!=="start"||N==="zoom"||N==="zoomReset"&&B==="start")&&h(A=>({...A,viewport:T})),C.current.forEach((A,I)=>I(w))},[h]),L=x.useCallback(w=>h(N=>({...N,container:w})),[h]),g=bt(L,{debounce:s}),b=x.useCallback(w=>h(N=>({...N,grid:{...N.grid,[w.key]:w}})),[h]),E=x.useCallback(w=>h(N=>{const{[w]:T,...B}=N.grid;return{...N,grid:B}}),[h]),y=x.useCallback(w=>{j(N=>[...N.filter(({key:T})=>T!==w.key),w])},[j,v]),M=x.useCallback(w=>j(N=>N.filter(({key:T})=>T!==w)),[y]),V=x.useMemo(()=>Uo(S),[S]),$=x.useCallback(w=>{h(N=>({...N,hold:w})),u==null||u(w)},[h,u]),_=x.useMemo(()=>({lines:d,setGridEntry:b,removeGridEntry:E,setLine:y,removeLine:M,setViewport:v,addViewportHandler:R,setHold:$}),[d,b,E,y,M,v,R,$]);return n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("line-plot"),style:{...t,...V},ref:g,...a,children:n.jsxRuntimeExports.jsx(js.Provider,{value:_,children:n.jsxRuntimeExports.jsx(c.Composite,{path:f,children:r})})})}),Uo=e=>{const t=l.CSS.newGridBuilder();return p.filterGridEntries("top",e).forEach(({key:s,size:o})=>t.row(`axis-start-${s}`,`axis-end-${s}`,o)),t.row("plot-start","plot-end","minmax(0, 1fr)"),p.filterGridEntries("bottom",e).forEach(({key:s,size:o})=>t.row(`axis-start-${s}`,`axis-end-${s}`,o)),p.filterGridEntries("left",e).forEach(({key:s,size:o})=>t.col(`axis-start-${s}`,`axis-end-${s}`,o)),t.col("plot-start","plot-end","minmax(0, 1fr)"),p.filterGridEntries("right",e).forEach(({key:s,size:o})=>t.col(`axis-start-${s}`,`axis-end-${s}`,o)),t.build()},vt=e=>{const t=e==="x"?"bottom":"left",s=e==="x"?p.XAxis.TYPE:p.YAxis.TYPE,o=`${e}-axis`;return c.wrap$1(s,({aetherKey:r,children:i,location:u=t,label:a="",labelLevel:d="small",labelDirection:j=e,onLabelChange:m,color:f,labelSize:S,showGrid:h,type:C,bounds:R,className:v,tickSpacing:L,autoBounds:g,autoBoundUpdateInterval:b,onAutoBoundsChange:E,style:y,...M})=>{const V=((a==null?void 0:a.length)??0)>0,$=c.useMemoDeepEqualProps({location:u,showGrid:h,type:C,bounds:R,label:a,labelDirection:j,tickSpacing:L,autoBounds:g,autoBoundUpdateInterval:b}),[{path:_},{size:w,labelSize:N,...T},B]=c.use$3({aetherKey:r,type:s,schema:p.coreAxisStateZ,initialState:$});x.useEffect(()=>B(K=>({...K,...$})),[$]),x.useEffect(()=>{const{lower:K,upper:U}=p.parseAutoBounds(T.autoBounds);T.bounds!=null&&(K&&(R==null?void 0:R.lower)!==T.bounds.lower||U&&(R==null?void 0:R.upper)!==T.bounds.upper)&&(E==null||E(T.bounds))},[T.autoBounds,T.bounds]);const A=tt({loc:u,key:`${s}-${r}`,size:w+N,order:"last"},"XAxis"),I=c.useTypography(d).toString(),Y=x.useRef(0);return x.useEffect(()=>{if(e==="y"){if(a==null)return;let U=k.dimensions(a,I)[l.g.dimension(l.g.construct(j))];U>0&&(U+=6),B(Me=>({...Me,labelSize:U}))}else{const U=k.dimensions(a,I).height+12,Me=Y.current;p.withinSizeThreshold(Me,U)||(Y.current=U,B(ot=>({...ot,labelSize:U})))}},[a,j,I]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(v,l.CSS.B("axis"),l.CSS.B(o),l.CSS.loc(u)),style:{...y,...A},align:"center",justify:e==="x"?"end":"start",direction:l.g.swap(e),...M,children:V&&n.jsxRuntimeExports.jsx(c.MaybeEditable,{className:l.CSS(l.CSS.BE("axis","label"),l.CSS.dir(j)),value:a,onChange:m,level:d})}),n.jsxRuntimeExports.jsx(c.Composite,{path:_,children:i})]})})},Ss=vt("x"),gs=vt("y"),Es=l.q.xy.extend({root:l.J.corner,units:se.z.object({x:se.z.enum(["px","decimal"]),y:se.z.enum(["px","decimal"])})}),Wo=Es.partial({root:!0,units:!0}),Xo=e=>{var s,o,r,i;const t={};return t[((s=e.root)==null?void 0:s.x)??"left"]=((o=e==null?void 0:e.units)==null?void 0:o.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((r=e.root)==null?void 0:r.y)??"top"]=((i=e==null?void 0:e.units)==null?void 0:i.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},Jo=(e,t)=>{var i,u,a,d,j,m;const s={x:e.x,y:e.y};if(t.current==null)return s;const o=l.To.construct(t.current),r=l.To.construct(t.current.parentElement);return((i=e.units)==null?void 0:i.x)==="decimal"?((u=e.root)==null?void 0:u.x)==="right"&&(s.x=1-e.x):((a=e.root)==null?void 0:a.x)==="right"?s.x=1-(e.x+l.To.width(o))/l.To.width(r):s.x/=l.To.width(r),((d=e.units)==null?void 0:d.y)==="decimal"?((j=e.root)==null?void 0:j.y)==="bottom"&&(s.y=1-e.y):((m=e.root)==null?void 0:m.y)==="bottom"?s.y=1-(e.y+l.To.height(o))/l.To.height(r):s.y/=l.To.height(r),s},Rs=(e,t)=>{if(t.current==null)return null;const s=l.To.construct(t.current.parentElement),o=l.To.construct(t.current),r={x:e.x,y:e.y,root:{...l.J.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(r.x=(1-e.x)*l.To.width(s)-l.To.width(o),r.root.x="right"):e.x<.2?r.x=e.x*l.To.width(s):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*l.To.height(s)-l.To.height(o),r.root.y="bottom"):e.y<.2?r.y=e.y*l.To.height(s):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...l.q.truncate(r,3)}},Ht=l.To.reRoot(l.To.DECIMAL,l.J.TOP_LEFT),wt=x.memo(({className:e,value:t,onChange:s,style:o,draggable:r=!0,...i})=>{const[u,a]=k.usePurePassthrough({value:t,onChange:s,initial:{x:.1,y:.1,root:l.J.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),d=x.useRef(u),j=c.useSyncedRef(r===!1),m=x.useRef(null);u!==null&&(o={...o,...Xo(u)});const f=x.useCallback(h=>{var E;if(((E=m.current)==null?void 0:E.parentElement)==null)return d.current;const C=l.To.construct(m.current.parentElement),R=l.k.XY.scale(C).scale(Ht),v=R.box(l.To.construct(m.current)),L=l.k.XY.clamp(l.To.construct(l.To.topLeft(Ht),{width:1-l.To.width(v),height:1-l.To.height(v)})),g=l.q.translate(l.q.construct(d.current),l.To.signedDims(R.box(h))),b=L.pos(g);return Rs(b,m)},[]),S=Ke({onStart:x.useCallback(()=>{d.current=Jo(d.current,m)},[]),onMove:x.useCallback(h=>{if(j.current)return;const C=f(h);C!==null&&a(C)},[]),onEnd:x.useCallback(h=>{if(j.current)return;const C=f(h);C!==null&&(d.current=C)},[])});return n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(e,l.CSS.B("legend")),bordered:!0,rounded:!0,style:o,onDragStart:S,draggable:r,ref:m,...i,onDrag:Ie,onDragEnd:Ie,empty:!0})});wt.displayName="Legend.Container";const Tt=({data:e=[],onEntryChange:t,position:s,onPositionChange:o,...r})=>{const[i,u]=x.useState(!1);return e.length===0?null:n.jsxRuntimeExports.jsx(wt,{...r,draggable:!i,value:s,onChange:o,children:e.sort((a,d)=>a.label.localeCompare(d.label)).map(({key:a,color:d,label:j})=>n.jsxRuntimeExports.jsxs(O.Space,{style:{cursor:"pointer"},direction:"x",align:"center",children:[n.jsxRuntimeExports.jsx(St.Swatch,{value:d,onChange:m=>t==null?void 0:t({key:a,color:m,label:j}),onVisibleChange:u,draggable:!1,size:"small"}),n.jsxRuntimeExports.jsx(c.MaybeEditable,{level:"small",value:j,onChange:m=>t==null?void 0:t({key:a,color:d,label:m}),noWrap:!0})]},a))})},Ko=Object.freeze(Object.defineProperty({__proto__:null,Container:wt,Simple:Tt,calcStickyPos:Rs,completeStickyXYz:Es,stickyXYz:Wo},Symbol.toStringTag,{value:"Module"})),Cs=({className:e,style:t,onLineChange:s,...o})=>{const{lines:r}=fe("Legend");return fe("Legend"),n.jsxRuntimeExports.jsx(Tt,{data:r,onEntryChange:s,...o})},ys=c.wrap$1("Line",({aetherKey:e,...t})=>{const[,,s]=c.use$3({aetherKey:e,type:p.Line.TYPE,schema:p.stateZ,initialState:t}),o=c.useMemoDeepEqualProps(t);return x.useLayoutEffect(()=>s(o),[o]),null}),Qo=Object.freeze(Object.defineProperty({__proto__:null,Line:ys},Symbol.toStringTag,{value:"Module"})),kt=c.wrap$1("Line",({aetherKey:e,color:t,label:s="",...o})=>{const{setLine:r,removeLine:i}=fe("Line");return x.useEffect(()=>(r({key:e,color:t,label:s}),()=>i(e)),[s,t]),n.jsxRuntimeExports.jsx(ys,{aetherKey:e,color:t,label:s,...o})}),bs=({level:e="h2",...t})=>{const s=c.useUniqueKey(),o=c.useTypography(e),r=tt({key:s,size:(o.lineHeight+2)*o.baseSize,loc:"top",order:"first"},"Title");return n.jsxRuntimeExports.jsx(O.Space,{justify:"center",align:"center",style:r,children:n.jsxRuntimeExports.jsx(c.MaybeEditable,{...t,level:e})})},vs=c.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:p.Tooltip.TYPE,schema:p.tooltipStateZ,initialState:{position:null}}),s=x.useRef(null),o=x.useCallback(i=>{const u=document.querySelector(".pluto-canvas-container");if(u==null)return;const a=l.To.topLeft(u);t({position:l.q.translation(a,l.q.construct(i))})},[t]),r=x.useCallback(()=>t({position:null}),[t]);return x.useEffect(()=>{if(s.current===null)return;const i=s.current.parentElement;if(i!=null)return i.addEventListener("mousemove",o),i.addEventListener("mouseleave",r),()=>{i.removeEventListener("mousemove",o),i.removeEventListener("mouseleave",r)}},[o]),n.jsxRuntimeExports.jsx("span",{ref:s})}),el=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:vs},Symbol.toStringTag,{value:"Module"})),tl={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Pt=x.forwardRef(({className:e,mode:t,maskBox:s,children:o,style:r,...i},u)=>n.jsxRuntimeExports.jsxs("div",{ref:u,className:l.CSS(l.CSS.noSelect,l.CSS.BE("viewport-mask","container"),e),style:{cursor:tl[t],...r},...i,children:[n.jsxRuntimeExports.jsx("div",{style:{...l.To.css(s),display:l.To.areaIsZero(s)?"none":"block"},className:l.CSS.BE("viewport-mask","selection")}),o]}));Pt.displayName="ZoomPanMask";const sl=new Set([k.g.UUID,k.g.JSON]),nl=k.g.ALL.filter(e=>e!==k.g.UNKNOWN).map(e=>({key:e.toString(),name:sl.has(e)?e.toString().toUpperCase():l.S.capitalize(e.toString())})),rl=[{key:"name",name:"Name"}],ol=e=>n.jsxRuntimeExports.jsx(re.DropdownButton,{...e,data:nl,columns:rl,entryRenderKey:"name"}),ll=[{key:"x",icon:n.jsxRuntimeExports.jsx(c.k0.Arrow.Right,{})},{key:"y",icon:n.jsxRuntimeExports.jsx(c.k0.Arrow.Down,{})}],il=({key:e,entry:t,onClick:s,selected:o})=>n.jsxRuntimeExports.jsx(c.Icon,{variant:o?"filled":"outlined",onClick:s,children:t.icon},e),cl=({children:e=il,...t})=>n.jsxRuntimeExports.jsx(re.Button,{...t,allowMultiple:!1,data:ll,children:e}),ws=e=>n.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS.BE("select","clear"),variant:"outlined",...e,children:n.jsxRuntimeExports.jsx(c.k0.Close,{"aria-label":"clear"})}),st=({onChange:e,value:t,entryRenderKey:s="key",columns:o,data:r,emptyContent:i,inputProps:u,allowNone:a=!0,searcher:d,className:j,variant:m,hideColumnHeader:f=!1,disabled:S,omit:h,children:C,...R})=>{const{visible:v,open:L,close:g}=c.use$1(),[b,E]=x.useState(null),y=d!=null;c.useAsyncEffect(async()=>{if(c.selectValueIsZero(t))return E(null);if((b==null?void 0:b.key)===t)return;let $=null;if(y)try{[$]=await d.retrieve([t])}finally{$??($=null)}else r!=null&&($=r.find(_=>_.key===t)??null);E($)},[d,t,r]);const M=x.useCallback(($,_)=>{Array.isArray($)||(E($==null?null:_.entries[0]),g(),e($,_))},[e,a]),V=x.useMemo(()=>y?c.Search:be.Filter,[y]);return n.jsxRuntimeExports.jsx(re.Core,{close:g,open:L,data:r,omit:h,emptyContent:i,allowMultiple:!1,visible:v,value:t,hideColumnHeader:f,onChange:M,allowNone:a,columns:o,listItem:C,...R,children:n.jsxRuntimeExports.jsx(V,{searcher:d,children:({onChange:$})=>n.jsxRuntimeExports.jsx(al,{variant:m,onChange:$,onFocus:L,selected:b,entryRenderKey:s,visible:v,allowNone:a,className:j,disabled:S})})})},Lt="Select",al=({entryRenderKey:e,selected:t,visible:s,onChange:o,onFocus:r,allowNone:i=!0,placeholder:u=Lt,className:a,disabled:d,...j})=>{const{clear:m}=c.useSelectionUtils(),[f,S]=x.useState("");x.useEffect(()=>{if(!s){if(k.S$1(t==null?void 0:t.key))return S("");if(t!=null)return S(typeof e=="function"?e(t).toString():(t==null?void 0:t[e]).toString())}},[t,s,e]);const h=L=>{o(L),S(L)},C=()=>{S(""),r==null||r()},R=L=>{s||(L.preventDefault(),r==null||r())},v=()=>{S(""),m==null||m()};return n.jsxRuntimeExports.jsx(c.Text$1,{className:l.CSS(l.CSS.BE("select","input"),a),value:f,onChange:h,onFocus:C,onKeyDown:c.matchCallback([["Enter"]],L=>{L.preventDefault(),!s&&(r==null||r())}),style:{flexGrow:1},onClick:R,placeholder:u,disabled:d,...j,children:i&&n.jsxRuntimeExports.jsx(ws,{onClick:v,disabled:d})})},Ze=({children:e="",size:t="medium",color:s,icon:o,onClose:r,className:i,onDragStart:u,...a})=>{const d=l.cssString(s);o==null&&s!=null&&(o=n.jsxRuntimeExports.jsx(c.k0.Circle,{fill:d}));const j=r==null?void 0:n.jsxRuntimeExports.jsx(c.Icon,{"aria-label":"close",size:t,className:l.CSS.BE("tag","close"),onClick:m=>{m.stopPropagation(),r()},children:n.jsxRuntimeExports.jsx(c.k0.Close,{})});return n.jsxRuntimeExports.jsx(c.WithIcon,{startIcon:o,endIcon:j,className:l.CSS(i,l.CSS.B("tag"),r!=null&&l.CSS.BM("tag","closeable")),level:k.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:u,...a,children:e})},ul=Object.freeze(Object.defineProperty({__proto__:null,Tag:Ze},Symbol.toStringTag,{value:"Module"})),nt=({onChange:e,value:t,className:s,data:o,columns:r=[],entryRenderKey:i="key",emptyContent:u,searcher:a,renderTag:d,placeholder:j,onTagDragStart:m,allowMultiple:f,allowNone:S,replaceOnSingle:h,onTagDragEnd:C,style:R,children:v,...L})=>{const{visible:g,open:b,close:E}=c.use$1(),[y,M]=x.useState([]),[V,$]=x.useState(!1),_=a!=null;c.useAsyncEffect(async()=>{$(!0),c.selectValueIsZero(t)&&M([]);const T=y.map(I=>I.key),B=k.A(t);if(k.E.unorderedPrimitiveArrays(T,B)===k.E.EQUAL)return;let A=[];if(_)try{A=await a.retrieve(B)}finally{$(!1)}else o!=null&&(A=o.filter(I=>B.includes(I.key)));M(A)},[a,_,t,o]);const w=x.useCallback((T,B)=>{T!=null&&(M(B.entries),e(k.A(T),B))},[e]),N=x.useMemo(()=>_?c.Search:be.Filter,[_]);return n.jsxRuntimeExports.jsx(re.Core,{close:E,open:b,data:o,emptyContent:u,visible:g,value:t,onChange:w,allowNone:S,replaceOnSingle:h,columns:r,allowMultiple:!0,listItem:v,...L,children:n.jsxRuntimeExports.jsx(N,{searcher:a,children:({onChange:T,value:B})=>n.jsxRuntimeExports.jsx(xl,{value:B,selectedKeys:t,className:s,onChange:T,loading:V,selected:y,onFocus:b,entryRenderKey:i,visible:g,renderTag:d,placeholder:j,onTagDragStart:m,onTagDragEnd:C,style:R})})})},xl=({selectedKeys:e,loading:t,selected:s,onChange:o,onFocus:r,visible:i,entryRenderKey:u,renderTag:a=c.componentRenderProp(Ts),placeholder:d=Lt,onTagDragStart:j,onTagDragEnd:m,value:f,className:S,...h})=>{const{onSelect:C,clear:R}=c.useSelectionUtils(),v=x.useRef(null);x.useLayoutEffect(()=>{var E;i&&((E=v.current)==null||E.focus())},[i,s]);const L=()=>{i||o(""),r==null||r()},g=()=>{i||r==null||r()},b=()=>{i||o("")};return n.jsxRuntimeExports.jsxs(c.Text$1,{ref:v,className:l.CSS(l.CSS.BE("select-multiple","input"),l.CSS.visible(i),S),onBlur:b,placeholder:d,value:f,onChange:o,onFocus:L,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:g,...h,children:[n.jsxRuntimeExports.jsx(O.Space,{direction:"x",className:l.CSS.BE("select-multiple","tags"),align:"center",grow:!0,children:k.A(e).map((E,y)=>{const M=s[y];return a({key:E,entryKey:E,entryRenderKey:u,loading:t,entry:M,onClose:()=>C==null?void 0:C(E),onDragStart:V=>j==null?void 0:j(V,E),onDragEnd:V=>m==null?void 0:m(V,E)})})}),n.jsxRuntimeExports.jsx(ws,{onClick:R})]})},Ts=({entryKey:e,entryRenderKey:t,entry:s,loading:o,...r})=>{let i=e;return s!=null&&(i=typeof t=="function"?t(s):s[t]),x.createElement(Ze,{size:"small",variant:"outlined",className:l.CSS(s==null&&!o&&l.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...r,key:e.toString()},k.L(i))},dl=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:re.BaseButton,Button:re.Button,DEFAULT_PLACEHOLDER:Lt,DataType:ol,Direction:cl,DropdownButton:re.DropdownButton,Multiple:nt,MultipleTag:Ts,Single:st,defaultButton:re.defaultButton},Symbol.toStringTag,{value:"Module"})),Ae=6,pl=2,Ut=5,ml=e=>l.To.width(e)<Ut&&l.To.height(e)<Ut,jl=["zoom","pan","select","zoomReset"],Ne=[...jl,"click"],fl=se.z.enum(Ne),ks=["zoom","select"],De={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},Ps={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},Ls={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Mt={zoom:De,pan:Ps,select:Ls,zoomReset:De,click:De},hl=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([s,o])=>s==="defaultMode"?[s,o]:[s,o.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},Sl=l.To.construct(0,0,1,1,l.J.TOP_LEFT),gl={width:30,height:50},Ms=({onChange:e,triggers:t,initial:s=Sl,threshold:o=gl,ref:r})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[u,a]=x.useState(l.To.ZERO),[d,j]=x.useState(i),[m,f]=c.useStateRef(s),S=x.useRef(l.q.ZERO),h=x.useRef(null),C=l._.construct(o);x.useEffect(()=>f(()=>l.To.truncate(s,Ae)),[s]),x.useEffect(()=>j(i),[i]);const[R,v,L,g]=c.useMemoCompare(()=>{const $={...Mt[i],...t},_=c.flattenConfig($),w=hl($);return[$,_,w,c.flattenConfig(w)]},c.compareModeConfigs,[t]),b=x.useCallback(({box:$,triggers:_,stage:w,cursor:N})=>{if(h.current==null)return;const T=c.determineMode(R,_),B=l.To.construct(h.current);if(T==null)return;if(T==="zoomReset")return a(l.To.ZERO),e==null||e({box:l.To.DECIMAL,mode:T,stage:w,cursor:N}),f(l.To.DECIMAL);const A=ml($);if(w==="end"){if(A){T==="zoom"&&a(l.To.ZERO),e==null||e({box:m.current,mode:"click",stage:w,cursor:N});return}return f(Y=>{if(T==="pan"){const U=Wt($,Y,B);return U===null||l.To.equals(U,Y)?Y:(e==null||e({box:U,mode:T,stage:w,cursor:N}),U)}const K=E($,Y,B);return K===null?Y:(e==null||e({box:K,mode:T,stage:w,cursor:N}),T==="zoom"?(a(l.To.ZERO),K):l.To.truncate(Y,Ae))})}if(ks.includes(T))return A?void 0:a(l.k.XY.scale(B).clamp(B).translate({x:-l.To.left(B),y:-l.To.top(B)}).box(Xt(C,$,B)));if(a(Y=>l.To.areaIsZero(Y)?Y:l.To.ZERO),l.q.distance(N,S.current)<pl)return;S.current=N;const I=Wt($,m.current,B);e==null||e({box:I,mode:T,stage:w,cursor:N})},[a,j,e,R,o.height,o.width,f,h]);x.useImperativeHandle(r,()=>({reset:()=>{a(l.To.ZERO),f(l.To.DECIMAL),e==null||e({box:l.To.DECIMAL,mode:"zoomReset",stage:"start",cursor:l.q.ZERO})}}),[e]);const E=x.useCallback(($,_,w)=>l.To.truncate(pt(_,w).box(Xt(C,$,w)),Ae),[o]),y=c.useHeldRef({triggers:[["Control"]]}),M=c.useHeldRef({triggers:[["Alt"]]});x.useEffect(()=>{const $=_=>{if(h.current==null)return;let w=1;_.deltaY<0?w-=.035:w+=.035;const N=l.To.construct(h.current),T=l.q.construct(_);if(!l.To.contains(N,T)||_.target!==h.current)return;const A=pt(m.current,l.To.construct(h.current)).pos(l.q.construct(_));let Y=l.k.XY.magnify({x:y.current.held?1:w,y:M.current.held?1:w}).box(m.current);Y=l.To.translate(Y,{x:y.current.held?0:A.x*(1-w),y:M.current.held?0:A.y*(1-w)}),f(Y),e==null||e({stage:"end",box:Y,cursor:l.q.construct(_),mode:"zoom"})};return window.addEventListener("wheel",$),()=>window.removeEventListener("wheel",$)},[f,e]),gt.useDrag({bound:h,onDrag:b,triggers:v,loose:!0});const V=x.useCallback(({triggers:$,stage:_})=>{if(_==="end")return j(i);const w=c.determineMode(L,$);w!=null&&j(w)},[L,i,e]);return c.use$2({triggers:g,callback:V,region:h}),{maskBox:u,ref:h,mode:d}},pt=(e,t)=>l.k.XY.scale(t).clamp(t).scale(e),Wt=(e,t,s)=>{let o=l.To.signedDims(pt(t,s).box(e));return o={signedWidth:-o.signedWidth,signedHeight:-o.signedHeight},l.To.truncate(l.k.XY.translate(l.q.construct(o)).box(t),Ae)},Xt=(e,t,s)=>l.To.height(t)<=e.height?l.To.construct(l.To.left(t),l.To.top(s),l.To.width(t),l.To.height(s)):l.To.width(t)<=e.width?l.To.construct(l.To.left(s),l.To.top(t),l.To.width(s),l.To.height(t)):t,El=({mode:e,triggers:t})=>n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",children:[n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:l.S.capitalize(e)}),n.jsxRuntimeExports.jsx(gt.Text,{trigger:t[0],level:"small"})]}),Rl={zoom:n.jsxRuntimeExports.jsx(c.k0.Zoom,{}),pan:n.jsxRuntimeExports.jsx(c.k0.Pan,{}),select:n.jsxRuntimeExports.jsx(c.k0.Selection,{}),zoomReset:n.jsxRuntimeExports.jsx(c.k0.Expand,{}),click:n.jsxRuntimeExports.jsx(c.k0.Bolt,{})},Cl=({triggers:e,disable:t=["zoomReset","click"],...s})=>{const o=Object.entries(e).filter(([r])=>!t.includes(r)&&Ne.includes(r)).map(([r,i])=>({key:r,icon:Rl[r],tooltip:n.jsxRuntimeExports.jsx(El,{mode:r,triggers:i})})).sort((r,i)=>Ne.indexOf(r.key)-Ne.indexOf(i.key));return n.jsxRuntimeExports.jsx(re.Button,{...s,data:o,entryRenderKey:"icon",children:({title:r,entry:i,...u})=>x.createElement(c.Icon,{...u,key:i.key,variant:u.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},yl=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Mt,MASK_MODES:ks,MODES:Ne,Mask:Pt,PAN_DEFAULT_TRIGGERS:Ps,SELECT_DEFAULT_TRIGGERS:Ls,SelectMode:Cl,ZOOM_DEFAULT_TRIGGERS:De,modeZ:fl,use:Ms},Symbol.toStringTag,{value:"Module"})),$s=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,$t=x.forwardRef(({children:e,initial:t=l.To.DECIMAL,onChange:s,...o},r)=>{const{setViewport:i}=fe("Viewport");x.useLayoutEffect(()=>{i({box:t,mode:"zoom",cursor:l.q.ZERO,stage:"start"})},[i,t]);const u=x.useCallback(d=>{i(d),s==null||s(d)},[s,i]),a=Ms({onChange:u,initial:t,ref:r,...o});return n.jsxRuntimeExports.jsx(Pt,{className:l.CSS.BE("line-plot","viewport"),...a,children:e})});$t.displayName="Viewport";const bl=Object.freeze(Object.defineProperty({__proto__:null,Legend:Cs,Line:kt,LinePlot:hs,Title:bs,Tooltip:el,Viewport:$t,XAxis:Ss,YAxis:gs,axisFactory:vt,selectViewportEl:$s,useContext:fe,useGridEntry:tt,useViewport:fs},Symbol.toStringTag,{value:"Module"})),vl=c.wrap$1("Tooltip",({aetherKey:e,...t})=>(c.use$3({aetherKey:e,type:p.Annotation.TYPE,schema:p.annotationStateZ,initialState:t}),null)),Ns=c.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...s})=>{const{setViewport:o,setHold:r}=fe("Range.Provider"),[,{hovered:i,count:u},a]=c.use$3({aetherKey:e,type:p.Provider$1.TYPE,schema:p.providerStateZ,initialState:{...s,cursor:null,hovered:null,count:0}}),d=tt({key:e,loc:"top",size:u>0?32:0,order:"last"},"Annotation.Provider"),j=c.useContextMenu(),m=c.useSyncedRef(j.visible),f=x.useCallback(S=>{const h=R=>{a(v=>({...v,cursor:{x:R.clientX,y:R.clientY}}))},C=S.currentTarget;C.addEventListener("mousemove",h),C.addEventListener("mouseleave",()=>{C.removeEventListener("mousemove",h),m.current||a(R=>({...R,cursor:null}))},{once:!0})},[a]);return n.jsxRuntimeExports.jsx(c.ContextMenu,{style:{...d,cursor:i!=null?"pointer":"default"},...j,menu:()=>t==null||i==null?null:t(i),children:n.jsxRuntimeExports.jsx(O.Space,{style:{width:"100%",height:"100%"},onClick:()=>{i!=null&&(o({box:l.To.construct({x:i.viewport.lower,y:0},{x:i.viewport.upper,y:1}),mode:"zoom",cursor:l.q.ZERO,stage:"start"}),r(!0))},onMouseEnter:f})})}),wl=Object.freeze(Object.defineProperty({__proto__:null,Annotation:vl,Provider:Ns},Symbol.toStringTag,{value:"Module"})),_s={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Tl=c.flattenConfig(_s),Bs=c.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:p.Measure.TYPE,schema:p.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=x.useRef(null),o=c.useHeldRef({triggers:Tl,loose:!0}),r=x.useCallback(({mode:a,cursor:d})=>{if(a==="click"){const j=c.determineMode(_s,o.current.triggers,!0);if(["one","two"].includes(j))return t(m=>({...m,[j]:d}));t(j==="clear"?m=>({...m,one:null,two:null}):m=>({...m,one:m.one??d,two:m.one!==null?d:m.two}))}},[t,o]);fs(r);const i=x.useCallback(a=>t(d=>({...d,hover:l.q.construct(a)})),[t]),u=x.useCallback(()=>{t(a=>({...a,hover:null}))},[t]);return x.useEffect(()=>{if(s.current===null)return;const a=s.current.parentElement;if(a!=null)return a.addEventListener("mousemove",i),a.addEventListener("mouseleave",u),()=>{a.removeEventListener("mousemove",i),a.removeEventListener("mouseleave",u)}},[r]),n.jsxRuntimeExports.jsx("span",{ref:s})}),kl=Object.freeze(Object.defineProperty({__proto__:null,Measure:Bs},Symbol.toStringTag,{value:"Module"})),Nt=c.wrap$1("Rule",({aetherKey:e,label:t,position:s,onLabelChange:o,onPositionChange:r,units:i="",color:u,lineWidth:a,lineDash:d})=>{const[j,m]=k.usePurePassthrough({value:t,onChange:o,initial:""}),[,{position:f,pixelPosition:S},h]=c.use$3({aetherKey:e,type:p.Rule.TYPE,schema:p.ruleStateZ,initialState:{color:u,dragging:!1,position:s,lineWidth:a,lineDash:d}});x.useEffect(()=>{if(f==null)return;if(s==null)return r==null?void 0:r(f);const E=l.R.construct(f+.01,f-.01);s!=null&&!l.R.contains(E,s)&&(r==null||r(Math.trunc(f*100)/100))},[f]);const C=x.useRef(S);S!==C.current&&(C.current=S);const R=x.useRef(S);x.useEffect(()=>{h(E=>({...E,position:s,color:u,lineWidth:a,lineDash:d}))},[s,u,a,d]);const v=Ke({onStart:x.useCallback(()=>{h(E=>({...E,dragging:!0})),R.current=C.current},[]),onMove:E=>{h(y=>({...y,pixelPosition:(R.current??0)+l.To.signedHeight(E)}))},onEnd:x.useCallback(()=>{h(E=>({...E,dragging:!1})),R.current=S},[])}),L=x.useRef(null);if(f==null||S==null)return null;const g=$s(L==null?void 0:L.current),b=n.jsxRuntimeExports.jsxs("div",{ref:L,className:l.CSS.B("rule"),style:{top:`calc(${S}px - 0.5rem)`},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("rule","drag-handle"),onDragStart:v,draggable:!0}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[n.jsxRuntimeExports.jsx(c.Editable,{level:"p",value:j,onChange:m}),n.jsxRuntimeExports.jsx(c.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${f.toFixed(2)} ${i}`})]})]});return g==null?b:Et.createPortal(b,g)}),Pl=Object.freeze(Object.defineProperty({__proto__:null,Rule:Nt},Symbol.toStringTag,{value:"Module"})),zs=c.canDropOfType(de),Ll=({lines:e,axes:t,showTitle:s=!0,title:o="",onTitleChange:r,showLegend:i=!0,legendPosition:u,onLegendPositionChange:a,titleLevel:d="h4",onLineChange:j,onRuleChange:m,onAxisChannelDrop:f,onAxisChange:S,rules:h,enableTooltip:C=!0,enableMeasure:R=!1,initialViewport:v=l.To.DECIMAL,onViewportChange:L,viewportTriggers:g,annotationProvider:b,...E})=>{var _;const y=t.filter(({location:w})=>l.J.isY(w)),M=x.useRef(),V=c.usePrevious(e.length),$=c.usePrevious(E.hold);return(V===0&&e.length!==0||$===!0&&E.hold===!1)&&((_=M.current)==null||_.reset()),n.jsxRuntimeExports.jsxs(hs,{...E,children:[y.map((w,N)=>{const T=e.filter(I=>I.axes.x===w.key),B=t.filter(({location:I})=>l.J.isX(I)),A=h==null?void 0:h.filter(I=>[...B.map(({key:Y})=>Y),w.key].includes(I.axis));return n.jsxRuntimeExports.jsx(Ml,{axis:w,index:N,lines:T,yAxes:B,rules:A,onAxisChannelDrop:f,onAxisChange:S,annotationProvider:b},w.key)}),i&&n.jsxRuntimeExports.jsx(Cs,{onLineChange:j,position:u,onPositionChange:a}),s&&n.jsxRuntimeExports.jsx(bs,{value:o,onChange:r,level:d}),n.jsxRuntimeExports.jsxs($t,{initial:v,onChange:L,triggers:g,ref:M,children:[C&&n.jsxRuntimeExports.jsx(vs,{}),R&&n.jsxRuntimeExports.jsx(Bs,{})]})]})},Ml=({yAxes:e,lines:t,index:s,rules:o,onRuleChange:r,onAxisChannelDrop:i,onAxisChange:u,axis:{location:a,key:d,showGrid:j,...m},annotationProvider:f})=>{const S=c.useDrop({type:"Channel.LinePlot.XAxis",canDrop:zs,onDrop:x.useCallback(({items:R})=>{const v=c.filterByType(de,R);return i==null||i(d,v.map(({key:L})=>L)),v},[d,i])}),h=o==null?void 0:o.filter(R=>R.axis===d),C=c.useDraggingState();return n.jsxRuntimeExports.jsxs(Ss,{...m,...S,location:a,showGrid:j??s===0,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(de)(C))),onAutoBoundsChange:R=>u==null?void 0:u({key:d,bounds:R}),children:[e.map((R,v)=>{const L=t.filter(b=>b.axes.y===R.key),g=o==null?void 0:o.filter(b=>b.axis===R.key);return n.jsxRuntimeExports.jsx(Nl,{axis:{...R,showGrid:j??(s===0&&v===0)},lines:L,rules:g,onRuleChange:r,onAxisChannelDrop:i,onAxisChange:u},R.key)}),h==null?void 0:h.map(R=>x.createElement(Nt,{aetherKey:R.key,...R,key:R.key,onLabelChange:v=>r==null?void 0:r({key:R.key,label:v}),onPositionChange:v=>r==null?void 0:r({key:R.key,position:v})})),n.jsxRuntimeExports.jsx(Ns,{...f})]})},$l=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Nl=({lines:e,rules:t,onRuleChange:s,onAxisChannelDrop:o,onAxisChange:r,axis:{key:i,location:u,...a}})=>{const d=c.useDrop({type:"Channel.LinePlot.YAxis",canDrop:zs,onDrop:x.useCallback(({items:m})=>{const f=c.filterByType(de,m);return o==null||o(i,f.map(({key:S})=>S)),f},[i,o])}),j=c.useDraggingState();return n.jsxRuntimeExports.jsxs(gs,{...a,...d,location:u,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(de)(j))),onAutoBoundsChange:m=>r==null?void 0:r({key:i,bounds:m}),children:[e.map(m=>n.jsxRuntimeExports.jsx(_l,{line:m},$l(m))),t==null?void 0:t.map(m=>x.createElement(Nt,{aetherKey:m.key,...m,key:m.key,onLabelChange:f=>s==null?void 0:s({key:m.key,label:f}),onPositionChange:f=>s==null?void 0:s({key:m.key,position:f})}))]})},_l=({line:e})=>e.variant==="static"?n.jsxRuntimeExports.jsx(zl,{line:e}):n.jsxRuntimeExports.jsx(Bl,{line:e}),Bl=({line:{key:e,timeSpan:t,channels:{x:s,y:o},...r}})=>{const i=Number(t.valueOf())*3,u=p.streamChannelData({timeSpan:t,channel:o,keepFor:i}),a=s!=null&&s!==0,d=p.streamChannelData({timeSpan:t,channel:a?s:o,useIndexOfChannel:!a,keepFor:i});return n.jsxRuntimeExports.jsx(kt,{aetherKey:e,y:u,x:d,...r})},zl=({line:{timeRange:e,key:t,channels:{x:s,y:o},...r}})=>{const i=p.channelData({timeRange:e,channel:o}),u=s!=null&&s!==0,a=p.channelData({timeRange:e,channel:u?s:o,useIndexOfChannel:!u});return n.jsxRuntimeExports.jsx(kt,{aetherKey:t,y:i,x:a,...r})},Jt=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],Fe=({items:e},t)=>{const s=c.filterByType(de,e);return s.length>0&&!s.every(o=>t.includes(o.key))},Os=["name","alias"],Vs=e=>{const t=Qe();return x.useMemo(()=>e.length===0?Jt:Jt.filter(s=>e.includes(s.key)),[e,t])},Ol=({columns:e=Os,onChange:t,className:s,value:o,searchOptions:r,...i})=>{const u=ve(),a=Qe(),d=Vs(e),j=yt(),m=c.useMemoDeepEqualProps(r),f=x.useMemo(()=>u==null?void 0:u.channels.newSearcherWithOptions({rangeKey:j,internal:!1,...m}),[u,j,m]),S=u!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:h,onDragEnd:C,...R}=c.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:x.useCallback(E=>Fe(E,k.A(o)),[o]),onDrop:x.useCallback(({items:E})=>{const y=c.filterByType(de,E);if(y.length===0)return[];const M=k.n([...k.A(o),...y.map(V=>V.key)]);return t(M,{clickedIndex:null,clicked:null,entries:[]}),y},[t,o])}),v=c.useDraggingState(),L=x.useCallback(({dropped:E})=>{t(k.A(o).filter(y=>!E.some(M=>M.key===y)),{clickedIndex:null,clicked:null,entries:[]})},[t,o]),g=x.useCallback((E,y)=>h([{key:y,type:de}],L),[h,L]),b=x.useCallback(E=>a[E.key]??E.name,[a]);return n.jsxRuntimeExports.jsx(nt,{className:l.CSS(s,l.CSS.dropRegion(Fe(v,k.A(o)))),value:o,onTagDragStart:g,onTagDragEnd:C,searcher:f,onChange:t,columns:d,emptyContent:S,entryRenderKey:b,...R,...i})},Ce=({columns:e=Os,onChange:t,value:s,className:o,data:r,searchOptions:i,...u})=>{const a=ve(),d=Qe(),j=Vs(e),m=yt(),f=c.useMemoDeepEqualProps(i),S=x.useMemo(()=>{if(!(r!=null&&r.length>0))return a==null?void 0:a.channels.newSearcherWithOptions({rangeKey:m,internal:!1,...f})},[a,m,r==null?void 0:r.length,f]),h=a!=null?void 0:n.jsxRuntimeExports.jsx(c.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),C=x.useId(),R=x.useMemo(()=>({key:C,type:"Channel.SelectMultiple"}),[C]),{startDrag:v,onDragEnd:L,...g}=c.useDragAndDrop({type:"Channel.SelectSingle",canDrop:x.useCallback(M=>Fe(M,k.o(s)),[s]),onDrop:x.useCallback(({items:M})=>{const V=c.filterByType(de,M);return V.length===0?[]:(t(V[0].key,{clickedIndex:null,clicked:null,entries:[]}),V)},[R,t])}),b=c.useDraggingState(),E=x.useCallback(()=>s!=null&&v([{type:de,key:s}]),[v,s]),y=x.useCallback(M=>d[M.key]??M.name,[d]);return n.jsxRuntimeExports.jsx(st,{data:r,className:l.CSS(o,l.CSS.dropRegion(Fe(b,k.o(s)))),value:s,onDragStart:E,onDragEnd:L,onChange:t,searcher:S,columns:j,emptyContent:h,entryRenderKey:y,...g,...u})},Vl=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:Bo,AliasProvider:ps,LinePlot:Ll,SelectMultiple:Ol,SelectSingle:Ce,useActiveRange:yt,useAlias:ds,useAliases:Qe,useContext:xs,useName:et},Symbol.toStringTag,{value:"Module"})),As=e=>k.c(e,(t,s,o)=>{const r=s===o.length-1,i=!isNaN(parseInt(t)),u=!isNaN(parseInt(o[s+1]));return i&&(t="element"),r||u?t:[t,"shape"]}),Kt=(e,t)=>{if(e==null)return null;const s=e[t];return s==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:s},Al=(e,t,s)=>k.i(Kt(e,"shape"),As(t),{...s,getter:Kt}),Dl=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:Al,getFieldSchemaPath:As},Symbol.toStringTag,{value:"Module"})),Te=({path:e,optional:t=!1,onChange:s})=>{const o=he(),{get:r,bind:i,set:u,setStatus:a}=o,[d,j]=x.useState(r(e,{optional:t}));x.useEffect(()=>(j(r(e,{optional:t})),i({path:e,onChange:j,listenToChildren:!1})),[e,s,i,r]);const m=x.useCallback(S=>{s==null||s(S,{...o,path:e}),u(e,S)},[e,u,s]),f=x.useCallback(S=>a(e,S),[e,a]);if(d==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}return{onChange:m,setStatus:f,...d}},Ds=(e,t=!1,s)=>{const{get:o,bind:r}=he(s),[,i]=x.useState(0);return x.useEffect(()=>(i(u=>u+1),r({path:e,onChange:()=>i(u=>u+1)})),[e,r]),o(e,{optional:t})??null},Il=(e,t=!1,s)=>{var u;const{get:o,bind:r}=he(s),[,i]=x.useState(0);return x.useEffect(()=>(i(a=>a+1),r({path:e,onChange:()=>i(a=>a+1)})),[e,r]),((u=o(e,{optional:t}))==null?void 0:u.value)??null},Zl=e=>{var t,s;return((s=(t=Ds(e,!0))==null?void 0:t.status)==null?void 0:s.variant)==="success"},Fl=({path:e,ctx:t,onChange:s})=>{const o=he(t);x.useEffect(()=>o.bind({path:e,onChange:r=>s(r,o),listenToChildren:!1}),[e,o])},ql=({path:e,optional:t=!1})=>{const{bind:s,get:o}=he(),[r,i]=x.useState(o(e,{optional:t}));if(x.useEffect(()=>(i(o(e,{optional:t})),s({path:e,onChange:u=>i({...u,value:k.C(u.value)}),listenToChildren:!0})),[e,s,o]),r==null&&!t)throw new Error("Field state is null");return(r==null?void 0:r.value)??null},Yl=({path:e,updateOnChildren:t=!1})=>{const{bind:s,get:o,set:r}=he(),[i,u]=x.useState(o(e).value);x.useEffect(()=>(u(o(e).value),s({path:e,onChange:S=>u(k.C(S.value)),listenToChildren:t})),[e,s,o,u]);const a=x.useCallback(S=>{const h=k.C(o(e).value);h.push(...k.A(S)),r(e,h,{validateChildren:!1})},[e,o,r]),d=x.useCallback((S,h)=>{const C=k.C(o(e).value);C.splice(h,0,...k.A(S)),r(e,C,{validateChildren:!1})},[e,o,r]),j=x.useCallback(S=>{const h=o(e).value,C=new Set(k.A(S));r(e,h.filter((R,v)=>!C.has(v)))},[e,k.state,o]),m=x.useCallback(S=>{const h=o(e).value,C=new Set(k.A(S));r(e,h.filter((R,v)=>C.has(v)))},[e,i,o]),f=x.useCallback(S=>{r(e,k.executeSetter(S,o(e).value))},[e,r]);return{value:i,push:a,remove:j,keepOnly:m,set:f,add:d}},_t=x.createContext({bind:()=>()=>{},set:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1,setStatus:()=>{},clearStatuses:()=>{}}),he=e=>{const t=x.useContext(_t);return e??t},Qt=e=>({key:e,variant:"success",message:""}),Gl=e=>e.code===se.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",Hl=({values:e,sync:t=!1,schema:s,onChange:o})=>{const r=x.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),i=c.useSyncedRef(s),u=c.useSyncedRef(o),a=x.useCallback(({path:g,onChange:b,listenToChildren:E=!1})=>{var $;const{parentListeners:y,listeners:M}=r.current,V=E?y:M;return V.has(g)||V.set(g,new Set),($=V.get(g))==null||$.add(b),()=>{var _;return(_=V.get(g))==null?void 0:_.delete(b)}},[]),d=x.useCallback((g,{optional:b}={optional:!1})=>{const{state:E,statuses:y,touched:M}=r.current,V=k._.get(E,g,{optional:b});if(V==null)return null;const $={value:V,status:y.get(g)??Qt(g),touched:M.has(g),required:!1};if(i.current==null)return $;const _=i.current,w=Dl.getFieldSchema(_,g,{optional:!0});return w==null||($.required=!w.isOptional()),$},[]),j=x.useCallback(g=>{var y;const{listeners:b}=r.current,E=d(g,{optional:!0});E!=null&&((y=b.get(g))==null||y.forEach(M=>M(E)))},[]),m=x.useCallback(g=>{const{listeners:b,parentListeners:E}=r.current,y=b.get(g);if(y!=null){const M=d(g,{optional:!0});M!=null&&y.forEach(V=>{V(M)})}E.forEach((M,V)=>{if(k._.pathsMatch(g,V)){const _=d(V,{optional:!0});_!=null&&M.forEach(w=>{w(_)})}})},[]),f=x.useCallback((g,b="",E=!0)=>{const{statuses:y,listeners:M,touched:V}=r.current;if(g.success){const N=[...y.keys()];return y.clear(),N.forEach(T=>j(T)),!0}let $=!0;const _=new Set(g.error.issues.map(N=>N.path.join(".")));let w=(N,T)=>N===T;return E&&(w=(N,T)=>k._.pathsMatch(N,T)),g.error.issues.forEach(N=>{var Y;const{message:T}=N,B=N.path.join(".");if(!w(B,b))return;const A=Gl(N);A!=="warning"&&($=!1),y.set(B,{key:B,variant:A,message:T}),V.add(B);let I=d(B,{optional:!0});I==null&&(I={value:void 0,status:y.get(B)??Qt(B),touched:!1,required:!1}),(Y=M.get(B))==null||Y.forEach(K=>K(I))}),y.forEach((N,T)=>{_.has(T)||(y.delete(T),j(T))}),$},[]),S=x.useCallback((g,b)=>{if(i.current==null)return!0;const{state:E}=r.current,y=i.current.safeParse(E);return f(y,g,b)},[f]),h=x.useCallback(async(g,b)=>{if(i.current==null)return!0;const{state:E}=r.current,y=await i.current.safeParseAsync(E);return f(y,g,b)},[f]),C=x.useCallback((g,b,E={})=>{var $;const{validateChildren:y=!0}=E,{state:M,touched:V}=r.current;V.add(g),g.length===0?r.current.state=b:k._.set(M,g,b);try{S(g,y)}catch{h(g,y)}m(g),($=u.current)==null||$.call(u,r.current.state)},[]),R=x.useCallback(g=>k._.has(r.current.state,g),[]),v=x.useCallback((g,b)=>{r.current.statuses.set(g,b),r.current.touched.add(g),j(g)},[]),L=x.useCallback(()=>{const{statuses:g}=r.current;g.clear(),g.forEach((b,E)=>j(E))},[]);return x.useEffect(()=>{if(!t)return;const{listeners:g}=r.current;r.current.state=e,g.forEach((b,E)=>{const y=d(E,{optional:!0});y!=null&&b.forEach(M=>M(y))})},[t,e]),x.useMemo(()=>({bind:a,set:C,get:d,validate:S,validateAsync:h,value:()=>r.current.state,has:R,setStatus:v,clearStatuses:L}),[])},Ul=e=>n.jsxRuntimeExports.jsx(_t.Provider,{value:e,children:e.children}),Wl=c.componentRenderProp(c.Text$1),pe=({path:e,children:t=Wl,label:s,padHelpText:o=!0,visible:r=!0,hideIfNull:i=!1,optional:u,onChange:a,className:d,...j})=>{const m=Te({path:e,optional:u??i,onChange:a}),f=he();if(m==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(s==null&&(s=l.S.capitalize(k._.element(e,-1))),r=typeof r=="function"?r(m,f):r,!r)return null;const S=m.status.message,{onChange:h,value:C}=m;return n.jsxRuntimeExports.jsx(me.Item,{padHelpText:o,helpText:S,helpTextVariant:m.status.variant,label:s,required:m.required,className:l.CSS(d,l.CSS.BE("field",e.split(".").join("-")),l.CSS.M(m.status.variant)),...j,children:t({onChange:h,value:C})})},Se=e=>({fieldKey:t,fieldProps:s,inputProps:o})=>{const r=({inputProps:i,path:u,fieldKey:a=t,...d})=>n.jsxRuntimeExports.jsx(pe,{...s,...d,path:a?`${u}.${a}`:u,children:j=>n.jsxRuntimeExports.jsx(e,{...j,...o,...i})});return r.displayName=e.displayName,r},Is=Se(c.Numeric),Xl=Is({}),Zs=Se(c.Text$1),Jl=Zs({}),Fs=Se(c.Switch$1),Kl=Fs({}),Ql=Se(st),ei=Se(nt),ti=Se(re.DropdownButton),si=Object.freeze(Object.defineProperty({__proto__:null,Context:_t,Field:pe,Form:Ul,NumericField:Xl,SwitchField:Kl,TextField:Jl,buildDropdownButtonSelectField:ti,buildNumericField:Is,buildSelectMultiField:ei,buildSelectSingleField:Ql,buildSwitchField:Fs,buildTextField:Zs,fieldBuilder:Se,use:Hl,useChildFieldValues:ql,useContext:he,useField:Te,useFieldArray:Yl,useFieldListener:Fl,useFieldState:Ds,useFieldValid:Zl,useFieldValue:Il},Symbol.toStringTag,{value:"Module"})),ni=[{key:"name",name:"Name"},{key:"location",name:"Location"}],ri=({searchOptions:e,...t})=>{const s=ve();let o=s==null?void 0:s.hardware.devices;return e!=null&&s!=null&&(o=s.hardware.devices.newSearcherWithOptions(e)),n.jsxRuntimeExports.jsx(st,{columns:ni,searcher:o,entryRenderKey:"name",...t})},oi=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:ri},Symbol.toStringTag,{value:"Module"})),ze=(e,t)=>x.cloneElement(e,{className:l.CSS(e.props.className,l.CSS.B("sub"),l.CSS.M(t))}),qs=({topRight:e,topLeft:t,bottomLeft:s,bottomRight:o,children:r,className:i,...u})=>n.jsxRuntimeExports.jsxs("div",{className:l.CSS(i,l.CSS.B("icon")),...u,children:[e&&ze(e,"topRight"),t&&ze(t,"topLeft"),s&&ze(s,"bottomLeft"),o&&ze(o,"bottomRight"),r]}),li=e=>n.jsxRuntimeExports.jsx(qs,{topRight:n.jsxRuntimeExports.jsx(c.k0.Add,{}),...e}),ii=Object.freeze(Object.defineProperty({__proto__:null,Create:li,Icon:qs},Symbol.toStringTag,{value:"Module"})),ci=({visible:e,children:t,close:s,...o})=>{const r=x.useRef(null);return c.useClickOutside({ref:r,onClickOutside:s}),c.use$2({triggers:[["Escape"]],callback:s,loose:!0}),Et.createPortal(n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(l.CSS.BE("modal","bg"),l.CSS.visible(e)),role:"dialog",empty:!0,align:"center",children:n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(l.CSS.BE("modal","dialog")),role:"dialog",empty:!0,ref:r,...o,children:n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(l.CSS.BE("modal","content")),role:"dialog",empty:!0,children:t})})}),c.getRootElement())},ai=Object.freeze(Object.defineProperty({__proto__:null,Modal:ci},Symbol.toStringTag,{value:"Module"})),Bt=new Error("Tab not found"),ui=new Error("Invalid Mosaic"),Ys=(e,t,s="center",o)=>{var d;if(e=ge(e),o===void 0)return mt(e,t);const r=Xs(e,o);if(s==="center")return(d=r.tabs)==null||d.push(t),r.selected=t.tabKey,e;if(r.tabs==null||r.tabs.length===0)return e;const[i,u,a]=pi(s);if(r.direction=a,r[i]={key:0,tabs:[t],selected:t.tabKey},r[u]={key:0,tabs:r.tabs,selected:r.selected},r.first==null||r.last==null)throw ui;return r.first.key=r.key*2,r.last.key=r.key*2+1,r.tabs=void 0,r.size=void 0,r.selected=void 0,e},mt=(e,t)=>(e=ge(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=mt(e.first,t):e.last!=null&&(e.last=mt(e.last,t)),e)),qe=e=>{e=ge(e);const t=[];if(e.tabs!=null&&(e.selected=X.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[s,o]=qe(e.first);e.first=s,t.push(...o)}if(e.last!=null){const[s,o]=qe(e.last);e.last=s,t.push(...o)}return[e,t]},zt=(e,t)=>{var r;e=ge(e);const[,s]=ye(e,t);if(s==null)return[e,null];s.tabs=(r=s.tabs)==null?void 0:r.filter(i=>i.tabKey!==t),s.selected=X.resetSelection(s.selected,s.tabs),e=di(e);const o=s.selected??Ye(e);return[e,o]},Ye=e=>e.selected!=null?e.selected:e.first!=null?Ye(e.first):e.last!=null?Ye(e.last):null,Gs=(e,t)=>{e=ge(e);const[s,o]=ye(e,t);if(s==null||o==null)throw Bt;return o.selected=t,e},Hs=(e,t,s,o)=>{e=ge(e);const[r,i]=ye(e,t);if(r==null||i==null)throw Bt;const[u,a]=zt(e,t);return[Ys(u,r,s,o),a]},Us=(e,t,s)=>{const o=Ge(e,t);if(o==null)throw new Error("Node not found");return o.size=s,e},Ws=(e,t,s)=>{e=ge(e);const[,o]=ye(e,t);if((o==null?void 0:o.tabs)==null)throw Bt;return o.tabs=X.rename(t,s,(o==null?void 0:o.tabs)??[]),e},xi=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,Xs=(e,t)=>{const s=Ge(e,t);if(s!=null)return s;const o=Math.floor(t/2);return o===0?e:Xs(e,o)},di=e=>{let t=!0;for(;t;)[e,t]=jt(e);return e.first==null&&e.last==null&&(e.key=1),e},jt=e=>{if(e.first==null||e.last==null)return[e,!1];if(ts(e.first))return[es(e.last,!0),!0];if(ts(e.last))return[es(e.first,!1),!0];let[t,s]=[!1,!1];return[e.first,t]=jt(e.first),[e.last,s]=jt(e.last),[e,t||s]},es=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),ts=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),ye=(e,t)=>{if(e.tabs!=null){const u=e.tabs.find(a=>a.tabKey===t);if(u!=null)return[u,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[s,o]=ye(e.first,t);if(s!=null&&o!=null)return[s,o];const[r,i]=ye(e.last,t);return[r,i]},Ge=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const s=Ge(e.first,t);return s??Ge(e.last,t)},pi=e=>{switch(e){case"top":return["first","last","y"];case"left":return["first","last","x"];case"bottom":return["last","first","y"];case"right":return["last","first","x"];case"center":throw new Error("cannot split a center placed tab")}},ge=e=>k._.copy(e),He=(e,t,s=[])=>(s.push(t(e)),e.first!=null&&He(e.first,t,s),e.last!=null&&He(e.last,t,s),s),ft=(e,t)=>{t(e),e.first!=null&&ft(e.first,t),e.last!=null&&ft(e.last,t)};class mi{constructor(t={}){xe(this,"parent");xe(this,"stub");xe(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([s,o])=>this.el.setAttribute(s,o))}mount(t,s){s!==this.stub&&(this.unmount(null),t.replaceChild(this.el,s),this.parent=t,this.stub=s)}unmount(t){t!=null&&t!==this.stub||this.parent==null||this.stub==null||(this.parent.replaceChild(this.stub,this.el),this.parent=void 0,this.stub=void 0)}}const ji=({node:e})=>{const t=x.createRef(),s=x.useRef(e);return x.useEffect(()=>{const o=t.current;if(o==null)return;const r=o.parentNode;if(r!=null)return e.mount(r,o),()=>{t.current!=null&&e.unmount(t.current)}},[]),x.useEffect(()=>{s.current!=null&&e!==s.current&&(s.current.unmount(t.current),s.current=e);const o=t.current;if(o==null)return;const r=o.parentNode;r!=null&&e.mount(r,o)},[e]),n.jsxRuntimeExports.jsx("div",{ref:t})},fi=({node:e,children:t})=>Et.createPortal(t,e.el),Js=x.memo(({children:e,...t})=>{const s=x.useRef(new Map),o=new Set,r=He(t.root,i=>{var d;if(i.selected==null)return null;let u=s.current.get(i.selected);const a=(d=i.tabs)==null?void 0:d.find(j=>j.tabKey===i.selected);return a==null?null:(u==null&&(u=new mi({style:"width: 100%; height: 100%; position: relative;"}),u.el.addEventListener("click",()=>{var j;return(j=t.onSelect)==null?void 0:j.call(t,a.tabKey)}),s.current.set(i.selected,u)),o.add(i.selected),n.jsxRuntimeExports.jsx(fi,{node:u,children:e(a)},a.tabKey))});return s.current.forEach((i,u)=>!o.has(u)&&s.current.delete(u)),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[r,n.jsxRuntimeExports.jsx(Ue,{portalNodes:s,...t})]})}),Ue=x.memo(e=>{const{onResize:t,...s}=e,{root:{tabs:o,direction:r,first:i,last:u,key:a,size:d},emptyContent:j,...m}=s,f=x.useCallback(([C])=>t(a,C),[t]),{props:S}=Rt({direction:r,onResize:f,count:2,initialSizes:d!=null?[d]:void 0});let h;return o!==void 0?h=n.jsxRuntimeExports.jsx(Ks,{emptyContent:j,...s}):i!=null&&u!=null?h=n.jsxRuntimeExports.jsxs(Je,{align:"stretch",className:l.CSS.BE("mosaic","resize"),...S,children:[n.jsxRuntimeExports.jsx(Ue,{...m,root:i,onResize:t},i.key),n.jsxRuntimeExports.jsx(Ue,{...m,root:u,onResize:t},u.key)]}):(h=null,console.warn("Mosaic tree is malformed")),a===1?n.jsxRuntimeExports.jsx(c.Provider$2,{children:h}):h});Js.displayName="Mosaic";Ue.displayName="Mosaic";const We="pluto-mosaic-tab-drop",Ot="pluto-mosaic-tab-create",hi=(e,t,s)=>{if(c.filterByType(c.FILE_TYPE,t).length>0&&s)return!0;const r=c.filterByType(We,t).map(a=>a.key),i=e.filter(a=>!r.includes(a.tabKey)).length>0;return c.filterByType(Ot,t).length>0||r.length>0&&(i||e.length===0)},Ks=x.memo(({root:e,onDrop:t,onCreate:s,portalNodes:o,activeTab:r,onFileDrop:i,...u})=>{const{key:a,tabs:d}=e,[j,m]=x.useState(null),f=i!=null,S=x.useCallback(({items:y})=>hi(d,y,f),[d,f]),h=x.useCallback(({items:y,event:M})=>{if(M==null)return[];m(null);const V=c.filterByType(c.FILE_TYPE,y).length>0,$=d.length===0?"center":ns(ss(M));if(V)return i==null||i(a,$,M),y;const _=c.filterByType(We,y);if(_.length>0){const N=_.map(({key:T})=>T)[0];t(a,N,$)}const w=c.filterByType(Ot,y);if(w.length>0){const N=w.map(({key:T})=>T);s==null||s(a,$,N)}return _},[t,d.length]),C=x.useCallback(({event:y})=>{if(y==null)return;const M=d.length===0?"center":ns(ss(y));m(M)},[d.length]),{startDrag:R,...v}=c.useDragAndDrop({type:"Mosaic",canDrop:S,onDrop:h,onDragOver:C}),L=S(c.useDraggingState()),g=x.useCallback(()=>m(null),[]),b=x.useCallback((y,{tabKey:M})=>{R([{key:M,type:We,elementID:y.currentTarget.id}])},[R]),E=x.useCallback(()=>s==null?void 0:s(a,"center"),[a]);return n.jsxRuntimeExports.jsxs("div",{className:l.CSS.BE("mosaic","leaf"),children:[n.jsxRuntimeExports.jsxs(X.Tabs,{id:`tab-${a}`,tabs:d,onDragLeave:g,selected:e.selected,selectedAltColor:r===e.selected,onDragStart:b,onCreate:E,...u,...v,children:[n.jsxRuntimeExports.jsx(ji,{node:o.current.get(e.selected)}),L&&n.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),j!=null&&n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("mosaic","mask"),style:Si[j]})]})});Ks.displayName="MosaicTabLeaf";const Si={top:{left:"0%",top:"0%",width:"100%",height:"50%"},bottom:{left:"0%",top:"50%",width:"100%",height:"50%"},left:{left:"0%",top:"0%",width:"50%",height:"100%"},right:{left:"50%",top:"0%",width:"50%",height:"100%"},center:{left:"0%",top:"0%",width:"100%",height:"100%"}},ss=e=>{const t=e.currentTarget.getBoundingClientRect(),s=e.clientX-t.left,o=e.clientY-t.top;return o<24?{px:.5,py:.5}:{px:s/t.width,py:o/t.height}},gi=e=>e,Ei=e=>1-e,ns=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[s,o]=[gi(e),Ei(e)];if(t>s&&t>o)return"bottom";if(t<s&&t<o)return"top";if(t>s&&t<o)return"left";if(t<s&&t>o)return"right";throw new Error("[bug] - invalid insert position")},Ri=se.z.object({key:se.z.number(),tabs:se.z.array(X.tabZ).optional(),selected:se.z.string().optional(),direction:l.g.direction.optional(),size:se.z.number().optional()}),ht=Ri.extend({first:se.z.lazy(()=>ht).optional(),last:se.z.lazy(()=>ht).optional()}),Ci=({allowRename:e=!1,initialTree:t})=>{const[s,o]=x.useState(t);return x.useEffect(()=>o(qe(t)[0]),[t]),{root:s,onDrop:(j,m,f)=>o(S=>Hs(S,m,f,j)[0]),onClose:j=>o(m=>zt(m,j)[0]),onSelect:j=>o(m=>Gs(m,j)),onResize:(j,m)=>o(f=>Us(f,j,m)),onRename:e?(j,m)=>o(f=>Ws(f,j,m)):void 0}},yi=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Ot,HAUL_DROP_TYPE:We,Mosaic:Js,autoSelectTabs:qe,findSelected:Ye,forEachNode:ft,insertTab:Ys,isEmpty:xi,mapNodes:He,moveTab:Hs,nodeZ:ht,removeTab:zt,renameTab:Ws,resizeNode:Us,selectTab:Gs,use:Ci},Symbol.toStringTag,{value:"Module"})),bi=({location:e="left",size:t="9rem",className:s,style:o,...r})=>{const i=l.J.construct(e),u=l.J.direction(i),a=l.g.swap(u);return n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(l.CSS.B("navbar"),l.CSS.bordered(l.J.swap(i)),l.CSS.dir(a),l.CSS.loc(i),s),direction:a,style:{[l.g.dimension(u)]:t,...o},align:"center",empty:!0,...r})},_e=e=>({bordered:t=!1,className:s,...o})=>n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(l.CSS.BE("navbar","content"),e==="absolute-center"?l.CSS.M(e):l.CSS.align(e),e!==""&&t&&l.CSS.bordered(e),s),align:"center",...o}),Qs=_e("start");Qs.displayName="NavbarStart";const en=_e("end");en.displayName="NavbarEnd";const tn=_e("center");tn.displayName="NavbarCenter";const sn=_e("");sn.displayName="NavbarContent";const nn=_e("absolute-center");nn.displayName="NavbarAbsoluteCenter";const ke=bi;ke.Start=Qs;ke.Center=tn;ke.End=en;ke.AbsoluteCenter=nn;ke.Content=sn;const Vt=({aetherKey:e})=>{const[,{region:t},s]=c.use$3({aetherKey:e,type:p.Eraser$1.TYPE,schema:p.eraserStateZ,initialState:{region:l.To.ZERO,enabled:!0}}),o=c.useSyncedRef(t),r=x.useCallback(u=>{l.To.equals(u,o.current)||s(a=>({...a,region:u}))},[s]);return{setEnabled:x.useCallback(u=>s(a=>({...a,enabled:u})),[s]),erase:r}},vi=c.wrap$1(p.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:s}=Vt({aetherKey:e}),o=c.useResize(s);return n.jsxRuntimeExports.jsx("div",{ref:o,className:l.CSS(l.CSS.inheritDims()),children:t})}),wi=Object.freeze(Object.defineProperty({__proto__:null,Eraser:vi,use:Vt},Symbol.toStringTag,{value:"Module"})),Ti=({items:e,initialKey:t})=>{const[s,o]=x.useState(t),r=u=>o(u===s?void 0:u),i=e.find(u=>u.key===s);return{onSelect:r,activeItem:i}},ki=c.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:s,onSelect:o,location:r="left",collapseThreshold:i=.65,className:u,onResize:a,...d})=>{const j=l.J.direction(r),m=x.useCallback(()=>t!=null&&(o==null?void 0:o(t.key)),[o,t==null?void 0:t.key]),{erase:f,setEnabled:S}=Vt({aetherKey:e}),h=x.useCallback((L,g)=>{a==null||a(L,g),f(g)},[a,f]);if(x.useLayoutEffect(()=>{S(t!=null)},[t,S]),t==null)return null;const{content:C,key:R,...v}=t;return n.jsxRuntimeExports.jsx(as,{className:l.CSS(l.CSS.BE("navdrawer","content"),l.CSS.dir(j),u),collapseThreshold:i,onCollapse:m,location:r,onResize:h,...v,...d,children:t.content},R)}),Pi=Object.freeze(Object.defineProperty({__proto__:null,Bar:ke,Drawer:ki,useDrawer:Ti},Symbol.toStringTag,{value:"Module"})),Li=({variant:e,className:t,children:s,...o})=>n.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(t,l.CSS.B("note"),l.CSS.M(e)),align:"stretch",empty:!0,...o,children:s}),Mi=Object.freeze(Object.defineProperty({__proto__:null,Note:Li},Symbol.toStringTag,{value:"Module"})),rn=({key:e,open:t,onChange:s})=>{const o=c.useMemoCompare(()=>e,([r],[i])=>k.E.unorderedPrimitiveArrays(r,i)===k.E.EQUAL,[e]);c.useAsyncEffect(async()=>{const r=await t();if(r!=null)return r.onChange(s),()=>r.close()},[o])},$i=e=>{const[t,s]=x.useState(e.initialValue);return rn({...e,onChange:s}),t},Ni=Object.freeze(Object.defineProperty({__proto__:null,useListener:rn,useState:$i},Symbol.toStringTag,{value:"Module"})),at={Close:n.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),n.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:n.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:n.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),n.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},_i=({disabled:e=[],className:t,focused:s=!0,onMinimize:o,onMaximize:r,onFullscreen:i,onClose:u,...a})=>n.jsxRuntimeExports.jsxs(O.Space,{size:1.5,direction:"x",className:l.CSS(l.CSS.B("macos-controls"),!s&&l.CSS.BM("macos-controls","blurred"),t),...a,children:[n.jsxRuntimeExports.jsx(ut,{onClick:u,className:l.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:at.Close}),n.jsxRuntimeExports.jsx(ut,{onClick:o,className:l.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:at.Minimize}),n.jsxRuntimeExports.jsx(ut,{onClick:i,className:l.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:at.Maximize})]}),ut=({className:e,disabled:t,...s})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("macos-control"),l.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),xt=({disabled:e=[],onMinimize:t,onMaximize:s,onClose:o,onFullscreen:r,focused:i,...u})=>n.jsxRuntimeExports.jsxs(O.Pack,{...u,children:[n.jsxRuntimeExports.jsx(dt,{className:l.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:n.jsxRuntimeExports.jsx(c.k0.Subtract,{})}),n.jsxRuntimeExports.jsx(dt,{className:l.CSS.BM("windows-control","maximize"),onClick:s,disabled:e.includes("maximize"),children:n.jsxRuntimeExports.jsx(c.k0.Box,{})}),n.jsxRuntimeExports.jsx(dt,{onClick:o,className:l.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:n.jsxRuntimeExports.jsx(c.k0.Close,{})})]}),dt=({disabled:e=!1,className:t,...s})=>e?null:n.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.B("windows-control"),t),tabIndex:-1,...s}),on=e=>k.w.getOS(e),Bi={MacOS:_i,Windows:xt,Linux:xt,Docker:xt},zi="Windows",Oi=({forceOS:e,visibleIfOS:t,...s})=>{const o=on({force:e,default:zi}),r=Bi[o];return t!=null&&t!==o?null:n.jsxRuntimeExports.jsx(r,{...s})},Vi=Object.freeze(Object.defineProperty({__proto__:null,Controls:Oi,use:on},Symbol.toStringTag,{value:"Module"}));x.createContext({instrumentation:k.B.NOOP});const Ai=c.wrap$1(p.Provider$2.TYPE,({aetherKey:e,children:t,...s})=>{const o=c.useMemoDeepEqualProps(s),[{path:r},,i]=c.use$3({aetherKey:e,type:p.Provider$2.TYPE,schema:p.providerStateZ$1,initialState:o});return x.useEffect(()=>{i(o)},[o,i]),n.jsxRuntimeExports.jsx(c.Composite,{path:r,children:t})}),Di="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",ln=c.wrap$1(p.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:s}]=c.use$3({aetherKey:t,type:p.BaseProvider.TYPE,schema:p.providerStateZ$2,initialState:{}});return n.jsxRuntimeExports.jsx(c.Composite,{path:s,children:e})}),Ii=Object.freeze(Object.defineProperty({__proto__:null,Provider:ln},Symbol.toStringTag,{value:"Module"})),Zi=e=>{var t,s;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((s=e.data)==null?void 0:s.authority)===k.ly.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},cn=c.wrap$1("Chip",({aetherKey:e,source:t,sink:s,className:o,...r})=>{const i=c.useMemoDeepEqualProps({source:t,sink:s}),[,{status:u},a]=c.use$3({aetherKey:e,type:p.Chip.TYPE,schema:p.chipStateZ,initialState:{triggered:!1,...i,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:k.m.now()}}});x.useEffect(()=>{a(h=>({...h,...i}))},[i,a]);const d=x.useCallback(()=>a(h=>({...h,triggered:!h.triggered})),[a]),{message:j,chipColor:m,buttonStyle:f,disabled:S}=Zi(u);return n.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(l.CSS.B("control-chip"),o),disabled:S,onClick:d,tooltip:n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:j}),style:f,...r,children:n.jsxRuntimeExports.jsx(c.k0.Circle,{color:m})})}),an=x.createContext({needsControlOf:[]}),un=()=>x.useContext(an),Fi=c.wrap$1(p.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:s,...o})=>{const r=c.useMemoDeepEqualProps(o),[{path:i},{status:u,needsControlOf:a},d]=c.use$3({aetherKey:e,type:p.Controller$1.TYPE,schema:p.controllerStateZ,initialState:r});return x.useEffect(()=>{u!=null&&(s==null||s(u))},[u,s]),x.useEffect(()=>{d(j=>({...j,...r}))},[r,d]),x.useEffect(()=>()=>s==null?void 0:s("released"),[]),n.jsxRuntimeExports.jsxs(an.Provider,{value:{needsControlOf:a},children:[n.jsxRuntimeExports.jsx(c.Composite,{path:i,children:t}),";"]})}),xn=c.wrap$1(p.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:s})=>{var d;const o=c.useMemoDeepEqualProps({colorSource:t,statusSource:s}),[,{color:r,status:i},u]=c.use$3({aetherKey:e,type:p.Indicator.TYPE,initialState:{...o,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:k.m.now()}},schema:p.indicatorStateZ});x.useEffect(()=>{u(j=>({...j,...o}))},[o,u]);let a;return((d=i.data)==null?void 0:d.color)!=null?a=l.Color.z.parse(i.data.color):r!=null&&!r.isZero?a=r:a="var(--pluto-gray-l8)",n.jsxRuntimeExports.jsxs(c.Dialog$1,{location:{x:"center",y:"bottom"},children:[n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:i.message}),n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("indicator"),style:{backgroundColor:l.cssString(a),flexGrow:1}})]})}),qi=c.wrap$1(p.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:s}=un(),[,{states:o},r]=c.use$3({aetherKey:e,type:p.Legend.TYPE,schema:p.legendStateZ,initialState:{states:[],needsControlOf:s}});x.useEffect(()=>{r(a=>({...a,needsControlOf:s}))},[s]);const u=k.n(o.map(a=>a.subject.key)).map(a=>{const d=o.find(j=>j.subject.key===a);if(d==null)throw new k.Ee("Legend subject not found");return{key:d.subject.key,label:d.subject.name,color:d.subjectColor}});return n.jsxRuntimeExports.jsx(Tt,{data:u,...t})}),dn=c.wrap$1(p.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:s}]=c.use$3({aetherKey:e,type:p.StateProvider.TYPE,schema:p.stateProviderStateZ,initialState:{}});return n.jsxRuntimeExports.jsx(c.Composite,{path:s,children:t})}),Yi=Object.freeze(Object.defineProperty({__proto__:null,Chip:cn,Controller:Fi,Indicator:xn,Legend:qi,StateProvider:dn,useContext:un},Symbol.toStringTag,{value:"Module"})),pn=e=>{const t=({disabled:s=!1,...o})=>s?o.children:n.jsxRuntimeExports.jsx(e,{...o});return t.displayName=e.displayName,t},Gi=pn(ln),Hi=pn(c.Provider$3),Ui=({children:e,connParams:t,workerEnabled:s=!0,workerURL:o,theming:r,tooltip:i,triggers:u,alamos:a,haul:d,channelAlias:j,telem:m})=>n.jsxRuntimeExports.jsx(c.Provider$1,{...u,children:n.jsxRuntimeExports.jsx(c.Config,{...i,children:n.jsxRuntimeExports.jsx(c.Provider$2,{...d,children:n.jsxRuntimeExports.jsx(c.Provider$4,{url:o??Di,enabled:s,children:n.jsxRuntimeExports.jsx(Hi,{workerKey:"vis",children:n.jsxRuntimeExports.jsx(Ai,{...a,children:n.jsxRuntimeExports.jsx(c.Aggregator,{children:n.jsxRuntimeExports.jsx(us,{connParams:t,children:n.jsxRuntimeExports.jsx(ps,{...j,children:n.jsxRuntimeExports.jsx(Gi,{...m,children:n.jsxRuntimeExports.jsx(c.Provider,{...r,children:n.jsxRuntimeExports.jsx(dn,{children:e})})})})})})})})})})})}),Wi=Object.freeze(Object.defineProperty({__proto__:null,Provider:Ui},Symbol.toStringTag,{value:"Module"})),Xi=({value:e})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress"),children:n.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress-bar"),style:{width:`${e}%`}})}),Ji=Object.freeze(Object.defineProperty({__proto__:null,Progress:Xi},Symbol.toStringTag,{value:"Module"})),Ki=[{key:"color",name:"Color",width:50,render:e=>n.jsxRuntimeExports.jsx(c.k0.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Qi=e=>{const t=ve();return n.jsxRuntimeExports.jsx(nt,{...e,searcher:t==null?void 0:t.labels,columns:Ki,renderTag:s=>s.entry==null?n.jsxRuntimeExports.jsx(Ze,{color:"gray",children:s.entryKey}):n.jsxRuntimeExports.jsx(Ze,{color:s.entry.color,children:s.entry.name})})},ec=({timeRange:e,...t})=>{const s=new k.m(e.start),o=s.isToday?"time":"dateTime",r=new k.m(e.end),i=r.equals(k.m.MAX),u=r.span(s)<k.y.DAY?"time":"dateTime";return n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",size:"small",className:l.CSS(l.CSS.B("time-range-chip")),align:"center",...t,children:[s.isToday&&n.jsxRuntimeExports.jsx(c.Text,{level:"p",shade:7,weight:450,children:"Today"}),n.jsxRuntimeExports.jsx(c.DateTime,{level:"p",displayTZ:"local",format:o,shade:7,weight:450,children:s}),n.jsxRuntimeExports.jsx(c.k0.Arrow.Right,{color:"var(--pluto-text-color)"}),i?n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"Now"}):n.jsxRuntimeExports.jsx(c.DateTime,{level:"p",displayTZ:"local",format:u,shade:7,weight:450,children:r})]})},tc=Object.freeze(Object.defineProperty({__proto__:null,SelectLabels:Qi,TimeRangeChip:ec},Symbol.toStringTag,{value:"Module"})),sc=({steps:e,value:t,onChange:s,...o})=>{const r=e.findIndex(i=>i.key===t);return n.jsxRuntimeExports.jsx(O.Space,{direction:"x",align:"center",className:l.CSS.B("steps"),...o,children:e.map((i,u)=>n.jsxRuntimeExports.jsxs(x.Fragment,{children:[n.jsxRuntimeExports.jsxs(c.Button,{onClick:()=>s(i.key),variant:"outlined",disabled:u>r,children:[u+1,". ",i.title]},i.key),u!==e.length-1&&n.jsxRuntimeExports.jsx(c.k0.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},nc=Object.freeze(Object.defineProperty({__proto__:null,Steps:sc},Symbol.toStringTag,{value:"Module"})),rc=(e,t="x")=>{if(e.length===0)return[];const s=l.J.construct(t),o=l.J.swap(s);return e.sort((r,i)=>l.To.loc(r.box,s)-l.To.loc(i.box,s)),e.forEach((r,i)=>{if(i===0)return;const a=e[i-1].handles.find(h=>h.orientation===o),d=r.handles.find(h=>h.orientation===s);if(a==null||d==null)return;const j=a.absolutePosition,m=d.absolutePosition,f=l.q.set(l.q.translation(m,j),t,0),S=l.q.translate(l.To.topLeft(r.box),f);r.box=l.To.construct(S,l.To.dims(r.box))}),e},At=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},ee=(e,t)=>{const s=At(t),o=e.getNodes().find(r=>r.id===t);if(o==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return l.To.construct(o.position,l.To.dims(l.To.construct(s)))},oc=(e,t)=>rt.fromFlow(e,t);class mn{constructor(t,s){xe(this,"node_",null);xe(this,"position");xe(this,"orientation");this.position=t,this.orientation=s}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[schematic] - handle has no node");return this.node_}get absolutePosition(){return l.q.translate(l.To.topLeft(this.node.box),this.position)}}class rt{constructor(t,s,o){xe(this,"key");xe(this,"box");xe(this,"handles");this.key=t,this.box=s,this.handles=o,o.forEach(r=>r.node=this)}static fromFlow(t,s){const o=ee(s,t),r=At(t),i=r.getElementsByClassName("react-flow__handle"),u=l.To.construct(r),a=Array.from(i).map(d=>{const j=l.To.center(l.To.construct(d)),m=l.q.translation(l.To.topLeft(u),j),f=d.className.match(/react-flow__handle-(\w+)/);if(f==null)throw new Error("[schematic] - cannot find handle orientation");const S=l.J.construct(f[0]);return new mn(m,S)});return new rt(t,o,a)}}const lc=({fromX:e,fromY:t,toX:s,toY:o,fromPosition:r,toPosition:i,fromNode:u,connectionLineStyle:a,connectionStatus:d})=>{const j=document.querySelector(".react-flow__handle-connecting"),m=j==null?void 0:j.className.match(/react-flow__handle-(\w+)/);if(m!=null){const C=l.J.outer.safeParse(m[1]);C.success&&(i=C.data)}const f=p.buildNew({sourcePos:l.q.construct(e,t),targetPos:l.q.construct(s,o),sourceOrientation:r,targetOrientation:i,sourceBox:ee(p.useReactFlow(),(u==null?void 0:u.id)??""),targetBox:ee(p.useReactFlow(),(u==null?void 0:u.id)??"")}),S=p.useReactFlow(),h=p.segmentsToPoints(l.q.construct(e,t),f,S.getZoom(),!1);return n.jsxRuntimeExports.jsx(p.BaseEdge,{path:jn(h),style:{...a,stroke:l.cssString(d==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},ic=({id:e,source:t,target:s,sourcePosition:o,targetHandleId:r,targetPosition:i,style:u,segments:a=[],onSegmentsChange:d,color:j="var(--pluto-gray-l9)",selected:m=!1,...f})=>{const S=l.q.construct(f.sourceX,f.sourceY),h=x.useRef(S),C=l.q.equals(S,h.current),R=l.q.construct(f.targetX,f.targetY),v=x.useRef(R),L=l.q.equals(R,v.current),g=p.useReactFlow(),[b,E,y]=c.useCombinedStateAndRef(()=>a.length>0?a:p.buildNew({sourcePos:S,targetPos:R,sourceOrientation:o,targetOrientation:i,sourceBox:ee(g,t),targetBox:ee(g,s)})),M=x.useRef(i),V=x.useRef(o),$=c.useDebouncedCallback(d,100,[d]);if(!C||!L){let T=b;const B=l.q.translation(h.current,S),A=l.q.translation(R,v.current);l.q.equals(B,l.q.scale(A,-1),.001)?(h.current=S,v.current=R):(C?L||(T=p.moveTargetNode({delta:A,segments:T}),M.current!==i&&(M.current=i,T=p.buildNew({sourcePos:S,targetPos:R,sourceOrientation:o,targetOrientation:i,sourceBox:ee(g,t),targetBox:ee(g,s)})),p.checkIntegrity({sourcePos:S,targetPos:R,next:T,prev:b})||(T=p.buildNew({sourcePos:S,targetPos:R,sourceOrientation:o,targetOrientation:i,sourceBox:ee(g,t),targetBox:ee(g,s)})),v.current=R):(T=p.moveSourceNode({delta:B,segments:T}),V.current!==o&&(V.current=o,T=p.buildNew({sourcePos:S,targetPos:R,sourceOrientation:o,targetOrientation:i,sourceBox:ee(g,t),targetBox:ee(g,s)})),p.checkIntegrity({sourcePos:S,targetPos:R,next:T,prev:b})||(T=p.buildNew({sourcePos:S,targetPos:R,sourceOrientation:o,targetOrientation:i,sourceBox:ee(g,t),targetBox:ee(g,s)})),h.current=S),$(T),E(T))}const _=x.useRef(null),w=Ke({onStart:x.useCallback((T,B,A)=>{_.current={index:Number(A.currentTarget.id.split("-")[1]),segments:[...y.current]}},[]),onMove:x.useCallback(T=>{if(_.current==null)return;const B=p.dragSegment({segments:_.current.segments,index:_.current.index,magnitude:l.To.dim(T,l.g.swap(_.current.segments[_.current.index].direction),!0)/g.getZoom()});E(B)},[]),onEnd:x.useCallback(()=>d(y.current),[d])}),N=p.segmentsToPoints(S,b,g.getZoom(),!0);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(p.BaseEdge,{path:jn(N),style:{...u,stroke:l.cssString(j)},...f}),m&&cc(N).map((T,B)=>{const A=b[B].direction,I=l.g.swap(A),Y={[l.g.dimension(A)]:"18px",[l.g.dimension(I)]:"4px"},K={[A]:T[A]-9,[I]:T[I]-2};return n.jsxRuntimeExports.jsxs(x.Fragment,{children:[n.jsxRuntimeExports.jsx("rect",{className:l.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...Y,...K,rx:"2px",ry:"2px"}),n.jsxRuntimeExports.jsx("foreignObject",{x:T.x-9,y:T.y-9,width:"18px",height:"18px",children:n.jsxRuntimeExports.jsx("div",{id:`handle-${B}`,className:l.CSS(l.CSS.BE("diagram-edge-handle","dragger"),l.CSS.dir(A)),draggable:!0,onDragStart:w})})]},B)})]})},jn=e=>{let t="";const o=e.length+-1;for(let r=0;r<o;r++){const i=e[r%e.length],u=e[(r+1)%e.length],a=Math.min(6/Math.hypot(u.x-i.x,u.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-a)+u.x*a},${i.y*(1-a)+u.y*a}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-a)+u.x*a},${i.y*(1-a)+u.y*a}`),r===o-1?t+=`L${u.x},${u.y}`:r<o-1&&(t+=`L${i.x*a+u.x*(1-a)},${i.y*a+u.y*(1-a)}`)}return t},cc=e=>e.slice(1).map((t,s)=>{const o=e[s];return l.q.construct((t.x+o.x)/2,(t.y+o.y)/2)}),ac=({initialNodes:e,initialEdges:t,allowEdit:s=!0,initialViewport:o={position:l.q.ZERO,zoom:1}})=>{const[r,i]=x.useState(s),[u,a]=x.useState(e),[d,j]=x.useState(t),[m,f]=x.useState(o),[S,h]=x.useState(!1);return{viewport:m,onViewportChange:f,edges:d,nodes:u,onNodesChange:a,onEdgesChange:j,editable:r,onEditableChange:i,fitViewOnResize:S,setFitViewOnResize:h}},uc=e=>e.source!==e.target,xc={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},dc={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesUpdatable:!1,nodesFocusable:!1,edgeUpdaterRadius:0},fn={padding:0,maxZoom:1,minZoom:.5},pc={hideAttribution:!0},hn=x.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Be=()=>x.useContext(hn),Sn=x.memo(({children:e})=>{const{registerNodeRenderer:t}=Be();return x.useEffect(()=>t(e),[t,e]),null});Sn.displayName="NodeRenderer";const mc=["Backspace","Delete"],jc=c.wrap$1(p.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:s,onEdgesChange:o,nodes:r,edges:i,onEditableChange:u,editable:a,viewport:d,triggers:j,onViewportChange:m,fitViewOnResize:f,setFitViewOnResize:S,...h})=>{const[{path:C},,R]=c.use$3({aetherKey:e,type:p.Diagram$1.TYPE,schema:p.diagramStateZ,initialState:{position:d.position,region:l.To.ZERO,zoom:d.zoom}}),v=c.use().colors.gray.l9.hex,L=c.useMemoCompare(()=>j??Mt.zoom,c.compareModeConfigs,[j]),{fitView:g}=p.useReactFlow(),b=bt(x.useCallback(D=>{f&&g({maxZoom:1}),R(H=>({...H,region:D}))},[R,g,f])),E=x.useRef(null),y=x.useCallback(D=>{const H=E.current;H!=null&&H.x===D.x&&H.y===D.y&&H.zoom===D.zoom||(E.current=D,R(Q=>({...Q,position:D,zoom:D.zoom})),m(p.translateViewportBackward(D)))},[R,m]);p.useOnViewportChange({onStart:y,onChange:y,onEnd:y});const[M,V]=x.useState(()=>()=>null),$=x.useCallback(D=>V(()=>D),[]),_=x.useMemo(()=>({custom:({id:D,xPos:H,yPos:Q,selected:$e})=>M({symbolKey:D,position:{x:H,y:Q},selected:$e})}),[M]),w=x.useRef(i),N=x.useMemo(()=>(w.current=i,p.translateEdgesForward(i)),[i]),T=x.useRef(r),B=x.useMemo(()=>(T.current=r,p.translateNodesForward(r)),[r]),A=x.useCallback(D=>s(p.nodeConverter(T.current,H=>p.applyNodeChanges(D,H))),[s]),I=x.useCallback(D=>o(p.edgeConverter(w.current,H=>p.applyEdgeChanges(D,H),v)),[o,v]),Y=x.useCallback((D,H)=>o(p.edgeConverter(w.current,Q=>p.updateEdge(D,H,Q),v)),[]),K=x.useCallback(D=>{o(p.edgeConverter(w.current,H=>p.addEdge(D,H),v))},[o,v]),U=x.useCallback((D,H)=>{const Q=[...w.current],$e=Q.findIndex(no=>no.key===D);$e!==-1&&(Q[$e]={...Q[$e],segments:H},w.current=Q,o(Q))},[o]),Me=a?xc:dc,ot=x.useMemo(()=>({default:D=>n.jsxRuntimeExports.jsx(ic,{...D,segments:D.data.segments,color:D.data.color,onSegmentsChange:x.useCallback(H=>U(D.id,H),[D.id])},D.id)}),[U]),Zt=x.useRef(null);c.use$2({triggers:L.zoomReset,callback:x.useCallback(({stage:D,cursor:H})=>{const Q=Zt.current;Q==null||D!=="start"||!l.To.contains(Q,H)||g()},[g])});const Ft=c.purgeMouse(L.select)[0]??null,qt=c.purgeMouse(L.pan)[0]??null,Qr=c.purgeMouse(L.zoom)[0]??null,eo={selectionOnDrag:Ft==null,panOnDrag:qt==null,selectionKeyCode:Ft,panActivationKeyCode:qt,zoomActivationKeyCode:Qr},to=c.useCombinedRefs(Zt,b),so=x.useMemo(()=>({editable:a,onEditableChange:u,registerNodeRenderer:$,fitViewOnResize:f,setFitViewOnResize:S}),[a,u,$,f]);return n.jsxRuntimeExports.jsx(hn.Provider,{value:so,children:n.jsxRuntimeExports.jsx(c.Composite,{path:C,children:n.jsxRuntimeExports.jsx(p.ReactFlow,{...eo,className:l.CSS(l.CSS.B("diagram"),l.CSS.editable(a)),nodes:B,edges:N,nodeTypes:_,edgeTypes:ot,ref:to,fitView:!0,onNodesChange:A,onEdgesChange:I,onConnect:K,onEdgeUpdate:Y,defaultViewport:p.translateViewportForward(d),connectionLineComponent:lc,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:uc,connectionMode:p.ConnectionMode.Loose,snapGrid:[3,3],fitViewOptions:fn,selectionMode:p.SelectionMode.Partial,proOptions:pc,deleteKeyCode:mc,...h,style:{[l.CSS.var("diagram-zoom")]:d.zoom,...h.style},...Me,children:t})})})}),fc=()=>{const{editable:e}=Be();return e?n.jsxRuntimeExports.jsx(Fo,{}):null},hc=({children:e,...t})=>n.jsxRuntimeExports.jsx(O.Pack,{direction:"y",className:l.CSS.BE("diagram","controls"),...t,children:e}),Sc=({onClick:e,...t})=>{const{editable:s,onEditableChange:o}=Be();return n.jsxRuntimeExports.jsx(c.ToggleIcon,{onChange:()=>o(!s),value:s,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:l.J.RIGHT_CENTER,tooltip:s?n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Disable edit mode"}):n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Enable edit mode"}),...t,children:s?n.jsxRuntimeExports.jsx(c.k0.EditOff,{}):n.jsxRuntimeExports.jsx(c.k0.Edit,{})})},gc=({onClick:e,...t})=>{const{fitView:s}=p.useReactFlow(),{fitViewOnResize:o,setFitViewOnResize:r}=Be();return n.jsxRuntimeExports.jsx(c.ToggleIcon,{onClick:i=>{s(fn),e==null||e(i)},value:o,onChange:i=>r(i),rightClickToggle:!0,tooltip:n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:l.J.RIGHT_CENTER,variant:"outlined",...t,children:n.jsxRuntimeExports.jsx(c.k0.Expand,{})})},Ec=e=>n.jsxRuntimeExports.jsx(p.ReactFlowProvider,{children:n.jsxRuntimeExports.jsx(jc,{...e})}),Rc=Object.freeze(Object.defineProperty({__proto__:null,Background:fc,Controls:hc,Diagram:Ec,FitViewControl:gc,HandleLayout:mn,NodeLayout:rt,NodeRenderer:Sn,ToggleEditControl:Sc,alignNodes:rc,edgeConverter:p.edgeConverter,edgeZ:p.edgeZ,nodeConverter:p.nodeConverter,nodeZ:p.nodeZ,rfEdgeDataZ:p.rfEdgeDataZ,selectNode:At,selectNodeBox:ee,selectNodeLayout:oc,translateEdgesBackward:p.translateEdgesBackward,translateEdgesForward:p.translateEdgesForward,translateNodesBackward:p.translateNodesBackward,translateNodesForward:p.translateNodesForward,translateViewportBackward:p.translateViewportBackward,translateViewportForward:p.translateViewportForward,use:ac,useContext:Be,viewportZ:p.viewportZ},Symbol.toStringTag,{value:"Module"})),Cc=({value:e,onChange:t})=>{const{inner:s,outer:o}=e,r=i=>()=>t({...e,...i});return n.jsxRuntimeExports.jsxs(O.Space,{className:l.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(je,{selected:o==="top",onClick:r({outer:"top"})}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[n.jsxRuntimeExports.jsx(je,{selected:o==="left",onClick:r({outer:"left"})}),n.jsxRuntimeExports.jsxs(O.Space,{className:l.CSS.B("value"),direction:"y",align:"center",justify:"center",empty:!0,children:[n.jsxRuntimeExports.jsx(je,{className:l.CSS(l.CSS.dir("y")),selected:s==="top",onClick:r({inner:"top"})}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",justify:"center",children:[n.jsxRuntimeExports.jsx(je,{selected:s==="left",onClick:r({inner:"left"})}),n.jsxRuntimeExports.jsx(je,{selected:s==="right",onClick:r({inner:"right"})})]}),n.jsxRuntimeExports.jsx(je,{className:l.CSS(l.CSS.dir("y")),selected:s==="bottom",onClick:r({inner:"bottom"})})]}),n.jsxRuntimeExports.jsx(je,{selected:o==="right",onClick:r({outer:"right"})})]}),n.jsxRuntimeExports.jsx(je,{selected:o==="bottom",onClick:r({outer:"bottom"})})]})},je=({selected:e,className:t,...s})=>n.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(t,l.CSS.selected(e)),...s,children:n.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Dt=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],ae=({className:e,direction:t,...s})=>n.jsxRuntimeExports.jsx(O.Space,{direction:t,align:"stretch",className:l.CSS(l.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...s}),Ee=e=>n.jsxRuntimeExports.jsx(pe,{label:"Orientation",padHelpText:!1,...e,children:({value:t,onChange:s})=>{var o;return n.jsxRuntimeExports.jsx(Cc,{value:{inner:t.orientation??"top",outer:((o=t.label)==null?void 0:o.orientation)??"top"},onChange:r=>s({...t,orientation:r.inner,label:{...t.label,orientation:r.outer}})})}}),Re=({path:e})=>n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(pe,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:t=>n.jsxRuntimeExports.jsx(c.Text$1,{selectOnFocus:!0,...t})}),n.jsxRuntimeExports.jsx(pe,{path:e+".level",label:"Label Size",padHelpText:!1,children:t=>n.jsxRuntimeExports.jsx(re.SelectLevel,{...t})})]}),Pe=e=>n.jsxRuntimeExports.jsx(pe,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:s,...o})=>n.jsxRuntimeExports.jsx(St.Swatch,{value:t??l.ZERO.setAlpha(1).rgba255,onChange:r=>s(r.rgba255),...o})}),gn=({path:e})=>{var j,m;const{value:t,onChange:s}=Te({path:e}),o=p.sourcePipelinePropsZ.parse((j=t.source)==null?void 0:j.props),r=p.sinkPipelinePropsZ.parse((m=t.sink)==null?void 0:m.props),i=p.streamChannelValuePropsZ.parse(o.segments.valueStream.props),u=p.setChannelValuePropsZ.parse(r.segments.setter.props),a=f=>{f=f??0;const S=p.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:p.streamChannelValue({channel:f}),threshold:p.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});s({...t,source:S})},d=f=>{f=f??0;const S=p.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:p.setChannelValue({channel:f}),setpoint:p.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),h=p.authoritySource({channel:f}),C=p.acquireChannelControl({channel:f,authority:255});s({...t,sink:S,control:{...t.control,showChip:!0,chip:{sink:C,source:h},showIndicator:!0,indicator:{statusSource:h}}})};return n.jsxRuntimeExports.jsxs(ae,{direction:"x",grow:!0,align:"stretch",children:[n.jsxRuntimeExports.jsx(me.Item,{label:"State Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:i.channel,onChange:a})}),n.jsxRuntimeExports.jsx(me.Item,{label:"Command Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:u.channel,onChange:d})})]})},ue=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(gn,{path:""});default:return n.jsxRuntimeExports.jsxs(ae,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(Re,{path:"label"}),n.jsxRuntimeExports.jsx(Pe,{path:"color",hideIfNull:!0,optional:!0})]}),n.jsxRuntimeExports.jsx(Ee,{path:""})]})}},[]),t=X.useStatic({tabs:Dt,content:e});return n.jsxRuntimeExports.jsx(X.Tabs,{...t})},yc=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(gn,{path:""});default:return n.jsxRuntimeExports.jsxs(ae,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(Re,{path:"label"}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(Pe,{path:"color"}),n.jsxRuntimeExports.jsx(pe,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,children:o=>n.jsxRuntimeExports.jsx(c.Switch$1,{...o})})]})]}),n.jsxRuntimeExports.jsx(Ee,{path:""})]})}},[]),t=X.useStatic({tabs:Dt,content:e});return n.jsxRuntimeExports.jsx(X.Tabs,{...t})},oe=()=>n.jsxRuntimeExports.jsxs(ae,{direction:"x",children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(Re,{path:"label"}),n.jsxRuntimeExports.jsx(Pe,{path:"color"})]}),n.jsxRuntimeExports.jsx(Ee,{path:""})]}),rs={y:2,x:.25},os={lower:0,upper:2e3},bc=()=>n.jsxRuntimeExports.jsxs(ae,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(Re,{path:"label"}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(Pe,{path:"color"}),n.jsxRuntimeExports.jsx(pe,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:e??200,dragScale:rs,bounds:os,...t})}),n.jsxRuntimeExports.jsx(pe,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>n.jsxRuntimeExports.jsx(c.Numeric,{value:e??200,dragScale:rs,bounds:os,...t})})]})]}),n.jsxRuntimeExports.jsx(Ee,{path:""})]}),En=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],vc=({path:e})=>{var f;const{value:t,onChange:s}=Te({path:e}),o=p.sourcePipelinePropsZ.parse((f=t.telem)==null?void 0:f.props),r=p.streamChannelValuePropsZ.parse(o.segments.valueStream.props),i=p.stringifyNumberProps.parse(o.segments.stringifier.props),u=p.rollingAverageProps.parse(o.segments.rollingAverage.props),a=S=>{const h=p.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:p.streamChannelValue({channel:S??0}),stringifier:p.stringifyNumber({precision:i.precision??2}),rollingAverage:p.rollingAverage({windowSize:u.windowSize??1})},outlet:"stringifier"});s({...t,telem:h})},d=S=>{const h=p.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:p.streamChannelValue({channel:r.channel}),stringifier:p.stringifyNumber({precision:S}),rollingAverage:p.rollingAverage({windowSize:u.windowSize})},outlet:"stringifier"});s({...t,telem:h})},j=S=>{const h=p.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:p.stringifyNumber({precision:i.precision??2}),valueStream:p.streamChannelValue({channel:r.channel}),rollingAverage:p.rollingAverage({windowSize:S})},outlet:"stringifier"});s({...t,telem:h})},m=et(r.channel);return x.useEffect(()=>{s({...t,tooltip:[m]})},[m]),n.jsxRuntimeExports.jsxs(ae,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(me.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:r.channel,onChange:a})}),n.jsxRuntimeExports.jsx(me.Item,{label:"Precision",align:"start",children:n.jsxRuntimeExports.jsx(c.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:d})}),n.jsxRuntimeExports.jsx(me.Item,{label:"Averaging Window",align:"start",children:n.jsxRuntimeExports.jsx(c.Numeric,{value:u.windowSize??1,bounds:{lower:1,upper:100},onChange:j})})]})},wc=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(vc,{path:""});default:return n.jsxRuntimeExports.jsxs(ae,{direction:"x",children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(Re,{path:"label"}),n.jsxRuntimeExports.jsxs(O.Space,{direction:"x",children:[n.jsxRuntimeExports.jsx(Pe,{path:"color"}),n.jsxRuntimeExports.jsx(pe,{path:"units",label:"Units",align:"start",padHelpText:!1,children:o=>n.jsxRuntimeExports.jsx(c.Text$1,{...o})})]})]}),n.jsxRuntimeExports.jsx(Ee,{path:""})]})}},[]),t=X.useStatic({tabs:En,content:e});return n.jsxRuntimeExports.jsx(X.Tabs,{...t})},Tc=({path:e})=>{var a;const{value:t,onChange:s}=Te({path:e}),o=p.sourcePipelinePropsZ.parse((a=t.source)==null?void 0:a.props),r=p.streamChannelValuePropsZ.parse(o.segments.valueStream.props),i=d=>{d=d??0;const j=p.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:p.streamChannelValue({channel:d}),threshold:p.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});s({...t,source:j})},u=et(r.channel);return x.useEffect(()=>{s({...t})},[u]),n.jsxRuntimeExports.jsx(ae,{direction:"x",align:"stretch",children:n.jsxRuntimeExports.jsx(me.Item,{label:"Input Channel",grow:!0,children:n.jsxRuntimeExports.jsx(Ce,{value:r.channel,onChange:i})})})},kc=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return n.jsxRuntimeExports.jsx(Tc,{path:""});default:return n.jsxRuntimeExports.jsxs(ae,{direction:"x",children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[n.jsxRuntimeExports.jsx(Re,{path:"label"}),n.jsxRuntimeExports.jsx(O.Space,{direction:"x",children:n.jsxRuntimeExports.jsx(Pe,{path:"color"})})]}),n.jsxRuntimeExports.jsx(Ee,{path:""})]})}},[]),t=X.useStatic({tabs:En,content:e});return n.jsxRuntimeExports.jsx(X.Tabs,{...t})},Pc=({path:e})=>{var u;const{value:t,onChange:s}=Te({path:e}),o=p.sinkPipelinePropsZ.parse((u=t.sink)==null?void 0:u.props),r=p.setChannelValuePropsZ.parse(o.segments.setter.props),i=a=>{const d=p.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:p.setChannelValue({channel:a}),setpoint:p.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),j=p.authoritySource({channel:a}),m=p.acquireChannelControl({channel:a,authority:255});s({...t,sink:d,control:{...t.control,showChip:!0,chip:{sink:m,source:j},showIndicator:!0,indicator:{statusSource:j}}})};return n.jsxRuntimeExports.jsx(ae,{direction:"y",children:n.jsxRuntimeExports.jsx(me.Item,{label:"Output Channel",children:n.jsxRuntimeExports.jsx(Ce,{value:r.channel,onChange:i})})})},Lc=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return n.jsxRuntimeExports.jsx(Pc,{path:""});default:return n.jsxRuntimeExports.jsxs(ae,{direction:"x",align:"stretch",children:[n.jsxRuntimeExports.jsx(O.Space,{direction:"y",grow:!0,children:n.jsxRuntimeExports.jsx(Re,{path:"label"})}),n.jsxRuntimeExports.jsx(Ee,{path:""})]})}},[]),t=X.useStatic({tabs:Dt,content:e});return n.jsxRuntimeExports.jsx(X.Tabs,{...t})},Mc=({aetherKey:e,sink:t})=>{const s=c.useMemoDeepEqualProps({sink:t}),[,,o]=c.use$3({aetherKey:e,type:p.Button.TYPE,schema:p.buttonStateZ,initialState:{trigger:0,sink:t}});return x.useEffect(()=>{o(i=>({...i,...s}))},[s]),{click:x.useCallback(()=>{o(i=>({...i,trigger:i.trigger+1}))},[o])}},Z=x.forwardRef(({label:e="",onChange:t,level:s="p",children:o,orientation:r="top",style:i,className:u,...a},d)=>n.jsxRuntimeExports.jsxs(O.Space,{style:{marginRight:r==="right"?1:0,marginTop:r==="top"?1:0,...i},size:2/3,direction:r,ref:d,className:l.CSS(l.CSS.B("symbol"),u),align:"center",justify:"center",...a,children:[e.length>0&&n.jsxRuntimeExports.jsx(c.Editable,{className:l.CSS.BE("symbol","label"),value:e,onChange:x.useCallback(j=>t({label:{label:j,level:s,orientation:r}}),[t,s]),level:s}),o]}));Z.displayName="Labeled";const z=e=>n.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),It=e=>n.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Le=e=>n.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),W=e=>n.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),$c={left:{left:p.Position.Left,right:p.Position.Right,top:p.Position.Top,bottom:p.Position.Bottom},right:{left:p.Position.Right,right:p.Position.Left,top:p.Position.Bottom,bottom:p.Position.Top},top:{left:p.Position.Bottom,right:p.Position.Top,top:p.Position.Left,bottom:p.Position.Right},bottom:{left:p.Position.Top,right:p.Position.Bottom,top:p.Position.Right,bottom:p.Position.Left}},Nc=(e,t)=>$c[t][e],_c=(e,t,s)=>s==="left"?{top:e,left:t}:s==="right"?{top:100-e,left:100-t}:s==="top"?{top:100-t,left:e}:{top:t,left:100-e},F=({children:e,orientation:t})=>{let s;try{s=p.useUpdateNodeInternals()}catch{return n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{})}const o=x.useRef(null),r=x.useRef(!0);return x.useEffect(()=>{if(o.current==null)return;if(r.current){r.current=!1;return}const i=o.current.closest(".react-flow__node"),u=i==null?void 0:i.getAttribute("data-id");u!=null&&(s==null||s(u))},[t]),n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{ref:o}),e]})},P=({location:e,orientation:t,left:s,top:o,...r})=>{const i=_c(o,s,t);return n.jsxRuntimeExports.jsx(p.Handle$1,{position:Nc(e,t),...r,type:"source",onClick:u=>u.stopPropagation(),className:(l.CSS.B("handle"),l.CSS.BE("handle",r.id)),style:{left:`${i.left}%`,top:`${i.top}%`}})},le=({className:e,enabled:t=!1,triggered:s=!1,orientation:o="left",color:r,...i})=>n.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("symbol-primitive"),l.CSS.B("symbol-primitive-toggle"),o!=null&&l.CSS.loc(o),t&&l.CSS.M("enabled"),s&&l.CSS.M("triggered"),e),color:l.cssString(r),...i}),J=({className:e,...t})=>n.jsxRuntimeExports.jsx("div",{className:l.CSS(l.CSS.B("symbol-primitive"),e),...t}),Bc=.8,G=({dimensions:e,orientation:t="left",children:s,className:o,color:r,style:i={},scale:u=1,...a})=>{e=l.g.construct(t)==="y"?l._.swap(e):e;const j=l.cssString(r),m=c.use();return r!=null&&(i[l.CSS.var("symbol-color")]=new l.Color(r).rgbString,i[l.CSS.var("symbol-color-contrast")]=new l.Color(r).pickByContrast(m.colors.gray.l0,m.colors.gray.l10).rgbString),n.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:l._.svgViewBox(e),className:l.CSS(l.CSS.loc(t),o),fill:j,stroke:j,...a,style:{aspectRatio:`${e.width} / ${e.height}`,width:l._.scale(e,u*Bc).width,...i},children:n.jsxRuntimeExports.jsx("g",{children:s})})},Rn=({className:e,orientation:t,scale:s,color:o,...r})=>n.jsxRuntimeExports.jsxs(le,{...r,orientation:t,className:l.CSS(l.CSS.B("four-way-valve"),e),children:[n.jsxRuntimeExports.jsxs(F,{orientation:t,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:"left",left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:"left",left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(P,{location:"top",orientation:"left",left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:"left",left:50,top:100,id:"4"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:87},color:o,scale:s,children:[n.jsxRuntimeExports.jsx(z,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),n.jsxRuntimeExports.jsx(z,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),Cn=({color:e,orientation:t="left",scale:s,...o})=>n.jsxRuntimeExports.jsxs(le,{...o,className:l.CSS(l.CSS.B("three-way-valve")),orientation:t,children:[n.jsxRuntimeExports.jsxs(F,{orientation:t,children:[n.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:t,left:50,top:100,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:0,top:33,id:"2"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:100,top:33,id:"3"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:64},color:e,orientation:t,scale:s,children:[n.jsxRuntimeExports.jsx(z,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),n.jsxRuntimeExports.jsx(z,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),yn=({orientation:e="left",color:t,scale:s,...o})=>n.jsxRuntimeExports.jsxs(le,{...o,children:[n.jsxRuntimeExports.jsxs(F,{orientation:e,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:e,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:e,left:100,top:50,id:"2"})]}),n.jsxRuntimeExports.jsx(G,{dimensions:{width:87,height:42},color:t,orientation:e,scale:s,children:n.jsxRuntimeExports.jsx(z,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),bn=({className:e,color:t,orientation:s="left",normallyOpen:o=!1,scale:r,...i})=>n.jsxRuntimeExports.jsxs(le,{className:l.CSS(l.CSS.B("solenoid-valve"),o&&l.CSS.M("normally-open"),e),...i,children:[n.jsxRuntimeExports.jsxs(F,{orientation:s,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:s,left:1,top:69,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:s,left:99,top:69,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:69},color:t,orientation:s,scale:r,children:[n.jsxRuntimeExports.jsx(z,{className:l.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),n.jsxRuntimeExports.jsx(z,{d:"M43.5 47L43.5 24.6177"}),n.jsxRuntimeExports.jsx(It,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),vn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{orientation:t,className:l.CSS(l.CSS.B("relief-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(F,{orientation:t,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:1,top:66,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:58},color:s,orientation:t,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),n.jsxRuntimeExports.jsx(z,{d:"M43.5 2L43.5 38",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),wn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{orientation:t,className:l.CSS(l.CSS.B("check-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(F,{orientation:t,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:45,height:43},color:s,orientation:t,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M43 2L43 40",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),Tn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(le,{...r,orientation:s,className:l.CSS(l.CSS.B("angled-valve"),t),children:[n.jsxRuntimeExports.jsxs(F,{orientation:s,children:[n.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:s,left:33,top:100,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:s,left:100,top:35,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),n.jsxRuntimeExports.jsx(z,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"}),n.jsxRuntimeExports.jsx(z,{d:"M24.3461 18.5709L21.7484 19.88C20.9998 20.2572 20.3887 20.8601 20.0012 21.6035L19.3383 22.8756"})]})]}),kn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(le,{...r,className:l.CSS(l.CSS.B("pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(F,{orientation:s,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:s,left:2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(W,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(W,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)})]})]}),Pn=({className:e,color:t,orientation:s="left",scale:o,...r})=>{const i=l.cssString(t);return n.jsxRuntimeExports.jsxs(J,{...r,className:l.CSS(l.CSS.B("symbol"),e),children:[n.jsxRuntimeExports.jsx(F,{orientation:s,children:n.jsxRuntimeExports.jsx(P,{location:"left",orientation:s,left:2,top:50,id:"1"})}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:40,height:48},color:t,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),n.jsxRuntimeExports.jsx(z,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:i}),n.jsxRuntimeExports.jsx(z,{d:"M33 24H3",strokeLinecap:"round"})]})]})},Ln=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(l.CSS.B("cap"),e),...r,children:[n.jsxRuntimeExports.jsx(F,{orientation:t,children:n.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:0,top:50,id:"1"})}),n.jsxRuntimeExports.jsx(G,{color:s,dimensions:{width:26,height:48},orientation:t,scale:o,children:n.jsxRuntimeExports.jsx(z,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),Mn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(l.CSS.B("manual-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(F,{orientation:t,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:1,top:58,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:99,top:58,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:48},color:s,orientation:t,scale:o,children:[n.jsxRuntimeExports.jsx(W,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),n.jsxRuntimeExports.jsx(z,{d:"M19.64 2L66.68 2",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),$n=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(l.CSS.B("filter"),e),...r,children:[n.jsxRuntimeExports.jsxs(F,{orientation:t,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsx(G,{dimensions:{width:52,height:34},orientation:t,color:s,scale:o,children:n.jsxRuntimeExports.jsx(z,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17M6 17H1M46 17H51"})})]}),zc=e=>typeof e=="number"?{topLeft:l.q.construct(e),topRight:l.q.construct(e),bottomLeft:l.q.construct(e),bottomRight:l.q.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:l.q.construct(e.topLeft),topRight:l.q.construct(e.topRight),bottomLeft:l.q.construct(e.bottomLeft),bottomRight:l.q.construct(e.bottomRight)}:e,Oc=e=>{const{topLeft:t,topRight:s,bottomLeft:o,bottomRight:r}=e;return`${t.x}% ${s.x}% ${r.x}% ${o.x}% / ${t.y}% ${s.y}% ${r.y}% ${o.y}%`},Vc={width:40,height:80},Ac={x:50,y:10},Nn=({className:e,dimensions:t=Vc,borderRadius:s=Ac,color:o,...r})=>{const i=zc(s),u=c.use();return n.jsxRuntimeExports.jsx(J,{className:l.CSS(e,l.CSS.B("tank")),style:{...t,borderRadius:Oc(i),borderColor:l.cssString(o??u.colors.gray.l9)},...r,children:n.jsxRuntimeExports.jsxs(F,{children:[n.jsxRuntimeExports.jsx(P,{location:"top",orientation:"left",left:50,top:0,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"top",orientation:"left",left:-.5,top:i.topLeft.y-1,id:"2"}),n.jsxRuntimeExports.jsx(P,{location:"top",orientation:"left",left:101,top:i.topRight.y-1,id:"3"}),n.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),n.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:"left",left:-.5,top:100-i.bottomLeft.y+1,id:"5"}),n.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:"left",left:101,top:100-i.bottomRight.y+1,id:"6"}),n.jsxRuntimeExports.jsx(P,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},_n=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(e,l.CSS.B("regulator")),...r,children:[n.jsxRuntimeExports.jsxs(F,{orientation:t,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:0,top:66,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:100,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:88,height:80},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),n.jsxRuntimeExports.jsx(z,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44 30H61Z"}),n.jsxRuntimeExports.jsx(W,{x1:"44",y1:"53",x2:"44",y2:"30",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M44 10.5V8C44 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44 53"})]})]}),Bn=({className:e,orientation:t="left",scale:s,color:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(l.CSS.B("orifice"),e),...r,children:[n.jsxRuntimeExports.jsxs(F,{orientation:t,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:100,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:70,height:34},orientation:t,color:o,scale:s,children:[n.jsxRuntimeExports.jsx(z,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),zn=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(l.CSS.B("needle-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(F,{orientation:t,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:42},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:l.cssString(s)}),n.jsxRuntimeExports.jsx(z,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),On=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{orientation:t,className:l.CSS(l.CSS.B("angled-relief-valve"),e),...r,children:[n.jsxRuntimeExports.jsxs(F,{children:[n.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:t,left:33,top:100,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:100,top:45,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:79},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M20.75 2L20.75 38",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),n.jsxRuntimeExports.jsx(z,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"}),n.jsxRuntimeExports.jsx(z,{d:"M24.3461 33.5709L21.7484 34.88C20.9998 35.2572 20.3887 35.8601 20.0012 36.6035L19.3383 37.8756"})]})]}),Vn=({className:e,color:t,dimensions:s,orientation:o,units:r="psi",children:i,...u})=>{const a=l.cssString(t),d=c.use(),j=t==null?"var(--pluto-gray-l0)":l.cssString(new l.Color(t).pickByContrast(d.colors.gray.l0,d.colors.gray.l9));return n.jsxRuntimeExports.jsxs(J,{className:l.CSS(l.CSS.B("value"),e),...u,style:{borderColor:a,height:s==null?void 0:s.height,width:"100%"},children:[n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","content"),style:{flexGrow:1,minWidth:s==null?void 0:s.width,inlineSize:80},children:i}),n.jsxRuntimeExports.jsxs(F,{orientation:o,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:"left",left:-2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:"left",left:102,top:50,id:"2"}),n.jsxRuntimeExports.jsx(P,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),n.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),n.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","units"),style:{background:a},children:n.jsxRuntimeExports.jsx(c.Text,{level:"small",color:j,children:r})})]})},An=({enabled:e=!1,onClick:t,orientation:s="left"})=>n.jsxRuntimeExports.jsxs(J,{orientation:s,children:[n.jsxRuntimeExports.jsx(c.Switch$1,{value:e,onClick:t,onChange:()=>{}}),n.jsxRuntimeExports.jsxs(F,{orientation:s,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:s,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:s,left:100,top:50,id:"2"})]})]}),Dn=({onClick:e,orientation:t="left",label:s=""})=>n.jsxRuntimeExports.jsxs(J,{orientation:t,children:[n.jsxRuntimeExports.jsx(c.Button,{onClick:e,children:s}),n.jsxRuntimeExports.jsxs(F,{orientation:t,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(P,{location:"top",orientation:t,left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),In=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(le,{...r,className:l.CSS(l.CSS.B("screw-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(F,{orientation:s,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:s,left:2,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(W,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(W,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(z,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(z,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)})]})]}),Zn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(le,{...r,className:l.CSS(l.CSS.B("vacuum-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(F,{orientation:s,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(W,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(W,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:l.CSS(l.CSS.M("detail"),t)})]})]}),Fn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(le,{...r,className:l.CSS(l.CSS.B("cavity-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(F,{orientation:s,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(W,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(W,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(z,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:l.CSS(l.CSS.M("detail"),t)})]})]}),qn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(le,{...r,className:l.CSS(l.CSS.B("piston-pump"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(F,{orientation:s,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:s,left:98,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),n.jsxRuntimeExports.jsx(W,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(W,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(z,{d:"M 23 32, h 16, m 0 -8, v 16",className:l.CSS(l.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Yn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{...r,className:l.CSS(l.CSS.B("static-mixer"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(F,{orientation:s,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:s,left:99,top:50,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:66,height:31},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(It,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),n.jsxRuntimeExports.jsx(z,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),Gn=({color:e,className:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(le,{...r,className:l.CSS(l.CSS.B("rotary-mixer"),t),orientation:s,children:[n.jsxRuntimeExports.jsxs(F,{orientation:s,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:s,left:1,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:s,left:99,top:48,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:50,height:33},color:e,orientation:s,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),n.jsxRuntimeExports.jsx(W,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(W,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),n.jsxRuntimeExports.jsx(W,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)})]})]}),Hn=({className:e,color:t,orientation:s="left",scale:o,...r})=>n.jsxRuntimeExports.jsxs(le,{...r,className:l.CSS(l.CSS.B("light"),e),children:[n.jsxRuntimeExports.jsxs(F,{orientation:s,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:s,left:0,top:50,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:s,left:100,top:50,id:"2"}),n.jsxRuntimeExports.jsx(P,{location:"top",orientation:s,left:50,top:0,id:"3"}),n.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:s,left:50,top:100,id:"4"})]}),n.jsxRuntimeExports.jsx(G,{dimensions:{width:64,height:64},color:t,orientation:s,scale:o,children:n.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"})})]}),Un=({className:e,orientation:t="left",color:s,scale:o,...r})=>n.jsxRuntimeExports.jsxs(J,{className:l.CSS(e,l.CSS.B("regulator")),...r,children:[n.jsxRuntimeExports.jsxs(F,{orientation:t,children:[n.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:5,top:66,id:"1"}),n.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),n.jsxRuntimeExports.jsxs(G,{dimensions:{width:88,height:80},orientation:t,color:s,scale:o,children:[n.jsxRuntimeExports.jsx(z,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),n.jsxRuntimeExports.jsx(It,{x:"19",y:"10",width:"50",height:"20",rx:"3",ry:"3"}),n.jsxRuntimeExports.jsx(W,{x1:"44",y1:"53",x2:"44",y2:"30",strokeLinecap:"round"}),n.jsxRuntimeExports.jsx(z,{d:"M44 10.5V8C44 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44 53"})]})]}),ne=({aetherKey:e,source:t,sink:s})=>{const o=c.useMemoDeepEqualProps({source:t,sink:s}),[,{triggered:r,enabled:i},u]=c.use$3({aetherKey:e,type:p.Toggle.TYPE,schema:p.toggleStateZ,initialState:{triggered:!1,enabled:!1,...o}});return x.useEffect(()=>{u(d=>({...d,...o}))},[o,u]),{toggle:x.useCallback(()=>u(d=>({...d,triggered:!d.triggered})),[u]),triggered:r,enabled:i}},Dc=p.Value.z.omit({font:!0}).partial({color:!0}).extend({level:k.levelZ.optional()}),Wn=({aetherKey:e,box:t,telem:s,color:o,precision:r,minWidth:i,level:u="small"})=>{const a=c.useMemoDeepEqualProps({box:t,telem:s,color:o,precision:r,level:u,minWidth:i}),[,d,j]=c.use$3({aetherKey:e,type:p.Value.TYPE,schema:p.Value.z,initialState:a});return x.useLayoutEffect(()=>j(m=>({...m,...a})),[a]),{width:d.width??d.minWidth}},Ic=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:Dc,use:Wn},Symbol.toStringTag,{value:"Module"})),Xn=e=>l.g.construct(e)==="x"?l.J.swap(e):e,Zc=e=>l.g.construct(e)==="y"?l.J.swap(e):e,te=({showChip:e=!0,showIndicator:t=!0,indicator:s,orientation:o="left",chip:r,children:i,...u})=>n.jsxRuntimeExports.jsxs(O.Space,{direction:l.J.rotate90(o),align:"center",justify:"center",empty:!0,...u,children:[n.jsxRuntimeExports.jsxs(O.Space,{direction:l.g.construct(o),align:"center",className:l.CSS(l.CSS.B("control-state")),size:"small",children:[e&&n.jsxRuntimeExports.jsx(cn,{size:"small",...r}),t&&n.jsxRuntimeExports.jsx(xn,{...s})]}),i]}),Jn=c.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:s,control:o,source:r,sink:i,orientation:u="left",color:a})=>{const{enabled:d,triggered:j,toggle:m}=ne({aetherKey:e,source:r,sink:i});return n.jsxRuntimeExports.jsx(Z,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(te,{...o,orientation:Xn(u),children:n.jsxRuntimeExports.jsx(Cn,{enabled:d,triggered:j,onClick:m,orientation:u,color:a})})})}),Kn=e=>n.jsxRuntimeExports.jsx(Cn,{...e}),Qn=c.wrap$1("Valve",({control:e,aetherKey:t,label:s,onChange:o,source:r,sink:i,orientation:u,color:a})=>{const{enabled:d,triggered:j,toggle:m}=ne({aetherKey:t,source:r,sink:i});return n.jsxRuntimeExports.jsx(Z,{...s,onChange:o,children:n.jsxRuntimeExports.jsx(te,{...e,orientation:u,children:n.jsxRuntimeExports.jsx(yn,{enabled:d,triggered:j,onClick:m,orientation:u,color:a})})})}),er=e=>n.jsxRuntimeExports.jsx(yn,{...e}),tr=c.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:s,orientation:o="left",normallyOpen:r,color:i,source:u,sink:a,control:d})=>{const{enabled:j,triggered:m,toggle:f}=ne({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(Z,{...t,onChange:s,children:n.jsxRuntimeExports.jsx(te,{...d,orientation:Zc(o),children:n.jsxRuntimeExports.jsx(bn,{enabled:j,triggered:m,onClick:f,orientation:o,color:i,normallyOpen:r})})})}),sr=e=>n.jsxRuntimeExports.jsx(bn,{...e}),nr=c.wrap$1("FourWayValve",({aetherKey:e,control:t,label:s,onChange:o,orientation:r,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:m}=ne({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(Z,{...s,onChange:o,children:n.jsxRuntimeExports.jsx(te,{...t,orientation:r,children:n.jsxRuntimeExports.jsx(Rn,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),rr=e=>n.jsxRuntimeExports.jsx(Rn,{...e}),or=c.wrap$1("AngleValve",({aetherKey:e,label:t,control:s,onChange:o,orientation:r="left",color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:m}=ne({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(Z,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(te,{...s,orientation:Xn(r),children:n.jsxRuntimeExports.jsx(Tn,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),lr=e=>n.jsxRuntimeExports.jsx(Tn,{...e}),ir=c.wrap$1("Pump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:m}=ne({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(Z,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(te,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(kn,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),cr=e=>n.jsxRuntimeExports.jsx(kn,{...e}),ar=c.wrap$1("Tank",({label:e,onChange:t,orientation:s,color:o,dimensions:r,borderRadius:i})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Nn,{onResize:u=>t({dimensions:u}),orientation:s,color:o,dimensions:r,borderRadius:i})})),ur=e=>n.jsxRuntimeExports.jsx(Nn,{...e,dimensions:{width:25,height:50}}),xr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(vn,{orientation:s,color:o})}),dr=e=>n.jsxRuntimeExports.jsx(vn,{...e}),pr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(_n,{orientation:s,color:o})}),mr=e=>n.jsxRuntimeExports.jsx(_n,{...e}),jr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Un,{orientation:s,color:o})}),fr=e=>n.jsxRuntimeExports.jsx(Un,{...e}),hr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Pn,{orientation:s,color:o})}),Sr=e=>n.jsxRuntimeExports.jsx(Pn,{...e}),gr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Ln,{orientation:s,color:o})}),Er=e=>n.jsxRuntimeExports.jsx(Ln,{...e}),Rr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Mn,{orientation:s,color:o})}),Cr=e=>n.jsxRuntimeExports.jsx(Mn,{...e}),yr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx($n,{orientation:s,color:o})}),br=e=>n.jsxRuntimeExports.jsx($n,{...e}),vr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(zn,{orientation:s,color:o})}),wr=e=>n.jsxRuntimeExports.jsx(zn,{...e}),Tr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(wn,{orientation:s,color:o})}),kr=e=>n.jsxRuntimeExports.jsx(wn,{...e}),Pr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Bn,{orientation:s,color:o})}),Lr=e=>n.jsxRuntimeExports.jsx(Bn,{...e}),Mr=({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(On,{orientation:s,color:o})}),$r=e=>n.jsxRuntimeExports.jsx(On,{...e}),Nr=c.wrap$1("Value",({aetherKey:e,label:t,level:s="p",position:o,className:r,textColor:i,color:u,telem:a,units:d,onChange:j,tooltip:m})=>{const f=c.useTypography(s),[S,h]=x.useState({outerBox:l.To.ZERO,labelBox:l.To.ZERO}),C=(f.lineHeight+.5)*f.baseSize+2,R=c.useResize(x.useCallback(b=>{const E=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);let y={...l.To.ZERO};E!=null&&(y=l.To.construct(E),y=l.To.resize(y,{width:l.To.width(y),height:l.To.height(y)})),h({outerBox:b,labelBox:y})},[]),{}),{zoom:v}=p.useInitialViewport(),L=qc({labelOrientation:(t==null?void 0:t.orientation)??"top",hasLabel:(t==null?void 0:t.label)!=null&&(t==null?void 0:t.label.length)>0,valueBoxHeight:C,position:o,zoom:v,...S}),{width:g}=Wn({aetherKey:e,color:i,level:s,box:L,telem:a,minWidth:60});return n.jsxRuntimeExports.jsxs(c.Dialog$1,{location:{y:"top"},hide:m==null||m.length===0,children:[n.jsxRuntimeExports.jsx(O.Space,{direction:"y",children:m==null?void 0:m.map((b,E)=>n.jsxRuntimeExports.jsx(c.Text,{level:"small",children:b},E))}),n.jsxRuntimeExports.jsx(Z,{className:l.CSS(r,l.CSS.B("value-labeled")),ref:R,onChange:j,...t,children:n.jsxRuntimeExports.jsx(Vn,{color:u,dimensions:{height:C,width:g},units:d})})]})}),Fc=.9,qc=({labelOrientation:e,outerBox:t,labelBox:s,valueBoxHeight:o,position:r,hasLabel:i,zoom:u})=>{const a=l.q.scale(l.To.dims(s),1/(Fc*u));return l.g.construct(e)==="x"&&(r=l.q.translate(r,"y",Math.max((a.y-o)/2-1,0))),i&&e==="left"?r=l.q.translate(r,"x",a.x+4):i&&e==="top"&&(r=l.q.translate(r,"y",a.y+4)),l.To.construct(r.x,r.y,l.To.width(t),o)},_r=({color:e})=>n.jsxRuntimeExports.jsx(Vn,{color:e,dimensions:{width:60,height:25},units:"psi",children:n.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"50.00"})}),Br=c.wrap$1("Switch",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:m}=ne({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(Z,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(te,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(An,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),zr=e=>n.jsxRuntimeExports.jsx(An,{...e}),Or=c.wrap$1("Button",({aetherKey:e,label:t,orientation:s,sink:o,control:r})=>{const{click:i}=Mc({aetherKey:e,sink:o});return n.jsxRuntimeExports.jsx(te,{...r,className:l.CSS.B("symbol"),orientation:s,children:n.jsxRuntimeExports.jsx(Dn,{label:t==null?void 0:t.label,onClick:i})})}),Vr=({label:e,...t})=>n.jsxRuntimeExports.jsx(Dn,{label:"Button",...t}),Ar=c.wrap$1("screwPump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:m}=ne({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(Z,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(te,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(In,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),Dr=e=>n.jsxRuntimeExports.jsx(In,{...e}),Ir=c.wrap$1("vacuumPump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:m}=ne({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(Z,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(te,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(Zn,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),Zr=e=>n.jsxRuntimeExports.jsx(Zn,{...e}),Fr=c.wrap$1("progressiveCavityPump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:m}=ne({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(Z,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(te,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(Fn,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),qr=e=>n.jsxRuntimeExports.jsx(Fn,{...e}),Yr=c.wrap$1("pistonPump",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:m}=ne({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(Z,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(te,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(qn,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),Gr=e=>n.jsxRuntimeExports.jsx(qn,{...e}),Hr=c.wrap$1("statixMixer",({label:e,onChange:t,orientation:s,color:o})=>n.jsxRuntimeExports.jsx(Z,{...e,onChange:t,children:n.jsxRuntimeExports.jsx(Yn,{orientation:s,color:o})})),Ur=e=>n.jsxRuntimeExports.jsx(Yn,{...e}),Wr=c.wrap$1("rotaryMixer",({aetherKey:e,label:t,control:s,onChange:o,orientation:r,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:m}=ne({aetherKey:e,source:u,sink:a});return n.jsxRuntimeExports.jsx(Z,{...t,onChange:o,children:n.jsxRuntimeExports.jsx(te,{...s,orientation:r,children:n.jsxRuntimeExports.jsx(Gn,{enabled:d,triggered:j,onClick:m,orientation:r,color:i})})})}),Xr=e=>n.jsxRuntimeExports.jsx(Gn,{...e}),Jr=c.wrap$1("light",({aetherKey:e,label:t,className:s,orientation:o="left",color:r,source:i,onChange:u})=>{const{enabled:a}=ne({aetherKey:e,source:i});return n.jsxRuntimeExports.jsx(Z,{...t,onChange:u,children:n.jsxRuntimeExports.jsx(Hn,{color:r,enabled:a,className:s,orientation:o})})}),Kr=e=>n.jsxRuntimeExports.jsx(Hn,{...e}),q=4,Yc=2,Gc=["angledReliefValve","angledValve","burstDisc","button","cap","cavityPump","checkValve","electricRegulator","filter","fourWayValve","light","manualValve","needleValve","orifice","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","solenoidValve","staticMixer","switch","tank","threeWayValve","vacuumPump","value","valve"],Hc=se.z.enum(Gc),ie={source:p.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:p.streamChannelValue({channel:0}),threshold:p.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"}),sink:p.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:p.setChannelValue({channel:0}),setpoint:p.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},Uc={name:"Three Way Valve",key:"threeWayValve",Form:ue,Symbol:Jn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Three Way Valve",level:"p",orientation:"top"},...ie,orientation:"left"}),Preview:Kn,zIndex:q},Wc={name:"Valve",key:"valve",Form:ue,Symbol:Qn,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Valve",level:"p",orientation:"top"},orientation:"left",...ie}),Preview:er,zIndex:q},Xc={name:"Solenoid Valve",key:"solenoidValve",Form:yc,Symbol:tr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Solenoid Valve",level:"p",orientation:"top"},orientation:"left",normallyOpen:!1,...ie}),Preview:sr,zIndex:q},Jc={name:"Four Way Valve",key:"fourWayValve",Form:ue,Symbol:nr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Four Way Valve",level:"p",orientation:"top"},orientation:"left",...ie}),Preview:rr,zIndex:q},Kc={name:"Angled Valve",key:"angledValve",Form:ue,Symbol:or,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Angled Valve",level:"p",orientation:"top"},orientation:"left",...ie}),Preview:lr,zIndex:q},Qc={name:"Pump",key:"pump",Form:ue,Symbol:ir,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Pump",level:"p",orientation:"top"},orientation:"left",...ie}),Preview:cr,zIndex:q},ea={name:"Screw Pump",key:"screwPump",Form:ue,Symbol:Ar,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Screw Pump",level:"p",orientation:"top"},orientation:"left",...ie}),Preview:Dr,zIndex:q},ta={name:"Tank",key:"tank",Form:bc,Symbol:ar,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Tank",level:"p",orientation:"top"},dimensions:{width:100,height:200},orientation:"left"}),Preview:ur,zIndex:Yc},sa={name:"Relief Valve",key:"reliefValve",Form:oe,Symbol:xr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Relief Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:dr,zIndex:q},na={name:"Regulator",key:"regulator",Form:oe,Symbol:pr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Regulator",level:"p",orientation:"top"},orientation:"left"}),Preview:mr,zIndex:q},ra={name:"Electric Regulator",key:"electricRegulator",Form:oe,Symbol:jr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Electric Regulator",level:"p",orientation:"top"},orientation:"left"}),Preview:fr,zIndex:q},oa={name:"Burst Disc",key:"burstDisc",Form:oe,Symbol:hr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Burst Disc",level:"p",orientation:"top"},orientation:"left"}),Preview:Sr,zIndex:q},la={name:"Cap",key:"cap",Form:oe,Symbol:gr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Cap",level:"p",orientation:"top"},orientation:"left"}),Preview:Er,zIndex:q},ia={name:"Manual Valve",key:"manualValve",Form:oe,Symbol:Rr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Manual Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:Cr,zIndex:q},ca={name:"Filter",key:"filter",Form:oe,Symbol:yr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Filter",level:"p",orientation:"top"},orientation:"left"}),Preview:br,zIndex:q},aa={name:"Needle Valve",key:"needleValve",Form:oe,Symbol:vr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Needle Valve",level:"p"},orientation:"left"}),Preview:wr,zIndex:q},ua={name:"Check Valve",key:"checkValve",Form:oe,Symbol:Tr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Check Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:kr,zIndex:q},xa={name:"Orifice",key:"orifice",Form:oe,Symbol:Pr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Orifice",level:"p",orientation:"top"},orientation:"left"}),Preview:Lr,zIndex:q},da={name:"Angled Relief Valve",key:"angledReliefValve",Form:oe,Symbol:Mr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Angled Relief Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:$r,zIndex:q},pa={name:"Value",key:"value",Form:wc,Symbol:Nr,Preview:_r,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",label:{label:"Value",level:"p",orientation:"top"},orientation:"left",telem:p.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:p.streamChannelValue({channel:0}),stringifier:p.stringifyNumber({precision:2}),rollingAverage:p.rollingAverage({windowSize:1})},outlet:"stringifier"})}),zIndex:q},ma={name:"Button",key:"button",Symbol:Or,Form:Lc,Preview:Vr,defaultProps:()=>({label:{label:"Button",level:"p",orientation:"top"},orientation:"left",sink:p.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:p.setChannelValue({channel:0}),setpoint:p.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})}),zIndex:q},ja={name:"Switch",key:"switch",Symbol:Br,Preview:zr,Form:ue,defaultProps:()=>({label:{label:"Switch",level:"p",orientation:"top"},orientation:"left",...ie}),zIndex:q},fa={name:"Vacuum Pump",key:"vacuumPump",Symbol:Ir,Form:ue,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Vacuum Pump",level:"p",orientation:"top"},orientation:"left",...ie}),Preview:Zr,zIndex:q},ha={name:"Cavity Pump",key:"cavityPump",Symbol:Fr,Form:ue,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Cavity Pump",level:"p",orientation:"top"},orientation:"left",...ie}),Preview:qr,zIndex:q},Sa={name:"Piston Pump",key:"pistonPump",Symbol:Yr,Form:ue,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Piston Pump",level:"p",orientation:"top"},orientation:"left",...ie}),Preview:Gr,zIndex:q},ga={name:"Static Mixer",key:"staticMixer",Symbol:Hr,Form:oe,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Static Mixer",level:"p",orientation:"top"},orientation:"left"}),Preview:Ur,zIndex:q},Ea={name:"Rotary Mixer",key:"rotaryMixer",Symbol:Wr,Form:ue,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Rotary Mixer",level:"p",orientation:"top"},orientation:"left",...ie}),Preview:Xr,zIndex:q},Ra={name:"Light",key:"light",Symbol:Jr,Form:kc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Light",level:"p",orientation:"top"},orientation:"left",units:"psi",source:p.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:p.streamChannelValue({channel:0}),threshold:p.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})}),Preview:Kr,zIndex:q},Ca={value:pa,light:Ra,switch:ja,button:ma,tank:ta,valve:Wc,solenoidValve:Xc,threeWayValve:Uc,fourWayValve:Jc,angledValve:Kc,manualValve:ia,needleValve:aa,reliefValve:sa,angledReliefValve:da,checkValve:ua,regulator:na,electricRegulator:ra,pump:Qc,pistonPump:Sa,screwPump:ea,cavityPump:ha,vacuumPump:fa,staticMixer:ga,rotaryMixer:Ea,burstDisc:oa,cap:la,filter:ca,orifice:xa},ya=Object.freeze(Object.defineProperty({__proto__:null,AngledReliefValve:Mr,AngledReliefValvePreview:$r,AngledValve:or,AngledValvePreview:lr,BurstDisc:hr,BurstDiscPreview:Sr,Button:Or,ButtonPreview:Vr,Cap:gr,CapPreview:Er,CavityPump:Fr,CavityPumpPreview:qr,CheckValve:Tr,CheckValvePreview:kr,ControlState:te,ElectricRegulator:jr,ElectricRegulatorPreview:fr,Filter:yr,FilterPreview:br,FourWayValve:nr,FourWayValvePreview:rr,Light:Jr,LightPreview:Kr,ManualValve:Rr,ManualValvePreview:Cr,NeedleValve:vr,NeedleValvePreview:wr,Orifice:Pr,OrificePreview:Lr,PistonPump:Yr,PistonPumpPreview:Gr,Pump:ir,PumpPreview:cr,Regulator:pr,RegulatorPreview:mr,ReliefValve:xr,ReliefValvePreview:dr,RotaryMixer:Wr,RotaryMixerPreview:Xr,SYMBOLS:Ca,ScrewPump:Ar,ScrewPumpPreview:Dr,SolenoidValve:tr,SolenoidValvePreview:sr,StaticMixer:Hr,StaticMixerPreview:Ur,Switch:Br,SwitchPreview:zr,Tank:ar,TankPreview:ur,ThreeWayValve:Jn,ThreeWayValvePreview:Kn,VacuumPump:Ir,VacuumPumpPreview:Zr,Value:Nr,ValuePreview:_r,Valve:Qn,ValvePreview:er,typeZ:Hc},Symbol.toStringTag,{value:"Module"}));exports.Aether=c.main;exports.Divider=c.Divider$1;exports.Dropdown=c.Dropdown;exports.Haul=c.Haul;exports.Worker=c.Context$1;exports.compareArrayDeps=c.compareArrayDeps;exports.componentRenderProp=c.componentRenderProp;exports.isRenderProp=c.isRenderProp;exports.useAsyncEffect=c.useAsyncEffect;exports.useClickOutside=c.useClickOutside;exports.useCombinedRefs=c.useCombinedRefs;exports.useCombinedStateAndRef=c.useCombinedStateAndRef;exports.useDebouncedCallback=c.useDebouncedCallback;exports.useEffectCompare=c.useEffectCompare;exports.useMemoCompare=c.useMemoCompare;exports.useMemoDeepEqualProps=c.useMemoDeepEqualProps;exports.usePrevious=c.usePrevious;exports.useResize=c.useResize;exports.useStateRef=c.useStateRef;exports.useSyncedRef=c.useSyncedRef;exports.useTransforms=c.useTransforms;exports.CSS=l.CSS;exports.newBEM=l.newBEM;exports.Header=Oe.external;exports.DataType=k.g;exports.Density=k.I;exports.MultiSeries=k.mt;exports.Rate=k.$;exports.Series=k.N;exports.TimeRange=k.U;exports.TimeSpan=k.y;exports.TimeStamp=k.m;exports.state=k.state;exports.Generic=O.Generic;exports.Align=lo.external;exports.Button=io.external;exports.Caret=co.Animated$1;exports.telem=p.external;exports.Color=St.external;exports.Text=re.external;exports.Triggers=gt.external;exports.Menu=ao.external;exports.List=be.external;exports.createFilterTransform=be.createFilterTransform;exports.fuseFilter=be.fuseFilter;exports.proxyMemo=be.proxyMemo;exports.createHexOpacityVariants=ls.createHexOpacityVariants;exports.unitProperty=ls.unitProperty;exports.Input=me.external;exports.Tabs=X.external;exports.Theming=uo.external;exports.Tree=xo.external;exports.Video=po.Video;exports.Accordion=$o;exports.Canvas=Ho;exports.Channel=Vl;exports.Control=Yi;exports.Device=oi;exports.Diagram=Rc;exports.Eraser=wi;exports.Form=si;exports.Icon=ii;exports.Legend=Ko;exports.Line=Qo;exports.LinePlot=bl;exports.Measure=kl;exports.Modal=ai;exports.Mosaic=yi;exports.Nav=Pi;exports.Note=Mi;exports.OS=Vi;exports.Observe=Ni;exports.Pluto=Wi;exports.Progress=Ji;exports.Range=wl;exports.Ranger=tc;exports.Resize=bo;exports.Rule=Pl;exports.Schematic=ya;exports.Select=dl;exports.Status=fo;exports.Steps=nc;exports.Synnax=_o;exports.Tag=ul;exports.Telem=Ii;exports.Tooltip=ho;exports.Value=Ic;exports.Viewport=yl;exports.axis=zo;exports.control=Oo;