@synnaxlabs/pluto 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/dist/Center-8mBjm1cO.js +126 -0
  2. package/dist/{Center-gEKkAkdh.js.map → Center-8mBjm1cO.js.map} +1 -1
  3. package/dist/Center-ER_owvfX.cjs +2 -0
  4. package/dist/{Center-ZAcURh-3.cjs.map → Center-ER_owvfX.cjs.map} +1 -1
  5. package/dist/Header-9CR1VnwV.js +34 -0
  6. package/dist/{Header-7x6367IV.js.map → Header-9CR1VnwV.js.map} +1 -1
  7. package/dist/Header-PpcdP7hn.cjs +2 -0
  8. package/dist/{Header-5YX6FUn6.cjs.map → Header-PpcdP7hn.cjs.map} +1 -1
  9. package/dist/Item--h4UWJZo.js +80 -0
  10. package/dist/{Item-owLU4Xop.js.map → Item--h4UWJZo.js.map} +1 -1
  11. package/dist/Item-EBiM5yGJ.cjs +2 -0
  12. package/dist/{Item-HWzX7RK2.cjs.map → Item-EBiM5yGJ.cjs.map} +1 -1
  13. package/dist/Item-_og4CdwZ.cjs +2 -0
  14. package/dist/{Item-rkSKzZoh.cjs.map → Item-_og4CdwZ.cjs.map} +1 -1
  15. package/dist/Item-kbCoFEj2.js +137 -0
  16. package/dist/{Item-EDdYN2NK.js.map → Item-kbCoFEj2.js.map} +1 -1
  17. package/dist/Keyboard-IWRXgioJ.js +14 -0
  18. package/dist/{Keyboard-mE03PKwA.js.map → Keyboard-IWRXgioJ.js.map} +1 -1
  19. package/dist/Keyboard-bXNOi0bP.cjs +2 -0
  20. package/dist/{Keyboard-w372197S.cjs.map → Keyboard-bXNOi0bP.cjs.map} +1 -1
  21. package/dist/Link-16dbGK7G.cjs +2 -0
  22. package/dist/{Link-xlTZan29.cjs.map → Link-16dbGK7G.cjs.map} +1 -1
  23. package/dist/Link-fRQvqiYx.js +11 -0
  24. package/dist/{Link-laNlv47N.js.map → Link-fRQvqiYx.js.map} +1 -1
  25. package/dist/SelectLevel-DrdlLBOs.cjs +2 -0
  26. package/dist/{SelectLevel-bGb0dRXh.cjs.map → SelectLevel-DrdlLBOs.cjs.map} +1 -1
  27. package/dist/SelectLevel-Uod3Ez6y.js +121 -0
  28. package/dist/{SelectLevel-cewIWtOv.js.map → SelectLevel-Uod3Ez6y.js.map} +1 -1
  29. package/dist/Selector-8rTHUToj.cjs +2 -0
  30. package/dist/{Selector-hQLSIYum.cjs.map → Selector-8rTHUToj.cjs.map} +1 -1
  31. package/dist/Selector-R4SumEUV.js +233 -0
  32. package/dist/{Selector-R3lL41_i.js.map → Selector-R4SumEUV.js.map} +1 -1
  33. package/dist/Swatch--Prmb5q_.cjs +2 -0
  34. package/dist/Swatch--Prmb5q_.cjs.map +1 -0
  35. package/dist/Swatch-IH4OmVdd.js +82 -0
  36. package/dist/Swatch-IH4OmVdd.js.map +1 -0
  37. package/dist/TimeRangeChip-jI9Nn9z8.js +7384 -0
  38. package/dist/TimeRangeChip-jI9Nn9z8.js.map +1 -0
  39. package/dist/TimeRangeChip-jQH9NacG.cjs +50 -0
  40. package/dist/TimeRangeChip-jQH9NacG.cjs.map +1 -0
  41. package/dist/Toggle-HVxv8bv2.js +10648 -0
  42. package/dist/Toggle-HVxv8bv2.js.map +1 -0
  43. package/dist/Toggle-QnKinMl4.cjs +73 -0
  44. package/dist/Toggle-QnKinMl4.cjs.map +1 -0
  45. package/dist/Video-iiPAk_ej.cjs +2 -0
  46. package/dist/{Video-a7BUKvzF.cjs.map → Video-iiPAk_ej.cjs.map} +1 -1
  47. package/dist/Video-vyIORMaH.js +11 -0
  48. package/dist/{Video-Vpwp5ao1.js.map → Video-vyIORMaH.js.map} +1 -1
  49. package/dist/aether.cjs +1 -89
  50. package/dist/aether.cjs.map +1 -1
  51. package/dist/aether.js +76 -80
  52. package/dist/aether.js.map +1 -1
  53. package/dist/align.cjs +1 -9
  54. package/dist/align.cjs.map +1 -1
  55. package/dist/align.js +5 -5
  56. package/dist/button.cjs +1 -14
  57. package/dist/button.cjs.map +1 -1
  58. package/dist/button.js +9 -8
  59. package/dist/button.js.map +1 -1
  60. package/dist/color-9QRifwqk.js +9 -0
  61. package/dist/color-9QRifwqk.js.map +1 -0
  62. package/dist/color-gJTR__ef.cjs +2 -0
  63. package/dist/color-gJTR__ef.cjs.map +1 -0
  64. package/dist/color.cjs +2 -0
  65. package/dist/color.cjs.map +1 -0
  66. package/dist/color.js +16 -0
  67. package/dist/color.js.map +1 -0
  68. package/dist/component-LA8IXGSG.js +17961 -0
  69. package/dist/component-LA8IXGSG.js.map +1 -0
  70. package/dist/component-dgLAEMbt.cjs +23 -0
  71. package/dist/component-dgLAEMbt.cjs.map +1 -0
  72. package/dist/css-5RvvUhjr.js +6414 -0
  73. package/dist/{css-NTD4Xm8x.js.map → css-5RvvUhjr.js.map} +1 -1
  74. package/dist/css-s9KpanYu.cjs +8 -0
  75. package/dist/{css-V3VUT_Js.cjs.map → css-s9KpanYu.cjs.map} +1 -1
  76. package/dist/css.cjs +2 -0
  77. package/dist/css.cjs.map +1 -0
  78. package/dist/css.js +10 -0
  79. package/dist/css.js.map +1 -0
  80. package/dist/dimensions--C45ahLe.js +20 -0
  81. package/dist/{dimensions-guJ5PHmb.js.map → dimensions--C45ahLe.js.map} +1 -1
  82. package/dist/dimensions-HfZjDJQz.cjs +2 -0
  83. package/dist/{dimensions-Sej0Zly9.cjs.map → dimensions-HfZjDJQz.cjs.map} +1 -1
  84. package/dist/dropdown.cjs +1 -12
  85. package/dist/dropdown.cjs.map +1 -1
  86. package/dist/dropdown.js +7 -6
  87. package/dist/dropdown.js.map +1 -1
  88. package/dist/external--jsfNkbo.cjs +2 -0
  89. package/dist/external--jsfNkbo.cjs.map +1 -0
  90. package/dist/external-1DGLK9F2.js +17 -0
  91. package/dist/external-1DGLK9F2.js.map +1 -0
  92. package/dist/external-4h9H4Y_N.js +21 -0
  93. package/dist/external-4h9H4Y_N.js.map +1 -0
  94. package/dist/external-4uqucf0m.js +67 -0
  95. package/dist/{external-QuVTCnGl.js.map → external-4uqucf0m.js.map} +1 -1
  96. package/dist/external-A_eQgT5T.cjs +2 -0
  97. package/dist/external-A_eQgT5T.cjs.map +1 -0
  98. package/dist/external-FCO_hdNr.js +24 -0
  99. package/dist/external-FCO_hdNr.js.map +1 -0
  100. package/dist/external-HZ6f2KvU.cjs +2 -0
  101. package/dist/external-HZ6f2KvU.cjs.map +1 -0
  102. package/dist/external-LPdjowBG.cjs +2 -0
  103. package/dist/external-LPdjowBG.cjs.map +1 -0
  104. package/dist/external-O1b3FJKI.cjs +2 -0
  105. package/dist/external-O1b3FJKI.cjs.map +1 -0
  106. package/dist/external-RGdrJX7y.cjs +2 -0
  107. package/dist/{external-9Ncn2J9B.cjs.map → external-RGdrJX7y.cjs.map} +1 -1
  108. package/dist/external-WiHGqQPA.js +30 -0
  109. package/dist/external-WiHGqQPA.js.map +1 -0
  110. package/dist/external-eWu6hCLU.cjs +2 -0
  111. package/dist/external-eWu6hCLU.cjs.map +1 -0
  112. package/dist/external-kvAz85mu.js +18 -0
  113. package/dist/external-kvAz85mu.js.map +1 -0
  114. package/dist/external-mpVdVPF1.js +88 -0
  115. package/dist/external-mpVdVPF1.js.map +1 -0
  116. package/dist/external-nTDD8IMd.cjs +2 -0
  117. package/dist/external-nTDD8IMd.cjs.map +1 -0
  118. package/dist/external-phknItOL.js +15 -0
  119. package/dist/external-phknItOL.js.map +1 -0
  120. package/dist/external-rGcWjp84.cjs +2 -0
  121. package/dist/{external-zBiIxeDG.cjs.map → external-rGcWjp84.cjs.map} +1 -1
  122. package/dist/external-r_2-tYfC.js +88 -0
  123. package/dist/{external-up1sE3F6.js.map → external-r_2-tYfC.js.map} +1 -1
  124. package/dist/external-sHbzLUrP.js +17 -0
  125. package/dist/external-sHbzLUrP.js.map +1 -0
  126. package/dist/external-tZiYBM94.cjs +2 -0
  127. package/dist/external-tZiYBM94.cjs.map +1 -0
  128. package/dist/external-tnCo64yx.cjs +2 -0
  129. package/dist/external-tnCo64yx.cjs.map +1 -0
  130. package/dist/external-uR-7_68y.js +16 -0
  131. package/dist/external-uR-7_68y.js.map +1 -0
  132. package/dist/external-uSIsCKNG.js +15 -0
  133. package/dist/external-uSIsCKNG.js.map +1 -0
  134. package/dist/external-z6BLlxur.cjs +2 -0
  135. package/dist/external-z6BLlxur.cjs.map +1 -0
  136. package/dist/font-HpLrwPSD.js +16 -0
  137. package/dist/{font-t7KoGNFX.js.map → font-HpLrwPSD.js.map} +1 -1
  138. package/dist/font-yosRgv9n.cjs +2 -0
  139. package/dist/{font-wlgaMRYN.cjs.map → font-yosRgv9n.cjs.map} +1 -1
  140. package/dist/fontString-_dtZSiPk.cjs +2 -0
  141. package/dist/{fontString-i24UxKCQ.cjs.map → fontString-_dtZSiPk.cjs.map} +1 -1
  142. package/dist/fontString-lodjYTYz.js +12 -0
  143. package/dist/{fontString-RKvYIr5H.js.map → fontString-lodjYTYz.js.map} +1 -1
  144. package/dist/header.cjs +1 -14
  145. package/dist/header.cjs.map +1 -1
  146. package/dist/header.js +9 -8
  147. package/dist/header.js.map +1 -1
  148. package/dist/index.cjs +1 -1174
  149. package/dist/index.cjs.map +1 -1
  150. package/dist/index.js +737 -930
  151. package/dist/index.js.map +1 -1
  152. package/dist/input/Input.stories.d.ts +1 -0
  153. package/dist/input/TextArea.d.ts +20 -0
  154. package/dist/input/external.d.ts +1 -0
  155. package/dist/input/types.d.ts +4 -2
  156. package/dist/input.cjs +1 -14
  157. package/dist/input.cjs.map +1 -1
  158. package/dist/input.js +9 -8
  159. package/dist/input.js.map +1 -1
  160. package/dist/jsx-runtime-NmMXPjeo.js +632 -0
  161. package/dist/{jsx-runtime-rX5tAIG2.js.map → jsx-runtime-NmMXPjeo.js.map} +1 -1
  162. package/dist/jsx-runtime-evvPGacs.cjs +28 -0
  163. package/dist/{jsx-runtime-N1ikfypN.cjs.map → jsx-runtime-evvPGacs.cjs.map} +1 -1
  164. package/dist/list.cjs +1 -26
  165. package/dist/list.cjs.map +1 -1
  166. package/dist/list.js +21 -19
  167. package/dist/list.js.map +1 -1
  168. package/dist/menu.cjs +1 -15
  169. package/dist/menu.cjs.map +1 -1
  170. package/dist/menu.js +10 -9
  171. package/dist/menu.js.map +1 -1
  172. package/dist/style.css +1 -3119
  173. package/dist/table-MJysJcCC.js +10312 -0
  174. package/dist/table-MJysJcCC.js.map +1 -0
  175. package/dist/table-NIrLpFOm.cjs +69 -0
  176. package/dist/table-NIrLpFOm.cjs.map +1 -0
  177. package/dist/tabs.cjs +1 -14
  178. package/dist/tabs.cjs.map +1 -1
  179. package/dist/tabs.js +9 -8
  180. package/dist/tabs.js.map +1 -1
  181. package/dist/text.cjs +1 -16
  182. package/dist/text.cjs.map +1 -1
  183. package/dist/text.js +11 -10
  184. package/dist/text.js.map +1 -1
  185. package/dist/theming.cjs +1 -15
  186. package/dist/theming.cjs.map +1 -1
  187. package/dist/theming.js +10 -9
  188. package/dist/theming.js.map +1 -1
  189. package/dist/tree.cjs +1 -25
  190. package/dist/tree.cjs.map +1 -1
  191. package/dist/tree.js +20 -18
  192. package/dist/tree.js.map +1 -1
  193. package/dist/triggers.cjs +1 -15
  194. package/dist/triggers.cjs.map +1 -1
  195. package/dist/triggers.js +10 -9
  196. package/dist/triggers.js.map +1 -1
  197. package/dist/useDrag-4o21IpGy.js +36 -0
  198. package/dist/{useDrag-rQt5hv4R.js.map → useDrag-4o21IpGy.js.map} +1 -1
  199. package/dist/useDrag-l_moa7e3.cjs +2 -0
  200. package/dist/{useDrag-KRQ7DTg1.cjs.map → useDrag-l_moa7e3.cjs.map} +1 -1
  201. package/dist/video.cjs +1 -9
  202. package/dist/video.cjs.map +1 -1
  203. package/dist/video.js +3 -3
  204. package/package.json +15 -5
  205. package/dist/Center-ZAcURh-3.cjs +0 -148
  206. package/dist/Center-gEKkAkdh.js +0 -149
  207. package/dist/Header-5YX6FUn6.cjs +0 -35
  208. package/dist/Header-7x6367IV.js +0 -36
  209. package/dist/Item-EDdYN2NK.js +0 -171
  210. package/dist/Item-HWzX7RK2.cjs +0 -170
  211. package/dist/Item-owLU4Xop.js +0 -97
  212. package/dist/Item-rkSKzZoh.cjs +0 -96
  213. package/dist/Keyboard-mE03PKwA.js +0 -14
  214. package/dist/Keyboard-w372197S.cjs +0 -13
  215. package/dist/Link-laNlv47N.js +0 -13
  216. package/dist/Link-xlTZan29.cjs +0 -12
  217. package/dist/SelectLevel-bGb0dRXh.cjs +0 -152
  218. package/dist/SelectLevel-cewIWtOv.js +0 -153
  219. package/dist/Selector-R3lL41_i.js +0 -267
  220. package/dist/Selector-hQLSIYum.cjs +0 -266
  221. package/dist/TimeRangeChip-XXXLMCrf.cjs +0 -9316
  222. package/dist/TimeRangeChip-XXXLMCrf.cjs.map +0 -1
  223. package/dist/TimeRangeChip-eDCX5pUC.js +0 -9301
  224. package/dist/TimeRangeChip-eDCX5pUC.js.map +0 -1
  225. package/dist/Toggle-eOKYw1OT.cjs +0 -13664
  226. package/dist/Toggle-eOKYw1OT.cjs.map +0 -1
  227. package/dist/Toggle-kLunfJtR.js +0 -13665
  228. package/dist/Toggle-kLunfJtR.js.map +0 -1
  229. package/dist/Video-Vpwp5ao1.js +0 -12
  230. package/dist/Video-a7BUKvzF.cjs +0 -11
  231. package/dist/component-joFaJiQW.cjs +0 -24719
  232. package/dist/component-joFaJiQW.cjs.map +0 -1
  233. package/dist/component-k78Jq9I7.js +0 -24720
  234. package/dist/component-k78Jq9I7.js.map +0 -1
  235. package/dist/css-NTD4Xm8x.js +0 -9206
  236. package/dist/css-V3VUT_Js.cjs +0 -9204
  237. package/dist/dimensions-Sej0Zly9.cjs +0 -26
  238. package/dist/dimensions-guJ5PHmb.js +0 -27
  239. package/dist/external-2Aicsb3l.js +0 -88
  240. package/dist/external-2Aicsb3l.js.map +0 -1
  241. package/dist/external-9Ncn2J9B.cjs +0 -93
  242. package/dist/external-9RCzxzgZ.js +0 -30
  243. package/dist/external-9RCzxzgZ.js.map +0 -1
  244. package/dist/external-9pS8-DvV.js +0 -15
  245. package/dist/external-9pS8-DvV.js.map +0 -1
  246. package/dist/external-KxlyA74C.js +0 -20
  247. package/dist/external-KxlyA74C.js.map +0 -1
  248. package/dist/external-OSLzuRs1.cjs +0 -14
  249. package/dist/external-OSLzuRs1.cjs.map +0 -1
  250. package/dist/external-PS3nzqUn.cjs +0 -23
  251. package/dist/external-PS3nzqUn.cjs.map +0 -1
  252. package/dist/external-QRmqSjV0.js +0 -18
  253. package/dist/external-QRmqSjV0.js.map +0 -1
  254. package/dist/external-QuVTCnGl.js +0 -71
  255. package/dist/external-U5HRPaDI.cjs +0 -17
  256. package/dist/external-U5HRPaDI.cjs.map +0 -1
  257. package/dist/external-_CtRDtih.js +0 -17
  258. package/dist/external-_CtRDtih.js.map +0 -1
  259. package/dist/external-eQU48hM4.cjs +0 -87
  260. package/dist/external-eQU48hM4.cjs.map +0 -1
  261. package/dist/external-kbDFnfuk.js +0 -24
  262. package/dist/external-kbDFnfuk.js.map +0 -1
  263. package/dist/external-oX1JmOFf.js +0 -17
  264. package/dist/external-oX1JmOFf.js.map +0 -1
  265. package/dist/external-oZe6tF4A.cjs +0 -14
  266. package/dist/external-oZe6tF4A.cjs.map +0 -1
  267. package/dist/external-tVcmKSsT.cjs +0 -19
  268. package/dist/external-tVcmKSsT.cjs.map +0 -1
  269. package/dist/external-up1sE3F6.js +0 -94
  270. package/dist/external-uvx0b-Jw.cjs +0 -16
  271. package/dist/external-uvx0b-Jw.cjs.map +0 -1
  272. package/dist/external-vXBQOmKv.js +0 -15
  273. package/dist/external-vXBQOmKv.js.map +0 -1
  274. package/dist/external-yiqRIIvW.cjs +0 -16
  275. package/dist/external-yiqRIIvW.cjs.map +0 -1
  276. package/dist/external-zBiIxeDG.cjs +0 -70
  277. package/dist/external-zw9fckWT.cjs +0 -29
  278. package/dist/external-zw9fckWT.cjs.map +0 -1
  279. package/dist/font-t7KoGNFX.js +0 -17
  280. package/dist/font-wlgaMRYN.cjs +0 -16
  281. package/dist/fontString-RKvYIr5H.js +0 -13
  282. package/dist/fontString-i24UxKCQ.cjs +0 -12
  283. package/dist/jsx-runtime-N1ikfypN.cjs +0 -931
  284. package/dist/jsx-runtime-rX5tAIG2.js +0 -932
  285. package/dist/table-8MFXzE4C.js +0 -13664
  286. package/dist/table-8MFXzE4C.js.map +0 -1
  287. package/dist/table-VNkSG_Cj.cjs +0 -13661
  288. package/dist/table-VNkSG_Cj.cjs.map +0 -1
  289. package/dist/useDrag-KRQ7DTg1.cjs +0 -48
  290. package/dist/useDrag-rQt5hv4R.js +0 -49
@@ -0,0 +1,50 @@
1
+ "use strict";var jr=Object.defineProperty;var Er=(e,t,s)=>t in e?jr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var pe=(e,t,s)=>(Er(e,typeof t!="symbol"?t+"":t,s),s);const Sr=require("zod"),j=require("./table-NIrLpFOm.cjs"),c=require("./css-s9KpanYu.cjs"),i=require("./jsx-runtime-evvPGacs.cjs"),p=require("react"),V=require("./Center-ER_owvfX.cjs"),m=require("./Toggle-QnKinMl4.cjs"),se=require("./component-dgLAEMbt.cjs"),ws=require("./Swatch--Prmb5q_.cjs"),$s=require("./SelectLevel-DrdlLBOs.cjs"),Rr=require("./useDrag-l_moa7e3.cjs"),ne=require("./Item-_og4CdwZ.cjs"),Ze=require("./Item-EBiM5yGJ.cjs");require("react-hook-form");require("./Header-PpcdP7hn.cjs");const Ye=require("./dimensions-HfZjDJQz.cjs"),Qe=require("./font-yosRgv9n.cjs"),br=require("react-dom"),le=require("./Selector-8rTHUToj.cjs"),vr=require("./Link-16dbGK7G.cjs");require("./Video-k52RqIHf.cjs");function Cr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const ke=Cr(p);function ce(e){return Array.isArray?Array.isArray(e):ks(e)==="[object Array]"}const yr=1/0;function wr(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-yr?"-0":t}function $r(e){return e==null?"":wr(e)}function oe(e){return typeof e=="string"}function Ms(e){return typeof e=="number"}function Mr(e){return e===!0||e===!1||Tr(e)&&ks(e)=="[object Boolean]"}function Ts(e){return typeof e=="object"}function Tr(e){return Ts(e)&&e!==null}function J(e){return e!=null}function xt(e){return!e.trim().length}function ks(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const kr="Incorrect 'index' type",Lr=e=>`Invalid value for key ${e}`,Pr=e=>`Pattern length exceeds max of ${e}.`,Or=e=>`Missing ${e} property in key`,Ir=e=>`Property 'weight' in key '${e}' must be a positive integer`,Xt=Object.prototype.hasOwnProperty;class Nr{constructor(t){this._keys=[],this._keyMap={};let s=0;t.forEach(n=>{let r=Ls(n);this._keys.push(r),this._keyMap[r.id]=r,s+=r.weight}),this._keys.forEach(n=>{n.weight/=s})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ls(e){let t=null,s=null,n=null,r=1,o=null;if(oe(e)||ce(e))n=e,t=Qt(e),s=gt(e);else{if(!Xt.call(e,"name"))throw new Error(Or("name"));const l=e.name;if(n=l,Xt.call(e,"weight")&&(r=e.weight,r<=0))throw new Error(Ir(l));t=Qt(l),s=gt(l),o=e.getFn}return{path:t,id:s,weight:r,src:n,getFn:o}}function Qt(e){return ce(e)?e:e.split(".")}function gt(e){return ce(e)?e.join("."):e}function _r(e,t){let s=[],n=!1;const r=(o,l,a)=>{if(J(o))if(!l[a])s.push(o);else{let u=l[a];const d=o[u];if(!J(d))return;if(a===l.length-1&&(oe(d)||Ms(d)||Mr(d)))s.push($r(d));else if(ce(d)){n=!0;for(let x=0,h=d.length;x<h;x+=1)r(d[x],l,a+1)}else l.length&&r(d,l,a+1)}};return r(e,oe(t)?t.split("."):t,0),n?s:s[0]}const Dr={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Ar={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Vr={location:0,threshold:.6,distance:100},Br={useExtendedSearch:!1,getFn:_r,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var P={...Ar,...Dr,...Vr,...Br};const zr=/[^ ]+/g;function Fr(e=1,t=3){const s=new Map,n=Math.pow(10,t);return{get(r){const o=r.match(zr).length;if(s.has(o))return s.get(o);const l=1/Math.pow(o,.5*e),a=parseFloat(Math.round(l*n)/n);return s.set(o,a),a},clear(){s.clear()}}}class kt{constructor({getFn:t=P.getFn,fieldNormWeight:s=P.fieldNormWeight}={}){this.norm=Fr(s,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((s,n)=>{this._keysMap[s.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,oe(this.docs[0])?this.docs.forEach((t,s)=>{this._addString(t,s)}):this.docs.forEach((t,s)=>{this._addObject(t,s)}),this.norm.clear())}add(t){const s=this.size();oe(t)?this._addString(t,s):this._addObject(t,s)}removeAt(t){this.records.splice(t,1);for(let s=t,n=this.size();s<n;s+=1)this.records[s].i-=1}getValueForItemAtKeyId(t,s){return t[this._keysMap[s]]}size(){return this.records.length}_addString(t,s){if(!J(t)||xt(t))return;let n={v:t,i:s,n:this.norm.get(t)};this.records.push(n)}_addObject(t,s){let n={i:s,$:{}};this.keys.forEach((r,o)=>{let l=r.getFn?r.getFn(t):this.getFn(t,r.path);if(J(l)){if(ce(l)){let a=[];const u=[{nestedArrIndex:-1,value:l}];for(;u.length;){const{nestedArrIndex:d,value:x}=u.pop();if(J(x))if(oe(x)&&!xt(x)){let h={v:x,i:d,n:this.norm.get(x)};a.push(h)}else ce(x)&&x.forEach((h,f)=>{u.push({nestedArrIndex:f,value:h})})}n.$[o]=a}else if(oe(l)&&!xt(l)){let a={v:l,n:this.norm.get(l)};n.$[o]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Ps(e,t,{getFn:s=P.getFn,fieldNormWeight:n=P.fieldNormWeight}={}){const r=new kt({getFn:s,fieldNormWeight:n});return r.setKeys(e.map(Ls)),r.setSources(t),r.create(),r}function Zr(e,{getFn:t=P.getFn,fieldNormWeight:s=P.fieldNormWeight}={}){const{keys:n,records:r}=e,o=new kt({getFn:t,fieldNormWeight:s});return o.setKeys(n),o.setIndexRecords(r),o}function Ae(e,{errors:t=0,currentLocation:s=0,expectedLocation:n=0,distance:r=P.distance,ignoreLocation:o=P.ignoreLocation}={}){const l=t/e.length;if(o)return l;const a=Math.abs(n-s);return r?l+a/r:a?1:l}function Yr(e=[],t=P.minMatchCharLength){let s=[],n=-1,r=-1,o=0;for(let l=e.length;o<l;o+=1){let a=e[o];a&&n===-1?n=o:!a&&n!==-1&&(r=o-1,r-n+1>=t&&s.push([n,r]),n=-1)}return e[o-1]&&o-n>=t&&s.push([n,o-1]),s}const me=32;function Hr(e,t,s,{location:n=P.location,distance:r=P.distance,threshold:o=P.threshold,findAllMatches:l=P.findAllMatches,minMatchCharLength:a=P.minMatchCharLength,includeMatches:u=P.includeMatches,ignoreLocation:d=P.ignoreLocation}={}){if(t.length>me)throw new Error(Pr(me));const x=t.length,h=e.length,f=Math.max(0,Math.min(n,h));let g=o,E=f;const S=a>1||u,R=S?Array(h):[];let b;for(;(b=e.indexOf(t,E))>-1;){let L=Ae(t,{currentLocation:b,expectedLocation:f,distance:r,ignoreLocation:d});if(g=Math.min(L,g),E=b+x,S){let M=0;for(;M<x;)R[b+M]=1,M+=1}}E=-1;let C=[],v=1,y=x+h;const k=1<<x-1;for(let L=0;L<x;L+=1){let M=0,$=y;for(;M<$;)Ae(t,{errors:L,currentLocation:f+$,expectedLocation:f,distance:r,ignoreLocation:d})<=g?M=$:y=$,$=Math.floor((y-M)/2+M);y=$;let B=Math.max(1,f-$+1),D=l?h:Math.min(f+$,h)+x,O=Array(D+2);O[D+1]=(1<<L)-1;for(let _=D;_>=B;_-=1){let U=_-1,Y=s[e.charAt(U)];if(S&&(R[U]=+!!Y),O[_]=(O[_+1]<<1|1)&Y,L&&(O[_]|=(C[_+1]|C[_])<<1|1|C[_+1]),O[_]&k&&(v=Ae(t,{errors:L,currentLocation:U,expectedLocation:f,distance:r,ignoreLocation:d}),v<=g)){if(g=v,E=U,E<=f)break;B=Math.max(1,2*f-E)}}if(Ae(t,{errors:L+1,currentLocation:f,expectedLocation:f,distance:r,ignoreLocation:d})>g)break;C=O}const w={isMatch:E>=0,score:Math.max(.001,v)};if(S){const L=Yr(R,a);L.length?u&&(w.indices=L):w.isMatch=!1}return w}function Gr(e){let t={};for(let s=0,n=e.length;s<n;s+=1){const r=e.charAt(s);t[r]=(t[r]||0)|1<<n-s-1}return t}class Os{constructor(t,{location:s=P.location,threshold:n=P.threshold,distance:r=P.distance,includeMatches:o=P.includeMatches,findAllMatches:l=P.findAllMatches,minMatchCharLength:a=P.minMatchCharLength,isCaseSensitive:u=P.isCaseSensitive,ignoreLocation:d=P.ignoreLocation}={}){if(this.options={location:s,threshold:n,distance:r,includeMatches:o,findAllMatches:l,minMatchCharLength:a,isCaseSensitive:u,ignoreLocation:d},this.pattern=u?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const x=(f,g)=>{this.chunks.push({pattern:f,alphabet:Gr(f),startIndex:g})},h=this.pattern.length;if(h>me){let f=0;const g=h%me,E=h-g;for(;f<E;)x(this.pattern.substr(f,me),f),f+=me;if(g){const S=h-me;x(this.pattern.substr(S),S)}}else x(this.pattern,0)}searchIn(t){const{isCaseSensitive:s,includeMatches:n}=this.options;if(s||(t=t.toLowerCase()),this.pattern===t){let E={isMatch:!0,score:0};return n&&(E.indices=[[0,t.length-1]]),E}const{location:r,distance:o,threshold:l,findAllMatches:a,minMatchCharLength:u,ignoreLocation:d}=this.options;let x=[],h=0,f=!1;this.chunks.forEach(({pattern:E,alphabet:S,startIndex:R})=>{const{isMatch:b,score:C,indices:v}=Hr(t,E,S,{location:r+R,distance:o,threshold:l,findAllMatches:a,minMatchCharLength:u,includeMatches:n,ignoreLocation:d});b&&(f=!0),h+=C,b&&v&&(x=[...x,...v])});let g={isMatch:f,score:f?h/this.chunks.length:1};return f&&n&&(g.indices=x),g}}class de{constructor(t){this.pattern=t}static isMultiMatch(t){return Jt(t,this.multiRegex)}static isSingleMatch(t){return Jt(t,this.singleRegex)}search(){}}function Jt(e,t){const s=e.match(t);return s?s[1]:null}class Ur extends de{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const s=t===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class Wr extends de{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const n=t.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class Kr extends de{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const s=t.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class qr extends de{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const s=!t.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class Xr extends de{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const s=t.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class Qr extends de{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const s=!t.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class Is extends de{constructor(t,{location:s=P.location,threshold:n=P.threshold,distance:r=P.distance,includeMatches:o=P.includeMatches,findAllMatches:l=P.findAllMatches,minMatchCharLength:a=P.minMatchCharLength,isCaseSensitive:u=P.isCaseSensitive,ignoreLocation:d=P.ignoreLocation}={}){super(t),this._bitapSearch=new Os(t,{location:s,threshold:n,distance:r,includeMatches:o,findAllMatches:l,minMatchCharLength:a,isCaseSensitive:u,ignoreLocation:d})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Ns extends de{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let s=0,n;const r=[],o=this.pattern.length;for(;(n=t.indexOf(this.pattern,s))>-1;)s=n+o,r.push([n,s-1]);const l=!!r.length;return{isMatch:l,score:l?0:1,indices:r}}}const jt=[Ur,Ns,Kr,qr,Qr,Xr,Wr,Is],es=jt.length,Jr=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,eo="|";function to(e,t={}){return e.split(eo).map(s=>{let n=s.trim().split(Jr).filter(o=>o&&!!o.trim()),r=[];for(let o=0,l=n.length;o<l;o+=1){const a=n[o];let u=!1,d=-1;for(;!u&&++d<es;){const x=jt[d];let h=x.isMultiMatch(a);h&&(r.push(new x(h,t)),u=!0)}if(!u)for(d=-1;++d<es;){const x=jt[d];let h=x.isSingleMatch(a);if(h){r.push(new x(h,t));break}}}return r})}const so=new Set([Is.type,Ns.type]);class no{constructor(t,{isCaseSensitive:s=P.isCaseSensitive,includeMatches:n=P.includeMatches,minMatchCharLength:r=P.minMatchCharLength,ignoreLocation:o=P.ignoreLocation,findAllMatches:l=P.findAllMatches,location:a=P.location,threshold:u=P.threshold,distance:d=P.distance}={}){this.query=null,this.options={isCaseSensitive:s,includeMatches:n,minMatchCharLength:r,findAllMatches:l,ignoreLocation:o,location:a,threshold:u,distance:d},this.pattern=s?t:t.toLowerCase(),this.query=to(this.pattern,this.options)}static condition(t,s){return s.useExtendedSearch}searchIn(t){const s=this.query;if(!s)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r}=this.options;t=r?t:t.toLowerCase();let o=0,l=[],a=0;for(let u=0,d=s.length;u<d;u+=1){const x=s[u];l.length=0,o=0;for(let h=0,f=x.length;h<f;h+=1){const g=x[h],{isMatch:E,indices:S,score:R}=g.search(t);if(E){if(o+=1,a+=R,n){const b=g.constructor.type;so.has(b)?l=[...l,...S]:l.push(S)}}else{a=0,o=0,l.length=0;break}}if(o){let h={isMatch:!0,score:a/o};return n&&(h.indices=l),h}}return{isMatch:!1,score:1}}}const Et=[];function ro(...e){Et.push(...e)}function St(e,t){for(let s=0,n=Et.length;s<n;s+=1){let r=Et[s];if(r.condition(e,t))return new r(e,t)}return new Os(e,t)}const He={AND:"$and",OR:"$or"},Rt={PATH:"$path",PATTERN:"$val"},bt=e=>!!(e[He.AND]||e[He.OR]),oo=e=>!!e[Rt.PATH],io=e=>!ce(e)&&Ts(e)&&!bt(e),ts=e=>({[He.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function _s(e,t,{auto:s=!0}={}){const n=r=>{let o=Object.keys(r);const l=oo(r);if(!l&&o.length>1&&!bt(r))return n(ts(r));if(io(r)){const u=l?r[Rt.PATH]:o[0],d=l?r[Rt.PATTERN]:r[u];if(!oe(d))throw new Error(Lr(u));const x={keyId:gt(u),pattern:d};return s&&(x.searcher=St(d,t)),x}let a={children:[],operator:o[0]};return o.forEach(u=>{const d=r[u];ce(d)&&d.forEach(x=>{a.children.push(n(x))})}),a};return bt(e)||(e=ts(e)),n(e)}function lo(e,{ignoreFieldNorm:t=P.ignoreFieldNorm}){e.forEach(s=>{let n=1;s.matches.forEach(({key:r,norm:o,score:l})=>{const a=r?r.weight:null;n*=Math.pow(l===0&&a?Number.EPSILON:l,(a||1)*(t?1:o))}),s.score=n})}function co(e,t){const s=e.matches;t.matches=[],J(s)&&s.forEach(n=>{if(!J(n.indices)||!n.indices.length)return;const{indices:r,value:o}=n;let l={indices:r,value:o};n.key&&(l.key=n.key.src),n.idx>-1&&(l.refIndex=n.idx),t.matches.push(l)})}function ao(e,t){t.score=e.score}function uo(e,t,{includeMatches:s=P.includeMatches,includeScore:n=P.includeScore}={}){const r=[];return s&&r.push(co),n&&r.push(ao),e.map(o=>{const{idx:l}=o,a={item:t[l],refIndex:l};return r.length&&r.forEach(u=>{u(o,a)}),a})}class ve{constructor(t,s={},n){this.options={...P,...s},this.options.useExtendedSearch,this._keyStore=new Nr(this.options.keys),this.setCollection(t,n)}setCollection(t,s){if(this._docs=t,s&&!(s instanceof kt))throw new Error(kr);this._myIndex=s||Ps(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){J(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const s=[];for(let n=0,r=this._docs.length;n<r;n+=1){const o=this._docs[n];t(o,n)&&(this.removeAt(n),n-=1,r-=1,s.push(o))}return s}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:s=-1}={}){const{includeMatches:n,includeScore:r,shouldSort:o,sortFn:l,ignoreFieldNorm:a}=this.options;let u=oe(t)?oe(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return lo(u,{ignoreFieldNorm:a}),o&&u.sort(l),Ms(s)&&s>-1&&(u=u.slice(0,s)),uo(u,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(t){const s=St(t,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:o,i:l,n:a})=>{if(!J(o))return;const{isMatch:u,score:d,indices:x}=s.searchIn(o);u&&r.push({item:o,idx:l,matches:[{score:d,value:o,norm:a,indices:x}]})}),r}_searchLogical(t){const s=_s(t,this.options),n=(a,u,d)=>{if(!a.children){const{keyId:h,searcher:f}=a,g=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(u,h),searcher:f});return g&&g.length?[{idx:d,item:u,matches:g}]:[]}const x=[];for(let h=0,f=a.children.length;h<f;h+=1){const g=a.children[h],E=n(g,u,d);if(E.length)x.push(...E);else if(a.operator===He.AND)return[]}return x},r=this._myIndex.records,o={},l=[];return r.forEach(({$:a,i:u})=>{if(J(a)){let d=n(s,a,u);d.length&&(o[u]||(o[u]={idx:u,item:a,matches:[]},l.push(o[u])),d.forEach(({matches:x})=>{o[u].matches.push(...x)}))}}),l}_searchObjectList(t){const s=St(t,this.options),{keys:n,records:r}=this._myIndex,o=[];return r.forEach(({$:l,i:a})=>{if(!J(l))return;let u=[];n.forEach((d,x)=>{u.push(...this._findMatches({key:d,value:l[x],searcher:s}))}),u.length&&o.push({idx:a,item:l,matches:u})}),o}_findMatches({key:t,value:s,searcher:n}){if(!J(s))return[];let r=[];if(ce(s))s.forEach(({v:o,i:l,n:a})=>{if(!J(o))return;const{isMatch:u,score:d,indices:x}=n.searchIn(o);u&&r.push({score:d,key:t,value:o,idx:l,norm:a,indices:x})});else{const{v:o,n:l}=s,{isMatch:a,score:u,indices:d}=n.searchIn(o);a&&r.push({score:u,key:t,value:o,norm:l,indices:d})}return r}}ve.version="7.0.0";ve.createIndex=Ps;ve.parseIndex=Zr;ve.config=P;ve.parseQuery=_s;ro(no);const vt=Symbol(),Ds=Symbol(),Lt=Symbol();let xo=(e,t)=>new Proxy(e,t);const Ct=Object.getPrototypeOf,ss=new WeakMap,Pt=e=>e&&(ss.has(e)?ss.get(e):Ct(e)===Object.prototype||Ct(e)===Array.prototype),ns=e=>typeof e=="object"&&e!==null,rs=new WeakMap,As=e=>e[Lt]||e,Vs=(e,t,s)=>{if(!Pt(e))return e;const n=As(e),r=(l=>Object.isFrozen(l)||Object.values(Object.getOwnPropertyDescriptors(l)).some(a=>!a.writable))(n);let o=s&&s.get(n);return o&&o[1].f===r||(o=((l,a)=>{const u={f:a};let d=!1;const x=(f,g)=>{if(!d){let E=u.a.get(l);E||(E=new Set,u.a.set(l,E)),g&&E.has(vt)||E.add(f)}},h={get:(f,g)=>g===Lt?l:(x(g),Vs(f[g],u.a,u.c)),has:(f,g)=>g===Ds?(d=!0,u.a.delete(l),!0):(x(g),g in f),getOwnPropertyDescriptor:(f,g)=>(x(g,!0),Object.getOwnPropertyDescriptor(f,g)),ownKeys:f=>(x(vt),Reflect.ownKeys(f))};return a&&(h.set=h.deleteProperty=()=>!1),[h,u]})(n,r),o[1].p=xo(r?(l=>{let a=rs.get(l);if(!a){if(Array.isArray(l))a=Array.from(l);else{const u=Object.getOwnPropertyDescriptors(l);Object.values(u).forEach(d=>{d.configurable=!0}),a=Object.create(Ct(l),u)}rs.set(l,a)}return a})(n):n,o[0]),s&&s.set(n,o)),o[1].a=t,o[1].c=s,o[1].p},ho=(e,t)=>{const s=Reflect.ownKeys(e),n=Reflect.ownKeys(t);return s.length!==n.length||s.some((r,o)=>r!==n[o])},Bs=(e,t,s,n)=>{if(Object.is(e,t))return!1;if(!ns(e)||!ns(t))return!0;const r=s.get(As(e));if(!r)return!0;if(n){const l=n.get(e);if(l&&l.n===t)return l.g;n.set(e,{n:t,g:!1})}let o=null;for(const l of r){const a=l===vt?ho(e,t):Bs(e[l],t[l],s,n);if(a!==!0&&a!==!1||(o=a),o)break}return o===null&&(o=!0),n&&n.set(e,{n:t,g:o}),o},po=e=>!!Pt(e)&&Ds in e,Ot=e=>Pt(e)&&e[Lt]||null,yt=e=>typeof e=="object"&&e!==null,zs=(e,t)=>{if(!yt(e))return e;const s=Ot(e);return s!==null?(po(e),s):(t.has(e)||(t.add(e),Object.entries(e).forEach(([n,r])=>{const o=zs(r,t);Object.is(o,r)||(e[n]=o)})),e)},Be=(e,t,s)=>{if(!yt(e)||!yt(t))return;const n=s.get(Ot(t)||t);n&&n.forEach(r=>{Be(e[r],t[r],s)})},mo=(e,t)=>{var s;let n=0;const r=(s=t==null?void 0:t.size)!=null?s:1,o=[],l=new WeakMap,a=new WeakMap;return u=>{const d=Ot(u)||u,x=l.get(d);if(x)return Be(u,x.o,x.a),x.r;for(let S=0;S<r;S+=1){const R=o[(n+S)%r];if(!R)break;if(!Bs(R.o,u,R.a,new WeakMap))return l.set(d,R),Be(u,R.o,R.a),R.r}const h=new WeakMap,f=Vs(u,h,a),g=zs(e(f),new Set);Be(u,u,h);const E={o:u,r:g,a:h};return n=(n-1+r)%r,o[n]=E,l.set(d,E),g}},fo=(e,t)=>c.external$1.RUNTIME==="browser"?mo(e,t):e,go={threshold:.3},Fs=e=>t=>{const s=new ve(t,{keys:Object.keys(t[0]),...go,...e});return{page:(n,r)=>t.slice(n*r,(n+1)*r),search:n=>s.search(n).map(({item:r})=>r),retrieve:n=>t.filter(r=>n.includes(r.key))}},jo=Fs(),Zs=({term:e,searcher:t=jo})=>fo(s=>typeof t=="function"?e.length===0||(s==null?void 0:s.length)===0?s:t(s).search(e):t.search(e)),Ys=({transforms:e=[]})=>{const[t,s]=p.useState(e),n=p.useCallback((l,a,u=0)=>s(d=>{const x=d.filter(h=>h.key!==l);return x.push({key:l,transform:a,priority:u}),x.sort((h,f)=>f.priority-h.priority),x}),[s]),r=p.useCallback(l=>s(a=>a.filter(u=>u.key!==l)),[n]);return{transform:p.useCallback(l=>t.reduce((a,u)=>u.transform(a),l),[t]),setTransform:n,deleteTransform:r}},Je=(e,t,s)=>p.useCallback(c.debounce(e,t),[t,...s]),et=({onMove:e,onStart:t,onEnd:s})=>p.useCallback(n=>{n.preventDefault();const r=c.xy.construct(n),o=m.mouseKey(n.button);t==null||t(r,o,n);const l=u=>{if(u.buttons===0)return a(u);const d=c.xy.construct(u);e==null||e(c.box$1.construct(r,d),o,u)};window.addEventListener("mousemove",l);const a=u=>{window.removeEventListener("mousemove",l);const d=c.xy.construct(u);s==null||s(c.box$1.construct(r,d),o,u)};window.addEventListener("mouseup",a,{once:!0})},[e,t,s]),Ge=e=>e.preventDefault(),tt=p.forwardRef(({location:e,style:t,size:s,className:n,children:r,onDragStart:o,sizeUnits:l="px",showHandle:a=!0,...u},d)=>{const x=c.location.construct(e),h=c.location.direction(x),f=c.direction$1.dimension(h);return i.jsxRuntimeExports.jsxs("div",{className:c.CSS(c.CSS.B("resize"),c.CSS.loc(x),c.CSS.dir(h),n),style:{[f]:`${s}${l}`,...t},ref:d,...u,children:[r,a&&i.jsxRuntimeExports.jsx("div",{draggable:!0,className:c.CSS(c.CSS.BE("resize","handle"),c.CSS.bordered(c.location.swap(x))),onDragStart:o,onDrag:Ge,onDragEnd:Ge})]})});tt.displayName="Resize.Core";const Hs=({onResize:e,count:t,initialSizes:s=[],minSize:n=100,direction:r="x"})=>{const o=p.useRef(null),[l,a]=p.useState({sizeDistribution:Eo(s,t),root:null}),u=p.useCallback((h,f,g)=>{if(o.current==null)return;const E=c.box$1.dim(c.box$1.construct(o.current),r);a(S=>ht(S,E,h,n,f,g))},[n,a,r]);p.useEffect(()=>e==null?void 0:e(l.sizeDistribution),[l.sizeDistribution,e]);const d=p.useCallback((h,f)=>{h.preventDefault();const g=r==="x"?"clientX":"clientY",E=R=>u(f,R[g]),S=()=>{a(R=>({...R,root:null})),document.removeEventListener("mousemove",E)};a(R=>({...R,root:h[g]})),document.addEventListener("mousemove",E),document.addEventListener("mouseup",S,{once:!0})},[a,r,ht]);return{setSize:p.useCallback((h,f)=>u(h,void 0,f),[ht]),props:{direction:r,sizeDistribution:l.sizeDistribution,onDragHandle:d,ref:o}}},It=p.forwardRef(({direction:e="x",children:t,sizeDistribution:s,onDragHandle:n,className:r,...o},l)=>{const a=c.direction$1.construct(e),u=p.Children.toArray(t);return i.jsxRuntimeExports.jsx(V.Space,{...o,ref:l,direction:a,className:c.CSS(c.CSS.B("resize-multiple"),r),empty:!0,grow:!0,children:u.map((d,x)=>i.jsxRuntimeExports.jsx(tt,{onDragStart:h=>n(h,x),location:c.direction$1.location(a),size:s[x]*100,sizeUnits:"%",showHandle:x!==u.length-1,children:d},x))})});It.displayName="Resize.Multiple";const Eo=(e,t)=>{const s=e.reduce((r,o)=>r+o,0),n=t-e.length;if(n<=0)return e.slice(0,t).map(r=>r/s);if(e.every(r=>r<=1)){const r=1-s;return[...e,...Array(n).fill(r/n)]}return e.map(()=>1/t)},ht=(e,t,s,n,r,o)=>{const l=Gs(e,t,s,r,o),[a,u]=So(e.sizeDistribution,s,l,n/t),d=u?r??null:e.root;return{...e,sizeDistribution:a,root:d}},Gs=(e,t,s,n,r)=>{let o;if(r!=null)r>1&&(r=r/t),o=r-e.sizeDistribution[s];else if(n!=null){if(e.root===null)throw new Error("resize root is null during handle drag");o=(n-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return o},So=(e,t,s,n)=>{let r=t;for(;r>0&&e[r]+s<=n;)r--;const o=e[r]+s,l=Ro(r,e,n,s),a=e[l]-s;return o<n||a<n?[e,!1]:[e.map((u,d)=>d===r?o:d===l?a:u),!0]},Ro=(e,t,s,n)=>(e===t.length-1?vo:bo)(e,t,s,n),bo=(e,t,s,n)=>{let r=e+1;for(;r<t.length-1&&t[r]-n<=s;)r++;return r},vo=(e,t,s,n)=>{let r=e-1;for(;r>0&&t[r]-n<=s;)r--;return r},pt=2,Us=({onCollapse:e,onResize:t,location:s="left",minSize:n=100,maxSize:r=1/0,initialSize:o=200,collapseThreshold:l=1/0,className:a,...u})=>{const[d,x]=p.useState(c.clamp(o,n,r)),h=p.useRef(null),f=c.location.construct(s),g=p.useCallback(v=>{if(h.current===null)return 0;const y=c.box$1.dim(v,c.location.direction(f),!0)*(1-2*Number(["bottom","right"].includes(f))),k=h.current+y,w=c.clamp(k,n,r);return(w-k)/n>l?pt:w},[f,n,r,l]),E=p.useRef(null),S=p.useCallback(v=>{const y=g(v);x(y),E.current!=null&&(t==null||t(y,c.box$1.construct(E.current)))},[t,g]),R=p.useCallback(()=>x(v=>(h.current=v,v)),[x]),b=p.useCallback(v=>g(v)===pt&&(e==null?void 0:e()),[e,g]);p.useEffect(()=>x(v=>{const y=c.clamp(v,n,r);return h.current=y,y}),[n,r]);const C=et({onMove:S,onStart:R,onEnd:b});return i.jsxRuntimeExports.jsx(tt,{ref:E,location:f,size:d,onDragStart:C,className:c.clsx(a,c.CSS.expanded(d!==pt)),...u})},be="channel",os=(e,t)=>{if(t.current==null)return{display:"none"};const s={},n=c.box$1.construct(t.current.parentElement),r=c.box$1.construct(t.current);return e.x>.8?s.right=`${(1-e.x)*c.box$1.width(n)-c.box$1.width(r)}px`:e.x<.2?s.left=`${e.x*c.box$1.width(n)}px`:s.left=`${e.x*100}%`,e.y>.8?s.bottom=`${(1-e.y)*c.box$1.height(n)-c.box$1.height(r)}px`:e.y<.2?s.top=`${e.y*c.box$1.height(n)}px`:s.top=`${e.y*100}%`,s},Ws=p.memo(({className:e,value:t,onChange:s,style:n,draggable:r=!0,...o})=>{const[l,a]=se.usePurePassthrough({value:t,onChange:s,initial:c.xy.construct(.1,.01)}),u=p.useRef(l),d=m.useSyncedRef(!r),x=p.useRef(null),[h,f]=p.useState({});l!==null&&(n={...n,...h});const g=p.useCallback(R=>{x.current=R,f(os(c.xy.construct(l),x))},[]),E=p.useCallback(R=>{var w;if(((w=x.current)==null?void 0:w.parentElement)==null)return u.current;const b=c.box$1.construct(x.current.parentElement),C=c.box$1.reRoot(c.box$1.DECIMAL,c.location.TOP_LEFT),v=c.scale.XY.scale(b).scale(C),y=v.box(c.box$1.construct(x.current));return c.scale.XY.clamp(c.box$1.construct(c.box$1.topLeft(C),{width:c.box$1.width(C)-c.box$1.width(y),height:c.box$1.height(C)-c.box$1.height(y)})).pos(c.xy.translate(c.xy.construct(u.current),c.box$1.signedDims(v.box(R))))},[]),S=et({onMove:p.useCallback(R=>{if(d.current)return;const b=E(R);f(os(c.xy.construct(b),x))},[a]),onEnd:p.useCallback(R=>{d.current||(u.current=E(R))},[])});return i.jsxRuntimeExports.jsx(V.Space,{className:c.CSS(e,c.CSS.B("legend")),bordered:!0,rounded:!0,style:n,onDragStart:S,draggable:r,ref:g,...o,onDrag:Ge,onDragEnd:Ge,size:"small"})});Ws.displayName="Legend.Container";const Ks=({data:e=[],onEntryChange:t,position:s,onPositionChange:n,...r})=>{const[o,l]=p.useState(!1);return e.length===0?null:i.jsxRuntimeExports.jsx(Ws,{...r,draggable:!o,value:s,onChange:n,children:e.sort((a,u)=>a.label.localeCompare(u.label)).map(({key:a,color:u,label:d})=>i.jsxRuntimeExports.jsxs(V.Space,{style:{cursor:"pointer"},direction:"x",align:"center",children:[i.jsxRuntimeExports.jsx(ws.Swatch,{value:u,onChange:x=>t==null?void 0:t({key:a,color:x,label:d}),onVisibleChange:l,size:"small"}),i.jsxRuntimeExports.jsx(m.MaybeEditable,{level:"small",value:d,onChange:x=>t==null?void 0:t({key:a,color:u,label:x}),noWrap:!0})]},a))})},Co={region:c.box$1.ZERO,dpr:1,os:c.external$1.getOS()},yo={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},wo=m.wrap$1(j.Canvas.TYPE,({children:e,resizeDebounce:t=100,className:s,aetherKey:n,...r})=>{const[{path:o},{bootstrapped:l},a]=m.use$3({aetherKey:n,type:j.Canvas.TYPE,schema:j.canvasStateZ,initialState:Co}),u=p.useRef({...yo}),d=p.useCallback(f=>{u.current.bootstrapped&&a(g=>({bootstrapped:!0,region:f,dpr:window.devicePixelRatio,os:c.external$1.getOS({default:"Windows"})}))},[a]),x=m.useResize(d,{debounce:t}),h=p.useCallback(f=>{if(x(f),f==null)return;f.className.includes("gl")?u.current.gl=f:f.className.includes("upper2d")?u.current.upper2d=f:u.current.lower2d=f;const{gl:g,lower2d:E,upper2d:S,bootstrapped:R}=u.current;if(g==null||E==null||S==null||R)return;u.current.bootstrapped=!0;const b=g.transferControlToOffscreen(),C=S.transferControlToOffscreen(),v=E.transferControlToOffscreen();a({glCanvas:b,upper2dCanvas:C,lower2dCanvas:v,bootstrap:!0,bootstrapped:!1,region:c.box$1.construct(g),dpr:window.devicePixelRatio,os:c.external$1.getOS({default:"Windows"})},[b,C,v])},[a]);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("canvas",{ref:h,className:c.CSS(c.CSS.BM("canvas","lower2d"),s),...r}),i.jsxRuntimeExports.jsx("canvas",{ref:h,className:c.CSS(c.CSS.BM("canvas","gl"),s),...r}),i.jsxRuntimeExports.jsx("canvas",{ref:h,className:c.CSS(c.CSS.BM("canvas","upper2d"),s),...r}),i.jsxRuntimeExports.jsx(m.Composite,{path:o,children:l&&e})]})}),Nt=e=>m.useResize(p.useCallback((t,s)=>{const n=document.querySelector(".pluto-canvas--lower2d");if(n==null)return;const r=c.box$1.construct(n);t=c.scale.XY.translate(c.xy.scale(c.box$1.topLeft(r),-1)).box(t),e(t,s)},[e])),$o=Object.freeze(Object.defineProperty({__proto__:null,Canvas:wo,useRegion:Nt},Symbol.toStringTag,{value:"Module"})),qs=p.createContext(null),Oe=e=>{const t=p.useContext(qs);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Xs=e=>{const t=Oe("Viewport"),{addViewportHandler:s}=t;p.useEffect(()=>s(e),[s,e])},Qs=(e,t)=>{const{setAxis:s,removeAxis:n}=Oe(t),{key:r}=e;return m.useEffectCompare(()=>(c.location.outer.parse(e.loc),s(e),()=>n(e.key)),([a],[u])=>c.external.equal(a,u),[e]),{gridArea:c.direction$1.swap(c.location.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},Mo=m.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:s=0,clearOverscan:n,children:r,hold:o,...l})=>{const[a,u]=p.useState([]),d=m.useMemoDeepEqualProps({clearOverscan:n,hold:o}),[{path:x},{grid:h},f]=m.use$3({aetherKey:e,type:j.LinePlot.TYPE,schema:j.linePlotStateZ,initialState:{container:c.box$1.ZERO,viewport:c.box$1.DECIMAL,grid:[],...d}});p.useEffect(()=>f(M=>({...M,...d})),[d]);const g=p.useRef(new Map),E=p.useCallback(M=>(g.current.set(M,null),()=>g.current.delete(M)),[g]),S=p.useCallback(M=>{const{mode:$,box:B,stage:D}=M;($==="pan"&&D!=="start"||$==="zoom"||$==="zoomReset"&&D==="start")&&f(O=>({...O,viewport:B})),g.current.forEach((O,A)=>A(M))},[f]),R=p.useCallback(M=>f($=>({...$,container:M})),[f]),b=Nt(R),C=p.useCallback(M=>f($=>({...$,grid:[...$.grid.filter(({key:B})=>B!==M.key),M]})),[f]),v=p.useCallback(M=>f($=>({...$,grid:$.grid.filter(({key:B})=>B!==M)})),[f]),y=p.useCallback(M=>u($=>[...$.filter(({key:B})=>B!==M.key),M]),[u]),k=p.useCallback(M=>u($=>$.filter(({key:B})=>B!==M)),[y]),w=To(h),L=p.useMemo(()=>({lines:a,setAxis:C,removeAxis:v,setLine:y,removeLine:k,setViewport:S,addViewportHandler:E}),[a,C,v,y,k,S,E]);return i.jsxRuntimeExports.jsx("div",{className:c.CSS.B("line-plot"),style:{...t,...w},ref:b,...l,children:i.jsxRuntimeExports.jsx(qs.Provider,{value:L,children:i.jsxRuntimeExports.jsx(m.Composite,{path:x,children:r})})})}),To=e=>{const t=c.CSS.newGridBuilder();return j.filterGridPositions("top",e).forEach(({key:s,size:n})=>t.addRow(`axis-start-${s}`,`axis-end-${s}`,n)),t.addRow("plot-start","plot-end","minmax(0, 1fr)"),j.filterGridPositions("bottom",e).forEach(({key:s,size:n})=>t.addRow(`axis-start-${s}`,`axis-end-${s}`,n)),j.filterGridPositions("left",e).forEach(({key:s,size:n})=>t.addColumn(`axis-start-${s}`,`axis-end-${s}`,n)),t.addColumn("plot-start","plot-end","minmax(0, 1fr)"),j.filterGridPositions("right",e).forEach(({key:s,size:n})=>t.addColumn(`axis-start-${s}`,`axis-end-${s}`,n)),t.build()},Js=m.wrap$1("Line",({aetherKey:e,...t})=>{const[,,s]=m.use$3({aetherKey:e,type:j.Line.TYPE,schema:j.stateZ,initialState:t}),n=m.useMemoDeepEqualProps(t);return p.useLayoutEffect(()=>s(n),[n]),null}),ko=Object.freeze(Object.defineProperty({__proto__:null,Line:Js},Symbol.toStringTag,{value:"Module"})),Lo=m.wrap$1("Line",({aetherKey:e,color:t,label:s="",...n})=>{const{setLine:r,removeLine:o}=Oe("Line");return p.useEffect(()=>(r({key:e,color:t,label:s}),()=>o(e)),[s,t]),i.jsxRuntimeExports.jsx(Js,{aetherKey:e,color:t,label:s,...n})}),Po={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},_t=p.forwardRef(({className:e,mode:t,maskBox:s,children:n,style:r,...o},l)=>i.jsxRuntimeExports.jsxs("div",{ref:l,className:c.CSS(c.CSS.noSelect,c.CSS.BE("viewport-mask","container"),e),style:{cursor:Po[t],...r},...o,children:[i.jsxRuntimeExports.jsx("div",{style:{...c.box$1.css(s),display:c.box$1.isZero(s)?"none":"block"},className:c.CSS.BE("viewport-mask","selection")}),n]}));_t.displayName="ZoomPanMask";const Oo=["zoom","pan","select","zoomReset"],Io=[...Oo,"click"],en=["zoom","select"],ze={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},tn={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},sn={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Dt={zoom:ze,pan:tn,select:sn,zoomReset:ze,click:ze},No=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([s,n])=>s==="defaultMode"?[s,n]:[s,n.map(r=>r.filter(o=>o!=="MouseLeft")).filter(r=>r.length>0)]))},_o=c.box$1.construct(0,0,1,1,c.location.TOP_LEFT),Do={width:30,height:30},nn=({onChange:e,triggers:t,initial:s=_o,threshold:n=Do})=>{const r=(t==null?void 0:t.defaultMode)??"zoom",[o,l]=p.useState(c.box$1.ZERO),[a,u]=p.useState(r),[d,x]=m.useStateRef(s),h=p.useRef(null),f=c.dimensions.construct(n);p.useEffect(()=>x(s),[s]),p.useEffect(()=>u(r),[r]);const[g,E,S,R]=m.useMemoCompare(()=>{const y={...Dt[r],...t},k=m.flattenConfig(y),w=No(y);return[y,k,w,m.flattenConfig(w)]},m.compareModeConfigs,[t]),b=p.useCallback(({box:y,triggers:k,stage:w,cursor:L})=>{if(h.current==null)return;const M=m.determineMode(g,k),$=c.box$1.construct(h.current);if(M==null)return;if(M==="zoomReset")return l(c.box$1.ZERO),e==null||e({box:c.box$1.DECIMAL,mode:M,stage:w,cursor:L}),x(c.box$1.DECIMAL);if(w==="end"){if(c.box$1.width(y)<5&&c.box$1.height(y)<5){M==="zoom"&&l(c.box$1.ZERO),e==null||e({box:d.current,mode:"click",stage:w,cursor:L});return}return x(D=>{if(M==="pan"){const A=is(y,D,$);return A===null?D:(e==null||e({box:A,mode:M,stage:w,cursor:L}),A)}const O=C(y,D,$);return O===null?D:(e==null||e({box:O,mode:M,stage:w,cursor:L}),M==="zoom"?(l(c.box$1.ZERO),O):D)})}if(en.includes(M))return c.box$1.height(y)<5&&c.box$1.width(y)<5?void 0:l(c.scale.XY.scale($).clamp($).translate({x:-c.box$1.left($),y:-c.box$1.top($)}).box(ls(f,y,$)));l(D=>c.box$1.isZero(D)?D:c.box$1.ZERO);const B=is(y,d.current,$);e==null||e({box:B,mode:M,stage:w,cursor:L})},[l,u,e,g,n.height,n.width,x,h]),C=p.useCallback((y,k,w)=>rn(k,w).box(ls(f,y,w)),[n]);Rr.useDrag({bound:h,onDrag:b,triggers:E,loose:!0});const v=p.useCallback(({triggers:y,stage:k})=>{if(k==="end")return u(r);const w=m.determineMode(S,y);w!=null&&u(w)},[S,r,e]);return m.use$1({triggers:R,callback:v,region:h}),{maskBox:o,ref:h,mode:a}},rn=(e,t)=>c.scale.XY.scale(t).clamp(t).scale(e),is=(e,t,s)=>{let n=c.box$1.signedDims(rn(t,s).box(e));return n={signedWidth:-n.signedWidth,signedHeight:-n.signedHeight},c.scale.XY.translate(c.xy.construct(n)).box(t)},ls=(e,t,s)=>c.box$1.height(t)<=e.height?c.box$1.construct(c.box$1.left(t),c.box$1.top(s),c.box$1.width(t),c.box$1.height(s)):c.box$1.width(t)<=e.width?c.box$1.construct(c.box$1.left(s),c.box$1.top(t),c.box$1.width(s),c.box$1.height(t)):t,At=p.createContext({columnar:{columns:[],setColumns:()=>{}},sourceData:[],data:[],setTransform:()=>{},deleteTransform:()=>{},setSourceData:()=>{},select:{value:[],onChange:()=>{},onSelect:void 0,setOnSelect:()=>{},clear:void 0,setClear:()=>{}},infinite:{hasMore:!1,setHasMore:()=>{},onFetchMore:void 0,setOnFetchMore:()=>{}},hover:{value:-1,onChange:()=>{}},emptyContent:void 0,setEmptyContent:()=>{}}),ie=()=>p.useContext(At),on=({value:e,children:t})=>i.jsxRuntimeExports.jsx(At.Provider,{value:e,children:t}),mt="sort",Ao=({columns:e})=>{const{columnar:{columns:t,setColumns:s},sourceData:n,setTransform:r,deleteTransform:o}=ie(),l=Qe.useTypography("p").toString(),[a,u]=p.useState([null,!1]),d=x=>{const[h,f]=a;h===x?f?(u([x,!f]),r(mt,cs(x,!f))):(u([null,!1]),o(mt)):(u([x,!0]),r(mt,cs(x,!0)))};return p.useEffect(()=>{s(x=>zo(x.length===0?e:x,n,l))},[l,n,e]),i.jsxRuntimeExports.jsx(V.Space,{direction:"x",size:"medium",className:c.CSS.BE("list-col-header","container"),children:t.filter(({visible:x=!0})=>x).map(({key:x,cWidth:h,name:f})=>{const[g,E]=a;let S;const R=n[0];return x===g&&(S=E?i.jsxRuntimeExports.jsx(m.n0.Caret.Up,{}):i.jsxRuntimeExports.jsx(m.n0.Caret.Down,{})),i.jsxRuntimeExports.jsx(m.WithIcon,{className:c.CSS.BE("list-col-header","item"),justify:"spaceBetween",level:"p",endIcon:S,style:{width:h},shrink:!1,onClick:()=>R!=null&&x in R&&d(x),children:f},x.toString())})})},Vo=({entry:e,selected:t,columns:s,onSelect:n,index:r,hovered:o,...l})=>{const a=()=>n==null?void 0:n(e.key);return i.jsxRuntimeExports.jsx(V.Space,{id:e.key.toString(),className:c.CSS(Ze.CONTEXT_TARGET,c.CSS.BE("list-col-item","container"),n!=null&&c.CSS.BEM("list-col-item","container","selectable"),o&&c.CSS.BEM("list-col-item","container","hovered"),t&&c.CSS.BEM("list-col-item","container","selected"),t&&Ze.CONTEXT_SELECTED),direction:"x",onClick:a,onContextMenu:a,align:"center",...l,size:"medium",children:s.filter(({visible:u=!0})=>u).map(u=>i.jsxRuntimeExports.jsx(Bo,{entry:e,col:u},u.key.toString()))})},Bo=({entry:e,col:{width:t,...s}})=>{const n={width:s.cWidth,userSelect:"none",padding:"1rem",flexShrink:0};if(s.render!=null)return s.render({key:s.key,entry:e,style:n});let r;return s.stringer!=null?r=s.stringer(e):r=e[s.key],i.jsxRuntimeExports.jsx(m.Text,{level:"p",style:n,children:c.convertRenderV(r)},s.key.toString())},zo=(e,t,s)=>{const n=Fo(t,e);return e.map(r=>{if(r.width!=null)r.cWidth=r.width;else{const{width:o}=Ye.dimensions(r.name,s),{width:l}=Ye.dimensions(n[r.key],s);r.cWidth=Math.max(o,l)*1.1}return r})},Fo=(e,t)=>{const s={};return e.forEach(n=>t.forEach(({key:r,stringer:o})=>{const l=n[r];if(l==null)return;const a=o!=null?o(n):l;(!(r in s)||a.length>s[r].length)&&(s[r]=a)})),s},cs=(e,t)=>s=>s.length===0?s:[...s].sort(c.compare.newFieldF(e,s[0],!t)),Fe={Header:Ao,Item:Vo,itemHeight:30};/**
2
+ * react-virtual
3
+ *
4
+ * Copyright (c) TanStack
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},Ue.apply(this,arguments)}/**
11
+ * virtual-core
12
+ *
13
+ * Copyright (c) TanStack
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE.md file in the root directory of this source tree.
17
+ *
18
+ * @license MIT
19
+ */function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},We.apply(this,arguments)}/**
20
+ * virtual-core
21
+ *
22
+ * Copyright (c) TanStack
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE.md file in the root directory of this source tree.
26
+ *
27
+ * @license MIT
28
+ */function Se(e,t,s){var n,r=(n=s.initialDeps)!=null?n:[],o;return function(){var l;s.key&&s.debug!=null&&s.debug()&&(l=Date.now());var a=e(),u=a.length!==r.length||a.some(function(E,S){return r[S]!==E});if(!u)return o;r=a;var d;if(s.key&&s.debug!=null&&s.debug()&&(d=Date.now()),o=t.apply(void 0,a),s.key&&s.debug!=null&&s.debug()){var x=Math.round((Date.now()-l)*100)/100,h=Math.round((Date.now()-d)*100)/100,f=h/16,g=function(S,R){for(S=String(S);S.length<R;)S=" "+S;return S};console.info("%c⏱ "+g(h,5)+" /"+g(x,5)+" ms",`
29
+ font-size: .6rem;
30
+ font-weight: bold;
31
+ color: hsl(`+Math.max(0,Math.min(120-120*f,120))+"deg 100% 31%);",s==null?void 0:s.key)}return s==null||s.onChange==null||s.onChange(o),o}}function ft(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var Zo=function(t,s){return Math.abs(t-s)<1};/**
32
+ * virtual-core
33
+ *
34
+ * Copyright (c) TanStack
35
+ *
36
+ * This source code is licensed under the MIT license found in the
37
+ * LICENSE.md file in the root directory of this source tree.
38
+ *
39
+ * @license MIT
40
+ */var Yo=function(t){return t},Ho=function(t){for(var s=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[],o=s;o<=n;o++)r.push(o);return r},Go=function(t,s){var n=t.scrollElement;if(n){var r=function(a){var u=a.width,d=a.height;s({width:Math.round(u),height:Math.round(d)})};r(n.getBoundingClientRect());var o=new ResizeObserver(function(l){var a=l[0];if(a!=null&&a.borderBoxSize){var u=a.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(n.getBoundingClientRect())});return o.observe(n,{box:"border-box"}),function(){o.unobserve(n)}}},Uo=function(t,s){var n=t.scrollElement;if(n){var r=function(){s(n[t.options.horizontal?"scrollLeft":"scrollTop"])};return r(),n.addEventListener("scroll",r,{passive:!0}),function(){n.removeEventListener("scroll",r)}}},Wo=function(t,s,n){if(s!=null&&s.borderBoxSize){var r=s.borderBoxSize[0];if(r){var o=Math.round(r[n.options.horizontal?"inlineSize":"blockSize"]);return o}}return Math.round(t.getBoundingClientRect()[n.options.horizontal?"width":"height"])},Ko=function(t,s,n){var r,o,l=s.adjustments,a=l===void 0?0:l,u=s.behavior,d=t+a;(r=n.scrollElement)==null||r.scrollTo==null||r.scrollTo((o={},o[n.options.horizontal?"left":"top"]=d,o.behavior=u,o))},qo=function(t){var s=this;this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.isScrollingTimeoutId=null,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=function(){var n=null,r=function(){return n||(typeof ResizeObserver<"u"?n=new ResizeObserver(function(l){l.forEach(function(a){s._measureElement(a.target,a)})}):null)};return{disconnect:function(){var l;return(l=r())==null?void 0:l.disconnect()},observe:function(l){var a;return(a=r())==null?void 0:a.observe(l,{box:"border-box"})},unobserve:function(l){var a;return(a=r())==null?void 0:a.unobserve(l)}}}(),this.range={startIndex:0,endIndex:0},this.setOptions=function(n){Object.entries(n).forEach(function(r){var o=r[0],l=r[1];typeof l>"u"&&delete n[o]}),s.options=We({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Yo,rangeExtractor:Ho,onChange:function(){},measureElement:Wo,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},n)},this.notify=function(){s.options.onChange==null||s.options.onChange(s)},this.cleanup=function(){s.unsubs.filter(Boolean).forEach(function(n){return n()}),s.unsubs=[],s.scrollElement=null},this._didMount=function(){return s.measureElementCache.forEach(s.observer.observe),function(){s.observer.disconnect(),s.cleanup()}},this._willUpdate=function(){var n=s.options.getScrollElement();s.scrollElement!==n&&(s.cleanup(),s.scrollElement=n,s._scrollToOffset(s.scrollOffset,{adjustments:void 0,behavior:void 0}),s.unsubs.push(s.options.observeElementRect(s,function(r){var o=s.scrollRect;s.scrollRect=r,(s.options.horizontal?r.width!==o.width:r.height!==o.height)&&s.maybeNotify()})),s.unsubs.push(s.options.observeElementOffset(s,function(r){s.scrollAdjustments=0,s.scrollOffset!==r&&(s.isScrollingTimeoutId!==null&&(clearTimeout(s.isScrollingTimeoutId),s.isScrollingTimeoutId=null),s.isScrolling=!0,s.scrollDirection=s.scrollOffset<r?"forward":"backward",s.scrollOffset=r,s.maybeNotify(),s.isScrollingTimeoutId=setTimeout(function(){s.isScrollingTimeoutId=null,s.isScrolling=!1,s.scrollDirection=null,s.maybeNotify()},s.options.scrollingDelay))})))},this.getSize=function(){return s.scrollRect[s.options.horizontal?"width":"height"]},this.memoOptions=Se(function(){return[s.options.count,s.options.paddingStart,s.options.scrollMargin,s.options.getItemKey]},function(n,r,o,l){return s.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:l}},{key:!1}),this.getFurthestMeasurement=function(n,r){for(var o=new Map,l=new Map,a=r-1;a>=0;a--){var u=n[a];if(!o.has(u.lane)){var d=l.get(u.lane);if(d==null||u.end>d.end?l.set(u.lane,u):u.end<d.end&&o.set(u.lane,!0),o.size===s.options.lanes)break}}return l.size===s.options.lanes?Array.from(l.values()).sort(function(x,h){return x.end-h.end})[0]:void 0},this.getMeasurements=Se(function(){return[s.memoOptions(),s.itemSizeCache]},function(n,r){var o=n.count,l=n.paddingStart,a=n.scrollMargin,u=n.getItemKey,d=s.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,s.pendingMeasuredCacheIndexes):0;s.pendingMeasuredCacheIndexes=[];for(var x=s.measurementsCache.slice(0,d),h=d;h<o;h++){var f=u(h),g=s.options.lanes===1?x[h-1]:s.getFurthestMeasurement(x,h),E=g?g.end:l+a,S=r.get(f),R=typeof S=="number"?S:s.options.estimateSize(h),b=E+R,C=g?g.lane:h%s.options.lanes;x[h]={index:h,start:E,size:R,end:b,key:f,lane:C}}return s.measurementsCache=x,x},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:function(){return s.options.debug}}),this.calculateRange=Se(function(){return[s.getMeasurements(),s.getSize(),s.scrollOffset]},function(n,r,o){return s.range=Xo({measurements:n,outerSize:r,scrollOffset:o})},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return s.options.debug}}),this.maybeNotify=Se(function(){var n=s.calculateRange();return[n.startIndex,n.endIndex,s.isScrolling]},function(){s.notify()},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:function(){return s.options.debug},initialDeps:[this.range.startIndex,this.range.endIndex,this.isScrolling]}),this.getIndexes=Se(function(){return[s.options.rangeExtractor,s.calculateRange(),s.options.overscan,s.options.count]},function(n,r,o,l){return n(We({},r,{overscan:o,count:l}))},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return s.options.debug}}),this.indexFromElement=function(n){var r=s.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn("Missing attribute name '"+r+"={index}' on measured element."),-1)},this._measureElement=function(n,r){var o,l=s.indexFromElement(n),a=s.measurementsCache[l];if(a){var u=s.measureElementCache.get(a.key);if(!n.isConnected){s.observer.unobserve(n),n===u&&s.measureElementCache.delete(a.key);return}u!==n&&(u&&s.observer.unobserve(u),s.observer.observe(n),s.measureElementCache.set(a.key,n));var d=s.options.measureElement(n,r,s),x=(o=s.itemSizeCache.get(a.key))!=null?o:a.size,h=d-x;h!==0&&(a.start<s.scrollOffset&&(process.env.NODE_ENV!=="production"&&s.options.debug&&console.info("correction",h),s._scrollToOffset(s.scrollOffset,{adjustments:s.scrollAdjustments+=h,behavior:void 0})),s.pendingMeasuredCacheIndexes.push(l),s.itemSizeCache=new Map(s.itemSizeCache.set(a.key,d)),s.notify())}},this.measureElement=function(n){n&&s._measureElement(n,void 0)},this.getVirtualItems=Se(function(){return[s.getIndexes(),s.getMeasurements()]},function(n,r){for(var o=[],l=0,a=n.length;l<a;l++){var u=n[l],d=r[u];o.push(d)}return o},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return s.options.debug}}),this.getVirtualItemForOffset=function(n){var r=s.getMeasurements();return ft(r[ln(0,r.length-1,function(o){return ft(r[o]).start},n)])},this.getOffsetForAlignment=function(n,r){var o=s.getSize();r==="auto"&&(n<=s.scrollOffset?r="start":n>=s.scrollOffset+o?r="end":r="start"),r==="start"?n=n:r==="end"?n=n-o:r==="center"&&(n=n-o/2);var l=s.options.horizontal?"scrollWidth":"scrollHeight",a=s.scrollElement?"document"in s.scrollElement?s.scrollElement.document.documentElement[l]:s.scrollElement[l]:0,u=a-s.getSize();return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=function(n,r){r===void 0&&(r="auto"),n=Math.max(0,Math.min(n,s.options.count-1));var o=ft(s.getMeasurements()[n]);if(r==="auto")if(o.end>=s.scrollOffset+s.getSize()-s.options.scrollPaddingEnd)r="end";else if(o.start<=s.scrollOffset+s.options.scrollPaddingStart)r="start";else return[s.scrollOffset,r];var l=r==="end"?o.end+s.options.scrollPaddingEnd:o.start-s.options.scrollPaddingStart;return[s.getOffsetForAlignment(l,r),r]},this.isDynamicMode=function(){return s.measureElementCache.size>0},this.cancelScrollToIndex=function(){s.scrollToIndexTimeoutId!==null&&(clearTimeout(s.scrollToIndexTimeoutId),s.scrollToIndexTimeoutId=null)},this.scrollToOffset=function(n,r){var o=r===void 0?{}:r,l=o.align,a=l===void 0?"start":l,u=o.behavior;s.cancelScrollToIndex(),u==="smooth"&&s.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),s._scrollToOffset(s.getOffsetForAlignment(n,a),{adjustments:void 0,behavior:u})},this.scrollToIndex=function(n,r){var o=r===void 0?{}:r,l=o.align,a=l===void 0?"auto":l,u=o.behavior;n=Math.max(0,Math.min(n,s.options.count-1)),s.cancelScrollToIndex(),u==="smooth"&&s.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");var d=s.getOffsetForIndex(n,a),x=d[0],h=d[1];s._scrollToOffset(x,{adjustments:void 0,behavior:u}),u!=="smooth"&&s.isDynamicMode()&&(s.scrollToIndexTimeoutId=setTimeout(function(){s.scrollToIndexTimeoutId=null;var f=s.measureElementCache.has(s.options.getItemKey(n));if(f){var g=s.getOffsetForIndex(n,h),E=g[0];Zo(E,s.scrollOffset)||s.scrollToIndex(n,{align:h,behavior:u})}else s.scrollToIndex(n,{align:h,behavior:u})}))},this.scrollBy=function(n,r){var o=r===void 0?{}:r,l=o.behavior;s.cancelScrollToIndex(),l==="smooth"&&s.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),s._scrollToOffset(s.scrollOffset+n,{adjustments:void 0,behavior:l})},this.getTotalSize=function(){var n;return(((n=s.getMeasurements()[s.options.count-1])==null?void 0:n.end)||s.options.paddingStart)-s.options.scrollMargin+s.options.paddingEnd},this._scrollToOffset=function(n,r){var o=r.adjustments,l=r.behavior;s.options.scrollToFn(n,{behavior:l,adjustments:o},s)},this.measure=function(){s.itemSizeCache=new Map,s.notify()},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(function(n){s.itemSizeCache.set(n.key,n.size)}),this.maybeNotify()},ln=function(t,s,n,r){for(;t<=s;){var o=(t+s)/2|0,l=n(o);if(l<r)t=o+1;else if(l>r)s=o-1;else return o}return t>0?t-1:0};function Xo(e){for(var t=e.measurements,s=e.outerSize,n=e.scrollOffset,r=t.length-1,o=function(d){return t[d].start},l=ln(0,r,o,n),a=l;a<r&&t[a].end<n+s;)a++;return{startIndex:l,endIndex:a}}/**
41
+ * react-virtual
42
+ *
43
+ * Copyright (c) TanStack
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */var Qo=typeof document<"u"?ke.useLayoutEffect:ke.useEffect;function Jo(e){var t=ke.useReducer(function(){return{}},{})[1],s=Ue({},e,{onChange:function(l){t(),e.onChange==null||e.onChange(l)}}),n=ke.useState(function(){return new qo(s)}),r=n[0];return r.setOptions(s),ke.useEffect(function(){return r._didMount()},[]),Qo(function(){return r._willUpdate()}),r}function ei(e){return Jo(Ue({observeElementRect:Go,observeElementOffset:Uo,scrollToFn:Ko},e))}const ti=({itemHeight:e,children:t,overscan:s=5,className:n,...r})=>{var S;if(e<=0)throw new Error("itemHeight must be greater than 0");const{data:o,emptyContent:l,columnar:{columns:a},hover:u,select:d,infinite:{hasMore:x,onFetchMore:h}}=ie(),f=p.useRef(null),g=ei({count:o.length,getScrollElement:()=>f.current,estimateSize:()=>e,overscan:s}),E=g.getVirtualItems();return((S=E.at(-1))==null?void 0:S.index)===o.length-1&&x&&(h==null||h()),i.jsxRuntimeExports.jsx("div",{ref:f,className:c.CSS(n,c.CSS.BE("list","container")),...r,children:o.length===0?l:i.jsxRuntimeExports.jsx("div",{style:{height:g.getTotalSize()},children:E.map(({index:R,start:b})=>{const C=o[R];return t({key:C.key,index:R,onSelect:d.onSelect,entry:C,columns:a,selected:d.value.includes(C.key),hovered:R===u.value,style:{transform:`translateY(${b}px)`,position:"absolute"}})})})})},Le=e=>{const{data:t,emptyContent:s,columnar:n,hover:r,select:o}=ie();return i.jsxRuntimeExports.jsx(V.Space,{className:c.CSS.BE("list","container"),...e,empty:!0,children:t.length===0?s:i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:t.map((l,a)=>e.children({key:l.key.toString(),index:a,onSelect:o.onSelect,entry:l,columns:n.columns,selected:o.value.includes(l.key),hovered:a===r.value,style:{}}))})})};Le.Virtual=ti;const as=["ArrowUp"],us=["ArrowDown"],ds=["Enter"],cn=e=>{const{data:t,select:{onSelect:s},hover:{value:n,onChange:r}}=ie(),o=p.useRef(n),l=p.useCallback(({triggers:a,stage:u})=>{u==="start"&&(m.match(a,[as])?r(d=>{const x=d===0?t.length-1:d-1;return o.current=x,x}):m.match(a,[us])?r(d=>{const x=d===t.length-1?0:d+1;return o.current=x,x}):m.match(a,[ds])&&(s==null||s(t[o.current].key)))},[t,s]);return m.use$1({triggers:[as,us,ds],callback:l,loose:!0}),null},an={height:150},xs=i.jsxRuntimeExports.jsx(m.Text$2.Centered,{level:"h4",variant:"disabled",hideIcon:!0,style:an,children:"No Results"}),hs=i.jsxRuntimeExports.jsx(m.Text$2.Centered,{level:"h4",variant:"disabled",hideIcon:!0,style:an,children:"Type to search..."}),Vt=({debounce:e=250,children:t=m.componentRenderProp(m.Text$1),searcher:s,value:n,onChange:r,pageSize:o=10})=>{const[l,a]=se.usePurePassthrough({value:n,onChange:r,initial:""}),u=m.useSyncedRef(l),d=p.useRef(!1),x=p.useRef(!0),h=p.useRef(0),{setSourceData:f,setEmptyContent:g,infinite:{setOnFetchMore:E,setHasMore:S}}=ie();p.useEffect(()=>g(hs),[g]);const R=p.useCallback(()=>{u.current.length>0||d.current||s==null||(d.current=!0,s.page(h.current,o).then(v=>{d.current=!1,v.length<o&&(x.current=!1,S(!1)),h.current+=o,f(y=>[...y,...v])}).catch(v=>{d.current=!1,console.error(v)}))},[s,f,o]);p.useEffect(()=>{E(R)},[R]),p.useEffect(()=>{R()},[]);const b=Je(v=>{if(s==null)return g(xs);s.search(v).then(y=>{y.length===0?g(xs):f(y)}).catch(y=>{g(i.jsxRuntimeExports.jsx(m.Text$2.Centered,{level:"h4",variant:"error",children:y.message}))})},e,[s,f,g]),C=p.useCallback(v=>{a(v),v.length===0?g(hs):b(v)},[a,b]);return t({value:l,onChange:C})},Bt=({children:e=r=>i.jsxRuntimeExports.jsx(m.Text$1,{...r}),debounce:t=250,onChange:s,value:n})=>{const[r,o]=se.usePurePassthrough({onChange:s,value:n,initial:""}),{setTransform:l,deleteTransform:a}=ie(),u=Je(l,t,[]),d=p.useCallback(x=>{o(x),x.length===0?a("filter"):u("filter",Zs({term:x}))},[o]);return e({value:r,onChange:d})},st=({children:e,data:t,emptyContent:s})=>{const[n,r]=p.useState([]),[o,l]=p.useState([]),[a,u]=p.useState(-1),[d,x]=p.useState(void 0),[h,f]=p.useState(void 0),{transform:g,setTransform:E,deleteTransform:S}=Ys({}),[R,b]=p.useState(()=>t??[]);p.useEffect(()=>{t!=null&&b(t)},[t]);const C=p.useMemo(()=>g(R),[R,g]),[v,y]=p.useState(s),[k,w]=m.useStateRef(()=>{}),[L,M]=p.useState(!0),$=p.useCallback(D=>w(()=>D),[w]),B=p.useCallback(()=>{var D;return(D=k.current)==null?void 0:D.call(k)},[k]);return i.jsxRuntimeExports.jsx(on,{value:{setEmptyContent:y,sourceData:R,data:C,setSourceData:b,deleteTransform:S,setTransform:E,hover:{value:a,onChange:u},emptyContent:s??v,columnar:{columns:n,setColumns:r},select:{value:o,onChange:l,setOnSelect:x,onSelect:d,clear:h,setClear:f},infinite:{onFetchMore:B,setOnFetchMore:$,hasMore:L,setHasMore:M}},children:e})},zt=({value:e,...t})=>{const{data:s,select:{setOnSelect:n,setClear:r,onChange:o}}=ie(),{onSelect:l,clear:a}=$s.useSelectMultiple({data:s,value:e,...t});return p.useEffect(()=>{n(()=>l),r(()=>a)},[l,a]),p.useEffect(()=>{o(e)},[e]),null},un=e=>i.jsxRuntimeExports.jsx(m.Icon,{className:c.CSS.BE("select","clear"),variant:"outlined",...e,children:i.jsxRuntimeExports.jsx(m.n0.Close,{"aria-label":"clear"})}),dn=({value:e,onChange:t,allowMultiple:s,visible:n,...r})=>i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(zt,{value:e,onChange:t,allowMultiple:s}),n&&i.jsxRuntimeExports.jsx(cn,{}),i.jsxRuntimeExports.jsx(Fe.Header,{...r}),i.jsxRuntimeExports.jsx(Le.Virtual,{itemHeight:Fe.itemHeight,children:m.componentRenderProp(Fe.Item)})]}),Ft=({children:e="",size:t="medium",variant:s="filled",color:n,icon:r,onClose:o,onDragStart:l,...a})=>{const u=c.cssString(n);r==null&&n!=null&&(r=i.jsxRuntimeExports.jsx(m.n0.Circle,{fill:u}));const d=o==null?void 0:i.jsxRuntimeExports.jsx(m.Icon,{"aria-label":"close",size:t,className:c.CSS.BE("tag","close"),onClick:x=>{x.stopPropagation(),o()},children:i.jsxRuntimeExports.jsx(m.n0.Close,{})});return i.jsxRuntimeExports.jsx(m.WithIcon,{startIcon:r,endIcon:d,className:c.CSS(c.CSS.B("tag"),o!=null&&c.CSS.BM("tag","closeable")),level:se.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:l,...a,children:e})},si=Object.freeze(Object.defineProperty({__proto__:null,Tag:Ft},Symbol.toStringTag,{value:"Module"})),xn=({onChange:e,value:t,location:s,className:n,data:r,columns:o=[],tagKey:l="key",emptyContent:a,searcher:u,renderTag:d,placeholder:x,onTagDragStart:h,onTagDragEnd:f,style:g,...E})=>{const{ref:S,visible:R,open:b}=m.use$2(),[C,v]=p.useState([]),y=u!=null;m.useAsyncEffect(async()=>{const L=C.map($=>$.key);if(t.length===0)return v([]);if(c.compare.primitiveArrays(L,t)===c.compare.EQUAL)return;const M=y?await u.retrieve(t):(r==null?void 0:r.filter($=>t.includes($.key)))??[];v(M)},[u,y,t,r]);const k=p.useCallback((L,M)=>{v(M.entries),e(L)},[e]),w=p.useMemo(()=>y?Vt:Bt,[y]);return i.jsxRuntimeExports.jsx(st,{data:r,emptyContent:a,children:i.jsxRuntimeExports.jsxs(m.Dialog,{ref:S,visible:R,location:s,...E,matchTriggerWidth:!0,children:[i.jsxRuntimeExports.jsx(w,{searcher:u,children:({onChange:L})=>i.jsxRuntimeExports.jsx(ni,{className:n,onChange:L,selected:C,onFocus:b,tagKey:l,visible:R,renderTag:d,placeholder:x,onTagDragStart:h,onTagDragEnd:f,style:g})}),i.jsxRuntimeExports.jsx(dn,{visible:R,value:t,onChange:k,columns:o,allowMultiple:!0})]})})},ni=({selected:e,onChange:t,onFocus:s,visible:n,tagKey:r,renderTag:o=m.componentRenderProp(ri),placeholder:l="Search...",onTagDragStart:a,onTagDragEnd:u,className:d,...x})=>{const{select:{onSelect:h,clear:f}}=ie(),[g,E]=p.useState(""),S=p.useRef(null);p.useLayoutEffect(()=>{var b;n?(b=S.current)==null||b.focus():E("")},[n,e]);const R=b=>{E(b),t(b)};return i.jsxRuntimeExports.jsxs(m.Text$1,{ref:S,className:c.CSS(c.CSS.BE("select-multiple","input"),c.CSS.visible(n),d),placeholder:l,value:g,onChange:R,onFocus:s,...x,children:[i.jsxRuntimeExports.jsx(V.Space,{direction:"x",className:c.CSS.BE("select-multiple","tags"),align:"center",grow:!0,children:e.map((b,C)=>o({key:b.key,tagKey:r,entry:b,onClose:()=>h==null?void 0:h(b.key),onDragStart:v=>a==null?void 0:a(v,b.key),onDragEnd:v=>u==null?void 0:u(v,b.key)}))}),i.jsxRuntimeExports.jsx(un,{onClick:f})]})},ri=({tagKey:e,entry:t,...s})=>{const n=typeof e=="function"?e(t):t[e];return p.createElement(Ft,{size:"small",variant:"outlined",draggable:!0,...s,key:n.toString()},c.convertRenderV(n))},hn=({onChange:e,value:t,tagKey:s="key",columns:n=[],data:r,emptyContent:o,inputProps:l,allowClear:a=!0,searcher:u,className:d,variant:x,...h})=>{const{ref:f,visible:g,open:E,close:S}=m.use$2(),R=p.useRef(t),[b,C]=p.useState(null),v=u!=null;m.useAsyncEffect(async()=>{if(u==null||(b==null?void 0:b.key)===t||c.primitiveIsZero(t))return;const[w]=await u.retrieve([t]);C(w??null)},[u,t]),p.useEffect(()=>{(b==null?void 0:b.key)!==t&&C((r==null?void 0:r.find(w=>w.key===t))??null)},[t]);const y=p.useCallback(([w],L)=>{if(S(),w==null)return a?(C(null),e(R.current)):void 0;C(L.entries[0]),e(w)},[e,a]),k=p.useMemo(()=>v?Vt:Bt,[v]);return i.jsxRuntimeExports.jsx(st,{data:r,emptyContent:o,children:i.jsxRuntimeExports.jsxs(m.Dialog,{ref:f,visible:g,className:c.CSS.B("select"),matchTriggerWidth:!0,...h,children:[i.jsxRuntimeExports.jsx(k,{searcher:u,children:({onChange:w})=>i.jsxRuntimeExports.jsx(oi,{variant:x,onChange:w,onFocus:E,selected:b,tagKey:s,visible:g,allowClear:a,className:d})}),i.jsxRuntimeExports.jsx(dn,{visible:g,value:[t],onChange:y,allowMultiple:!1,columns:n})]})})},oi=({tagKey:e,selected:t,visible:s,onChange:n,onFocus:r,allowClear:o=!0,debounceSearch:l=250,className:a,...u})=>{const{select:{clear:d}}=ie(),[x,h]=p.useState("");p.useEffect(()=>{if(!s){if(c.primitiveIsZero(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 f=S=>{n(S),h(S)},g=S=>{h(""),r==null||r(S)},E=()=>{h(""),d==null||d()};return i.jsxRuntimeExports.jsx(m.Text$1,{className:c.CSS(c.CSS.BE("select","input"),a),value:x,onChange:f,onFocus:g,style:{flexGrow:1},...u,children:o&&i.jsxRuntimeExports.jsx(un,{onClick:E})})},pn=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,ii=({children:e,initial:t=c.box$1.DECIMAL,onChange:s,...n})=>{const{setViewport:r}=Oe("Viewport");p.useLayoutEffect(()=>{r({box:t,mode:"zoom",cursor:c.xy.ZERO,stage:"start"})},[r,t]);const o=p.useCallback(a=>{r(a),s==null||s(a)},[s,r]),l=nn({onChange:o,initial:t,...n});return i.jsxRuntimeExports.jsx(_t,{className:c.CSS.BE("line-plot","viewport"),...l,children:e})},Zt=e=>{const t=e==="x"?"bottom":"left",s=e==="x"?j.XAxis.TYPE:j.YAxis.TYPE,n=`${e}-axis`;return m.wrap$1(s,({aetherKey:r,children:o,resizeDebounce:l=0,location:a=t,label:u="",labelLevel:d="small",labelDirection:x=e,onLabelChange:h,color:f,labelSize:g,showGrid:E,type:S,bounds:R,className:b,tickSpacing:C,autoBounds:v,autoBoundUpdateInterval:y,onAutoBoundsChange:k,style:w,...L})=>{const M=((u==null?void 0:u.length)??0)>0,$=m.useMemoDeepEqualProps({location:a,showGrid:E,type:S,bounds:R,label:u,labelDirection:x,tickSpacing:C,autoBounds:v,autoBoundUpdateInterval:y}),[{path:B},{size:D,labelSize:O,...A},_]=m.use$3({aetherKey:r,type:s,schema:j.coreAxisStateZ,initialState:$});p.useEffect(()=>_(K=>({...K,...$})),[$]),p.useEffect(()=>{const{lower:K,upper:H}=j.parseAutoBounds(A.autoBounds);A.bounds!=null&&(K&&(R==null?void 0:R.lower)!==A.bounds.lower||H&&(R==null?void 0:R.upper)!==A.bounds.upper)&&(k==null||k(A.bounds))},[A.autoBounds,A.bounds]);const U=Qs({loc:a,key:r,size:D+O,order:"last"},"XAxis"),Y=Qe.useTypography(d).toString(),W=p.useRef(0);return p.useEffect(()=>{if(e==="y"){if(u==null)return;let H=Ye.dimensions(u,Y)[c.direction$1.dimension(c.direction$1.construct(x))];H>0&&(H+=6),_(Ee=>({...Ee,labelSize:H}))}else{const H=Ye.dimensions(u,Y).height+12,Ee=W.current;j.withinSizeThreshold(Ee,H)||(W.current=H,_(dt=>({...dt,labelSize:H})))}},[u,x,Y]),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(V.Space,{className:c.CSS(b,c.CSS.B("axis"),c.CSS.B(n),c.CSS.loc(a)),style:{...w,...U},align:"center",justify:e==="x"?"end":"start",direction:c.direction$1.swap(e),...L,children:M&&i.jsxRuntimeExports.jsx(m.MaybeEditable,{className:c.CSS(c.CSS.BE("axis","label"),c.CSS.dir(x)),value:u,onChange:h,level:d})}),i.jsxRuntimeExports.jsx(m.Composite,{path:B,children:o})]})})},li=Zt("x"),ci=Zt("y"),ai=m.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=m.use$3({aetherKey:e,type:j.Tooltip.TYPE,schema:j.tooltipStateZ,initialState:{position:null}}),s=p.useRef(null),n=p.useCallback(o=>t({position:c.xy.construct(o)}),[t]),r=p.useCallback(()=>t({position:null}),[t]);return p.useEffect(()=>{if(s.current===null)return;const o=s.current.parentElement;if(o!=null)return o.addEventListener("mousemove",n),o.addEventListener("mouseleave",r),()=>{o.removeEventListener("mousemove",n),o.removeEventListener("mouseleave",r)}},[n]),i.jsxRuntimeExports.jsx("span",{ref:s})}),mn={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},ui=m.flattenConfig(mn),fn=m.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=m.use$3({aetherKey:e,type:j.Measure.TYPE,schema:j.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=p.useRef(null),n=m.useHeldRef({triggers:ui,loose:!0}),r=p.useCallback(({mode:a,cursor:u})=>{if(a==="click"){const d=m.determineMode(mn,n.current.triggers,!0);if(["one","two"].includes(d))return t(x=>({...x,[d]:u}));t(d==="clear"?x=>({...x,one:null,two:null}):x=>({...x,one:x.one??u,two:x.one!==null?u:x.two}))}},[t,n]);Xs(r);const o=p.useCallback(a=>t(u=>({...u,hover:c.xy.construct(a)})),[t]),l=p.useCallback(()=>{t(a=>({...a,hover:null}))},[t]);return p.useEffect(()=>{if(s.current===null)return;const a=s.current.parentElement;if(a!=null)return a.addEventListener("mousemove",o),a.addEventListener("mouseleave",l),()=>{a.removeEventListener("mousemove",o),a.removeEventListener("mouseleave",l)}},[r]),i.jsxRuntimeExports.jsx("span",{ref:s})}),di=Object.freeze(Object.defineProperty({__proto__:null,Measure:fn},Symbol.toStringTag,{value:"Module"})),gn=m.wrap$1("Rule",({aetherKey:e,label:t,position:s,onLabelChange:n,onPositionChange:r,units:o="",color:l,lineWidth:a,lineDash:u})=>{const[d,x]=se.usePurePassthrough({value:t,onChange:n,initial:""}),[,{position:h,pixelPosition:f},g]=m.use$3({aetherKey:e,type:j.Rule.TYPE,schema:j.ruleStateZ,initialState:{color:l,dragging:!1,position:s,lineWidth:a,lineDash:u}});p.useEffect(()=>{if(h==null)return;if(s==null)return r==null?void 0:r(h);const y=c.bounds.construct(h+.01,h-.01);s!=null&&!c.bounds.contains(y,s)&&(r==null||r(Math.trunc(h*100)/100))},[h]);const E=p.useRef(f);f!==E.current&&(E.current=f);const S=p.useRef(f);p.useEffect(()=>{g(y=>({...y,position:s,color:l,lineWidth:a,lineDash:u}))},[s,l,a,u]);const R=et({onStart:p.useCallback(()=>{g(y=>({...y,dragging:!0})),S.current=E.current},[]),onMove:y=>{g(k=>({...k,pixelPosition:(S.current??0)+c.box$1.signedHeight(y)}))},onEnd:p.useCallback(()=>{g(y=>({...y,dragging:!1})),S.current=f},[])}),b=p.useRef(null);if(h==null||f==null)return null;const C=pn(b==null?void 0:b.current),v=i.jsxRuntimeExports.jsxs("div",{ref:b,className:c.CSS.B("rule"),style:{top:`calc(${f}px - 0.5rem)`},children:[i.jsxRuntimeExports.jsx("div",{className:c.CSS.BE("rule","drag-handle"),onDragStart:R,draggable:!0}),i.jsxRuntimeExports.jsxs(V.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[i.jsxRuntimeExports.jsx(m.Editable,{level:"p",value:d,onChange:x}),i.jsxRuntimeExports.jsx(m.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${h.toFixed(2)} ${o}`})]})]});return C==null?v:br.createPortal(v,C)}),xi=Object.freeze(Object.defineProperty({__proto__:null,Rule:gn},Symbol.toStringTag,{value:"Module"})),Yt=p.createContext(j.ZERO_CONTEXT_VALUE),Ie=()=>p.useContext(Yt).synnax,hi=()=>p.useContext(Yt).state,ps={connected:"success",connecting:"info",disconnected:"info",failed:"error"},jn=m.wrap$1(j.Provider.TYPE,({aetherKey:e,connParams:t,children:s})=>{const[n,r,o]=m.useCombinedStateAndRef(j.ZERO_CONTEXT_VALUE),[{path:l},,a]=m.use$3({aetherKey:e,type:j.Provider.TYPE,schema:j.Provider.stateZ,initialState:{props:t??null,state:null}}),u=m.useAggregator(),d=p.useCallback(x=>{o.current.state.status!==x.status&&u({variant:ps[x.status],message:x.message??c.Case.capitalize(x.status)}),r(h=>({...h,state:x}))},[u]);return m.useAsyncEffect(async()=>{if(n.synnax!=null&&n.synnax.close(),t==null)return r(j.ZERO_CONTEXT_VALUE);const x=new se.Synnax({...t,connectivityPollFrequency:se.TimeSpan.seconds(5)}),h=await x.connectivity.check();return r({synnax:x,state:h}),u({variant:ps[h.status],message:h.message??h.status.toUpperCase()}),x.connectivity.onChange(d),a({props:t,state:h}),()=>{x.close(),r(j.ZERO_CONTEXT_VALUE),a({props:null,state:null})}},[t,d]),i.jsxRuntimeExports.jsx(Yt.Provider,{value:n,children:i.jsxRuntimeExports.jsx(m.Composite,{path:l,children:s})})}),pi=Object.freeze(Object.defineProperty({__proto__:null,Provider:jn,use:Ie,useConnectionState:hi},Symbol.toStringTag,{value:"Module"})),Ce=p.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),En=()=>p.useContext(Ce),Sn=e=>{const{aliases:t}=p.useContext(Ce);return t[e]??null},nt=()=>{const{aliases:e}=p.useContext(Ce);return e},Rn=(e,t="")=>{const{getName:s}=p.useContext(Ce),[n,r]=p.useState(t);return m.useAsyncEffect(async()=>{const o=await s(e);o!=null&&r(o)},[e,s]),n},Ht=()=>{const{activeRange:e}=p.useContext(Ce);return e??void 0},mi=({activeRange:e,children:t})=>{const s=Ie(),[n,r]=p.useState({}),o=p.useCallback(u=>{r(d=>{const x={...d};return u.forEach(({variant:h,key:f,value:g})=>{const E=Number(f.split("---")[1]);h==="delete"?delete x[E]:x[g.channel]=g.alias}),x})},[r]),l=p.useCallback(async(u,d)=>{if(s==null||e==null)return;await(await s.ranges.retrieve(e)).setAlias(u,d)},[s,e]),a=p.useCallback(async u=>{if(s==null||u===0)return;const d=n[u];return d??(await s.channels.retrieve(u)).name},[n,s]);return m.useAsyncEffect(async()=>{if(s==null||e==null){r({});return}const u=await s.ranges.retrieve(e),d=await u.listAliases();r(d);const x=await u.openAliasTracker(),h=x.onChange(o);return()=>{h(),x.close()}},[s,e]),i.jsxRuntimeExports.jsx(Ce.Provider,{value:{aliases:n,activeRange:e,setAlias:e!=null?l:null,getName:a},children:t})},fi=({channelKey:e,value:t,shadow:s,className:n,...r})=>{const[o,l]=p.useState(!1),{setAlias:a}=En(),u=Sn(e),d=Rn(e);let x=i.jsxRuntimeExports.jsx(m.n0.Rename,{});o?x=i.jsxRuntimeExports.jsx(m.n0.Loading,{}):u===t&&(x=i.jsxRuntimeExports.jsx(m.n0.Check,{}));const h=a!=null&&!o&&u!==t&&e!==0,f=()=>{h&&(async()=>(l(!0),await a(e,t),l(!1)))()},g=()=>{var S;u!=null&&((S=r.onChange)==null||S.call(r,u))},E=()=>e===0?i.jsxRuntimeExports.jsx(m.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):a==null?i.jsxRuntimeExports.jsx(m.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?i.jsxRuntimeExports.jsx(m.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):u===t?i.jsxRuntimeExports.jsx(m.Text,{level:"small",children:"Alias synced with this label"}):i.jsxRuntimeExports.jsxs(m.Text,{level:"small",children:["Sync alias for ",d," with this label"]});return i.jsxRuntimeExports.jsxs(m.Text$1,{value:t,...r,children:[h&&i.jsxRuntimeExports.jsx(m.Icon,{onClick:g,tooltip:i.jsxRuntimeExports.jsxs(m.Text,{level:"small",children:["Set ",d," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:i.jsxRuntimeExports.jsx(m.n0.Sync,{})}),i.jsxRuntimeExports.jsx(m.Icon,{onClick:f,disabled:!h,tooltip:i.jsxRuntimeExports.jsx(E,{}),tooltipLocation:{y:"top"},variant:"outlined",children:x})]})},ms=[{key:"name",name:"Name"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],Ke=({items:e},t)=>{const s=m.filterByType(be,e);return s.length>0&&!s.every(n=>t.includes(n.key))},bn=["name"],vn=e=>{const t=nt();return p.useMemo(()=>e.length===0?ms:ms.filter(s=>e.includes(s.key)).map(s=>s.key==="name"?{...s,stringer:n=>t[n.key]??n.name}:s),[e,t])},gi=({columns:e=bn,onChange:t,value:s,className:n,...r})=>{const o=Ie(),l=nt(),a=vn(e),u=Ht(),d=p.useMemo(()=>o==null?void 0:o.channels.newSearcherUnderRange(u),[o,u]),x=o!=null?void 0:i.jsxRuntimeExports.jsx(m.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:h,onDragEnd:f,...g}=m.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:p.useCallback(C=>Ke(C,s),[s]),onDrop:p.useCallback(({items:C})=>{const v=m.filterByType(be,C);return v.length===0?[]:(t(c.unique([...s,...v.map(y=>y.key)])),v)},[t,s])}),E=m.useDraggingState(),S=p.useCallback(({dropped:C})=>{t(s.filter(v=>!C.some(y=>y.key===v)))},[t,s]),R=p.useCallback((C,v)=>h([{key:v,type:be}],S),[h,S]),b=p.useCallback(C=>l[C.key]??C.name,[l]);return i.jsxRuntimeExports.jsx(xn,{className:c.CSS(n,c.CSS.dropRegion(Ke(E,s))),value:s,onTagDragStart:R,onTagDragEnd:f,searcher:d,onChange:t,columns:a,emptyContent:x,tagKey:b,...g,...r})},Pe=({columns:e=bn,onChange:t,value:s,className:n,...r})=>{const o=Ie(),l=nt(),a=vn(e),u=Ht(),d=p.useMemo(()=>o==null?void 0:o.channels.newSearcherUnderRange(u),[o,u]),x=o!=null?void 0:i.jsxRuntimeExports.jsx(m.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),h=p.useId(),f=p.useMemo(()=>({key:h,type:"Channel.SelectMultiple"}),[h]),{startDrag:g,onDragEnd:E,...S}=m.useDragAndDrop({type:"Channel.SelectSingle",canDrop:p.useCallback(v=>Ke(v,[s]),[s]),onDrop:p.useCallback(({items:v})=>{const y=m.filterByType(be,v);return y.length===0?[]:(t(y[0].key),y)},[f,t])}),R=m.useDraggingState(),b=p.useCallback(()=>g([{type:be,key:s}]),[g,s]),C=p.useCallback(v=>l[v.key]??v.name,[l]);return i.jsxRuntimeExports.jsx(hn,{className:c.CSS(n,c.CSS.dropRegion(Ke(R,[s]))),value:s,onDragStart:b,onDragEnd:E,onChange:t,searcher:d,columns:a,emptyContent:x,tagKey:C,...S,...r})},qe=p.memo(e=>{const{onResize:t,...s}=e,{root:{tabs:n,direction:r,first:o,last:l,key:a,size:u},emptyContent:d,...x}=s,h=p.useCallback(([E])=>t(a,E),[t]),{props:f}=Hs({direction:r,onResize:h,count:2,initialSizes:u!=null?[u]:void 0});let g;return n!==void 0?g=i.jsxRuntimeExports.jsx(Cn,{emptyContent:d,...s}):o!=null&&l!=null?g=i.jsxRuntimeExports.jsxs(It,{align:"stretch",className:c.CSS.BE("mosaic","resize"),...f,children:[i.jsxRuntimeExports.jsx(qe,{...x,root:o,onResize:t},o.key),i.jsxRuntimeExports.jsx(qe,{...x,root:l,onResize:t},l.key)]}):(g=null,console.warn("Mosaic tree is malformed")),a===1?i.jsxRuntimeExports.jsx(m.Provider$2,{children:g}):g});qe.displayName="Mosaic";const Xe="pluto-mosaic-tab-drop",Gt="pluto-mosaic-tab-create",ji=(e,t)=>{const s=m.filterByType(Xe,t).map(o=>o.key),n=e.filter(o=>!s.includes(o.tabKey)).length>0;return m.filterByType(Gt,t).length>0||s.length>0&&(n||e.length===0)},Cn=p.memo(({root:e,onDrop:t,onCreate:s,...n})=>{const{key:r,tabs:o}=e,[l,a]=p.useState(null),u=p.useCallback(({items:R})=>ji(o,R),[o]),d=p.useCallback(({items:R,event:b})=>{a(null);const C=m.filterByType(Xe,R),v=o.length===0?"center":gs(fs(b));if(C.length>0){const k=C.map(({key:w})=>w)[0];t(r,k,v)}const y=m.filterByType(Gt,R);if(y.length>0){const k=y.map(({key:w})=>w);s==null||s(r,v,k)}return C},[t,o.length]),x=p.useCallback(({event:R})=>{const b=o.length===0?"center":gs(fs(R));a(b)},[o.length]),{startDrag:h,...f}=m.useDragAndDrop({type:"Mosaic",canDrop:u,onDrop:d,onDragOver:x}),g=p.useCallback(()=>a(null),[]),E=p.useCallback((R,{tabKey:b})=>h([{key:b,type:Xe}]),[h]),S=p.useCallback(()=>s==null?void 0:s(r,"center"),[r]);return i.jsxRuntimeExports.jsxs("div",{className:c.CSS.BE("mosaic","leaf"),children:[i.jsxRuntimeExports.jsx(le.Tabs,{tabs:o,onDragLeave:g,selected:e.selected,onDragStart:E,onCreate:S,...n,...f}),l!=null&&i.jsxRuntimeExports.jsx("div",{className:c.CSS.BE("mosaic","mask"),style:Ei[l]})]})});Cn.displayName="MosaicTabLeaf";const Ei={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%"}},fs=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}},Si=e=>e,Ri=e=>1-e,gs=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[s,n]=[Si(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")},Ut=({aetherKey:e})=>{const[,{region:t},s]=m.use$3({aetherKey:e,type:j.Eraser$1.TYPE,schema:j.eraserStateZ,initialState:{region:c.box$1.ZERO}}),n=m.useSyncedRef(t);return p.useCallback(r=>{c.box$1.equals(r,n.current)||s(o=>({...o,region:r}))},[s])},bi=m.wrap$1(j.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const s=Ut({aetherKey:e}),n=m.useResize(s);return i.jsxRuntimeExports.jsx("div",{ref:n,className:c.CSS(c.CSS.inheritDims()),children:t})}),vi=Object.freeze(Object.defineProperty({__proto__:null,Eraser:bi,use:Ut},Symbol.toStringTag,{value:"Module"})),Ci=({items:e,initialKey:t})=>{const[s,n]=p.useState(t),r=l=>n(l===s?void 0:l),o=e.find(l=>l.key===s);return{onSelect:r,activeItem:o}},yi=m.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:s,onSelect:n,location:r="left",collapseThreshold:o=.65,className:l,onResize:a,...u})=>{if(t==null)return null;const d=c.location.direction(r),{key:x,content:h,...f}=t,g=p.useCallback(()=>n==null?void 0:n(x),[n,x]),E=Ut({aetherKey:e}),S=p.useCallback((R,b)=>{a==null||a(R,b),E(b)},[a,E]);return i.jsxRuntimeExports.jsx(Us,{className:c.CSS(c.CSS.BE("navdrawer","content"),c.CSS.dir(d),l),collapseThreshold:o,onCollapse:g,location:r,onResize:S,...f,...u,children:h})}),wi=({location:e="left",size:t="9rem",className:s,style:n,...r})=>{const o=c.location.construct(e),l=c.location.direction(o),a=c.direction$1.swap(l);return i.jsxRuntimeExports.jsx(V.Space,{className:c.CSS(c.CSS.B("navbar"),c.CSS.bordered(c.location.swap(o)),c.CSS.dir(a),c.CSS.loc(o),s),direction:a,style:{[c.direction$1.dimension(l)]:t,...n},align:"center",empty:!0,...r})},rt=e=>({bordered:t=!1,className:s,...n})=>i.jsxRuntimeExports.jsx(V.Space,{className:c.CSS(c.CSS.BE("navbar","content"),c.CSS.align(e),e!==""&&t&&c.CSS.bordered(e),s),align:"center",...n}),yn=rt("start");yn.displayName="NavbarStart";const wn=rt("end");wn.displayName="NavbarEnd";const $n=rt("center");$n.displayName="NavbarCenter";const Mn=rt("");Mn.displayName="NavbarContent";const Ne=wi;Ne.Start=yn;Ne.Center=$n;Ne.End=wn;Ne.Content=Mn;const wt="tree-item",$i=e=>{const{onExpand:t,nodes:s,initialExpanded:n=[],sort:r=!0}=e??{},[o,l,a]=m.useCombinedStateAndRef(n),[u,d]=p.useState([]),x=p.useMemo(()=>Wt(s,o,void 0,r),[s,o,r]),h=m.useSyncedRef(x),f=m.useHeldRef({triggers:[["Shift"]]});return{onSelect:p.useCallback((E,{clicked:S})=>{d(E);const R=h.current.find(y=>y.key===S);if((R==null?void 0:R.hasChildren)===!1||S==null||f.current.held)return;const b=a.current,C=b.some(y=>y===S)?"contract":"expand";let v=b;C==="contract"?v=b.filter(y=>y!==S):v=[...b,S],l(v),t==null||t({current:v,action:C,clicked:S})},[t,h,l,d]),selected:u,expanded:o,nodes:x}},Mi=i.jsxRuntimeExports.jsx(m.n0.Caret.Down,{className:c.CSS.B("caret")}),Ti=i.jsxRuntimeExports.jsx(m.n0.Caret.Right,{className:c.CSS.B("caret")}),Tn=({entry:e,selected:t,onSelect:s,style:n,onDrop:r,onRename:o,onSuccessfulDrop:l,selectedItems:a,onDoubleClick:u,loading:d=!1,useMargin:x=!1})=>{const{key:h,hasChildren:f=!1,allowRename:g=!1,children:E,icon:S,name:R,depth:b,expanded:C,href:v,haulItems:y=[]}=e,k=f||E!=null&&E.length>0,w=[];k&&w.push(C?Mi:Ti),S!=null&&w.push(S);const L=[];d&&L.push(i.jsxRuntimeExports.jsx(m.n0.Loading,{className:c.CSS.B("loading-indicator")}));const[M,$]=p.useState(!1),{startDrag:B,...D}=m.useDragAndDrop({type:"Tree.Item",key:h,canDrop:p.useCallback(({items:Y,source:W})=>{const K=Y.map(H=>H.key);return $(!1),W.type==="Tree.Item"&&!K.includes(h)},[]),onDrop:p.useCallback(Y=>(r==null?void 0:r(h,Y))??[],[h,r]),onDragOver:p.useCallback(()=>$(!0),[])}),O=()=>{if(a.map(({key:W})=>W).includes(h)){const W=a.map(({key:K,haulItems:H})=>[{type:wt,key:K},...H??[]]).flat();return B(W,K=>l==null?void 0:l(h,K))}B([{type:wt,key:h},...y],W=>l==null?void 0:l(h,W))},A=x?"marginLeft":"paddingLeft",_={id:h,variant:"text",draggable:!0,className:c.CSS(Ze.CONTEXT_TARGET,M&&c.CSS.M("dragging-over"),t&&Ze.CONTEXT_SELECTED,c.CSS.selected(t),k&&c.CSS.M("has-children")),onDragLeave:()=>$(!1),onDragStart:O,onClick:()=>s==null?void 0:s(h),style:{...n,[A]:`${b*1.5+1}rem`},startIcon:w,iconSpacing:"small",noWrap:!0,endIcon:L,onDoubleClick:Y=>u==null?void 0:u(h,Y),href:v,...D},U=v!=null?vr.Link:m.Button;return i.jsxRuntimeExports.jsx(U,{..._,children:i.jsxRuntimeExports.jsx(m.MaybeEditable,{id:`text-${h}`,level:"p",allowDoubleClick:!1,value:R,onChange:o!=null&&g?Y=>o(h,Y):void 0})})},ki=m.componentRenderProp(Tn),Li=({nodes:e,selected:t=[],onSelect:s,onDrop:n,onRename:r,onSuccessfulDrop:o,onDoubleClick:l,className:a,children:u=ki,itemHeight:d=27,useMargin:x=!1,virtual:h=!0,...f})=>{const g=h?Le.Virtual:Le;return i.jsxRuntimeExports.jsxs(st,{data:e,children:[i.jsxRuntimeExports.jsx(zt,{value:t,onChange:s,allowMultiple:!0,replaceOnSingle:!0}),i.jsxRuntimeExports.jsx(g,{itemHeight:d,className:c.CSS(a,c.CSS.B("tree")),...f,children:E=>u({...E,useMargin:x,onDrop:n,onRename:r,onSuccessfulDrop:o,selectedItems:e.filter(S=>t.includes(S.key)),onDoubleClick:l})})]})},Pi=e=>m.edit(`text-${e}`),kn=(e,t)=>t.includes(e.key),Wt=(e,t,s=0,n)=>{s===0&&n&&(e=e.sort((o,l)=>o.name.localeCompare(l.name)));const r=[];return e.forEach((o,l)=>{const a=kn(o,t);r.push({...o,depth:s,expanded:a,index:l}),a&&o.children!=null&&(n&&(o.children=o.children.sort((u,d)=>u.name.localeCompare(d.name))),r.push(...Wt(o.children,t,s+1,n)))}),r},Oi=(e,t,...s)=>(s.forEach(n=>{const r=ye(e,n);r!=null&&(Ln(e,n),Pn(e,t,r))}),e),Ln=(e,...t)=>{const s=e.map(n=>n.key);return t.forEach(n=>{var o;const r=s.indexOf(n);if(r!==-1)e.splice(r,1);else{const l=ot(e,n);l!=null&&(l.children=(o=l.children)==null?void 0:o.filter(a=>a.key!==n))}}),e},Pn=(e,t,...s)=>{const n=ye(e,t);if(n==null)throw new Error(`Could not find node with key ${t}`);n.children==null&&(n.children=[]);const r=s.map(o=>o.key);return n.children=[...s,...n.children.filter(o=>!r.includes(o.key))],e},Ii=(e,t,s,n=!0)=>{var l,a;const r=ye(e,t);if(r==null){if(n)throw new Error(`Could not find node with key ${t}`);return e}const o=ot(e,t);if(o!=null){const u=(l=o.children)==null?void 0:l.findIndex(d=>d.key===t);u!=null&&u!==-1&&((a=o.children)==null||a.splice(u,1,s(r)))}else e.splice(e.findIndex(u=>u.key===t),1,s(r));return e},ye=(e,t,s=0)=>{for(const n of e){if(n.key===t){const r=n;return r.depth=s,r}if(n.children!=null){const r=ye(n.children,t,s+1);if(r!=null)return r}}return null},Ni=(e,t)=>{const s=[];for(const n of t){const r=ye(e,n);r!=null&&s.push(r)}return s},ot=(e,t)=>{for(const s of e)if(s.children!=null){if(s.children.some(r=>r.key===t))return s;const n=ot(s.children,t);if(n!=null)return n}return null},_i=Object.freeze(Object.defineProperty({__proto__:null,DefaultItem:Tn,HAUL_TYPE:wt,Tree:Li,findNode:ye,findNodeParent:ot,findNodes:Ni,flatten:Wt,moveNode:Oi,removeNode:Ln,setNode:Pn,shouldExpand:kn,startRenaming:Pi,updateNode:Ii,use:$i},Symbol.toStringTag,{value:"Module"}));var te;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(te||(te={}));function Di({color:e,dimensions:t,lineWidth:s}){return p.createElement("path",{stroke:e,strokeWidth:s,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function Ai({color:e,radius:t}){return p.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const Vi={[te.Dots]:"#91919a",[te.Lines]:"#eee",[te.Cross]:"#e2e2e2"},Bi={[te.Dots]:1,[te.Lines]:1,[te.Cross]:6},zi=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function On({id:e,variant:t=te.Dots,gap:s=20,size:n,lineWidth:r=1,offset:o=2,color:l,style:a,className:u}){const d=p.useRef(null),{transform:x,patternId:h}=j.useStore(zi,j.shallow$1),f=l||Vi[t],g=n||Bi[t],E=t===te.Dots,S=t===te.Cross,R=Array.isArray(s)?s:[s,s],b=[R[0]*x[2]||1,R[1]*x[2]||1],C=g*x[2],v=S?[C,C]:b,y=E?[C/o,C/o]:[v[0]/o,v[1]/o];return p.createElement("svg",{className:j.cc(["react-flow__background",u]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},p.createElement("pattern",{id:h+e,x:x[0]%b[0],y:x[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${y[0]},-${y[1]})`},E?p.createElement(Ai,{color:f,radius:C/o}):p.createElement(Di,{dimensions:v,color:f,lineWidth:r})),p.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${h+e})`}))}On.displayName="Background";var Fi=p.memo(On);const js=({sourcePos:e,targetPos:t,next:s,prev:n})=>{const r=Te(e,...s);return c.xy.distance(r,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",r),console.log("Actual target",t),console.log("Segments",s),console.log("Prev segments",n),!1)},Es=({sourceStumpTip:e,sourceOrientation:t,sourceBox:s,targetStumpTip:n,targetOrientation:r,targetBox:o})=>{if(!Zi({sourcePos:e,sourceOrientation:t,targetPos:n}))return;const l=c.direction$1.construct(t),a=c.direction$1.swap(l);let u=fe(a,n[a]-e[a]);const d=c.box$1.loc(s,u);if(c.location.swap(t)===r){const x=c.box$1.loc(o,c.location.swap(u));Math.abs(d-x)<ee&&(u=c.location.swap(u))}return{direction:a,length:d-e[a]+ge(u,ee)}},Te=(e,...t)=>{let s=e;for(const n of t)s=c.xy.translate(s,n.direction,n.length);return s},In=(e,t,s,n)=>{try{let r=e;const o=[e,...t.map(f=>(r=c.xy.translate(r,f.direction,f.length),r))];if(!n)return o;const l=t[0],a=fe(l.direction,l.length),u=Ss(a);o[0]=c.xy.translate(o[0],{[l.direction]:-1*u*4*s,[c.direction$1.swap(l.direction)]:0});const d=t[t.length-1],x=fe(d.direction,d.length),h=Ss(x);return o[o.length-1]=c.xy.translate(o[o.length-1],{[d.direction]:h*4*s,[c.direction$1.swap(d.direction)]:0}),o}catch{return[]}},ee=10,Ss=e=>e==="top"||e==="left"?-1:1,ge=(e,t)=>e==="top"||e==="left"?-t:t,fe=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ue=e=>fe(e.direction,e.length),Zi=({sourcePos:e,targetPos:t,sourceOrientation:s})=>{const n=c.direction$1.construct(s),r=t[n]-e[n];return ge(s,r)<0},Ve=e=>({direction:c.direction$1.construct(e),length:ge(e,ee)}),Rs={top:Ve("top"),bottom:Ve("bottom"),left:Ve("left"),right:Ve("right")},Yi=4,Hi=.25,it=e=>$t(Gi($t(e))),Gi=e=>{const t=[...e],s=e.findIndex((n,r)=>{const o=Math.abs(n.length);if(o<Yi){if(o<Hi)return!0;if(r===0||r===e.length-1||e.length<=3)return!1;if(r+2<e.length){const l=t[r+2];if(l.direction!==n.direction)return!1;t[r+2]={...l,length:l.length+n.length}}else{const l=t[r-2];if(l.direction!==n.direction)return!1;t[r-2]={...l,length:l.length+n.length}}return!0}return!1});return s!==-1&&t.splice(s,1),t},$t=e=>{const t=[...e];return e.findIndex((n,r)=>{const o=t[r-1];if(r===0||n.direction!==o.direction)return!1;if(r===1){const l=r-1,a=r,u=ue(o),d=ue(n);if(u===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(o.length)===ee)return!1;const x=ge(u,ee),h=t[l].length-x,f=t[a].length+h;return Math.abs(f)<ee?!1:(t[l]={...t[l],length:x},t[a]={...t[a],length:f},!0)}if(r===e.length-1){const l=r,a=r-1,u=ue(n),d=ue(o);if(u===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(n.length)===ee)return!1;const x=ge(u,ee),h=t[l].length-x,f=t[a].length+h;return Math.abs(f)<ee?!1:(t[l]={...t[l],length:x},t[a]={...t[a],length:f},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?$t(t):t},Re=e=>it(Ui(e)),Ui=({sourceBox:e,targetBox:t,sourcePos:s,targetPos:n,targetOrientation:r,sourceOrientation:o})=>{let l=o,a=r,u={...Rs[o]},d=Te(s,u);const x={...Rs[r]};let h=Te(n,x);const f=[u],g=Es({sourceStumpTip:d,sourceOrientation:o,sourceBox:e,targetStumpTip:h,targetOrientation:r,targetBox:t});g!=null&&(f.push(g),d=Te(d,g),l=ue(g),u=g);const E=Es({sourceStumpTip:h,sourceOrientation:a,sourceBox:t,targetStumpTip:d,targetOrientation:l,targetBox:e});E!=null&&(h=Te(h,E),a=fe(E.direction,E.length));const S=()=>{E!=null&&(E.length*=-1,f.push(E)),x.length*=-1,f.push(x)};if(c.location.swap(l)===r){const k=c.direction$1.construct(l),w=(h[k]-d[k])/2;f.push({direction:k,length:w});const L=c.direction$1.swap(k);return f.push({direction:L,length:h[L]-d[L]}),f.push({direction:k,length:w}),S(),f}const R=h[u.direction]-d[u.direction];let b=c.direction$1.swap(u.direction);const C=d[b]-h[b];let v;fe(u.direction,R)===l&&fe(b,C)===a?v={direction:u.direction,length:R}:(v={direction:b,length:h[b]-d[b]},b=c.direction$1.swap(b)),f.push(v);const y={direction:b,length:h[b]-d[b]};return f.push(y),S(),f},Wi=e=>it(Ki(e)),Ki=({segments:e,index:t,magnitude:s})=>{const n=[...e],r=n[t],o=c.direction$1.swap(r.direction),l=ue(r);if(t===0){n.unshift({direction:o,length:s});const a=ge(l,ee);n.unshift({direction:r.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:o,length:-s});const a=ge(l,ee);n.push({direction:r.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},qi=(e,t)=>{for(let s=e.length-1;s>=0;s--)if(t(e[s],s))return s;return-1},Xi=(e,t,s=!1,...n)=>{const r=(o,l)=>!n.includes(l)&&t(o,l);return s?qi(e,r):e.findIndex(r)},Qi=({delta:e,segments:t})=>it(Nn(e,t,!1)),Ji=({delta:e,segments:t})=>it(Nn(e,t,!0)),Nn=(e,t,s)=>{let n=[...t];return e.x!==0&&(n=vs("x",e,n,s)),e.y!==0&&(n=vs("y",e,n,s)),n},bs=(e,t,s)=>{if(t.direction!==e)return!1;const n={...t,length:t.length-s[e]},r=ue(t),o=ue(n);return Math.abs(n.length)>ee&&r===o},vs=(e,t,s,n)=>{const r=c.direction$1.swap(e),o=n?s.length-1:0,l=s[o];if(bs(e,l,t))return s[o]={...l,length:l.length-t[e]},s;const a=n?0:s.length-1,d=Xi(s,h=>h.direction===e,n,o);if(d===a){const h=s[a];return bs(e,h,t)?(s[a]={...h,length:h.length-t[e]},s):(l.direction===e?s[o]={...l,length:l.length-t[e]}:s[a]={...h,length:h.length-t[e]},s)}if(d===-1)return s.length===1?s[0].direction===e?[{direction:e,length:s[0].length-t[e]}]:[{direction:r,length:s[0].length/2},{direction:e,length:-t[e]},{direction:r,length:s[0].length/2}]:l.direction===e?(s[o]={...l,length:l.length-t[e]},s):[{direction:r,length:s[0].length},{direction:e,length:-t[e]},...s.slice(1)];const x=s[d];return s[d]={...x,length:x.length-t[e]},s},Kt=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[pid] - cannot find node with key: ${e}`);return t},X=(e,t)=>{const s=Kt(t),n=e.getNodes().find(r=>r.id===t);if(n==null)throw new Error(`[pid] - cannot find node with key: ${t}`);return c.box$1.construct(n.position,c.box$1.dims(c.box$1.construct(s)))},el=(e,t)=>lt.fromFlow(e,t);class _n{constructor(t,s){pe(this,"node_",null);pe(this,"position");pe(this,"orientation");this.position=t,this.orientation=s}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[pid] - handle has no node");return this.node_}get absolutePosition(){return c.xy.translate(c.box$1.topLeft(this.node.box),this.position)}}class lt{constructor(t,s,n){pe(this,"key");pe(this,"box");pe(this,"handles");this.key=t,this.box=s,this.handles=n,n.forEach(r=>r.node=this)}static fromFlow(t,s){const n=X(s,t),r=Kt(t),o=r.getElementsByClassName("react-flow__handle"),l=c.box$1.construct(r),a=Array.from(o).map(u=>{const d=c.box$1.center(c.box$1.construct(u)),x=c.xy.translation(c.box$1.topLeft(l),d),h=u.className.match(/react-flow__handle-(\w+)/);if(h==null)throw new Error("[pid] - cannot find handle orientation");const f=c.location.construct(h[0]);return new _n(x,f)});return new lt(t,n,a)}}const tl=({fromX:e,fromY:t,toX:s,toY:n,fromPosition:r,toPosition:o,fromNode:l,connectionLineStyle:a,connectionStatus:u})=>{const d=document.querySelector(".react-flow__handle-connecting"),x=d==null?void 0:d.className.match(/react-flow__handle-(\w+)/);x!=null&&(o=x[1]);const h=Re({sourcePos:c.xy.construct(e,t),targetPos:c.xy.construct(s,n),sourceOrientation:r,targetOrientation:o,sourceBox:X(j.useReactFlow(),(l==null?void 0:l.id)??""),targetBox:X(j.useReactFlow(),(l==null?void 0:l.id)??"")}),f=j.useReactFlow(),g=In(c.xy.construct(e,t),h,f.getZoom(),!1);return i.jsxRuntimeExports.jsx(j.BaseEdge,{path:Dn(g),style:{...a,stroke:c.cssString(u==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},sl=({id:e,source:t,target:s,sourcePosition:n,targetHandleId:r,targetPosition:o,style:l,segments:a=[],onSegmentsChange:u,color:d="var(--pluto-gray-l9)",selected:x=!1,...h})=>{const f=c.xy.construct(h.sourceX,h.sourceY),g=p.useRef(f),E=c.xy.equals(f,g.current),S=c.xy.construct(h.targetX,h.targetY),R=p.useRef(S),b=c.xy.equals(S,R.current),C=j.useReactFlow(),[v,y,k]=m.useCombinedStateAndRef(()=>a.length>0?a:Re({sourcePos:f,targetPos:S,sourceOrientation:n,targetOrientation:o,sourceBox:X(C,t),targetBox:X(C,s)})),w=p.useRef(o),L=p.useRef(n),M=Je(u,100,[u]);if(!E||!b){let O=v;const A=c.xy.translation(g.current,f),_=c.xy.translation(S,R.current);c.xy.equals(A,c.xy.scale(_,-1),.001)?(g.current=f,R.current=S):(E?b||(O=Ji({delta:_,segments:O}),w.current!==o&&(w.current=o,O=Re({sourcePos:f,targetPos:S,sourceOrientation:n,targetOrientation:o,sourceBox:X(C,t),targetBox:X(C,s)})),js({sourcePos:f,targetPos:S,next:O,prev:v})||(O=Re({sourcePos:f,targetPos:S,sourceOrientation:n,targetOrientation:o,sourceBox:X(C,t),targetBox:X(C,s)})),R.current=S):(O=Qi({delta:A,segments:O}),L.current!==n&&(L.current=n,O=Re({sourcePos:f,targetPos:S,sourceOrientation:n,targetOrientation:o,sourceBox:X(C,t),targetBox:X(C,s)})),js({sourcePos:f,targetPos:S,next:O,prev:v})||(O=Re({sourcePos:f,targetPos:S,sourceOrientation:n,targetOrientation:o,sourceBox:X(C,t),targetBox:X(C,s)})),g.current=f),M(O),y(O))}const $=p.useRef(null),B=et({onStart:p.useCallback((O,A,_)=>{$.current={index:Number(_.currentTarget.id.split("-")[1]),segments:[...k.current]}},[]),onMove:p.useCallback(O=>{if($.current==null)return;const A=Wi({segments:$.current.segments,index:$.current.index,magnitude:c.box$1.dim(O,c.direction$1.swap($.current.segments[$.current.index].direction),!0)/C.getZoom()});y(A)},[]),onEnd:p.useCallback(()=>u(k.current),[u])}),D=In(f,v,C.getZoom(),!0);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(j.BaseEdge,{path:Dn(D),style:{...l,stroke:c.cssString(d)},interactionWidth:6,...h}),x&&nl(D).map((O,A)=>{const _=v[A].direction,U=c.direction$1.swap(_),Y={[c.direction$1.dimension(_)]:"18px",[c.direction$1.dimension(U)]:"4px"},W={[_]:O[_]-9,[U]:O[U]-2};return i.jsxRuntimeExports.jsxs(p.Fragment,{children:[i.jsxRuntimeExports.jsx("rect",{className:c.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...Y,...W,rx:"2px",ry:"2px"}),i.jsxRuntimeExports.jsx("foreignObject",{x:O.x-9,y:O.y-9,width:"18px",height:"18px",children:i.jsxRuntimeExports.jsx("div",{id:`handle-${A}`,className:c.CSS(c.CSS.BE("diagram-edge-handle","dragger"),c.CSS.dir(_)),draggable:!0,onDragStart:B})})]},A)})]})},Dn=e=>{let t="";const n=e.length+-1;for(let r=0;r<n;r++){const o=e[r%e.length],l=e[(r+1)%e.length],a=Math.min(6/Math.hypot(l.x-o.x,l.y-o.y),.5);r>0&&(t+=`Q${o.x},${o.y} ${o.x*(1-a)+l.x*a},${o.y*(1-a)+l.y*a}`),r===0?t+=`M${o.x},${o.y}`:r===0&&(t+=`M${o.x*(1-a)+l.x*a},${o.y*(1-a)+l.y*a}`),r===n-1?t+=`L${l.x},${l.y}`:r<n-1&&(t+=`L${o.x*a+l.x*(1-a)},${o.y*a+l.y*(1-a)}`)}return t},nl=e=>e.slice(1).map((t,s)=>{const n=e[s];return c.xy.construct((t.x+n.x)/2,(t.y+n.y)/2)}),rl=({initialNodes:e,initialEdges:t,allowEdit:s=!0,initialViewport:n={position:c.xy.ZERO,zoom:1}})=>{const[r,o]=p.useState(s),[l,a]=p.useState(e),[u,d]=p.useState(t),[x,h]=p.useState(n);return{viewport:x,onViewportChange:h,edges:u,nodes:l,onNodesChange:a,onEdgesChange:d,editable:r,onEditableChange:o}},ol=e=>e.source!==e.target,il={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},ll={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},An=p.createContext({editable:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{}}),ct=()=>p.useContext(An),Vn=p.memo(({children:e})=>{const{registerNodeRenderer:t}=ct();return p.useEffect(()=>t(e),[t,e]),null});Vn.displayName="NodeRenderer";const cl=m.wrap$1(j.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:s,onEdgesChange:n,nodes:r,edges:o,onEditableChange:l,editable:a,viewport:u,triggers:d,onViewportChange:x,...h})=>{const[{path:f},,g]=m.use$3({aetherKey:e,type:j.Diagram$1.TYPE,schema:j.diagramStateZ,initialState:{position:u.position,region:c.box$1.ZERO,zoom:u.zoom}}),E=m.useMemoCompare(()=>d??Dt.zoom,m.compareModeConfigs,[d]),{fitView:S}=j.useReactFlow(),R=Nt(p.useCallback(N=>{g(z=>({...z,region:N}))},[g])),b=p.useRef(null),C=p.useCallback(N=>{const z=b.current;z!=null&&z.x===N.x&&z.y===N.y&&z.zoom===N.zoom||(b.current=N,g(q=>({...q,position:N,zoom:N.zoom})),x(j.translateViewportBackward(N)))},[g,x]);j.useOnViewportChange({onStart:C,onChange:C,onEnd:C});const[v,y]=p.useState(()=>()=>null),k=p.useCallback(N=>y(()=>N),[]),w=p.useMemo(()=>({custom:({id:N,xPos:z,yPos:q,selected:Me})=>v({symbolKey:N,position:{x:z,y:q},selected:Me})}),[v]),L=p.useRef(o),M=p.useMemo(()=>(L.current=o,j.translateEdgesForward(o)),[o]),$=p.useRef(r),B=p.useMemo(()=>($.current=r,j.translateNodesForward(r)),[r]),D=p.useCallback(N=>s(j.nodeConverter($.current,z=>j.applyNodeChanges(N,z))),[s]),O=p.useCallback(N=>n(j.edgeConverter(L.current,z=>j.applyEdgeChanges(N,z))),[n]),A=p.useCallback((N,z)=>n(j.edgeConverter(L.current,q=>j.updateEdge(N,z,q))),[]),_=p.useCallback(N=>{n(j.edgeConverter(L.current,z=>j.addEdge(N,z)))},[n]),U=p.useCallback((N,z)=>{const q=[...L.current],Me=q.findIndex(gr=>gr.key===N);Me!==-1&&(q[Me]={...q[Me],segments:z},L.current=q,n(q))},[n]),Y=a?il:ll,W=p.useMemo(()=>({default:N=>i.jsxRuntimeExports.jsx(sl,{...N,segments:N.data.segments,color:N.data.color,onSegmentsChange:p.useCallback(z=>U(N.id,z),[N.id])},N.id)}),[U]),K=p.useRef(null);m.use$1({triggers:E.zoomReset,callback:p.useCallback(({stage:N,cursor:z})=>{const q=K.current;q==null||N!=="start"||!c.box$1.contains(q,z)||S()},[S])});const H=m.purgeMouse(E.select)[0]??null,Ee=m.purgeMouse(E.pan)[0]??null,dt=m.purgeMouse(E.zoom)[0]??null,mr={selectionOnDrag:H==null,panOnDrag:Ee==null,selectionKeyCode:H,panActivationKeyCode:Ee,zoomActivationKeyCode:dt},fr=m.useCombinedRefs(K,R);return i.jsxRuntimeExports.jsx(An.Provider,{value:{editable:a,onEditableChange:l,registerNodeRenderer:k},children:i.jsxRuntimeExports.jsx(m.Composite,{path:f,children:i.jsxRuntimeExports.jsx(j.ReactFlow,{...mr,className:c.CSS(c.CSS.B("diagram"),c.CSS.editable(a)),nodes:B,edges:M,nodeTypes:w,edgeTypes:W,ref:fr,fitView:!0,onNodesChange:D,onEdgesChange:O,onConnect:_,onEdgeUpdate:A,defaultViewport:j.translateViewportForward(u),connectionLineComponent:tl,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.1,isValidConnection:ol,connectionMode:j.ConnectionMode.Loose,snapGrid:[3,3],proOptions:{hideAttribution:!0},...h,style:{[c.CSS.var("diagram-zoom")]:u.zoom,...h.style},...Y,children:t})})})}),al=()=>{const{editable:e}=ct();return e?i.jsxRuntimeExports.jsx(Fi,{}):null},ul=({children:e,...t})=>i.jsxRuntimeExports.jsx(V.Pack,{direction:"y",className:c.CSS.BE("diagram","controls"),...t,children:e}),dl=({onClick:e,...t})=>{const{editable:s,onEditableChange:n}=ct();return i.jsxRuntimeExports.jsx(m.ToggleIcon,{onChange:()=>n(!s),value:s,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:c.location.RIGHT_CENTER,tooltip:s?i.jsxRuntimeExports.jsx(m.Text,{level:"small",children:"Disable edit mode"}):i.jsxRuntimeExports.jsx(m.Text,{level:"small",children:"Enable edit mode"}),...t,children:s?i.jsxRuntimeExports.jsx(m.n0.EditOff,{}):i.jsxRuntimeExports.jsx(m.n0.Edit,{})})},xl=({onClick:e,...t})=>{const{fitView:s}=j.useReactFlow();return i.jsxRuntimeExports.jsx(m.Icon,{onClick:n=>{s(),e==null||e(n)},tooltip:i.jsxRuntimeExports.jsx(m.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:c.location.RIGHT_CENTER,variant:"outlined",...t,children:i.jsxRuntimeExports.jsx(m.n0.Expand,{})})},hl=e=>i.jsxRuntimeExports.jsx(j.ReactFlowProvider,{children:i.jsxRuntimeExports.jsx(cl,{...e})}),pl=m.wrap$1(j.Table.TYPE,({aetherKey:e,numColumns:t,children:s,className:n,...r})=>{const[{path:o},,l]=m.use$3({aetherKey:e,type:j.Table.TYPE,schema:j.tableStateZ,initialState:{region:c.box$1.ZERO,widths:Array(t).fill(0)}}),a=p.useCallback(x=>l(h=>({...h,region:x})),[l]),u=p.useCallback((x,h)=>l(f=>({...f,widths:f.widths.map((g,E)=>E===x?h:g)})),[l]),d=m.useResize(a);return i.jsxRuntimeExports.jsx("table",{ref:d,className:c.CSS(c.CSS.B("table"),n),...r,children:i.jsxRuntimeExports.jsxs("tbody",{children:[i.jsxRuntimeExports.jsx(m.Composite,{path:o,children:s}),i.jsxRuntimeExports.jsx("tr",{className:c.CSS.BE("table","virtual-row"),children:Array(t).fill(0).map((x,h)=>i.jsxRuntimeExports.jsx(ml,{index:h,onResize:u},h))})]})})}),ml=({onResize:e,index:t})=>{const s=p.useCallback(r=>e(t,c.box$1.width(r)),[e,t]),n=m.useResize(s);return i.jsxRuntimeExports.jsx("td",{ref:n,className:c.CSS.BE("table","virtual-cell")})},fl=["y"],gl=m.wrap$1(j.TR.TYPE,({aetherKey:e,children:t})=>{const[{path:s},,n]=m.use$3({aetherKey:e,type:j.TR.TYPE,schema:j.trStateZ,initialState:{height:0}}),r=p.useCallback(l=>n(a=>({...a,height:c.box$1.height(l)})),[n]),o=m.useResize(r,{triggers:fl});return i.jsxRuntimeExports.jsx("tr",{ref:o,children:i.jsxRuntimeExports.jsx(m.Composite,{path:s,children:t})})}),jl=m.wrap$1(j.StringTD.TYPE,({aetherKey:e,telem:t})=>(m.use$3({aetherKey:e,type:j.StringTD.TYPE,schema:j.stringTDStateZ,initialState:{stringSource:t}}),i.jsxRuntimeExports.jsx("td",{style:{height:20}}))),El=({onChange:e,className:t,onSelect:s,...n})=>i.jsxRuntimeExports.jsx("td",{className:c.CSS(c.CSS.BE("table","label")),onDoubleClick:s,children:i.jsxRuntimeExports.jsx(m.Editable,{...n,onChange:r=>{e({...n,value:r})}})}),Sl=({value:e,onChange:t})=>i.jsxRuntimeExports.jsx("h1",{children:"Hello"}),Bn=e=>({value:"Label",level:"p"}),Mt={type:"label",title:"Label",initialProps:Bn,Cell:El,Form:Sl},Rl={[Mt.type]:Mt},bl=j.Value.z.omit({font:!0}).partial({color:!0}).extend({level:se.levelZ.optional()}),zn=({aetherKey:e,box:t,telem:s,color:n,precision:r,width:o,level:l="small"})=>{const a=Qe.useTypography(l),u=m.useMemoDeepEqualProps({box:t,telem:s,color:n,precision:r,width:o,font:a.toString()}),[,,d]=m.use$3({aetherKey:e,type:j.Value.TYPE,schema:j.Value.z,initialState:u});return p.useLayoutEffect(()=>d(x=>({...x,...u})),[u]),null},vl=({value:e,onChange:t})=>{const{inner:s,outer:n}=e,r=o=>()=>t({...e,...o});return i.jsxRuntimeExports.jsxs(V.Space,{className:c.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[i.jsxRuntimeExports.jsx(ae,{selected:n==="top",onClick:r({outer:"top"})}),i.jsxRuntimeExports.jsxs(V.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[i.jsxRuntimeExports.jsx(ae,{selected:n==="left",onClick:r({outer:"left"})}),i.jsxRuntimeExports.jsxs(V.Space,{className:c.CSS.B("value"),direction:"y",align:"center",justify:"center",empty:!0,children:[i.jsxRuntimeExports.jsx(ae,{className:c.CSS(c.CSS.dir("y")),selected:s==="top",onClick:r({inner:"top"})}),i.jsxRuntimeExports.jsxs(V.Space,{direction:"x",align:"center",justify:"center",children:[i.jsxRuntimeExports.jsx(ae,{selected:s==="left",onClick:r({inner:"left"})}),i.jsxRuntimeExports.jsx(ae,{selected:s==="right",onClick:r({inner:"right"})})]}),i.jsxRuntimeExports.jsx(ae,{className:c.CSS(c.CSS.dir("y")),selected:s==="bottom",onClick:r({inner:"bottom"})})]}),i.jsxRuntimeExports.jsx(ae,{selected:n==="right",onClick:r({outer:"right"})})]}),i.jsxRuntimeExports.jsx(ae,{selected:n==="bottom",onClick:r({outer:"bottom"})})]})},ae=({selected:e,className:t,...s})=>i.jsxRuntimeExports.jsx(m.Icon,{variant:"text",className:c.CSS(t,c.CSS.selected(e)),...s,children:i.jsxRuntimeExports.jsx("div",{className:"symbol"})}),qt=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"},{tabKey:"tooltip",name:"Tooltip"}],xe=({className:e,direction:t,...s})=>i.jsxRuntimeExports.jsx(V.Space,{direction:t,align:"stretch",className:c.CSS(c.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...s}),_e=({value:e,onChange:t})=>{var s;return i.jsxRuntimeExports.jsx(ne.Item,{label:"Orientation",children:i.jsxRuntimeExports.jsx(vl,{value:{inner:e.orientation??"top",outer:((s=e.label)==null?void 0:s.orientation)??"top"},onChange:n=>t({orientation:n.inner,label:{...e.label,orientation:n.outer}})})})},De=({value:{label:e},onChange:t})=>i.jsxRuntimeExports.jsxs(V.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(ne.Item,{label:"Label",grow:!0,children:i.jsxRuntimeExports.jsx(m.Text$1,{value:(e==null?void 0:e.label)??"",onChange:s=>t({label:{...e,label:s}})})}),i.jsxRuntimeExports.jsx(ne.Item,{label:"Label Size",children:i.jsxRuntimeExports.jsx($s.SelectLevel,{value:(e==null?void 0:e.level)??"p",onChange:s=>t({label:{...e,level:s}})})})]}),at=({value:e,onChange:t})=>i.jsxRuntimeExports.jsx(ne.Item,{label:"Color",align:"start",children:i.jsxRuntimeExports.jsx(ws.Swatch,{value:e.color??c.ZERO.setAlpha(1).rgba255,onChange:s=>t({color:s.rgba255})})}),Fn=({value:e,onChange:t})=>{var u,d;const s=j.sourcePipelinePropsZ.parse((u=e.source)==null?void 0:u.props),n=j.sinkPipelinePropsZ.parse((d=e.sink)==null?void 0:d.props),r=j.streamChannelValuePropsZ.parse(s.segments.valueStream.props),o=j.setChannelValuePropsZ.parse(n.segments.setter.props),l=x=>{const h=j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:x}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});t({...e,source:h})},a=x=>{const h=j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:x}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),f=j.authoritySource({channel:x}),g=j.acquireChannelControl({channel:x,authority:255});t({...e,sink:h,control:{...e.control,showChip:!0,chip:{sink:g,source:f},showIndicator:!0,indicator:{statusSource:f}}})};return i.jsxRuntimeExports.jsxs(xe,{direction:"y",children:[i.jsxRuntimeExports.jsx(ne.Item,{label:"Input Channel",children:i.jsxRuntimeExports.jsx(Pe,{value:r.channel,onChange:l})}),i.jsxRuntimeExports.jsx(ne.Item,{label:"Output Channel",children:i.jsxRuntimeExports.jsx(Pe,{value:o.channel,onChange:a})})]})},we=({value:e,onChange:t})=>{const s=p.useCallback(({tabKey:r})=>{switch(r){case"control":return i.jsxRuntimeExports.jsx(Fn,{value:e,onChange:t});default:return i.jsxRuntimeExports.jsxs(xe,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(V.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(De,{value:e,onChange:t}),i.jsxRuntimeExports.jsx(at,{value:e,onChange:t})]}),i.jsxRuntimeExports.jsx(_e,{value:e,onChange:t})]})}},[e,t]),n=le.useStatic({tabs:qt,content:s});return i.jsxRuntimeExports.jsx(le.Tabs,{...n})},Cl=({value:e,onChange:t})=>{const s=p.useCallback(({tabKey:r})=>{switch(r){case"control":return i.jsxRuntimeExports.jsx(Fn,{value:e,onChange:t});default:return i.jsxRuntimeExports.jsxs(xe,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(V.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(De,{value:e,onChange:t}),i.jsxRuntimeExports.jsxs(V.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(at,{value:e,onChange:t}),i.jsxRuntimeExports.jsx(ne.Item,{label:"Normally Open",children:i.jsxRuntimeExports.jsx(m.Switch$1,{value:e.normallyOpen??!1,onChange:o=>t({...e,normallyOpen:o})})})]})]}),i.jsxRuntimeExports.jsx(_e,{value:e,onChange:t})]})}},[e,t]),n=le.useStatic({tabs:qt,content:s});return i.jsxRuntimeExports.jsx(le.Tabs,{...n})},re=({value:e,onChange:t})=>i.jsxRuntimeExports.jsxs(xe,{direction:"x",children:[i.jsxRuntimeExports.jsxs(V.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(De,{value:e,onChange:t}),i.jsxRuntimeExports.jsx(at,{value:e,onChange:t})]}),i.jsxRuntimeExports.jsx(_e,{value:e,onChange:t})]}),Cs={y:2,x:.25},ys={lower:0,upper:2e3},yl=({value:e,onChange:t})=>{var n,r;const s=o=>{t({...e,dimensions:{width:100,height:200,...e.dimensions,...o}})};return i.jsxRuntimeExports.jsxs(xe,{direction:"x",children:[i.jsxRuntimeExports.jsxs(V.Space,{direction:"y",children:[i.jsxRuntimeExports.jsx(De,{value:e,onChange:t}),i.jsxRuntimeExports.jsxs(V.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(at,{value:e,onChange:t}),i.jsxRuntimeExports.jsx(ne.Item,{label:"Width",children:i.jsxRuntimeExports.jsx(m.Numeric,{value:((n=e.dimensions)==null?void 0:n.width)??200,dragScale:Cs,bounds:ys,onChange:o=>s({width:o})})}),i.jsxRuntimeExports.jsx(ne.Item,{label:"Height",children:i.jsxRuntimeExports.jsx(m.Numeric,{value:((r=e.dimensions)==null?void 0:r.height)??200,dragScale:Cs,bounds:ys,onChange:o=>s({height:o})})})]})]}),i.jsxRuntimeExports.jsx(_e,{value:e,onChange:t})]})},wl=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],$l=({value:e,onChange:t})=>{var o;const s=j.sourcePipelinePropsZ.parse((o=e.telem)==null?void 0:o.props),n=j.streamChannelValuePropsZ.parse(s.segments.valueStream.props),r=l=>{const a=j.sourcePipeline("string",{connections:[{from:"valueStream",to:"stringifier"}],segments:{valueStream:j.streamChannelValue({channel:l}),stringifier:j.stringifyNumber({precision:2,suffix:" psi"})},outlet:"stringifier"});t({...e,telem:a})};return i.jsxRuntimeExports.jsx(xe,{direction:"y",children:i.jsxRuntimeExports.jsx(ne.Item,{label:"Input Channel",children:i.jsxRuntimeExports.jsx(Pe,{value:n.channel,onChange:r})})})},Ml=({value:e,onChange:t})=>{const s=p.useCallback(({tabKey:r})=>{switch(r){case"telemetry":return i.jsxRuntimeExports.jsx($l,{value:e,onChange:t});default:return i.jsxRuntimeExports.jsx(re,{value:e,onChange:t})}},[e,t]),n=le.useStatic({tabs:wl,content:s});return i.jsxRuntimeExports.jsx(le.Tabs,{...n})},Tl=({value:e,onChange:t})=>{var o;const s=j.sinkPipelinePropsZ.parse((o=e.sink)==null?void 0:o.props),n=j.setChannelValuePropsZ.parse(s.segments.setter.props),r=l=>{const a=j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:l}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),u=j.authoritySource({channel:l}),d=j.acquireChannelControl({channel:l,authority:255});t({...e,sink:a,control:{...e.control,showChip:!0,chip:{sink:d,source:u},showIndicator:!0,indicator:{statusSource:u}}})};return i.jsxRuntimeExports.jsx(xe,{direction:"y",children:i.jsxRuntimeExports.jsx(ne.Item,{label:"Output Channel",children:i.jsxRuntimeExports.jsx(Pe,{value:n.channel,onChange:r})})})},kl=({value:e,onChange:t})=>{const s=p.useCallback(({tabKey:r})=>{switch(r){case"control":return i.jsxRuntimeExports.jsx(Tl,{value:e,onChange:t});default:return i.jsxRuntimeExports.jsxs(xe,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(V.Space,{direction:"y",grow:!0,children:i.jsxRuntimeExports.jsx(De,{value:e,onChange:t})}),i.jsxRuntimeExports.jsx(_e,{value:e,onChange:t})]})}},[e,t]),n=le.useStatic({tabs:qt,content:s});return i.jsxRuntimeExports.jsx(le.Tabs,{...n})},Zn=p.createContext({needsControlOf:[]}),Yn=()=>p.useContext(Zn),Ll=m.wrap$1(j.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:s,...n})=>{const r=m.useMemoDeepEqualProps(n),[{path:o},{status:l,needsControlOf:a},u]=m.use$3({aetherKey:e,type:j.Controller$1.TYPE,schema:j.controllerStateZ,initialState:r});return p.useEffect(()=>{l!=null&&(s==null||s(l))},[l,s]),p.useEffect(()=>{u(d=>({...d,...r}))},[r,u]),i.jsxRuntimeExports.jsxs(Zn.Provider,{value:{needsControlOf:a},children:[i.jsxRuntimeExports.jsx(m.Composite,{path:o,children:t}),";"]})}),Pl=m.wrap$1(j.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:s}]=m.use$3({aetherKey:e,type:j.StateProvider.TYPE,schema:j.stateProviderStateZ,initialState:{}});return i.jsxRuntimeExports.jsx(m.Composite,{path:s,children:t})}),Hn=m.wrap$1(j.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:s})=>{var u;const n=m.useMemoDeepEqualProps({colorSource:t,statusSource:s}),[,{color:r,status:o},l]=m.use$3({aetherKey:e,type:j.Indicator.TYPE,initialState:{...n,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:c.TimeStamp.now()}},schema:j.indicatorStateZ});p.useEffect(()=>{l(d=>({...d,...n}))},[n,l]);let a;return((u=o.data)==null?void 0:u.color)!=null?a=o.data.color:r!=null&&!r.isZero?a=r:a="var(--pluto-gray-l8)",i.jsxRuntimeExports.jsxs(m.Dialog$1,{location:{x:"center",y:"right"},children:[i.jsxRuntimeExports.jsx(m.Text,{level:"p",children:o.message}),i.jsxRuntimeExports.jsx("div",{className:c.CSS.B("indicator"),style:{backgroundColor:c.cssString(a),flexGrow:1}})]})}),Ol=e=>{var t;switch(e.variant){case"disabled":return{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((t=e.data)==null?void 0:t.authority)===se.external.Authority.ABSOLUTE?{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)"}}},Gn=m.wrap$1("Chip",({aetherKey:e,source:t,sink:s,...n})=>{const r=m.useMemoDeepEqualProps({source:t,sink:s}),[,{status:o},l]=m.use$3({aetherKey:e,type:j.Chip.TYPE,schema:j.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:c.TimeStamp.now()}}});p.useEffect(()=>{l(h=>({...h,...r}))},[r,l]);const a=p.useCallback(()=>l(h=>({...h,triggered:!h.triggered})),[l]),{message:u,chipColor:d,buttonStyle:x}=Ol(o);return i.jsxRuntimeExports.jsx(m.Icon,{variant:"text",onClick:a,tooltip:i.jsxRuntimeExports.jsx(m.Text,{level:"small",children:u}),style:x,...n,children:i.jsxRuntimeExports.jsx(m.n0.Circle,{color:d})})}),Il=m.wrap$1(j.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:s}=Yn(),[,{states:n},r]=m.use$3({aetherKey:e,type:j.Legend.TYPE,schema:j.legendStateZ,initialState:{states:[],needsControlOf:s}});p.useEffect(()=>{r(a=>({...a,needsControlOf:s}))},[s]);const l=c.unique(n.map(a=>a.subject.key)).map(a=>{const u=n.find(d=>d.subject.key===a);if(u==null)throw new se.UnexpectedError("Legend subject not found");return{key:u.subject.key,label:u.subject.name,color:u.subjectColor}});return i.jsxRuntimeExports.jsx(Ks,{data:l,...t})}),Nl=({aetherKey:e,sink:t})=>{const s=m.useMemoDeepEqualProps({sink:t}),[,,n]=m.use$3({aetherKey:e,type:j.Button.TYPE,schema:j.buttonStateZ,initialState:{trigger:0,sink:t}});return p.useEffect(()=>{n(o=>({...o,...s}))},[s]),{click:p.useCallback(()=>{n(o=>({...o,trigger:o.trigger+1}))},[n])}},F=p.forwardRef(({label:e="",onChange:t,level:s="p",children:n,orientation:r="top",style:o,className:l,...a},u)=>i.jsxRuntimeExports.jsxs(V.Space,{style:{marginRight:r==="right"?1:0,marginTop:r==="top"?1:0,...o},align:"center",justify:"center",direction:r,ref:u,className:c.CSS(c.CSS.B("symbol"),l),...a,children:[i.jsxRuntimeExports.jsx(m.Editable,{value:e,onChange:p.useCallback(d=>t({label:{label:d,level:s,orientation:r}}),[t,s]),level:s}),n]}));F.displayName="Labeled";const I=e=>i.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),_l=e=>i.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Dl=e=>i.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),Tt=e=>i.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),Al={left:{left:j.Position.Left,right:j.Position.Right,top:j.Position.Top,bottom:j.Position.Bottom},right:{left:j.Position.Right,right:j.Position.Left,top:j.Position.Bottom,bottom:j.Position.Top},top:{left:j.Position.Bottom,right:j.Position.Top,top:j.Position.Left,bottom:j.Position.Right},bottom:{left:j.Position.Top,right:j.Position.Bottom,top:j.Position.Right,bottom:j.Position.Left}},Vl=(e,t)=>Al[t][e],Bl=(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},Z=({children:e,orientation:t})=>{let s;try{s=j.useUpdateNodeInternals()}catch{return i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{})}const n=p.useRef(null),r=p.useRef(!0);return p.useEffect(()=>{if(n.current==null)return;if(r.current){r.current=!1;return}const o=n.current.closest(".react-flow__node"),l=o==null?void 0:o.getAttribute("data-id");l!=null&&(s==null||s(l))},[t]),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("span",{ref:n}),e]})},T=({location:e,orientation:t,left:s,top:n,...r})=>{const o=Bl(n,s,t);return i.jsxRuntimeExports.jsx(j.Handle$1,{position:Vl(e,t),...r,type:"source",onClick:l=>l.stopPropagation(),className:(c.CSS.B("handle"),c.CSS.BE("handle",r.id)),style:{left:`${o.left}%`,top:`${o.top}%`}})},$e=({className:e,enabled:t=!1,triggered:s=!1,color:n,orientation:r="left",...o})=>i.jsxRuntimeExports.jsx("button",{className:c.CSS(c.CSS.B("symbol-primitive"),c.CSS.B("symbol-primitive-toggle"),r!=null&&c.CSS.loc(r),t&&c.CSS.M("enabled"),s&&c.CSS.M("triggered"),e),...o}),Q=({className:e,orientation:t="left",...s})=>i.jsxRuntimeExports.jsx("div",{className:c.CSS(c.CSS.B("symbol-primitive"),e),...s}),zl=.8,G=({dimensions:e,orientation:t="left",children:s,className:n,color:r,style:o={},scale:l=1,...a})=>{e=c.direction$1.construct(t)==="y"?c.dimensions.swap(e):e;const d=c.cssString(r);return r!=null&&(o[c.CSS.var("symbol-color")]=new c.Color(r).rgbString),i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:c.dimensions.svgViewBox(e),className:c.CSS(c.CSS.loc(t),n),fill:d,stroke:d,...a,style:{aspectRatio:`${e.width} / ${e.height}`,width:c.dimensions.scale(e,l*zl).width,...o},children:i.jsxRuntimeExports.jsx("g",{children:s})})},Un=({className:e,orientation:t,scale:s,color:n,...r})=>i.jsxRuntimeExports.jsxs($e,{...r,orientation:t,className:c.CSS(c.CSS.B("four-way-valve"),e),children:[i.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:"left",left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:"left",left:100,top:50,id:"2"}),i.jsxRuntimeExports.jsx(T,{location:"top",orientation:"left",left:50,top:0,id:"3"}),i.jsxRuntimeExports.jsx(T,{location:"bottom",orientation:"left",left:50,top:100,id:"4"})]}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:87},color:n,scale:s,children:[i.jsxRuntimeExports.jsx(I,{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"}),i.jsxRuntimeExports.jsx(I,{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"})]})]}),Wn=({color:e,orientation:t="left",scale:s,...n})=>i.jsxRuntimeExports.jsxs($e,{...n,className:c.CSS(c.CSS.B("three-way-valve")),orientation:t,children:[i.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[i.jsxRuntimeExports.jsx(T,{location:"bottom",orientation:t,left:50,top:100,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"left",orientation:t,left:0,top:33,id:"2"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:t,left:100,top:33,id:"3"})]}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:64},color:e,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(I,{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"}),i.jsxRuntimeExports.jsx(I,{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"})]})]}),Kn=({orientation:e="left",color:t,scale:s,...n})=>i.jsxRuntimeExports.jsxs($e,{...n,children:[i.jsxRuntimeExports.jsxs(Z,{orientation:e,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:e,left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:e,left:100,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(G,{dimensions:{width:87,height:42},color:t,orientation:e,scale:s,children:i.jsxRuntimeExports.jsx(I,{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"})})]}),qn=({className:e,color:t,orientation:s="left",normallyOpen:n=!1,scale:r,...o})=>i.jsxRuntimeExports.jsxs($e,{className:c.CSS(c.CSS.B("solenoid-valve"),n&&c.CSS.M("normally-open"),e),...o,children:[i.jsxRuntimeExports.jsxs(Z,{orientation:s,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:s,left:1,top:69,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:s,left:99,top:69,id:"2"})]}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:69},color:t,orientation:s,scale:r,children:[i.jsxRuntimeExports.jsx(I,{className:c.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"}),i.jsxRuntimeExports.jsx(I,{d:"M43.5 47L43.5 24.6177"}),i.jsxRuntimeExports.jsx(_l,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),Xn=({className:e,orientation:t="left",color:s,scale:n,...r})=>i.jsxRuntimeExports.jsxs(Q,{orientation:t,className:c.CSS(c.CSS.B("relief-valve"),e),...r,children:[i.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:t,left:1,top:66,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:t,left:99,top:66,id:"2"})]}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:58},color:s,orientation:t,scale:n,children:[i.jsxRuntimeExports.jsx(I,{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"}),i.jsxRuntimeExports.jsx(I,{d:"M43.5 2L43.5 38",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(I,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(I,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(I,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Qn=({className:e,orientation:t="left",color:s,scale:n,...r})=>i.jsxRuntimeExports.jsxs(Q,{orientation:t,className:c.CSS(c.CSS.B("check-valve"),e),...r,children:[i.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:t,left:1,top:50,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:45,height:43},color:s,orientation:t,scale:n,children:[i.jsxRuntimeExports.jsx(I,{d:"M43 2L43 40",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(I,{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"})]})]}),Jn=({color:e,className:t,orientation:s="left",scale:n,...r})=>i.jsxRuntimeExports.jsxs($e,{...r,orientation:s,className:c.CSS(c.CSS.B("angled-valve"),t),children:[i.jsxRuntimeExports.jsxs(Z,{orientation:s,children:[i.jsxRuntimeExports.jsx(T,{location:"bottom",orientation:s,left:33,top:100,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:s,left:100,top:35,id:"2"})]}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:64},color:e,orientation:s,scale:n,children:[i.jsxRuntimeExports.jsx(I,{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"}),i.jsxRuntimeExports.jsx(I,{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"}),i.jsxRuntimeExports.jsx(I,{d:"M24.3461 18.5709L21.7484 19.88C20.9998 20.2572 20.3887 20.8601 20.0012 21.6035L19.3383 22.8756"})]})]}),er=({color:e,className:t,orientation:s="left",scale:n,...r})=>i.jsxRuntimeExports.jsxs($e,{...r,className:c.CSS(c.CSS.B("pump"),t),orientation:s,children:[i.jsxRuntimeExports.jsxs(Z,{orientation:s,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:s,left:1,top:39,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:s,left:95,top:3,id:"2"})]}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:68,height:61},color:e,orientation:s,scale:n,children:[i.jsxRuntimeExports.jsx(Dl,{cx:"35",cy:"25",r:"23"}),i.jsxRuntimeExports.jsx(I,{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"}),i.jsxRuntimeExports.jsx(Tt,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),i.jsxRuntimeExports.jsx(Tt,{x1:"1",y1:"24",x2:"35",y2:"24"})]})]}),tr=({className:e,color:t,orientation:s="left",scale:n,...r})=>{const o=c.cssString(t);return i.jsxRuntimeExports.jsxs(Q,{...r,className:c.CSS(c.CSS.B("symbol"),e),children:[i.jsxRuntimeExports.jsx(Z,{orientation:s,children:i.jsxRuntimeExports.jsx(T,{location:"left",orientation:s,left:2,top:50,id:"1"})}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:40,height:48},color:t,orientation:s,scale:n,children:[i.jsxRuntimeExports.jsx(I,{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"}),i.jsxRuntimeExports.jsx(I,{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:o}),i.jsxRuntimeExports.jsx(I,{d:"M33 24H3",strokeLinecap:"round"})]})]})},sr=({className:e,orientation:t="left",color:s,scale:n,...r})=>i.jsxRuntimeExports.jsxs(Q,{className:c.CSS(c.CSS.B("cap"),e),...r,children:[i.jsxRuntimeExports.jsx(Z,{orientation:t,children:i.jsxRuntimeExports.jsx(T,{location:"left",orientation:t,left:0,top:50,id:"1"})}),i.jsxRuntimeExports.jsx(G,{color:s,dimensions:{width:26,height:48},orientation:t,scale:n,children:i.jsxRuntimeExports.jsx(I,{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"})})]}),nr=({className:e,orientation:t="left",color:s,scale:n,...r})=>i.jsxRuntimeExports.jsxs(Q,{className:c.CSS(c.CSS.B("manual-valve"),e),...r,children:[i.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:t,left:1,top:58,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:t,left:99,top:58,id:"2"})]}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:48},color:s,orientation:t,scale:n,children:[i.jsxRuntimeExports.jsx(Tt,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),i.jsxRuntimeExports.jsx(I,{d:"M19.64 2L66.68 2",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(I,{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"})]})]}),rr=({className:e,orientation:t="left",color:s,scale:n,...r})=>i.jsxRuntimeExports.jsxs(Q,{className:c.CSS(c.CSS.B("filter"),e),...r,children:[i.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:t,left:2,top:50,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:t,left:98,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(G,{dimensions:{width:52,height:34},orientation:t,color:s,scale:n,children:i.jsxRuntimeExports.jsx(I,{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"})})]}),Fl=e=>typeof e=="number"?{topLeft:c.xy.construct(e),topRight:c.xy.construct(e),bottomLeft:c.xy.construct(e),bottomRight:c.xy.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:c.xy.construct(e.topLeft),topRight:c.xy.construct(e.topRight),bottomLeft:c.xy.construct(e.bottomLeft),bottomRight:c.xy.construct(e.bottomRight)}:e,Zl=e=>{const{topLeft:t,topRight:s,bottomLeft:n,bottomRight:r}=e;return`${t.x}% ${s.x}% ${r.x}% ${n.x}% / ${t.y}% ${s.y}% ${r.y}% ${n.y}%`},Yl={width:40,height:80},Hl={x:50,y:10},or=({className:e,dimensions:t=Yl,borderRadius:s=Hl,color:n,...r})=>{const o=Fl(s),l=m.use();return i.jsxRuntimeExports.jsx(Q,{className:c.CSS(e,c.CSS.B("tank")),style:{...t,borderRadius:Zl(o),borderColor:c.cssString(n??l.colors.gray.l9)},...r,children:i.jsxRuntimeExports.jsxs(Z,{children:[i.jsxRuntimeExports.jsx(T,{location:"top",orientation:"left",left:50,top:0,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"top",orientation:"left",left:-.5,top:o.topLeft.y-1,id:"2"}),i.jsxRuntimeExports.jsx(T,{location:"top",orientation:"left",left:101,top:o.topRight.y-1,id:"3"}),i.jsxRuntimeExports.jsx(T,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),i.jsxRuntimeExports.jsx(T,{location:"bottom",orientation:"left",left:-.5,top:100-o.bottomLeft.y+1,id:"5"}),i.jsxRuntimeExports.jsx(T,{location:"bottom",orientation:"left",left:101,top:100-o.bottomRight.y+1,id:"6"}),i.jsxRuntimeExports.jsx(T,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},ir=({className:e,orientation:t="left",color:s,scale:n,...r})=>i.jsxRuntimeExports.jsxs(Q,{className:c.CSS(e,c.CSS.B("regulator")),...r,children:[i.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:t,left:0,top:66,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:t,left:100,top:66,id:"2"})]}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:84,height:58},orientation:t,color:s,scale:n,children:[i.jsxRuntimeExports.jsx(I,{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"}),i.jsxRuntimeExports.jsx(I,{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"})]})]}),lr=({className:e,orientation:t="left",scale:s,color:n,...r})=>i.jsxRuntimeExports.jsxs(Q,{className:c.CSS(c.CSS.B("orifice"),e),...r,children:[i.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:t,left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:t,left:100,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:70,height:34},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(I,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(I,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),cr=({className:e,orientation:t="left",color:s,scale:n,...r})=>i.jsxRuntimeExports.jsxs(Q,{className:c.CSS(c.CSS.B("needle-valve"),e),...r,children:[i.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:t,left:1,top:50,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:t,left:99,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:87,height:42},orientation:t,color:s,scale:n,children:[i.jsxRuntimeExports.jsx(I,{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:c.cssString(s)}),i.jsxRuntimeExports.jsx(I,{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"})]})]}),ar=({className:e,orientation:t="left",color:s,scale:n,...r})=>i.jsxRuntimeExports.jsxs(Q,{orientation:t,className:c.CSS(c.CSS.B("angled-relief-valve"),e),...r,children:[i.jsxRuntimeExports.jsxs(Z,{children:[i.jsxRuntimeExports.jsx(T,{location:"bottom",orientation:t,left:33,top:100,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:t,left:100,top:45,id:"2"})]}),i.jsxRuntimeExports.jsxs(G,{dimensions:{width:64,height:79},orientation:t,color:s,scale:n,children:[i.jsxRuntimeExports.jsx(I,{d:"M20.75 2L20.75 38",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(I,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(I,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(I,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(I,{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"}),i.jsxRuntimeExports.jsx(I,{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"}),i.jsxRuntimeExports.jsx(I,{d:"M24.3461 33.5709L21.7484 34.88C20.9998 35.2572 20.3887 35.8601 20.0012 36.6035L19.3383 37.8756"})]})]}),ur=({className:e,color:t,dimensions:s,orientation:n,...r})=>i.jsxRuntimeExports.jsxs(Q,{className:c.CSS(c.CSS.B("value"),e),...r,style:{borderColor:c.cssString(t),...s},children:[i.jsxRuntimeExports.jsxs(Z,{orientation:n,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:"left",left:-2,top:50,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:"left",left:102,top:50,id:"2"}),i.jsxRuntimeExports.jsx(T,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),i.jsxRuntimeExports.jsx(T,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),r.children]}),dr=({triggered:e,enabled:t=!1,color:s,onClick:n,orientation:r="left",...o})=>i.jsxRuntimeExports.jsxs(Q,{orientation:r,children:[i.jsxRuntimeExports.jsx(m.Switch$1,{value:t,onClick:n,onChange:()=>{},...o}),i.jsxRuntimeExports.jsxs(Z,{orientation:r,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:r,left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:r,left:100,top:50,id:"2"})]})]}),xr=({onClick:e,orientation:t="left",label:s=""})=>i.jsxRuntimeExports.jsxs(Q,{orientation:t,children:[i.jsxRuntimeExports.jsx(m.Button,{onClick:e,children:s}),i.jsxRuntimeExports.jsxs(Z,{orientation:t,children:[i.jsxRuntimeExports.jsx(T,{location:"left",orientation:t,left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(T,{location:"right",orientation:t,left:100,top:50,id:"2"}),i.jsxRuntimeExports.jsx(T,{location:"top",orientation:t,left:50,top:0,id:"3"}),i.jsxRuntimeExports.jsx(T,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),je=({aetherKey:e,source:t,sink:s})=>{const n=m.useMemoDeepEqualProps({source:t,sink:s}),[,{triggered:r,enabled:o},l]=m.use$3({aetherKey:e,type:j.Toggle.TYPE,schema:j.toggleStateZ,initialState:{triggered:!1,enabled:!1,...n}});return p.useEffect(()=>{l(u=>({...u,...n}))},[n,l]),{toggle:p.useCallback(()=>l(u=>({...u,triggered:!u.triggered})),[l]),triggered:r,enabled:o}},hr=e=>c.direction$1.construct(e)==="x"?c.location.swap(e):e,Gl=e=>c.direction$1.construct(e)==="y"?c.location.swap(e):e,he=({showChip:e=!0,showIndicator:t=!0,indicator:s,orientation:n="left",chip:r,children:o,...l})=>i.jsxRuntimeExports.jsxs(V.Space,{direction:c.location.rotate90(n),align:"center",justify:"center",empty:!0,...l,children:[i.jsxRuntimeExports.jsxs(V.Space,{direction:c.direction$1.construct(n),align:"center",className:c.CSS(c.CSS.B("control-state")),size:"small",children:[e&&i.jsxRuntimeExports.jsx(Gn,{size:"small",...r}),t&&i.jsxRuntimeExports.jsx(Hn,{...s})]}),o]}),Ul=m.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:s,control:n,source:r,sink:o,orientation:l="left",color:a})=>{const{enabled:u,triggered:d,toggle:x}=je({aetherKey:e,source:r,sink:o});return i.jsxRuntimeExports.jsx(F,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(he,{...n,orientation:hr(l),children:i.jsxRuntimeExports.jsx(Wn,{enabled:u,triggered:d,onClick:x,orientation:l,color:a})})})}),Wl=e=>i.jsxRuntimeExports.jsx(Wn,{...e}),Kl=m.wrap$1("Valve",({control:e,aetherKey:t,label:s,onChange:n,source:r,sink:o,orientation:l,color:a})=>{const{enabled:u,triggered:d,toggle:x}=je({aetherKey:t,source:r,sink:o});return i.jsxRuntimeExports.jsx(F,{...s,onChange:n,children:i.jsxRuntimeExports.jsx(he,{...e,orientation:l,children:i.jsxRuntimeExports.jsx(Kn,{enabled:u,triggered:d,onClick:x,orientation:l,color:a})})})}),ql=e=>i.jsxRuntimeExports.jsx(Kn,{...e}),Xl=m.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:s,orientation:n="left",normallyOpen:r,color:o,source:l,sink:a,control:u})=>{const{enabled:d,triggered:x,toggle:h}=je({aetherKey:e,source:l,sink:a});return i.jsxRuntimeExports.jsx(F,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(he,{...u,orientation:Gl(n),children:i.jsxRuntimeExports.jsx(qn,{enabled:d,triggered:x,onClick:h,orientation:n,color:o,normallyOpen:r})})})}),Ql=e=>i.jsxRuntimeExports.jsx(qn,{...e}),Jl=m.wrap$1("FourWayValve",({aetherKey:e,control:t,label:s,onChange:n,orientation:r,color:o})=>{const{enabled:l,triggered:a,toggle:u}=je({aetherKey:e});return i.jsxRuntimeExports.jsx(F,{...s,onChange:n,children:i.jsxRuntimeExports.jsx(he,{...t,orientation:r,children:i.jsxRuntimeExports.jsx(Un,{enabled:l,triggered:a,onClick:u,orientation:r,color:o})})})}),ec=e=>i.jsxRuntimeExports.jsx(Un,{...e}),tc=m.wrap$1("AngleValve",({aetherKey:e,label:t,control:s,onChange:n,orientation:r,color:o,...l})=>{const{enabled:a,triggered:u,toggle:d}=je({aetherKey:e});return i.jsxRuntimeExports.jsx(F,{...t,onChange:n,children:i.jsxRuntimeExports.jsx(he,{...s,orientation:hr(r),children:i.jsxRuntimeExports.jsx(Jn,{enabled:a,triggered:u,onClick:d,orientation:r,color:o})})})}),sc=e=>i.jsxRuntimeExports.jsx(Jn,{...e}),nc=m.wrap$1("Pump",({aetherKey:e,label:t,control:s,onChange:n,orientation:r,color:o})=>{const{enabled:l,triggered:a,toggle:u}=je({aetherKey:e});return i.jsxRuntimeExports.jsx(F,{...t,onChange:n,children:i.jsxRuntimeExports.jsx(he,{...s,orientation:r,children:i.jsxRuntimeExports.jsx(er,{enabled:l,triggered:a,onClick:u,orientation:r,color:o})})})}),rc=e=>i.jsxRuntimeExports.jsx(er,{...e}),oc=m.wrap$1("Tank",({label:e,onChange:t,orientation:s,color:n,dimensions:r,borderRadius:o})=>i.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(or,{orientation:s,color:n,dimensions:r,borderRadius:o})})),ic=e=>i.jsxRuntimeExports.jsx(or,{...e,dimensions:{width:25,height:50}}),lc=({label:e,onChange:t,orientation:s,color:n})=>i.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(Xn,{orientation:s,color:n})}),cc=e=>i.jsxRuntimeExports.jsx(Xn,{...e}),ac=({label:e,onChange:t,orientation:s,color:n})=>i.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(ir,{orientation:s,color:n})}),uc=e=>i.jsxRuntimeExports.jsx(ir,{...e}),dc=({label:e,onChange:t,orientation:s,color:n})=>i.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(tr,{orientation:s,color:n})}),xc=e=>i.jsxRuntimeExports.jsx(tr,{...e}),hc=({label:e,onChange:t,orientation:s,color:n})=>i.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(sr,{orientation:s,color:n})}),pc=e=>i.jsxRuntimeExports.jsx(sr,{...e}),mc=({label:e,onChange:t,orientation:s,color:n})=>i.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(nr,{orientation:s,color:n})}),fc=e=>i.jsxRuntimeExports.jsx(nr,{...e}),gc=({label:e,onChange:t,orientation:s,color:n})=>i.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(rr,{orientation:s,color:n})}),jc=e=>i.jsxRuntimeExports.jsx(rr,{...e}),Ec=({label:e,onChange:t,orientation:s,color:n})=>i.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(cr,{orientation:s,color:n})}),Sc=e=>i.jsxRuntimeExports.jsx(cr,{...e}),Rc=({label:e,onChange:t,orientation:s,color:n})=>i.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(Qn,{orientation:s,color:n})}),bc=e=>i.jsxRuntimeExports.jsx(Qn,{...e}),vc=({label:e,onChange:t,orientation:s,color:n})=>i.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(lr,{orientation:s,color:n})}),Cc=e=>i.jsxRuntimeExports.jsx(lr,{...e}),yc=({label:e,onChange:t,orientation:s,color:n})=>i.jsxRuntimeExports.jsx(F,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(ar,{orientation:s,color:n})}),wc=e=>i.jsxRuntimeExports.jsx(ar,{...e}),$c=m.wrap$1("Value",({aetherKey:e,label:t,level:s="p",position:n,className:r,children:o,textColor:l,color:a,precision:u,width:d,telem:x,onChange:h})=>{const f=Qe.useTypography(s),[g,E]=p.useState(c.box$1.ZERO),S=(f.lineHeight+2)*f.baseSize+2,R=m.useResize(E,{}),b=j.useInitialViewport().zoom,C=Mc((t==null?void 0:t.orientation)??"top",b,g,S,n);return zn({aetherKey:e,color:l,level:s,box:C,telem:x,precision:u,width:d}),i.jsxRuntimeExports.jsx(F,{className:c.CSS(r,c.CSS.B("value-labeled")),align:"center",ref:R,onChange:h,...t,children:i.jsxRuntimeExports.jsx(ur,{color:a,dimensions:{height:S,width:100},children:o})})}),Mc=(e,t,s,n,r)=>e==="left"?c.box$1.construct(((r==null?void 0:r.x)??c.box$1.left(s))+c.box$1.width(s)/t-100,(r==null?void 0:r.y)??c.box$1.top(s),100,n):e==="right"?c.box$1.construct((r==null?void 0:r.x)??c.box$1.left(s),(r==null?void 0:r.y)??c.box$1.top(s),100,n):e==="bottom"?c.box$1.construct((r==null?void 0:r.x)??c.box$1.left(s),(r==null?void 0:r.y)??c.box$1.top(s),c.box$1.width(s)/t,n):c.box$1.construct((r==null?void 0:r.x)??c.box$1.left(s),((r==null?void 0:r.y)??c.box$1.top(s))+c.box$1.height(s)/t-n,c.box$1.width(s)/t,n),Tc=({color:e})=>i.jsxRuntimeExports.jsx(ur,{color:e,dimensions:{width:60,height:25},children:i.jsxRuntimeExports.jsx(m.Text,{level:"small",children:"500 psi"})}),kc=m.wrap$1("Switch",({aetherKey:e,label:t,control:s,onChange:n,orientation:r,color:o,source:l,sink:a})=>{const{enabled:u,triggered:d,toggle:x}=je({aetherKey:e,source:l,sink:a});return i.jsxRuntimeExports.jsx(F,{...t,onChange:n,children:i.jsxRuntimeExports.jsx(he,{...s,orientation:r,children:i.jsxRuntimeExports.jsx(dr,{enabled:u,triggered:d,onClick:x,orientation:r,color:o})})})}),Lc=e=>i.jsxRuntimeExports.jsx(dr,{...e}),Pc=m.wrap$1("Button",({aetherKey:e,label:t,orientation:s,sink:n,control:r})=>{const{click:o}=Nl({aetherKey:e,sink:n});return i.jsxRuntimeExports.jsx(he,{...r,className:c.CSS.B("symbol"),orientation:s,children:i.jsxRuntimeExports.jsx(xr,{label:t==null?void 0:t.label,onClick:o})})}),Oc=({label:e,...t})=>i.jsxRuntimeExports.jsx(xr,{label:"Button",...t}),Ic=["threeWayValve","valve","solenoidValve","fourWayValve","angledValve","pump","tank","reliefValve","regulator","burstDisc","cap","manualValve","filter","needleValve","checkValve","orifice","angledReliefValve","value","button","switch"];Sr.z.enum(Ic);const ut={source:j.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:j.streamChannelValue({channel:0}),threshold:j.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"}),sink:j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:0}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},Nc={name:"Three Way Valve",variant:"threeWayValve",Form:we,Symbol:Ul,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Three Way Valve",level:"p",orientation:"top"},...ut,orientation:"left"}),Preview:Wl},_c={name:"Valve",variant:"valve",Form:we,Symbol:Kl,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Valve",level:"p",orientation:"top"},orientation:"left",...ut}),Preview:ql},Dc={name:"Solenoid Valve",variant:"solenoidValve",Form:Cl,Symbol:Xl,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Solenoid Valve",level:"p",orientation:"top"},orientation:"left",...ut}),Preview:Ql},Ac={name:"Four Way Valve",variant:"fourWayValve",Form:we,Symbol:Jl,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Four Way Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:ec},Vc={name:"Angled Valve",variant:"angledValve",Form:we,Symbol:tc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Angled Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:sc},Bc={name:"Pump",variant:"pump",Form:we,Symbol:nc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Pump",level:"p",orientation:"top"},orientation:"left"}),Preview:rc},zc={name:"Tank",variant:"tank",Form:yl,Symbol:oc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Tank",level:"p",orientation:"top"},dimensions:{width:100,height:200},orientation:"left"}),Preview:ic},Fc={name:"Relief Valve",variant:"reliefValve",Form:re,Symbol:lc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Relief Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:cc},Zc={name:"Regulator",variant:"regulator",Form:re,Symbol:ac,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Regulator",level:"p",orientation:"top"},orientation:"left"}),Preview:uc},Yc={name:"Burst Disc",variant:"burstDisc",Form:re,Symbol:dc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Burst Disc",level:"p",orientation:"top"},orientation:"left"}),Preview:xc},Hc={name:"Cap",variant:"cap",Form:re,Symbol:hc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Cap",level:"p",orientation:"top"},orientation:"left"}),Preview:pc},Gc={name:"Manual Valve",variant:"manualValve",Form:re,Symbol:mc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Manual Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:fc},Uc={name:"Filter",variant:"filter",Form:re,Symbol:gc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Filter",level:"p",orientation:"top"},orientation:"left"}),Preview:jc},Wc={name:"Needle Valve",variant:"needleValve",Form:re,Symbol:Ec,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Needle Valve",level:"p"},orientation:"left"}),Preview:Sc},Kc={name:"Check Valve",variant:"checkValve",Form:re,Symbol:Rc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Check Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:bc},qc={name:"Orifice",variant:"orifice",Form:re,Symbol:vc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Orifice",level:"p",orientation:"top"},orientation:"left"}),Preview:Cc},Xc={name:"Angled Relief Valve",variant:"angledReliefValve",Form:re,Symbol:yc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,label:{label:"Angled Relief Valve",level:"p",orientation:"top"},orientation:"left"}),Preview:wc},Qc={name:"Value",variant:"value",Form:Ml,Symbol:$c,Preview:Tc,defaultProps:e=>({color:e.colors.gray.l9.rgba255,level:"small",label:{label:"Value",level:"p",orientation:"top"},orientation:"left",telem:j.sourcePipeline("string",{connections:[{from:"valueStream",to:"stringify"}],segments:{valueStream:j.streamChannelValue({channel:0}),stringify:j.stringifyNumber({precision:2})},outlet:"stringify"})})},Jc={name:"Button",variant:"button",Symbol:Pc,Form:kl,Preview:Oc,defaultProps:e=>({label:{label:"Button",level:"p",orientation:"top"},orientation:"left",sink:j.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:j.setChannelValue({channel:0}),setpoint:j.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})})},ea={name:"Switch",variant:"switch",Symbol:kc,Preview:Lc,Form:we,defaultProps:e=>({label:{label:"Switch",level:"p",orientation:"top"},orientation:"left",...ut})},ta={value:Qc,threeWayValve:Nc,valve:_c,solenoidValve:Dc,fourWayValve:Ac,angledValve:Vc,pump:Bc,tank:zc,reliefValve:Fc,regulator:Zc,burstDisc:Yc,cap:Hc,manualValve:Gc,filter:Uc,needleValve:Wc,checkValve:Kc,orifice:qc,angledReliefValve:Xc,button:Jc,switch:ea},sa=Object.freeze(Object.defineProperty({__proto__:null,SYMBOLS:ta},Symbol.toStringTag,{value:"Module"}));p.createContext({instrumentation:se.C.NOOP});const na=m.wrap$1(j.Provider$1.TYPE,({aetherKey:e,children:t,...s})=>{const n=m.useMemoDeepEqualProps(s),[{path:r},,o]=m.use$3({aetherKey:e,type:j.Provider$1.TYPE,schema:j.providerStateZ$1,initialState:n});return p.useEffect(()=>{o(n)},[n,o]),i.jsxRuntimeExports.jsx(m.Composite,{path:r,children:t})}),pr=m.wrap$1(j.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:s}]=m.use$3({aetherKey:t,type:j.BaseProvider.TYPE,schema:j.providerStateZ,initialState:{}});return i.jsxRuntimeExports.jsx(m.Composite,{path:s,children:e})}),ra=Object.freeze(Object.defineProperty({__proto__:null,Provider:pr},Symbol.toStringTag,{value:"Module"}));exports.AliasInput=fi;exports.AliasProvider=mi;exports.Background=al;exports.Bar=Ne;exports.Canvas=$o;exports.Chip=Gn;exports.Column=Fe;exports.Context=At;exports.Controller=Ll;exports.Controls=ul;exports.Core=Le;exports.Core$1=tt;exports.DEFAULT_TRIGGERS=Dt;exports.Diagram=hl;exports.Drawer=yi;exports.Filter=Bt;exports.FitViewControl=xl;exports.HAUL_CREATE_TYPE=Gt;exports.HAUL_DROP_TYPE=Xe;exports.HAUL_TYPE=be;exports.HandleLayout=_n;exports.Hover=cn;exports.Indicator=Hn;exports.LabelSpec=Mt;exports.Legend=Il;exports.Line=Lo;exports.Line$1=ko;exports.LinePlot=Mo;exports.List=st;exports.MASK_MODES=en;exports.MODES=Io;exports.Mask=_t;exports.Measure=fn;exports.Measure$1=di;exports.Mosaic=qe;exports.Multiple=It;exports.Multiple$1=xn;exports.NodeLayout=lt;exports.NodeRenderer=Vn;exports.PAN_DEFAULT_TRIGGERS=tn;exports.Provider=on;exports.Provider$1=na;exports.Provider$2=jn;exports.Provider$3=pr;exports.Provider$4=pi;exports.Provider$5=ra;exports.REGISTRY=Rl;exports.Rule=gn;exports.Rule$1=xi;exports.SELECT_DEFAULT_TRIGGERS=sn;exports.Search=Vt;exports.SelectMultiple=gi;exports.SelectSingle=Pe;exports.Selector=zt;exports.Simple=Ks;exports.Single=Us;exports.Single$1=hn;exports.StateProvider=Pl;exports.StringTD=jl;exports.TR=gl;exports.Table=pl;exports.Tag=Ft;exports.Tag$1=si;exports.ToggleEditControl=dl;exports.Tooltip=ai;exports.Tree=_i;exports.Viewport=ii;exports.XAxis=li;exports.YAxis=ci;exports.ZOOM_DEFAULT_TRIGGERS=ze;exports.axisFactory=Zt;exports.calculateDiffPercentage=Gs;exports.corePropsZ=bl;exports.createFilterTransform=Zs;exports.fuseFilter=Fs;exports.initialProps=Bn;exports.registry=sa;exports.selectNode=Kt;exports.selectNodeBox=X;exports.selectNodeLayout=el;exports.selectViewportEl=pn;exports.use=nn;exports.use$1=rl;exports.use$2=zn;exports.use$3=Ie;exports.use$4=vi;exports.useActiveRange=Ht;exports.useAlias=Sn;exports.useAliases=nt;exports.useContext=ie;exports.useContext$1=Oe;exports.useContext$2=En;exports.useContext$3=ct;exports.useContext$4=Yn;exports.useDebouncedCallback=Je;exports.useDrawer=Ci;exports.useGridPosition=Qs;exports.useMultiple=Hs;exports.useName=Rn;exports.useTransforms=Ys;exports.useViewport=Xs;
50
+ //# sourceMappingURL=TimeRangeChip-jQH9NacG.cjs.map