@synnaxlabs/pluto 0.24.0 → 0.25.1

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 (469) hide show
  1. package/dist/{Animated-Cbt7tqBk.cjs → Animated-B5JgnUUd.cjs} +1 -1
  2. package/dist/{Animated-DGp8qHGT.js → Animated-DLex_hI8.js} +3 -3
  3. package/dist/{Keyboard-HZ6Llqo5.js → Keyboard-Dq4czdJl.js} +3 -3
  4. package/dist/{Keyboard-BjnOIJ5V.cjs → Keyboard-cRnR69tU.cjs} +1 -1
  5. package/dist/{LinePlot-Dw8vQLJw.js → LinePlot-CQD2Wqca.js} +4192 -3945
  6. package/dist/LinePlot-Co1s_Tqs.cjs +66 -0
  7. package/dist/{Link-j-xpQ9HD.js → Link-0lZQ38cR.js} +2 -2
  8. package/dist/Link-BhQ-K5io.cjs +1 -0
  9. package/dist/{List-BX3MLMNz.cjs → List-lSysLR6L.cjs} +1 -1
  10. package/dist/List-xUwGRWFg.js +22 -0
  11. package/dist/{Pack-D93gFUU9.cjs → Pack-BM_LmeO7.cjs} +1 -1
  12. package/dist/{Pack-B5JX1aqf.js → Pack-E_3LSkGG.js} +2 -2
  13. package/dist/Toggle-BKoV45C3.cjs +143 -0
  14. package/dist/{Toggle-Cq3FTFfq.js → Toggle-BYLe2YvN.js} +16471 -16522
  15. package/dist/{Video-D382cbrn.cjs → Video-A2NddcPS.cjs} +1 -1
  16. package/dist/{Video-DIIo17du.js → Video-Ct4BfJzt.js} +2 -2
  17. package/dist/aggregator-BjcY2k2l.cjs +51 -0
  18. package/dist/{aggregator-BIhLPgXc.js → aggregator-ZdqEkvBK.js} +3834 -4648
  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-DEMSADUS.js +1042 -0
  26. package/dist/css-DY1Oedjj.cjs +1 -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 +46 -45
  33. package/dist/{external-lDVnD7Yi.js → external--9Vu3Tvu.js} +2 -2
  34. package/dist/{external-DUeGQ4si.cjs → external-ARvsEsOz.cjs} +1 -1
  35. package/dist/{external-RIKGjo5R.js → external-B432ukHJ.js} +4 -4
  36. package/dist/{external-BCyTR9bj.cjs → external-BAw0sDOf.cjs} +1 -1
  37. package/dist/{external-v3jmKHoB.cjs → external-BQS9le5M.cjs} +1 -1
  38. package/dist/{external-CZiW7AR4.js → external-BlA8AVL_.js} +24 -38
  39. package/dist/external-Bs4ZUlV0.cjs +1 -0
  40. package/dist/{external-CjjdhnS5.cjs → external-C5O8yyPx.cjs} +1 -1
  41. package/dist/{external-BJI4w1QU.js → external-CCaVfdMh.js} +5 -5
  42. package/dist/{external-D9eq1UnF.cjs → external-CYaPBMuM.cjs} +1 -1
  43. package/dist/{external-C3TJ5wKl.js → external-CZ4JWSju.js} +5 -5
  44. package/dist/{external-CDZA7f7F.js → external-CZvU-o3e.js} +2 -2
  45. package/dist/external-Cq-09sZJ.js +344 -0
  46. package/dist/{external-DKxxR-uc.cjs → external-Cq39ap_s.cjs} +1 -1
  47. package/dist/external-D3r8Iptl.js +93 -0
  48. package/dist/{external-DVg6hQ24.js → external-D8t2fJPR.js} +13 -14
  49. package/dist/{external-B5j7Ee09.cjs → external-DauKaEP3.cjs} +1 -1
  50. package/dist/{external-B4-opRnY.js → external-DlkO8mh4.js} +1 -1
  51. package/dist/{external-D6mqXF0b.js → external-DluodP6q.js} +18 -19
  52. package/dist/external-Gp6DgYYV.cjs +1 -0
  53. package/dist/{external-IpylADnr.cjs → external-aHhj9dKH.cjs} +1 -1
  54. package/dist/{external-CD2dFTTj.cjs → external-wfqDajHH.cjs} +1 -1
  55. package/dist/{external-DvFgLm4v.js → external-xFWuaTdI.js} +42 -33
  56. package/dist/{external-CFqe6ymi.cjs → external-xb_RKgNH.cjs} +1 -1
  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 +4484 -3915
  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 +13 -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 +8 -8
  95. package/dist/src/channel/Select.d.ts +2 -2
  96. package/dist/src/color/Picker/Picker.d.ts +2 -2
  97. package/dist/src/color/Swatch/Swatch.d.ts +4 -4
  98. package/dist/src/color/core/color.d.ts +7 -0
  99. package/dist/src/color/core/color.d.ts.map +1 -1
  100. package/dist/src/css/color.d.ts.map +1 -1
  101. package/dist/src/css/css.d.ts +4 -4
  102. package/dist/src/css/css.d.ts.map +1 -1
  103. package/dist/src/css/vars.d.ts.map +1 -1
  104. package/dist/src/dialog/use.d.ts.map +1 -1
  105. package/dist/src/divider/Divider.d.ts +1 -1
  106. package/dist/src/dropdown/Dropdown.d.ts +5 -5
  107. package/dist/src/dropdown/Dropdown.d.ts.map +1 -1
  108. package/dist/src/form/Field.d.ts +7 -7
  109. package/dist/src/form/Field.d.ts.map +1 -1
  110. package/dist/src/form/Form.d.ts +7 -7
  111. package/dist/src/form/Form.d.ts.map +1 -1
  112. package/dist/src/generic/Generic.d.ts +1 -1
  113. package/dist/src/generic/Generic.d.ts.map +1 -1
  114. package/dist/src/hardware/device/Select.d.ts +2 -2
  115. package/dist/src/haul/Haul.d.ts +20 -16
  116. package/dist/src/haul/Haul.d.ts.map +1 -1
  117. package/dist/src/header/Actions.d.ts +1 -1
  118. package/dist/src/header/ButtonTitle.d.ts +1 -1
  119. package/dist/src/header/Header.d.ts +2 -2
  120. package/dist/src/header/Title.d.ts +1 -1
  121. package/dist/src/hooks/effect.d.ts.map +1 -1
  122. package/dist/src/hooks/ref.d.ts +3 -3
  123. package/dist/src/hooks/ref.d.ts.map +1 -1
  124. package/dist/src/hooks/useCursorDrag/types.d.ts +1 -1
  125. package/dist/src/hooks/useCursorDrag/useCursorDrag.d.ts +2 -2
  126. package/dist/src/hooks/useDebouncedCallback.d.ts.map +1 -1
  127. package/dist/src/hooks/useFilter.d.ts +1 -1
  128. package/dist/src/hooks/useFilter.d.ts.map +1 -1
  129. package/dist/src/hooks/useRequiredContext.d.ts.map +1 -1
  130. package/dist/src/hooks/useResize.d.ts +1 -1
  131. package/dist/src/hooks/useResize.d.ts.map +1 -1
  132. package/dist/src/hooks/useTransforms.d.ts.map +1 -1
  133. package/dist/src/hooks/useUniqueKey.d.ts.map +1 -1
  134. package/dist/src/icon/Icon.d.ts +14 -0
  135. package/dist/src/icon/Icon.d.ts.map +1 -0
  136. package/dist/src/icon/index.d.ts +2 -0
  137. package/dist/src/icon/index.d.ts.map +1 -0
  138. package/dist/src/index.d.ts +2 -0
  139. package/dist/src/index.d.ts.map +1 -1
  140. package/dist/src/input/Date.d.ts +1 -1
  141. package/dist/src/input/Date.d.ts.map +1 -1
  142. package/dist/src/input/DateTime.d.ts +1 -1
  143. package/dist/src/input/DragButton.d.ts +3 -3
  144. package/dist/src/input/HelpText.d.ts +2 -2
  145. package/dist/src/input/Item.d.ts +2 -2
  146. package/dist/src/input/Numeric.d.ts +3 -3
  147. package/dist/src/input/Numeric.d.ts.map +1 -1
  148. package/dist/src/input/Switch.d.ts.map +1 -1
  149. package/dist/src/input/Text.d.ts +1 -1
  150. package/dist/src/input/Text.d.ts.map +1 -1
  151. package/dist/src/input/TextArea.d.ts +1 -1
  152. package/dist/src/input/Time.d.ts +2 -2
  153. package/dist/src/input/Time.d.ts.map +1 -1
  154. package/dist/src/input/types.d.ts +2 -2
  155. package/dist/src/list/Column.d.ts +6 -6
  156. package/dist/src/list/Column.d.ts.map +1 -1
  157. package/dist/src/list/Core.d.ts +4 -4
  158. package/dist/src/list/Core.d.ts.map +1 -1
  159. package/dist/src/list/Data.d.ts +5 -3
  160. package/dist/src/list/Data.d.ts.map +1 -1
  161. package/dist/src/list/Filter.d.ts +4 -4
  162. package/dist/src/list/Filter.d.ts.map +1 -1
  163. package/dist/src/list/Hover.d.ts +1 -1
  164. package/dist/src/list/Hover.d.ts.map +1 -1
  165. package/dist/src/list/Item.d.ts +3 -3
  166. package/dist/src/list/Item.d.ts.map +1 -1
  167. package/dist/src/list/List.d.ts +1 -1
  168. package/dist/src/list/List.d.ts.map +1 -1
  169. package/dist/src/list/Search.d.ts +3 -3
  170. package/dist/src/list/Search.d.ts.map +1 -1
  171. package/dist/src/list/Selector.d.ts +2 -2
  172. package/dist/src/list/Selector.d.ts.map +1 -1
  173. package/dist/src/list/types.d.ts.map +1 -1
  174. package/dist/src/list/useSelect.d.ts +1 -1
  175. package/dist/src/list/useSelect.d.ts.map +1 -1
  176. package/dist/src/memo/useMemoCompare.d.ts +1 -1
  177. package/dist/src/memo/useMemoCompare.d.ts.map +1 -1
  178. package/dist/src/menu/ContextMenu.d.ts +2 -2
  179. package/dist/src/menu/Item.d.ts +7 -7
  180. package/dist/src/menu/Item.d.ts.map +1 -1
  181. package/dist/src/menu/Menu.d.ts +2 -2
  182. package/dist/src/mock/MockGLBufferController.d.ts +1 -1
  183. package/dist/src/modal/Modal.d.ts +3 -3
  184. package/dist/src/modal/Modal.d.ts.map +1 -1
  185. package/dist/src/mosaic/Mosaic.d.ts +5 -4
  186. package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
  187. package/dist/src/mosaic/tree.d.ts +2 -2
  188. package/dist/src/mosaic/tree.d.ts.map +1 -1
  189. package/dist/src/mosaic/types.d.ts +2 -2
  190. package/dist/src/mosaic/use.d.ts +1 -1
  191. package/dist/src/nav/Bar.d.ts +2 -2
  192. package/dist/src/nav/Bar.d.ts.map +1 -1
  193. package/dist/src/nav/Drawer.d.ts +3 -3
  194. package/dist/src/note/Note.d.ts +1 -1
  195. package/dist/src/note/Note.d.ts.map +1 -1
  196. package/dist/src/observe/use.d.ts.map +1 -1
  197. package/dist/src/os/Controls/Controls.d.ts +2 -2
  198. package/dist/src/os/Controls/Mac.d.ts +1 -1
  199. package/dist/src/os/Controls/Windows.d.ts +1 -1
  200. package/dist/src/os/Controls/types.d.ts +1 -1
  201. package/dist/src/os/use.d.ts.map +1 -1
  202. package/dist/src/pluto/Pluto.d.ts +8 -8
  203. package/dist/src/pluto/aether/index.d.ts +1 -1
  204. package/dist/src/pluto/aether/index.d.ts.map +1 -1
  205. package/dist/src/pluto/aether/{ pluto.d.ts → pluto.d.ts} +1 -1
  206. package/dist/src/pluto/aether/pluto.d.ts.map +1 -0
  207. package/dist/src/portal/Portal.d.ts +0 -1
  208. package/dist/src/portal/Portal.d.ts.map +1 -1
  209. package/dist/src/ranger/SelectLabel.d.ts +2 -2
  210. package/dist/src/ranger/TimeRangeChip.d.ts +2 -2
  211. package/dist/src/resize/Core.d.ts +1 -1
  212. package/dist/src/resize/Multiple.d.ts +2 -2
  213. package/dist/src/resize/Single.d.ts +2 -2
  214. package/dist/src/select/Button.d.ts +8 -8
  215. package/dist/src/select/Button.d.ts.map +1 -1
  216. package/dist/src/select/ClearButton.d.ts +1 -1
  217. package/dist/src/select/ClearButton.d.ts.map +1 -1
  218. package/dist/src/select/DataType.d.ts +1 -1
  219. package/dist/src/select/DataType.d.ts.map +1 -1
  220. package/dist/src/select/Direction.d.ts +2 -2
  221. package/dist/src/select/List.d.ts +3 -3
  222. package/dist/src/select/List.d.ts.map +1 -1
  223. package/dist/src/select/Multiple.d.ts +7 -7
  224. package/dist/src/select/Multiple.d.ts.map +1 -1
  225. package/dist/src/select/Single.d.ts +5 -5
  226. package/dist/src/select/Single.d.ts.map +1 -1
  227. package/dist/src/state/state.d.ts +1 -1
  228. package/dist/src/state/state.d.ts.map +1 -1
  229. package/dist/src/status/Aggregator.d.ts +4 -4
  230. package/dist/src/status/Circle.d.ts +2 -2
  231. package/dist/src/status/Notification.d.ts +3 -3
  232. package/dist/src/status/Text.d.ts +2 -2
  233. package/dist/src/status/Text.d.ts.map +1 -1
  234. package/dist/src/status/aether/aggregator.d.ts +3 -3
  235. package/dist/src/status/aether/aggregator.d.ts.map +1 -1
  236. package/dist/src/status/aether/types.d.ts +1 -1
  237. package/dist/src/steps/Steps.d.ts +2 -2
  238. package/dist/src/synnax/Provider.d.ts +2 -2
  239. package/dist/src/synnax/Provider.d.ts.map +1 -1
  240. package/dist/src/synnax/aether/provider.d.ts +14 -14
  241. package/dist/src/synnax/aether/provider.d.ts.map +1 -1
  242. package/dist/src/tabs/Selector.d.ts +3 -3
  243. package/dist/src/tabs/Tabs.d.ts +3 -3
  244. package/dist/src/tabs/types.d.ts +2 -2
  245. package/dist/src/tag/Tag.d.ts +3 -3
  246. package/dist/src/telem/Provider.d.ts +1 -1
  247. package/dist/src/telem/aether/context.d.ts +4 -4
  248. package/dist/src/telem/aether/context.d.ts.map +1 -1
  249. package/dist/src/telem/aether/factory.d.ts +1 -1
  250. package/dist/src/telem/aether/factory.d.ts.map +1 -1
  251. package/dist/src/telem/aether/noop.d.ts +1 -1
  252. package/dist/src/telem/aether/pipeline.d.ts +3 -3
  253. package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
  254. package/dist/src/telem/aether/provider.d.ts +6 -6
  255. package/dist/src/telem/aether/remote.d.ts +3 -3
  256. package/dist/src/telem/aether/remote.d.ts.map +1 -1
  257. package/dist/src/telem/aether/static.d.ts +3 -3
  258. package/dist/src/telem/aether/telem.d.ts +3 -3
  259. package/dist/src/telem/aether/transformers.d.ts +3 -3
  260. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  261. package/dist/src/telem/client/cache/cache.d.ts +3 -3
  262. package/dist/src/telem/client/cache/static.d.ts +1 -1
  263. package/dist/src/telem/client/cache/unary.d.ts +3 -3
  264. package/dist/src/telem/client/client.d.ts +4 -5
  265. package/dist/src/telem/client/client.d.ts.map +1 -1
  266. package/dist/src/telem/client/reader.d.ts +4 -4
  267. package/dist/src/telem/client/streamer.d.ts +4 -4
  268. package/dist/src/telem/client/types.d.ts +1 -1
  269. package/dist/src/telem/control/Chip.d.ts +3 -3
  270. package/dist/src/telem/control/Chip.d.ts.map +1 -1
  271. package/dist/src/telem/control/Controller.d.ts +4 -4
  272. package/dist/src/telem/control/Indicator.d.ts +3 -3
  273. package/dist/src/telem/control/Legend.d.ts +1 -1
  274. package/dist/src/telem/control/Legend.d.ts.map +1 -1
  275. package/dist/src/telem/control/StateProvider.d.ts +3 -3
  276. package/dist/src/telem/control/aether/chip.d.ts +3 -3
  277. package/dist/src/telem/control/aether/controller.d.ts +8 -8
  278. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  279. package/dist/src/telem/control/aether/indicator.d.ts +3 -3
  280. package/dist/src/telem/control/aether/legend.d.ts +3 -3
  281. package/dist/src/telem/control/aether/state.d.ts +5 -5
  282. package/dist/src/telem/test/mock.d.ts +2 -2
  283. package/dist/src/testutil/dom.d.ts.map +1 -1
  284. package/dist/src/text/DateTime.d.ts +5 -5
  285. package/dist/src/text/DateTime.d.ts.map +1 -1
  286. package/dist/src/text/Editable.d.ts +7 -10
  287. package/dist/src/text/Editable.d.ts.map +1 -1
  288. package/dist/src/text/Keyboard.d.ts +3 -3
  289. package/dist/src/text/Keyboard.d.ts.map +1 -1
  290. package/dist/src/text/Link.d.ts +3 -3
  291. package/dist/src/text/Link.d.ts.map +1 -1
  292. package/dist/src/text/SelectLevel.d.ts +2 -2
  293. package/dist/src/text/Text.d.ts +4 -4
  294. package/dist/src/text/Text.d.ts.map +1 -1
  295. package/dist/src/text/WithIcon.d.ts +5 -5
  296. package/dist/src/text/WithIcon.d.ts.map +1 -1
  297. package/dist/src/text/core/types.d.ts +1 -1
  298. package/dist/src/text/dimensions.d.ts.map +1 -1
  299. package/dist/src/theming/Provider.d.ts +4 -4
  300. package/dist/src/theming/Provider.d.ts.map +1 -1
  301. package/dist/src/theming/aether/provider.d.ts +2 -2
  302. package/dist/src/theming/aether/provider.d.ts.map +1 -1
  303. package/dist/src/theming/core/fontString.d.ts +2 -2
  304. package/dist/src/theming/core/fontString.d.ts.map +1 -1
  305. package/dist/src/theming/core/theme.d.ts +1 -1
  306. package/dist/src/theming/css.d.ts.map +1 -1
  307. package/dist/src/theming/font.d.ts.map +1 -1
  308. package/dist/src/tooltip/Config.d.ts +1 -1
  309. package/dist/src/tooltip/Dialog.d.ts +2 -2
  310. package/dist/src/tooltip/Dialog.d.ts.map +1 -1
  311. package/dist/src/tooltip/wrap.d.ts +1 -1
  312. package/dist/src/tooltip/wrap.d.ts.map +1 -1
  313. package/dist/src/tree/Tree.d.ts +14 -14
  314. package/dist/src/tree/Tree.d.ts.map +1 -1
  315. package/dist/src/tree/core.d.ts +1 -1
  316. package/dist/src/triggers/Provider.d.ts +2 -2
  317. package/dist/src/triggers/Status.d.ts +1 -1
  318. package/dist/src/triggers/Text.d.ts +4 -4
  319. package/dist/src/triggers/Text.d.ts.map +1 -1
  320. package/dist/src/triggers/hooks.d.ts +3 -3
  321. package/dist/src/triggers/hooks.d.ts.map +1 -1
  322. package/dist/src/triggers/triggers.d.ts +2 -2
  323. package/dist/src/triggers/triggers.d.ts.map +1 -1
  324. package/dist/src/triggers/useDrag.d.ts +2 -2
  325. package/dist/src/util/children.d.ts +2 -2
  326. package/dist/src/util/children.d.ts.map +1 -1
  327. package/dist/src/util/component.d.ts +1 -1
  328. package/dist/src/util/component.d.ts.map +1 -1
  329. package/dist/src/util/renderProp.d.ts +1 -1
  330. package/dist/src/util/renderProp.d.ts.map +1 -1
  331. package/dist/src/util/zod.d.ts.map +1 -1
  332. package/dist/src/viewport/Mask.d.ts.map +1 -1
  333. package/dist/src/viewport/SelectMode.d.ts +2 -2
  334. package/dist/src/viewport/use.d.ts +3 -3
  335. package/dist/src/vis/axis/axis.d.ts +3 -3
  336. package/dist/src/vis/axis/canvas.d.ts +2 -2
  337. package/dist/src/vis/axis/ticks.d.ts +1 -1
  338. package/dist/src/vis/button/aether/button.d.ts +2 -2
  339. package/dist/src/vis/button/use.d.ts +1 -1
  340. package/dist/src/vis/canvas/Canvas.d.ts +2 -2
  341. package/dist/src/vis/canvas/Canvas.d.ts.map +1 -1
  342. package/dist/src/vis/canvas/aether/canvas.d.ts +25 -25
  343. package/dist/src/vis/diagram/Diagram.d.ts +6 -6
  344. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  345. package/dist/src/vis/diagram/aether/Diagram.d.ts +41 -41
  346. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  347. package/dist/src/vis/diagram/aether/types.d.ts +331 -0
  348. package/dist/src/vis/diagram/aether/types.d.ts.map +1 -0
  349. package/dist/src/vis/diagram/align.d.ts +1 -1
  350. package/dist/src/vis/diagram/align.d.ts.map +1 -1
  351. package/dist/src/vis/diagram/edge/Edge.d.ts +4 -4
  352. package/dist/src/vis/diagram/edge/Edge.d.ts.map +1 -1
  353. package/dist/src/vis/diagram/edge/connector/connector.d.ts +12 -4
  354. package/dist/src/vis/diagram/edge/connector/connector.d.ts.map +1 -1
  355. package/dist/src/vis/diagram/external.d.ts +1 -1
  356. package/dist/src/vis/diagram/external.d.ts.map +1 -1
  357. package/dist/src/vis/diagram/util.d.ts +1 -1
  358. package/dist/src/vis/diagram/util.d.ts.map +1 -1
  359. package/dist/src/vis/draw2d/index.d.ts +4 -4
  360. package/dist/src/vis/eraser/aether/eraser.d.ts +26 -26
  361. package/dist/src/vis/eraser/use.d.ts +2 -2
  362. package/dist/src/vis/legend/Container.d.ts +20 -20
  363. package/dist/src/vis/legend/Container.d.ts.map +1 -1
  364. package/dist/src/vis/legend/Simple.d.ts +2 -2
  365. package/dist/src/vis/line/Line.d.ts +2 -2
  366. package/dist/src/vis/line/Line.d.ts.map +1 -1
  367. package/dist/src/vis/line/aether/line.d.ts +8 -7
  368. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  369. package/dist/src/vis/lineplot/Axis.d.ts +5 -5
  370. package/dist/src/vis/lineplot/Axis.d.ts.map +1 -1
  371. package/dist/src/vis/lineplot/Legend.d.ts +2 -2
  372. package/dist/src/vis/lineplot/Line.d.ts +1 -1
  373. package/dist/src/vis/lineplot/Line.d.ts.map +1 -1
  374. package/dist/src/vis/lineplot/LinePlot.d.ts +7 -7
  375. package/dist/src/vis/lineplot/LinePlot.d.ts.map +1 -1
  376. package/dist/src/vis/lineplot/Title.d.ts +2 -2
  377. package/dist/src/vis/lineplot/Title.d.ts.map +1 -1
  378. package/dist/src/vis/lineplot/Viewport.d.ts +1 -1
  379. package/dist/src/vis/lineplot/aether/LinePlot.d.ts +57 -57
  380. package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
  381. package/dist/src/vis/lineplot/aether/XAxis.d.ts +4 -3
  382. package/dist/src/vis/lineplot/aether/XAxis.d.ts.map +1 -1
  383. package/dist/src/vis/lineplot/aether/YAxis.d.ts +5 -4
  384. package/dist/src/vis/lineplot/aether/YAxis.d.ts.map +1 -1
  385. package/dist/src/vis/lineplot/aether/axis.d.ts +6 -6
  386. package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
  387. package/dist/src/vis/lineplot/aether/grid.d.ts +1 -1
  388. package/dist/src/vis/lineplot/aether/grid.d.ts.map +1 -1
  389. package/dist/src/vis/lineplot/range/Annotation.d.ts +2 -2
  390. package/dist/src/vis/lineplot/range/Annotation.d.ts.map +1 -1
  391. package/dist/src/vis/lineplot/range/Provider.d.ts +2 -2
  392. package/dist/src/vis/lineplot/range/Provider.d.ts.map +1 -1
  393. package/dist/src/vis/lineplot/range/aether/annotation.d.ts +4 -4
  394. package/dist/src/vis/lineplot/range/aether/provider.d.ts +19 -19
  395. package/dist/src/vis/lineplot/tooltip/Tooltip.d.ts +2 -2
  396. package/dist/src/vis/lineplot/tooltip/Tooltip.d.ts.map +1 -1
  397. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts +6 -6
  398. package/dist/src/vis/measure/Measure.d.ts +1 -2
  399. package/dist/src/vis/measure/Measure.d.ts.map +1 -1
  400. package/dist/src/vis/measure/aether/measure.d.ts +7 -7
  401. package/dist/src/vis/render/GLProgram.d.ts +2 -2
  402. package/dist/src/vis/render/clear/program.d.ts +1 -1
  403. package/dist/src/vis/render/context.d.ts +4 -7
  404. package/dist/src/vis/render/context.d.ts.map +1 -1
  405. package/dist/src/vis/render/eraser.d.ts +3 -3
  406. package/dist/src/vis/render/performance.d.ts +11 -0
  407. package/dist/src/vis/render/performance.d.ts.map +1 -0
  408. package/dist/src/vis/render/util.d.ts.map +1 -1
  409. package/dist/src/vis/rule/Rule.d.ts +2 -2
  410. package/dist/src/vis/rule/Rule.d.ts.map +1 -1
  411. package/dist/src/vis/rule/aether/aether.d.ts +5 -5
  412. package/dist/src/vis/schematic/Forms.d.ts +5 -0
  413. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  414. package/dist/src/vis/schematic/Labeled.d.ts +2 -2
  415. package/dist/src/vis/schematic/Labeled.d.ts.map +1 -1
  416. package/dist/src/vis/schematic/SelectOrientation.d.ts +3 -3
  417. package/dist/src/vis/schematic/Symbols.d.ts +127 -19
  418. package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
  419. package/dist/src/vis/schematic/primitives/Primitives.d.ts +35 -3
  420. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
  421. package/dist/src/vis/schematic/registry.d.ts +5 -6
  422. package/dist/src/vis/schematic/registry.d.ts.map +1 -1
  423. package/dist/src/vis/setpoint/aether/index.d.ts +2 -0
  424. package/dist/src/vis/setpoint/aether/index.d.ts.map +1 -0
  425. package/dist/src/vis/setpoint/aether/setpoint.d.ts +200 -0
  426. package/dist/src/vis/setpoint/aether/setpoint.d.ts.map +1 -0
  427. package/dist/src/vis/setpoint/index.d.ts +2 -0
  428. package/dist/src/vis/setpoint/index.d.ts.map +1 -0
  429. package/dist/src/vis/setpoint/use.d.ts +11 -0
  430. package/dist/src/vis/setpoint/use.d.ts.map +1 -0
  431. package/dist/src/vis/toggle/aether/toggle.d.ts +5 -5
  432. package/dist/src/vis/toggle/use.d.ts +1 -1
  433. package/dist/src/vis/value/aether/value.d.ts +43 -43
  434. package/dist/src/vis/value/use.d.ts +12 -12
  435. package/dist/src/worker/Context.d.ts +1 -1
  436. package/dist/src/worker/Context.d.ts.map +1 -1
  437. package/dist/style.css +1 -1
  438. package/dist/tabs.cjs +1 -1
  439. package/dist/tabs.js +1 -1
  440. package/dist/text.cjs +1 -1
  441. package/dist/text.js +2 -2
  442. package/dist/theming.cjs +1 -1
  443. package/dist/theming.js +2 -2
  444. package/dist/tree.cjs +1 -1
  445. package/dist/tree.js +1 -1
  446. package/dist/triggers.cjs +1 -1
  447. package/dist/triggers.js +1 -1
  448. package/dist/{units-DeLVJ01P.js → units-BREWRknL.js} +1 -1
  449. package/dist/{units-MTRY0KtD.cjs → units-DNx3byGw.cjs} +1 -1
  450. package/dist/video.cjs +1 -1
  451. package/dist/video.js +1 -1
  452. package/package.json +21 -22
  453. package/dist/LinePlot-tnVASicV.cjs +0 -66
  454. package/dist/Link-CmzvCQDi.cjs +0 -1
  455. package/dist/List-BlgM15Pf.js +0 -22
  456. package/dist/Toggle-BvWOTk9-.cjs +0 -188
  457. package/dist/aggregator-CaPKb9Zv.cjs +0 -51
  458. package/dist/css-BNL3vU5o.cjs +0 -1
  459. package/dist/css-CDB-JY4S.js +0 -1370
  460. package/dist/external-BK0QWtit.cjs +0 -1
  461. package/dist/external-CRbJq-i4.js +0 -92
  462. package/dist/external-jSb_axxw.js +0 -346
  463. package/dist/external-zDAAJJHM.cjs +0 -1
  464. package/dist/jsx-runtime-fmb_vB8K.cjs +0 -25
  465. package/dist/src/pluto/aether/ pluto.d.ts.map +0 -1
  466. package/dist/src/util/case.d.ts +0 -2
  467. package/dist/src/util/case.d.ts.map +0 -1
  468. package/dist/src/vis/diagram/types.d.ts +0 -73
  469. package/dist/src/vis/diagram/types.d.ts.map +0 -1
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var Gr=Object.defineProperty;var Hr=(e,t,s)=>t in e?Gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var re=(e,t,s)=>(Hr(e,typeof t!="symbol"?t+"":t,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-fmb_vB8K.cjs"),x=require("react"),u=require("./Toggle-BvWOTk9-.cjs"),l=require("./css-BNL3vU5o.cjs"),Ie=require("./external-B5j7Ee09.cjs"),k=require("./aggregator-CaPKb9Zv.cjs"),z=require("./Pack-D93gFUU9.cjs"),Ur=require("./external-BCyTR9bj.cjs"),Wr=require("./external-CFqe6ymi.cjs"),Xr=require("./Animated-Cbt7tqBk.cjs"),f=require("./LinePlot-tnVASicV.cjs"),ee=require("zod"),yt=require("./external-CD2dFTTj.cjs"),se=require("./external-zDAAJJHM.cjs"),vt=require("./external-IpylADnr.cjs"),Jr=require("./external-DKxxR-uc.cjs"),wt=require("react-dom"),be=require("./external-v3jmKHoB.cjs"),gs=require("./units-MTRY0KtD.cjs"),de=require("./external-CjjdhnS5.cjs"),K=require("./external-D9eq1UnF.cjs"),Kr=require("./external-DUeGQ4si.cjs"),Qr=require("./external-BK0QWtit.cjs"),eo=require("./Video-D382cbrn.cjs"),Ss=({variant:e,...t})=>r.jsxRuntimeExports.jsx(u.bt.Circle,{color:u.variantColors[e],...t}),to=({status:{key:e,time:t,count:s,message:n,description:o,variant:i},silence:c,actions:a,className:d,children:p,...m})=>r.jsxRuntimeExports.jsxs(z.Space,{className:l.CSS(l.CSS.B("notification"),d),direction:"y",empty:!0,...m,children:[r.jsxRuntimeExports.jsxs(z.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[r.jsxRuntimeExports.jsxs(z.Space,{direction:"x",align:"center",size:"small",children:[r.jsxRuntimeExports.jsx(Ss,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),r.jsxRuntimeExports.jsx(u.Text,{level:"small",shade:7,children:`x${s}`}),r.jsxRuntimeExports.jsx(u.DateTime,{className:l.CSS(l.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),r.jsxRuntimeExports.jsx(u.Icon,{className:l.CSS(l.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>c(e),children:r.jsxRuntimeExports.jsx(u.bt.Close,{})})]}),r.jsxRuntimeExports.jsxs(z.Space,{direction:"y",align:"start",className:l.CSS(l.CSS.BE("notification","content")),size:"small",children:[p??r.jsxRuntimeExports.jsx(u.Text,{className:l.CSS(l.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:n}),o!=null&&r.jsxRuntimeExports.jsx(u.Text,{className:l.CSS(l.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),a!=null&&r.jsxRuntimeExports.jsx(z.Space,{direction:"x",align:"center",justify:"end",className:l.CSS(l.CSS.BE("notification","actions")),children:k.A(a).map(j=>r.jsxRuntimeExports.jsx(so,{action:j},j.key))})]},t.toString()),so=({action:e})=>{if(!x.isValidElement(e)){const t=e;return r.jsxRuntimeExports.jsx(u.Button,{...t})}return e},no=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:u.Aggregator,Circle:Ss,Notification:to,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"})),ro=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"})),Ye=e=>e.preventDefault(),et=x.forwardRef(({location:e,style:t,size:s,className:n,children:o,onDragStart:i,sizeUnits:c="px",showHandle:a=!0,...d},p)=>{const m=l.J.construct(e),j=l.J.direction(m),h=l.g.dimension(j);return r.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("resize"),l.CSS.loc(m),l.CSS.dir(j),n),style:{[h]:`${s}${c}`,...t},ref:p,...d,children:[o,a&&r.jsxRuntimeExports.jsx("div",{draggable:!0,className:l.CSS(l.CSS.BE("resize","handle"),l.CSS.bordered(l.J.swap(m))),onDragStart:i,onDrag:Ye,onDragEnd:Ye})]})});et.displayName="Resize.Core";const Tt=({onResize:e,count:t,initialSizes:s=[],minSize:n=100,direction:o="x"})=>{const i=x.useRef(null),[c,a]=x.useState({sizeDistribution:oo(s,t),root:null}),d=x.useCallback((j,h,g)=>{if(i.current==null)return;const S=l.To.dim(l.To.construct(i.current),o);a(b=>xt(b,S,j,n,h,g))},[n,a,o]);x.useEffect(()=>e==null?void 0:e(c.sizeDistribution),[c.sizeDistribution,e]);const p=x.useCallback((j,h)=>{j.preventDefault();const g=o==="x"?"clientX":"clientY",S=v=>d(h,v[g]),b=()=>{a(v=>({...v,root:null})),document.removeEventListener("mousemove",S)};a(v=>({...v,root:j[g]})),document.addEventListener("mousemove",S),document.addEventListener("mouseup",b,{once:!0})},[a,o,xt]);return{setSize:x.useCallback((j,h)=>d(j,void 0,h),[xt]),props:{direction:o,sizeDistribution:c.sizeDistribution,onDragHandle:p,ref:i}}},tt=x.forwardRef(({direction:e="x",children:t,sizeDistribution:s,onDragHandle:n,className:o,...i},c)=>{const a=l.g.construct(e),d=x.Children.toArray(t);return s=lo(s),r.jsxRuntimeExports.jsx(z.Space,{...i,ref:c,direction:a,className:l.CSS(l.CSS.B("resize-multiple"),o),empty:!0,grow:!0,children:d.map((p,m)=>r.jsxRuntimeExports.jsx(et,{onDragStart:j=>n(j,m),location:l.g.location(a),size:s[m]*100,sizeUnits:"%",showHandle:m!==d.length-1,children:p},m))})});tt.displayName="Resize.Multiple";const oo=(e,t)=>{const s=e.reduce((o,i)=>o+i,0),n=t-e.length;if(n<=0)return e.slice(0,t).map(o=>o/s);if(e.every(o=>o<=1)){const o=1-s;return[...e,...Array(n).fill(o/n)]}return e.map(()=>1/t)},ut=.001,lo=e=>e.every(t=>l.L.closeTo(t,1/e.length),ut)?e.map((t,s)=>s%2===0?t+ut:s===e.length-1?t:t-ut):e,xt=(e,t,s,n,o,i)=>{const c=Es(e,t,s,o,i),[a,d]=io(e.sizeDistribution,s,c,n/t),p=d?o??null:e.root;return{...e,sizeDistribution:a,root:p}},Es=(e,t,s,n,o)=>{let i;if(o!=null)o>1&&(o=o/t),i=o-e.sizeDistribution[s];else if(n!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(n-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},io=(e,t,s,n)=>{let o=t;for(;o>0&&e[o]+s<=n;)o--;const i=e[o]+s,c=co(o,e,n,s),a=e[c]-s;return i<n||a<n?[e,!1]:[e.map((d,p)=>p===o?i:p===c?a:d),!0]},co=(e,t,s,n)=>(e===t.length-1?uo:ao)(e,t,s,n),ao=(e,t,s,n)=>{let o=e+1;for(;o<t.length-1&&t[o]-n<=s;)o++;return o},uo=(e,t,s,n)=>{let o=e-1;for(;o>0&&t[o]-n<=s;)o--;return o},st=({onMove:e,onStart:t,onEnd:s})=>x.useCallback(n=>{n.preventDefault();const o=l.q.construct(n),i=u.mouseKey(n.button);t==null||t(o,i,n);const c=d=>{if(d.buttons===0)return a(d);const p=l.q.construct(d);e==null||e(l.To.construct(o,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(o,p),i,d)};window.addEventListener("mouseup",a,{once:!0})},[e,t,s]),dt=2,Rs=({onCollapse:e,onResize:t,location:s="left",minSize:n=100,maxSize:o=1/0,initialSize:i=200,collapseThreshold:c=1/0,className:a,...d})=>{const[p,m]=x.useState(l.Y(i,n,o)),j=x.useRef(null),h=l.J.construct(s),g=x.useCallback(C=>{if(j.current===null)return 0;const R=l.To.dim(C,l.J.direction(h),!0)*(1-2*Number(["bottom","right"].includes(h))),y=j.current+R,M=l.Y(y,n,o);return(M-y)/n>c?dt:M},[h,n,o,c]),S=x.useRef(null),b=x.useCallback(C=>{const R=g(C);m(R),S.current!=null&&(t==null||t(R,l.To.construct(S.current)))},[t,g]),v=x.useCallback(()=>m(C=>(j.current=C,C)),[m]),w=x.useCallback(C=>g(C)===dt&&(e==null?void 0:e()),[e,g]);x.useEffect(()=>m(C=>{const R=l.Y(C,n,o);return j.current=R,R}),[n,o]);const E=st({onMove:b,onStart:v,onEnd:w});return r.jsxRuntimeExports.jsx(et,{ref:S,location:h,size:p,onDragStart:E,className:l.clsx(a,l.CSS.expanded(p!==dt)),...d})},xo=Object.freeze(Object.defineProperty({__proto__:null,Core:et,Multiple:tt,Single:Rs,calculateDiffPercentage:Es,useMultiple:Tt},Symbol.toStringTag,{value:"Module"})),Ze="y",Jt=28,po=32,mo=40,fo=.5,jo=({data:e,...t})=>{const{setSize:s,props:{sizeDistribution:n,ref:o,...i}}=Tt({direction:Ze,count:e.length,minSize:Jt}),c=a=>{if(o.current==null)return;const d=l.To.dim(l.To.construct(o.current),Ze);n[a]<mo/d?s(a,e[a].initialSize??fo):s(a,Jt+1)};return r.jsxRuntimeExports.jsx(tt,{empty:!0,className:l.CSS.B("accordion"),sizeDistribution:n,ref:o,...t,...i,children:e.map((a,d)=>x.createElement(So,{...a,key:a.key,index:d,direction:Ze,onExpand:c,parent:o,size:n[d]}))})},ho=r.jsxRuntimeExports.jsx(u.bt.Caret.Down,{"aria-label":"contract"}),go=r.jsxRuntimeExports.jsx(u.bt.Caret.Right,{"aria-label":"expand"}),So=({index:e,name:t,content:s,actions:n,size:o,parent:i,onExpand:c})=>{let a=!0;if(i.current!=null){const p=l.To.dim(l.To.construct(i.current),Ze);a=o*p>po}const d=a?ho:go;return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs(Ie.Header,{level:"p",className:l.CSS.expanded(a),empty:!0,children:[r.jsxRuntimeExports.jsx(Ie.ButtonTitle,{startIcon:d,onClick:()=>c(e),children:t}),n!=null&&r.jsxRuntimeExports.jsx(Ie.Actions,{children:n})]}),s]})},Eo=Object.freeze(Object.defineProperty({__proto__:null,Accordion:jo},Symbol.toStringTag,{value:"Module"})),kt=x.createContext(f.ZERO_CONTEXT_VALUE),ye=()=>x.useContext(kt).synnax,Ro=()=>x.useContext(kt).state,Kt={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Cs=u.wrap$1(f.Provider.TYPE,({aetherKey:e,connParams:t,children:s})=>{const[n,o,i]=u.useCombinedStateAndRef(f.ZERO_CONTEXT_VALUE),[{path:c},,a]=u.use$3({aetherKey:e,type:f.Provider.TYPE,schema:f.Provider.stateZ,initialState:{props:t??null,state:null}}),d=u.useAggregator(),p=x.useCallback(m=>{i.current.state.status!==m.status&&d({variant:Kt[m.status],message:m.message??l.he.capitalize(m.status)}),o(j=>({...j,state:m}))},[d]);return u.useAsyncEffect(async()=>{if(n.synnax!=null&&n.synnax.close(),t==null)return o(f.ZERO_CONTEXT_VALUE);const m=new k.qd({...t,connectivityPollFrequency:k.A$1.seconds(5)});o({synnax:m,state:{clusterKey:"",status:"connecting",message:"Connecting..."}});const j=await m.connectivity.check();return o({synnax:m,state:j}),d({variant:Kt[j.status],message:j.message??j.status.toUpperCase()}),m.connectivity.onChange(p),a({props:t,state:j}),()=>{m.close(),o(f.ZERO_CONTEXT_VALUE),a({props:null,state:null})}},[t,p]),r.jsxRuntimeExports.jsx(kt.Provider,{value:n,children:r.jsxRuntimeExports.jsx(u.Composite,{path:c,children:s})})}),Co=Object.freeze(Object.defineProperty({__proto__:null,Provider:Cs,use:ye,useConnectionState:Ro},Symbol.toStringTag,{value:"Module"})),ve=x.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),bs=()=>x.useContext(ve),ys=e=>{const{aliases:t}=x.useContext(ve);return t[e]??null},nt=()=>{const{aliases:e}=x.useContext(ve);return e},Pt=(e,t="")=>{const{getName:s}=x.useContext(ve),[n,o]=x.useState(t);return u.useAsyncEffect(async()=>{const i=await s(e);i!=null&&o(i)},[e,s]),n},Lt=()=>{const{activeRange:e}=x.useContext(ve);return e??void 0},vs=({activeRange:e,children:t})=>{const s=ye(),[n,o]=x.useState({}),i=x.useCallback(d=>{o(p=>{const m={...p};return d.forEach(({variant:j,key:h,value:g})=>{const S=Number(h.split("---")[1]);j==="delete"?delete m[S]:m[g.channel]=g.alias}),m})},[o]),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=n[d];return p??(await s.channels.retrieve(d)).name},[n,s]);return u.useAsyncEffect(async()=>{if(s==null||e==null){o({});return}const d=await s.ranges.retrieve(e),p=await d.listAliases();o(p);const m=await d.openAliasTracker(),j=m.onChange(i);return()=>{j(),m.close()}},[s,e]),r.jsxRuntimeExports.jsx(ve.Provider,{value:{aliases:n,activeRange:e,setAlias:e!=null?c:null,getName:a},children:t})},bo=({channelKey:e,value:t,shadow:s,className:n,...o})=>{const[i,c]=x.useState(!1),{setAlias:a}=bs(),d=ys(e),p=Pt(e);let m=r.jsxRuntimeExports.jsx(u.bt.Rename,{});i?m=r.jsxRuntimeExports.jsx(u.bt.Loading,{}):d===t&&(m=r.jsxRuntimeExports.jsx(u.bt.Check,{}));const j=a!=null&&!i&&d!==t&&e!==0,h=()=>{j&&(async()=>(c(!0),await a(e,t),c(!1)))()},g=()=>{var b;d!=null&&((b=o.onChange)==null||b.call(o,d))},S=()=>e===0?r.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):a==null?r.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?r.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):d===t?r.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Alias synced with this label"}):r.jsxRuntimeExports.jsxs(u.Text,{level:"small",children:["Sync alias for ",p," with this label"]});return r.jsxRuntimeExports.jsxs(u.Text$1,{value:t,...o,children:[j&&r.jsxRuntimeExports.jsx(u.Icon,{onClick:g,tooltip:r.jsxRuntimeExports.jsxs(u.Text,{level:"small",children:["Set ",p," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:r.jsxRuntimeExports.jsx(u.bt.Sync,{})}),r.jsxRuntimeExports.jsx(u.Icon,{onClick:h,disabled:!j,tooltip:r.jsxRuntimeExports.jsx(S,{}),tooltipLocation:{y:"top"},variant:"outlined",children:m})]})},oe="channel",yo=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:f.AcquireChannelControl,AuthoritySource:f.AuthoritySource,Chip:f.Chip,Controller:f.Controller$1,Indicator:f.Indicator,Legend:f.Legend,REGISTRY:f.REGISTRY$11,STATUSES:f.STATUSES,SetChannelValue:f.SetChannelValue,StateProvider:f.StateProvider,acquireChannelControl:f.acquireChannelControl,acquireChannelControlPropsZ:f.acquireChannelControlPropsZ,authoritySource:f.authoritySource,authoritySourceProps:f.authoritySourceProps,chipStateZ:f.chipStateZ,controllerStateZ:f.controllerStateZ,indicatorStateZ:f.indicatorStateZ,legendStateZ:f.legendStateZ,setChannelValue:f.setChannelValue,setChannelValuePropsZ:f.setChannelValuePropsZ,stateProviderStateZ:f.stateProviderStateZ,statusZ:f.statusZ,sugaredStateZ:f.sugaredStateZ},Symbol.toStringTag,{value:"Module"}));var ne;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ne||(ne={}));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 wo({color:e,radius:t}){return x.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const To={[ne.Dots]:"#91919a",[ne.Lines]:"#eee",[ne.Cross]:"#e2e2e2"},ko={[ne.Dots]:1,[ne.Lines]:1,[ne.Cross]:6},Po=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ws({id:e,variant:t=ne.Dots,gap:s=20,size:n,lineWidth:o=1,offset:i=2,color:c,style:a,className:d}){const p=x.useRef(null),{transform:m,patternId:j}=f.useStore(Po,f.shallow$1),h=c||To[t],g=n||ko[t],S=t===ne.Dots,b=t===ne.Cross,v=Array.isArray(s)?s:[s,s],w=[v[0]*m[2]||1,v[1]*m[2]||1],E=g*m[2],C=b?[E,E]:w,R=S?[E/i,E/i]:[C[0]/i,C[1]/i];return x.createElement("svg",{className:f.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:j+e,x:m[0]%w[0],y:m[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`},S?x.createElement(wo,{color:h,radius:E/i}):x.createElement(vo,{dimensions:C,color:h,lineWidth:o})),x.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${j+e})`}))}ws.displayName="Background";var Lo=x.memo(ws);const Mo={region:l.To.ZERO,dpr:1,os:k.w$1.getOS()},$o={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},No=u.wrap$1(f.Canvas.TYPE,({children:e,resizeDebounce:t=100,aetherKey:s,className:n,...o})=>{const[{path:i},{bootstrapped:c,dpr:a},d]=u.use$3({aetherKey:s,type:f.Canvas.TYPE,schema:f.canvasStateZ,initialState:Mo}),p=x.useRef({...$o}),m=x.useCallback(g=>{p.current.bootstrapped&&d(()=>({bootstrapped:!0,region:g,dpr:window.devicePixelRatio,os:k.w$1.getOS({default:"Windows"})}))},[d]),j=u.useResize(m,{debounce:t});x.useEffect(()=>{const g=()=>{window.devicePixelRatio!==a&&d(S=>({...S,dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",g,{once:!0})},[a]);const h=x.useCallback(g=>{if(j(g),g==null)return;g.className.includes("gl")?p.current.gl=g:g.className.includes("upper2d")?p.current.upper2d=g:p.current.lower2d=g;const{gl:S,lower2d:b,upper2d:v,bootstrapped:w}=p.current;if(S==null||b==null||v==null||w)return;p.current.bootstrapped=!0;const E=S.transferControlToOffscreen(),C=v.transferControlToOffscreen(),R=b.transferControlToOffscreen();d({glCanvas:E,upper2dCanvas:C,lower2dCanvas:R,bootstrap:!0,bootstrapped:!1,region:l.To.construct(S),dpr:window.devicePixelRatio,os:k.w$1.getOS({default:"Windows"})},[E,C,R])},[d]);return r.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("canvas-container"),n),...o,children:[r.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","lower2d"))}),r.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","gl"))}),r.jsxRuntimeExports.jsx("canvas",{ref:h,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","upper2d"))}),r.jsxRuntimeExports.jsx(u.Composite,{path:i,children:c&&e})]})}),Mt=(e,t)=>u.useResize(x.useCallback((s,n)=>{const o=document.querySelector(".pluto-canvas--lower2d");o!=null&&e(l.k.XY.translate(l.q.scale(l.To.topLeft(o),-1)).box(s),n)},[e]),t),_o=Object.freeze(Object.defineProperty({__proto__:null,Canvas:No,useRegion:Mt},Symbol.toStringTag,{value:"Module"})),Ts=x.createContext(null),pe=e=>{const t=x.useContext(Ts);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},ks=e=>{const t=pe("Viewport"),{addViewportHandler:s}=t;x.useEffect(()=>s(e),[s,e])},rt=(e,t)=>{const{setGridEntry:s,removeGridEntry:n}=pe(t),{key:o}=e;return u.useEffectCompare(()=>{l.J.outer.parse(e.loc),s(e)},([a],[d])=>k.m$1.equal(a,d),[e]),x.useEffect(()=>()=>n(o),[]),{gridArea:l.g.swap(l.J.direction(e.loc))==="x"?`axis-start-${o} / plot-start / axis-end-${o} / plot-end`:`plot-start / axis-start-${o} / plot-end / axis-end-${o}`}},Ps=u.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:s=0,clearOverScan:n=l.q.ZERO,children:o,hold:i=!1,onHold:c,...a})=>{const[d,p]=x.useState([]),m=u.useMemoDeepEqualProps({clearOverScan:n,hold:i}),[{path:j},{grid:h},g]=u.use$3({aetherKey:e,type:f.LinePlot.TYPE,schema:f.linePlotStateZ,initialState:{container:l.To.ZERO,viewport:l.To.DECIMAL,grid:{},...m}});x.useEffect(()=>g(T=>({...T,...m})),[m]);const S=x.useRef(new Map),b=x.useCallback(T=>(S.current.set(T,null),()=>S.current.delete(T)),[S]),v=x.useCallback(T=>{const{mode:N,box:P,stage:_}=T;(N==="pan"&&_!=="start"||N==="zoom"||N==="zoomReset"&&_==="start")&&g(A=>({...A,viewport:P})),S.current.forEach((A,I)=>I(T))},[g]),w=x.useCallback(T=>g(N=>({...N,container:T})),[g]),E=Mt(w,{debounce:s}),C=x.useCallback(T=>g(N=>({...N,grid:{...N.grid,[T.key]:T}})),[g]),R=x.useCallback(T=>g(N=>{const{[T]:P,..._}=N.grid;return{...N,grid:_}}),[g]),y=x.useCallback(T=>{p(N=>[...N.filter(({key:P})=>P!==T.key),T])},[p,v]),M=x.useCallback(T=>p(N=>N.filter(({key:P})=>P!==T)),[y]),B=x.useMemo(()=>Oo(h),[h]),L=x.useCallback(T=>{g(N=>({...N,hold:T})),c==null||c(T)},[g,c]),$=x.useMemo(()=>({lines:d,setGridEntry:C,removeGridEntry:R,setLine:y,removeLine:M,setViewport:v,addViewportHandler:b,setHold:L}),[d,C,R,y,M,v,b,L]);return r.jsxRuntimeExports.jsx("div",{className:l.CSS.B("line-plot"),style:{...t,...B},ref:E,...a,children:r.jsxRuntimeExports.jsx(Ts.Provider,{value:$,children:r.jsxRuntimeExports.jsx(u.Composite,{path:j,children:o})})})}),Oo=e=>{const t=l.CSS.newGridBuilder();return f.filterGridEntries("top",e).forEach(({key:s,size:n})=>t.row(`axis-start-${s}`,`axis-end-${s}`,n)),t.row("plot-start","plot-end","minmax(0, 1fr)"),f.filterGridEntries("bottom",e).forEach(({key:s,size:n})=>t.row(`axis-start-${s}`,`axis-end-${s}`,n)),f.filterGridEntries("left",e).forEach(({key:s,size:n})=>t.col(`axis-start-${s}`,`axis-end-${s}`,n)),t.col("plot-start","plot-end","minmax(0, 1fr)"),f.filterGridEntries("right",e).forEach(({key:s,size:n})=>t.col(`axis-start-${s}`,`axis-end-${s}`,n)),t.build()},$t=e=>{const t=e==="x"?"bottom":"left",s=e==="x"?f.XAxis.TYPE:f.YAxis.TYPE,n=`${e}-axis`;return u.wrap$1(s,({aetherKey:o,children:i,location:c=t,label:a="",labelLevel:d="small",labelDirection:p=e,onLabelChange:m,color:j,labelSize:h,showGrid:g,type:S,bounds:b,className:v,tickSpacing:w,autoBounds:E,autoBoundUpdateInterval:C,onAutoBoundsChange:R,style:y,...M})=>{const B=((a==null?void 0:a.length)??0)>0,L=u.useMemoDeepEqualProps({location:c,showGrid:g,type:S,bounds:b,label:a,labelDirection:p,tickSpacing:w,autoBounds:E,autoBoundUpdateInterval:C}),[{path:$},{size:T,labelSize:N,...P},_]=u.use$3({aetherKey:o,type:s,schema:f.coreAxisStateZ,initialState:L});x.useEffect(()=>_(W=>({...W,...L})),[L]),x.useEffect(()=>{const{lower:W,upper:H}=f.parseAutoBounds(P.autoBounds);P.bounds!=null&&(W&&(b==null?void 0:b.lower)!==P.bounds.lower||H&&(b==null?void 0:b.upper)!==P.bounds.upper)&&(R==null||R(P.bounds))},[P.autoBounds,P.bounds]);const A=rt({loc:c,key:`${s}-${o}`,size:T+N,order:"last"},"XAxis"),I=u.useTypography(d).toString(),Z=x.useRef(0);return x.useEffect(()=>{if(e==="y"){if(a==null)return;let H=k.dimensions(a,I)[l.g.dimension(l.g.construct(p))];H>0&&(H+=6),_(Me=>({...Me,labelSize:H}))}else{const H=k.dimensions(a,I).height+12,Me=Z.current;f.withinSizeThreshold(Me,H)||(Z.current=H,_(at=>({...at,labelSize:H})))}},[a,p,I]),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(z.Space,{className:l.CSS(v,l.CSS.B("axis"),l.CSS.B(n),l.CSS.loc(c)),style:{...y,...A},align:"center",justify:e==="x"?"end":"start",direction:l.g.swap(e),...M,children:B&&r.jsxRuntimeExports.jsx(u.MaybeEditable,{className:l.CSS(l.CSS.BE("axis","label"),l.CSS.dir(p)),value:a,onChange:m,level:d})}),r.jsxRuntimeExports.jsx(u.Composite,{path:$,children:i})]})})},Ls=$t("x"),Ms=$t("y"),$s=l.q.xy.extend({root:l.J.corner,units:ee.z.object({x:ee.z.enum(["px","decimal"]),y:ee.z.enum(["px","decimal"])})}),Bo=$s.partial({root:!0,units:!0}),zo=e=>{var s,n,o,i;const t={};return t[((s=e.root)==null?void 0:s.x)??"left"]=((n=e==null?void 0:e.units)==null?void 0:n.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((o=e.root)==null?void 0:o.y)??"top"]=((i=e==null?void 0:e.units)==null?void 0:i.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},Do=(e,t)=>{var i,c,a,d,p,m;const s={x:e.x,y:e.y};if(t.current==null)return s;const n=l.To.construct(t.current),o=l.To.construct(t.current.parentElement);return((i=e.units)==null?void 0:i.x)==="decimal"?((c=e.root)==null?void 0:c.x)==="right"&&(s.x=1-e.x):((a=e.root)==null?void 0:a.x)==="right"?s.x=1-(e.x+l.To.width(n))/l.To.width(o):s.x/=l.To.width(o),((d=e.units)==null?void 0:d.y)==="decimal"?((p=e.root)==null?void 0:p.y)==="bottom"&&(s.y=1-e.y):((m=e.root)==null?void 0:m.y)==="bottom"?s.y=1-(e.y+l.To.height(n))/l.To.height(o):s.y/=l.To.height(o),s},Ns=(e,t)=>{if(t.current==null)return null;const s=l.To.construct(t.current.parentElement),n=l.To.construct(t.current),o={x:e.x,y:e.y,root:{...l.J.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(o.x=(1-e.x)*l.To.width(s)-l.To.width(n),o.root.x="right"):e.x<.2?o.x=e.x*l.To.width(s):o.units.x="decimal",e.y>.8?(o.y=(1-e.y)*l.To.height(s)-l.To.height(n),o.root.y="bottom"):e.y<.2?o.y=e.y*l.To.height(s):o.units.y="decimal",o.x=Math.round(o.x*100)/100,{...o,...l.q.truncate(o,3)}},Qt=l.To.reRoot(l.To.DECIMAL,l.J.TOP_LEFT),Nt=x.memo(({className:e,value:t,onChange:s,style:n,draggable:o=!0,...i})=>{const[c,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(c),p=u.useSyncedRef(o===!1),m=x.useRef(null);c!==null&&(n={...n,...zo(c)});const j=x.useCallback(g=>{var R;if(((R=m.current)==null?void 0:R.parentElement)==null)return d.current;const S=l.To.construct(m.current.parentElement),b=l.k.XY.scale(S).scale(Qt),v=b.box(l.To.construct(m.current)),w=l.k.XY.clamp(l.To.construct(l.To.topLeft(Qt),{width:1-l.To.width(v),height:1-l.To.height(v)})),E=l.q.translate(l.q.construct(d.current),l.To.signedDims(b.box(g))),C=w.pos(E);return Ns(C,m)},[]),h=st({onStart:x.useCallback(()=>{d.current=Do(d.current,m)},[]),onMove:x.useCallback(g=>{if(p.current)return;const S=j(g);S!==null&&a(S)},[]),onEnd:x.useCallback(g=>{if(p.current)return;const S=j(g);S!==null&&(d.current=S)},[])});return r.jsxRuntimeExports.jsx(z.Space,{className:l.CSS(e,l.CSS.B("legend")),bordered:!0,rounded:!0,style:n,onDragStart:h,draggable:o,ref:m,...i,onDrag:Ye,onDragEnd:Ye,empty:!0})});Nt.displayName="Legend.Container";const _t=({data:e=[],onEntryChange:t,position:s,onPositionChange:n,...o})=>{const[i,c]=x.useState(!1);return e.length===0?null:r.jsxRuntimeExports.jsx(Nt,{...o,draggable:!i,value:s,onChange:n,children:e.sort((a,d)=>a.label.localeCompare(d.label)).map(({key:a,color:d,label:p})=>r.jsxRuntimeExports.jsxs(z.Space,{style:{cursor:"pointer"},direction:"x",align:"center",children:[r.jsxRuntimeExports.jsx(yt.Swatch,{value:d,onChange:m=>t==null?void 0:t({key:a,color:m,label:p}),onVisibleChange:c,draggable:!1,size:"small"}),r.jsxRuntimeExports.jsx(u.MaybeEditable,{level:"small",value:p,onChange:m=>t==null?void 0:t({key:a,color:d,label:m}),noWrap:!0})]},a))})},Ao=Object.freeze(Object.defineProperty({__proto__:null,Container:Nt,Simple:_t,calcStickyPos:Ns,completeStickyXYz:$s,stickyXYz:Bo},Symbol.toStringTag,{value:"Module"})),_s=({className:e,style:t,onLineChange:s,...n})=>{const{lines:o}=pe("Legend");return pe("Legend"),r.jsxRuntimeExports.jsx(_t,{data:o,onEntryChange:s,...n})},Os=u.wrap$1("Line",({aetherKey:e,...t})=>{const[,,s]=u.use$3({aetherKey:e,type:f.Line.TYPE,schema:f.stateZ,initialState:t}),n=u.useMemoDeepEqualProps(t);return x.useLayoutEffect(()=>s(n),[n]),null}),Vo=Object.freeze(Object.defineProperty({__proto__:null,Line:Os},Symbol.toStringTag,{value:"Module"})),Ot=u.wrap$1("Line",({aetherKey:e,color:t,label:s="",...n})=>{const{setLine:o,removeLine:i}=pe("Line");return x.useEffect(()=>(o({key:e,color:t,label:s}),()=>i(e)),[s,t]),r.jsxRuntimeExports.jsx(Os,{aetherKey:e,color:t,label:s,...n})}),Bs=({level:e="h2",...t})=>{const s=u.useUniqueKey(),n=u.useTypography(e),o=rt({key:s,size:(n.lineHeight+2)*n.baseSize,loc:"top",order:"first"},"Title");return r.jsxRuntimeExports.jsx(z.Space,{justify:"center",align:"center",style:o,children:r.jsxRuntimeExports.jsx(u.MaybeEditable,{...t,level:e})})},zs=u.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=u.use$3({aetherKey:e,type:f.Tooltip.TYPE,schema:f.tooltipStateZ,initialState:{position:null}}),s=x.useRef(null),n=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]),o=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",n),i.addEventListener("mouseleave",o),()=>{i.removeEventListener("mousemove",n),i.removeEventListener("mouseleave",o)}},[n]),r.jsxRuntimeExports.jsx("span",{ref:s})}),Io=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:zs},Symbol.toStringTag,{value:"Module"})),Zo={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Bt=x.forwardRef(({className:e,mode:t,maskBox:s,children:n,style:o,...i},c)=>r.jsxRuntimeExports.jsxs("div",{ref:c,className:l.CSS(l.CSS.noSelect,l.CSS.BE("viewport-mask","container"),e),style:{cursor:Zo[t],...o},...i,children:[r.jsxRuntimeExports.jsx("div",{style:{...l.To.css(s),display:l.To.areaIsZero(s)?"none":"block"},className:l.CSS.BE("viewport-mask","selection")}),n]}));Bt.displayName="ZoomPanMask";const Fo=k.g.ALL.filter(e=>e!==k.g.UNKNOWN).map(e=>({key:e.toString(),name:l.he.capitalize(e.toString())})),qo=[{key:"name",name:"Name"}],Yo=e=>r.jsxRuntimeExports.jsx(se.DropdownButton,{...e,data:Fo,columns:qo,entryRenderKey:"name"}),Go=[{key:"x",icon:r.jsxRuntimeExports.jsx(u.bt.Arrow.Right,{})},{key:"y",icon:r.jsxRuntimeExports.jsx(u.bt.Arrow.Down,{})}],Ho=({key:e,entry:t,onClick:s,selected:n})=>r.jsxRuntimeExports.jsx(u.Icon,{variant:n?"filled":"outlined",onClick:s,children:t.icon},e),Uo=({children:e=Ho,...t})=>r.jsxRuntimeExports.jsx(se.Button,{...t,allowMultiple:!1,data:Go,children:e}),Ds=e=>r.jsxRuntimeExports.jsx(u.Icon,{className:l.CSS.BE("select","clear"),variant:"outlined",...e,children:r.jsxRuntimeExports.jsx(u.bt.Close,{"aria-label":"clear"})}),ot=({onChange:e,value:t,entryRenderKey:s="key",columns:n,data:o,emptyContent:i,inputProps:c,allowNone:a=!0,searcher:d,className:p,variant:m,hideColumnHeader:j=!1,disabled:h,omit:g,children:S,...b})=>{const{visible:v,open:w,close:E}=u.use$1(),[C,R]=x.useState(null),y=d!=null;u.useAsyncEffect(async()=>{if(u.selectValueIsZero(t))return R(null);if((C==null?void 0:C.key)===t)return;let L=null;if(y)try{[L]=await d.retrieve([t])}finally{L??(L=null)}else o!=null&&(L=o.find($=>$.key===t)??null);R(L)},[d,t,o]);const M=x.useCallback((L,$)=>{Array.isArray(L)||(R(L==null?null:$.entries[0]),E(),e(L,$))},[e,a]),B=x.useMemo(()=>y?u.Search:be.Filter,[y]);return r.jsxRuntimeExports.jsx(se.Core,{close:E,open:w,data:o,omit:g,emptyContent:i,allowMultiple:!1,visible:v,value:t,hideColumnHeader:j,onChange:M,allowNone:a,columns:n,listItem:S,...b,children:r.jsxRuntimeExports.jsx(B,{searcher:d,children:({onChange:L})=>r.jsxRuntimeExports.jsx(Wo,{variant:m,onChange:L,onFocus:w,selected:C,entryRenderKey:s,visible:v,allowNone:a,className:p,disabled:h})})})},zt="Select",Wo=({entryRenderKey:e,selected:t,visible:s,onChange:n,onFocus:o,allowNone:i=!0,placeholder:c=zt,className:a,disabled:d,...p})=>{const{clear:m}=u.useSelectionUtils(),[j,h]=x.useState("");x.useEffect(()=>{if(!s){if(k.S(t==null?void 0:t.key))return h("");if(t!=null)return h(typeof e=="function"?e(t).toString():(t==null?void 0:t[e]).toString())}},[t,s,e]);const g=w=>{n(w),h(w)},S=()=>{h(""),o==null||o()},b=w=>{s||(w.preventDefault(),o==null||o())},v=()=>{h(""),m==null||m()};return r.jsxRuntimeExports.jsx(u.Text$1,{className:l.CSS(l.CSS.BE("select","input"),a),value:j,onChange:g,onFocus:S,onKeyDown:u.matchCallback([["Enter"]],w=>{w.preventDefault(),!s&&(o==null||o())}),style:{flexGrow:1},onClick:b,placeholder:c,disabled:d,...p,children:i&&r.jsxRuntimeExports.jsx(Ds,{onClick:v,disabled:d})})},Ge=({children:e="",size:t="medium",color:s,icon:n,onClose:o,className:i,onDragStart:c,...a})=>{const d=l.cssString(s);n==null&&s!=null&&(n=r.jsxRuntimeExports.jsx(u.bt.Circle,{fill:d}));const p=o==null?void 0:r.jsxRuntimeExports.jsx(u.Icon,{"aria-label":"close",size:t,className:l.CSS.BE("tag","close"),onClick:m=>{m.stopPropagation(),o()},children:r.jsxRuntimeExports.jsx(u.bt.Close,{})});return r.jsxRuntimeExports.jsx(u.WithIcon,{startIcon:n,endIcon:p,className:l.CSS(i,l.CSS.B("tag"),o!=null&&l.CSS.BM("tag","closeable")),level:k.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:c,...a,children:e})},Xo=Object.freeze(Object.defineProperty({__proto__:null,Tag:Ge},Symbol.toStringTag,{value:"Module"})),lt=({onChange:e,value:t,className:s,data:n,columns:o=[],entryRenderKey:i="key",emptyContent:c,searcher:a,renderTag:d,placeholder:p,onTagDragStart:m,allowMultiple:j,allowNone:h,replaceOnSingle:g,onTagDragEnd:S,style:b,children:v,...w})=>{const{visible:E,open:C,close:R}=u.use$1(),[y,M]=x.useState([]),[B,L]=x.useState(!1),$=a!=null;u.useAsyncEffect(async()=>{L(!0),u.selectValueIsZero(t)&&M([]);const P=y.map(I=>I.key),_=k.A(t);if(k.E.unorderedPrimitiveArrays(P,_)===k.E.EQUAL)return;let A=[];if($)try{A=await a.retrieve(_)}finally{L(!1)}else n!=null&&(A=n.filter(I=>_.includes(I.key)));M(A)},[a,$,t,n]);const T=x.useCallback((P,_)=>{P!=null&&(M(_.entries),e(k.A(P),_))},[e]),N=x.useMemo(()=>$?u.Search:be.Filter,[$]);return r.jsxRuntimeExports.jsx(se.Core,{close:R,open:C,data:n,emptyContent:c,visible:E,value:t,onChange:T,allowNone:h,replaceOnSingle:g,columns:o,allowMultiple:!0,listItem:v,...w,children:r.jsxRuntimeExports.jsx(N,{searcher:a,children:({onChange:P,value:_})=>r.jsxRuntimeExports.jsx(Jo,{value:_,selectedKeys:t,className:s,onChange:P,loading:B,selected:y,onFocus:C,entryRenderKey:i,visible:E,renderTag:d,placeholder:p,onTagDragStart:m,onTagDragEnd:S,style:b})})})},Jo=({selectedKeys:e,loading:t,selected:s,onChange:n,onFocus:o,visible:i,entryRenderKey:c,renderTag:a=u.componentRenderProp(As),placeholder:d=zt,onTagDragStart:p,onTagDragEnd:m,value:j,className:h,...g})=>{const{onSelect:S,clear:b}=u.useSelectionUtils(),v=x.useRef(null);x.useLayoutEffect(()=>{var R;i&&((R=v.current)==null||R.focus())},[i,s]);const w=()=>{i||n(""),o==null||o()},E=()=>{i||o==null||o()},C=()=>{i||n("")};return r.jsxRuntimeExports.jsxs(u.Text$1,{ref:v,className:l.CSS(l.CSS.BE("select-multiple","input"),l.CSS.visible(i),h),onBlur:C,placeholder:d,value:j,onChange:n,onFocus:w,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:E,...g,children:[r.jsxRuntimeExports.jsx(z.Space,{direction:"x",className:l.CSS.BE("select-multiple","tags"),align:"center",grow:!0,children:k.A(e).map((R,y)=>{const M=s[y];return a({key:R,entryKey:R,entryRenderKey:c,loading:t,entry:M,onClose:()=>S==null?void 0:S(R),onDragStart:B=>p==null?void 0:p(B,R),onDragEnd:B=>m==null?void 0:m(B,R)})})}),r.jsxRuntimeExports.jsx(Ds,{onClick:b})]})},As=({entryKey:e,entryRenderKey:t,entry:s,loading:n,...o})=>{let i=e;return s!=null&&(i=typeof t=="function"?t(s):s[t]),x.createElement(Ge,{size:"small",variant:"outlined",className:l.CSS(s==null&&!n&&l.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...o,key:e.toString()},k.D(i))},Ko=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:se.BaseButton,Button:se.Button,DEFAULT_PLACEHOLDER:zt,DataType:Yo,Direction:Uo,DropdownButton:se.DropdownButton,Multiple:lt,MultipleTag:As,Single:ot,defaultButton:se.defaultButton},Symbol.toStringTag,{value:"Module"})),Fe=6,Qo=2,es=5,el=e=>l.To.width(e)<es&&l.To.height(e)<es,tl=["zoom","pan","select","zoomReset"],_e=[...tl,"click"],sl=ee.z.enum(_e),Vs=["zoom","select"],qe={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},Is={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"]]},Dt={zoom:qe,pan:Is,select:Zs,zoomReset:qe,click:qe},nl=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([s,n])=>s==="defaultMode"?[s,n]:[s,n.map(o=>o.filter(i=>i!=="MouseLeft")).filter(o=>o.length>0)]))},rl=l.To.construct(0,0,1,1,l.J.TOP_LEFT),ol={width:30,height:50},Fs=({onChange:e,triggers:t,initial:s=rl,threshold:n=ol,ref:o})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[c,a]=x.useState(l.To.ZERO),[d,p]=x.useState(i),[m,j]=u.useStateRef(s),h=x.useRef(l.q.ZERO),g=x.useRef(null),S=l._.construct(n);x.useEffect(()=>j(()=>l.To.truncate(s,Fe)),[s]),x.useEffect(()=>p(i),[i]);const[b,v,w,E]=u.useMemoCompare(()=>{const L={...Dt[i],...t},$=u.flattenConfig(L),T=nl(L);return[L,$,T,u.flattenConfig(T)]},u.compareModeConfigs,[t]),C=x.useCallback(({box:L,triggers:$,stage:T,cursor:N})=>{if(g.current==null)return;const P=u.determineMode(b,$),_=l.To.construct(g.current);if(P==null)return;if(P==="zoomReset")return a(l.To.ZERO),e==null||e({box:l.To.DECIMAL,mode:P,stage:T,cursor:N}),j(l.To.DECIMAL);const A=el(L);if(T==="end"){if(A){P==="zoom"&&a(l.To.ZERO),e==null||e({box:m.current,mode:"click",stage:T,cursor:N});return}return j(Z=>{if(P==="pan"){const H=ts(L,Z,_);return H===null||l.To.equals(H,Z)?Z:(e==null||e({box:H,mode:P,stage:T,cursor:N}),H)}const W=R(L,Z,_);return W===null?Z:(e==null||e({box:W,mode:P,stage:T,cursor:N}),P==="zoom"?(a(l.To.ZERO),W):l.To.truncate(Z,Fe))})}if(Vs.includes(P))return A?void 0:a(l.k.XY.scale(_).clamp(_).translate({x:-l.To.left(_),y:-l.To.top(_)}).box(ss(S,L,_)));if(a(Z=>l.To.areaIsZero(Z)?Z:l.To.ZERO),l.q.distance(N,h.current)<Qo)return;h.current=N;const I=ts(L,m.current,_);e==null||e({box:I,mode:P,stage:T,cursor:N})},[a,p,e,b,n.height,n.width,j,g]);x.useImperativeHandle(o,()=>({reset:()=>{a(l.To.ZERO),j(l.To.DECIMAL),e==null||e({box:l.To.DECIMAL,mode:"zoomReset",stage:"start",cursor:l.q.ZERO})}}),[e]);const R=x.useCallback((L,$,T)=>l.To.truncate(ht($,T).box(ss(S,L,T)),Fe),[n]),y=u.useHeldRef({triggers:[["Control"]]}),M=u.useHeldRef({triggers:[["Alt"]]});x.useEffect(()=>{const L=$=>{if(g.current==null)return;let T=1;$.deltaY<0?T-=.035:T+=.035;const N=l.To.construct(g.current),P=l.q.construct($);if(!l.To.contains(N,P)||$.target!==g.current)return;const A=ht(m.current,l.To.construct(g.current)).pos(l.q.construct($));let Z=l.k.XY.magnify({x:y.current.held?1:T,y:M.current.held?1:T}).box(m.current);Z=l.To.translate(Z,{x:y.current.held?0:A.x*(1-T),y:M.current.held?0:A.y*(1-T)}),j(Z),e==null||e({stage:"end",box:Z,cursor:l.q.construct($),mode:"zoom"})};return window.addEventListener("wheel",L),()=>window.removeEventListener("wheel",L)},[j,e]),vt.useDrag({bound:g,onDrag:C,triggers:v,loose:!0});const B=x.useCallback(({triggers:L,stage:$})=>{if($==="end")return p(i);const T=u.determineMode(w,L);T!=null&&p(T)},[w,i,e]);return u.use$2({triggers:E,callback:B,region:g}),{maskBox:c,ref:g,mode:d}},ht=(e,t)=>l.k.XY.scale(t).clamp(t).scale(e),ts=(e,t,s)=>{let n=l.To.signedDims(ht(t,s).box(e));return n={signedWidth:-n.signedWidth,signedHeight:-n.signedHeight},l.To.truncate(l.k.XY.translate(l.q.construct(n)).box(t),Fe)},ss=(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,ll=({mode:e,triggers:t})=>r.jsxRuntimeExports.jsxs(z.Space,{direction:"x",align:"center",children:[r.jsxRuntimeExports.jsx(u.Text,{level:"small",children:l.he.capitalize(e)}),r.jsxRuntimeExports.jsx(vt.Text,{trigger:t[0],level:"small"})]}),il={zoom:r.jsxRuntimeExports.jsx(u.bt.Zoom,{}),pan:r.jsxRuntimeExports.jsx(u.bt.Pan,{}),select:r.jsxRuntimeExports.jsx(u.bt.Selection,{}),zoomReset:r.jsxRuntimeExports.jsx(u.bt.Expand,{}),click:r.jsxRuntimeExports.jsx(u.bt.Bolt,{})},cl=({triggers:e,disable:t=["zoomReset","click"],...s})=>{const n=Object.entries(e).filter(([o])=>!t.includes(o)&&_e.includes(o)).map(([o,i])=>({key:o,icon:il[o],tooltip:r.jsxRuntimeExports.jsx(ll,{mode:o,triggers:i})})).sort((o,i)=>_e.indexOf(o.key)-_e.indexOf(i.key));return r.jsxRuntimeExports.jsx(se.Button,{...s,data:n,entryRenderKey:"icon",children:({title:o,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)})},al=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Dt,MASK_MODES:Vs,MODES:_e,Mask:Bt,PAN_DEFAULT_TRIGGERS:Is,SELECT_DEFAULT_TRIGGERS:Zs,SelectMode:cl,ZOOM_DEFAULT_TRIGGERS:qe,modeZ:sl,use:Fs},Symbol.toStringTag,{value:"Module"})),qs=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,At=x.forwardRef(({children:e,initial:t=l.To.DECIMAL,onChange:s,...n},o)=>{const{setViewport:i}=pe("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=Fs({onChange:c,initial:t,ref:o,...n});return r.jsxRuntimeExports.jsx(Bt,{className:l.CSS.BE("line-plot","viewport"),...a,children:e})});At.displayName="Viewport";const ul=Object.freeze(Object.defineProperty({__proto__:null,Legend:_s,Line:Ot,LinePlot:Ps,Title:Bs,Tooltip:Io,Viewport:At,XAxis:Ls,YAxis:Ms,axisFactory:$t,selectViewportEl:qs,useContext:pe,useGridEntry:rt,useViewport:ks},Symbol.toStringTag,{value:"Module"})),xl=u.wrap$1("Tooltip",({aetherKey:e,...t})=>(u.use$3({aetherKey:e,type:f.Annotation.TYPE,schema:f.annotationStateZ,initialState:t}),null)),Ys=u.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...s})=>{const{setViewport:n,setHold:o}=pe("Range.Provider"),[,{hovered:i,count:c},a]=u.use$3({aetherKey:e,type:f.Provider$1.TYPE,schema:f.providerStateZ,initialState:{...s,cursor:null,hovered:null,count:0}}),d=rt({key:e,loc:"top",size:c>0?32:0,order:"last"},"Annotation.Provider"),p=u.useContextMenu(),m=u.useSyncedRef(p.visible),j=x.useCallback(h=>{const g=b=>{a(v=>({...v,cursor:{x:b.clientX,y:b.clientY}}))},S=h.currentTarget;S.addEventListener("mousemove",g),S.addEventListener("mouseleave",()=>{S.removeEventListener("mousemove",g),m.current||a(b=>({...b,cursor:null}))},{once:!0})},[a]);return r.jsxRuntimeExports.jsx(u.ContextMenu,{style:{...d,cursor:i!=null?"pointer":"default"},...p,menu:()=>t==null||i==null?null:t(i),children:r.jsxRuntimeExports.jsx(z.Space,{style:{width:"100%",height:"100%"},onClick:()=>{i!=null&&(n({box:l.To.construct({x:i.viewport.lower,y:0},{x:i.viewport.upper,y:1}),mode:"zoom",cursor:l.q.ZERO,stage:"start"}),o(!0))},onMouseEnter:j})})}),dl=Object.freeze(Object.defineProperty({__proto__:null,Annotation:xl,Provider:Ys},Symbol.toStringTag,{value:"Module"})),Gs={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},pl=u.flattenConfig(Gs),Hs=u.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=u.use$3({aetherKey:e,type:f.Measure.TYPE,schema:f.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=x.useRef(null),n=u.useHeldRef({triggers:pl,loose:!0}),o=x.useCallback(({mode:a,cursor:d})=>{if(a==="click"){const p=u.determineMode(Gs,n.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,n]);ks(o);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)}},[o]),r.jsxRuntimeExports.jsx("span",{ref:s})}),ml=Object.freeze(Object.defineProperty({__proto__:null,Measure:Hs},Symbol.toStringTag,{value:"Module"})),Vt=u.wrap$1("Rule",({aetherKey:e,label:t,position:s,onLabelChange:n,onPositionChange:o,units:i="",color:c,lineWidth:a,lineDash:d})=>{const[p,m]=k.usePurePassthrough({value:t,onChange:n,initial:""}),[,{position:j,pixelPosition:h},g]=u.use$3({aetherKey:e,type:f.Rule.TYPE,schema:f.ruleStateZ,initialState:{color:c,dragging:!1,position:s,lineWidth:a,lineDash:d}});x.useEffect(()=>{if(j==null)return;if(s==null)return o==null?void 0:o(j);const R=l.C.construct(j+.01,j-.01);s!=null&&!l.C.contains(R,s)&&(o==null||o(Math.trunc(j*100)/100))},[j]);const S=x.useRef(h);h!==S.current&&(S.current=h);const b=x.useRef(h);x.useEffect(()=>{g(R=>({...R,position:s,color:c,lineWidth:a,lineDash:d}))},[s,c,a,d]);const v=st({onStart:x.useCallback(()=>{g(R=>({...R,dragging:!0})),b.current=S.current},[]),onMove:R=>{g(y=>({...y,pixelPosition:(b.current??0)+l.To.signedHeight(R)}))},onEnd:x.useCallback(()=>{g(R=>({...R,dragging:!1})),b.current=h},[])}),w=x.useRef(null);if(j==null||h==null)return null;const E=qs(w==null?void 0:w.current),C=r.jsxRuntimeExports.jsxs("div",{ref:w,className:l.CSS.B("rule"),style:{top:`calc(${h}px - 0.5rem)`},children:[r.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("rule","drag-handle"),onDragStart:v,draggable:!0}),r.jsxRuntimeExports.jsxs(z.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[r.jsxRuntimeExports.jsx(u.Editable,{level:"p",value:p,onChange:m}),r.jsxRuntimeExports.jsx(u.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${j.toFixed(2)} ${i}`})]})]});return E==null?C:wt.createPortal(C,E)}),fl=Object.freeze(Object.defineProperty({__proto__:null,Rule:Vt},Symbol.toStringTag,{value:"Module"})),Us=u.canDropOfType(oe),jl=({lines:e,axes:t,showTitle:s=!0,title:n="",onTitleChange:o,showLegend:i=!0,legendPosition:c,onLegendPositionChange:a,titleLevel:d="h4",onLineChange:p,onRuleChange:m,onAxisChannelDrop:j,onAxisChange:h,rules:g,enableTooltip:S=!0,enableMeasure:b=!1,initialViewport:v=l.To.DECIMAL,onViewportChange:w,viewportTriggers:E,annotationProvider:C,...R})=>{var $;const y=t.filter(({location:T})=>l.J.isY(T)),M=x.useRef(),B=u.usePrevious(e.length),L=u.usePrevious(R.hold);return(B===0&&e.length!==0||L===!0&&R.hold===!1)&&(($=M.current)==null||$.reset()),r.jsxRuntimeExports.jsxs(Ps,{...R,children:[y.map((T,N)=>{const P=e.filter(I=>I.axes.x===T.key),_=t.filter(({location:I})=>l.J.isX(I)),A=g==null?void 0:g.filter(I=>[..._.map(({key:Z})=>Z),T.key].includes(I.axis));return r.jsxRuntimeExports.jsx(hl,{axis:T,index:N,lines:P,yAxes:_,rules:A,onAxisChannelDrop:j,onAxisChange:h,annotationProvider:C},T.key)}),i&&r.jsxRuntimeExports.jsx(_s,{onLineChange:p,position:c,onPositionChange:a}),s&&r.jsxRuntimeExports.jsx(Bs,{value:n,onChange:o,level:d}),r.jsxRuntimeExports.jsxs(At,{initial:v,onChange:w,triggers:E,ref:M,children:[S&&r.jsxRuntimeExports.jsx(zs,{}),b&&r.jsxRuntimeExports.jsx(Hs,{})]})]})},hl=({yAxes:e,lines:t,index:s,rules:n,onRuleChange:o,onAxisChannelDrop:i,onAxisChange:c,axis:{location:a,key:d,showGrid:p,...m},annotationProvider:j})=>{const h=u.useDrop({type:"Channel.LinePlot.XAxis",canDrop:Us,onDrop:x.useCallback(({items:S})=>{const b=u.filterByType(oe,S);return i==null||i(d,b.map(({key:v})=>v)),b},[d,i])}),g=n==null?void 0:n.filter(S=>S.axis===d);return r.jsxRuntimeExports.jsxs(Ls,{...m,...h,location:a,showGrid:p??s===0,className:l.CSS(l.CSS.dropRegion(u.canDropOfType(oe)(u.useDraggingState()))),onAutoBoundsChange:S=>c==null?void 0:c({key:d,bounds:S}),children:[e.map((S,b)=>{const v=t.filter(E=>E.axes.y===S.key),w=n==null?void 0:n.filter(E=>E.axis===S.key);return r.jsxRuntimeExports.jsx(Sl,{axis:{...S,showGrid:p??(s===0&&b===0)},lines:v,rules:w,onRuleChange:o,onAxisChannelDrop:i,onAxisChange:c},S.key)}),g==null?void 0:g.map(S=>x.createElement(Vt,{aetherKey:S.key,...S,key:S.key,onLabelChange:b=>o==null?void 0:o({key:S.key,label:b}),onPositionChange:b=>o==null?void 0:o({key:S.key,position:b})})),r.jsxRuntimeExports.jsx(Ys,{...j})]})},gl=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Sl=({lines:e,rules:t,onRuleChange:s,onAxisChannelDrop:n,onAxisChange:o,axis:{key:i,location:c,...a}})=>{const d=u.useDrop({type:"Channel.LinePlot.YAxis",canDrop:Us,onDrop:x.useCallback(({items:m})=>{const j=u.filterByType(oe,m);return n==null||n(i,j.map(({key:h})=>h)),j},[i,n])}),p=u.useDraggingState();return r.jsxRuntimeExports.jsxs(Ms,{...a,...d,location:c,className:l.CSS(l.CSS.dropRegion(u.canDropOfType(oe)(p))),onAutoBoundsChange:m=>o==null?void 0:o({key:i,bounds:m}),children:[e.map(m=>r.jsxRuntimeExports.jsx(El,{line:m},gl(m))),t==null?void 0:t.map(m=>x.createElement(Vt,{aetherKey:m.key,...m,key:m.key,onLabelChange:j=>s==null?void 0:s({key:m.key,label:j}),onPositionChange:j=>s==null?void 0:s({key:m.key,position:j})}))]})},El=({line:e})=>e.variant==="static"?r.jsxRuntimeExports.jsx(Cl,{line:e}):r.jsxRuntimeExports.jsx(Rl,{line:e}),Rl=({line:{key:e,timeSpan:t,channels:{x:s,y:n},...o}})=>{const i=Number(t.valueOf())*3,c=f.streamChannelData({timeSpan:t,channel:n,keepFor:i}),a=s!=null&&s!==0,d=f.streamChannelData({timeSpan:t,channel:a?s:n,useIndexOfChannel:!a,keepFor:i});return r.jsxRuntimeExports.jsx(Ot,{aetherKey:e,y:c,x:d,...o})},Cl=({line:{timeRange:e,key:t,channels:{x:s,y:n},...o}})=>{const i=f.channelData({timeRange:e,channel:n}),c=s!=null&&s!==0,a=f.channelData({timeRange:e,channel:c?s:n,useIndexOfChannel:!c});return r.jsxRuntimeExports.jsx(Ot,{aetherKey:t,y:i,x:a,...o})},ns=[{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"}],He=({items:e},t)=>{const s=u.filterByType(oe,e);return s.length>0&&!s.every(n=>t.includes(n.key))},Ws=["name","alias"],Xs=e=>{const t=nt();return x.useMemo(()=>e.length===0?ns:ns.filter(s=>e.includes(s.key)),[e,t])},bl=({columns:e=Ws,onChange:t,className:s,value:n,searchOptions:o,...i})=>{const c=ye(),a=nt(),d=Xs(e),p=Lt(),m=u.useMemoDeepEqualProps(o),j=x.useMemo(()=>c==null?void 0:c.channels.newSearcherWithOptions({rangeKey:p,internal:!1,...m}),[c,p,m]),h=c!=null?void 0:r.jsxRuntimeExports.jsx(u.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:g,onDragEnd:S,...b}=u.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:x.useCallback(R=>He(R,k.A(n)),[n]),onDrop:x.useCallback(({items:R})=>{const y=u.filterByType(oe,R);if(y.length===0)return[];const M=k.n([...k.A(n),...y.map(B=>B.key)]);return t(M,{clickedIndex:null,clicked:null,entries:[]}),y},[t,n])}),v=u.useDraggingState(),w=x.useCallback(({dropped:R})=>{t(k.A(n).filter(y=>!R.some(M=>M.key===y)),{clickedIndex:null,clicked:null,entries:[]})},[t,n]),E=x.useCallback((R,y)=>g([{key:y,type:oe}],w),[g,w]),C=x.useCallback(R=>a[R.key]??R.name,[a]);return r.jsxRuntimeExports.jsx(lt,{className:l.CSS(s,l.CSS.dropRegion(He(v,k.A(n)))),value:n,onTagDragStart:E,onTagDragEnd:S,searcher:j,onChange:t,columns:d,emptyContent:h,entryRenderKey:C,...b,...i})},Oe=({columns:e=Ws,onChange:t,value:s,className:n,data:o,searchOptions:i,...c})=>{const a=ye(),d=nt(),p=Xs(e),m=Lt(),j=u.useMemoDeepEqualProps(i),h=x.useMemo(()=>{if(!(o!=null&&o.length>0))return a==null?void 0:a.channels.newSearcherWithOptions({rangeKey:m,internal:!1,...j})},[a,m,o==null?void 0:o.length,j]),g=a!=null?void 0:r.jsxRuntimeExports.jsx(u.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),S=x.useId(),b=x.useMemo(()=>({key:S,type:"Channel.SelectMultiple"}),[S]),{startDrag:v,onDragEnd:w,...E}=u.useDragAndDrop({type:"Channel.SelectSingle",canDrop:x.useCallback(M=>He(M,k.o(s)),[s]),onDrop:x.useCallback(({items:M})=>{const B=u.filterByType(oe,M);return B.length===0?[]:(t(B[0].key,{clickedIndex:null,clicked:null,entries:[]}),B)},[b,t])}),C=u.useDraggingState(),R=x.useCallback(()=>s!=null&&v([{type:oe,key:s}]),[v,s]),y=x.useCallback(M=>d[M.key]??M.name,[d]);return r.jsxRuntimeExports.jsx(ot,{data:o,className:l.CSS(n,l.CSS.dropRegion(He(C,k.o(s)))),value:s,onDragStart:R,onDragEnd:w,onChange:t,searcher:h,columns:p,emptyContent:g,entryRenderKey:y,...E,...c})},yl=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:bo,AliasProvider:vs,LinePlot:jl,SelectMultiple:bl,SelectSingle:Oe,useActiveRange:Lt,useAlias:ys,useAliases:nt,useContext:bs,useName:Pt},Symbol.toStringTag,{value:"Module"})),Js=e=>k.u(e,(t,s,n)=>{const o=s===n.length-1,i=!isNaN(parseInt(t)),c=!isNaN(parseInt(n[s+1]));return i&&(t="element"),o||c?t:[t,"shape"]}),rs=(e,t)=>{if(e==null)return null;const s=e[t];return s==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:s},vl=(e,t,s)=>k.p(rs(e,"shape"),Js(t),{...s,getter:rs}),wl=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:vl,getFieldSchemaPath:Js},Symbol.toStringTag,{value:"Module"})),Be=({path:e,optional:t=!1,onChange:s})=>{const n=me(),{get:o,bind:i,set:c,setStatus:a}=n,[d,p]=x.useState(o(e,{optional:t}));x.useEffect(()=>(p(o(e,{optional:t})),i({path:e,onChange:p,listenToChildren:!1})),[e,s,i,o]);const m=x.useCallback(h=>{s==null||s(h,{...n,path:e}),c(e,h)},[e,c,s]),j=x.useCallback(h=>a(e,h),[e,a]);if(d==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}return{onChange:m,setStatus:j,...d}},Ks=(e,t=!1,s)=>{const{get:n,bind:o}=me(s),[,i]=x.useState(0);return x.useEffect(()=>(i(c=>c+1),o({path:e,onChange:()=>i(c=>c+1)})),[e,o]),n(e,{optional:t})??null},Tl=(e,t=!1,s)=>{var c;const{get:n,bind:o}=me(s),[,i]=x.useState(0);return x.useEffect(()=>(i(a=>a+1),o({path:e,onChange:()=>i(a=>a+1)})),[e,o]),((c=n(e,{optional:t}))==null?void 0:c.value)??null},kl=e=>{var t,s;return((s=(t=Ks(e,!0))==null?void 0:t.status)==null?void 0:s.variant)==="success"},Pl=({path:e,ctx:t,onChange:s})=>{const n=me(t);x.useEffect(()=>n.bind({path:e,onChange:o=>s(o,n),listenToChildren:!1}),[e,n])},Ll=({path:e,optional:t=!1})=>{const{bind:s,get:n}=me(),[o,i]=x.useState(n(e,{optional:t}));if(x.useEffect(()=>(i(n(e,{optional:t})),s({path:e,onChange:c=>i({...c,value:k.N(c.value)}),listenToChildren:!0})),[e,s,n]),o==null&&!t)throw new Error("Field state is null");return(o==null?void 0:o.value)??null},Ml=({path:e,updateOnChildren:t=!1})=>{const{bind:s,get:n,set:o}=me(),[i,c]=x.useState(n(e).value);x.useEffect(()=>(c(n(e).value),s({path:e,onChange:h=>c(k.N(h.value)),listenToChildren:t})),[e,s,n,c]);const a=x.useCallback(h=>{const g=k.N(n(e).value);g.push(...k.A(h)),o(e,g,{validateChildren:!1})},[e,n,o]),d=x.useCallback((h,g)=>{const S=k.N(n(e).value);S.splice(g,0,...k.A(h)),o(e,S,{validateChildren:!1})},[e,n,o]),p=x.useCallback(h=>{const g=n(e).value,S=new Set(k.A(h));o(e,g.filter((b,v)=>!S.has(v)))},[e,k.state,n]),m=x.useCallback(h=>{const g=n(e).value,S=new Set(k.A(h));o(e,g.filter((b,v)=>S.has(v)))},[e,i,n]),j=x.useCallback(h=>{o(e,k.executeSetter(h,n(e).value))},[e,o]);return{value:i,push:a,remove:p,keepOnly:m,set:j,add:d}},It=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:()=>{}}),me=e=>{const t=x.useContext(It);return e??t},os=e=>({key:e,variant:"success",message:""}),$l=e=>e.code===ee.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",Nl=({values:e,sync:t=!1,schema:s,onChange:n})=>{const o=x.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),i=u.useSyncedRef(s),c=u.useSyncedRef(n),a=x.useCallback(({path:E,onChange:C,listenToChildren:R=!1})=>{var L;const{parentListeners:y,listeners:M}=o.current,B=R?y:M;return B.has(E)||B.set(E,new Set),(L=B.get(E))==null||L.add(C),()=>{var $;return($=B.get(E))==null?void 0:$.delete(C)}},[]),d=x.useCallback((E,{optional:C}={optional:!1})=>{const{state:R,statuses:y,touched:M}=o.current,B=k.m$1.get(R,E,{optional:C});if(B==null)return null;const L={value:B,status:y.get(E)??os(E),touched:M.has(E),required:!1};if(i.current==null)return L;const $=i.current,T=wl.getFieldSchema($,E,{optional:!0});return T==null||(L.required=!T.isOptional()),L},[]),p=x.useCallback(E=>{var y;const{listeners:C}=o.current,R=d(E,{optional:!0});R!=null&&((y=C.get(E))==null||y.forEach(M=>M(R)))},[]),m=x.useCallback(E=>{const{listeners:C,parentListeners:R}=o.current,y=C.get(E);if(y!=null){const M=d(E,{optional:!0});M!=null&&y.forEach(B=>{B(M)})}R.forEach((M,B)=>{if(k.m$1.pathsMatch(E,B)){const $=d(B,{optional:!0});$!=null&&M.forEach(T=>{T($)})}})},[]),j=x.useCallback((E,C="",R=!0)=>{const{statuses:y,listeners:M,touched:B}=o.current;if(E.success){const N=[...y.keys()];return y.clear(),N.forEach(P=>p(P)),!0}let L=!0;const $=new Set(E.error.issues.map(N=>N.path.join(".")));let T=(N,P)=>N===P;return R&&(T=(N,P)=>k.m$1.pathsMatch(N,P)),E.error.issues.forEach(N=>{var Z;const{message:P}=N,_=N.path.join(".");if(!T(_,C))return;const A=$l(N);A!=="warning"&&(L=!1),y.set(_,{key:_,variant:A,message:P}),B.add(_);let I=d(_,{optional:!0});I==null&&(I={value:void 0,status:y.get(_)??os(_),touched:!1,required:!1}),(Z=M.get(_))==null||Z.forEach(W=>W(I))}),y.forEach((N,P)=>{$.has(P)||(y.delete(P),p(P))}),L},[]),h=x.useCallback((E,C)=>{if(i.current==null)return!0;const{state:R}=o.current,y=i.current.safeParse(R);return j(y,E,C)},[j]),g=x.useCallback(async(E,C)=>{if(i.current==null)return!0;const{state:R}=o.current,y=await i.current.safeParseAsync(R);return j(y,E,C)},[j]),S=x.useCallback((E,C,R={})=>{var L;const{validateChildren:y=!0}=R,{state:M,touched:B}=o.current;B.add(E),E.length===0?o.current.state=C:k.m$1.set(M,E,C);try{h(E,y)}catch{g(E,y)}m(E),(L=c.current)==null||L.call(c,o.current.state)},[]),b=x.useCallback(E=>k.m$1.has(o.current.state,E),[]),v=x.useCallback((E,C)=>{o.current.statuses.set(E,C),o.current.touched.add(E),p(E)},[]),w=x.useCallback(()=>{const{statuses:E}=o.current;E.clear(),E.forEach((C,R)=>p(R))},[]);return x.useEffect(()=>{if(!t)return;const{listeners:E}=o.current;o.current.state=e,E.forEach((C,R)=>{const y=d(R,{optional:!0});y!=null&&C.forEach(M=>M(y))})},[t,e]),x.useMemo(()=>({bind:a,set:S,get:d,validate:h,validateAsync:g,value:()=>o.current.state,has:b,setStatus:v,clearStatuses:w}),[])},_l=e=>r.jsxRuntimeExports.jsx(It.Provider,{value:e,children:e.children}),Ol=u.componentRenderProp(u.Text$1),le=({path:e,children:t=Ol,label:s,padHelpText:n=!0,visible:o=!0,hideIfNull:i=!1,optional:c,onChange:a,className:d,...p})=>{const m=Be({path:e,optional:c??i,onChange:a}),j=me();if(m==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(s==null&&(s=l.he.capitalize(k.m$1.element(e,-1))),o=typeof o=="function"?o(m,j):o,!o)return null;const h=m.status.message,{onChange:g,value:S}=m;return r.jsxRuntimeExports.jsx(de.Item,{padHelpText:n,helpText:h,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)),...p,children:t({onChange:g,value:S})})},he=e=>({fieldKey:t,fieldProps:s,inputProps:n})=>{const o=({inputProps:i,path:c,fieldKey:a=t,...d})=>r.jsxRuntimeExports.jsx(le,{...s,...d,path:a?`${c}.${a}`:c,children:p=>r.jsxRuntimeExports.jsx(e,{...p,...n,...i})});return o.displayName=e.displayName,o},Qs=he(u.Numeric),Bl=Qs({}),en=he(u.Text$1),zl=en({}),tn=he(u.Switch$1),Dl=tn({}),Al=he(ot),Vl=he(lt),Il=he(se.DropdownButton),Zl=Object.freeze(Object.defineProperty({__proto__:null,Context:It,Field:le,Form:_l,NumericField:Bl,SwitchField:Dl,TextField:zl,buildDropdownButtonSelectField:Il,buildNumericField:Qs,buildSelectMultiField:Vl,buildSelectSingleField:Al,buildSwitchField:tn,buildTextField:en,fieldBuilder:he,use:Nl,useChildFieldValues:Ll,useContext:me,useField:Be,useFieldArray:Ml,useFieldListener:Pl,useFieldState:Ks,useFieldValid:kl,useFieldValue:Tl},Symbol.toStringTag,{value:"Module"})),Fl=[{key:"name",name:"Name"},{key:"location",name:"Location"}],ql=({searchOptions:e,...t})=>{const s=ye();let n=s==null?void 0:s.hardware.devices;return e!=null&&s!=null&&(n=s.hardware.devices.newSearcherWithOptions(e)),r.jsxRuntimeExports.jsx(ot,{columns:Fl,searcher:n,entryRenderKey:"name",...t})},Yl=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:ql},Symbol.toStringTag,{value:"Module"})),Gl=({visible:e,close:t,...s})=>{const n=x.useRef(null);return u.useClickOutside({ref:n,onClickOutside:t}),u.use$2({triggers:[["Escape"]],callback:t,loose:!0}),wt.createPortal(r.jsxRuntimeExports.jsx(z.Space,{className:l.CSS(l.CSS.BE("modal","bg"),l.CSS.visible(e)),role:"dialog",empty:!0,align:"center",children:r.jsxRuntimeExports.jsx(z.Space,{className:l.CSS(l.CSS.BE("modal","dialog")),role:"dialog",empty:!0,ref:n,...s})}),u.getRootElement())},Hl=Object.freeze(Object.defineProperty({__proto__:null,Modal:Gl},Symbol.toStringTag,{value:"Module"})),Zt=new Error("Tab not found"),Ul=new Error("Invalid Mosaic"),sn=(e,t,s="center",n)=>{var d;if(e=ge(e),n===void 0)return gt(e,t);const o=cn(e,n);if(s==="center")return(d=o.tabs)==null||d.push(t),o.selected=t.tabKey,e;if(o.tabs==null||o.tabs.length===0)return e;const[i,c,a]=Jl(s);if(o.direction=a,o[i]={key:0,tabs:[t],selected:t.tabKey},o[c]={key:0,tabs:o.tabs,selected:o.selected},o.first==null||o.last==null)throw Ul;return o.first.key=o.key*2,o.last.key=o.key*2+1,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},gt=(e,t)=>(e=ge(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=gt(e.first,t):e.last!=null&&(e.last=gt(e.last,t)),e)),Ue=e=>{e=ge(e);const t=[];if(e.tabs!=null&&(e.selected=K.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[s,n]=Ue(e.first);e.first=s,t.push(...n)}if(e.last!=null){const[s,n]=Ue(e.last);e.last=s,t.push(...n)}return[e,t]},Ft=(e,t)=>{var o;e=ge(e);const[,s]=Ce(e,t);if(s==null)return[e,null];s.tabs=(o=s.tabs)==null?void 0:o.filter(i=>i.tabKey!==t),s.selected=K.resetSelection(s.selected,s.tabs),e=Xl(e);const n=s.selected??We(e);return[e,n]},We=e=>e.selected!=null?e.selected:e.first!=null?We(e.first):e.last!=null?We(e.last):null,nn=(e,t)=>{e=ge(e);const[s,n]=Ce(e,t);if(s==null||n==null)throw Zt;return n.selected=t,e},rn=(e,t,s,n)=>{e=ge(e);const[o,i]=Ce(e,t);if(o==null||i==null)throw Zt;const[c,a]=Ft(e,t);return[sn(c,o,s,n),a]},on=(e,t,s)=>{const n=Xe(e,t);if(n==null)throw new Error("Node not found");return n.size=s,e},ln=(e,t,s)=>{e=ge(e);const[,n]=Ce(e,t);if((n==null?void 0:n.tabs)==null)throw Zt;return n.tabs=K.rename(t,s,(n==null?void 0:n.tabs)??[]),e},Wl=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,cn=(e,t)=>{const s=Xe(e,t);if(s!=null)return s;const n=Math.floor(t/2);return n===0?e:cn(e,n)},Xl=e=>{let t=!0;for(;t;)[e,t]=St(e);return e.first==null&&e.last==null&&(e.key=1),e},St=e=>{if(e.first==null||e.last==null)return[e,!1];if(is(e.first))return[ls(e.last,!0),!0];if(is(e.last))return[ls(e.first,!1),!0];let[t,s]=[!1,!1];return[e.first,t]=St(e.first),[e.last,s]=St(e.last),[e,t||s]},ls=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),is=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Ce=(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,n]=Ce(e.first,t);if(s!=null&&n!=null)return[s,n];const[o,i]=Ce(e.last,t);return[o,i]},Xe=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const s=Xe(e.first,t);return s??Xe(e.last,t)},Jl=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.m$1.copy(e),Je=(e,t,s=[])=>(s.push(t(e)),e.first!=null&&Je(e.first,t,s),e.last!=null&&Je(e.last,t,s),s),Et=(e,t)=>{t(e),e.first!=null&&Et(e.first,t),e.last!=null&&Et(e.last,t)};class Kl{constructor(t={}){re(this,"parent");re(this,"stub");re(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([s,n])=>this.el.setAttribute(s,n))}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 Ql=({node:e})=>{const t=x.createRef(),s=x.useRef(e);return x.useEffect(()=>{const n=t.current;if(n==null)return;const o=n.parentNode;if(o!=null)return e.mount(o,n),()=>{t.current!=null&&e.unmount(t.current)}},[]),x.useEffect(()=>{s.current!=null&&e!==s.current&&(s.current.unmount(t.current),s.current=e);const n=t.current;if(n==null)return;const o=n.parentNode;o!=null&&e.mount(o,n)},[e]),r.jsxRuntimeExports.jsx("div",{ref:t})},ei=({node:e,children:t})=>wt.createPortal(t,e.el),an=x.memo(({children:e,...t})=>{const s=x.useRef(new Map),n=new Set,o=Je(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 Kl({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)),n.add(i.selected),r.jsxRuntimeExports.jsx(ei,{node:c,children:e(a)},a.tabKey))});return s.current.forEach((i,c)=>!n.has(c)&&s.current.delete(c)),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[o,r.jsxRuntimeExports.jsx(Ke,{portalNodes:s,...t})]})}),Ke=x.memo(e=>{const{onResize:t,...s}=e,{root:{tabs:n,direction:o,first:i,last:c,key:a,size:d},emptyContent:p,...m}=s,j=x.useCallback(([S])=>t(a,S),[t]),{props:h}=Tt({direction:o,onResize:j,count:2,initialSizes:d!=null?[d]:void 0});let g;return n!==void 0?g=r.jsxRuntimeExports.jsx(un,{emptyContent:p,...s}):i!=null&&c!=null?g=r.jsxRuntimeExports.jsxs(tt,{align:"stretch",className:l.CSS.BE("mosaic","resize"),...h,children:[r.jsxRuntimeExports.jsx(Ke,{...m,root:i,onResize:t},i.key),r.jsxRuntimeExports.jsx(Ke,{...m,root:c,onResize:t},c.key)]}):(g=null,console.warn("Mosaic tree is malformed")),a===1?r.jsxRuntimeExports.jsx(u.Provider$2,{children:g}):g});an.displayName="Mosaic";Ke.displayName="Mosaic";const Qe="pluto-mosaic-tab-drop",qt="pluto-mosaic-tab-create",ti=(e,t)=>{const s=u.filterByType(Qe,t).map(i=>i.key),n=e.filter(i=>!s.includes(i.tabKey)).length>0;return u.filterByType(qt,t).length>0||s.length>0&&(n||e.length===0)},un=x.memo(({root:e,onDrop:t,onCreate:s,portalNodes:n,activeTab:o,...i})=>{const{key:c,tabs:a}=e,[d,p]=x.useState(null),m=x.useCallback(({items:C})=>ti(a,C),[a]),j=x.useCallback(({items:C,event:R})=>{if(R==null)return[];p(null);const y=u.filterByType(Qe,C),M=a.length===0?"center":as(cs(R));if(y.length>0){const L=y.map(({key:$})=>$)[0];t(c,L,M)}const B=u.filterByType(qt,C);if(B.length>0){const L=B.map(({key:$})=>$);s==null||s(c,M,L)}return y},[t,a.length]),h=x.useCallback(({event:C})=>{if(C==null)return;const R=a.length===0?"center":as(cs(C));p(R)},[a.length]),{startDrag:g,...S}=u.useDragAndDrop({type:"Mosaic",canDrop:m,onDrop:j,onDragOver:h}),b=m(u.useDraggingState()),v=x.useCallback(()=>p(null),[]),w=x.useCallback((C,{tabKey:R})=>{g([{key:R,type:Qe,elementID:C.currentTarget.id}])},[g]),E=x.useCallback(()=>s==null?void 0:s(c,"center"),[c]);return r.jsxRuntimeExports.jsxs("div",{className:l.CSS.BE("mosaic","leaf"),children:[r.jsxRuntimeExports.jsxs(K.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:v,selected:e.selected,selectedAltColor:o===e.selected,onDragStart:w,onCreate:E,...i,...S,children:[r.jsxRuntimeExports.jsx(Ql,{node:n.current.get(e.selected)}),b&&r.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),d!=null&&r.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("mosaic","mask"),style:si[d]})]})});un.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%"}},cs=e=>{const t=e.currentTarget.getBoundingClientRect(),s=e.clientX-t.left,n=e.clientY-t.top;return n<24?{px:.5,py:.5}:{px:s/t.width,py:n/t.height}},ni=e=>e,ri=e=>1-e,as=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[s,n]=[ni(e),ri(e)];if(t>s&&t>n)return"bottom";if(t<s&&t<n)return"top";if(t>s&&t<n)return"left";if(t<s&&t>n)return"right";throw new Error("[bug] - invalid insert position")},oi=ee.z.object({key:ee.z.number(),tabs:ee.z.array(K.tabZ).optional(),selected:ee.z.string().optional(),direction:l.g.direction.optional(),size:ee.z.number().optional()}),Rt=oi.extend({first:ee.z.lazy(()=>Rt).optional(),last:ee.z.lazy(()=>Rt).optional()}),li=({allowRename:e=!1,initialTree:t})=>{const[s,n]=x.useState(t);return x.useEffect(()=>n(Ue(t)[0]),[t]),{root:s,onDrop:(p,m,j)=>n(h=>rn(h,m,j,p)[0]),onClose:p=>n(m=>Ft(m,p)[0]),onSelect:p=>n(m=>nn(m,p)),onResize:(p,m)=>n(j=>on(j,p,m)),onRename:e?(p,m)=>n(j=>ln(j,p,m)):void 0}},ii=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:qt,HAUL_DROP_TYPE:Qe,Mosaic:an,autoSelectTabs:Ue,findSelected:We,forEachNode:Et,insertTab:sn,isEmpty:Wl,mapNodes:Je,moveTab:rn,nodeZ:Rt,removeTab:Ft,renameTab:ln,resizeNode:on,selectTab:nn,use:li},Symbol.toStringTag,{value:"Module"})),ci=({location:e="left",size:t="9rem",className:s,style:n,...o})=>{const i=l.J.construct(e),c=l.J.direction(i),a=l.g.swap(c);return r.jsxRuntimeExports.jsx(z.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(c)]:t,...n},align:"center",empty:!0,...o})},ze=e=>({bordered:t=!1,className:s,...n})=>r.jsxRuntimeExports.jsx(z.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",...n}),xn=ze("start");xn.displayName="NavbarStart";const dn=ze("end");dn.displayName="NavbarEnd";const pn=ze("center");pn.displayName="NavbarCenter";const mn=ze("");mn.displayName="NavbarContent";const fn=ze("absolute-center");fn.displayName="NavbarAbsoluteCenter";const we=ci;we.Start=xn;we.Center=pn;we.End=dn;we.AbsoluteCenter=fn;we.Content=mn;const Yt=({aetherKey:e})=>{const[,{region:t},s]=u.use$3({aetherKey:e,type:f.Eraser$1.TYPE,schema:f.eraserStateZ,initialState:{region:l.To.ZERO,enabled:!0}}),n=u.useSyncedRef(t),o=x.useCallback(c=>{l.To.equals(c,n.current)||s(a=>({...a,region:c}))},[s]);return{setEnabled:x.useCallback(c=>s(a=>({...a,enabled:c})),[s]),erase:o}},ai=u.wrap$1(f.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:s}=Yt({aetherKey:e}),n=u.useResize(s);return r.jsxRuntimeExports.jsx("div",{ref:n,className:l.CSS(l.CSS.inheritDims()),children:t})}),ui=Object.freeze(Object.defineProperty({__proto__:null,Eraser:ai,use:Yt},Symbol.toStringTag,{value:"Module"})),xi=({items:e,initialKey:t})=>{const[s,n]=x.useState(t),o=c=>n(c===s?void 0:c),i=e.find(c=>c.key===s);return{onSelect:o,activeItem:i}},di=u.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:s,onSelect:n,location:o="left",collapseThreshold:i=.65,className:c,onResize:a,...d})=>{const p=l.J.direction(o),m=x.useCallback(()=>t!=null&&(n==null?void 0:n(t.key)),[n,t==null?void 0:t.key]),{erase:j,setEnabled:h}=Yt({aetherKey:e}),g=x.useCallback((w,E)=>{a==null||a(w,E),j(E)},[a,j]);if(x.useLayoutEffect(()=>{h(t!=null)},[t,h]),t==null)return null;const{content:S,key:b,...v}=t;return r.jsxRuntimeExports.jsx(Rs,{className:l.CSS(l.CSS.BE("navdrawer","content"),l.CSS.dir(p),c),collapseThreshold:i,onCollapse:m,location:o,onResize:g,...v,...d,children:t.content},b)}),pi=Object.freeze(Object.defineProperty({__proto__:null,Bar:we,Drawer:di,useDrawer:xi},Symbol.toStringTag,{value:"Module"})),mi=({variant:e,className:t,children:s,...n})=>r.jsxRuntimeExports.jsx(z.Space,{className:l.CSS(t,l.CSS.B("note"),l.CSS.M(e)),align:"stretch",empty:!0,...n,children:s}),fi=Object.freeze(Object.defineProperty({__proto__:null,Note:mi},Symbol.toStringTag,{value:"Module"})),jn=({key:e,open:t,onChange:s})=>{const n=u.useMemoCompare(()=>e,([o],[i])=>k.E.unorderedPrimitiveArrays(o,i)===k.E.EQUAL,[e]);u.useAsyncEffect(async()=>{const o=await t();if(o!=null)return o.onChange(s),()=>o.close()},[n])},ji=e=>{const[t,s]=x.useState(e.initialValue);return jn({...e,onChange:s}),t},hi=Object.freeze(Object.defineProperty({__proto__:null,useListener:jn,useState:ji},Symbol.toStringTag,{value:"Module"})),pt={Close:r.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),r.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:r.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:r.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:r.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.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"}),r.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"})]})},gi=({disabled:e=[],className:t,focused:s=!0,onMinimize:n,onMaximize:o,onFullscreen:i,onClose:c,...a})=>r.jsxRuntimeExports.jsxs(z.Space,{size:1.5,direction:"x",className:l.CSS(l.CSS.B("macos-controls"),!s&&l.CSS.BM("macos-controls","blurred"),t),...a,children:[r.jsxRuntimeExports.jsx(mt,{onClick:c,className:l.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:pt.Close}),r.jsxRuntimeExports.jsx(mt,{onClick:n,className:l.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:pt.Minimize}),r.jsxRuntimeExports.jsx(mt,{onClick:i,className:l.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:pt.Maximize})]}),mt=({className:e,disabled:t,...s})=>r.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("macos-control"),l.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),ft=({disabled:e=[],onMinimize:t,onMaximize:s,onClose:n,onFullscreen:o,focused:i,...c})=>r.jsxRuntimeExports.jsxs(z.Pack,{...c,children:[r.jsxRuntimeExports.jsx(jt,{className:l.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:r.jsxRuntimeExports.jsx(u.bt.Subtract,{})}),r.jsxRuntimeExports.jsx(jt,{className:l.CSS.BM("windows-control","maximize"),onClick:s,disabled:e.includes("maximize"),children:r.jsxRuntimeExports.jsx(u.bt.Box,{})}),r.jsxRuntimeExports.jsx(jt,{onClick:n,className:l.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:r.jsxRuntimeExports.jsx(u.bt.Close,{})})]}),jt=({disabled:e=!1,className:t,...s})=>e?null:r.jsxRuntimeExports.jsx(u.Icon,{className:l.CSS(l.CSS.B("windows-control"),t),tabIndex:-1,...s}),hn=e=>k.w$1.getOS(e),Si={MacOS:gi,Windows:ft,Linux:ft,Docker:ft},Ei="Windows",Ri=({forceOS:e,visibleIfOS:t,...s})=>{const n=hn({force:e,default:Ei}),o=Si[n];return t!=null&&t!==n?null:r.jsxRuntimeExports.jsx(o,{...s})},Ci=Object.freeze(Object.defineProperty({__proto__:null,Controls:Ri,use:hn},Symbol.toStringTag,{value:"Module"}));x.createContext({instrumentation:k.B.NOOP});const bi=u.wrap$1(f.Provider$2.TYPE,({aetherKey:e,children:t,...s})=>{const n=u.useMemoDeepEqualProps(s),[{path:o},,i]=u.use$3({aetherKey:e,type:f.Provider$2.TYPE,schema:f.providerStateZ$1,initialState:n});return x.useEffect(()=>{i(n)},[n,i]),r.jsxRuntimeExports.jsx(u.Composite,{path:o,children:t})}),yi="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",gn=u.wrap$1(f.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:s}]=u.use$3({aetherKey:t,type:f.BaseProvider.TYPE,schema:f.providerStateZ$2,initialState:{}});return r.jsxRuntimeExports.jsx(u.Composite,{path:s,children:e})}),vi=Object.freeze(Object.defineProperty({__proto__:null,Provider:gn},Symbol.toStringTag,{value:"Module"})),wi=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.hy.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)"}}},Sn=u.wrap$1("Chip",({aetherKey:e,source:t,sink:s,className:n,...o})=>{const i=u.useMemoDeepEqualProps({source:t,sink:s}),[,{status:c},a]=u.use$3({aetherKey:e,type:f.Chip.TYPE,schema:f.chipStateZ,initialState:{triggered:!1,...i,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:k.m.now()}}});x.useEffect(()=>{a(g=>({...g,...i}))},[i,a]);const d=x.useCallback(()=>a(g=>({...g,triggered:!g.triggered})),[a]),{message:p,chipColor:m,buttonStyle:j,disabled:h}=wi(c);return r.jsxRuntimeExports.jsx(u.Icon,{variant:"text",className:l.CSS(l.CSS.B("control-chip"),n),disabled:h,onClick:d,tooltip:r.jsxRuntimeExports.jsx(u.Text,{level:"small",children:p}),style:j,...o,children:r.jsxRuntimeExports.jsx(u.bt.Circle,{color:m})})}),En=x.createContext({needsControlOf:[]}),Rn=()=>x.useContext(En),Ti=u.wrap$1(f.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:s,...n})=>{const o=u.useMemoDeepEqualProps(n),[{path:i},{status:c,needsControlOf:a},d]=u.use$3({aetherKey:e,type:f.Controller$1.TYPE,schema:f.controllerStateZ,initialState:o});return x.useEffect(()=>{c!=null&&(s==null||s(c))},[c,s]),x.useEffect(()=>{d(p=>({...p,...o}))},[o,d]),x.useEffect(()=>()=>s==null?void 0:s("released"),[]),r.jsxRuntimeExports.jsxs(En.Provider,{value:{needsControlOf:a},children:[r.jsxRuntimeExports.jsx(u.Composite,{path:i,children:t}),";"]})}),Cn=u.wrap$1(f.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:s})=>{var d;const n=u.useMemoDeepEqualProps({colorSource:t,statusSource:s}),[,{color:o,status:i},c]=u.use$3({aetherKey:e,type:f.Indicator.TYPE,initialState:{...n,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:k.m.now()}},schema:f.indicatorStateZ});x.useEffect(()=>{c(p=>({...p,...n}))},[n,c]);let a;return((d=i.data)==null?void 0:d.color)!=null?a=l.Color.z.parse(i.data.color):o!=null&&!o.isZero?a=o:a="var(--pluto-gray-l8)",r.jsxRuntimeExports.jsxs(u.Dialog$1,{location:{x:"center",y:"bottom"},children:[r.jsxRuntimeExports.jsx(u.Text,{level:"p",children:i.message}),r.jsxRuntimeExports.jsx("div",{className:l.CSS.B("indicator"),style:{backgroundColor:l.cssString(a),flexGrow:1}})]})}),ki=u.wrap$1(f.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:s}=Rn(),[,{states:n},o]=u.use$3({aetherKey:e,type:f.Legend.TYPE,schema:f.legendStateZ,initialState:{states:[],needsControlOf:s}});x.useEffect(()=>{o(a=>({...a,needsControlOf:s}))},[s]);const c=k.n(n.map(a=>a.subject.key)).map(a=>{const d=n.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 r.jsxRuntimeExports.jsx(_t,{data:c,...t})}),bn=u.wrap$1(f.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:s}]=u.use$3({aetherKey:e,type:f.StateProvider.TYPE,schema:f.stateProviderStateZ,initialState:{}});return r.jsxRuntimeExports.jsx(u.Composite,{path:s,children:t})}),Pi=Object.freeze(Object.defineProperty({__proto__:null,Chip:Sn,Controller:Ti,Indicator:Cn,Legend:ki,StateProvider:bn,useContext:Rn},Symbol.toStringTag,{value:"Module"})),yn=e=>{const t=({disabled:s=!1,...n})=>s?n.children:r.jsxRuntimeExports.jsx(e,{...n});return t.displayName=e.displayName,t},Li=yn(gn),Mi=yn(u.Provider$3),$i=({children:e,connParams:t,workerEnabled:s=!0,workerURL:n,theming:o,tooltip:i,triggers:c,alamos:a,haul:d,channelAlias:p,telem:m})=>r.jsxRuntimeExports.jsx(u.Provider$1,{...c,children:r.jsxRuntimeExports.jsx(u.Config,{...i,children:r.jsxRuntimeExports.jsx(u.Provider$2,{...d,children:r.jsxRuntimeExports.jsx(u.Provider$4,{url:n??yi,enabled:s,children:r.jsxRuntimeExports.jsx(Mi,{workerKey:"vis",children:r.jsxRuntimeExports.jsx(bi,{...a,children:r.jsxRuntimeExports.jsx(u.Aggregator,{children:r.jsxRuntimeExports.jsx(Cs,{connParams:t,children:r.jsxRuntimeExports.jsx(vs,{...p,children:r.jsxRuntimeExports.jsx(Li,{...m,children:r.jsxRuntimeExports.jsx(u.Provider,{...o,children:r.jsxRuntimeExports.jsx(bn,{children:e})})})})})})})})})})})}),Ni=Object.freeze(Object.defineProperty({__proto__:null,Provider:$i},Symbol.toStringTag,{value:"Module"})),_i=({value:e})=>r.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress"),children:r.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress-bar"),style:{width:`${e}%`}})}),Oi=Object.freeze(Object.defineProperty({__proto__:null,Progress:_i},Symbol.toStringTag,{value:"Module"})),Bi=[{key:"color",name:"Color",width:50,render:e=>r.jsxRuntimeExports.jsx(u.bt.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],zi=e=>{const t=ye();return r.jsxRuntimeExports.jsx(lt,{...e,searcher:t==null?void 0:t.labels,columns:Bi,renderTag:s=>s.entry==null?r.jsxRuntimeExports.jsx(Ge,{color:"gray",children:s.entryKey}):r.jsxRuntimeExports.jsx(Ge,{color:s.entry.color,children:s.entry.name})})},Di=({timeRange:e,...t})=>{const s=new k.m(e.start),n=s.isToday?"time":"dateTime",o=new k.m(e.end),i=o.equals(k.m.MAX),c=o.span(s)<k.w.DAY?"time":"dateTime";return r.jsxRuntimeExports.jsxs(z.Space,{direction:"x",size:"small",className:l.CSS(l.CSS.B("time-range-chip")),align:"center",...t,children:[s.isToday&&r.jsxRuntimeExports.jsx(u.Text,{level:"p",shade:7,weight:450,children:"Today"}),r.jsxRuntimeExports.jsx(u.DateTime,{level:"p",displayTZ:"local",format:n,shade:7,weight:450,children:s}),r.jsxRuntimeExports.jsx(u.bt.Arrow.Right,{color:"var(--pluto-text-color)"}),i?r.jsxRuntimeExports.jsx(u.Text,{level:"p",children:"Now"}):r.jsxRuntimeExports.jsx(u.DateTime,{level:"p",displayTZ:"local",format:c,shade:7,weight:450,children:o})]})},Ai=Object.freeze(Object.defineProperty({__proto__:null,SelectLabels:zi,TimeRangeChip:Di},Symbol.toStringTag,{value:"Module"})),Vi=({steps:e,value:t,onChange:s,...n})=>{const o=e.findIndex(i=>i.key===t);return r.jsxRuntimeExports.jsx(z.Space,{direction:"x",align:"center",className:l.CSS.B("steps"),...n,children:e.map((i,c)=>r.jsxRuntimeExports.jsxs(x.Fragment,{children:[r.jsxRuntimeExports.jsxs(u.Button,{onClick:()=>s(i.key),variant:"outlined",disabled:c>o,children:[c+1,". ",i.title]},i.key),c!==e.length-1&&r.jsxRuntimeExports.jsx(u.bt.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},Ii=Object.freeze(Object.defineProperty({__proto__:null,Steps:Vi},Symbol.toStringTag,{value:"Module"})),Zi=(e,t="x")=>{if(e.length===0)return[];const s=l.J.construct(t),n=l.J.swap(s);return e.sort((o,i)=>l.To.loc(o.box,s)-l.To.loc(i.box,s)),e.forEach((o,i)=>{if(i===0)return;const a=e[i-1].handles.find(g=>g.orientation===n),d=o.handles.find(g=>g.orientation===s);if(a==null||d==null)return;const p=a.absolutePosition,m=d.absolutePosition,j=l.q.set(l.q.translation(m,p),t,0),h=l.q.translate(l.To.topLeft(o.box),j);o.box=l.To.construct(h,l.To.dims(o.box))}),e},us=({sourcePos:e,targetPos:t,next:s,prev:n})=>{const o=Ne(e,...s);return l.q.distance(o,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",o),console.log("Actual target",t),console.log("Segments",s),console.log("Prev segments",n),!1)},xs=({sourceStumpTip:e,sourceOrientation:t,sourceBox:s,targetStumpTip:n,targetOrientation:o,targetBox:i})=>{if(!Fi({sourcePos:e,sourceOrientation:t,targetPos:n}))return;const c=l.g.construct(t),a=l.g.swap(c);let d=fe(a,n[a]-e[a]);const p=l.To.loc(s,d);if(l.J.swap(t)===o){const m=l.To.loc(i,l.J.swap(d));Math.abs(p-m)<te&&(d=l.J.swap(d))}return{direction:a,length:p-e[a]+je(d,te)}},Ne=(e,...t)=>{let s=e;for(const n of t)s=l.q.translate(s,n.direction,n.length);return s},vn=(e,t,s,n)=>{try{let o=e;const i=[e,...t.map(h=>(o=l.q.translate(o,h.direction,h.length),o))];if(!n)return i;const c=t[0],a=fe(c.direction,c.length),d=ds(a);i[0]=l.q.translate(i[0],{[c.direction]:-1*d*4*s,[l.g.swap(c.direction)]:0});const p=t[t.length-1],m=fe(p.direction,p.length),j=ds(m);return i[i.length-1]=l.q.translate(i[i.length-1],{[p.direction]:j*4*s,[l.g.swap(p.direction)]:0}),i}catch{return[]}},te=10,ds=e=>e==="top"||e==="left"?-1:1,je=(e,t)=>e==="top"||e==="left"?-t:t,fe=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",xe=e=>fe(e.direction,e.length),Fi=({sourcePos:e,targetPos:t,sourceOrientation:s})=>{const n=l.g.construct(s),o=t[n]-e[n];return je(s,o)<0},Ve=e=>({direction:l.g.construct(e),length:je(e,te)}),ps={top:Ve("top"),bottom:Ve("bottom"),left:Ve("left"),right:Ve("right")},qi=4,Yi=.25,it=e=>Ct(Gi(Ct(e))),Gi=e=>{const t=[...e],s=e.findIndex((n,o)=>{const i=Math.abs(n.length);if(i<qi){if(i<Yi)return!0;if(o===0||o===e.length-1||e.length<=3)return!1;if(o+2<e.length){const c=t[o+2];if(c.direction!==n.direction)return!1;t[o+2]={...c,length:c.length+n.length}}else{const c=t[o-2];if(c.direction!==n.direction)return!1;t[o-2]={...c,length:c.length+n.length}}return!0}return!1});return s!==-1&&t.splice(s,1),t},Ct=e=>{const t=[...e];return e.findIndex((n,o)=>{const i=t[o-1];if(o===0||n.direction!==i.direction)return!1;if(o===1){const c=o-1,a=o,d=xe(i),p=xe(n);if(d===p)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(i.length)===te)return!1;const m=je(d,te),j=t[c].length-m,h=t[a].length+j;return Math.abs(h)<te?!1:(t[c]={...t[c],length:m},t[a]={...t[a],length:h},!0)}if(o===e.length-1){const c=o,a=o-1,d=xe(n),p=xe(i);if(d===p)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(n.length)===te)return!1;const m=je(d,te),j=t[c].length-m,h=t[a].length+j;return Math.abs(h)<te?!1:(t[c]={...t[c],length:m},t[a]={...t[a],length:h},!0)}return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0})!==-1?Ct(t):t},Re=e=>it(Hi(e)),Hi=({sourceBox:e,targetBox:t,sourcePos:s,targetPos:n,targetOrientation:o,sourceOrientation:i})=>{let c=i,a=o,d={...ps[i]},p=Ne(s,d);const m={...ps[o]};let j=Ne(n,m);const h=[d],g=xs({sourceStumpTip:p,sourceOrientation:i,sourceBox:e,targetStumpTip:j,targetOrientation:o,targetBox:t});g!=null&&(h.push(g),p=Ne(p,g),c=xe(g),d=g);const S=xs({sourceStumpTip:j,sourceOrientation:a,sourceBox:t,targetStumpTip:p,targetOrientation:c,targetBox:e});S!=null&&(j=Ne(j,S),a=fe(S.direction,S.length));const b=()=>{S!=null&&(S.length*=-1,h.push(S)),m.length*=-1,h.push(m)};if(l.J.swap(c)===o){const y=l.g.construct(c),M=(j[y]-p[y])/2;h.push({direction:y,length:M});const B=l.g.swap(y);return h.push({direction:B,length:j[B]-p[B]}),h.push({direction:y,length:M}),b(),h}const v=j[d.direction]-p[d.direction];let w=l.g.swap(d.direction);const E=p[w]-j[w];let C;fe(d.direction,v)===c&&fe(w,E)===a?C={direction:d.direction,length:v}:(C={direction:w,length:j[w]-p[w]},w=l.g.swap(w)),h.push(C);const R={direction:w,length:j[w]-p[w]};return h.push(R),b(),h},Ui=e=>it(Wi(e)),Wi=({segments:e,index:t,magnitude:s})=>{const n=[...e],o=n[t],i=l.g.swap(o.direction),c=xe(o);if(t===0){n.unshift({direction:i,length:s});const a=je(c,te);n.unshift({direction:o.direction,length:a}),t+=2,n[t]={...n[t],length:n[t].length-a}}else n[t-1]={direction:n[t-1].direction,length:n[t-1].length+s};if(t===n.length-1){n.push({direction:i,length:-s});const a=je(c,te);n.push({direction:o.direction,length:a}),n[t]={...n[t],length:n[t].length-a}}else n[t+1]={direction:n[t+1].direction,length:n[t+1].length-s};return n},Xi=(e,t)=>{for(let s=e.length-1;s>=0;s--)if(t(e[s],s))return s;return-1},Ji=(e,t,s=!1,...n)=>{const o=(i,c)=>!n.includes(c)&&t(i,c);return s?Xi(e,o):e.findIndex(o)},Ki=({delta:e,segments:t})=>it(wn(e,t,!1)),Qi=({delta:e,segments:t})=>it(wn(e,t,!0)),wn=(e,t,s)=>{let n=[...t];return e.x!==0&&(n=fs("x",e,n,s)),e.y!==0&&(n=fs("y",e,n,s)),n},ms=(e,t,s)=>{if(t.direction!==e)return!1;const n={...t,length:t.length-s[e]},o=xe(t),i=xe(n);return Math.abs(n.length)>te&&o===i},fs=(e,t,s,n)=>{const o=l.g.swap(e),i=n?s.length-1:0,c=s[i];if(ms(e,c,t))return s[i]={...c,length:c.length-t[e]},s;const a=n?0:s.length-1,p=Ji(s,j=>j.direction===e,n,i);if(p===a){const j=s[a];return ms(e,j,t)?(s[a]={...j,length:j.length-t[e]},s):(c.direction===e?s[i]={...c,length:c.length-t[e]}:s[a]={...j,length:j.length-t[e]},s)}if(p===-1)return s.length===1?s[0].direction===e?[{direction:e,length:s[0].length-t[e]}]:[{direction:o,length:s[0].length/2},{direction:e,length:-t[e]},{direction:o,length:s[0].length/2}]:c.direction===e?(s[i]={...c,length:c.length-t[e]},s):[{direction:o,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},Gt=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},J=(e,t)=>{const s=Gt(t),n=e.getNodes().find(o=>o.id===t);if(n==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return l.To.construct(n.position,l.To.dims(l.To.construct(s)))},ec=(e,t)=>ct.fromFlow(e,t);class Tn{constructor(t,s){re(this,"node_",null);re(this,"position");re(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 ct{constructor(t,s,n){re(this,"key");re(this,"box");re(this,"handles");this.key=t,this.box=s,this.handles=n,n.forEach(o=>o.node=this)}static fromFlow(t,s){const n=J(s,t),o=Gt(t),i=o.getElementsByClassName("react-flow__handle"),c=l.To.construct(o),a=Array.from(i).map(d=>{const p=l.To.center(l.To.construct(d)),m=l.q.translation(l.To.topLeft(c),p),j=d.className.match(/react-flow__handle-(\w+)/);if(j==null)throw new Error("[schematic] - cannot find handle orientation");const h=l.J.construct(j[0]);return new Tn(m,h)});return new ct(t,n,a)}}const tc=({fromX:e,fromY:t,toX:s,toY:n,fromPosition:o,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 S=l.J.outer.safeParse(m[1]);S.success&&(i=S.data)}const j=Re({sourcePos:l.q.construct(e,t),targetPos:l.q.construct(s,n),sourceOrientation:o,targetOrientation:i,sourceBox:J(f.useReactFlow(),(c==null?void 0:c.id)??""),targetBox:J(f.useReactFlow(),(c==null?void 0:c.id)??"")}),h=f.useReactFlow(),g=vn(l.q.construct(e,t),j,h.getZoom(),!1);return r.jsxRuntimeExports.jsx(f.BaseEdge,{path:kn(g),style:{...a,stroke:l.cssString(d==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},sc=({id:e,source:t,target:s,sourcePosition:n,targetHandleId:o,targetPosition:i,style:c,segments:a=[],onSegmentsChange:d,color:p="var(--pluto-gray-l9)",selected:m=!1,...j})=>{const h=l.q.construct(j.sourceX,j.sourceY),g=x.useRef(h),S=l.q.equals(h,g.current),b=l.q.construct(j.targetX,j.targetY),v=x.useRef(b),w=l.q.equals(b,v.current),E=f.useReactFlow(),[C,R,y]=u.useCombinedStateAndRef(()=>a.length>0?a:Re({sourcePos:h,targetPos:b,sourceOrientation:n,targetOrientation:i,sourceBox:J(E,t),targetBox:J(E,s)})),M=x.useRef(i),B=x.useRef(n),L=u.useDebouncedCallback(d,100,[d]);if(!S||!w){let P=C;const _=l.q.translation(g.current,h),A=l.q.translation(b,v.current);l.q.equals(_,l.q.scale(A,-1),.001)?(g.current=h,v.current=b):(S?w||(P=Qi({delta:A,segments:P}),M.current!==i&&(M.current=i,P=Re({sourcePos:h,targetPos:b,sourceOrientation:n,targetOrientation:i,sourceBox:J(E,t),targetBox:J(E,s)})),us({sourcePos:h,targetPos:b,next:P,prev:C})||(P=Re({sourcePos:h,targetPos:b,sourceOrientation:n,targetOrientation:i,sourceBox:J(E,t),targetBox:J(E,s)})),v.current=b):(P=Ki({delta:_,segments:P}),B.current!==n&&(B.current=n,P=Re({sourcePos:h,targetPos:b,sourceOrientation:n,targetOrientation:i,sourceBox:J(E,t),targetBox:J(E,s)})),us({sourcePos:h,targetPos:b,next:P,prev:C})||(P=Re({sourcePos:h,targetPos:b,sourceOrientation:n,targetOrientation:i,sourceBox:J(E,t),targetBox:J(E,s)})),g.current=h),L(P),R(P))}const $=x.useRef(null),T=st({onStart:x.useCallback((P,_,A)=>{$.current={index:Number(A.currentTarget.id.split("-")[1]),segments:[...y.current]}},[]),onMove:x.useCallback(P=>{if($.current==null)return;const _=Ui({segments:$.current.segments,index:$.current.index,magnitude:l.To.dim(P,l.g.swap($.current.segments[$.current.index].direction),!0)/E.getZoom()});R(_)},[]),onEnd:x.useCallback(()=>d(y.current),[d])}),N=vn(h,C,E.getZoom(),!0);return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(f.BaseEdge,{path:kn(N),style:{...c,stroke:l.cssString(p)},...j}),m&&nc(N).map((P,_)=>{const A=C[_].direction,I=l.g.swap(A),Z={[l.g.dimension(A)]:"18px",[l.g.dimension(I)]:"4px"},W={[A]:P[A]-9,[I]:P[I]-2};return r.jsxRuntimeExports.jsxs(x.Fragment,{children:[r.jsxRuntimeExports.jsx("rect",{className:l.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...Z,...W,rx:"2px",ry:"2px"}),r.jsxRuntimeExports.jsx("foreignObject",{x:P.x-9,y:P.y-9,width:"18px",height:"18px",children:r.jsxRuntimeExports.jsx("div",{id:`handle-${_}`,className:l.CSS(l.CSS.BE("diagram-edge-handle","dragger"),l.CSS.dir(A)),draggable:!0,onDragStart:T})})]},_)})]})},kn=e=>{let t="";const n=e.length+-1;for(let o=0;o<n;o++){const i=e[o%e.length],c=e[(o+1)%e.length],a=Math.min(6/Math.hypot(c.x-i.x,c.y-i.y),.5);o>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-a)+c.x*a},${i.y*(1-a)+c.y*a}`),o===0?t+=`M${i.x},${i.y}`:o===0&&(t+=`M${i.x*(1-a)+c.x*a},${i.y*(1-a)+c.y*a}`),o===n-1?t+=`L${c.x},${c.y}`:o<n-1&&(t+=`L${i.x*a+c.x*(1-a)},${i.y*a+c.y*(1-a)}`)}return t},nc=e=>e.slice(1).map((t,s)=>{const n=e[s];return l.q.construct((t.x+n.x)/2,(t.y+n.y)/2)}),rc=({initialNodes:e,initialEdges:t,allowEdit:s=!0,initialViewport:n={position:l.q.ZERO,zoom:1}})=>{const[o,i]=x.useState(s),[c,a]=x.useState(e),[d,p]=x.useState(t),[m,j]=x.useState(n),[h,g]=x.useState(!1);return{viewport:m,onViewportChange:j,edges:d,nodes:c,onNodesChange:a,onEdgesChange:p,editable:o,onEditableChange:i,fitViewOnResize:h,setFitViewOnResize:g}},oc=e=>e.source!==e.target,lc={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},ic={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},Pn={padding:0,maxZoom:1,minZoom:.5},cc={hideAttribution:!0},Ln=x.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),De=()=>x.useContext(Ln),Mn=x.memo(({children:e})=>{const{registerNodeRenderer:t}=De();return x.useEffect(()=>t(e),[t,e]),null});Mn.displayName="NodeRenderer";const ac=["Backspace","Delete"],uc=u.wrap$1(f.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:s,onEdgesChange:n,nodes:o,edges:i,onEditableChange:c,editable:a,viewport:d,triggers:p,onViewportChange:m,fitViewOnResize:j,setFitViewOnResize:h,...g})=>{const[{path:S},,b]=u.use$3({aetherKey:e,type:f.Diagram$1.TYPE,schema:f.diagramStateZ,initialState:{position:d.position,region:l.To.ZERO,zoom:d.zoom}}),v=u.use().colors.gray.l9.hex,w=u.useMemoCompare(()=>p??Dt.zoom,u.compareModeConfigs,[p]),{fitView:E}=f.useReactFlow(),C=Mt(x.useCallback(V=>{j&&E({maxZoom:1}),b(F=>({...F,region:V}))},[b,E,j])),R=x.useRef(null),y=x.useCallback(V=>{const F=R.current;F!=null&&F.x===V.x&&F.y===V.y&&F.zoom===V.zoom||(R.current=V,b(X=>({...X,position:V,zoom:V.zoom})),m(f.translateViewportBackward(V)))},[b,m]);f.useOnViewportChange({onStart:y,onChange:y,onEnd:y});const[M,B]=x.useState(()=>()=>null),L=x.useCallback(V=>B(()=>V),[]),$=x.useMemo(()=>({custom:({id:V,xPos:F,yPos:X,selected:$e})=>M({symbolKey:V,position:{x:F,y:X},selected:$e})}),[M]),T=x.useRef(i),N=x.useMemo(()=>(T.current=i,f.translateEdgesForward(i)),[i]),P=x.useRef(o),_=x.useMemo(()=>(P.current=o,f.translateNodesForward(o)),[o]),A=x.useCallback(V=>s(f.nodeConverter(P.current,F=>f.applyNodeChanges(V,F))),[s]),I=x.useCallback(V=>n(f.edgeConverter(T.current,F=>f.applyEdgeChanges(V,F),v)),[n,v]),Z=x.useCallback((V,F)=>n(f.edgeConverter(T.current,X=>f.updateEdge(V,F,X),v)),[]),W=x.useCallback(V=>{n(f.edgeConverter(T.current,F=>f.addEdge(V,F),v))},[n,v]),H=x.useCallback((V,F)=>{const X=[...T.current],$e=X.findIndex(Yr=>Yr.key===V);$e!==-1&&(X[$e]={...X[$e],segments:F},T.current=X,n(X))},[n]),Me=a?lc:ic,at=x.useMemo(()=>({default:V=>r.jsxRuntimeExports.jsx(sc,{...V,segments:V.data.segments,color:V.data.color,onSegmentsChange:x.useCallback(F=>H(V.id,F),[V.id])},V.id)}),[H]),Ut=x.useRef(null);u.use$2({triggers:w.zoomReset,callback:x.useCallback(({stage:V,cursor:F})=>{const X=Ut.current;X==null||V!=="start"||!l.To.contains(X,F)||E()},[E])});const Wt=u.purgeMouse(w.select)[0]??null,Xt=u.purgeMouse(w.pan)[0]??null,Ir=u.purgeMouse(w.zoom)[0]??null,Zr={selectionOnDrag:Wt==null,panOnDrag:Xt==null,selectionKeyCode:Wt,panActivationKeyCode:Xt,zoomActivationKeyCode:Ir},Fr=u.useCombinedRefs(Ut,C),qr=x.useMemo(()=>({editable:a,onEditableChange:c,registerNodeRenderer:L,fitViewOnResize:j,setFitViewOnResize:h}),[a,c,L,j]);return r.jsxRuntimeExports.jsx(Ln.Provider,{value:qr,children:r.jsxRuntimeExports.jsx(u.Composite,{path:S,children:r.jsxRuntimeExports.jsx(f.ReactFlow,{...Zr,className:l.CSS(l.CSS.B("diagram"),l.CSS.editable(a)),nodes:_,edges:N,nodeTypes:$,edgeTypes:at,ref:Fr,fitView:!0,onNodesChange:A,onEdgesChange:I,onConnect:W,onEdgeUpdate:Z,defaultViewport:f.translateViewportForward(d),connectionLineComponent:tc,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:oc,connectionMode:f.ConnectionMode.Loose,snapGrid:[3,3],fitViewOptions:Pn,selectionMode:f.SelectionMode.Partial,proOptions:cc,deleteKeyCode:ac,...g,style:{[l.CSS.var("diagram-zoom")]:d.zoom,...g.style},...Me,children:t})})})}),xc=()=>{const{editable:e}=De();return e?r.jsxRuntimeExports.jsx(Lo,{}):null},dc=({children:e,...t})=>r.jsxRuntimeExports.jsx(z.Pack,{direction:"y",className:l.CSS.BE("diagram","controls"),...t,children:e}),pc=({onClick:e,...t})=>{const{editable:s,onEditableChange:n}=De();return r.jsxRuntimeExports.jsx(u.ToggleIcon,{onChange:()=>n(!s),value:s,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:l.J.RIGHT_CENTER,tooltip:s?r.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Disable edit mode"}):r.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Enable edit mode"}),...t,children:s?r.jsxRuntimeExports.jsx(u.bt.EditOff,{}):r.jsxRuntimeExports.jsx(u.bt.Edit,{})})},mc=({onClick:e,...t})=>{const{fitView:s}=f.useReactFlow(),{fitViewOnResize:n,setFitViewOnResize:o}=De();return r.jsxRuntimeExports.jsx(u.ToggleIcon,{onClick:i=>{s(Pn),e==null||e(i)},value:n,onChange:i=>o(i),rightClickToggle:!0,tooltip:r.jsxRuntimeExports.jsx(u.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:l.J.RIGHT_CENTER,variant:"outlined",...t,children:r.jsxRuntimeExports.jsx(u.bt.Expand,{})})},fc=e=>r.jsxRuntimeExports.jsx(f.ReactFlowProvider,{children:r.jsxRuntimeExports.jsx(uc,{...e})}),jc=Object.freeze(Object.defineProperty({__proto__:null,Background:xc,Controls:dc,Diagram:fc,FitViewControl:mc,HandleLayout:Tn,NodeLayout:ct,NodeRenderer:Mn,ToggleEditControl:pc,alignNodes:Zi,selectNode:Gt,selectNodeBox:J,selectNodeLayout:ec,use:rc,useContext:De},Symbol.toStringTag,{value:"Module"})),hc=({value:e,onChange:t})=>{const{inner:s,outer:n}=e,o=i=>()=>t({...e,...i});return r.jsxRuntimeExports.jsxs(z.Space,{className:l.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[r.jsxRuntimeExports.jsx(ue,{selected:n==="top",onClick:o({outer:"top"})}),r.jsxRuntimeExports.jsxs(z.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[r.jsxRuntimeExports.jsx(ue,{selected:n==="left",onClick:o({outer:"left"})}),r.jsxRuntimeExports.jsxs(z.Space,{className:l.CSS.B("value"),direction:"y",align:"center",justify:"center",empty:!0,children:[r.jsxRuntimeExports.jsx(ue,{className:l.CSS(l.CSS.dir("y")),selected:s==="top",onClick:o({inner:"top"})}),r.jsxRuntimeExports.jsxs(z.Space,{direction:"x",align:"center",justify:"center",children:[r.jsxRuntimeExports.jsx(ue,{selected:s==="left",onClick:o({inner:"left"})}),r.jsxRuntimeExports.jsx(ue,{selected:s==="right",onClick:o({inner:"right"})})]}),r.jsxRuntimeExports.jsx(ue,{className:l.CSS(l.CSS.dir("y")),selected:s==="bottom",onClick:o({inner:"bottom"})})]}),r.jsxRuntimeExports.jsx(ue,{selected:n==="right",onClick:o({outer:"right"})})]}),r.jsxRuntimeExports.jsx(ue,{selected:n==="bottom",onClick:o({outer:"bottom"})})]})},ue=({selected:e,className:t,...s})=>r.jsxRuntimeExports.jsx(u.Icon,{variant:"text",className:l.CSS(t,l.CSS.selected(e)),...s,children:r.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Ht=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],ce=({className:e,direction:t,...s})=>r.jsxRuntimeExports.jsx(z.Space,{direction:t,align:"stretch",className:l.CSS(l.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...s}),Te=e=>r.jsxRuntimeExports.jsx(le,{label:"Orientation",padHelpText:!1,...e,children:({value:t,onChange:s})=>{var n;return r.jsxRuntimeExports.jsx(hc,{value:{inner:t.orientation??"top",outer:((n=t.label)==null?void 0:n.orientation)??"top"},onChange:o=>s({...t,orientation:o.inner,label:{...t.label,orientation:o.outer}})})}}),ke=({path:e})=>r.jsxRuntimeExports.jsxs(z.Space,{direction:"x",align:"stretch",children:[r.jsxRuntimeExports.jsx(le,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:t=>r.jsxRuntimeExports.jsx(u.Text$1,{selectOnFocus:!0,...t})}),r.jsxRuntimeExports.jsx(le,{path:e+".level",label:"Label Size",padHelpText:!1,children:t=>r.jsxRuntimeExports.jsx(se.SelectLevel,{...t})})]}),Ae=e=>r.jsxRuntimeExports.jsx(le,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:s,...n})=>r.jsxRuntimeExports.jsx(yt.Swatch,{value:t??l.ZERO.setAlpha(1).rgba255,onChange:o=>s(o.rgba255),...n})}),$n=({path:e})=>{var p,m;const{value:t,onChange:s}=Be({path:e}),n=f.sourcePipelinePropsZ.parse((p=t.source)==null?void 0:p.props),o=f.sinkPipelinePropsZ.parse((m=t.sink)==null?void 0:m.props),i=f.streamChannelValuePropsZ.parse(n.segments.valueStream.props),c=f.setChannelValuePropsZ.parse(o.segments.setter.props),a=j=>{j=j??0;const h=f.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:f.streamChannelValue({channel:j}),threshold:f.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});s({...t,source:h})},d=j=>{j=j??0;const h=f.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:f.setChannelValue({channel:j}),setpoint:f.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),g=f.authoritySource({channel:j}),S=f.acquireChannelControl({channel:j,authority:255});s({...t,sink:h,control:{...t.control,showChip:!0,chip:{sink:S,source:g},showIndicator:!0,indicator:{statusSource:g}}})};return r.jsxRuntimeExports.jsxs(ce,{direction:"x",grow:!0,align:"stretch",children:[r.jsxRuntimeExports.jsx(de.Item,{label:"State Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Oe,{value:i.channel,onChange:a})}),r.jsxRuntimeExports.jsx(de.Item,{label:"Command Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Oe,{value:c.channel,onChange:d})})]})},Pe=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return r.jsxRuntimeExports.jsx($n,{path:""});default:return r.jsxRuntimeExports.jsxs(ce,{direction:"x",align:"stretch",children:[r.jsxRuntimeExports.jsxs(z.Space,{direction:"y",grow:!0,children:[r.jsxRuntimeExports.jsx(ke,{path:"label"}),r.jsxRuntimeExports.jsx(Ae,{path:"color",hideIfNull:!0,optional:!0})]}),r.jsxRuntimeExports.jsx(Te,{path:""})]})}},[]),t=K.useStatic({tabs:Ht,content:e});return r.jsxRuntimeExports.jsx(K.Tabs,{...t})},gc=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return r.jsxRuntimeExports.jsx($n,{path:""});default:return r.jsxRuntimeExports.jsxs(ce,{direction:"x",align:"stretch",children:[r.jsxRuntimeExports.jsxs(z.Space,{direction:"y",grow:!0,children:[r.jsxRuntimeExports.jsx(ke,{path:"label"}),r.jsxRuntimeExports.jsxs(z.Space,{direction:"x",children:[r.jsxRuntimeExports.jsx(Ae,{path:"color"}),r.jsxRuntimeExports.jsx(le,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,children:n=>r.jsxRuntimeExports.jsx(u.Switch$1,{...n})})]})]}),r.jsxRuntimeExports.jsx(Te,{path:""})]})}},[]),t=K.useStatic({tabs:Ht,content:e});return r.jsxRuntimeExports.jsx(K.Tabs,{...t})},ie=()=>r.jsxRuntimeExports.jsxs(ce,{direction:"x",children:[r.jsxRuntimeExports.jsxs(z.Space,{direction:"y",grow:!0,children:[r.jsxRuntimeExports.jsx(ke,{path:"label"}),r.jsxRuntimeExports.jsx(Ae,{path:"color"})]}),r.jsxRuntimeExports.jsx(Te,{path:""})]}),js={y:2,x:.25},hs={lower:0,upper:2e3},Sc=()=>r.jsxRuntimeExports.jsxs(ce,{direction:"x",align:"stretch",children:[r.jsxRuntimeExports.jsxs(z.Space,{direction:"y",grow:!0,children:[r.jsxRuntimeExports.jsx(ke,{path:"label"}),r.jsxRuntimeExports.jsxs(z.Space,{direction:"x",children:[r.jsxRuntimeExports.jsx(Ae,{path:"color"}),r.jsxRuntimeExports.jsx(le,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>r.jsxRuntimeExports.jsx(u.Numeric,{value:e??200,dragScale:js,bounds:hs,...t})}),r.jsxRuntimeExports.jsx(le,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>r.jsxRuntimeExports.jsx(u.Numeric,{value:e??200,dragScale:js,bounds:hs,...t})})]})]}),r.jsxRuntimeExports.jsx(Te,{path:""})]}),Ec=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],Rc=({path:e})=>{var j;const{value:t,onChange:s}=Be({path:e}),n=f.sourcePipelinePropsZ.parse((j=t.telem)==null?void 0:j.props),o=f.streamChannelValuePropsZ.parse(n.segments.valueStream.props),i=f.stringifyNumberProps.parse(n.segments.stringifier.props),c=f.rollingAverageProps.parse(n.segments.rollingAverage.props),a=h=>{const g=f.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:f.streamChannelValue({channel:h??0}),stringifier:f.stringifyNumber({precision:i.precision??2}),rollingAverage:f.rollingAverage({windowSize:c.windowSize??1})},outlet:"stringifier"});s({...t,telem:g})},d=h=>{const g=f.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:f.streamChannelValue({channel:o.channel}),stringifier:f.stringifyNumber({precision:h}),rollingAverage:f.rollingAverage({windowSize:c.windowSize})},outlet:"stringifier"});s({...t,telem:g})},p=h=>{const g=f.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:f.stringifyNumber({precision:i.precision??2}),valueStream:f.streamChannelValue({channel:o.channel}),rollingAverage:f.rollingAverage({windowSize:h})},outlet:"stringifier"});s({...t,telem:g})},m=Pt(o.channel);return x.useEffect(()=>{s({...t,tooltip:[m]})},[m]),r.jsxRuntimeExports.jsxs(ce,{direction:"x",align:"stretch",children:[r.jsxRuntimeExports.jsx(de.Item,{label:"Input Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Oe,{value:o.channel,onChange:a})}),r.jsxRuntimeExports.jsx(de.Item,{label:"Precision",align:"start",children:r.jsxRuntimeExports.jsx(u.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:d})}),r.jsxRuntimeExports.jsx(de.Item,{label:"Averaging Window",align:"start",children:r.jsxRuntimeExports.jsx(u.Numeric,{value:c.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})},Cc=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"telemetry":return r.jsxRuntimeExports.jsx(Rc,{path:""});default:return r.jsxRuntimeExports.jsxs(ce,{direction:"x",children:[r.jsxRuntimeExports.jsxs(z.Space,{direction:"y",grow:!0,children:[r.jsxRuntimeExports.jsx(ke,{path:"label"}),r.jsxRuntimeExports.jsxs(z.Space,{direction:"x",children:[r.jsxRuntimeExports.jsx(Ae,{path:"color"}),r.jsxRuntimeExports.jsx(le,{path:"units",label:"Units",align:"start",padHelpText:!1,children:n=>r.jsxRuntimeExports.jsx(u.Text$1,{...n})})]})]}),r.jsxRuntimeExports.jsx(Te,{path:""})]})}},[]),t=K.useStatic({tabs:Ec,content:e});return r.jsxRuntimeExports.jsx(K.Tabs,{...t})},bc=({path:e})=>{var c;const{value:t,onChange:s}=Be({path:e}),n=f.sinkPipelinePropsZ.parse((c=t.sink)==null?void 0:c.props),o=f.setChannelValuePropsZ.parse(n.segments.setter.props),i=a=>{const d=f.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:f.setChannelValue({channel:a}),setpoint:f.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),p=f.authoritySource({channel:a}),m=f.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 r.jsxRuntimeExports.jsx(ce,{direction:"y",children:r.jsxRuntimeExports.jsx(de.Item,{label:"Output Channel",children:r.jsxRuntimeExports.jsx(Oe,{value:o.channel,onChange:i})})})},yc=()=>{const e=x.useCallback(({tabKey:s})=>{switch(s){case"control":return r.jsxRuntimeExports.jsx(bc,{path:""});default:return r.jsxRuntimeExports.jsxs(ce,{direction:"x",align:"stretch",children:[r.jsxRuntimeExports.jsx(z.Space,{direction:"y",grow:!0,children:r.jsxRuntimeExports.jsx(ke,{path:"label"})}),r.jsxRuntimeExports.jsx(Te,{path:""})]})}},[]),t=K.useStatic({tabs:Ht,content:e});return r.jsxRuntimeExports.jsx(K.Tabs,{...t})},vc=({aetherKey:e,sink:t})=>{const s=u.useMemoDeepEqualProps({sink:t}),[,,n]=u.use$3({aetherKey:e,type:f.Button.TYPE,schema:f.buttonStateZ,initialState:{trigger:0,sink:t}});return x.useEffect(()=>{n(i=>({...i,...s}))},[s]),{click:x.useCallback(()=>{n(i=>({...i,trigger:i.trigger+1}))},[n])}},q=x.forwardRef(({label:e="",onChange:t,level:s="p",children:n,orientation:o="top",style:i,className:c,...a},d)=>r.jsxRuntimeExports.jsxs(z.Space,{style:{marginRight:o==="right"?1:0,marginTop:o==="top"?1:0,...i},size:2/3,direction:o,ref:d,className:l.CSS(l.CSS.B("symbol"),c),align:"center",justify:"center",...a,children:[e.length>0&&r.jsxRuntimeExports.jsx(u.Editable,{className:l.CSS.BE("symbol","label"),value:e,onChange:x.useCallback(p=>t({label:{label:p,level:s,orientation:o}}),[t,s]),level:s}),n]}));q.displayName="Labeled";const D=e=>r.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),wc=e=>r.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Tc=e=>r.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),bt=e=>r.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),kc={left:{left:f.Position.Left,right:f.Position.Right,top:f.Position.Top,bottom:f.Position.Bottom},right:{left:f.Position.Right,right:f.Position.Left,top:f.Position.Bottom,bottom:f.Position.Top},top:{left:f.Position.Bottom,right:f.Position.Top,top:f.Position.Left,bottom:f.Position.Right},bottom:{left:f.Position.Top,right:f.Position.Bottom,top:f.Position.Right,bottom:f.Position.Left}},Pc=(e,t)=>kc[t][e],Lc=(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},Y=({children:e,orientation:t})=>{let s;try{s=f.useUpdateNodeInternals()}catch{return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{})}const n=x.useRef(null),o=x.useRef(!0);return x.useEffect(()=>{if(n.current==null)return;if(o.current){o.current=!1;return}const i=n.current.closest(".react-flow__node"),c=i==null?void 0:i.getAttribute("data-id");c!=null&&(s==null||s(c))},[t]),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("span",{ref:n}),e]})},O=({location:e,orientation:t,left:s,top:n,...o})=>{const i=Lc(n,s,t);return r.jsxRuntimeExports.jsx(f.Handle$1,{position:Pc(e,t),...o,type:"source",onClick:c=>c.stopPropagation(),className:(l.CSS.B("handle"),l.CSS.BE("handle",o.id)),style:{left:`${i.left}%`,top:`${i.top}%`}})},Le=({className:e,enabled:t=!1,triggered:s=!1,orientation:n="left",color:o,...i})=>r.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("symbol-primitive"),l.CSS.B("symbol-primitive-toggle"),n!=null&&l.CSS.loc(n),t&&l.CSS.M("enabled"),s&&l.CSS.M("triggered"),e),color:l.cssString(o),...i}),Q=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:l.CSS(l.CSS.B("symbol-primitive"),e),...t}),Mc=.8,U=({dimensions:e,orientation:t="left",children:s,className:n,color:o,style:i={},scale:c=1,...a})=>{e=l.g.construct(t)==="y"?l._.swap(e):e;const p=l.cssString(o);return o!=null&&(i[l.CSS.var("symbol-color")]=new l.Color(o).rgbString),r.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:l._.svgViewBox(e),className:l.CSS(l.CSS.loc(t),n),fill:p,stroke:p,...a,style:{aspectRatio:`${e.width} / ${e.height}`,width:l._.scale(e,c*Mc).width,...i},children:r.jsxRuntimeExports.jsx("g",{children:s})})},Nn=({className:e,orientation:t,scale:s,color:n,...o})=>r.jsxRuntimeExports.jsxs(Le,{...o,orientation:t,className:l.CSS(l.CSS.B("four-way-valve"),e),children:[r.jsxRuntimeExports.jsxs(Y,{orientation:t,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:"left",left:0,top:50,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:"left",left:100,top:50,id:"2"}),r.jsxRuntimeExports.jsx(O,{location:"top",orientation:"left",left:50,top:0,id:"3"}),r.jsxRuntimeExports.jsx(O,{location:"bottom",orientation:"left",left:50,top:100,id:"4"})]}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:87},color:n,scale:s,children:[r.jsxRuntimeExports.jsx(D,{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"}),r.jsxRuntimeExports.jsx(D,{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"})]})]}),_n=({color:e,orientation:t="left",scale:s,...n})=>r.jsxRuntimeExports.jsxs(Le,{...n,className:l.CSS(l.CSS.B("three-way-valve")),orientation:t,children:[r.jsxRuntimeExports.jsxs(Y,{orientation:t,children:[r.jsxRuntimeExports.jsx(O,{location:"bottom",orientation:t,left:50,top:100,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"left",orientation:t,left:0,top:33,id:"2"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:t,left:100,top:33,id:"3"})]}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:64},color:e,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(D,{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"}),r.jsxRuntimeExports.jsx(D,{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"})]})]}),On=({orientation:e="left",color:t,scale:s,...n})=>r.jsxRuntimeExports.jsxs(Le,{...n,children:[r.jsxRuntimeExports.jsxs(Y,{orientation:e,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:e,left:0,top:50,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:e,left:100,top:50,id:"2"})]}),r.jsxRuntimeExports.jsx(U,{dimensions:{width:87,height:42},color:t,orientation:e,scale:s,children:r.jsxRuntimeExports.jsx(D,{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:n=!1,scale:o,...i})=>r.jsxRuntimeExports.jsxs(Le,{className:l.CSS(l.CSS.B("solenoid-valve"),n&&l.CSS.M("normally-open"),e),...i,children:[r.jsxRuntimeExports.jsxs(Y,{orientation:s,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:s,left:1,top:69,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:s,left:99,top:69,id:"2"})]}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:69},color:t,orientation:s,scale:o,children:[r.jsxRuntimeExports.jsx(D,{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"}),r.jsxRuntimeExports.jsx(D,{d:"M43.5 47L43.5 24.6177"}),r.jsxRuntimeExports.jsx(wc,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),zn=({className:e,orientation:t="left",color:s,scale:n,...o})=>r.jsxRuntimeExports.jsxs(Q,{orientation:t,className:l.CSS(l.CSS.B("relief-valve"),e),...o,children:[r.jsxRuntimeExports.jsxs(Y,{orientation:t,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:t,left:1,top:66,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:58},color:s,orientation:t,scale:n,children:[r.jsxRuntimeExports.jsx(D,{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"}),r.jsxRuntimeExports.jsx(D,{d:"M43.5 2L43.5 38",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(D,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(D,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(D,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Dn=({className:e,orientation:t="left",color:s,scale:n,...o})=>r.jsxRuntimeExports.jsxs(Q,{orientation:t,className:l.CSS(l.CSS.B("check-valve"),e),...o,children:[r.jsxRuntimeExports.jsxs(Y,{orientation:t,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:t,left:1,top:50,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:45,height:43},color:s,orientation:t,scale:n,children:[r.jsxRuntimeExports.jsx(D,{d:"M43 2L43 40",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(D,{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"})]})]}),An=({color:e,className:t,orientation:s="left",scale:n,...o})=>r.jsxRuntimeExports.jsxs(Le,{...o,orientation:s,className:l.CSS(l.CSS.B("angled-valve"),t),children:[r.jsxRuntimeExports.jsxs(Y,{orientation:s,children:[r.jsxRuntimeExports.jsx(O,{location:"bottom",orientation:s,left:33,top:100,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:s,left:100,top:35,id:"2"})]}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:s,scale:n,children:[r.jsxRuntimeExports.jsx(D,{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"}),r.jsxRuntimeExports.jsx(D,{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"}),r.jsxRuntimeExports.jsx(D,{d:"M24.3461 18.5709L21.7484 19.88C20.9998 20.2572 20.3887 20.8601 20.0012 21.6035L19.3383 22.8756"})]})]}),Vn=({color:e,className:t,orientation:s="left",scale:n,...o})=>r.jsxRuntimeExports.jsxs(Le,{...o,className:l.CSS(l.CSS.B("pump"),t),orientation:s,children:[r.jsxRuntimeExports.jsxs(Y,{orientation:s,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:s,left:1,top:39,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:s,left:95,top:3,id:"2"})]}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:68,height:61},color:e,orientation:s,scale:n,children:[r.jsxRuntimeExports.jsx(Tc,{cx:"35",cy:"25",r:"23"}),r.jsxRuntimeExports.jsx(D,{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"}),r.jsxRuntimeExports.jsx(bt,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),r.jsxRuntimeExports.jsx(bt,{x1:"1",y1:"24",x2:"35",y2:"24"})]})]}),In=({className:e,color:t,orientation:s="left",scale:n,...o})=>{const i=l.cssString(t);return r.jsxRuntimeExports.jsxs(Q,{...o,className:l.CSS(l.CSS.B("symbol"),e),children:[r.jsxRuntimeExports.jsx(Y,{orientation:s,children:r.jsxRuntimeExports.jsx(O,{location:"left",orientation:s,left:2,top:50,id:"1"})}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:40,height:48},color:t,orientation:s,scale:n,children:[r.jsxRuntimeExports.jsx(D,{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"}),r.jsxRuntimeExports.jsx(D,{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}),r.jsxRuntimeExports.jsx(D,{d:"M33 24H3",strokeLinecap:"round"})]})]})},Zn=({className:e,orientation:t="left",color:s,scale:n,...o})=>r.jsxRuntimeExports.jsxs(Q,{className:l.CSS(l.CSS.B("cap"),e),...o,children:[r.jsxRuntimeExports.jsx(Y,{orientation:t,children:r.jsxRuntimeExports.jsx(O,{location:"left",orientation:t,left:0,top:50,id:"1"})}),r.jsxRuntimeExports.jsx(U,{color:s,dimensions:{width:26,height:48},orientation:t,scale:n,children:r.jsxRuntimeExports.jsx(D,{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"})})]}),Fn=({className:e,orientation:t="left",color:s,scale:n,...o})=>r.jsxRuntimeExports.jsxs(Q,{className:l.CSS(l.CSS.B("manual-valve"),e),...o,children:[r.jsxRuntimeExports.jsxs(Y,{orientation:t,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:t,left:1,top:58,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:t,left:99,top:58,id:"2"})]}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:48},color:s,orientation:t,scale:n,children:[r.jsxRuntimeExports.jsx(bt,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),r.jsxRuntimeExports.jsx(D,{d:"M19.64 2L66.68 2",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(D,{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"})]})]}),qn=({className:e,orientation:t="left",color:s,scale:n,...o})=>r.jsxRuntimeExports.jsxs(Q,{className:l.CSS(l.CSS.B("filter"),e),...o,children:[r.jsxRuntimeExports.jsxs(Y,{orientation:t,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:t,left:2,top:50,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:t,left:98,top:50,id:"2"})]}),r.jsxRuntimeExports.jsx(U,{dimensions:{width:52,height:34},orientation:t,color:s,scale:n,children:r.jsxRuntimeExports.jsx(D,{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"})})]}),$c=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,Nc=e=>{const{topLeft:t,topRight:s,bottomLeft:n,bottomRight:o}=e;return`${t.x}% ${s.x}% ${o.x}% ${n.x}% / ${t.y}% ${s.y}% ${o.y}% ${n.y}%`},_c={width:40,height:80},Oc={x:50,y:10},Yn=({className:e,dimensions:t=_c,borderRadius:s=Oc,color:n,...o})=>{const i=$c(s),c=u.use();return r.jsxRuntimeExports.jsx(Q,{className:l.CSS(e,l.CSS.B("tank")),style:{...t,borderRadius:Nc(i),borderColor:l.cssString(n??c.colors.gray.l9)},...o,children:r.jsxRuntimeExports.jsxs(Y,{children:[r.jsxRuntimeExports.jsx(O,{location:"top",orientation:"left",left:50,top:0,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"top",orientation:"left",left:-.5,top:i.topLeft.y-1,id:"2"}),r.jsxRuntimeExports.jsx(O,{location:"top",orientation:"left",left:101,top:i.topRight.y-1,id:"3"}),r.jsxRuntimeExports.jsx(O,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),r.jsxRuntimeExports.jsx(O,{location:"bottom",orientation:"left",left:-.5,top:100-i.bottomLeft.y+1,id:"5"}),r.jsxRuntimeExports.jsx(O,{location:"bottom",orientation:"left",left:101,top:100-i.bottomRight.y+1,id:"6"}),r.jsxRuntimeExports.jsx(O,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},Gn=({className:e,orientation:t="left",color:s,scale:n,...o})=>r.jsxRuntimeExports.jsxs(Q,{className:l.CSS(e,l.CSS.B("regulator")),...o,children:[r.jsxRuntimeExports.jsxs(Y,{orientation:t,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:t,left:0,top:66,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:t,left:100,top:66,id:"2"})]}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:84,height:58},orientation:t,color:s,scale:n,children:[r.jsxRuntimeExports.jsx(D,{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"}),r.jsxRuntimeExports.jsx(D,{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"})]})]}),Hn=({className:e,orientation:t="left",scale:s,color:n,...o})=>r.jsxRuntimeExports.jsxs(Q,{className:l.CSS(l.CSS.B("orifice"),e),...o,children:[r.jsxRuntimeExports.jsxs(Y,{orientation:t,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:t,left:0,top:50,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:t,left:100,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:70,height:34},orientation:t,color:n,scale:s,children:[r.jsxRuntimeExports.jsx(D,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(D,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Un=({className:e,orientation:t="left",color:s,scale:n,...o})=>r.jsxRuntimeExports.jsxs(Q,{className:l.CSS(l.CSS.B("needle-valve"),e),...o,children:[r.jsxRuntimeExports.jsxs(Y,{orientation:t,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:t,left:1,top:50,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:42},orientation:t,color:s,scale:n,children:[r.jsxRuntimeExports.jsx(D,{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)}),r.jsxRuntimeExports.jsx(D,{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"})]})]}),Wn=({className:e,orientation:t="left",color:s,scale:n,...o})=>r.jsxRuntimeExports.jsxs(Q,{orientation:t,className:l.CSS(l.CSS.B("angled-relief-valve"),e),...o,children:[r.jsxRuntimeExports.jsxs(Y,{children:[r.jsxRuntimeExports.jsx(O,{location:"bottom",orientation:t,left:33,top:100,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:t,left:100,top:45,id:"2"})]}),r.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:79},orientation:t,color:s,scale:n,children:[r.jsxRuntimeExports.jsx(D,{d:"M20.75 2L20.75 38",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(D,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(D,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(D,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(D,{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"}),r.jsxRuntimeExports.jsx(D,{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"}),r.jsxRuntimeExports.jsx(D,{d:"M24.3461 33.5709L21.7484 34.88C20.9998 35.2572 20.3887 35.8601 20.0012 36.6035L19.3383 37.8756"})]})]}),Xn=({className:e,color:t,dimensions:s,orientation:n,units:o="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))),r.jsxRuntimeExports.jsxs(Q,{className:l.CSS(l.CSS.B("value"),e),...c,style:{borderColor:a,height:s==null?void 0:s.height,width:"100%"},children:[r.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","content"),style:{flexGrow:1,minWidth:s==null?void 0:s.width,inlineSize:80},children:i}),r.jsxRuntimeExports.jsxs(Y,{orientation:n,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:"left",left:-2,top:50,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:"left",left:102,top:50,id:"2"}),r.jsxRuntimeExports.jsx(O,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),r.jsxRuntimeExports.jsx(O,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),r.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","units"),style:{background:a},children:r.jsxRuntimeExports.jsx(u.Text,{level:"small",color:p,children:o})})]})},Jn=({enabled:e=!1,onClick:t,orientation:s="left"})=>r.jsxRuntimeExports.jsxs(Q,{orientation:s,children:[r.jsxRuntimeExports.jsx(u.Switch$1,{value:e,onClick:t,onChange:()=>{}}),r.jsxRuntimeExports.jsxs(Y,{orientation:s,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:s,left:0,top:50,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:s,left:100,top:50,id:"2"})]})]}),Kn=({onClick:e,orientation:t="left",label:s=""})=>r.jsxRuntimeExports.jsxs(Q,{orientation:t,children:[r.jsxRuntimeExports.jsx(u.Button,{onClick:e,children:s}),r.jsxRuntimeExports.jsxs(Y,{orientation:t,children:[r.jsxRuntimeExports.jsx(O,{location:"left",orientation:t,left:0,top:50,id:"1"}),r.jsxRuntimeExports.jsx(O,{location:"right",orientation:t,left:100,top:50,id:"2"}),r.jsxRuntimeExports.jsx(O,{location:"top",orientation:t,left:50,top:0,id:"3"}),r.jsxRuntimeExports.jsx(O,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),Se=({aetherKey:e,source:t,sink:s})=>{const n=u.useMemoDeepEqualProps({source:t,sink:s}),[,{triggered:o,enabled:i},c]=u.use$3({aetherKey:e,type:f.Toggle.TYPE,schema:f.toggleStateZ,initialState:{triggered:!1,enabled:!1,...n}});return x.useEffect(()=>{c(d=>({...d,...n}))},[n,c]),{toggle:x.useCallback(()=>c(d=>({...d,triggered:!d.triggered})),[c]),triggered:o,enabled:i}},Bc=f.Value.z.omit({font:!0}).partial({color:!0}).extend({level:k.levelZ.optional()}),Qn=({aetherKey:e,box:t,telem:s,color:n,precision:o,minWidth:i,level:c="small"})=>{const a=u.useMemoDeepEqualProps({box:t,telem:s,color:n,precision:o,level:c,minWidth:i}),[,d,p]=u.use$3({aetherKey:e,type:f.Value.TYPE,schema:f.Value.z,initialState:a});return x.useLayoutEffect(()=>p(m=>({...m,...a})),[a]),{width:d.width??d.minWidth}},zc=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:Bc,use:Qn},Symbol.toStringTag,{value:"Module"})),er=e=>l.g.construct(e)==="x"?l.J.swap(e):e,Dc=e=>l.g.construct(e)==="y"?l.J.swap(e):e,ae=({showChip:e=!0,showIndicator:t=!0,indicator:s,orientation:n="left",chip:o,children:i,...c})=>r.jsxRuntimeExports.jsxs(z.Space,{direction:l.J.rotate90(n),align:"center",justify:"center",empty:!0,...c,children:[r.jsxRuntimeExports.jsxs(z.Space,{direction:l.g.construct(n),align:"center",className:l.CSS(l.CSS.B("control-state")),size:"small",children:[e&&r.jsxRuntimeExports.jsx(Sn,{size:"small",...o}),t&&r.jsxRuntimeExports.jsx(Cn,{...s})]}),i]}),tr=u.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:s,control:n,source:o,sink:i,orientation:c="left",color:a})=>{const{enabled:d,triggered:p,toggle:m}=Se({aetherKey:e,source:o,sink:i});return r.jsxRuntimeExports.jsx(q,{...t,onChange:s,children:r.jsxRuntimeExports.jsx(ae,{...n,orientation:er(c),children:r.jsxRuntimeExports.jsx(_n,{enabled:d,triggered:p,onClick:m,orientation:c,color:a})})})}),sr=e=>r.jsxRuntimeExports.jsx(_n,{...e}),nr=u.wrap$1("Valve",({control:e,aetherKey:t,label:s,onChange:n,source:o,sink:i,orientation:c,color:a})=>{const{enabled:d,triggered:p,toggle:m}=Se({aetherKey:t,source:o,sink:i});return r.jsxRuntimeExports.jsx(q,{...s,onChange:n,children:r.jsxRuntimeExports.jsx(ae,{...e,orientation:c,children:r.jsxRuntimeExports.jsx(On,{enabled:d,triggered:p,onClick:m,orientation:c,color:a})})})}),rr=e=>r.jsxRuntimeExports.jsx(On,{...e}),or=u.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:s,orientation:n="left",normallyOpen:o,color:i,source:c,sink:a,control:d})=>{const{enabled:p,triggered:m,toggle:j}=Se({aetherKey:e,source:c,sink:a});return r.jsxRuntimeExports.jsx(q,{...t,onChange:s,children:r.jsxRuntimeExports.jsx(ae,{...d,orientation:Dc(n),children:r.jsxRuntimeExports.jsx(Bn,{enabled:p,triggered:m,onClick:j,orientation:n,color:i,normallyOpen:o})})})}),lr=e=>r.jsxRuntimeExports.jsx(Bn,{...e}),ir=u.wrap$1("FourWayValve",({aetherKey:e,control:t,label:s,onChange:n,orientation:o,color:i,source:c,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=Se({aetherKey:e,source:c,sink:a});return r.jsxRuntimeExports.jsx(q,{...s,onChange:n,children:r.jsxRuntimeExports.jsx(ae,{...t,orientation:o,children:r.jsxRuntimeExports.jsx(Nn,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),cr=e=>r.jsxRuntimeExports.jsx(Nn,{...e}),ar=u.wrap$1("AngleValve",({aetherKey:e,label:t,control:s,onChange:n,orientation:o="left",color:i,source:c,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=Se({aetherKey:e,source:c,sink:a});return r.jsxRuntimeExports.jsx(q,{...t,onChange:n,children:r.jsxRuntimeExports.jsx(ae,{...s,orientation:er(o),children:r.jsxRuntimeExports.jsx(An,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),ur=e=>r.jsxRuntimeExports.jsx(An,{...e}),xr=u.wrap$1("Pump",({aetherKey:e,label:t,control:s,onChange:n,orientation:o,color:i,source:c,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=Se({aetherKey:e,source:c,sink:a});return r.jsxRuntimeExports.jsx(q,{...t,onChange:n,children:r.jsxRuntimeExports.jsx(ae,{...s,orientation:o,children:r.jsxRuntimeExports.jsx(Vn,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),dr=e=>r.jsxRuntimeExports.jsx(Vn,{...e}),pr=u.wrap$1("Tank",({label:e,onChange:t,orientation:s,color:n,dimensions:o,borderRadius:i})=>r.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:r.jsxRuntimeExports.jsx(Yn,{onResize:c=>t({dimensions:c}),orientation:s,color:n,dimensions:o,borderRadius:i})})),mr=e=>r.jsxRuntimeExports.jsx(Yn,{...e,dimensions:{width:25,height:50}}),fr=({label:e,onChange:t,orientation:s,color:n})=>r.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:r.jsxRuntimeExports.jsx(zn,{orientation:s,color:n})}),jr=e=>r.jsxRuntimeExports.jsx(zn,{...e}),hr=({label:e,onChange:t,orientation:s,color:n})=>r.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:r.jsxRuntimeExports.jsx(Gn,{orientation:s,color:n})}),gr=e=>r.jsxRuntimeExports.jsx(Gn,{...e}),Sr=({label:e,onChange:t,orientation:s,color:n})=>r.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:r.jsxRuntimeExports.jsx(In,{orientation:s,color:n})}),Er=e=>r.jsxRuntimeExports.jsx(In,{...e}),Rr=({label:e,onChange:t,orientation:s,color:n})=>r.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:r.jsxRuntimeExports.jsx(Zn,{orientation:s,color:n})}),Cr=e=>r.jsxRuntimeExports.jsx(Zn,{...e}),br=({label:e,onChange:t,orientation:s,color:n})=>r.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:r.jsxRuntimeExports.jsx(Fn,{orientation:s,color:n})}),yr=e=>r.jsxRuntimeExports.jsx(Fn,{...e}),vr=({label:e,onChange:t,orientation:s,color:n})=>r.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:r.jsxRuntimeExports.jsx(qn,{orientation:s,color:n})}),wr=e=>r.jsxRuntimeExports.jsx(qn,{...e}),Tr=({label:e,onChange:t,orientation:s,color:n})=>r.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:r.jsxRuntimeExports.jsx(Un,{orientation:s,color:n})}),kr=e=>r.jsxRuntimeExports.jsx(Un,{...e}),Pr=({label:e,onChange:t,orientation:s,color:n})=>r.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:r.jsxRuntimeExports.jsx(Dn,{orientation:s,color:n})}),Lr=e=>r.jsxRuntimeExports.jsx(Dn,{...e}),Mr=({label:e,onChange:t,orientation:s,color:n})=>r.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:r.jsxRuntimeExports.jsx(Hn,{orientation:s,color:n})}),$r=e=>r.jsxRuntimeExports.jsx(Hn,{...e}),Nr=({label:e,onChange:t,orientation:s,color:n})=>r.jsxRuntimeExports.jsx(q,{...e,onChange:t,children:r.jsxRuntimeExports.jsx(Wn,{orientation:s,color:n})}),_r=e=>r.jsxRuntimeExports.jsx(Wn,{...e}),Or=u.wrap$1("Value",({aetherKey:e,label:t,level:s="p",position:n,className:o,textColor:i,color:c,telem:a,units:d,onChange:p,tooltip:m})=>{const j=u.useTypography(s),[h,g]=x.useState({outerBox:l.To.ZERO,labelBox:l.To.ZERO}),S=(j.lineHeight+.5)*j.baseSize+2,b=u.useResize(x.useCallback(C=>{const R=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);let y={...l.To.ZERO};R!=null&&(y=l.To.construct(R),y=l.To.resize(y,{width:l.To.width(y),height:l.To.height(y)})),g({outerBox:C,labelBox:y})},[]),{}),{zoom:v}=f.useInitialViewport(),w=Vc({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:S,position:n,zoom:v,...h}),{width:E}=Qn({aetherKey:e,color:i,level:s,box:w,telem:a,minWidth:60});return r.jsxRuntimeExports.jsxs(u.Dialog$1,{location:{y:"top"},hide:m==null||m.length===0,children:[r.jsxRuntimeExports.jsx(z.Space,{direction:"y",children:m==null?void 0:m.map((C,R)=>r.jsxRuntimeExports.jsx(u.Text,{level:"small",children:C},R))}),r.jsxRuntimeExports.jsx(q,{className:l.CSS(o,l.CSS.B("value-labeled")),ref:b,onChange:p,...t,children:r.jsxRuntimeExports.jsx(Xn,{color:c,dimensions:{height:S,width:E},units:d})})]})}),Ac=.9,Vc=({labelOrientation:e,outerBox:t,labelBox:s,valueBoxHeight:n,position:o,hasLabel:i,zoom:c})=>{const a=l.q.scale(l.To.dims(s),1/(Ac*c));return l.g.construct(e)==="x"&&(o=l.q.translate(o,"y",Math.max((a.y-n)/2-1,0))),i&&e==="left"?o=l.q.translate(o,"x",a.x+4):i&&e==="top"&&(o=l.q.translate(o,"y",a.y+4)),l.To.construct(o.x,o.y,l.To.width(t),n)},Br=({color:e})=>r.jsxRuntimeExports.jsx(Xn,{color:e,dimensions:{width:60,height:25},units:"psi",children:r.jsxRuntimeExports.jsx(u.Text,{level:"p",children:"50.00"})}),zr=u.wrap$1("Switch",({aetherKey:e,label:t,control:s,onChange:n,orientation:o,color:i,source:c,sink:a})=>{const{enabled:d,triggered:p,toggle:m}=Se({aetherKey:e,source:c,sink:a});return r.jsxRuntimeExports.jsx(q,{...t,onChange:n,children:r.jsxRuntimeExports.jsx(ae,{...s,orientation:o,children:r.jsxRuntimeExports.jsx(Jn,{enabled:d,triggered:p,onClick:m,orientation:o,color:i})})})}),Dr=e=>r.jsxRuntimeExports.jsx(Jn,{...e}),Ar=u.wrap$1("Button",({aetherKey:e,label:t,orientation:s,sink:n,control:o})=>{const{click:i}=vc({aetherKey:e,sink:n});return r.jsxRuntimeExports.jsx(ae,{...o,className:l.CSS.B("symbol"),orientation:s,children:r.jsxRuntimeExports.jsx(Kn,{label:t==null?void 0:t.label,onClick:i})})}),Vr=({label:e,...t})=>r.jsxRuntimeExports.jsx(Kn,{label:"Button",...t}),G=4,Ic=2,Zc=["threeWayValve","valve","solenoidValve","fourWayValve","angledValve","pump","tank","reliefValve","regulator","burstDisc","cap","manualValve","filter","needleValve","checkValve","orifice","angledReliefValve","value","button","switch"];ee.z.enum(Zc);const Ee={source:f.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:f.streamChannelValue({channel:0}),threshold:f.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"}),sink:f.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:f.setChannelValue({channel:0}),setpoint:f.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},Fc={name:"Three Way Valve",key:"threeWayValve",Form:Pe,Symbol:tr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Three Way Valve",level:"p",orientation:"top"},...Ee,orientation:"left"}),Preview:sr,zIndex:G},qc={name:"Valve",key:"valve",Form:Pe,Symbol:nr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Valve",level:"p",orientation:"top"},orientation:"left",...Ee}),Preview:rr,zIndex:G},Yc={name:"Pneumatic Valve",key:"solenoidValve",Form:gc,Symbol:or,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Pneumatic Valve",level:"p",orientation:"top"},orientation:"left",normallyOpen:!1,...Ee}),Preview:lr,zIndex:G},Gc={name:"Four Way Valve",key:"fourWayValve",Form:Pe,Symbol:ir,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Four Way Valve",level:"p",orientation:"top"},orientation:"left",...Ee}),Preview:cr,zIndex:G},Hc={name:"Angled Valve",key:"angledValve",Form:Pe,Symbol:ar,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Angled Valve",level:"p",orientation:"top"},orientation:"left",...Ee}),Preview:ur,zIndex:G},Uc={name:"Pump",key:"pump",Form:Pe,Symbol:xr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Pump",level:"p",orientation:"top"},orientation:"left",...Ee}),Preview:dr,zIndex:G},Wc={name:"Tank",key:"tank",Form:Sc,Symbol:pr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Tank",level:"p",orientation:"top"},dimensions:{width:100,height:200},orientation:"left"}),Preview:mr,zIndex:Ic},Xc={name:"Relief Valve",key:"reliefValve",Form:ie,Symbol:fr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Relief Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:jr,zIndex:G},Jc={name:"Regulator",key:"regulator",Form:ie,Symbol:hr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Regulator",level:"p",orientation:"top"},orientation:"left"}),Preview:gr,zIndex:G},Kc={name:"Burst Disc",key:"burstDisc",Form:ie,Symbol:Sr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Burst Disc",level:"p",orientation:"top"},orientation:"left"}),Preview:Er,zIndex:G},Qc={name:"Cap",key:"cap",Form:ie,Symbol:Rr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Cap",level:"p",orientation:"top"},orientation:"left"}),Preview:Cr,zIndex:G},ea={name:"Manual Valve",key:"manualValve",Form:ie,Symbol:br,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Manual Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:yr,zIndex:G},ta={name:"Filter",key:"filter",Form:ie,Symbol:vr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Filter",level:"p",orientation:"top"},orientation:"left"}),Preview:wr,zIndex:G},sa={name:"Needle Valve",key:"needleValve",Form:ie,Symbol:Tr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Needle Valve",level:"p"},orientation:"left"}),Preview:kr,zIndex:G},na={name:"Check Valve",key:"checkValve",Form:ie,Symbol:Pr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Check Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:Lr,zIndex:G},ra={name:"Orifice",key:"orifice",Form:ie,Symbol:Mr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Orifice",level:"p",orientation:"top"},orientation:"left"}),Preview:$r,zIndex:G},oa={name:"Angled Relief Valve",key:"angledReliefValve",Form:ie,Symbol:Nr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Angled Relief Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:_r,zIndex:G},la={name:"Value",key:"value",Form:Cc,Symbol:Or,Preview:Br,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",label:{label:"Value",level:"p",orientation:"top"},orientation:"left",telem:f.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:f.streamChannelValue({channel:0}),stringifier:f.stringifyNumber({precision:2}),rollingAverage:f.rollingAverage({windowSize:1})},outlet:"stringifier"})}),zIndex:G},ia={name:"Button",key:"button",Symbol:Ar,Form:yc,Preview:Vr,defaultProps:()=>({label:{label:"Button",level:"p",orientation:"top"},orientation:"left",sink:f.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:f.setChannelValue({channel:0}),setpoint:f.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})}),zIndex:G},ca={name:"Switch",key:"switch",Symbol:zr,Preview:Dr,Form:Pe,defaultProps:()=>({label:{label:"Switch",level:"p",orientation:"top"},orientation:"left",...Ee}),zIndex:G},aa={value:la,threeWayValve:Fc,valve:qc,solenoidValve:Yc,fourWayValve:Gc,angledValve:Hc,pump:Uc,tank:Wc,reliefValve:Xc,regulator:Jc,burstDisc:Kc,cap:Qc,manualValve:ea,filter:ta,needleValve:sa,checkValve:na,orifice:ra,angledReliefValve:oa,button:ia,switch:ca},ua=Object.freeze(Object.defineProperty({__proto__:null,AngledReliefValve:Nr,AngledReliefValvePreview:_r,AngledValve:ar,AngledValvePreview:ur,BurstDisc:Sr,BurstDiscPreview:Er,Button:Ar,ButtonPreview:Vr,Cap:Rr,CapPreview:Cr,CheckValve:Pr,CheckValvePreview:Lr,ControlState:ae,Filter:vr,FilterPreview:wr,FourWayValve:ir,FourWayValvePreview:cr,ManualValve:br,ManualValvePreview:yr,NeedleValve:Tr,NeedleValvePreview:kr,Orifice:Mr,OrificePreview:$r,Pump:xr,PumpPreview:dr,Regulator:hr,RegulatorPreview:gr,ReliefValve:fr,ReliefValvePreview:jr,SYMBOLS:aa,SolenoidValve:or,SolenoidValvePreview:lr,Switch:zr,SwitchPreview:Dr,Tank:pr,TankPreview:mr,ThreeWayValve:tr,ThreeWayValvePreview:sr,Value:Or,ValuePreview:Br,Valve:nr,ValvePreview:rr},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=Ie.external;exports.DataType=k.g;exports.Density=k.I;exports.MultiSeries=k.lt;exports.Rate=k.q;exports.Series=k.N$1;exports.TimeRange=k.U;exports.TimeSpan=k.w;exports.TimeStamp=k.m;exports.state=k.state;exports.Generic=z.Generic;exports.Align=Ur.external;exports.Button=Wr.external;exports.Caret=Xr.Animated$1;exports.telem=f.external;exports.Color=yt.external;exports.Text=se.external;exports.Triggers=vt.external;exports.Menu=Jr.external;exports.List=be.external;exports.createFilterTransform=be.createFilterTransform;exports.fuseFilter=be.fuseFilter;exports.proxyMemo=be.proxyMemo;exports.createHexOpacityVariants=gs.createHexOpacityVariants;exports.unitProperty=gs.unitProperty;exports.Input=de.external;exports.Tabs=K.external;exports.Theming=Kr.external;exports.Tree=Qr.external;exports.Video=eo.Video;exports.Accordion=Eo;exports.Canvas=_o;exports.Channel=yl;exports.Control=Pi;exports.Device=Yl;exports.Diagram=jc;exports.Eraser=ui;exports.Form=Zl;exports.Legend=Ao;exports.Line=Vo;exports.LinePlot=ul;exports.Measure=ml;exports.Modal=Hl;exports.Mosaic=ii;exports.Nav=pi;exports.Note=fi;exports.OS=Ci;exports.Observe=hi;exports.Pluto=Ni;exports.Progress=Oi;exports.Range=dl;exports.Ranger=Ai;exports.Resize=xo;exports.Rule=fl;exports.Schematic=ua;exports.Select=Ko;exports.Status=no;exports.Steps=Ii;exports.Synnax=Co;exports.Tag=Xo;exports.Telem=vi;exports.Tooltip=ro;exports.Value=zc;exports.Viewport=al;exports.control=yo;
1
+ "use strict";var xo=Object.defineProperty;var mo=(e,t,n)=>t in e?xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var je=(e,t,n)=>mo(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-Cek9Ww4S.cjs"),x=require("react"),c=require("./Toggle-BKoV45C3.cjs"),l=require("./css-DY1Oedjj.cjs"),Ae=require("./external-DauKaEP3.cjs"),k=require("./aggregator-BjcY2k2l.cjs"),O=require("./Pack-BM_LmeO7.cjs"),po=require("./external-BAw0sDOf.cjs"),jo=require("./external-xb_RKgNH.cjs"),fo=require("./Animated-B5JgnUUd.cjs"),m=require("./LinePlot-Co1s_Tqs.cjs"),re=require("zod"),Rt=require("./external-wfqDajHH.cjs"),ie=require("./external-Gp6DgYYV.cjs"),Ct=require("./external-aHhj9dKH.cjs"),ho=require("./external-Cq39ap_s.cjs"),yt=require("react-dom"),Te=require("./external-BQS9le5M.cjs"),cs=require("./units-DNx3byGw.cjs"),xe=require("./external-C5O8yyPx.cjs"),X=require("./external-CYaPBMuM.cjs"),So=require("./external-ARvsEsOz.cjs"),go=require("./external-Bs4ZUlV0.cjs"),Eo=require("./Video-A2NddcPS.cjs"),as=({variant:e,...t})=>s.jsxRuntimeExports.jsx(c.k0.Circle,{color:c.variantColors[e],...t}),Ro=({status:{key:e,time:t,count:n,message:r,description:o,variant:i},silence:u,actions:a,className:d,children:j,...p})=>s.jsxRuntimeExports.jsxs(O.Space,{className:l.CSS(l.CSS.B("notification"),d),direction:"y",empty:!0,...p,children:[s.jsxRuntimeExports.jsxs(O.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[s.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",size:"small",children:[s.jsxRuntimeExports.jsx(as,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),s.jsxRuntimeExports.jsx(c.Text,{level:"small",shade:7,children:`x${n}`}),s.jsxRuntimeExports.jsx(c.DateTime,{className:l.CSS(l.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),s.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>u(e),children:s.jsxRuntimeExports.jsx(c.k0.Close,{})})]}),s.jsxRuntimeExports.jsxs(O.Space,{direction:"y",align:"start",className:l.CSS(l.CSS.BE("notification","content")),size:"small",children:[j??s.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:r}),o!=null&&s.jsxRuntimeExports.jsx(c.Text,{className:l.CSS(l.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),a!=null&&s.jsxRuntimeExports.jsx(O.Space,{direction:"x",align:"center",justify:"end",className:l.CSS(l.CSS.BE("notification","actions")),children:k.A(a).map(f=>s.jsxRuntimeExports.jsx(Co,{action:f},f.key))})]},t.toString()),Co=({action:e})=>{if(!x.isValidElement(e)){const t=e;return s.jsxRuntimeExports.jsx(c.Button,{...t})}return e},yo=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:c.Aggregator,Circle:as,Notification:Ro,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"})),bo=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"})),Fe=e=>e.preventDefault(),Ke=x.forwardRef(({location:e,style:t,size:n,className:r,children:o,onDragStart:i,sizeUnits:u="px",showHandle:a=!0,...d},j)=>{const p=l.J.construct(e),f=l.J.direction(p),S=l.g.dimension(f);return s.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("resize"),l.CSS.loc(p),l.CSS.dir(f),r),style:{[S]:`${n}${u}`,...t},ref:j,...d,children:[o,a&&s.jsxRuntimeExports.jsx("div",{draggable:!0,className:l.CSS(l.CSS.BE("resize","handle"),l.CSS.bordered(l.J.swap(p))),onDragStart:i,onDrag:Fe,onDragEnd:Fe})]})});Ke.displayName="Resize.Core";const bt=({onResize:e,count:t,initialSizes:n=[],minSize:r=100,direction:o="x"})=>{const i=x.useRef(null),[u,a]=x.useState({sizeDistribution:vo(n,t),root:null}),d=x.useCallback((f,S,h)=>{if(i.current==null)return;const C=l.To.dim(l.To.construct(i.current),o);a(R=>ut(R,C,f,r,S,h))},[r,a,o]);x.useEffect(()=>e==null?void 0:e(u.sizeDistribution),[u.sizeDistribution,e]);const j=x.useCallback((f,S)=>{f.preventDefault();const h=o==="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,o,ut]);return{setSize:x.useCallback((f,S)=>d(f,void 0,S),[ut]),props:{direction:o,sizeDistribution:u.sizeDistribution,onDragHandle:j,ref:i}}},Qe=x.forwardRef(({direction:e="x",children:t,sizeDistribution:n,onDragHandle:r,className:o,...i},u)=>{const a=l.g.construct(e),d=x.Children.toArray(t);return n=wo(n),s.jsxRuntimeExports.jsx(O.Space,{...i,ref:u,direction:a,className:l.CSS(l.CSS.B("resize-multiple"),o),empty:!0,grow:!0,children:d.map((j,p)=>s.jsxRuntimeExports.jsx(Ke,{onDragStart:f=>r(f,p),location:l.g.location(a),size:n[p]*100,sizeUnits:"%",showHandle:p!==d.length-1,children:j},p))})});Qe.displayName="Resize.Multiple";const vo=(e,t)=>{const n=e.reduce((o,i)=>o+i,0),r=t-e.length;if(r<=0)return e.slice(0,t).map(o=>o/n);if(e.every(o=>o<=1)){const o=1-n;return[...e,...Array(r).fill(o/r)]}return e.map(()=>1/t)},at=.001,wo=e=>e.every(t=>l.C$1.closeTo(t,1/e.length),at)?e.map((t,n)=>n%2===0?t+at:n===e.length-1?t:t-at):e,ut=(e,t,n,r,o,i)=>{const u=us(e,t,n,o,i),[a,d]=To(e.sizeDistribution,n,u,r/t),j=d?o??null:e.root;return{...e,sizeDistribution:a,root:j}},us=(e,t,n,r,o)=>{let i;if(o!=null)o>1&&(o=o/t),i=o-e.sizeDistribution[n];else if(r!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(r-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},To=(e,t,n,r)=>{let o=t;for(;o>0&&e[o]+n<=r;)o--;const i=e[o]+n,u=ko(o,e,r,n),a=e[u]-n;return i<r||a<r?[e,!1]:[e.map((d,j)=>j===o?i:j===u?a:d),!0]},ko=(e,t,n,r)=>(e===t.length-1?Lo:Po)(e,t,n,r),Po=(e,t,n,r)=>{let o=e+1;for(;o<t.length-1&&t[o]-r<=n;)o++;return o},Lo=(e,t,n,r)=>{let o=e-1;for(;o>0&&t[o]-r<=n;)o--;return o},et=({onMove:e,onStart:t,onEnd:n})=>x.useCallback(r=>{r.preventDefault();const o=l.q.construct(r),i=c.mouseKey(r.button);t==null||t(o,i,r);const u=d=>{if(d.buttons===0)return a(d);const j=l.q.construct(d);e==null||e(l.To.construct(o,j),i,d)};window.addEventListener("mousemove",u);const a=d=>{window.removeEventListener("mousemove",u);const j=l.q.construct(d);n==null||n(l.To.construct(o,j),i,d)};window.addEventListener("mouseup",a,{once:!0})},[e,t,n]),xt=2,xs=({onCollapse:e,onResize:t,location:n="left",minSize:r=100,maxSize:o=1/0,initialSize:i=200,collapseThreshold:u=1/0,className:a,...d})=>{const[j,p]=x.useState(l.j(i,r,o)),f=x.useRef(null),S=l.J.construct(n),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,r,o);return(M-y)/r>u?xt:M},[S,r,o,u]),C=x.useRef(null),R=x.useCallback(b=>{const E=h(b);p(E),C.current!=null&&(t==null||t(E,l.To.construct(C.current)))},[t,h]),v=x.useCallback(()=>p(b=>(f.current=b,b)),[p]),L=x.useCallback(b=>h(b)===xt&&(e==null?void 0:e()),[e,h]);x.useEffect(()=>p(b=>{const E=l.j(b,r,o);return f.current=E,E}),[r,o]);const g=et({onMove:R,onStart:v,onEnd:L});return s.jsxRuntimeExports.jsx(Ke,{ref:C,location:S,size:j,onDragStart:g,className:l.clsx(a,l.CSS.expanded(j!==xt)),...d})},Mo=Object.freeze(Object.defineProperty({__proto__:null,Core:Ke,Multiple:Qe,Single:xs,calculateDiffPercentage:us,useMultiple:bt},Symbol.toStringTag,{value:"Module"})),De="y",Gt=28,_o=32,$o=40,No=.5,Bo=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:r,ref:o,...i}}=bt({direction:De,count:e.length,minSize:Gt}),u=a=>{if(o.current==null)return;const d=l.To.dim(l.To.construct(o.current),De);r[a]<$o/d?n(a,e[a].initialSize??No):n(a,Gt+1)};return s.jsxRuntimeExports.jsx(Qe,{empty:!0,className:l.CSS.B("accordion"),sizeDistribution:r,ref:o,...t,...i,children:e.map((a,d)=>x.createElement(Vo,{...a,key:a.key,index:d,direction:De,onExpand:u,parent:o,size:r[d]}))})},Oo=s.jsxRuntimeExports.jsx(c.k0.Caret.Down,{"aria-label":"contract"}),zo=s.jsxRuntimeExports.jsx(c.k0.Caret.Right,{"aria-label":"expand"}),Vo=({index:e,name:t,content:n,actions:r,size:o,parent:i,onExpand:u})=>{let a=!0;if(i.current!=null){const j=l.To.dim(l.To.construct(i.current),De);a=o*j>_o}const d=a?Oo:zo;return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs(Ae.Header,{level:"p",className:l.CSS.expanded(a),empty:!0,children:[s.jsxRuntimeExports.jsx(Ae.ButtonTitle,{startIcon:d,onClick:()=>u(e),children:t}),r!=null&&s.jsxRuntimeExports.jsx(Ae.Actions,{children:r})]}),n]})},Ao=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Bo},Symbol.toStringTag,{value:"Module"})),vt=x.createContext(m.ZERO_CONTEXT_VALUE),ke=()=>x.useContext(vt).synnax,Do=()=>x.useContext(vt).state,Ut={connected:"success",connecting:"info",disconnected:"info",failed:"error"},ds=c.wrap$1(m.Provider.TYPE,({aetherKey:e,connParams:t,children:n})=>{const[r,o,i]=c.useCombinedStateAndRef(m.ZERO_CONTEXT_VALUE),[{path:u},,a]=c.use$3({aetherKey:e,type:m.Provider.TYPE,schema:m.Provider.stateZ,initialState:{props:t??null,state:null}}),d=c.useAggregator(),j=x.useCallback(p=>{i.current.state.status!==p.status&&d({variant:Ut[p.status],message:p.message??l._.capitalize(p.status)}),o(f=>({...f,state:p}))},[d]);return c.useAsyncEffect(async()=>{if(r.synnax!=null&&r.synnax.close(),t==null)return o(m.ZERO_CONTEXT_VALUE);const p=new k.Zh({...t,connectivityPollFrequency:k.S.seconds(5)});o({synnax:p,state:{clusterKey:"",status:"connecting",message:"Connecting..."}});const f=await p.connectivity.check();return o({synnax:p,state:f}),d({variant:Ut[f.status],message:f.message??f.status.toUpperCase()}),p.connectivity.onChange(j),a({props:t,state:f}),()=>{p.close(),o(m.ZERO_CONTEXT_VALUE),a({props:null,state:null})}},[t,j]),s.jsxRuntimeExports.jsx(vt.Provider,{value:r,children:s.jsxRuntimeExports.jsx(c.Composite,{path:u,children:n})})}),Io=Object.freeze(Object.defineProperty({__proto__:null,Provider:ds,use:ke,useConnectionState:Do},Symbol.toStringTag,{value:"Module"})),Pe=x.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),ms=()=>x.useContext(Pe),ps=e=>{const{aliases:t}=x.useContext(Pe);return t[e]??null},tt=()=>{const{aliases:e}=x.useContext(Pe);return e},st=(e,t="")=>{const{getName:n}=x.useContext(Pe),[r,o]=x.useState(t);return c.useAsyncEffect(async()=>{const i=await n(e);i!=null&&o(i)},[e,n]),r??t},wt=()=>{const{activeRange:e}=x.useContext(Pe);return e??void 0},js=({activeRange:e,children:t})=>{const n=ke(),[r,o]=x.useState({}),i=x.useCallback(d=>{o(j=>{const p={...j};return d.forEach(({variant:f,key:S,value:h})=>{const C=Number(S.split("---")[1]);f==="delete"?delete p[C]:p[h.channel]=h.alias}),p})},[o]),u=x.useCallback(async(d,j)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(d,j)},[n,e]),a=x.useCallback(async d=>{if(n==null||d===0)return;const j=r[d];return j??(await n.channels.retrieve(d)).name},[r,n]);return c.useAsyncEffect(async()=>{if(n==null||e==null){o({});return}const d=await n.ranges.retrieve(e),j=await d.listAliases();o(j);const p=await d.openAliasTracker(),f=p.onChange(i);return()=>{f(),p.close()}},[n,e]),s.jsxRuntimeExports.jsx(Pe.Provider,{value:{aliases:r,activeRange:e,setAlias:e!=null?u:null,getName:a},children:t})},Zo=({channelKey:e,value:t,shadow:n,className:r,...o})=>{const[i,u]=x.useState(!1),{setAlias:a}=ms(),d=ps(e),j=st(e);let p=s.jsxRuntimeExports.jsx(c.k0.Rename,{});i?p=s.jsxRuntimeExports.jsx(c.k0.Loading,{}):d===t&&(p=s.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=o.onChange)==null||R.call(o,d))},C=()=>e===0?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):a==null?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):d===t?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Alias synced with this label"}):s.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Sync alias for ",j," with this label"]});return s.jsxRuntimeExports.jsxs(c.Text$1,{value:t,...o,children:[f&&s.jsxRuntimeExports.jsx(c.Icon,{onClick:h,tooltip:s.jsxRuntimeExports.jsxs(c.Text,{level:"small",children:["Set ",j," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:s.jsxRuntimeExports.jsx(c.k0.Sync,{})}),s.jsxRuntimeExports.jsx(c.Icon,{onClick:S,disabled:!f,tooltip:s.jsxRuntimeExports.jsx(C,{}),tooltipLocation:{y:"top"},variant:"outlined",children:p})]})},fe="channel",Fo=Object.freeze(Object.defineProperty({__proto__:null,Canvas:m.Canvas,axisStateZ:m.axisStateZ,newTickFactory:m.newTickFactory,tickFactoryProps:m.tickFactoryProps,tickType:m.tickType},Symbol.toStringTag,{value:"Module"})),qo=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:m.AcquireChannelControl,AuthoritySource:m.AuthoritySource,Chip:m.Chip,Controller:m.Controller$1,Indicator:m.Indicator,Legend:m.Legend,REGISTRY:m.REGISTRY$3,STATUSES:m.STATUSES,SetChannelValue:m.SetChannelValue,StateProvider:m.StateProvider,acquireChannelControl:m.acquireChannelControl,acquireChannelControlPropsZ:m.acquireChannelControlPropsZ,authoritySource:m.authoritySource,authoritySourceProps:m.authoritySourceProps,chipStateZ:m.chipStateZ,controllerStateZ:m.controllerStateZ,indicatorStateZ:m.indicatorStateZ,legendStateZ:m.legendStateZ,setChannelValue:m.setChannelValue,setChannelValuePropsZ:m.setChannelValuePropsZ,stateProviderStateZ:m.stateProviderStateZ,statusZ:m.statusZ,sugaredStateZ:m.sugaredStateZ},Symbol.toStringTag,{value:"Module"}));var de;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(de||(de={}));function Yo({color:e,dimensions:t,lineWidth:n}){return x.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function Ho({color:e,radius:t}){return x.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const Go={[de.Dots]:"#91919a",[de.Lines]:"#eee",[de.Cross]:"#e2e2e2"},Uo={[de.Dots]:1,[de.Lines]:1,[de.Cross]:6},Wo=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function fs({id:e,variant:t=de.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=2,color:u,style:a,className:d}){const j=x.useRef(null),{transform:p,patternId:f}=m.useStore(Wo,m.shallow$1),S=u||Go[t],h=r||Uo[t],C=t===de.Dots,R=t===de.Cross,v=Array.isArray(n)?n:[n,n],L=[v[0]*p[2]||1,v[1]*p[2]||1],g=h*p[2],b=R?[g,g]:L,E=C?[g/i,g/i]:[b[0]/i,b[1]/i];return x.createElement("svg",{className:m.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:p[0]%L[0],y:p[1]%L[1],width:L[0],height:L[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`},C?x.createElement(Ho,{color:S,radius:g/i}):x.createElement(Yo,{dimensions:b,color:S,lineWidth:o})),x.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}fs.displayName="Background";var Xo=x.memo(fs);const Jo={region:l.To.ZERO,dpr:1,os:k.w$1.getOS()},Ko={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},Qo=c.wrap$1(m.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:n,className:r,...o})=>{const[{path:i},{bootstrapped:u,dpr:a},d]=c.use$3({aetherKey:n,type:m.Canvas$1.TYPE,schema:m.canvasStateZ,initialState:Jo}),j=x.useRef({...Ko}),p=x.useCallback(h=>{j.current.bootstrapped&&d(()=>({bootstrapped:!0,region:h,dpr:window.devicePixelRatio,os:k.w$1.getOS({default:"Windows"})}))},[d]),f=c.useResize(p,{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$1.getOS({default:"Windows"})},[g,b,E])},[d]);return s.jsxRuntimeExports.jsxs("div",{className:l.CSS(l.CSS.B("canvas-container"),r),...o,children:[s.jsxRuntimeExports.jsx("canvas",{ref:S,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","lower2d"))}),s.jsxRuntimeExports.jsx("canvas",{ref:S,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","gl"))}),s.jsxRuntimeExports.jsx("canvas",{ref:S,className:l.CSS(l.CSS.B("canvas"),l.CSS.BM("canvas","upper2d"))}),s.jsxRuntimeExports.jsx(c.Composite,{path:i,children:u&&e})]})}),Tt=(e,t)=>c.useResize(x.useCallback((n,r)=>{const o=document.querySelector(".pluto-canvas--lower2d");o!=null&&e(l.k.XY.translate(l.q.scale(l.To.topLeft(o),-1)).box(n),r)},[e]),t),el=Object.freeze(Object.defineProperty({__proto__:null,Canvas:Qo,useRegion:Tt},Symbol.toStringTag,{value:"Module"})),hs=x.createContext(null),Se=e=>{const t=x.useContext(hs);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Ss=e=>{const t=Se("Viewport"),{addViewportHandler:n}=t;x.useEffect(()=>n(e),[n,e])},nt=(e,t)=>{const{setGridEntry:n,removeGridEntry:r}=Se(t),{key:o}=e;return c.useEffectCompare(()=>{l.J.outer.parse(e.loc),n(e)},([a],[d])=>k._.equal(a,d),[e]),x.useEffect(()=>()=>r(o),[]),{gridArea:l.g.swap(l.J.direction(e.loc))==="x"?`axis-start-${o} / plot-start / axis-end-${o} / plot-end`:`plot-start / axis-start-${o} / plot-end / axis-end-${o}`}},gs=c.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:r=l.q.ZERO,children:o,hold:i=!1,onHold:u,...a})=>{const[d,j]=x.useState([]),p=c.useMemoDeepEqualProps({clearOverScan:r,hold:i}),[{path:f},{grid:S},h]=c.use$3({aetherKey:e,type:m.LinePlot.TYPE,schema:m.linePlotStateZ,initialState:{container:l.To.ZERO,viewport:l.To.DECIMAL,grid:{},...p}});x.useEffect(()=>h(w=>({...w,...p})),[p]);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:$,box:T,stage:B}=w;($==="pan"&&B!=="start"||$==="zoom"||$==="zoomReset"&&B==="start")&&h(A=>({...A,viewport:T})),C.current.forEach((A,q)=>q(w))},[h]),L=x.useCallback(w=>h($=>({...$,container:w})),[h]),g=Tt(L,{debounce:n}),b=x.useCallback(w=>h($=>({...$,grid:{...$.grid,[w.key]:w}})),[h]),E=x.useCallback(w=>h($=>{const{[w]:T,...B}=$.grid;return{...$,grid:B}}),[h]),y=x.useCallback(w=>{j($=>[...$.filter(({key:T})=>T!==w.key),w])},[j,v]),M=x.useCallback(w=>j($=>$.filter(({key:T})=>T!==w)),[y]),V=x.useMemo(()=>tl(S),[S]),_=x.useCallback(w=>{h($=>({...$,hold:w})),u==null||u(w)},[h,u]),N=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 s.jsxRuntimeExports.jsx("div",{className:l.CSS.B("line-plot"),style:{...t,...V},ref:g,...a,children:s.jsxRuntimeExports.jsx(hs.Provider,{value:N,children:s.jsxRuntimeExports.jsx(c.Composite,{path:f,children:o})})})}),tl=e=>{const t=l.CSS.newGridBuilder();return m.filterGridEntries("top",e).forEach(({key:n,size:r})=>t.row(`axis-start-${n}`,`axis-end-${n}`,r)),t.row("plot-start","plot-end","minmax(0, 1fr)"),m.filterGridEntries("bottom",e).forEach(({key:n,size:r})=>t.row(`axis-start-${n}`,`axis-end-${n}`,r)),m.filterGridEntries("left",e).forEach(({key:n,size:r})=>t.col(`axis-start-${n}`,`axis-end-${n}`,r)),t.col("plot-start","plot-end","minmax(0, 1fr)"),m.filterGridEntries("right",e).forEach(({key:n,size:r})=>t.col(`axis-start-${n}`,`axis-end-${n}`,r)),t.build()},kt=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?m.XAxis.TYPE:m.YAxis.TYPE,r=`${e}-axis`;return c.wrap$1(n,({aetherKey:o,children:i,location:u=t,label:a="",labelLevel:d="small",labelDirection:j=e,onLabelChange:p,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:N},{size:w,labelSize:$,...T},B]=c.use$3({aetherKey:o,type:n,schema:m.coreAxisStateZ,initialState:_});x.useEffect(()=>B(ee=>({...ee,..._})),[_]),x.useEffect(()=>{const{lower:ee,upper:J}=m.parseAutoBounds(T.autoBounds);T.bounds!=null&&(ee&&(R==null?void 0:R.lower)!==T.bounds.lower||J&&(R==null?void 0:R.upper)!==T.bounds.upper)&&(E==null||E(T.bounds))},[T.autoBounds,T.bounds]);const A=nt({loc:u,key:`${n}-${o}`,size:w+$,order:"last"},"XAxis"),q=c.useTypography(d).toString(),H=x.useRef(0);return x.useEffect(()=>{if(e==="y"){if(a==null)return;let J=k.dimensions(a,q)[l.g.dimension(l.g.construct(j))];J>0&&(J+=6),B($e=>({...$e,labelSize:J}))}else{const J=k.dimensions(a,q).height+12,$e=H.current;m.withinSizeThreshold($e,J)||(H.current=J,B(ct=>({...ct,labelSize:J})))}},[a,j,q]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(v,l.CSS.B("axis"),l.CSS.B(r),l.CSS.loc(u)),style:{...y,...A},align:"center",justify:e==="x"?"end":"start",direction:l.g.swap(e),...M,children:V&&s.jsxRuntimeExports.jsx(c.MaybeEditable,{className:l.CSS(l.CSS.BE("axis","label"),l.CSS.dir(j)),value:a,onChange:p,level:d})}),s.jsxRuntimeExports.jsx(c.Composite,{path:N,children:i})]})})},Es=kt("x"),Rs=kt("y"),Cs=l.q.xy.extend({root:l.J.corner,units:re.z.object({x:re.z.enum(["px","decimal"]),y:re.z.enum(["px","decimal"])})}),sl=Cs.partial({root:!0,units:!0}),nl=e=>{var n,r,o,i;const t={};return t[((n=e.root)==null?void 0:n.x)??"left"]=((r=e==null?void 0:e.units)==null?void 0:r.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((o=e.root)==null?void 0:o.y)??"top"]=((i=e==null?void 0:e.units)==null?void 0:i.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},rl=(e,t)=>{var i,u,a,d,j,p;const n={x:e.x,y:e.y};if(t.current==null)return n;const r=l.To.construct(t.current),o=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"&&(n.x=1-e.x):((a=e.root)==null?void 0:a.x)==="right"?n.x=1-(e.x+l.To.width(r))/l.To.width(o):n.x/=l.To.width(o),((d=e.units)==null?void 0:d.y)==="decimal"?((j=e.root)==null?void 0:j.y)==="bottom"&&(n.y=1-e.y):((p=e.root)==null?void 0:p.y)==="bottom"?n.y=1-(e.y+l.To.height(r))/l.To.height(o):n.y/=l.To.height(o),n},ys=(e,t)=>{if(t.current==null)return null;const n=l.To.construct(t.current.parentElement),r=l.To.construct(t.current),o={x:e.x,y:e.y,root:{...l.J.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(o.x=(1-e.x)*l.To.width(n)-l.To.width(r),o.root.x="right"):e.x<.2?o.x=e.x*l.To.width(n):o.units.x="decimal",e.y>.8?(o.y=(1-e.y)*l.To.height(n)-l.To.height(r),o.root.y="bottom"):e.y<.2?o.y=e.y*l.To.height(n):o.units.y="decimal",o.x=Math.round(o.x*100)/100,{...o,...l.q.truncate(o,3)}},Wt=l.To.reRoot(l.To.DECIMAL,l.J.TOP_LEFT),Pt=x.memo(({className:e,value:t,onChange:n,style:r,draggable:o=!0,...i})=>{const[u,a]=k.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:l.J.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),d=x.useRef(u),j=c.useSyncedRef(o===!1),p=x.useRef(null);u!==null&&(r={...r,...nl(u)});const f=x.useCallback(h=>{var E;if(((E=p.current)==null?void 0:E.parentElement)==null)return d.current;const C=l.To.construct(p.current.parentElement),R=l.k.XY.scale(C).scale(Wt),v=R.box(l.To.construct(p.current)),L=l.k.XY.clamp(l.To.construct(l.To.topLeft(Wt),{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 ys(b,p)},[]),S=et({onStart:x.useCallback(()=>{d.current=rl(d.current,p)},[]),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 s.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(e,l.CSS.B("legend")),bordered:!0,rounded:!0,style:r,onDragStart:S,draggable:o,ref:p,...i,onDrag:Fe,onDragEnd:Fe,empty:!0})});Pt.displayName="Legend.Container";const Lt=({data:e=[],onEntryChange:t,position:n,onPositionChange:r,...o})=>{const[i,u]=x.useState(!1);return e.length===0?null:s.jsxRuntimeExports.jsx(Pt,{...o,draggable:!i,value:n,onChange:r,children:e.sort((a,d)=>a.label.localeCompare(d.label)).map(({key:a,color:d,label:j})=>s.jsxRuntimeExports.jsxs(O.Space,{style:{cursor:"pointer"},direction:"x",align:"center",children:[s.jsxRuntimeExports.jsx(Rt.Swatch,{value:d,onChange:p=>t==null?void 0:t({key:a,color:p,label:j}),onVisibleChange:u,draggable:!1,size:"small"}),s.jsxRuntimeExports.jsx(c.MaybeEditable,{level:"small",value:j,onChange:p=>t==null?void 0:t({key:a,color:d,label:p}),noWrap:!0})]},a))})},ol=Object.freeze(Object.defineProperty({__proto__:null,Container:Pt,Simple:Lt,calcStickyPos:ys,completeStickyXYz:Cs,stickyXYz:sl},Symbol.toStringTag,{value:"Module"})),bs=({className:e,style:t,onLineChange:n,...r})=>{const{lines:o}=Se("Legend");return Se("Legend"),s.jsxRuntimeExports.jsx(Lt,{data:o,onEntryChange:n,...r})},vs=c.wrap$1("Line",({aetherKey:e,...t})=>{const[,,n]=c.use$3({aetherKey:e,type:m.Line.TYPE,schema:m.stateZ,initialState:t}),r=c.useMemoDeepEqualProps(t);return x.useLayoutEffect(()=>n(r),[r]),null}),ll=Object.freeze(Object.defineProperty({__proto__:null,Line:vs},Symbol.toStringTag,{value:"Module"})),Mt=c.wrap$1("Line",({aetherKey:e,color:t,label:n="",...r})=>{const{setLine:o,removeLine:i}=Se("Line");return x.useEffect(()=>(o({key:e,color:t,label:n}),()=>i(e)),[n,t]),s.jsxRuntimeExports.jsx(vs,{aetherKey:e,color:t,label:n,...r})}),ws=({level:e="h2",...t})=>{const n=c.useUniqueKey(),r=c.useTypography(e),o=nt({key:n,size:(r.lineHeight+2)*r.baseSize,loc:"top",order:"first"},"Title");return s.jsxRuntimeExports.jsx(O.Space,{justify:"center",align:"center",style:o,children:s.jsxRuntimeExports.jsx(c.MaybeEditable,{...t,level:e})})},Ts=c.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:m.Tooltip.TYPE,schema:m.tooltipStateZ,initialState:{position:null}}),n=x.useRef(null),r=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]),o=x.useCallback(()=>t({position:null}),[t]);return x.useEffect(()=>{if(n.current===null)return;const i=n.current.parentElement;if(i!=null)return i.addEventListener("mousemove",r),i.addEventListener("mouseleave",o),()=>{i.removeEventListener("mousemove",r),i.removeEventListener("mouseleave",o)}},[r]),s.jsxRuntimeExports.jsx("span",{ref:n})}),il=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Ts},Symbol.toStringTag,{value:"Module"})),cl={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},_t=x.forwardRef(({className:e,mode:t,maskBox:n,children:r,style:o,...i},u)=>s.jsxRuntimeExports.jsxs("div",{ref:u,className:l.CSS(l.CSS.noSelect,l.CSS.BE("viewport-mask","container"),e),style:{cursor:cl[t],...o},...i,children:[s.jsxRuntimeExports.jsx("div",{style:{...l.To.css(n),display:l.To.areaIsZero(n)?"none":"block"},className:l.CSS.BE("viewport-mask","selection")}),r]}));_t.displayName="ZoomPanMask";const al=new Set([k.g.UUID,k.g.JSON]),ul=k.g.ALL.filter(e=>e!==k.g.UNKNOWN).map(e=>({key:e.toString(),name:al.has(e)?e.toString().toUpperCase():l._.capitalize(e.toString())})),xl=[{key:"name",name:"Name"}],dl=e=>s.jsxRuntimeExports.jsx(ie.DropdownButton,{...e,data:ul,columns:xl,entryRenderKey:"name"}),ml=[{key:"x",icon:s.jsxRuntimeExports.jsx(c.k0.Arrow.Right,{})},{key:"y",icon:s.jsxRuntimeExports.jsx(c.k0.Arrow.Down,{})}],pl=({key:e,entry:t,onClick:n,selected:r})=>s.jsxRuntimeExports.jsx(c.Icon,{variant:r?"filled":"outlined",onClick:n,children:t.icon},e),jl=({children:e=pl,...t})=>s.jsxRuntimeExports.jsx(ie.Button,{...t,allowMultiple:!1,data:ml,children:e}),ks=e=>s.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS.BE("select","clear"),variant:"outlined",...e,children:s.jsxRuntimeExports.jsx(c.k0.Close,{"aria-label":"clear"})}),rt=({onChange:e,value:t,entryRenderKey:n="key",columns:r,data:o,emptyContent:i,inputProps:u,allowNone:a=!0,searcher:d,className:j,variant:p,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 o!=null&&(_=o.find(N=>N.key===t)??null);E(_)},[d,t,o]);const M=x.useCallback((_,N)=>{Array.isArray(_)||(E(_==null?null:N.entries[0]),g(),e(_,N))},[e,a]),V=x.useMemo(()=>y?c.Search:Te.Filter,[y]);return s.jsxRuntimeExports.jsx(ie.Core,{close:g,open:L,data:o,omit:h,emptyContent:i,allowMultiple:!1,visible:v,value:t,hideColumnHeader:f,onChange:M,allowNone:a,columns:r,listItem:C,...R,children:s.jsxRuntimeExports.jsx(V,{searcher:d,children:({onChange:_})=>s.jsxRuntimeExports.jsx(fl,{variant:p,onChange:_,onFocus:L,selected:b,entryRenderKey:n,visible:v,allowNone:a,className:j,disabled:S})})})},$t="Select",fl=({entryRenderKey:e,selected:t,visible:n,onChange:r,onFocus:o,allowNone:i=!0,placeholder:u=$t,className:a,disabled:d,...j})=>{const{clear:p}=c.useSelectionUtils(),[f,S]=x.useState("");x.useEffect(()=>{if(!n){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,n,e]);const h=L=>{r(L),S(L)},C=()=>{S(""),o==null||o()},R=L=>{n||(L.preventDefault(),o==null||o())},v=()=>{S(""),p==null||p()};return s.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(),!n&&(o==null||o())}),style:{flexGrow:1},onClick:R,placeholder:u,disabled:d,...j,children:i&&s.jsxRuntimeExports.jsx(ks,{onClick:v,disabled:d})})},qe=({children:e="",size:t="medium",color:n,icon:r,onClose:o,className:i,onDragStart:u,...a})=>{const d=l.cssString(n);r==null&&n!=null&&(r=s.jsxRuntimeExports.jsx(c.k0.Circle,{fill:d}));const j=o==null?void 0:s.jsxRuntimeExports.jsx(c.Icon,{"aria-label":"close",size:t,className:l.CSS.BE("tag","close"),onClick:p=>{p.stopPropagation(),o()},children:s.jsxRuntimeExports.jsx(c.k0.Close,{})});return s.jsxRuntimeExports.jsx(c.WithIcon,{startIcon:r,endIcon:j,className:l.CSS(i,l.CSS.B("tag"),o!=null&&l.CSS.BM("tag","closeable")),level:k.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:u,...a,children:e})},hl=Object.freeze(Object.defineProperty({__proto__:null,Tag:qe},Symbol.toStringTag,{value:"Module"})),ot=({onChange:e,value:t,className:n,data:r,columns:o=[],entryRenderKey:i="key",emptyContent:u,searcher:a,renderTag:d,placeholder:j,onTagDragStart:p,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),N=a!=null;c.useAsyncEffect(async()=>{_(!0),c.selectValueIsZero(t)&&M([]);const T=y.map(q=>q.key),B=k.A(t);if(k.E.unorderedPrimitiveArrays(T,B)===k.E.EQUAL)return;let A=[];if(N)try{A=await a.retrieve(B)}finally{_(!1)}else r!=null&&(A=r.filter(q=>B.includes(q.key)));M(A)},[a,N,t,r]);const w=x.useCallback((T,B)=>{T!=null&&(M(B.entries),e(k.A(T),B))},[e]),$=x.useMemo(()=>N?c.Search:Te.Filter,[N]);return s.jsxRuntimeExports.jsx(ie.Core,{close:E,open:b,data:r,emptyContent:u,visible:g,value:t,onChange:w,allowNone:S,replaceOnSingle:h,columns:o,allowMultiple:!0,listItem:v,...L,children:s.jsxRuntimeExports.jsx($,{searcher:a,children:({onChange:T,value:B})=>s.jsxRuntimeExports.jsx(Sl,{value:B,selectedKeys:t,className:n,onChange:T,loading:V,selected:y,onFocus:b,entryRenderKey:i,visible:g,renderTag:d,placeholder:j,onTagDragStart:p,onTagDragEnd:C,style:R})})})},Sl=({selectedKeys:e,loading:t,selected:n,onChange:r,onFocus:o,visible:i,entryRenderKey:u,renderTag:a=c.componentRenderProp(Ps),placeholder:d=$t,onTagDragStart:j,onTagDragEnd:p,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,n]);const L=()=>{i||r(""),o==null||o()},g=()=>{i||o==null||o()},b=()=>{i||r("")};return s.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:r,onFocus:L,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:g,...h,children:[s.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=n[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=>p==null?void 0:p(V,E)})})}),s.jsxRuntimeExports.jsx(ks,{onClick:R})]})},Ps=({entryKey:e,entryRenderKey:t,entry:n,loading:r,...o})=>{let i=e;return n!=null&&(i=typeof t=="function"?t(n):n[t]),x.createElement(qe,{size:"small",variant:"outlined",className:l.CSS(n==null&&!r&&l.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...o,key:e.toString()},k.L(i))},gl=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:ie.BaseButton,Button:ie.Button,DEFAULT_PLACEHOLDER:$t,DataType:dl,Direction:jl,DropdownButton:ie.DropdownButton,Multiple:ot,MultipleTag:Ps,Single:rt,defaultButton:ie.defaultButton},Symbol.toStringTag,{value:"Module"})),Ie=6,El=2,Xt=5,Rl=e=>l.To.width(e)<Xt&&l.To.height(e)<Xt,Cl=["zoom","pan","select","zoomReset"],Be=[...Cl,"click"],yl=re.z.enum(Be),Ls=["zoom","select"],Ze={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},Ms={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},_s={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Nt={zoom:Ze,pan:Ms,select:_s,zoomReset:Ze,click:Ze},bl=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,r])=>n==="defaultMode"?[n,r]:[n,r.map(o=>o.filter(i=>i!=="MouseLeft")).filter(o=>o.length>0)]))},vl=l.To.construct(0,0,1,1,l.J.TOP_LEFT),wl={width:30,height:50},$s=({onChange:e,triggers:t,initial:n=vl,threshold:r=wl,ref:o})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[u,a]=x.useState(l.To.ZERO),[d,j]=x.useState(i),[p,f]=c.useStateRef(n),S=x.useRef(l.q.ZERO),h=x.useRef(null),C=l._$1.construct(r);x.useEffect(()=>f(()=>l.To.truncate(n,Ie)),[n]),x.useEffect(()=>j(i),[i]);const[R,v,L,g]=c.useMemoCompare(()=>{const _={...Nt[i],...t},N=c.flattenConfig(_),w=bl(_);return[_,N,w,c.flattenConfig(w)]},c.compareModeConfigs,[t]),b=x.useCallback(({box:_,triggers:N,stage:w,cursor:$})=>{if(h.current==null)return;const T=c.determineMode(R,N),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:$}),f(l.To.DECIMAL);const A=Rl(_);if(w==="end"){if(A){T==="zoom"&&a(l.To.ZERO),e==null||e({box:p.current,mode:"click",stage:w,cursor:$});return}return f(H=>{if(T==="pan"){const J=Jt(_,H,B);return J===null||l.To.equals(J,H)?H:(e==null||e({box:J,mode:T,stage:w,cursor:$}),J)}const ee=E(_,H,B);return ee===null?H:(e==null||e({box:ee,mode:T,stage:w,cursor:$}),T==="zoom"?(a(l.To.ZERO),ee):l.To.truncate(H,Ie))})}if(Ls.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(Kt(C,_,B)));if(a(H=>l.To.areaIsZero(H)?H:l.To.ZERO),l.q.distance($,S.current)<El)return;S.current=$;const q=Jt(_,p.current,B);e==null||e({box:q,mode:T,stage:w,cursor:$})},[a,j,e,R,r.height,r.width,f,h]);x.useImperativeHandle(o,()=>({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((_,N,w)=>l.To.truncate(ft(N,w).box(Kt(C,_,w)),Ie),[r]),y=c.useHeldRef({triggers:[["Control"]]}),M=c.useHeldRef({triggers:[["Alt"]]});x.useEffect(()=>{const _=N=>{if(h.current==null)return;let w=1;N.deltaY<0?w-=.035:w+=.035;const $=l.To.construct(h.current),T=l.q.construct(N);if(!l.To.contains($,T)||N.target!==h.current)return;const A=ft(p.current,l.To.construct(h.current)).pos(l.q.construct(N));let H=l.k.XY.magnify({x:y.current.held?1:w,y:M.current.held?1:w}).box(p.current);H=l.To.translate(H,{x:y.current.held?0:A.x*(1-w),y:M.current.held?0:A.y*(1-w)}),f(H),e==null||e({stage:"end",box:H,cursor:l.q.construct(N),mode:"zoom"})};return window.addEventListener("wheel",_),()=>window.removeEventListener("wheel",_)},[f,e]),Ct.useDrag({bound:h,onDrag:b,triggers:v,loose:!0});const V=x.useCallback(({triggers:_,stage:N})=>{if(N==="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}},ft=(e,t)=>l.k.XY.scale(t).clamp(t).scale(e),Jt=(e,t,n)=>{let r=l.To.signedDims(ft(t,n).box(e));return r={signedWidth:-r.signedWidth,signedHeight:-r.signedHeight},l.To.truncate(l.k.XY.translate(l.q.construct(r)).box(t),Ie)},Kt=(e,t,n)=>l.To.height(t)<=e.height?l.To.construct(l.To.left(t),l.To.top(n),l.To.width(t),l.To.height(n)):l.To.width(t)<=e.width?l.To.construct(l.To.left(n),l.To.top(t),l.To.width(n),l.To.height(t)):t,Tl=({mode:e,triggers:t})=>s.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",children:[s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:l._.capitalize(e)}),s.jsxRuntimeExports.jsx(Ct.Text,{trigger:t[0],level:"small"})]}),kl={zoom:s.jsxRuntimeExports.jsx(c.k0.Zoom,{}),pan:s.jsxRuntimeExports.jsx(c.k0.Pan,{}),select:s.jsxRuntimeExports.jsx(c.k0.Selection,{}),zoomReset:s.jsxRuntimeExports.jsx(c.k0.Expand,{}),click:s.jsxRuntimeExports.jsx(c.k0.Bolt,{})},Pl=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const r=Object.entries(e).filter(([o])=>!t.includes(o)&&Be.includes(o)).map(([o,i])=>({key:o,icon:kl[o],tooltip:s.jsxRuntimeExports.jsx(Tl,{mode:o,triggers:i})})).sort((o,i)=>Be.indexOf(o.key)-Be.indexOf(i.key));return s.jsxRuntimeExports.jsx(ie.Button,{...n,data:r,entryRenderKey:"icon",children:({title:o,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)})},Ll=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Nt,MASK_MODES:Ls,MODES:Be,Mask:_t,PAN_DEFAULT_TRIGGERS:Ms,SELECT_DEFAULT_TRIGGERS:_s,SelectMode:Pl,ZOOM_DEFAULT_TRIGGERS:Ze,modeZ:yl,use:$s},Symbol.toStringTag,{value:"Module"})),Ns=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Bt=x.forwardRef(({children:e,initial:t=l.To.DECIMAL,onChange:n,...r},o)=>{const{setViewport:i}=Se("Viewport");x.useLayoutEffect(()=>{i({box:t,mode:"zoom",cursor:l.q.ZERO,stage:"start"})},[i,t]);const u=x.useCallback(d=>{i(d),n==null||n(d)},[n,i]),a=$s({onChange:u,initial:t,ref:o,...r});return s.jsxRuntimeExports.jsx(_t,{className:l.CSS.BE("line-plot","viewport"),...a,children:e})});Bt.displayName="Viewport";const Ml=Object.freeze(Object.defineProperty({__proto__:null,Legend:bs,Line:Mt,LinePlot:gs,Title:ws,Tooltip:il,Viewport:Bt,XAxis:Es,YAxis:Rs,axisFactory:kt,selectViewportEl:Ns,useContext:Se,useGridEntry:nt,useViewport:Ss},Symbol.toStringTag,{value:"Module"})),_l=c.wrap$1("Tooltip",({aetherKey:e,...t})=>(c.use$3({aetherKey:e,type:m.Annotation.TYPE,schema:m.annotationStateZ,initialState:t}),null)),Bs=c.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...n})=>{const{setViewport:r,setHold:o}=Se("Range.Provider"),[,{hovered:i,count:u},a]=c.use$3({aetherKey:e,type:m.Provider$1.TYPE,schema:m.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),d=nt({key:e,loc:"top",size:u>0?32:0,order:"last"},"Annotation.Provider"),j=c.useContextMenu(),p=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),p.current||a(R=>({...R,cursor:null}))},{once:!0})},[a]);return s.jsxRuntimeExports.jsx(c.ContextMenu,{style:{...d,cursor:i!=null?"pointer":"default"},...j,menu:()=>t==null||i==null?null:t(i),children:s.jsxRuntimeExports.jsx(O.Space,{style:{width:"100%",height:"100%"},onClick:()=>{i!=null&&(r({box:l.To.construct({x:i.viewport.lower,y:0},{x:i.viewport.upper,y:1}),mode:"zoom",cursor:l.q.ZERO,stage:"start"}),o(!0))},onMouseEnter:f})})}),$l=Object.freeze(Object.defineProperty({__proto__:null,Annotation:_l,Provider:Bs},Symbol.toStringTag,{value:"Module"})),Os={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Nl=c.flattenConfig(Os),zs=c.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=c.use$3({aetherKey:e,type:m.Measure.TYPE,schema:m.measureStateZ,initialState:{hover:null,one:null,two:null}}),n=x.useRef(null),r=c.useHeldRef({triggers:Nl,loose:!0}),o=x.useCallback(({mode:a,cursor:d})=>{if(a==="click"){const j=c.determineMode(Os,r.current.triggers,!0);if(["one","two"].includes(j))return t(p=>({...p,[j]:d}));t(j==="clear"?p=>({...p,one:null,two:null}):p=>({...p,one:p.one??d,two:p.one!==null?d:p.two}))}},[t,r]);Ss(o);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(n.current===null)return;const a=n.current.parentElement;if(a!=null)return a.addEventListener("mousemove",i),a.addEventListener("mouseleave",u),()=>{a.removeEventListener("mousemove",i),a.removeEventListener("mouseleave",u)}},[o]),s.jsxRuntimeExports.jsx("span",{ref:n})}),Bl=Object.freeze(Object.defineProperty({__proto__:null,Measure:zs},Symbol.toStringTag,{value:"Module"})),Ot=c.wrap$1("Rule",({aetherKey:e,label:t,position:n,onLabelChange:r,onPositionChange:o,units:i="",color:u,lineWidth:a,lineDash:d})=>{const[j,p]=k.usePurePassthrough({value:t,onChange:r,initial:""}),[,{position:f,pixelPosition:S},h]=c.use$3({aetherKey:e,type:m.Rule.TYPE,schema:m.ruleStateZ,initialState:{color:u,dragging:!1,position:n,lineWidth:a,lineDash:d}});x.useEffect(()=>{if(f==null)return;if(n==null)return o==null?void 0:o(f);const E=l.R.construct(f+.01,f-.01);n!=null&&!l.R.contains(E,n)&&(o==null||o(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:n,color:u,lineWidth:a,lineDash:d}))},[n,u,a,d]);const v=et({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=Ns(L==null?void 0:L.current),b=s.jsxRuntimeExports.jsxs("div",{ref:L,className:l.CSS.B("rule"),style:{top:`calc(${S}px - 0.5rem)`},children:[s.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("rule","drag-handle"),onDragStart:v,draggable:!0}),s.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[s.jsxRuntimeExports.jsx(c.Editable,{level:"p",value:j,onChange:p}),s.jsxRuntimeExports.jsx(c.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${f.toFixed(2)} ${i}`})]})]});return g==null?b:yt.createPortal(b,g)}),Ol=Object.freeze(Object.defineProperty({__proto__:null,Rule:Ot},Symbol.toStringTag,{value:"Module"})),Vs=c.canDropOfType(fe),zl=({lines:e,axes:t,showTitle:n=!0,title:r="",onTitleChange:o,showLegend:i=!0,legendPosition:u,onLegendPositionChange:a,titleLevel:d="h4",onLineChange:j,onRuleChange:p,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 N;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)&&((N=M.current)==null||N.reset()),s.jsxRuntimeExports.jsxs(gs,{...E,children:[y.map((w,$)=>{const T=e.filter(q=>q.axes.x===w.key),B=t.filter(({location:q})=>l.J.isX(q)),A=h==null?void 0:h.filter(q=>[...B.map(({key:H})=>H),w.key].includes(q.axis));return s.jsxRuntimeExports.jsx(Vl,{axis:w,index:$,lines:T,yAxes:B,rules:A,onAxisChannelDrop:f,onAxisChange:S,annotationProvider:b},w.key)}),i&&s.jsxRuntimeExports.jsx(bs,{onLineChange:j,position:u,onPositionChange:a}),n&&s.jsxRuntimeExports.jsx(ws,{value:r,onChange:o,level:d}),s.jsxRuntimeExports.jsxs(Bt,{initial:v,onChange:L,triggers:g,ref:M,children:[C&&s.jsxRuntimeExports.jsx(Ts,{}),R&&s.jsxRuntimeExports.jsx(zs,{})]})]})},Vl=({yAxes:e,lines:t,index:n,rules:r,onRuleChange:o,onAxisChannelDrop:i,onAxisChange:u,axis:{location:a,key:d,showGrid:j,...p},annotationProvider:f})=>{const S=c.useDrop({type:"Channel.LinePlot.XAxis",canDrop:Vs,onDrop:x.useCallback(({items:R})=>{const v=c.filterByType(fe,R);return i==null||i(d,v.map(({key:L})=>L)),v},[d,i])}),h=r==null?void 0:r.filter(R=>R.axis===d),C=c.useDraggingState();return s.jsxRuntimeExports.jsxs(Es,{...p,...S,location:a,showGrid:j??n===0,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(fe)(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=r==null?void 0:r.filter(b=>b.axis===R.key);return s.jsxRuntimeExports.jsx(Dl,{axis:{...R,showGrid:j??(n===0&&v===0)},lines:L,rules:g,onRuleChange:o,onAxisChannelDrop:i,onAxisChange:u},R.key)}),h==null?void 0:h.map(R=>x.createElement(Ot,{aetherKey:R.key,...R,key:R.key,onLabelChange:v=>o==null?void 0:o({key:R.key,label:v}),onPositionChange:v=>o==null?void 0:o({key:R.key,position:v})})),s.jsxRuntimeExports.jsx(Bs,{...f})]})},Al=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Dl=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:r,onAxisChange:o,axis:{key:i,location:u,...a}})=>{const d=c.useDrop({type:"Channel.LinePlot.YAxis",canDrop:Vs,onDrop:x.useCallback(({items:p})=>{const f=c.filterByType(fe,p);return r==null||r(i,f.map(({key:S})=>S)),f},[i,r])}),j=c.useDraggingState();return s.jsxRuntimeExports.jsxs(Rs,{...a,...d,location:u,className:l.CSS(l.CSS.dropRegion(c.canDropOfType(fe)(j))),onAutoBoundsChange:p=>o==null?void 0:o({key:i,bounds:p}),children:[e.map(p=>s.jsxRuntimeExports.jsx(Il,{line:p},Al(p))),t==null?void 0:t.map(p=>x.createElement(Ot,{aetherKey:p.key,...p,key:p.key,onLabelChange:f=>n==null?void 0:n({key:p.key,label:f}),onPositionChange:f=>n==null?void 0:n({key:p.key,position:f})}))]})},Il=({line:e})=>e.variant==="static"?s.jsxRuntimeExports.jsx(Fl,{line:e}):s.jsxRuntimeExports.jsx(Zl,{line:e}),Zl=({line:{key:e,timeSpan:t,channels:{x:n,y:r},...o}})=>{const i=Number(t.valueOf())*3,u=m.streamChannelData({timeSpan:t,channel:r,keepFor:i}),a=n!=null&&n!==0,d=m.streamChannelData({timeSpan:t,channel:a?n:r,useIndexOfChannel:!a,keepFor:i});return s.jsxRuntimeExports.jsx(Mt,{aetherKey:e,y:u,x:d,...o})},Fl=({line:{timeRange:e,key:t,channels:{x:n,y:r},...o}})=>{const i=m.channelData({timeRange:e,channel:r}),u=n!=null&&n!==0,a=m.channelData({timeRange:e,channel:u?n:r,useIndexOfChannel:!u});return s.jsxRuntimeExports.jsx(Mt,{aetherKey:t,y:i,x:a,...o})},Qt=[{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"}],Ye=({items:e},t)=>{const n=c.filterByType(fe,e);return n.length>0&&!n.every(r=>t.includes(r.key))},As=["name","alias"],Ds=e=>{const t=tt();return x.useMemo(()=>e.length===0?Qt:Qt.filter(n=>e.includes(n.key)),[e,t])},ql=({columns:e=As,onChange:t,className:n,value:r,searchOptions:o,...i})=>{const u=ke(),a=tt(),d=Ds(e),j=wt(),p=c.useMemoDeepEqualProps(o),f=x.useMemo(()=>u==null?void 0:u.channels.newSearcherWithOptions({rangeKey:j,internal:!1,...p}),[u,j,p]),S=u!=null?void 0:s.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=>Ye(E,k.A(r)),[r]),onDrop:x.useCallback(({items:E})=>{const y=c.filterByType(fe,E);if(y.length===0)return[];const M=k.n([...k.A(r),...y.map(V=>V.key)]);return t(M,{clickedIndex:null,clicked:null,entries:[]}),y},[t,r])}),v=c.useDraggingState(),L=x.useCallback(({dropped:E})=>{t(k.A(r).filter(y=>!E.some(M=>M.key===y)),{clickedIndex:null,clicked:null,entries:[]})},[t,r]),g=x.useCallback((E,y)=>h([{key:y,type:fe}],L),[h,L]),b=x.useCallback(E=>a[E.key]??E.name,[a]);return s.jsxRuntimeExports.jsx(ot,{className:l.CSS(n,l.CSS.dropRegion(Ye(v,k.A(r)))),value:r,onTagDragStart:g,onTagDragEnd:C,searcher:f,onChange:t,columns:d,emptyContent:S,entryRenderKey:b,...R,...i})},ge=({columns:e=As,onChange:t,value:n,className:r,data:o,searchOptions:i,...u})=>{const a=ke(),d=tt(),j=Ds(e),p=wt(),f=c.useMemoDeepEqualProps(i),S=x.useMemo(()=>{if(!(o!=null&&o.length>0))return a==null?void 0:a.channels.newSearcherWithOptions({rangeKey:p,internal:!1,...f})},[a,p,o==null?void 0:o.length,f]),h=a!=null?void 0:s.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=>Ye(M,k.o(n)),[n]),onDrop:x.useCallback(({items:M})=>{const V=c.filterByType(fe,M);return V.length===0?[]:(t(V[0].key,{clickedIndex:null,clicked:null,entries:[]}),V)},[R,t])}),b=c.useDraggingState(),E=x.useCallback(()=>n!=null&&v([{type:fe,key:n}]),[v,n]),y=x.useCallback(M=>d[M.key]??M.name,[d]);return s.jsxRuntimeExports.jsx(rt,{data:o,className:l.CSS(r,l.CSS.dropRegion(Ye(b,k.o(n)))),value:n,onDragStart:E,onDragEnd:L,onChange:t,searcher:S,columns:j,emptyContent:h,entryRenderKey:y,...g,...u})},Yl=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:Zo,AliasProvider:js,LinePlot:zl,SelectMultiple:ql,SelectSingle:ge,useActiveRange:wt,useAlias:ps,useAliases:tt,useContext:ms,useName:st},Symbol.toStringTag,{value:"Module"})),Is=e=>k.c(e,(t,n,r)=>{const o=n===r.length-1,i=!isNaN(parseInt(t)),u=!isNaN(parseInt(r[n+1]));return i&&(t="element"),o||u?t:[t,"shape"]}),es=(e,t)=>{if(e==null)return null;const n=e[t];return n==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:n},Hl=(e,t,n)=>k.i(es(e,"shape"),Is(t),{...n,getter:es}),Gl=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:Hl,getFieldSchemaPath:Is},Symbol.toStringTag,{value:"Module"})),ye=({path:e,optional:t=!1,onChange:n})=>{const r=Ee(),{get:o,bind:i,set:u,setStatus:a}=r,[d,j]=x.useState(o(e,{optional:t}));x.useEffect(()=>(j(o(e,{optional:t})),i({path:e,onChange:j,listenToChildren:!1})),[e,n,i,o]);const p=x.useCallback(S=>{n==null||n(S,{...r,path:e}),u(e,S)},[e,u,n]),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:p,setStatus:f,...d}},Zs=(e,t=!1,n)=>{const{get:r,bind:o}=Ee(n),[,i]=x.useState(0);return x.useEffect(()=>(i(u=>u+1),o({path:e,onChange:()=>i(u=>u+1)})),[e,o]),r(e,{optional:t})??null},Ul=(e,t=!1,n)=>{var u;const{get:r,bind:o}=Ee(n),[,i]=x.useState(0);return x.useEffect(()=>(i(a=>a+1),o({path:e,onChange:()=>i(a=>a+1)})),[e,o]),((u=r(e,{optional:t}))==null?void 0:u.value)??null},Wl=e=>{var t,n;return((n=(t=Zs(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},Xl=({path:e,ctx:t,onChange:n})=>{const r=Ee(t);x.useEffect(()=>r.bind({path:e,onChange:o=>n(o,r),listenToChildren:!1}),[e,r])},Jl=({path:e,optional:t=!1})=>{const{bind:n,get:r}=Ee(),[o,i]=x.useState(r(e,{optional:t}));if(x.useEffect(()=>(i(r(e,{optional:t})),n({path:e,onChange:u=>i({...u,value:k.C(u.value)}),listenToChildren:!0})),[e,n,r]),o==null&&!t)throw new Error("Field state is null");return(o==null?void 0:o.value)??null},Kl=({path:e,updateOnChildren:t=!1})=>{const{bind:n,get:r,set:o}=Ee(),[i,u]=x.useState(r(e).value);x.useEffect(()=>(u(r(e).value),n({path:e,onChange:S=>u(k.C(S.value)),listenToChildren:t})),[e,n,r,u]);const a=x.useCallback(S=>{const h=k.C(r(e).value);h.push(...k.A(S)),o(e,h,{validateChildren:!1})},[e,r,o]),d=x.useCallback((S,h)=>{const C=k.C(r(e).value);C.splice(h,0,...k.A(S)),o(e,C,{validateChildren:!1})},[e,r,o]),j=x.useCallback(S=>{const h=r(e).value,C=new Set(k.A(S));o(e,h.filter((R,v)=>!C.has(v)))},[e,k.state,r]),p=x.useCallback(S=>{const h=r(e).value,C=new Set(k.A(S));o(e,h.filter((R,v)=>C.has(v)))},[e,i,r]),f=x.useCallback(S=>{o(e,k.executeSetter(S,r(e).value))},[e,o]);return{value:i,push:a,remove:j,keepOnly:p,set:f,add:d}},zt=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:()=>{}}),Ee=e=>{const t=x.useContext(zt);return e??t},ts=e=>({key:e,variant:"success",message:""}),Ql=e=>e.code===re.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",ei=({values:e,sync:t=!1,schema:n,onChange:r})=>{const o=x.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),i=c.useSyncedRef(n),u=c.useSyncedRef(r),a=x.useCallback(({path:g,onChange:b,listenToChildren:E=!1})=>{var _;const{parentListeners:y,listeners:M}=o.current,V=E?y:M;return V.has(g)||V.set(g,new Set),(_=V.get(g))==null||_.add(b),()=>{var N;return(N=V.get(g))==null?void 0:N.delete(b)}},[]),d=x.useCallback((g,{optional:b}={optional:!1})=>{const{state:E,statuses:y,touched:M}=o.current,V=k._.get(E,g,{optional:b});if(V==null)return null;const _={value:V,status:y.get(g)??ts(g),touched:M.has(g),required:!1};if(i.current==null)return _;const N=i.current,w=Gl.getFieldSchema(N,g,{optional:!0});return w==null||(_.required=!w.isOptional()),_},[]),j=x.useCallback(g=>{var y;const{listeners:b}=o.current,E=d(g,{optional:!0});E!=null&&((y=b.get(g))==null||y.forEach(M=>M(E)))},[]),p=x.useCallback(g=>{const{listeners:b,parentListeners:E}=o.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 N=d(V,{optional:!0});N!=null&&M.forEach(w=>{w(N)})}})},[]),f=x.useCallback((g,b="",E=!0)=>{const{statuses:y,listeners:M,touched:V}=o.current;if(g.success){const $=[...y.keys()];return y.clear(),$.forEach(T=>j(T)),!0}let _=!0;const N=new Set(g.error.issues.map($=>$.path.join(".")));let w=($,T)=>$===T;return E&&(w=($,T)=>k._.pathsMatch($,T)),g.error.issues.forEach($=>{var H;const{message:T}=$,B=$.path.join(".");if(!w(B,b))return;const A=Ql($);A!=="warning"&&(_=!1),y.set(B,{key:B,variant:A,message:T}),V.add(B);let q=d(B,{optional:!0});q==null&&(q={value:void 0,status:y.get(B)??ts(B),touched:!1,required:!1}),(H=M.get(B))==null||H.forEach(ee=>ee(q))}),y.forEach(($,T)=>{N.has(T)||(y.delete(T),j(T))}),_},[]),S=x.useCallback((g,b)=>{if(i.current==null)return!0;const{state:E}=o.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}=o.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}=o.current;V.add(g),g.length===0?o.current.state=b:k._.set(M,g,b);try{S(g,y)}catch{h(g,y)}p(g),(_=u.current)==null||_.call(u,o.current.state)},[]),R=x.useCallback(g=>k._.has(o.current.state,g),[]),v=x.useCallback((g,b)=>{o.current.statuses.set(g,b),o.current.touched.add(g),j(g)},[]),L=x.useCallback(()=>{const{statuses:g}=o.current;g.clear(),g.forEach((b,E)=>j(E))},[]);return x.useEffect(()=>{if(!t)return;const{listeners:g}=o.current;o.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:()=>o.current.state,has:R,setStatus:v,clearStatuses:L}),[])},ti=e=>s.jsxRuntimeExports.jsx(zt.Provider,{value:e,children:e.children}),si=c.componentRenderProp(c.Text$1),me=({path:e,children:t=si,label:n,padHelpText:r=!0,visible:o=!0,hideIfNull:i=!1,optional:u,onChange:a,className:d,...j})=>{const p=ye({path:e,optional:u??i,onChange:a}),f=Ee();if(p==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n==null&&(n=l._.capitalize(k._.element(e,-1))),o=typeof o=="function"?o(p,f):o,!o)return null;const S=p.status.message,{onChange:h,value:C}=p;return s.jsxRuntimeExports.jsx(xe.Item,{padHelpText:r,helpText:S,helpTextVariant:p.status.variant,label:n,required:p.required,className:l.CSS(d,l.CSS.BE("field",e.split(".").join("-")),l.CSS.M(p.status.variant)),...j,children:t({onChange:h,value:C})})},be=e=>({fieldKey:t,fieldProps:n,inputProps:r})=>{const o=({inputProps:i,path:u,fieldKey:a=t,...d})=>s.jsxRuntimeExports.jsx(me,{...n,...d,path:a?`${u}.${a}`:u,children:j=>s.jsxRuntimeExports.jsx(e,{...j,...r,...i})});return o.displayName=e.displayName,o},Fs=be(c.Numeric),ni=Fs({}),qs=be(c.Text$1),ri=qs({}),Ys=be(c.Switch$1),oi=Ys({}),li=be(rt),ii=be(ot),ci=be(ie.DropdownButton),ai=Object.freeze(Object.defineProperty({__proto__:null,Context:zt,Field:me,Form:ti,NumericField:ni,SwitchField:oi,TextField:ri,buildDropdownButtonSelectField:ci,buildNumericField:Fs,buildSelectMultiField:ii,buildSelectSingleField:li,buildSwitchField:Ys,buildTextField:qs,fieldBuilder:be,use:ei,useChildFieldValues:Jl,useContext:Ee,useField:ye,useFieldArray:Kl,useFieldListener:Xl,useFieldState:Zs,useFieldValid:Wl,useFieldValue:Ul},Symbol.toStringTag,{value:"Module"})),ui=[{key:"name",name:"Name"},{key:"location",name:"Location"}],xi=({searchOptions:e,...t})=>{const n=ke();let r=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(r=n.hardware.devices.newSearcherWithOptions(e)),s.jsxRuntimeExports.jsx(rt,{columns:ui,searcher:r,entryRenderKey:"name",...t})},di=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:xi},Symbol.toStringTag,{value:"Module"})),Ve=(e,t)=>x.cloneElement(e,{className:l.CSS(e.props.className,l.CSS.B("sub"),l.CSS.M(t))}),Hs=({topRight:e,topLeft:t,bottomLeft:n,bottomRight:r,children:o,className:i,...u})=>s.jsxRuntimeExports.jsxs("div",{className:l.CSS(i,l.CSS.B("icon")),...u,children:[e&&Ve(e,"topRight"),t&&Ve(t,"topLeft"),n&&Ve(n,"bottomLeft"),r&&Ve(r,"bottomRight"),o]}),mi=e=>s.jsxRuntimeExports.jsx(Hs,{topRight:s.jsxRuntimeExports.jsx(c.k0.Add,{}),...e}),pi=Object.freeze(Object.defineProperty({__proto__:null,Create:mi,Icon:Hs},Symbol.toStringTag,{value:"Module"})),ji=({visible:e,children:t,close:n,...r})=>{const o=x.useRef(null);return c.useClickOutside({ref:o,onClickOutside:n}),c.use$2({triggers:[["Escape"]],callback:n,loose:!0}),yt.createPortal(s.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(l.CSS.BE("modal","bg"),l.CSS.visible(e)),role:"dialog",empty:!0,align:"center",children:s.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(l.CSS.BE("modal","dialog")),role:"dialog",empty:!0,ref:o,...r,children:s.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(l.CSS.BE("modal","content")),role:"dialog",empty:!0,children:t})})}),c.getRootElement())},fi=Object.freeze(Object.defineProperty({__proto__:null,Modal:ji},Symbol.toStringTag,{value:"Module"})),Vt=new Error("Tab not found"),hi=new Error("Invalid Mosaic"),Gs=(e,t,n="center",r)=>{var d;if(e=ve(e),r===void 0)return ht(e,t);const o=Ks(e,r);if(n==="center")return(d=o.tabs)==null||d.push(t),o.selected=t.tabKey,e;if(o.tabs==null||o.tabs.length===0)return e;const[i,u,a]=Ei(n);if(o.direction=a,o[i]={key:0,tabs:[t],selected:t.tabKey},o[u]={key:0,tabs:o.tabs,selected:o.selected},o.first==null||o.last==null)throw hi;return o.first.key=o.key*2,o.last.key=o.key*2+1,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},ht=(e,t)=>(e=ve(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)),He=e=>{e=ve(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[n,r]=He(e.first);e.first=n,t.push(...r)}if(e.last!=null){const[n,r]=He(e.last);e.last=n,t.push(...r)}return[e,t]},At=(e,t)=>{var o;e=ve(e);const[,n]=we(e,t);if(n==null)return[e,null];n.tabs=(o=n.tabs)==null?void 0:o.filter(i=>i.tabKey!==t),n.selected=X.resetSelection(n.selected,n.tabs),e=gi(e);const r=n.selected??Ge(e);return[e,r]},Ge=e=>e.selected!=null?e.selected:e.first!=null?Ge(e.first):e.last!=null?Ge(e.last):null,Us=(e,t)=>{e=ve(e);const[n,r]=we(e,t);if(n==null||r==null)throw Vt;return r.selected=t,e},Ws=(e,t,n,r)=>{e=ve(e);const[o,i]=we(e,t);if(o==null||i==null)throw Vt;const[u,a]=At(e,t);return[Gs(u,o,n,r),a]},Xs=(e,t,n)=>{const r=Ue(e,t);if(r==null)throw new Error("Node not found");return r.size=n,e},Js=(e,t,n)=>{e=ve(e);const[,r]=we(e,t);if((r==null?void 0:r.tabs)==null)throw Vt;return r.tabs=X.rename(t,n,(r==null?void 0:r.tabs)??[]),e},Si=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,Ks=(e,t)=>{const n=Ue(e,t);if(n!=null)return n;const r=Math.floor(t/2);return r===0?e:Ks(e,r)},gi=e=>{let t=!0;for(;t;)[e,t]=St(e);return e.first==null&&e.last==null&&(e.key=1),e},St=e=>{if(e.first==null||e.last==null)return[e,!1];if(ns(e.first))return[ss(e.last,!0),!0];if(ns(e.last))return[ss(e.first,!1),!0];let[t,n]=[!1,!1];return[e.first,t]=St(e.first),[e.last,n]=St(e.last),[e,t||n]},ss=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),ns=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),we=(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[n,r]=we(e.first,t);if(n!=null&&r!=null)return[n,r];const[o,i]=we(e.last,t);return[o,i]},Ue=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=Ue(e.first,t);return n??Ue(e.last,t)},Ei=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")}},ve=e=>k._.copy(e),We=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&We(e.first,t,n),e.last!=null&&We(e.last,t,n),n),gt=(e,t)=>{t(e),e.first!=null&&gt(e.first,t),e.last!=null&&gt(e.last,t)};class Ri{constructor(t={}){je(this,"parent");je(this,"stub");je(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([n,r])=>this.el.setAttribute(n,r))}mount(t,n){n!==this.stub&&(this.unmount(null),t.replaceChild(this.el,n),this.parent=t,this.stub=n)}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 Ci=({node:e})=>{const t=x.createRef(),n=x.useRef(e);return x.useEffect(()=>{const r=t.current;if(r==null)return;const o=r.parentNode;if(o!=null)return e.mount(o,r),()=>{t.current!=null&&e.unmount(t.current)}},[]),x.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const r=t.current;if(r==null)return;const o=r.parentNode;o!=null&&e.mount(o,r)},[e]),s.jsxRuntimeExports.jsx("div",{ref:t})},yi=({node:e,children:t})=>yt.createPortal(t,e.el),Qs=x.memo(({children:e,...t})=>{const n=x.useRef(new Map),r=new Set,o=We(t.root,i=>{var d;if(i.selected==null)return null;let u=n.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 Ri({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)}),n.current.set(i.selected,u)),r.add(i.selected),s.jsxRuntimeExports.jsx(yi,{node:u,children:e(a)},a.tabKey))});return n.current.forEach((i,u)=>!r.has(u)&&n.current.delete(u)),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[o,s.jsxRuntimeExports.jsx(Xe,{portalNodes:n,...t})]})}),Xe=x.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:r,direction:o,first:i,last:u,key:a,size:d},emptyContent:j,...p}=n,f=x.useCallback(([C])=>t(a,C),[t]),{props:S}=bt({direction:o,onResize:f,count:2,initialSizes:d!=null?[d]:void 0});let h;return r!==void 0?h=s.jsxRuntimeExports.jsx(en,{emptyContent:j,...n}):i!=null&&u!=null?h=s.jsxRuntimeExports.jsxs(Qe,{align:"stretch",className:l.CSS.BE("mosaic","resize"),...S,children:[s.jsxRuntimeExports.jsx(Xe,{...p,root:i,onResize:t},i.key),s.jsxRuntimeExports.jsx(Xe,{...p,root:u,onResize:t},u.key)]}):(h=null,console.warn("Mosaic tree is malformed")),a===1?s.jsxRuntimeExports.jsx(c.Provider$2,{children:h}):h});Qs.displayName="Mosaic";Xe.displayName="Mosaic";const Je="pluto-mosaic-tab-drop",Dt="pluto-mosaic-tab-create",bi=(e,t,n)=>{if(c.filterByType(c.FILE_TYPE,t).length>0&&n)return!0;const o=c.filterByType(Je,t).map(a=>a.key),i=e.filter(a=>!o.includes(a.tabKey)).length>0;return c.filterByType(Dt,t).length>0||o.length>0&&(i||e.length===0)},en=x.memo(({root:e,onDrop:t,onCreate:n,portalNodes:r,activeTab:o,onFileDrop:i,...u})=>{const{key:a,tabs:d}=e,[j,p]=x.useState(null),f=i!=null,S=x.useCallback(({items:y})=>bi(d,y,f),[d,f]),h=x.useCallback(({items:y,event:M})=>{if(M==null)return[];p(null);const V=c.filterByType(c.FILE_TYPE,y).length>0,_=d.length===0?"center":os(rs(M));if(V)return i==null||i(a,_,M),y;const N=c.filterByType(Je,y);if(N.length>0){const $=N.map(({key:T})=>T)[0];t(a,$,_)}const w=c.filterByType(Dt,y);if(w.length>0){const $=w.map(({key:T})=>T);n==null||n(a,_,$)}return N},[t,d.length]),C=x.useCallback(({event:y})=>{if(y==null)return;const M=d.length===0?"center":os(rs(y));p(M)},[d.length]),{startDrag:R,...v}=c.useDragAndDrop({type:"Mosaic",canDrop:S,onDrop:h,onDragOver:C}),L=S(c.useDraggingState()),g=x.useCallback(()=>p(null),[]),b=x.useCallback((y,{tabKey:M})=>{R([{key:M,type:Je,elementID:y.currentTarget.id}])},[R]),E=x.useCallback(()=>n==null?void 0:n(a,"center"),[a]);return s.jsxRuntimeExports.jsxs("div",{className:l.CSS.BE("mosaic","leaf"),children:[s.jsxRuntimeExports.jsxs(X.Tabs,{id:`tab-${a}`,tabs:d,onDragLeave:g,selected:e.selected,selectedAltColor:o===e.selected,onDragStart:b,onCreate:E,...u,...v,children:[s.jsxRuntimeExports.jsx(Ci,{node:r.current.get(e.selected)}),L&&s.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),j!=null&&s.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("mosaic","mask"),style:vi[j]})]})});en.displayName="MosaicTabLeaf";const vi={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%"}},rs=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;return r<24?{px:.5,py:.5}:{px:n/t.width,py:r/t.height}},wi=e=>e,Ti=e=>1-e,os=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,r]=[wi(e),Ti(e)];if(t>n&&t>r)return"bottom";if(t<n&&t<r)return"top";if(t>n&&t<r)return"left";if(t<n&&t>r)return"right";throw new Error("[bug] - invalid insert position")},ki=re.z.object({key:re.z.number(),tabs:re.z.array(X.tabZ).optional(),selected:re.z.string().optional(),direction:l.g.direction.optional(),size:re.z.number().optional()}),Et=ki.extend({first:re.z.lazy(()=>Et).optional(),last:re.z.lazy(()=>Et).optional()}),Pi=({allowRename:e=!1,initialTree:t})=>{const[n,r]=x.useState(t);return x.useEffect(()=>r(He(t)[0]),[t]),{root:n,onDrop:(j,p,f)=>r(S=>Ws(S,p,f,j)[0]),onClose:j=>r(p=>At(p,j)[0]),onSelect:j=>r(p=>Us(p,j)),onResize:(j,p)=>r(f=>Xs(f,j,p)),onRename:e?(j,p)=>r(f=>Js(f,j,p)):void 0}},Li=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Dt,HAUL_DROP_TYPE:Je,Mosaic:Qs,autoSelectTabs:He,findSelected:Ge,forEachNode:gt,insertTab:Gs,isEmpty:Si,mapNodes:We,moveTab:Ws,nodeZ:Et,removeTab:At,renameTab:Js,resizeNode:Xs,selectTab:Us,use:Pi},Symbol.toStringTag,{value:"Module"})),Mi=({location:e="left",size:t="9rem",className:n,style:r,...o})=>{const i=l.J.construct(e),u=l.J.direction(i),a=l.g.swap(u);return s.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),n),direction:a,style:{[l.g.dimension(u)]:t,...r},align:"center",empty:!0,...o})},Oe=e=>({bordered:t=!1,className:n,...r})=>s.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),n),align:"center",...r}),tn=Oe("start");tn.displayName="NavbarStart";const sn=Oe("end");sn.displayName="NavbarEnd";const nn=Oe("center");nn.displayName="NavbarCenter";const rn=Oe("");rn.displayName="NavbarContent";const on=Oe("absolute-center");on.displayName="NavbarAbsoluteCenter";const Le=Mi;Le.Start=tn;Le.Center=nn;Le.End=sn;Le.AbsoluteCenter=on;Le.Content=rn;const It=({aetherKey:e})=>{const[,{region:t},n]=c.use$3({aetherKey:e,type:m.Eraser$1.TYPE,schema:m.eraserStateZ,initialState:{region:l.To.ZERO,enabled:!0}}),r=c.useSyncedRef(t),o=x.useCallback(u=>{l.To.equals(u,r.current)||n(a=>({...a,region:u}))},[n]);return{setEnabled:x.useCallback(u=>n(a=>({...a,enabled:u})),[n]),erase:o}},_i=c.wrap$1(m.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:n}=It({aetherKey:e}),r=c.useResize(n);return s.jsxRuntimeExports.jsx("div",{ref:r,className:l.CSS(l.CSS.inheritDims()),children:t})}),$i=Object.freeze(Object.defineProperty({__proto__:null,Eraser:_i,use:It},Symbol.toStringTag,{value:"Module"})),Ni=({items:e,initialKey:t})=>{const[n,r]=x.useState(t),o=u=>r(u===n?void 0:u),i=e.find(u=>u.key===n);return{onSelect:o,activeItem:i}},Bi=c.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:n,onSelect:r,location:o="left",collapseThreshold:i=.65,className:u,onResize:a,...d})=>{const j=l.J.direction(o),p=x.useCallback(()=>t!=null&&(r==null?void 0:r(t.key)),[r,t==null?void 0:t.key]),{erase:f,setEnabled:S}=It({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 s.jsxRuntimeExports.jsx(xs,{className:l.CSS(l.CSS.BE("navdrawer","content"),l.CSS.dir(j),u),collapseThreshold:i,onCollapse:p,location:o,onResize:h,...v,...d,children:t.content},R)}),Oi=Object.freeze(Object.defineProperty({__proto__:null,Bar:Le,Drawer:Bi,useDrawer:Ni},Symbol.toStringTag,{value:"Module"})),zi=({variant:e,className:t,children:n,...r})=>s.jsxRuntimeExports.jsx(O.Space,{className:l.CSS(t,l.CSS.B("note"),l.CSS.M(e)),align:"stretch",empty:!0,...r,children:n}),Vi=Object.freeze(Object.defineProperty({__proto__:null,Note:zi},Symbol.toStringTag,{value:"Module"})),ln=({key:e,open:t,onChange:n})=>{const r=c.useMemoCompare(()=>e,([o],[i])=>k.E.unorderedPrimitiveArrays(o,i)===k.E.EQUAL,[e]);c.useAsyncEffect(async()=>{const o=await t();if(o!=null)return o.onChange(n),()=>o.close()},[r])},Ai=e=>{const[t,n]=x.useState(e.initialValue);return ln({...e,onChange:n}),t},Di=Object.freeze(Object.defineProperty({__proto__:null,useListener:ln,useState:Ai},Symbol.toStringTag,{value:"Module"})),dt={Close:s.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),s.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:s.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:s.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.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"}),s.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"})]})},Ii=({disabled:e=[],className:t,focused:n=!0,onMinimize:r,onMaximize:o,onFullscreen:i,onClose:u,...a})=>s.jsxRuntimeExports.jsxs(O.Space,{size:1.5,direction:"x",className:l.CSS(l.CSS.B("macos-controls"),!n&&l.CSS.BM("macos-controls","blurred"),t),...a,children:[s.jsxRuntimeExports.jsx(mt,{onClick:u,className:l.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:dt.Close}),s.jsxRuntimeExports.jsx(mt,{onClick:r,className:l.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:dt.Minimize}),s.jsxRuntimeExports.jsx(mt,{onClick:i,className:l.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:dt.Maximize})]}),mt=({className:e,disabled:t,...n})=>s.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("macos-control"),l.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...n}),pt=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:r,onFullscreen:o,focused:i,...u})=>s.jsxRuntimeExports.jsxs(O.Pack,{...u,children:[s.jsxRuntimeExports.jsx(jt,{className:l.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:s.jsxRuntimeExports.jsx(c.k0.Subtract,{})}),s.jsxRuntimeExports.jsx(jt,{className:l.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:s.jsxRuntimeExports.jsx(c.k0.Box,{})}),s.jsxRuntimeExports.jsx(jt,{onClick:r,className:l.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:s.jsxRuntimeExports.jsx(c.k0.Close,{})})]}),jt=({disabled:e=!1,className:t,...n})=>e?null:s.jsxRuntimeExports.jsx(c.Icon,{className:l.CSS(l.CSS.B("windows-control"),t),tabIndex:-1,...n}),cn=e=>k.w$1.getOS(e),Zi={MacOS:Ii,Windows:pt,Linux:pt,Docker:pt},Fi="Windows",qi=({forceOS:e,visibleIfOS:t,...n})=>{const r=cn({force:e,default:Fi}),o=Zi[r];return t!=null&&t!==r?null:s.jsxRuntimeExports.jsx(o,{...n})},Yi=Object.freeze(Object.defineProperty({__proto__:null,Controls:qi,use:cn},Symbol.toStringTag,{value:"Module"}));x.createContext({instrumentation:k.B.NOOP});const Hi=c.wrap$1(m.Provider$2.TYPE,({aetherKey:e,children:t,...n})=>{const r=c.useMemoDeepEqualProps(n),[{path:o},,i]=c.use$3({aetherKey:e,type:m.Provider$2.TYPE,schema:m.providerStateZ$1,initialState:r});return x.useEffect(()=>{i(r)},[r,i]),s.jsxRuntimeExports.jsx(c.Composite,{path:o,children:t})}),Gi="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",an=c.wrap$1(m.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:n}]=c.use$3({aetherKey:t,type:m.BaseProvider.TYPE,schema:m.providerStateZ$2,initialState:{}});return s.jsxRuntimeExports.jsx(c.Composite,{path:n,children:e})}),Ui=Object.freeze(Object.defineProperty({__proto__:null,Provider:an},Symbol.toStringTag,{value:"Module"})),Wi=e=>{var t,n;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((n=e.data)==null?void 0:n.authority)===k.uy.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)"}}},un=c.wrap$1("Chip",({aetherKey:e,source:t,sink:n,className:r,...o})=>{const i=c.useMemoDeepEqualProps({source:t,sink:n}),[,{status:u},a]=c.use$3({aetherKey:e,type:m.Chip.TYPE,schema:m.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:p,buttonStyle:f,disabled:S}=Wi(u);return s.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(l.CSS.B("control-chip"),r),disabled:S,onClick:d,tooltip:s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:j}),style:f,...o,children:s.jsxRuntimeExports.jsx(c.k0.Circle,{color:p})})}),xn=x.createContext({needsControlOf:[]}),dn=()=>x.useContext(xn),Xi=c.wrap$1(m.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:n,...r})=>{const o=c.useMemoDeepEqualProps(r),[{path:i},{status:u,needsControlOf:a},d]=c.use$3({aetherKey:e,type:m.Controller$1.TYPE,schema:m.controllerStateZ,initialState:o});return x.useEffect(()=>{u!=null&&(n==null||n(u))},[u,n]),x.useEffect(()=>{d(j=>({...j,...o}))},[o,d]),x.useEffect(()=>()=>n==null?void 0:n("released"),[]),s.jsxRuntimeExports.jsxs(xn.Provider,{value:{needsControlOf:a},children:[s.jsxRuntimeExports.jsx(c.Composite,{path:i,children:t}),";"]})}),mn=c.wrap$1(m.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:n})=>{var d;const r=c.useMemoDeepEqualProps({colorSource:t,statusSource:n}),[,{color:o,status:i},u]=c.use$3({aetherKey:e,type:m.Indicator.TYPE,initialState:{...r,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:k.m.now()}},schema:m.indicatorStateZ});x.useEffect(()=>{u(j=>({...j,...r}))},[r,u]);let a;return((d=i.data)==null?void 0:d.color)!=null?a=l.Color.z.parse(i.data.color):o!=null&&!o.isZero?a=o:a="var(--pluto-gray-l8)",s.jsxRuntimeExports.jsxs(c.Dialog$1,{location:{x:"center",y:"bottom"},children:[s.jsxRuntimeExports.jsx(c.Text,{level:"p",children:i.message}),s.jsxRuntimeExports.jsx("div",{className:l.CSS.B("indicator"),style:{backgroundColor:l.cssString(a),flexGrow:1}})]})}),Ji=c.wrap$1(m.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:n}=dn(),[,{states:r},o]=c.use$3({aetherKey:e,type:m.Legend.TYPE,schema:m.legendStateZ,initialState:{states:[],needsControlOf:n}});x.useEffect(()=>{o(a=>({...a,needsControlOf:n}))},[n]);const u=k.n(r.map(a=>a.subject.key)).map(a=>{const d=r.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 s.jsxRuntimeExports.jsx(Lt,{data:u,...t})}),pn=c.wrap$1(m.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:n}]=c.use$3({aetherKey:e,type:m.StateProvider.TYPE,schema:m.stateProviderStateZ,initialState:{}});return s.jsxRuntimeExports.jsx(c.Composite,{path:n,children:t})}),Ki=Object.freeze(Object.defineProperty({__proto__:null,Chip:un,Controller:Xi,Indicator:mn,Legend:Ji,StateProvider:pn,useContext:dn},Symbol.toStringTag,{value:"Module"})),jn=e=>{const t=({disabled:n=!1,...r})=>n?r.children:s.jsxRuntimeExports.jsx(e,{...r});return t.displayName=e.displayName,t},Qi=jn(an),ec=jn(c.Provider$3),tc=({children:e,connParams:t,workerEnabled:n=!0,workerURL:r,theming:o,tooltip:i,triggers:u,alamos:a,haul:d,channelAlias:j,telem:p})=>s.jsxRuntimeExports.jsx(c.Provider$1,{...u,children:s.jsxRuntimeExports.jsx(c.Config,{...i,children:s.jsxRuntimeExports.jsx(c.Provider$2,{...d,children:s.jsxRuntimeExports.jsx(c.Provider$4,{url:r??Gi,enabled:n,children:s.jsxRuntimeExports.jsx(ec,{workerKey:"vis",children:s.jsxRuntimeExports.jsx(Hi,{...a,children:s.jsxRuntimeExports.jsx(c.Aggregator,{children:s.jsxRuntimeExports.jsx(ds,{connParams:t,children:s.jsxRuntimeExports.jsx(js,{...j,children:s.jsxRuntimeExports.jsx(Qi,{...p,children:s.jsxRuntimeExports.jsx(c.Provider,{...o,children:s.jsxRuntimeExports.jsx(pn,{children:e})})})})})})})})})})})}),sc=Object.freeze(Object.defineProperty({__proto__:null,Provider:tc},Symbol.toStringTag,{value:"Module"})),nc=({value:e})=>s.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress"),children:s.jsxRuntimeExports.jsx("div",{className:l.CSS.B("progress-bar"),style:{width:`${e}%`}})}),rc=Object.freeze(Object.defineProperty({__proto__:null,Progress:nc},Symbol.toStringTag,{value:"Module"})),oc=[{key:"color",name:"Color",width:50,render:e=>s.jsxRuntimeExports.jsx(c.k0.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],lc=e=>{const t=ke();return s.jsxRuntimeExports.jsx(ot,{...e,searcher:t==null?void 0:t.labels,columns:oc,renderTag:n=>n.entry==null?s.jsxRuntimeExports.jsx(qe,{color:"gray",children:n.entryKey}):s.jsxRuntimeExports.jsx(qe,{color:n.entry.color,children:n.entry.name})})},ic=({timeRange:e,...t})=>{const n=new k.m(e.start),r=n.isToday?"time":"dateTime",o=new k.m(e.end),i=o.equals(k.m.MAX),u=o.span(n)<k.w.DAY?"time":"dateTime";return s.jsxRuntimeExports.jsxs(O.Space,{direction:"x",size:"small",className:l.CSS(l.CSS.B("time-range-chip")),align:"center",...t,children:[n.isToday&&s.jsxRuntimeExports.jsx(c.Text,{level:"p",shade:7,weight:450,children:"Today"}),s.jsxRuntimeExports.jsx(c.DateTime,{level:"p",displayTZ:"local",format:r,shade:7,weight:450,children:n}),s.jsxRuntimeExports.jsx(c.k0.Arrow.Right,{color:"var(--pluto-text-color)"}),i?s.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"Now"}):s.jsxRuntimeExports.jsx(c.DateTime,{level:"p",displayTZ:"local",format:u,shade:7,weight:450,children:o})]})},cc=Object.freeze(Object.defineProperty({__proto__:null,SelectLabels:lc,TimeRangeChip:ic},Symbol.toStringTag,{value:"Module"})),ac=({steps:e,value:t,onChange:n,...r})=>{const o=e.findIndex(i=>i.key===t);return s.jsxRuntimeExports.jsx(O.Space,{direction:"x",align:"center",className:l.CSS.B("steps"),...r,children:e.map((i,u)=>s.jsxRuntimeExports.jsxs(x.Fragment,{children:[s.jsxRuntimeExports.jsxs(c.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:u>o,children:[u+1,". ",i.title]},i.key),u!==e.length-1&&s.jsxRuntimeExports.jsx(c.k0.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},uc=Object.freeze(Object.defineProperty({__proto__:null,Steps:ac},Symbol.toStringTag,{value:"Module"})),xc=(e,t="x")=>{if(e.length===0)return[];const n=l.J.construct(t),r=l.J.swap(n);return e.sort((o,i)=>l.To.loc(o.box,n)-l.To.loc(i.box,n)),e.forEach((o,i)=>{if(i===0)return;const a=e[i-1].handles.find(h=>h.orientation===r),d=o.handles.find(h=>h.orientation===n);if(a==null||d==null)return;const j=a.absolutePosition,p=d.absolutePosition,f=l.q.set(l.q.translation(p,j),t,0),S=l.q.translate(l.To.topLeft(o.box),f);o.box=l.To.construct(S,l.To.dims(o.box))}),e},Zt=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},ne=(e,t)=>{const n=Zt(t),r=e.getNodes().find(o=>o.id===t);if(r==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return l.To.construct(r.position,l.To.dims(l.To.construct(n)))},dc=(e,t)=>lt.fromFlow(e,t);class fn{constructor(t,n){je(this,"node_",null);je(this,"position");je(this,"orientation");this.position=t,this.orientation=n}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 lt{constructor(t,n,r){je(this,"key");je(this,"box");je(this,"handles");this.key=t,this.box=n,this.handles=r,r.forEach(o=>o.node=this)}static fromFlow(t,n){const r=ne(n,t),o=Zt(t),i=o.getElementsByClassName("react-flow__handle"),u=l.To.construct(o),a=Array.from(i).map(d=>{const j=l.To.center(l.To.construct(d)),p=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 fn(p,S)});return new lt(t,r,a)}}const mc=({fromX:e,fromY:t,toX:n,toY:r,fromPosition:o,toPosition:i,fromNode:u,connectionLineStyle:a,connectionStatus:d})=>{const j=document.querySelector(".react-flow__handle-connecting"),p=j==null?void 0:j.className.match(/react-flow__handle-(\w+)/);if(p!=null){const C=l.J.outer.safeParse(p[1]);C.success&&(i=C.data)}const f=m.buildNew({sourcePos:l.q.construct(e,t),targetPos:l.q.construct(n,r),sourceOrientation:o,targetOrientation:i,sourceBox:ne(m.useReactFlow(),(u==null?void 0:u.id)??""),targetBox:ne(m.useReactFlow(),(u==null?void 0:u.id)??"")}),S=m.useReactFlow(),h=m.segmentsToPoints(l.q.construct(e,t),f,S.getZoom(),!1);return s.jsxRuntimeExports.jsx(m.BaseEdge,{path:hn(h),style:{...a,stroke:l.cssString(d==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},pc=({id:e,source:t,target:n,sourcePosition:r,targetHandleId:o,targetPosition:i,style:u,segments:a=[],onSegmentsChange:d,color:j="var(--pluto-gray-l9)",selected:p=!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=m.useReactFlow(),[b,E,y]=c.useCombinedStateAndRef(()=>a.length>0?a:m.buildNew({sourcePos:S,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:ne(g,t),targetBox:ne(g,n)})),M=x.useRef(i),V=x.useRef(r),_=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=m.moveTargetNode({delta:A,segments:T}),M.current!==i&&(M.current=i,T=m.buildNew({sourcePos:S,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:ne(g,t),targetBox:ne(g,n)})),m.checkIntegrity({sourcePos:S,targetPos:R,next:T,prev:b})||(T=m.buildNew({sourcePos:S,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:ne(g,t),targetBox:ne(g,n)})),v.current=R):(T=m.moveSourceNode({delta:B,segments:T}),V.current!==r&&(V.current=r,T=m.buildNew({sourcePos:S,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:ne(g,t),targetBox:ne(g,n)})),m.checkIntegrity({sourcePos:S,targetPos:R,next:T,prev:b})||(T=m.buildNew({sourcePos:S,targetPos:R,sourceOrientation:r,targetOrientation:i,sourceBox:ne(g,t),targetBox:ne(g,n)})),h.current=S),_(T),E(T))}const N=x.useRef(null),w=et({onStart:x.useCallback((T,B,A)=>{N.current={index:Number(A.currentTarget.id.split("-")[1]),segments:[...y.current]}},[]),onMove:x.useCallback(T=>{if(N.current==null)return;const B=m.dragSegment({segments:N.current.segments,index:N.current.index,magnitude:l.To.dim(T,l.g.swap(N.current.segments[N.current.index].direction),!0)/g.getZoom()});E(B)},[]),onEnd:x.useCallback(()=>d(y.current),[d])}),$=m.segmentsToPoints(S,b,g.getZoom(),!0);return s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(m.BaseEdge,{path:hn($),style:{...u,stroke:l.cssString(j)},...f}),p&&jc($).map((T,B)=>{const A=b[B].direction,q=l.g.swap(A),H={[l.g.dimension(A)]:"18px",[l.g.dimension(q)]:"4px"},ee={[A]:T[A]-9,[q]:T[q]-2};return s.jsxRuntimeExports.jsxs(x.Fragment,{children:[s.jsxRuntimeExports.jsx("rect",{className:l.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...H,...ee,rx:"2px",ry:"2px"}),s.jsxRuntimeExports.jsx("foreignObject",{x:T.x-9,y:T.y-9,width:"18px",height:"18px",children:s.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)})]})},hn=e=>{let t="";const r=e.length+-1;for(let o=0;o<r;o++){const i=e[o%e.length],u=e[(o+1)%e.length],a=Math.min(6/Math.hypot(u.x-i.x,u.y-i.y),.5);o>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-a)+u.x*a},${i.y*(1-a)+u.y*a}`),o===0?t+=`M${i.x},${i.y}`:o===0&&(t+=`M${i.x*(1-a)+u.x*a},${i.y*(1-a)+u.y*a}`),o===r-1?t+=`L${u.x},${u.y}`:o<r-1&&(t+=`L${i.x*a+u.x*(1-a)},${i.y*a+u.y*(1-a)}`)}return t},jc=e=>e.slice(1).map((t,n)=>{const r=e[n];return l.q.construct((t.x+r.x)/2,(t.y+r.y)/2)}),fc=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:r={position:l.q.ZERO,zoom:1}})=>{const[o,i]=x.useState(n),[u,a]=x.useState(e),[d,j]=x.useState(t),[p,f]=x.useState(r),[S,h]=x.useState(!1);return{viewport:p,onViewportChange:f,edges:d,nodes:u,onNodesChange:a,onEdgesChange:j,editable:o,onEditableChange:i,fitViewOnResize:S,setFitViewOnResize:h}},hc=e=>e.source!==e.target,Sc={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},gc={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},Sn={padding:0,maxZoom:1,minZoom:.5},Ec={hideAttribution:!0},gn=x.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),ze=()=>x.useContext(gn),En=x.memo(({children:e})=>{const{registerNodeRenderer:t}=ze();return x.useEffect(()=>t(e),[t,e]),null});En.displayName="NodeRenderer";const Rc=["Backspace","Delete"],Cc=c.wrap$1(m.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:n,onEdgesChange:r,nodes:o,edges:i,onEditableChange:u,editable:a,viewport:d,triggers:j,onViewportChange:p,fitViewOnResize:f,setFitViewOnResize:S,...h})=>{const[{path:C},,R]=c.use$3({aetherKey:e,type:m.Diagram$1.TYPE,schema:m.diagramStateZ,initialState:{position:d.position,region:l.To.ZERO,zoom:d.zoom}}),v=c.use().colors.gray.l9.hex,L=c.useMemoCompare(()=>j??Nt.zoom,c.compareModeConfigs,[j]),{fitView:g}=m.useReactFlow(),b=Tt(x.useCallback(D=>{f&&g({maxZoom:1}),R(U=>({...U,region:D}))},[R,g,f])),E=x.useRef(null),y=x.useCallback(D=>{const U=E.current;U!=null&&U.x===D.x&&U.y===D.y&&U.zoom===D.zoom||(E.current=D,R(se=>({...se,position:D,zoom:D.zoom})),p(m.translateViewportBackward(D)))},[R,p]);m.useOnViewportChange({onStart:y,onChange:y,onEnd:y});const[M,V]=x.useState(()=>()=>null),_=x.useCallback(D=>V(()=>D),[]),N=x.useMemo(()=>({custom:({id:D,xPos:U,yPos:se,selected:Ne})=>M({symbolKey:D,position:{x:U,y:se},selected:Ne})}),[M]),w=x.useRef(i),$=x.useMemo(()=>(w.current=i,m.translateEdgesForward(i)),[i]),T=x.useRef(o),B=x.useMemo(()=>(T.current=o,m.translateNodesForward(o)),[o]),A=x.useCallback(D=>n(m.nodeConverter(T.current,U=>m.applyNodeChanges(D,U))),[n]),q=x.useCallback(D=>r(m.edgeConverter(w.current,U=>m.applyEdgeChanges(D,U),v)),[r,v]),H=x.useCallback((D,U)=>r(m.edgeConverter(w.current,se=>m.updateEdge(D,U,se),v)),[]),ee=x.useCallback(D=>{r(m.edgeConverter(w.current,U=>m.addEdge(D,U),v))},[r,v]),J=x.useCallback((D,U)=>{const se=[...w.current],Ne=se.findIndex(uo=>uo.key===D);Ne!==-1&&(se[Ne]={...se[Ne],segments:U},w.current=se,r(se))},[r]),$e=a?Sc:gc,ct=x.useMemo(()=>({default:D=>s.jsxRuntimeExports.jsx(pc,{...D,segments:D.data.segments,color:D.data.color,onSegmentsChange:x.useCallback(U=>J(D.id,U),[D.id])},D.id)}),[J]),qt=x.useRef(null);c.use$2({triggers:L.zoomReset,callback:x.useCallback(({stage:D,cursor:U})=>{const se=qt.current;se==null||D!=="start"||!l.To.contains(se,U)||g()},[g])});const Yt=c.purgeMouse(L.select)[0]??null,Ht=c.purgeMouse(L.pan)[0]??null,lo=c.purgeMouse(L.zoom)[0]??null,io={selectionOnDrag:Yt==null,panOnDrag:Ht==null,selectionKeyCode:Yt,panActivationKeyCode:Ht,zoomActivationKeyCode:lo},co=c.useCombinedRefs(qt,b),ao=x.useMemo(()=>({editable:a,onEditableChange:u,registerNodeRenderer:_,fitViewOnResize:f,setFitViewOnResize:S}),[a,u,_,f]);return s.jsxRuntimeExports.jsx(gn.Provider,{value:ao,children:s.jsxRuntimeExports.jsx(c.Composite,{path:C,children:s.jsxRuntimeExports.jsx(m.ReactFlow,{...io,className:l.CSS(l.CSS.B("diagram"),l.CSS.editable(a)),nodes:B,edges:$,nodeTypes:N,edgeTypes:ct,ref:co,fitView:!0,onNodesChange:A,onEdgesChange:q,onConnect:ee,onEdgeUpdate:H,defaultViewport:m.translateViewportForward(d),connectionLineComponent:mc,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:hc,connectionMode:m.ConnectionMode.Loose,snapGrid:[3,3],fitViewOptions:Sn,selectionMode:m.SelectionMode.Partial,proOptions:Ec,deleteKeyCode:Rc,...h,style:{[l.CSS.var("diagram-zoom")]:d.zoom,...h.style},...$e,children:t})})})}),yc=()=>{const{editable:e}=ze();return e?s.jsxRuntimeExports.jsx(Xo,{}):null},bc=({children:e,...t})=>s.jsxRuntimeExports.jsx(O.Pack,{direction:"y",className:l.CSS.BE("diagram","controls"),...t,children:e}),vc=({onClick:e,...t})=>{const{editable:n,onEditableChange:r}=ze();return s.jsxRuntimeExports.jsx(c.ToggleIcon,{onChange:()=>r(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:l.J.RIGHT_CENTER,tooltip:n?s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Disable edit mode"}):s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Enable edit mode"}),...t,children:n?s.jsxRuntimeExports.jsx(c.k0.EditOff,{}):s.jsxRuntimeExports.jsx(c.k0.Edit,{})})},wc=({onClick:e,...t})=>{const{fitView:n}=m.useReactFlow(),{fitViewOnResize:r,setFitViewOnResize:o}=ze();return s.jsxRuntimeExports.jsx(c.ToggleIcon,{onClick:i=>{n(Sn),e==null||e(i)},value:r,onChange:i=>o(i),rightClickToggle:!0,tooltip:s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:l.J.RIGHT_CENTER,variant:"outlined",...t,children:s.jsxRuntimeExports.jsx(c.k0.Expand,{})})},Tc=e=>s.jsxRuntimeExports.jsx(m.ReactFlowProvider,{children:s.jsxRuntimeExports.jsx(Cc,{...e})}),kc=Object.freeze(Object.defineProperty({__proto__:null,Background:yc,Controls:bc,Diagram:Tc,FitViewControl:wc,HandleLayout:fn,NodeLayout:lt,NodeRenderer:En,ToggleEditControl:vc,alignNodes:xc,edgeConverter:m.edgeConverter,edgeZ:m.edgeZ,nodeConverter:m.nodeConverter,nodeZ:m.nodeZ,rfEdgeDataZ:m.rfEdgeDataZ,selectNode:Zt,selectNodeBox:ne,selectNodeLayout:dc,translateEdgesBackward:m.translateEdgesBackward,translateEdgesForward:m.translateEdgesForward,translateNodesBackward:m.translateNodesBackward,translateNodesForward:m.translateNodesForward,translateViewportBackward:m.translateViewportBackward,translateViewportForward:m.translateViewportForward,use:fc,useContext:ze,viewportZ:m.viewportZ},Symbol.toStringTag,{value:"Module"})),Pc=({value:e,onChange:t})=>{const{inner:n,outer:r}=e,o=i=>()=>t({...e,...i});return s.jsxRuntimeExports.jsxs(O.Space,{className:l.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[s.jsxRuntimeExports.jsx(he,{selected:r==="top",onClick:o({outer:"top"})}),s.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[s.jsxRuntimeExports.jsx(he,{selected:r==="left",onClick:o({outer:"left"})}),s.jsxRuntimeExports.jsxs(O.Space,{className:l.CSS.B("value"),direction:"y",align:"center",justify:"center",empty:!0,children:[s.jsxRuntimeExports.jsx(he,{className:l.CSS(l.CSS.dir("y")),selected:n==="top",onClick:o({inner:"top"})}),s.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"center",justify:"center",children:[s.jsxRuntimeExports.jsx(he,{selected:n==="left",onClick:o({inner:"left"})}),s.jsxRuntimeExports.jsx(he,{selected:n==="right",onClick:o({inner:"right"})})]}),s.jsxRuntimeExports.jsx(he,{className:l.CSS(l.CSS.dir("y")),selected:n==="bottom",onClick:o({inner:"bottom"})})]}),s.jsxRuntimeExports.jsx(he,{selected:r==="right",onClick:o({outer:"right"})})]}),s.jsxRuntimeExports.jsx(he,{selected:r==="bottom",onClick:o({outer:"bottom"})})]})},he=({selected:e,className:t,...n})=>s.jsxRuntimeExports.jsx(c.Icon,{variant:"text",className:l.CSS(t,l.CSS.selected(e)),...n,children:s.jsxRuntimeExports.jsx("div",{className:"symbol"})}),it=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],oe=({className:e,direction:t,...n})=>s.jsxRuntimeExports.jsx(O.Space,{direction:t,align:"stretch",className:l.CSS(l.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),Re=e=>s.jsxRuntimeExports.jsx(me,{label:"Orientation",padHelpText:!1,...e,children:({value:t,onChange:n})=>{var r;return s.jsxRuntimeExports.jsx(Pc,{value:{inner:t.orientation??"top",outer:((r=t.label)==null?void 0:r.orientation)??"top"},onChange:o=>n({...t,orientation:o.inner,label:{...t.label,orientation:o.outer}})})}}),Ce=({path:e})=>s.jsxRuntimeExports.jsxs(O.Space,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsx(me,{path:e+".label",label:"Label",padHelpText:!1,grow:!0,children:t=>s.jsxRuntimeExports.jsx(c.Text$1,{selectOnFocus:!0,...t})}),s.jsxRuntimeExports.jsx(me,{path:e+".level",label:"Label Size",padHelpText:!1,children:t=>s.jsxRuntimeExports.jsx(ie.SelectLevel,{...t})})]}),Me=e=>s.jsxRuntimeExports.jsx(me,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,...r})=>s.jsxRuntimeExports.jsx(Rt.Swatch,{value:t??l.ZERO.setAlpha(1).rgba255,onChange:o=>n(o.rgba255),...r})}),Rn=({path:e})=>{var j,p;const{value:t,onChange:n}=ye({path:e}),r=m.sourcePipelinePropsZ.parse((j=t.source)==null?void 0:j.props),o=m.sinkPipelinePropsZ.parse((p=t.sink)==null?void 0:p.props),i=m.streamChannelValuePropsZ.parse(r.segments.valueStream.props),u=m.setChannelValuePropsZ.parse(o.segments.setter.props),a=f=>{f=f??0;const S=m.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:m.streamChannelValue({channel:f}),threshold:m.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:S})},d=f=>{f=f??0;const S=m.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:m.setChannelValue({channel:f}),setpoint:m.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),h=m.authoritySource({channel:f}),C=m.acquireChannelControl({channel:f,authority:255});n({...t,sink:S,control:{...t.control,showChip:!0,chip:{sink:C,source:h},showIndicator:!0,indicator:{statusSource:h}}})};return s.jsxRuntimeExports.jsxs(oe,{direction:"x",grow:!0,align:"stretch",children:[s.jsxRuntimeExports.jsx(xe.Item,{label:"State Channel",grow:!0,children:s.jsxRuntimeExports.jsx(ge,{value:i.channel,onChange:a})}),s.jsxRuntimeExports.jsx(xe.Item,{label:"Command Channel",grow:!0,children:s.jsxRuntimeExports.jsx(ge,{value:u.channel,onChange:d})})]})},pe=()=>{const e=x.useCallback(({tabKey:n})=>{switch(n){case"control":return s.jsxRuntimeExports.jsx(Rn,{path:""});default:return s.jsxRuntimeExports.jsxs(oe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[s.jsxRuntimeExports.jsx(Ce,{path:"label"}),s.jsxRuntimeExports.jsx(Me,{path:"color",hideIfNull:!0,optional:!0})]}),s.jsxRuntimeExports.jsx(Re,{path:""})]})}},[]),t=X.useStatic({tabs:it,content:e});return s.jsxRuntimeExports.jsx(X.Tabs,{...t})},Lc=()=>{const e=x.useCallback(({tabKey:n})=>{switch(n){case"control":return s.jsxRuntimeExports.jsx(Rn,{path:""});default:return s.jsxRuntimeExports.jsxs(oe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[s.jsxRuntimeExports.jsx(Ce,{path:"label"}),s.jsxRuntimeExports.jsxs(O.Space,{direction:"x",children:[s.jsxRuntimeExports.jsx(Me,{path:"color"}),s.jsxRuntimeExports.jsx(me,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,children:r=>s.jsxRuntimeExports.jsx(c.Switch$1,{...r})})]})]}),s.jsxRuntimeExports.jsx(Re,{path:""})]})}},[]),t=X.useStatic({tabs:it,content:e});return s.jsxRuntimeExports.jsx(X.Tabs,{...t})},ce=()=>s.jsxRuntimeExports.jsxs(oe,{direction:"x",children:[s.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[s.jsxRuntimeExports.jsx(Ce,{path:"label"}),s.jsxRuntimeExports.jsx(Me,{path:"color"})]}),s.jsxRuntimeExports.jsx(Re,{path:""})]}),ls={y:2,x:.25},is={lower:0,upper:2e3},Mc=()=>s.jsxRuntimeExports.jsxs(oe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[s.jsxRuntimeExports.jsx(Ce,{path:"label"}),s.jsxRuntimeExports.jsxs(O.Space,{direction:"x",children:[s.jsxRuntimeExports.jsx(Me,{path:"color"}),s.jsxRuntimeExports.jsx(me,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>s.jsxRuntimeExports.jsx(c.Numeric,{value:e??200,dragScale:ls,bounds:is,...t})}),s.jsxRuntimeExports.jsx(me,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>s.jsxRuntimeExports.jsx(c.Numeric,{value:e??200,dragScale:ls,bounds:is,...t})})]})]}),s.jsxRuntimeExports.jsx(Re,{path:""})]}),Cn=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],_c=({path:e})=>{var f;const{value:t,onChange:n}=ye({path:e}),r=m.sourcePipelinePropsZ.parse((f=t.telem)==null?void 0:f.props),o=m.streamChannelValuePropsZ.parse(r.segments.valueStream.props),i=m.stringifyNumberProps.parse(r.segments.stringifier.props),u=m.rollingAverageProps.parse(r.segments.rollingAverage.props),a=S=>{const h=m.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:m.streamChannelValue({channel:S??0}),stringifier:m.stringifyNumber({precision:i.precision??2}),rollingAverage:m.rollingAverage({windowSize:u.windowSize??1})},outlet:"stringifier"});n({...t,telem:h})},d=S=>{const h=m.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:m.streamChannelValue({channel:o.channel}),stringifier:m.stringifyNumber({precision:S}),rollingAverage:m.rollingAverage({windowSize:u.windowSize})},outlet:"stringifier"});n({...t,telem:h})},j=S=>{const h=m.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:m.stringifyNumber({precision:i.precision??2}),valueStream:m.streamChannelValue({channel:o.channel}),rollingAverage:m.rollingAverage({windowSize:S})},outlet:"stringifier"});n({...t,telem:h})},p=st(o.channel);return x.useEffect(()=>{n({...t,tooltip:[p]})},[p]),s.jsxRuntimeExports.jsxs(oe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsx(xe.Item,{label:"Input Channel",grow:!0,children:s.jsxRuntimeExports.jsx(ge,{value:o.channel,onChange:a})}),s.jsxRuntimeExports.jsx(xe.Item,{label:"Precision",align:"start",children:s.jsxRuntimeExports.jsx(c.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:d})}),s.jsxRuntimeExports.jsx(xe.Item,{label:"Averaging Window",align:"start",children:s.jsxRuntimeExports.jsx(c.Numeric,{value:u.windowSize??1,bounds:{lower:1,upper:100},onChange:j})})]})},$c=()=>{const e=x.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return s.jsxRuntimeExports.jsx(_c,{path:""});default:return s.jsxRuntimeExports.jsxs(oe,{direction:"x",children:[s.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[s.jsxRuntimeExports.jsx(Ce,{path:"label"}),s.jsxRuntimeExports.jsxs(O.Space,{direction:"x",children:[s.jsxRuntimeExports.jsx(Me,{path:"color"}),s.jsxRuntimeExports.jsx(me,{path:"units",label:"Units",align:"start",padHelpText:!1,children:r=>s.jsxRuntimeExports.jsx(c.Text$1,{...r})})]})]}),s.jsxRuntimeExports.jsx(Re,{path:""})]})}},[]),t=X.useStatic({tabs:Cn,content:e});return s.jsxRuntimeExports.jsx(X.Tabs,{...t})},Nc=({path:e})=>{var a;const{value:t,onChange:n}=ye({path:e}),r=m.sourcePipelinePropsZ.parse((a=t.source)==null?void 0:a.props),o=m.streamChannelValuePropsZ.parse(r.segments.valueStream.props),i=d=>{d=d??0;const j=m.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:m.streamChannelValue({channel:d}),threshold:m.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:j})},u=st(o.channel);return x.useEffect(()=>{n({...t})},[u]),s.jsxRuntimeExports.jsx(oe,{direction:"x",align:"stretch",children:s.jsxRuntimeExports.jsx(xe.Item,{label:"Input Channel",grow:!0,children:s.jsxRuntimeExports.jsx(ge,{value:o.channel,onChange:i})})})},Bc=()=>{const e=x.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return s.jsxRuntimeExports.jsx(Nc,{path:""});default:return s.jsxRuntimeExports.jsxs(oe,{direction:"x",children:[s.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[s.jsxRuntimeExports.jsx(Ce,{path:"label"}),s.jsxRuntimeExports.jsx(O.Space,{direction:"x",children:s.jsxRuntimeExports.jsx(Me,{path:"color"})})]}),s.jsxRuntimeExports.jsx(Re,{path:""})]})}},[]),t=X.useStatic({tabs:Cn,content:e});return s.jsxRuntimeExports.jsx(X.Tabs,{...t})},Oc=({path:e})=>{var u;const{value:t,onChange:n}=ye({path:e}),r=m.sinkPipelinePropsZ.parse((u=t.sink)==null?void 0:u.props),o=m.setChannelValuePropsZ.parse(r.segments.setter.props),i=a=>{const d=m.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:m.setChannelValue({channel:a}),setpoint:m.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),j=m.authoritySource({channel:a}),p=m.acquireChannelControl({channel:a,authority:255});n({...t,sink:d,control:{...t.control,showChip:!0,chip:{sink:p,source:j},showIndicator:!0,indicator:{statusSource:j}}})};return s.jsxRuntimeExports.jsx(oe,{direction:"y",children:s.jsxRuntimeExports.jsx(xe.Item,{label:"Output Channel",children:s.jsxRuntimeExports.jsx(ge,{value:o.channel,onChange:i})})})},zc=()=>{const e=x.useCallback(({tabKey:n})=>{switch(n){case"control":return s.jsxRuntimeExports.jsx(Oc,{path:""});default:return s.jsxRuntimeExports.jsxs(oe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsx(O.Space,{direction:"y",grow:!0,children:s.jsxRuntimeExports.jsx(Ce,{path:"label"})}),s.jsxRuntimeExports.jsx(Re,{path:""})]})}},[]),t=X.useStatic({tabs:it,content:e});return s.jsxRuntimeExports.jsx(X.Tabs,{...t})},Vc=({path:e})=>{var j,p;const{value:t,onChange:n}=ye({path:e}),r=m.sourcePipelinePropsZ.parse((j=t.source)==null?void 0:j.props),o=m.sinkPipelinePropsZ.parse((p=t.sink)==null?void 0:p.props),i=m.streamChannelValuePropsZ.parse(r.segments.valueStream.props),u=m.setChannelValuePropsZ.parse(o.segments.setter.props),a=f=>{f=f??0;const S=m.sourcePipeline("number",{connections:[],segments:{valueStream:m.streamChannelValue({channel:f})},outlet:"valueStream"});n({...t,source:S})},d=f=>{f=f??0;const S=m.sinkPipeline("number",{connections:[],segments:{setter:m.setChannelValue({channel:f})},inlet:"setter"}),h=m.authoritySource({channel:f}),C=m.acquireChannelControl({channel:f,authority:255});n({...t,sink:S,control:{...t.control,showChip:!0,chip:{sink:C,source:h},showIndicator:!0,indicator:{statusSource:h}}})};return s.jsxRuntimeExports.jsxs(oe,{direction:"x",grow:!0,align:"stretch",children:[s.jsxRuntimeExports.jsx(xe.Item,{label:"State Channel",grow:!0,children:s.jsxRuntimeExports.jsx(ge,{value:i.channel,onChange:a})}),s.jsxRuntimeExports.jsx(xe.Item,{label:"Command Channel",grow:!0,children:s.jsxRuntimeExports.jsx(ge,{value:u.channel,onChange:d})})]})},Ac=()=>{const e=x.useCallback(({tabKey:n})=>{switch(n){case"control":return s.jsxRuntimeExports.jsx(Vc,{path:""});default:return s.jsxRuntimeExports.jsxs(oe,{direction:"x",align:"stretch",children:[s.jsxRuntimeExports.jsxs(O.Space,{direction:"y",grow:!0,children:[s.jsxRuntimeExports.jsx(Ce,{path:"label"}),s.jsxRuntimeExports.jsx(me,{path:"units",label:"Units",align:"start",padHelpText:!1,children:r=>s.jsxRuntimeExports.jsx(c.Text$1,{...r})})]}),s.jsxRuntimeExports.jsx(Re,{path:""})]})}},[]),t=X.useStatic({tabs:it,content:e});return s.jsxRuntimeExports.jsx(X.Tabs,{...t})},Dc=({aetherKey:e,sink:t})=>{const n=c.useMemoDeepEqualProps({sink:t}),[,,r]=c.use$3({aetherKey:e,type:m.Button.TYPE,schema:m.buttonStateZ,initialState:{trigger:0,sink:t}});return x.useEffect(()=>{r(i=>({...i,...n}))},[n]),{click:x.useCallback(()=>{r(i=>({...i,trigger:i.trigger+1}))},[r])}},I=x.forwardRef(({label:e="",onChange:t,level:n="p",children:r,orientation:o="top",style:i,className:u,...a},d)=>s.jsxRuntimeExports.jsxs(O.Space,{style:{marginRight:o==="right"?1:0,marginTop:o==="top"?1:0,...i},size:2/3,direction:o,ref:d,className:l.CSS(l.CSS.B("symbol"),u),align:"center",justify:"center",...a,children:[e.length>0&&s.jsxRuntimeExports.jsx(c.Editable,{className:l.CSS.BE("symbol","label"),value:e,onChange:x.useCallback(j=>t({label:{label:j,level:n,orientation:o}}),[t,n]),level:n}),r]}));I.displayName="Labeled";const z=e=>s.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),Ft=e=>s.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),_e=e=>s.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),Q=e=>s.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),Ic={left:{left:m.Position.Left,right:m.Position.Right,top:m.Position.Top,bottom:m.Position.Bottom},right:{left:m.Position.Right,right:m.Position.Left,top:m.Position.Bottom,bottom:m.Position.Top},top:{left:m.Position.Bottom,right:m.Position.Top,top:m.Position.Left,bottom:m.Position.Right},bottom:{left:m.Position.Top,right:m.Position.Bottom,top:m.Position.Right,bottom:m.Position.Left}},Zc=(e,t)=>Ic[t][e],Fc=(e,t,n)=>n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},Z=({children:e,orientation:t})=>{let n;try{n=m.useUpdateNodeInternals()}catch{return s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{})}const r=x.useRef(null),o=x.useRef(!0);return x.useEffect(()=>{if(r.current==null)return;if(o.current){o.current=!1;return}const i=r.current.closest(".react-flow__node"),u=i==null?void 0:i.getAttribute("data-id");u!=null&&(n==null||n(u))},[t]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx("span",{ref:r}),e]})},P=({location:e,orientation:t,left:n,top:r,...o})=>{const i=Fc(r,n,t);return s.jsxRuntimeExports.jsx(m.Handle$1,{position:Zc(e,t),...o,type:"source",onClick:u=>u.stopPropagation(),className:(l.CSS.B("handle"),l.CSS.BE("handle",o.id)),style:{left:`${i.left}%`,top:`${i.top}%`}})},ae=({className:e,enabled:t=!1,triggered:n=!1,orientation:r="left",color:o,...i})=>s.jsxRuntimeExports.jsx("button",{className:l.CSS(l.CSS.B("symbol-primitive"),l.CSS.B("symbol-primitive-toggle"),r!=null&&l.CSS.loc(r),t&&l.CSS.M("enabled"),n&&l.CSS.M("triggered"),e),color:l.cssString(o),...i}),K=({className:e,...t})=>s.jsxRuntimeExports.jsx("div",{className:l.CSS(l.CSS.B("symbol-primitive"),e),...t}),qc=.8,G=({dimensions:e,orientation:t="left",children:n,className:r,color:o,style:i={},scale:u=1,...a})=>{e=l.g.construct(t)==="y"?l._$1.swap(e):e;const j=l.cssString(o),p=c.use();return o!=null&&(i[l.CSS.var("symbol-color")]=new l.Color(o).rgbString,i[l.CSS.var("symbol-color-contrast")]=new l.Color(o).pickByContrast(p.colors.gray.l0,p.colors.gray.l10).rgbString),s.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:l._$1.svgViewBox(e),className:l.CSS(l.CSS.loc(t),r),fill:j,stroke:j,...a,style:{aspectRatio:`${e.width} / ${e.height}`,width:l._$1.scale(e,u*qc).width,...i},children:s.jsxRuntimeExports.jsx("g",{children:n})})},yn=({className:e,orientation:t,scale:n,color:r,...o})=>s.jsxRuntimeExports.jsxs(ae,{...o,orientation:t,className:l.CSS(l.CSS.B("four-way-valve"),e),children:[s.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:"left",left:0,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:"left",left:100,top:50,id:"2"}),s.jsxRuntimeExports.jsx(P,{location:"top",orientation:"left",left:50,top:0,id:"3"}),s.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:"left",left:50,top:100,id:"4"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:87},color:r,scale:n,children:[s.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"}),s.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"})]})]}),bn=({color:e,orientation:t="left",scale:n,...r})=>s.jsxRuntimeExports.jsxs(ae,{...r,className:l.CSS(l.CSS.B("three-way-valve")),orientation:t,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[s.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:t,left:50,top:100,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:0,top:33,id:"2"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:100,top:33,id:"3"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[s.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"}),s.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"})]})]}),vn=({orientation:e="left",color:t,scale:n,...r})=>s.jsxRuntimeExports.jsxs(ae,{...r,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:e,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:e,left:0,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:e,left:100,top:50,id:"2"})]}),s.jsxRuntimeExports.jsx(G,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:s.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"})})]}),wn=({className:e,color:t,orientation:n="left",normallyOpen:r=!1,scale:o,...i})=>s.jsxRuntimeExports.jsxs(ae,{className:l.CSS(l.CSS.B("solenoid-valve"),r&&l.CSS.M("normally-open"),e),...i,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:n,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:n,left:1,top:69,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:n,left:99,top:69,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:69},color:t,orientation:n,scale:o,children:[s.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"}),s.jsxRuntimeExports.jsx(z,{d:"M43.5 47L43.5 24.6177"}),s.jsxRuntimeExports.jsx(Ft,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),Tn=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(K,{orientation:t,className:l.CSS(l.CSS.B("relief-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:1,top:66,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:58},color:n,orientation:t,scale:r,children:[s.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"}),s.jsxRuntimeExports.jsx(z,{d:"M43.5 2L43.5 38",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(z,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(z,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(z,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),kn=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(K,{orientation:t,className:l.CSS(l.CSS.B("check-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:1,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:45,height:43},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(z,{d:"M43 2L43 40",strokeLinecap:"round"}),s.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"})]})]}),Pn=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ae,{...o,orientation:n,className:l.CSS(l.CSS.B("angled-valve"),t),children:[s.jsxRuntimeExports.jsxs(Z,{orientation:n,children:[s.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:n,left:33,top:100,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:n,left:100,top:35,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.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"}),s.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"}),s.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"})]})]}),Ln=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ae,{...o,className:l.CSS(l.CSS.B("pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:n,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:n,left:2,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:n,left:98,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(_e,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)})]})]}),Mn=({className:e,color:t,orientation:n="left",scale:r,...o})=>{const i=l.cssString(t);return s.jsxRuntimeExports.jsxs(K,{...o,className:l.CSS(l.CSS.B("symbol"),e),children:[s.jsxRuntimeExports.jsx(Z,{orientation:n,children:s.jsxRuntimeExports.jsx(P,{location:"left",orientation:n,left:2,top:50,id:"1"})}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:40,height:48},color:t,orientation:n,scale:r,children:[s.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"}),s.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}),s.jsxRuntimeExports.jsx(z,{d:"M33 24H3",strokeLinecap:"round"})]})]})},_n=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(K,{className:l.CSS(l.CSS.B("cap"),e),...o,children:[s.jsxRuntimeExports.jsx(Z,{orientation:t,children:s.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:0,top:50,id:"1"})}),s.jsxRuntimeExports.jsx(G,{color:n,dimensions:{width:26,height:48},orientation:t,scale:r,children:s.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=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(K,{className:l.CSS(l.CSS.B("manual-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:1,top:58,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:99,top:58,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:48},color:n,orientation:t,scale:r,children:[s.jsxRuntimeExports.jsx(Q,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),s.jsxRuntimeExports.jsx(z,{d:"M19.64 2L66.68 2",strokeLinecap:"round"}),s.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"})]})]}),Nn=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(K,{className:l.CSS(l.CSS.B("filter"),e),...o,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:2,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:98,top:50,id:"2"})]}),s.jsxRuntimeExports.jsx(G,{dimensions:{width:52,height:34},orientation:t,color:n,scale:r,children:s.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"})})]}),Yc=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,Hc=e=>{const{topLeft:t,topRight:n,bottomLeft:r,bottomRight:o}=e;return`${t.x}% ${n.x}% ${o.x}% ${r.x}% / ${t.y}% ${n.y}% ${o.y}% ${r.y}%`},Gc={width:40,height:80},Uc={x:50,y:10},Bn=({className:e,dimensions:t=Gc,borderRadius:n=Uc,color:r,...o})=>{const i=Yc(n),u=c.use();return s.jsxRuntimeExports.jsx(K,{className:l.CSS(e,l.CSS.B("tank")),style:{...t,borderRadius:Hc(i),borderColor:l.cssString(r??u.colors.gray.l9)},...o,children:s.jsxRuntimeExports.jsxs(Z,{children:[s.jsxRuntimeExports.jsx(P,{location:"top",orientation:"left",left:50,top:0,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"top",orientation:"left",left:-.5,top:i.topLeft.y-1,id:"2"}),s.jsxRuntimeExports.jsx(P,{location:"top",orientation:"left",left:101,top:i.topRight.y-1,id:"3"}),s.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),s.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:"left",left:-.5,top:100-i.bottomLeft.y+1,id:"5"}),s.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:"left",left:101,top:100-i.bottomRight.y+1,id:"6"}),s.jsxRuntimeExports.jsx(P,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},On=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(K,{className:l.CSS(e,l.CSS.B("regulator")),...o,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:0,top:66,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:100,top:66,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:88,height:80},orientation:t,color:n,scale:r,children:[s.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"}),s.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"}),s.jsxRuntimeExports.jsx(Q,{x1:"44",y1:"53",x2:"44",y2:"30",strokeLinecap:"round"}),s.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"})]})]}),zn=({className:e,orientation:t="left",scale:n,color:r,...o})=>s.jsxRuntimeExports.jsxs(K,{className:l.CSS(l.CSS.B("orifice"),e),...o,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:0,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:100,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:70,height:34},orientation:t,color:r,scale:n,children:[s.jsxRuntimeExports.jsx(z,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(z,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Vn=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(K,{className:l.CSS(l.CSS.B("needle-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:1,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:42},orientation:t,color:n,scale:r,children:[s.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(n)}),s.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"})]})]}),An=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(K,{orientation:t,className:l.CSS(l.CSS.B("angled-relief-valve"),e),...o,children:[s.jsxRuntimeExports.jsxs(Z,{children:[s.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:t,left:33,top:100,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:100,top:45,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:79},orientation:t,color:n,scale:r,children:[s.jsxRuntimeExports.jsx(z,{d:"M20.75 2L20.75 38",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(z,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(z,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(z,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),s.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"}),s.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"}),s.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"})]})]}),Dn=({className:e,color:t,dimensions:n,orientation:r,units:o="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 s.jsxRuntimeExports.jsxs(K,{className:l.CSS(l.CSS.B("value"),e),...u,style:{borderColor:a,height:n==null?void 0:n.height,width:"100%"},children:[s.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:80},children:i}),s.jsxRuntimeExports.jsxs(Z,{orientation:r,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:"left",left:-2,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:"left",left:102,top:50,id:"2"}),s.jsxRuntimeExports.jsx(P,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),s.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),s.jsxRuntimeExports.jsx("div",{className:l.CSS.BE("value","units"),style:{background:a},children:s.jsxRuntimeExports.jsx(c.Text,{level:"small",color:j,children:o})})]})},In=({enabled:e=!1,onClick:t,orientation:n="left"})=>s.jsxRuntimeExports.jsxs(K,{orientation:n,children:[s.jsxRuntimeExports.jsx(c.Switch$1,{value:e,onClick:t,onChange:()=>{}}),s.jsxRuntimeExports.jsxs(Z,{orientation:n,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:n,left:0,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),Zn=({onClick:e,orientation:t="left",label:n=""})=>s.jsxRuntimeExports.jsxs(K,{orientation:t,children:[s.jsxRuntimeExports.jsx(c.Button,{onClick:e,children:n}),s.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:0,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:100,top:50,id:"2"}),s.jsxRuntimeExports.jsx(P,{location:"top",orientation:t,left:50,top:0,id:"3"}),s.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),Fn=({orientation:e="left",className:t,onClick:n,children:r,value:o,units:i,onChange:u,...a})=>{const[d,j]=x.useState(o);return s.jsxRuntimeExports.jsxs(K,{className:l.CSS(l.CSS.B("setpoint"),t),orientation:e,...a,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:e,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:e,left:-2,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:e,left:102,top:50,id:"2"}),s.jsxRuntimeExports.jsx(P,{location:"top",orientation:e,left:50,top:-2,id:"3"}),s.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),s.jsxRuntimeExports.jsxs(c.Numeric,{size:"small",value:d,onChange:j,showDragHandle:!1,selectOnFocus:!0,children:[i!=""&&s.jsxRuntimeExports.jsx(c.Text,{className:l.CSS.B("units"),noWrap:!0,level:"small",children:i}),s.jsxRuntimeExports.jsx(c.Button,{variant:"outlined",size:"small",onClick:()=>u(d),children:"Set"})]})]})},qn=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ae,{...o,className:l.CSS(l.CSS.B("screw-pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:n,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:n,left:2,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:n,left:98,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(_e,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.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)}),s.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)})]})]}),Yn=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ae,{...o,className:l.CSS(l.CSS.B("vacuum-pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:n,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:n,left:1,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:n,left:98,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(_e,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(Q,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(Q,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:l.CSS(l.CSS.M("detail"),t)})]})]}),Hn=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ae,{...o,className:l.CSS(l.CSS.B("cavity-pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:n,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:n,left:1,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:n,left:98,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(_e,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.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)})]})]}),Gn=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ae,{...o,className:l.CSS(l.CSS.B("piston-pump"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:n,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:n,left:1,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:n,left:98,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(_e,{cx:"32",cy:"32",r:"30"}),s.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"2",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"62",x2:"62",y2:"32",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(z,{d:"M 23 32, h 16, m 0 -8, v 16",className:l.CSS(l.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Un=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(K,{...o,className:l.CSS(l.CSS.B("static-mixer"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:n,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:n,left:1,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:n,left:99,top:50,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:66,height:31},color:e,orientation:n,scale:r,children:[s.jsxRuntimeExports.jsx(Ft,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),s.jsxRuntimeExports.jsx(z,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),s.jsxRuntimeExports.jsx(z,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),Wn=({color:e,className:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ae,{...o,className:l.CSS(l.CSS.B("rotary-mixer"),t),orientation:n,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:n,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:n,left:1,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:n,left:99,top:48,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:50,height:33},color:e,orientation:n,scale:r,children:[s.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"}),s.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)}),s.jsxRuntimeExports.jsx(Q,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:l.CSS(l.CSS.M("detail"),t)})]})]}),Xn=({className:e,color:t,orientation:n="left",scale:r,...o})=>s.jsxRuntimeExports.jsxs(ae,{...o,className:l.CSS(l.CSS.B("light"),e),children:[s.jsxRuntimeExports.jsxs(Z,{orientation:n,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:n,left:0,top:50,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:n,left:100,top:50,id:"2"}),s.jsxRuntimeExports.jsx(P,{location:"top",orientation:n,left:50,top:0,id:"3"}),s.jsxRuntimeExports.jsx(P,{location:"bottom",orientation:n,left:50,top:100,id:"4"})]}),s.jsxRuntimeExports.jsx(G,{dimensions:{width:64,height:64},color:t,orientation:n,scale:r,children:s.jsxRuntimeExports.jsx(_e,{cx:"32",cy:"32",r:"30"})})]}),Jn=({className:e,orientation:t="left",color:n,scale:r,...o})=>s.jsxRuntimeExports.jsxs(K,{className:l.CSS(e,l.CSS.B("regulator")),...o,children:[s.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[s.jsxRuntimeExports.jsx(P,{location:"left",orientation:t,left:5,top:66,id:"1"}),s.jsxRuntimeExports.jsx(P,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),s.jsxRuntimeExports.jsxs(G,{dimensions:{width:88,height:80},orientation:t,color:n,scale:r,children:[s.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"}),s.jsxRuntimeExports.jsx(Ft,{x:"19",y:"10",width:"50",height:"20",rx:"3",ry:"3"}),s.jsxRuntimeExports.jsx(Q,{x1:"44",y1:"53",x2:"44",y2:"30",strokeLinecap:"round"}),s.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"})]})]}),Wc=({aetherKey:e,source:t,sink:n})=>{const r=c.useMemoDeepEqualProps({source:t,sink:n}),[,{value:o},i]=c.use$3({aetherKey:e,type:m.Setpoint.TYPE,schema:m.setpointStateZ,initialState:{trigger:0,value:0,...r}});return x.useEffect(()=>{i(a=>({...a,...r}))},[r,i]),{set:x.useCallback(a=>i(d=>({...d,trigger:d.trigger+1,command:a})),[i]),value:o}},le=({aetherKey:e,source:t,sink:n})=>{const r=c.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:o,enabled:i},u]=c.use$3({aetherKey:e,type:m.Toggle.TYPE,schema:m.toggleStateZ,initialState:{triggered:!1,enabled:!1,...r}});return x.useEffect(()=>{u(d=>({...d,...r}))},[r,u]),{toggle:x.useCallback(()=>u(d=>({...d,triggered:!d.triggered})),[u]),triggered:o,enabled:i}},Xc=m.Value.z.omit({font:!0}).partial({color:!0}).extend({level:k.levelZ.optional()}),Kn=({aetherKey:e,box:t,telem:n,color:r,precision:o,minWidth:i,level:u="small"})=>{const a=c.useMemoDeepEqualProps({box:t,telem:n,color:r,precision:o,level:u,minWidth:i}),[,d,j]=c.use$3({aetherKey:e,type:m.Value.TYPE,schema:m.Value.z,initialState:a});return x.useLayoutEffect(()=>j(p=>({...p,...a})),[a]),{width:d.width??d.minWidth}},Jc=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:Xc,use:Kn},Symbol.toStringTag,{value:"Module"})),Qn=e=>l.g.construct(e)==="x"?l.J.swap(e):e,Kc=e=>l.g.construct(e)==="y"?l.J.swap(e):e,te=({showChip:e=!0,showIndicator:t=!0,indicator:n,orientation:r="left",chip:o,children:i,...u})=>s.jsxRuntimeExports.jsxs(O.Space,{direction:l.J.rotate90(r),align:"center",justify:"center",empty:!0,...u,children:[s.jsxRuntimeExports.jsxs(O.Space,{direction:l.g.construct(r),align:"center",className:l.CSS(l.CSS.B("control-state")),size:"small",children:[e&&s.jsxRuntimeExports.jsx(un,{size:"small",...o}),t&&s.jsxRuntimeExports.jsx(mn,{...n})]}),i]}),er=c.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:n,control:r,source:o,sink:i,orientation:u="left",color:a})=>{const{enabled:d,triggered:j,toggle:p}=le({aetherKey:e,source:o,sink:i});return s.jsxRuntimeExports.jsx(I,{...t,onChange:n,children:s.jsxRuntimeExports.jsx(te,{...r,orientation:Qn(u),children:s.jsxRuntimeExports.jsx(bn,{enabled:d,triggered:j,onClick:p,orientation:u,color:a})})})}),tr=e=>s.jsxRuntimeExports.jsx(bn,{...e}),sr=c.wrap$1("Valve",({control:e,aetherKey:t,label:n,onChange:r,source:o,sink:i,orientation:u,color:a})=>{const{enabled:d,triggered:j,toggle:p}=le({aetherKey:t,source:o,sink:i});return s.jsxRuntimeExports.jsx(I,{...n,onChange:r,children:s.jsxRuntimeExports.jsx(te,{...e,orientation:u,children:s.jsxRuntimeExports.jsx(vn,{enabled:d,triggered:j,onClick:p,orientation:u,color:a})})})}),nr=e=>s.jsxRuntimeExports.jsx(vn,{...e}),rr=c.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:n,orientation:r="left",normallyOpen:o,color:i,source:u,sink:a,control:d})=>{const{enabled:j,triggered:p,toggle:f}=le({aetherKey:e,source:u,sink:a});return s.jsxRuntimeExports.jsx(I,{...t,onChange:n,children:s.jsxRuntimeExports.jsx(te,{...d,orientation:Kc(r),children:s.jsxRuntimeExports.jsx(wn,{enabled:j,triggered:p,onClick:f,orientation:r,color:i,normallyOpen:o})})})}),or=e=>s.jsxRuntimeExports.jsx(wn,{...e}),lr=c.wrap$1("FourWayValve",({aetherKey:e,control:t,label:n,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:p}=le({aetherKey:e,source:u,sink:a});return s.jsxRuntimeExports.jsx(I,{...n,onChange:r,children:s.jsxRuntimeExports.jsx(te,{...t,orientation:o,children:s.jsxRuntimeExports.jsx(yn,{enabled:d,triggered:j,onClick:p,orientation:o,color:i})})})}),ir=e=>s.jsxRuntimeExports.jsx(yn,{...e}),cr=c.wrap$1("AngleValve",({aetherKey:e,label:t,control:n,onChange:r,orientation:o="left",color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:p}=le({aetherKey:e,source:u,sink:a});return s.jsxRuntimeExports.jsx(I,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(te,{...n,orientation:Qn(o),children:s.jsxRuntimeExports.jsx(Pn,{enabled:d,triggered:j,onClick:p,orientation:o,color:i})})})}),ar=e=>s.jsxRuntimeExports.jsx(Pn,{...e}),ur=c.wrap$1("Pump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:p}=le({aetherKey:e,source:u,sink:a});return s.jsxRuntimeExports.jsx(I,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(te,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(Ln,{enabled:d,triggered:j,onClick:p,orientation:o,color:i})})})}),xr=e=>s.jsxRuntimeExports.jsx(Ln,{...e}),dr=c.wrap$1("Tank",({label:e,onChange:t,orientation:n,color:r,dimensions:o,borderRadius:i})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Bn,{onResize:u=>t({dimensions:u}),orientation:n,color:r,dimensions:o,borderRadius:i})})),mr=e=>s.jsxRuntimeExports.jsx(Bn,{...e,dimensions:{width:25,height:50}}),pr=({label:e,onChange:t,orientation:n,color:r})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Tn,{orientation:n,color:r})}),jr=e=>s.jsxRuntimeExports.jsx(Tn,{...e}),fr=({label:e,onChange:t,orientation:n,color:r})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(On,{orientation:n,color:r})}),hr=e=>s.jsxRuntimeExports.jsx(On,{...e}),Sr=({label:e,onChange:t,orientation:n,color:r})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Jn,{orientation:n,color:r})}),gr=e=>s.jsxRuntimeExports.jsx(Jn,{...e}),Er=({label:e,onChange:t,orientation:n,color:r})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Mn,{orientation:n,color:r})}),Rr=e=>s.jsxRuntimeExports.jsx(Mn,{...e}),Cr=({label:e,onChange:t,orientation:n,color:r})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(_n,{orientation:n,color:r})}),yr=e=>s.jsxRuntimeExports.jsx(_n,{...e}),br=({label:e,onChange:t,orientation:n,color:r})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx($n,{orientation:n,color:r})}),vr=e=>s.jsxRuntimeExports.jsx($n,{...e}),wr=c.wrap$1("Setpoint",({label:e,aetherKey:t,orientation:n,control:r,units:o,source:i,sink:u,onChange:a})=>{const{value:d,set:j}=Wc({aetherKey:t,source:i,sink:u});return s.jsxRuntimeExports.jsx(I,{...e,onChange:a,children:s.jsxRuntimeExports.jsx(te,{...r,className:l.CSS.B("symbol"),orientation:n,children:s.jsxRuntimeExports.jsx(Fn,{value:d,onChange:j,units:o,orientation:n})})})}),Tr=e=>s.jsxRuntimeExports.jsx(Fn,{value:12,onChange:()=>{},units:"mV",...e,children:s.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"10.0"})}),kr=({label:e,onChange:t,orientation:n,color:r})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Nn,{orientation:n,color:r})}),Pr=e=>s.jsxRuntimeExports.jsx(Nn,{...e}),Lr=({label:e,onChange:t,orientation:n,color:r})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Vn,{orientation:n,color:r})}),Mr=e=>s.jsxRuntimeExports.jsx(Vn,{...e}),_r=({label:e,onChange:t,orientation:n,color:r})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(kn,{orientation:n,color:r})}),$r=e=>s.jsxRuntimeExports.jsx(kn,{...e}),Nr=({label:e,onChange:t,orientation:n,color:r})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(zn,{orientation:n,color:r})}),Br=e=>s.jsxRuntimeExports.jsx(zn,{...e}),Or=({label:e,onChange:t,orientation:n,color:r})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(An,{orientation:n,color:r})}),zr=e=>s.jsxRuntimeExports.jsx(An,{...e}),Vr=c.wrap$1("Value",({aetherKey:e,label:t,level:n="p",position:r,className:o,textColor:i,color:u,telem:a,units:d,onChange:j,tooltip:p})=>{const f=c.useTypography(n),[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}=m.useInitialViewport(),L=ea({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:r,zoom:v,...S}),{width:g}=Kn({aetherKey:e,color:i,level:n,box:L,telem:a,minWidth:60});return s.jsxRuntimeExports.jsxs(c.Dialog$1,{location:{y:"top"},hide:p==null||p.length===0,children:[s.jsxRuntimeExports.jsx(O.Space,{direction:"y",children:p==null?void 0:p.map((b,E)=>s.jsxRuntimeExports.jsx(c.Text,{level:"small",children:b},E))}),s.jsxRuntimeExports.jsx(I,{className:l.CSS(o,l.CSS.B("value-labeled")),ref:R,onChange:j,...t,children:s.jsxRuntimeExports.jsx(Dn,{color:u,dimensions:{height:C,width:g},units:d})})]})}),Qc=.9,ea=({labelOrientation:e,outerBox:t,labelBox:n,valueBoxHeight:r,position:o,hasLabel:i,zoom:u})=>{const a=l.q.scale(l.To.dims(n),1/(Qc*u));return l.g.construct(e)==="x"&&(o=l.q.translate(o,"y",Math.max((a.y-r)/2-1,0))),i&&e==="left"?o=l.q.translate(o,"x",a.x+4):i&&e==="top"&&(o=l.q.translate(o,"y",a.y+4)),l.To.construct(o.x,o.y,l.To.width(t),r)},Ar=({color:e})=>s.jsxRuntimeExports.jsx(Dn,{color:e,dimensions:{width:60,height:25},units:"psi",children:s.jsxRuntimeExports.jsx(c.Text,{level:"p",children:"50.00"})}),Dr=c.wrap$1("Switch",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:p}=le({aetherKey:e,source:u,sink:a});return s.jsxRuntimeExports.jsx(I,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(te,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(In,{enabled:d,triggered:j,onClick:p,orientation:o,color:i})})})}),Ir=e=>s.jsxRuntimeExports.jsx(In,{...e}),Zr=c.wrap$1("Button",({aetherKey:e,label:t,orientation:n,sink:r,control:o})=>{const{click:i}=Dc({aetherKey:e,sink:r});return s.jsxRuntimeExports.jsx(te,{...o,className:l.CSS.B("symbol"),orientation:n,children:s.jsxRuntimeExports.jsx(Zn,{label:t==null?void 0:t.label,onClick:i})})}),Fr=({label:e,...t})=>s.jsxRuntimeExports.jsx(Zn,{label:"Button",...t}),qr=c.wrap$1("screwPump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:p}=le({aetherKey:e,source:u,sink:a});return s.jsxRuntimeExports.jsx(I,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(te,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(qn,{enabled:d,triggered:j,onClick:p,orientation:o,color:i})})})}),Yr=e=>s.jsxRuntimeExports.jsx(qn,{...e}),Hr=c.wrap$1("vacuumPump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:p}=le({aetherKey:e,source:u,sink:a});return s.jsxRuntimeExports.jsx(I,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(te,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(Yn,{enabled:d,triggered:j,onClick:p,orientation:o,color:i})})})}),Gr=e=>s.jsxRuntimeExports.jsx(Yn,{...e}),Ur=c.wrap$1("progressiveCavityPump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:p}=le({aetherKey:e,source:u,sink:a});return s.jsxRuntimeExports.jsx(I,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(te,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(Hn,{enabled:d,triggered:j,onClick:p,orientation:o,color:i})})})}),Wr=e=>s.jsxRuntimeExports.jsx(Hn,{...e}),Xr=c.wrap$1("pistonPump",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:p}=le({aetherKey:e,source:u,sink:a});return s.jsxRuntimeExports.jsx(I,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(te,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(Gn,{enabled:d,triggered:j,onClick:p,orientation:o,color:i})})})}),Jr=e=>s.jsxRuntimeExports.jsx(Gn,{...e}),Kr=c.wrap$1("statixMixer",({label:e,onChange:t,orientation:n,color:r})=>s.jsxRuntimeExports.jsx(I,{...e,onChange:t,children:s.jsxRuntimeExports.jsx(Un,{orientation:n,color:r})})),Qr=e=>s.jsxRuntimeExports.jsx(Un,{...e}),eo=c.wrap$1("rotaryMixer",({aetherKey:e,label:t,control:n,onChange:r,orientation:o,color:i,source:u,sink:a})=>{const{enabled:d,triggered:j,toggle:p}=le({aetherKey:e,source:u,sink:a});return s.jsxRuntimeExports.jsx(I,{...t,onChange:r,children:s.jsxRuntimeExports.jsx(te,{...n,orientation:o,children:s.jsxRuntimeExports.jsx(Wn,{enabled:d,triggered:j,onClick:p,orientation:o,color:i})})})}),to=e=>s.jsxRuntimeExports.jsx(Wn,{...e}),so=c.wrap$1("light",({aetherKey:e,label:t,className:n,orientation:r="left",color:o,source:i,onChange:u})=>{const{enabled:a}=le({aetherKey:e,source:i});return s.jsxRuntimeExports.jsx(I,{...t,onChange:u,children:s.jsxRuntimeExports.jsx(Xn,{color:o,enabled:a,className:n,orientation:r})})}),no=e=>s.jsxRuntimeExports.jsx(Xn,{...e}),Y=4,ta=2,sa=["angledReliefValve","angledValve","burstDisc","button","cap","cavityPump","checkValve","electricRegulator","filter","fourWayValve","setpoint","light","manualValve","needleValve","orifice","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","solenoidValve","staticMixer","switch","tank","threeWayValve","vacuumPump","value","valve"],na=re.z.enum(sa),W={orientation:"left"},ra={...W,source:m.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:m.streamChannelValue({channel:0}),rollingAverage:m.rollingAverage({windowSize:1}),stringifier:m.stringifyNumber({precision:2})},outlet:"stringifier"})},oa={...W,source:m.sourcePipeline("number",{connections:[],segments:{valueStream:m.streamChannelValue({channel:0})},outlet:"valueStream"})},la={...W,sink:m.sinkPipeline("number",{connections:[],segments:{setter:m.setChannelValue({channel:0})},inlet:"setter"})},ro={...W,source:m.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:m.streamChannelValue({channel:0}),threshold:m.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},oo={...W,sink:m.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:m.setChannelValue({channel:0}),setpoint:m.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},ue={...ro,...oo},F=e=>({label:{label:e,level:"p",orientation:"top"}}),ia={name:"Three Way Valve",key:"threeWayValve",Form:pe,Symbol:er,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Three Way Valve"),...ue}),Preview:tr,zIndex:Y},ca={name:"Valve",key:"valve",Form:pe,Symbol:sr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Valve"),...ue}),Preview:nr,zIndex:Y},aa={name:"Solenoid Valve",key:"solenoidValve",Form:Lc,Symbol:rr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Solenoid Valve"),normallyOpen:!1,...ue}),Preview:or,zIndex:Y},ua={name:"Four Way Valve",key:"fourWayValve",Form:pe,Symbol:lr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Four Way Valve"),...ue}),Preview:ir,zIndex:Y},xa={name:"Angled Valve",key:"angledValve",Form:pe,Symbol:cr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Angled Valve"),...ue}),Preview:ar,zIndex:Y},da={name:"Pump",key:"pump",Form:pe,Symbol:ur,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Pump"),...ue}),Preview:xr,zIndex:Y},ma={name:"Screw Pump",key:"screwPump",Form:pe,Symbol:qr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Screw Pump"),...ue}),Preview:Yr,zIndex:Y},pa={name:"Tank",key:"tank",Form:Mc,Symbol:dr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Tank"),dimensions:{width:100,height:200},...W}),Preview:mr,zIndex:ta},ja={name:"Relief Valve",key:"reliefValve",Form:ce,Symbol:pr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Relief Valve"),...W}),Preview:jr,zIndex:Y},fa={name:"Regulator",key:"regulator",Form:ce,Symbol:fr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Regulator"),...W}),Preview:hr,zIndex:Y},ha={name:"Electric Regulator",key:"electricRegulator",Form:ce,Symbol:Sr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Electric Regulator"),...W}),Preview:gr,zIndex:Y},Sa={name:"Burst Disc",key:"burstDisc",Form:ce,Symbol:Er,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Burst Disc"),...W}),Preview:Rr,zIndex:Y},ga={name:"Cap",key:"cap",Form:ce,Symbol:Cr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Cap"),...W}),Preview:yr,zIndex:Y},Ea={name:"Manual Valve",key:"manualValve",Form:ce,Symbol:br,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Manual Valve"),...W}),Preview:vr,zIndex:Y},Ra={name:"Filter",key:"filter",Form:ce,Symbol:kr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Filter"),...W}),Preview:Pr,zIndex:Y},Ca={name:"Needle Valve",key:"needleValve",Form:ce,Symbol:Lr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Needle Valve"),...W}),Preview:Mr,zIndex:Y},ya={name:"Check Valve",key:"checkValve",Form:ce,Symbol:_r,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Check Valve"),...W}),Preview:$r,zIndex:Y},ba={name:"Orifice",key:"orifice",Form:ce,Symbol:Nr,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Orifice"),...W}),Preview:Br,zIndex:Y},va={name:"Angled Relief Valve",key:"angledReliefValve",Form:ce,Symbol:Or,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Angled Relief Valve"),...W}),Preview:zr,zIndex:Y},wa={name:"Value",key:"value",Form:$c,Symbol:Vr,Preview:Ar,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",...F("Value"),...W,telem:ra.source}),zIndex:Y},Ta={name:"Button",key:"button",Symbol:Zr,Form:zc,Preview:Fr,defaultProps:()=>({...F("Button"),...oo}),zIndex:Y},ka={name:"Switch",key:"switch",Symbol:Dr,Preview:Ir,Form:pe,defaultProps:()=>({...F("Switch"),...ue}),zIndex:Y},Pa={name:"Vacuum Pump",key:"vacuumPump",Symbol:Hr,Form:pe,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Vacuum Pump"),...ue}),Preview:Gr,zIndex:Y},La={name:"Cavity Pump",key:"cavityPump",Symbol:Ur,Form:pe,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Cavity Pump"),...ue}),Preview:Wr,zIndex:Y},Ma={name:"Piston Pump",key:"pistonPump",Symbol:Xr,Form:pe,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Piston Pump"),...ue}),Preview:Jr,zIndex:Y},_a={name:"Static Mixer",key:"staticMixer",Symbol:Kr,Form:ce,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Static Mixer"),...W}),Preview:Qr,zIndex:Y},$a={name:"Rotary Mixer",key:"rotaryMixer",Symbol:eo,Form:pe,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Rotary Mixer"),...ue}),Preview:to,zIndex:Y},Na={name:"Light",key:"light",Symbol:so,Form:Bc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...F("Light"),...ro}),Preview:no,zIndex:Y},Ba={name:"Setpoint",key:"setpoint",Symbol:wr,Form:Ac,defaultProps:()=>({units:"mV",...F("Setpoint"),...oa,...la}),Preview:Tr,zIndex:Y},Oa={value:wa,light:Na,switch:ka,button:Ta,setpoint:Ba,tank:pa,valve:ca,solenoidValve:aa,threeWayValve:ia,fourWayValve:ua,angledValve:xa,manualValve:Ea,needleValve:Ca,reliefValve:ja,angledReliefValve:va,checkValve:ya,regulator:fa,electricRegulator:ha,pump:da,pistonPump:Ma,screwPump:ma,cavityPump:La,vacuumPump:Pa,staticMixer:_a,rotaryMixer:$a,burstDisc:Sa,cap:ga,filter:Ra,orifice:ba},za=Object.freeze(Object.defineProperty({__proto__:null,AngledReliefValve:Or,AngledReliefValvePreview:zr,AngledValve:cr,AngledValvePreview:ar,BurstDisc:Er,BurstDiscPreview:Rr,Button:Zr,ButtonPreview:Fr,Cap:Cr,CapPreview:yr,CavityPump:Ur,CavityPumpPreview:Wr,CheckValve:_r,CheckValvePreview:$r,ControlState:te,ElectricRegulator:Sr,ElectricRegulatorPreview:gr,Filter:kr,FilterPreview:Pr,FourWayValve:lr,FourWayValvePreview:ir,Light:so,LightPreview:no,ManualValve:br,ManualValvePreview:vr,NeedleValve:Lr,NeedleValvePreview:Mr,Orifice:Nr,OrificePreview:Br,PistonPump:Xr,PistonPumpPreview:Jr,Pump:ur,PumpPreview:xr,Regulator:fr,RegulatorPreview:hr,ReliefValve:pr,ReliefValvePreview:jr,RotaryMixer:eo,RotaryMixerPreview:to,SYMBOLS:Oa,ScrewPump:qr,ScrewPumpPreview:Yr,Setpoint:wr,SetpointPreview:Tr,SolenoidValve:rr,SolenoidValvePreview:or,StaticMixer:Kr,StaticMixerPreview:Qr,Switch:Dr,SwitchPreview:Ir,Tank:dr,TankPreview:mr,ThreeWayValve:er,ThreeWayValvePreview:tr,VacuumPump:Hr,VacuumPumpPreview:Gr,Value:Vr,ValuePreview:Ar,Valve:sr,ValvePreview:nr,typeZ:na},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=Ae.external;exports.DataType=k.g;exports.Density=k.I;exports.MultiSeries=k.yt;exports.Rate=k.$;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=po.external;exports.Button=jo.external;exports.Caret=fo.Animated$1;exports.telem=m.external;exports.Color=Rt.external;exports.Text=ie.external;exports.Triggers=Ct.external;exports.Menu=ho.external;exports.List=Te.external;exports.createFilterTransform=Te.createFilterTransform;exports.fuseFilter=Te.fuseFilter;exports.proxyMemo=Te.proxyMemo;exports.createHexOpacityVariants=cs.createHexOpacityVariants;exports.unitProperty=cs.unitProperty;exports.Input=xe.external;exports.Tabs=X.external;exports.Theming=So.external;exports.Tree=go.external;exports.Video=Eo.Video;exports.Accordion=Ao;exports.Canvas=el;exports.Channel=Yl;exports.Control=Ki;exports.Device=di;exports.Diagram=kc;exports.Eraser=$i;exports.Form=ai;exports.Icon=pi;exports.Legend=ol;exports.Line=ll;exports.LinePlot=Ml;exports.Measure=Bl;exports.Modal=fi;exports.Mosaic=Li;exports.Nav=Oi;exports.Note=Vi;exports.OS=Yi;exports.Observe=Di;exports.Pluto=sc;exports.Progress=rc;exports.Range=$l;exports.Ranger=cc;exports.Resize=Mo;exports.Rule=Ol;exports.Schematic=za;exports.Select=gl;exports.Status=yo;exports.Steps=uc;exports.Synnax=Io;exports.Tag=hl;exports.Telem=Ui;exports.Tooltip=bo;exports.Value=Jc;exports.Viewport=Ll;exports.axis=Fo;exports.control=qo;