cli-jaw 2.17.17 → 2.17.18

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 (289) hide show
  1. package/dist/bin/commands/skill.js +10 -11
  2. package/dist/bin/commands/skill.js.map +1 -1
  3. package/dist/bin/commands/status.js +40 -6
  4. package/dist/bin/commands/status.js.map +1 -1
  5. package/dist/lib/mcp/skills-reset.js +8 -7
  6. package/dist/lib/mcp/skills-reset.js.map +1 -1
  7. package/dist/lib/mcp/skills-utils.js +44 -0
  8. package/dist/lib/mcp/skills-utils.js.map +1 -1
  9. package/dist/scripts/check-deps-audit.js +89 -0
  10. package/dist/scripts/check-deps-audit.js.map +1 -0
  11. package/dist/src/discord/send-only-client.js +2 -1
  12. package/dist/src/discord/send-only-client.js.map +1 -1
  13. package/dist/src/manager/memory/federation.js +5 -0
  14. package/dist/src/manager/memory/federation.js.map +1 -1
  15. package/dist/src/manager/memory/instance-discovery.js +27 -4
  16. package/dist/src/manager/memory/instance-discovery.js.map +1 -1
  17. package/dist/src/manager/server.js +1 -0
  18. package/dist/src/manager/server.js.map +1 -1
  19. package/dist/src/prompt/builder.js +8 -7
  20. package/dist/src/prompt/builder.js.map +1 -1
  21. package/dist/src/prompt/templates/a1-system.md +5 -1
  22. package/dist/src/prompt/templates/skills.md +6 -0
  23. package/dist/src/slack/api.js +7 -0
  24. package/dist/src/slack/api.js.map +1 -1
  25. package/dist/src/slack/slack-file.js +8 -0
  26. package/dist/src/slack/slack-file.js.map +1 -1
  27. package/dist/src/telegram/bot.js +32 -3
  28. package/dist/src/telegram/bot.js.map +1 -1
  29. package/dist/src/telegram/rich-message.js +40 -12
  30. package/dist/src/telegram/rich-message.js.map +1 -1
  31. package/package.json +4 -3
  32. package/public/dist/assets/{AdvancedExport-IOkupLFE.js → AdvancedExport-tXydxVAh.js} +1 -1
  33. package/public/dist/assets/{Agent-CVt8RCVj.js → Agent-BjxJRsKG.js} +1 -1
  34. package/public/dist/assets/{Browser-J4TPo4bX.js → Browser-Dm5J1gXP.js} +1 -1
  35. package/public/dist/assets/{ChannelEnablementControl-Da_t_jq6.js → ChannelEnablementControl-B9KiYDZZ.js} +1 -1
  36. package/public/dist/assets/{ChannelsDiscord-kNjCCJcA.js → ChannelsDiscord-D6jmfyHe.js} +1 -1
  37. package/public/dist/assets/{ChannelsSlack-U0_Sfkz0.js → ChannelsSlack-BcykASIN.js} +1 -1
  38. package/public/dist/assets/{ChannelsTelegram-DBIFDz4R.js → ChannelsTelegram-XkNtVi8o.js} +1 -1
  39. package/public/dist/assets/{CodeCanvas-CaeLVtZi.js → CodeCanvas-D-JH2Ikl.js} +2 -2
  40. package/public/dist/assets/{DashboardMeta-Dsj8kEuW.js → DashboardMeta-D6nJsY8n.js} +1 -1
  41. package/public/dist/assets/{Display-nkXitDjD.js → Display-B25HqCMH.js} +1 -1
  42. package/public/dist/assets/{DocPanel-ogNttSee.js → DocPanel-qiqo6365.js} +1 -1
  43. package/public/dist/assets/{Employees-CU_1YnrA.js → Employees-CR41RcWo.js} +1 -1
  44. package/public/dist/assets/{Heartbeat-BeGhWW4a.js → Heartbeat-B8c_YvS7.js} +1 -1
  45. package/public/dist/assets/{MarkdownRenderer-Cd3kkg_s.js → MarkdownRenderer-DZ-hWmCB.js} +3 -3
  46. package/public/dist/assets/MarkdownRenderer-uwE0Wam5.js +1 -0
  47. package/public/dist/assets/{Mcp-2HD1qR7F.js → Mcp-DSIEQZfH.js} +1 -1
  48. package/public/dist/assets/{Memory-I30i-svi.js → Memory-BY88ur_h.js} +1 -1
  49. package/public/dist/assets/{MilkdownWysiwygEditor-BkEzO5cz.js → MilkdownWysiwygEditor-DanGAZL5.js} +1 -1
  50. package/public/dist/assets/{ModelProvider-B96RCkFb.js → ModelProvider-mtAtYLmW.js} +1 -1
  51. package/public/dist/assets/{Network-DfzqHi9q.js → Network-ByNu-VCZ.js} +1 -1
  52. package/public/dist/assets/{NotesGraphWorkspace-BRIiraP9.js → NotesGraphWorkspace-Be6ctzYE.js} +1 -1
  53. package/public/dist/assets/Permissions-B-74b-nO.js +1 -0
  54. package/public/dist/assets/{Permissions-RgyF1O6q.js → Permissions-x_6_kLC1.js} +1 -1
  55. package/public/dist/assets/{Profile-DXKtAzfg.js → Profile-Bf9-QN2Y.js} +1 -1
  56. package/public/dist/assets/{Prompts-C7njPWCu.js → Prompts-DGDw56NQ.js} +1 -1
  57. package/public/dist/assets/{SpeechKeys-B7SDWzo9.js → SpeechKeys-CIq4c1iz.js} +1 -1
  58. package/public/dist/assets/{TelegramHub-C61X3f-H.js → TelegramHub-BrCeAZEf.js} +1 -1
  59. package/public/dist/assets/abnfDiagram-VCTEODGH-DOF68zXc.js +1 -0
  60. package/public/dist/assets/{app-wKiMVlyi.js → app-DhDdCs_s.js} +5 -5
  61. package/public/dist/assets/architecture-7GRP2DOG-DxLizWvy.js +1 -0
  62. package/public/dist/assets/architectureDiagram-5GKGNRK7-BpxFEoT5.js +36 -0
  63. package/public/dist/assets/{bgtask-badge-BM93vlbj.js → bgtask-badge-CT6s6rND.js} +1 -1
  64. package/public/dist/assets/bgtask-badge-CidVvjWb.js +1 -0
  65. package/public/dist/assets/blockDiagram-OSKFZWR5-CRNzDJwU.js +129 -0
  66. package/public/dist/assets/c4Diagram-7LVT6UL2-Bg0DdRYW.js +38 -0
  67. package/public/dist/assets/channel-BjgXjYj8.js +1 -0
  68. package/public/dist/assets/chunk-2Q5K7J3B-BClkI2P5.js +1 -0
  69. package/public/dist/assets/chunk-2ZTRR5NV-DF9qGbFc.js +2 -0
  70. package/public/dist/assets/chunk-3NF5O7KM-DXOprKA_.js +168 -0
  71. package/public/dist/assets/chunk-3Z5EZCMW-D-umBnbE.js +1 -0
  72. package/public/dist/assets/chunk-4HAMMTFA-BzeIXjef.js +62 -0
  73. package/public/dist/assets/chunk-5V3GS4D5-DB7RMaO_.js +1 -0
  74. package/public/dist/assets/{chunk-FMBD7UC4-BEz4FhFn.js → chunk-5VM5RSS4-CEUkek2W.js} +1 -1
  75. package/public/dist/assets/chunk-6AZGARVD-qPN7cVYY.js +1 -0
  76. package/public/dist/assets/{chunk-N66VUXT2-DJVNyglo.js → chunk-6EIED4P4-Bt6lS0r9.js} +1 -1
  77. package/public/dist/assets/chunk-6K3QC6MW-BC_6hNGf.js +1 -0
  78. package/public/dist/assets/chunk-6TQVIW2G-NQr1OdRE.js +1 -0
  79. package/public/dist/assets/chunk-747NJXEK-CukETSeX.js +2 -0
  80. package/public/dist/assets/chunk-75Z2AOVW-BLiFJXcr.js +2 -0
  81. package/public/dist/assets/chunk-CLGD4ZFX-B5zkZ8n6.js +1 -0
  82. package/public/dist/assets/chunk-DU6HZSFF-CqT8wcBs.js +126 -0
  83. package/public/dist/assets/{chunk-ND2GUHAM-1k8TCCsJ.js → chunk-F27PBJKO-Ccrogyxp.js} +1 -1
  84. package/public/dist/assets/chunk-FOHPRMQF--f9XSh-3.js +161 -0
  85. package/public/dist/assets/chunk-GMAD6QVW-BJLz4nC-.js +13 -0
  86. package/public/dist/assets/chunk-GVQU2GXP-BlVn1fMW.js +1 -0
  87. package/public/dist/assets/chunk-H2I77ZZE-BXf4_vA2.js +1 -0
  88. package/public/dist/assets/{chunk-727SXJPM-CUOujQg0.js → chunk-HLEWEB6X-BKWwzzZJ.js} +2 -2
  89. package/public/dist/assets/chunk-I5DQTOEV-B46sdKHC.js +1 -0
  90. package/public/dist/assets/chunk-ICYGCRZG-CSu4gXtC.js +1 -0
  91. package/public/dist/assets/chunk-IH6LHLGP-B2m3mWfU.js +1 -0
  92. package/public/dist/assets/{chunk-4BX2VUAB-DU36Vmpr.js → chunk-JWPE2WC7-D-FE5omP.js} +1 -1
  93. package/public/dist/assets/chunk-KI3K4JFJ-Bfn6wbch.js +1 -0
  94. package/public/dist/assets/chunk-L3NEJ4N5-FGXu31jw.js +1 -0
  95. package/public/dist/assets/chunk-LNGE3PJU-Dyjtq0ks.js +34 -0
  96. package/public/dist/assets/chunk-LQGUR6SS-qUTD5FMI.js +2 -0
  97. package/public/dist/assets/chunk-OSK3NFVY-CrXjNywV.js +10 -0
  98. package/public/dist/assets/chunk-OUJLGHUK-DkWSHliq.js +2 -0
  99. package/public/dist/assets/chunk-P2QGCYS3-B-9ymCdr.js +1 -0
  100. package/public/dist/assets/chunk-POPQ4Y6H-Df0_Odad.js +1 -0
  101. package/public/dist/assets/chunk-PWAF6VOD-B1cuaLs-.js +1 -0
  102. package/public/dist/assets/chunk-SVP7TREG-DCh4QTp-.js +88 -0
  103. package/public/dist/assets/chunk-UY3FDG6J--uyeDRt4.js +1 -0
  104. package/public/dist/assets/chunk-X3CZISLH-C1s9nTVF.js +1 -0
  105. package/public/dist/assets/chunk-XHIXRSVI-CQtpMKYq.js +1 -0
  106. package/public/dist/assets/chunk-XXDRQBXY-DEwmqeYc.js +1 -0
  107. package/public/dist/assets/chunk-Y2CYZVJY-DlLjK0OJ.js +1 -0
  108. package/public/dist/assets/chunk-ZLD2IHE6-DOKyEMMC.js +231 -0
  109. package/public/dist/assets/classDiagram-CYGNFDIV-hbaxbeYd.js +1 -0
  110. package/public/dist/assets/classDiagram-v2-TLXNO2FR-_OfX3b6Y.js +1 -0
  111. package/public/dist/assets/cose-bilkent-JH36ORCC-HnUYAhwC.js +1 -0
  112. package/public/dist/assets/cynefin-OW5HDTMX-VXYSLvft.js +1 -0
  113. package/public/dist/assets/cynefinDiagram-5FMLGOSQ-D0dmg5fA.js +62 -0
  114. package/public/dist/assets/cytoscape.esm-CS3SmpXd.js +321 -0
  115. package/public/dist/assets/dagre-DDTOgfwg.js +1 -0
  116. package/public/dist/assets/dagre-OS7QT2EB-c-JkA4ju.js +4 -0
  117. package/public/dist/assets/diagram-S7CK7UJ4-CgObZnGW.js +30 -0
  118. package/public/dist/assets/diagram-UQ7AKVKN-DTiko3yH.js +41 -0
  119. package/public/dist/assets/{diagram-KO2AKTUF-uRuKS97A.js → diagram-VSXAHHWV-BtwoQsOH.js} +2 -2
  120. package/public/dist/assets/diagram-VX7I27RA-BvFpphqo.js +24 -0
  121. package/public/dist/assets/diagram-Z3DM3KII-Zq8iJClC.js +24 -0
  122. package/public/dist/assets/ebnfDiagram-PWID7BFC-_fcO3z5G.js +1 -0
  123. package/public/dist/assets/{employees-C0CQgpI9.js → employees-DCju7V1x.js} +1 -1
  124. package/public/dist/assets/erDiagram-2YWLMYGG-YIq0Go-p.js +99 -0
  125. package/public/dist/assets/eventmodeling-NTZA5JFV-Csqcv5T_.js +1 -0
  126. package/public/dist/assets/flowDiagram-T62WH6J4-Del9dfOW.js +1 -0
  127. package/public/dist/assets/ganttDiagram-EL5Y4UJY-CezfIvti.js +292 -0
  128. package/public/dist/assets/gitGraph-4MIJSDKK-D_1mlgPm.js +1 -0
  129. package/public/dist/assets/gitGraphDiagram-WWUBYQGX-Bg3OM_0S.js +106 -0
  130. package/public/dist/assets/{graphlib-B06FTUqA.js → graphlib-Cjg_soTo.js} +1 -1
  131. package/public/dist/assets/{iframe-renderer-CgCPbWs-.js → iframe-renderer-LZp7Nqm1.js} +3 -3
  132. package/public/dist/assets/iframe-renderer-aFXUtTXX.js +1 -0
  133. package/public/dist/assets/info-A6RAGUB7-ce7F80NR.js +1 -0
  134. package/public/dist/assets/infoDiagram-FKFFQAWI-Dbi9pIPw.js +2 -0
  135. package/public/dist/assets/{ishikawaDiagram-YF4QCWOH-fyJrRZTW.js → ishikawaDiagram-5VMMS53U-C1FUP-sO.js} +1 -1
  136. package/public/dist/assets/{journeyDiagram-JHISSGLW-Dd6CvR-c.js → journeyDiagram-EYS64GPL-CaEEa3uT.js} +1 -1
  137. package/public/dist/assets/{kanban-definition-UN3LZRKU-C2ZH4LXA.js → kanban-definition-UXKFOSKX-DQjqFxtj.js} +2 -2
  138. package/public/dist/assets/katex-BoGadFcG.js +1 -0
  139. package/public/dist/assets/{manager-C_EnQ0Fc.js → manager-BEvw_3H1.js} +5 -5
  140. package/public/dist/assets/memory-BcZdf_oz.js +1 -0
  141. package/public/dist/assets/{memory-8-eJn9cp.js → memory-V5caYbpS.js} +1 -1
  142. package/public/dist/assets/mermaid-loader-BcReSszT.js +1 -0
  143. package/public/dist/assets/mermaid-parser.core-CBiGpWk6.js +3 -0
  144. package/public/dist/assets/{mermaid-preprocess-0hqEN7sn.js → mermaid-preprocess-4oGDpf1X.js} +1 -1
  145. package/public/dist/assets/mermaid.core-BJIXJ0Ir.js +11 -0
  146. package/public/dist/assets/mermaid.core-J6tiqiVK.js +1 -0
  147. package/public/dist/assets/{message-history-BEy8JQHJ.js → message-history-Bp_sUDSx.js} +1 -1
  148. package/public/dist/assets/message-history-DrEPUdTy.js +1 -0
  149. package/public/dist/assets/{mindmap-definition-RKZ34NQL-DUQBUbUA.js → mindmap-definition-THT77NOG-CXOyjall.js} +1 -1
  150. package/public/dist/assets/packet-AYTQ26CC-86oNpyWh.js +1 -0
  151. package/public/dist/assets/pegDiagram-XKGWAZYB-DVD3P7WU.js +1 -0
  152. package/public/dist/assets/pie-WAS4IAKB-CMzmzfvT.js +1 -0
  153. package/public/dist/assets/pieDiagram-E7YTZNPT-DEH6UJP4.js +39 -0
  154. package/public/dist/assets/{quadrantDiagram-W4KKPZXB-lbpz07e4.js → quadrantDiagram-AXDQQJYC-CAbCNOON.js} +3 -3
  155. package/public/dist/assets/radar-RG4KPBEZ-CsDBxCx4.js +1 -0
  156. package/public/dist/assets/railroad-74A4TZTK-B6s85Oul.js +1 -0
  157. package/public/dist/assets/railroad-abnf-HS5TGJTU-jnABoAnr.js +1 -0
  158. package/public/dist/assets/railroad-ebnf-LZEXJU2U-C_VWXbk9.js +1 -0
  159. package/public/dist/assets/railroad-peg-WCYAUIDC-y3jeoP_s.js +1 -0
  160. package/public/dist/assets/railroadDiagram-O6MQD6OU-CEs81LrU.js +1 -0
  161. package/public/dist/assets/{render-B-8i-Rxq.js → render-Cd4frZ2U.js} +3 -3
  162. package/public/dist/assets/{requirementDiagram-4Y6WPE33-CrApoE_l.js → requirementDiagram-IS5BZ75X-DsPApdKv.js} +3 -3
  163. package/public/dist/assets/{sankeyDiagram-5OEKKPKP-Df1lU-mT.js → sankeyDiagram-P5KCCOFB-Im52Eou9.js} +3 -3
  164. package/public/dist/assets/{sequenceDiagram-3UESZ5HK-CelQN5jY.js → sequenceDiagram-WJ2MYXX4-BChOR6yh.js} +3 -3
  165. package/public/dist/assets/{settings-dDNt6x3f.js → settings-a0blK1fr.js} +1 -1
  166. package/public/dist/assets/{settings-core-DQCWldQD.js → settings-core-C5qo8giT.js} +1 -1
  167. package/public/dist/assets/settings-core-Cm-CmVLA.js +1 -0
  168. package/public/dist/assets/settings-mbGEtP5B.js +1 -0
  169. package/public/dist/assets/{sidebar-BDAnwLnk.js → sidebar-FbI4udzs.js} +4 -4
  170. package/public/dist/assets/sizeCapture-INFHLROL-D9Rpk-aA.js +1 -0
  171. package/public/dist/assets/{skills-BNbUv5Ty.js → skills-DeG9lWF2.js} +1 -1
  172. package/public/dist/assets/skills-G8KUeHBV.js +1 -0
  173. package/public/dist/assets/slash-commands-BYv3yboz.js +1 -0
  174. package/public/dist/assets/{slash-commands-BP2nZDmp.js → slash-commands-FoQuZXga.js} +1 -1
  175. package/public/dist/assets/stateDiagram-XQSTLZYL-B5CxGVqv.js +1 -0
  176. package/public/dist/assets/stateDiagram-v2-IH3M54BS-BmdRqxzy.js +1 -0
  177. package/public/dist/assets/swimlanes-V6O3JKXN-Ckem4dQh.js +1 -0
  178. package/public/dist/assets/swimlanesDiagram-JKAHXJPX-DW_0PiOk.js +8 -0
  179. package/public/dist/assets/{timeline-definition-PNZ67QCA-DP0lPzQ_.js → timeline-definition-24CTP7MA-CJRsjFnd.js} +2 -2
  180. package/public/dist/assets/{trace-drawer-CT83NUo4.js → trace-drawer-CWs8ydMO.js} +1 -1
  181. package/public/dist/assets/treeView-Q6P3EWNA-ChnMvz2a.js +1 -0
  182. package/public/dist/assets/treemap-WGGIJYW6-DZJ4jE42.js +1 -0
  183. package/public/dist/assets/{ui-NdMDA7kW.js → ui-Cd8etFwN.js} +2 -2
  184. package/public/dist/assets/ui-yrn3s72A.js +1 -0
  185. package/public/dist/assets/vendor-render-BpGO1zp3.js +383 -0
  186. package/public/dist/assets/vendor-render-kIxHrxDV.css +1 -0
  187. package/public/dist/assets/{vendor-utils-BK07iQND.js → vendor-utils-BUFU5ypz.js} +1 -1
  188. package/public/dist/assets/vennDiagram-4TSXK5OY-fVndHq7T.js +34 -0
  189. package/public/dist/assets/wardley-WFR3VGLG-CGM_JiX0.js +1 -0
  190. package/public/dist/assets/{wardleyDiagram-YWT4CUSO-CapVnCz5.js → wardleyDiagram-VM6X3IG4-CXIfS7ZF.js} +2 -2
  191. package/public/dist/assets/{wiki-link-resolver-N9fDy5zP.js → wiki-link-resolver-BGpGBLMp.js} +1 -1
  192. package/public/dist/assets/xychartDiagram-S5SC5T6Z-CqC-Uvuc.js +7 -0
  193. package/public/dist/index.html +2 -2
  194. package/public/dist/manager/index.html +2 -2
  195. package/scripts/audit-allowlist.json +81 -0
  196. package/scripts/check-deps-audit.ts +97 -0
  197. package/public/dist/assets/MarkdownRenderer-B6HbiZ6i.js +0 -1
  198. package/public/dist/assets/Permissions-ByUy_5DT.js +0 -1
  199. package/public/dist/assets/architecture-7EHR7CIX-Byg-B8Sh.js +0 -1
  200. package/public/dist/assets/architectureDiagram-3BPJPVTR-DA7niVYs.js +0 -36
  201. package/public/dist/assets/bgtask-badge-BjVnOXkr.js +0 -1
  202. package/public/dist/assets/blockDiagram-GPEHLZMM-czRsW1WP.js +0 -132
  203. package/public/dist/assets/c4Diagram-AAUBKEIU-zoRyRo1y.js +0 -10
  204. package/public/dist/assets/channel-Cr7Dmg2t.js +0 -1
  205. package/public/dist/assets/chunk-2J33WTMH-DMaZjiDe.js +0 -1
  206. package/public/dist/assets/chunk-3OPIFGDE-fm0Uteda.js +0 -62
  207. package/public/dist/assets/chunk-4EGX6M5U-CYPeQu4F.js +0 -1
  208. package/public/dist/assets/chunk-55IACEB6-Dkm6BnqN.js +0 -1
  209. package/public/dist/assets/chunk-5DO6E6H7-CIcLA1n6.js +0 -1
  210. package/public/dist/assets/chunk-5ZQYHXKU-NjOvV6Nd.js +0 -2
  211. package/public/dist/assets/chunk-AGHRB4JF-Cdp9MZGh.js +0 -1
  212. package/public/dist/assets/chunk-AQP2D5EJ-2nFXTQ0W.js +0 -231
  213. package/public/dist/assets/chunk-BR22UD5L-BoyFFQuR.js +0 -1
  214. package/public/dist/assets/chunk-BSJP7CBP-B1MMwNrU.js +0 -1
  215. package/public/dist/assets/chunk-CSCIHK7Q-C0MOgWVt.js +0 -123
  216. package/public/dist/assets/chunk-FHYWG6QK-CmUWtJPn.js +0 -1
  217. package/public/dist/assets/chunk-KSCS5N6A-B2XGqWQY.js +0 -10
  218. package/public/dist/assets/chunk-L5ZTLDWV-CfZ2hrJ2.js +0 -1
  219. package/public/dist/assets/chunk-LZXEDZCA-BXuFCBsZ.js +0 -2
  220. package/public/dist/assets/chunk-MPE355IW-BdSiU-oV.js +0 -1
  221. package/public/dist/assets/chunk-MZUSXYTE-VYfI8Uwx.js +0 -1
  222. package/public/dist/assets/chunk-NNHCCRGN-ChI2WAS0.js +0 -159
  223. package/public/dist/assets/chunk-NZK2D7GU-CkYWftT8.js +0 -1
  224. package/public/dist/assets/chunk-O5CBEL6O-B5g0NbhD.js +0 -11
  225. package/public/dist/assets/chunk-PUPMXCY4-DJKmByz8.js +0 -1
  226. package/public/dist/assets/chunk-QZHKN3VN-C6ktI6EQ.js +0 -1
  227. package/public/dist/assets/chunk-UIBZB4QT-DgLbPJ3_.js +0 -1
  228. package/public/dist/assets/chunk-WCWK7LTN-DWxi0w0a.js +0 -1
  229. package/public/dist/assets/chunk-WU5MYG2G-Cwe6QZ3_.js +0 -1
  230. package/public/dist/assets/chunk-XPW4576I-CaTDAC52.js +0 -32
  231. package/public/dist/assets/classDiagram-4FO5ZUOK-BzLBk9sv.js +0 -1
  232. package/public/dist/assets/classDiagram-v2-Q7XG4LA2-9K8wUz3g.js +0 -1
  233. package/public/dist/assets/cose-bilkent-S5V4N54A-B9Tcz6qW.js +0 -1
  234. package/public/dist/assets/cytoscape.esm-PBXWcYR1.js +0 -321
  235. package/public/dist/assets/dagre-BM42HDAG-OH37BMnf.js +0 -4
  236. package/public/dist/assets/dagre-BsKKQnyU.js +0 -1
  237. package/public/dist/assets/diagram-2AECGRRQ-B1t73Wn1.js +0 -43
  238. package/public/dist/assets/diagram-5GNKFQAL-DBGIcSxH.js +0 -10
  239. package/public/dist/assets/diagram-LMA3HP47-XMEHnr3B.js +0 -24
  240. package/public/dist/assets/diagram-OG6HWLK6-B_vRUJSJ.js +0 -24
  241. package/public/dist/assets/erDiagram-TEJ5UH35-CTHxg4ER.js +0 -85
  242. package/public/dist/assets/eventmodeling-FCH6USID-LckY84Wp.js +0 -1
  243. package/public/dist/assets/flowDiagram-I6XJVG4X-DgCs6PPU.js +0 -162
  244. package/public/dist/assets/ganttDiagram-6RSMTGT7-DGjdFJRc.js +0 -292
  245. package/public/dist/assets/gitGraph-WXDBUCRP-DXhEIZXY.js +0 -1
  246. package/public/dist/assets/gitGraphDiagram-PVQCEYII-DvCWiClL.js +0 -106
  247. package/public/dist/assets/iframe-renderer-CRPZFtWm.js +0 -1
  248. package/public/dist/assets/info-J43DQDTF-iXM3vzuR.js +0 -1
  249. package/public/dist/assets/infoDiagram-5YYISTIA-DxkbyTf_.js +0 -2
  250. package/public/dist/assets/katex-BT6jmGul.js +0 -1
  251. package/public/dist/assets/memory-h1JXRpv9.js +0 -1
  252. package/public/dist/assets/mermaid-loader-CylkLQP5.js +0 -1
  253. package/public/dist/assets/mermaid-parser.core-C-9KB617.js +0 -3
  254. package/public/dist/assets/mermaid.core-8XY13b72.js +0 -9
  255. package/public/dist/assets/mermaid.core-BEuf6y5_.js +0 -1
  256. package/public/dist/assets/message-history-BWh1dvBM.js +0 -1
  257. package/public/dist/assets/packet-YPE3B663-SclsNpNx.js +0 -1
  258. package/public/dist/assets/pie-LRSECV5Y-CF43gDO6.js +0 -1
  259. package/public/dist/assets/pieDiagram-4H26LBE5-ChOXpmZ5.js +0 -30
  260. package/public/dist/assets/radar-GUYGQ44K-BsylzLX_.js +0 -1
  261. package/public/dist/assets/settings-C2zm9EZp.js +0 -1
  262. package/public/dist/assets/settings-core-D72OTH7d.js +0 -1
  263. package/public/dist/assets/skills-DmzEkIbU.js +0 -1
  264. package/public/dist/assets/slash-commands-XwCb5ACm.js +0 -1
  265. package/public/dist/assets/stateDiagram-AJRCARHV-CeyXWXrg.js +0 -1
  266. package/public/dist/assets/stateDiagram-v2-BHNVJYJU-Bhb8zTjh.js +0 -1
  267. package/public/dist/assets/treeView-BLDUP644-DHq0vQpf.js +0 -1
  268. package/public/dist/assets/treemap-LRROVOQU-vKngXIla.js +0 -1
  269. package/public/dist/assets/ui-BVvHzdHI.js +0 -1
  270. package/public/dist/assets/vendor-render-Bjnw0wQ6.css +0 -1
  271. package/public/dist/assets/vendor-render-DCb9B75Q.js +0 -383
  272. package/public/dist/assets/vennDiagram-CIIHVFJN-WB9mzv1f.js +0 -34
  273. package/public/dist/assets/wardley-L42UT6IY-B1jQOSA5.js +0 -1
  274. package/public/dist/assets/xychartDiagram-2RQKCTM6-DduDB3Cd.js +0 -7
  275. /package/public/dist/assets/{BrowserPanel-C0aa2gja.js → BrowserPanel-CsYKexNf.js} +0 -0
  276. /package/public/dist/assets/{DashboardEmbeddingSection-DiqlLiLj.js → DashboardEmbeddingSection-CIOwsVB5.js} +0 -0
  277. /package/public/dist/assets/{DesignPanel-B8CAf6sH.js → DesignPanel-SuUOoyQN.js} +0 -0
  278. /package/public/dist/assets/{DiffPanel-BTZRq6eG.js → DiffPanel-ZaDoV7qS.js} +0 -0
  279. /package/public/dist/assets/{FolderPanel-D0w_zD66.js → FolderPanel-BkggPdTP.js} +0 -0
  280. /package/public/dist/assets/{HealthBadge-CiNMS-1k.js → HealthBadge-D7BQ-LHD.js} +0 -0
  281. /package/public/dist/assets/{InlineWarn-D-fmcQXD.js → InlineWarn-B3bJfG-Z.js} +0 -0
  282. /package/public/dist/assets/{TerminalPanel-DlUFPyzc.js → TerminalPanel-gXH7bTXQ.js} +0 -0
  283. /package/public/dist/assets/{agent-meta-DrYdO9lB.js → agent-meta-_Idad3qq.js} +0 -0
  284. /package/public/dist/assets/{dist-CuL30i1H.js → dist-CX7KjpF3.js} +0 -0
  285. /package/public/dist/assets/{dist-BbhtVnRz.js → dist-uSfGXqs6.js} +0 -0
  286. /package/public/dist/assets/{fields-BwOMlwS0.js → fields-E1L8aEhU.js} +0 -0
  287. /package/public/dist/assets/{page-shell-GpE8A-FA.js → page-shell-DZ1lls_P.js} +0 -0
  288. /package/public/dist/assets/{path-utils-CHwADH-r.js → path-utils-QbjARuCC.js} +0 -0
  289. /package/public/dist/assets/{rough.esm-DeGVhNS9.js → rough.esm-DQG0wzX4.js} +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-render-Bjnw0wQ6.css"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./state-DxpgDKMO.js";import{i as t,t as n}from"./api-tVoG39dL.js";import{t as r}from"./preload-helper-DFYRRz9w.js";import{D as i,F as a,M as o,O as s,R as c,d as ee,n as te}from"./render-B-8i-Rxq.js";import{_ as ne,g as re,p as ie}from"./iframe-renderer-CgCPbWs-.js";import{_ as ae,d as oe,u as l,v as u}from"./message-history-BEy8JQHJ.js";import{a as d,d as se,i as ce,l as f,n as le,r as ue,s as de,t as fe,u as pe}from"./ui-NdMDA7kW.js";var p=null,m=0,h=[],g=2e3,me=3e4,he=1.5,_=null,ge=4e4,_e=1e4,ve=0,ye=!1,be=null,xe=null;function Se(e){xe=e}function Ce(){let e=null;try{e=xe?.()??null}catch{e=null}return e?`&scope=${encodeURIComponent(e)}`:``}function we(){be||=setInterval(()=>{!p||!v||!ye||Date.now()-ve<=ge||(console.warn(`[sse] stalled channel (no ping in`,ge,`ms) — forcing reconnect`),p.close(),p=null,v=!1,x?.(),C(Te))},_e)}var Te=``,v=!1,Ee=!1,De=!1,y=!1,b=!1,Oe=null,x=null,S=null;function ke(e){Oe=e}function Ae(e){x=e}function je(e){S=e}function Me(e,t,n){let r={topic:e,event:t,handler:n};return h.push(r),()=>{let e=h.indexOf(r);e>=0&&h.splice(e,1)}}function Ne(e,t,n){for(let r of h)if((r.topic===`*`||r.topic===e)&&(r.event===null||r.event===t))try{r.handler(n)}catch(e){console.warn(`[sse] handler error:`,e.message)}}function Pe(){Ee||_||(_=setTimeout(()=>{_=null,C(Te)},g),g=Math.min(g*he,me))}function C(e){Te=e,Ee=!1,_&&=(clearTimeout(_),null),p&&p.close();let t=`${n}/api/events?lang=${encodeURIComponent(e)}`+Ce()+(m?`&lastEventId=${m}`:``);y=!1,b=!1,p=new EventSource(t),we(),p.onopen=()=>{g=2e3,v=!0,De=!0,y=!0,ve=Date.now(),Oe?.()},p.onerror=()=>{if(p?.close(),p=null,!y&&!De&&S){b||(b=!0,S());return}v&&(v=!1,x?.()),Pe()},p.onmessage=e=>{m=parseInt(e.lastEventId||`0`,10)||m;let t;try{t=JSON.parse(e.data)}catch{console.warn(`[sse] malformed message:`,e.data);return}if(!t||typeof t!=`object`||typeof t.topic!=`string`||typeof t.event!=`string`){console.warn(`[sse] invalid message shape:`,t);return}if(ve=Date.now(),t.topic===`system`&&t.event===`ping`){ye=!0;return}Ne(t.topic,t.event,t)}}var Fe=3e3,w=new Map,T=[],E=(e,t)=>`${e}:${t}`;function D(e=[]){let t=document.getElementById(`pendingQueue`);if(t){if(T=e.slice(),!e.length){Be(new Set),t.classList.remove(`visible`),t.innerHTML=``;return}t.classList.add(`visible`),t.innerHTML=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-render-kIxHrxDV.css"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./state-DxpgDKMO.js";import{i as t,t as n}from"./api-tVoG39dL.js";import{t as r}from"./preload-helper-DFYRRz9w.js";import{D as i,F as a,M as o,O as s,R as c,d as ee,n as te}from"./render-Cd4frZ2U.js";import{_ as ne,g as re,p as ie}from"./iframe-renderer-LZp7Nqm1.js";import{_ as ae,d as oe,u as l,v as u}from"./message-history-Bp_sUDSx.js";import{a as d,d as se,i as ce,l as f,n as le,r as ue,s as de,t as fe,u as pe}from"./ui-Cd8etFwN.js";var p=null,m=0,h=[],g=2e3,me=3e4,he=1.5,_=null,ge=4e4,_e=1e4,ve=0,ye=!1,be=null,xe=null;function Se(e){xe=e}function Ce(){let e=null;try{e=xe?.()??null}catch{e=null}return e?`&scope=${encodeURIComponent(e)}`:``}function we(){be||=setInterval(()=>{!p||!v||!ye||Date.now()-ve<=ge||(console.warn(`[sse] stalled channel (no ping in`,ge,`ms) — forcing reconnect`),p.close(),p=null,v=!1,x?.(),C(Te))},_e)}var Te=``,v=!1,Ee=!1,De=!1,y=!1,b=!1,Oe=null,x=null,S=null;function ke(e){Oe=e}function Ae(e){x=e}function je(e){S=e}function Me(e,t,n){let r={topic:e,event:t,handler:n};return h.push(r),()=>{let e=h.indexOf(r);e>=0&&h.splice(e,1)}}function Ne(e,t,n){for(let r of h)if((r.topic===`*`||r.topic===e)&&(r.event===null||r.event===t))try{r.handler(n)}catch(e){console.warn(`[sse] handler error:`,e.message)}}function Pe(){Ee||_||(_=setTimeout(()=>{_=null,C(Te)},g),g=Math.min(g*he,me))}function C(e){Te=e,Ee=!1,_&&=(clearTimeout(_),null),p&&p.close();let t=`${n}/api/events?lang=${encodeURIComponent(e)}`+Ce()+(m?`&lastEventId=${m}`:``);y=!1,b=!1,p=new EventSource(t),we(),p.onopen=()=>{g=2e3,v=!0,De=!0,y=!0,ve=Date.now(),Oe?.()},p.onerror=()=>{if(p?.close(),p=null,!y&&!De&&S){b||(b=!0,S());return}v&&(v=!1,x?.()),Pe()},p.onmessage=e=>{m=parseInt(e.lastEventId||`0`,10)||m;let t;try{t=JSON.parse(e.data)}catch{console.warn(`[sse] malformed message:`,e.data);return}if(!t||typeof t!=`object`||typeof t.topic!=`string`||typeof t.event!=`string`){console.warn(`[sse] invalid message shape:`,t);return}if(ve=Date.now(),t.topic===`system`&&t.event===`ping`){ye=!0;return}Ne(t.topic,t.event,t)}}var Fe=3e3,w=new Map,T=[],E=(e,t)=>`${e}:${t}`;function D(e=[]){let t=document.getElementById(`pendingQueue`);if(t){if(T=e.slice(),!e.length){Be(new Set),t.classList.remove(`visible`),t.innerHTML=``;return}t.classList.add(`visible`),t.innerHTML=`
3
3
  <div class="pending-queue-header">
4
4
  <span class="pending-queue-title">${s.hourglass} <span data-i18n="queue.pendingTitle">${o(c(`queue.pendingTitle`))}</span> <span class="pending-queue-count">${e.length}</span></span>
5
5
  </div>
@@ -12,7 +12,7 @@ import{t as e}from"./state-DxpgDKMO.js";import{i as t,t as n}from"./api-tVoG39dL
12
12
  <button class="pending-row-btn pending-row-copy" data-pending-action="copy" title="${i}" aria-label="${i}"><span class="pending-btn-content">${s.copy}</span></button>
13
13
  <button class="pending-row-btn pending-row-steer" data-pending-action="steer" data-i18n-title="queue.steer" title="${a}" aria-label="${a}"><span class="pending-arm-fill" aria-hidden="true"></span><span class="pending-btn-content"><span class="pending-steer-arrow" aria-hidden="true">↳</span><span class="pending-steer-label">${a}</span></span></button>
14
14
  <button class="pending-row-btn pending-row-delete" data-pending-action="delete" data-i18n-title="queue.delete" title="${ee}" aria-label="${ee}"><span class="pending-arm-fill" aria-hidden="true"></span><span class="pending-btn-content">${s.trash}</span></button>
15
- </div>`}function O(e,t){let n=document.querySelector(`.pending-row[data-pending-id="${CSS.escape(e)}"]`);return n?n.querySelector(`[data-pending-action="${t}"]`):null}function Le(e,t){let n=O(e,t);if(!n)return;n.classList.add(`armed`),n.setAttribute(`title`,c(`queue.cancelArm`));let r=n.querySelector(`.pending-arm-fill`);r&&(r.style.animation=`none`,r.offsetWidth,r.style.animation=``)}function Re(e,t){let n=O(e,t);n&&(n.classList.remove(`armed`),n.setAttribute(`title`,c(t===`steer`?`queue.steer`:`queue.delete`)))}function ze(){for(let e of w.values()){let t=O(e.id,e.action);t&&(t.classList.add(`armed`),t.setAttribute(`title`,c(`queue.cancelArm`)))}}function Be(e){for(let[t,n]of w)e.has(n.id)||(clearTimeout(n.timerId),w.delete(t))}function Ve(e,n){let r=E(e,n),i=setTimeout(()=>Ue(e,n),Fe);w.set(r,{id:e,action:n,timerId:i}),Le(e,n),n===`steer`&&t(`/api/orchestrate/queue/${encodeURIComponent(e)}/hold`,`POST`,{}).catch(()=>{})}function He(e,n){let r=E(e,n),i=w.get(r);i&&(clearTimeout(i.timerId),w.delete(r),Re(e,n),n===`steer`&&t(`/api/orchestrate/queue/${encodeURIComponent(e)}/hold`,`DELETE`,{}).catch(()=>{}))}async function Ue(e,n){w.delete(E(e,n));let r=n===`steer`?`/api/orchestrate/queue/${encodeURIComponent(e)}/steer`:`/api/orchestrate/queue/${encodeURIComponent(e)}`,i=n===`steer`?`POST`:`DELETE`;if(n===`steer`&&l(`running`),await t(r,i,{})==null){T=T.filter(t=>t.id!==e),D(T),n===`steer`&&U(`steer-fire-miss`).catch(()=>{});return}T=T.filter(t=>t.id!==e),D(T)}function We(e,t){if(w.has(E(e,t))){He(e,t);return}Ve(e,t)}function Ge(){let e=document.getElementById(`pendingQueue`);e&&e.addEventListener(`click`,async e=>{let t=e.target?.closest(`[data-pending-action]`);if(!t)return;let n=t.closest(`.pending-row`)?.dataset.pendingId;if(!n)return;let r=t.dataset.pendingAction;if(r===`copy`){let e=T.find(e=>e.id===n);if(e?.prompt&&(await i(e.prompt)).ok){let e=t.querySelector(`.pending-btn-content`);e&&(e.innerHTML=s.checkSimple,setTimeout(()=>{e.innerHTML=s.copy},600))}return}We(n,r===`steer`?`steer`:`delete`)})}var Ke=800,k=64,qe=`CLI-JAW`,A=!1,j=0,M=qe,N=null,Je=``,Ye=!1,Xe=0;function Ze(){return navigator}function Qe(){return document.visibilityState!==`visible`||!document.hasFocus()}function $e(e){return e-Xe<Ke}function et(){if(N)return N;let e=document.querySelector(`link[rel~="icon"]`);if(e)return N=e,Je=e.href||e.getAttribute(`href`)||``,e;let t=document.createElement(`link`);return t.rel=`icon`,document.head.appendChild(t),N=t,Ye=!0,t}function tt(e){let t=document.createElement(`canvas`);t.width=k,t.height=k;let n=t.getContext(`2d`);return n?(n.clearRect(0,0,k,k),n.font=`44px "Apple Color Emoji", "Segoe UI Emoji", sans-serif`,n.textAlign=`center`,n.textBaseline=`middle`,n.fillText(`🦈`,28,36),n.beginPath(),n.arc(50,15,e>1?12:9,0,Math.PI*2),n.fillStyle=`#ff335f`,n.fill(),n.lineWidth=4,n.strokeStyle=`#ffffff`,n.stroke(),e>1&&(n.fillStyle=`#ffffff`,n.font=`bold 15px sans-serif`,n.textAlign=`center`,n.textBaseline=`middle`,n.fillText(String(Math.min(e,9)),50,16)),t.toDataURL(`image/png`)):Je}async function nt(e){let t=Ze();if(typeof t.setAppBadge==`function`)try{await t.setAppBadge(e)}catch{}}async function rt(){let e=Ze();if(typeof e.clearAppBadge==`function`)try{await e.clearAppBadge()}catch{}}function it(){document.title=`(${j}) ${M}`;let e=et();e&&(e.href=tt(j)),nt(j)}function at(){document.title=M}function ot(){if(N){if(Ye){N.remove(),N=null,Ye=!1;return}N.href=Je}}function st(){A||(A=!0,M=document.title||qe,et(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&lt()}),window.addEventListener(`focus`,()=>lt()))}function ct(){if(!A||!Qe())return;let e=Date.now();$e(e)||(Xe=e,j+=1,it())}function lt(){!A||j===0||(j=0,Xe=0,at(),ot(),rt())}function ut(e,t){return!e||!t?!0:e===`all`||e===t}var P=[`I`,`P`,`A`,`B`,`C`],F=null;function dt(e,t,n){let r=P.indexOf(n);if(r<0)return;let i=e.getBoundingClientRect(),a=t.offsetWidth||36,o=document.getElementById(`dot-${n}`);if(!o)return;let s=P[r+1],c=s?document.getElementById(`dot-${s}`):null;if(c){let e=o.getBoundingClientRect(),n=c.getBoundingClientRect(),r=(e.right+n.left)/2;t.style.transform=`translateX(${r-i.left-a/2}px)`}else{let e=o.getBoundingClientRect();t.style.transform=`translateX(${e.left-i.left+e.width/2-a/2}px)`}}var I={},ft=8,pt=64,L=null,R=0,z=[],B=new Map;function mt(e){return e!==null&&z.includes(e)}function ht(e){let t=Number(e);return Number.isFinite(t)&&t>0?Math.floor(t):null}function gt(e,t){if(!(!e||t==null))for(t>(B.get(e)||0)&&B.set(e,t);B.size>pt;){let e=null;for(let t of B.keys())if(t!==L){e=t;break}if(!e)break;B.delete(e)}}function _t(e){let t=new Map;for(let n of e?.toolLog||[]){let e=typeof n?.traceRunId==`string`&&n.traceRunId?n.traceRunId:null,r=ht(n?.traceSeq);!e||r==null||r>(t.get(e)||0)&&t.set(e,r)}return t}function vt(e,t,n){return!n||!e||t==null?!1:t<=(B.get(e)||0)}function yt(e){let t=e??L;L=null,R=0,t&&!z.includes(t)&&(z.push(t),z.length>ft&&z.shift())}function bt(e){!e||e===L||(L=e,R=0)}function xt(e){if(e?.running){typeof e.traceRunId==`string`&&e.traceRunId&&(L=e.traceRunId),R=typeof e.textLen==`number`?e.textLen:(e.text||``).length;for(let[t,n]of _t(e))gt(t,n)}}var St=``,V=0,H=null,Ct=0,wt=!1,Tt=0,Et=750,Dt=750;async function Ot(e={}){let t=await(await fetch(`${n}/api/orchestrate/snapshot`)).json();St=String(t.orc.scope||``),Ht(t.orc.state),Ft(t.orc.ctx||null),Pt(t.heartbeat||{pending:0,deferredPending:0}),Nt(t.workers),oe(t.runtime.queuePending),le(t.queued||[]),D(t.queued||[]),e.hydrateRun&&(de(t.activeRun),xt(t.activeRun)),Bt(),t.runtime.busy?l(`running`):f()||l(`idle`),r(()=>import(`./employees-C0CQgpI9.js`).then(e=>{typeof e.renderEmployees==`function`&&e.renderEmployees()}),__vite__mapDeps([0]))}function U(e=`manual`,t={}){let n=Date.now();return t.hydrateRun?Ot(t):H||(n-Ct<Et?Promise.resolve():(Ct=n,H=Ot(t).catch(t=>{throw console.warn(`[ws] orchestrate snapshot sync failed (${e})`,t),t}).finally(()=>{H=null}),H))}function kt(e){return e===`iframe-visible`||e===`pageshow`||e===`discard`||e===`visibilitychange`}function At(e){re(e),r(()=>import(`./ui-BVvHzdHI.js`).then(async t=>{if(kt(e)&&V>0)try{await t.loadMessages(),V=Date.now()}catch(t){console.warn(`[ws] restore loadMessages failed (${e})`,t)}await U(e,{hydrateRun:!0})}),__vite__mapDeps([0])).catch(()=>{}).finally(()=>{ie(e)})}function W(e){let t=Date.now();!kt(e)&&t-Tt<Dt||(Tt=t,At(e))}function jt(e){let t=Array.isArray(e.changedKeys)?e.changedKeys:[];if(t.includes(`multiSession`)){window.location.reload();return}t.includes(`workingDir`)||t.includes(`projectDirs`)?r(()=>import(`./ui-BVvHzdHI.js`).then(async e=>{try{await e.loadMessages(),V=Date.now()}catch(e){console.warn(`[ws] settings scope loadMessages failed`,e)}await U(`settings_change`).catch(()=>{}).finally(()=>e.reconcileChatBottomAfterRestore(`settings_change`))}),__vite__mapDeps([0])):U(`settings_change`).catch(()=>{}),r(()=>import(`./settings-core-D72OTH7d.js`).then(t=>t.refreshHeaderFromSettingsChange(e)),__vite__mapDeps([0])).catch(()=>{})}function Mt(){wt||(wt=!0,window.addEventListener(`focus`,()=>{W(`focus`)}),window.addEventListener(`pageshow`,e=>{e.persisted&&W(`pageshow`)}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&W(`visibilitychange`)}),document.addEventListener(`resume`,()=>{W(`resume`)}),`wasDiscarded`in document&&document.wasDiscarded&&W(`discard`),window.addEventListener(`message`,e=>{e.data?.type===`jaw-preview-visibility`&&e.data.visible&&W(`iframe-visible`)}))}function Nt(e){for(let e of Object.keys(I))delete I[e];for(let t of e)t.state===`running`&&t.phase&&(I[t.agentId]={phase:t.phase,phaseLabel:t.phaseLabel||``})}function Pt(t){let n={pending:Number(t?.pending||0),deferredPending:Number(t?.deferredPending||0),...t?.reason?{reason:t.reason}:{},...t?.policy?{policy:t.policy}:{},...t?.jobId?{jobId:t.jobId}:{},...t?.jobName?{jobName:t.jobName}:{}};e.heartbeatRuntime=n;let r=document.getElementById(`pabcHeartbeatStatus`);if(r)if(n.reason===`pabcd_active`&&n.deferredPending>0){let e=n.jobName?`: ${n.jobName}`:``;r.textContent=`heartbeat deferred (${n.deferredPending})${e}`,r.hidden=!1}else r.textContent=``,r.hidden=!0}function Ft(t){e.orcTaskAnchor=String(t?.taskAnchor||``).trim(),e.orcResolvedSelection=t?.resolvedSelection||null;let n=document.getElementById(`pabcTaskAnchor`);n&&(e.orcTaskAnchor?(n.textContent=`anchor: ${e.orcResolvedSelection?.index?`${e.orcResolvedSelection.index}. `:``}${e.orcTaskAnchor}`,n.hidden=!1):(n.textContent=``,n.hidden=!0),Rt(t?.interview||null))}var G=(()=>{try{return localStorage.getItem(`jaw:interviewCollapsed`)===`1`}catch{return!1}})();function It(e){G=e;try{localStorage.setItem(`jaw:interviewCollapsed`,e?`1`:`0`)}catch{}let t=document.getElementById(`interviewPanel`);if(!t)return;t.classList.toggle(`collapsed`,e);let n=t.querySelector(`.iv-toggle`);n&&n.setAttribute(`aria-expanded`,String(!e))}function Lt(e){let t=e=>{switch(e){case`max`:return 1;case`xhigh`:return .8;case`high`:return .6;case`medium`:return .4;default:return .2}},n=e=>{switch(e){case`max`:return`#2196f3`;case`xhigh`:return`#4caf50`;case`high`:return`#8bc34a`;case`medium`:return`#ff9800`;default:return`#f44336`}},r=[t(e.goal),t(e.constraint),t(e.success),t(e.ontology)],i=1-r.reduce((e,t)=>e+t,0)/r.length,a=Object.values(e).every(e=>e===`max`)||i<=.2?`🟢 Ready`:i<=.4?`🟡 Almost`:`🔴 Needs work`,o=(e,r)=>{let i=t(r);return`<div style="display:flex;align-items:center;gap:6px;font-size:12px">
15
+ </div>`}function O(e,t){let n=document.querySelector(`.pending-row[data-pending-id="${CSS.escape(e)}"]`);return n?n.querySelector(`[data-pending-action="${t}"]`):null}function Le(e,t){let n=O(e,t);if(!n)return;n.classList.add(`armed`),n.setAttribute(`title`,c(`queue.cancelArm`));let r=n.querySelector(`.pending-arm-fill`);r&&(r.style.animation=`none`,r.offsetWidth,r.style.animation=``)}function Re(e,t){let n=O(e,t);n&&(n.classList.remove(`armed`),n.setAttribute(`title`,c(t===`steer`?`queue.steer`:`queue.delete`)))}function ze(){for(let e of w.values()){let t=O(e.id,e.action);t&&(t.classList.add(`armed`),t.setAttribute(`title`,c(`queue.cancelArm`)))}}function Be(e){for(let[t,n]of w)e.has(n.id)||(clearTimeout(n.timerId),w.delete(t))}function Ve(e,n){let r=E(e,n),i=setTimeout(()=>Ue(e,n),Fe);w.set(r,{id:e,action:n,timerId:i}),Le(e,n),n===`steer`&&t(`/api/orchestrate/queue/${encodeURIComponent(e)}/hold`,`POST`,{}).catch(()=>{})}function He(e,n){let r=E(e,n),i=w.get(r);i&&(clearTimeout(i.timerId),w.delete(r),Re(e,n),n===`steer`&&t(`/api/orchestrate/queue/${encodeURIComponent(e)}/hold`,`DELETE`,{}).catch(()=>{}))}async function Ue(e,n){w.delete(E(e,n));let r=n===`steer`?`/api/orchestrate/queue/${encodeURIComponent(e)}/steer`:`/api/orchestrate/queue/${encodeURIComponent(e)}`,i=n===`steer`?`POST`:`DELETE`;if(n===`steer`&&l(`running`),await t(r,i,{})==null){T=T.filter(t=>t.id!==e),D(T),n===`steer`&&U(`steer-fire-miss`).catch(()=>{});return}T=T.filter(t=>t.id!==e),D(T)}function We(e,t){if(w.has(E(e,t))){He(e,t);return}Ve(e,t)}function Ge(){let e=document.getElementById(`pendingQueue`);e&&e.addEventListener(`click`,async e=>{let t=e.target?.closest(`[data-pending-action]`);if(!t)return;let n=t.closest(`.pending-row`)?.dataset.pendingId;if(!n)return;let r=t.dataset.pendingAction;if(r===`copy`){let e=T.find(e=>e.id===n);if(e?.prompt&&(await i(e.prompt)).ok){let e=t.querySelector(`.pending-btn-content`);e&&(e.innerHTML=s.checkSimple,setTimeout(()=>{e.innerHTML=s.copy},600))}return}We(n,r===`steer`?`steer`:`delete`)})}var Ke=800,k=64,qe=`CLI-JAW`,A=!1,j=0,M=qe,N=null,Je=``,Ye=!1,Xe=0;function Ze(){return navigator}function Qe(){return document.visibilityState!==`visible`||!document.hasFocus()}function $e(e){return e-Xe<Ke}function et(){if(N)return N;let e=document.querySelector(`link[rel~="icon"]`);if(e)return N=e,Je=e.href||e.getAttribute(`href`)||``,e;let t=document.createElement(`link`);return t.rel=`icon`,document.head.appendChild(t),N=t,Ye=!0,t}function tt(e){let t=document.createElement(`canvas`);t.width=k,t.height=k;let n=t.getContext(`2d`);return n?(n.clearRect(0,0,k,k),n.font=`44px "Apple Color Emoji", "Segoe UI Emoji", sans-serif`,n.textAlign=`center`,n.textBaseline=`middle`,n.fillText(`🦈`,28,36),n.beginPath(),n.arc(50,15,e>1?12:9,0,Math.PI*2),n.fillStyle=`#ff335f`,n.fill(),n.lineWidth=4,n.strokeStyle=`#ffffff`,n.stroke(),e>1&&(n.fillStyle=`#ffffff`,n.font=`bold 15px sans-serif`,n.textAlign=`center`,n.textBaseline=`middle`,n.fillText(String(Math.min(e,9)),50,16)),t.toDataURL(`image/png`)):Je}async function nt(e){let t=Ze();if(typeof t.setAppBadge==`function`)try{await t.setAppBadge(e)}catch{}}async function rt(){let e=Ze();if(typeof e.clearAppBadge==`function`)try{await e.clearAppBadge()}catch{}}function it(){document.title=`(${j}) ${M}`;let e=et();e&&(e.href=tt(j)),nt(j)}function at(){document.title=M}function ot(){if(N){if(Ye){N.remove(),N=null,Ye=!1;return}N.href=Je}}function st(){A||(A=!0,M=document.title||qe,et(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&lt()}),window.addEventListener(`focus`,()=>lt()))}function ct(){if(!A||!Qe())return;let e=Date.now();$e(e)||(Xe=e,j+=1,it())}function lt(){!A||j===0||(j=0,Xe=0,at(),ot(),rt())}function ut(e,t){return!e||!t?!0:e===`all`||e===t}var P=[`I`,`P`,`A`,`B`,`C`],F=null;function dt(e,t,n){let r=P.indexOf(n);if(r<0)return;let i=e.getBoundingClientRect(),a=t.offsetWidth||36,o=document.getElementById(`dot-${n}`);if(!o)return;let s=P[r+1],c=s?document.getElementById(`dot-${s}`):null;if(c){let e=o.getBoundingClientRect(),n=c.getBoundingClientRect(),r=(e.right+n.left)/2;t.style.transform=`translateX(${r-i.left-a/2}px)`}else{let e=o.getBoundingClientRect();t.style.transform=`translateX(${e.left-i.left+e.width/2-a/2}px)`}}var I={},ft=8,pt=64,L=null,R=0,z=[],B=new Map;function mt(e){return e!==null&&z.includes(e)}function ht(e){let t=Number(e);return Number.isFinite(t)&&t>0?Math.floor(t):null}function gt(e,t){if(!(!e||t==null))for(t>(B.get(e)||0)&&B.set(e,t);B.size>pt;){let e=null;for(let t of B.keys())if(t!==L){e=t;break}if(!e)break;B.delete(e)}}function _t(e){let t=new Map;for(let n of e?.toolLog||[]){let e=typeof n?.traceRunId==`string`&&n.traceRunId?n.traceRunId:null,r=ht(n?.traceSeq);!e||r==null||r>(t.get(e)||0)&&t.set(e,r)}return t}function vt(e,t,n){return!n||!e||t==null?!1:t<=(B.get(e)||0)}function yt(e){let t=e??L;L=null,R=0,t&&!z.includes(t)&&(z.push(t),z.length>ft&&z.shift())}function bt(e){!e||e===L||(L=e,R=0)}function xt(e){if(e?.running){typeof e.traceRunId==`string`&&e.traceRunId&&(L=e.traceRunId),R=typeof e.textLen==`number`?e.textLen:(e.text||``).length;for(let[t,n]of _t(e))gt(t,n)}}var St=``,V=0,H=null,Ct=0,wt=!1,Tt=0,Et=750,Dt=750;async function Ot(e={}){let t=await(await fetch(`${n}/api/orchestrate/snapshot`)).json();St=String(t.orc.scope||``),Ht(t.orc.state),Ft(t.orc.ctx||null),Pt(t.heartbeat||{pending:0,deferredPending:0}),Nt(t.workers),oe(t.runtime.queuePending),le(t.queued||[]),D(t.queued||[]),e.hydrateRun&&(de(t.activeRun),xt(t.activeRun)),Bt(),t.runtime.busy?l(`running`):f()||l(`idle`),r(()=>import(`./employees-DCju7V1x.js`).then(e=>{typeof e.renderEmployees==`function`&&e.renderEmployees()}),__vite__mapDeps([0]))}function U(e=`manual`,t={}){let n=Date.now();return t.hydrateRun?Ot(t):H||(n-Ct<Et?Promise.resolve():(Ct=n,H=Ot(t).catch(t=>{throw console.warn(`[ws] orchestrate snapshot sync failed (${e})`,t),t}).finally(()=>{H=null}),H))}function kt(e){return e===`iframe-visible`||e===`pageshow`||e===`discard`||e===`visibilitychange`}function At(e){re(e),r(()=>import(`./ui-yrn3s72A.js`).then(async t=>{if(kt(e)&&V>0)try{await t.loadMessages(),V=Date.now()}catch(t){console.warn(`[ws] restore loadMessages failed (${e})`,t)}await U(e,{hydrateRun:!0})}),__vite__mapDeps([0])).catch(()=>{}).finally(()=>{ie(e)})}function W(e){let t=Date.now();!kt(e)&&t-Tt<Dt||(Tt=t,At(e))}function jt(e){let t=Array.isArray(e.changedKeys)?e.changedKeys:[];if(t.includes(`multiSession`)){window.location.reload();return}t.includes(`workingDir`)||t.includes(`projectDirs`)?r(()=>import(`./ui-yrn3s72A.js`).then(async e=>{try{await e.loadMessages(),V=Date.now()}catch(e){console.warn(`[ws] settings scope loadMessages failed`,e)}await U(`settings_change`).catch(()=>{}).finally(()=>e.reconcileChatBottomAfterRestore(`settings_change`))}),__vite__mapDeps([0])):U(`settings_change`).catch(()=>{}),r(()=>import(`./settings-core-Cm-CmVLA.js`).then(t=>t.refreshHeaderFromSettingsChange(e)),__vite__mapDeps([0])).catch(()=>{})}function Mt(){wt||(wt=!0,window.addEventListener(`focus`,()=>{W(`focus`)}),window.addEventListener(`pageshow`,e=>{e.persisted&&W(`pageshow`)}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&W(`visibilitychange`)}),document.addEventListener(`resume`,()=>{W(`resume`)}),`wasDiscarded`in document&&document.wasDiscarded&&W(`discard`),window.addEventListener(`message`,e=>{e.data?.type===`jaw-preview-visibility`&&e.data.visible&&W(`iframe-visible`)}))}function Nt(e){for(let e of Object.keys(I))delete I[e];for(let t of e)t.state===`running`&&t.phase&&(I[t.agentId]={phase:t.phase,phaseLabel:t.phaseLabel||``})}function Pt(t){let n={pending:Number(t?.pending||0),deferredPending:Number(t?.deferredPending||0),...t?.reason?{reason:t.reason}:{},...t?.policy?{policy:t.policy}:{},...t?.jobId?{jobId:t.jobId}:{},...t?.jobName?{jobName:t.jobName}:{}};e.heartbeatRuntime=n;let r=document.getElementById(`pabcHeartbeatStatus`);if(r)if(n.reason===`pabcd_active`&&n.deferredPending>0){let e=n.jobName?`: ${n.jobName}`:``;r.textContent=`heartbeat deferred (${n.deferredPending})${e}`,r.hidden=!1}else r.textContent=``,r.hidden=!0}function Ft(t){e.orcTaskAnchor=String(t?.taskAnchor||``).trim(),e.orcResolvedSelection=t?.resolvedSelection||null;let n=document.getElementById(`pabcTaskAnchor`);n&&(e.orcTaskAnchor?(n.textContent=`anchor: ${e.orcResolvedSelection?.index?`${e.orcResolvedSelection.index}. `:``}${e.orcTaskAnchor}`,n.hidden=!1):(n.textContent=``,n.hidden=!0),Rt(t?.interview||null))}var G=(()=>{try{return localStorage.getItem(`jaw:interviewCollapsed`)===`1`}catch{return!1}})();function It(e){G=e;try{localStorage.setItem(`jaw:interviewCollapsed`,e?`1`:`0`)}catch{}let t=document.getElementById(`interviewPanel`);if(!t)return;t.classList.toggle(`collapsed`,e);let n=t.querySelector(`.iv-toggle`);n&&n.setAttribute(`aria-expanded`,String(!e))}function Lt(e){let t=e=>{switch(e){case`max`:return 1;case`xhigh`:return .8;case`high`:return .6;case`medium`:return .4;default:return .2}},n=e=>{switch(e){case`max`:return`#2196f3`;case`xhigh`:return`#4caf50`;case`high`:return`#8bc34a`;case`medium`:return`#ff9800`;default:return`#f44336`}},r=[t(e.goal),t(e.constraint),t(e.success),t(e.ontology)],i=1-r.reduce((e,t)=>e+t,0)/r.length,a=Object.values(e).every(e=>e===`max`)||i<=.2?`🟢 Ready`:i<=.4?`🟡 Almost`:`🔴 Needs work`,o=(e,r)=>{let i=t(r);return`<div style="display:flex;align-items:center;gap:6px;font-size:12px">
16
16
  <span style="width:70px;color:var(--text-secondary)">${e}</span>
17
17
  <div style="flex:1;height:5px;background:var(--bg-tertiary);border-radius:3px">
18
18
  <div style="width:${i*100}%;height:100%;background:${n(r)};border-radius:3px;transition:width .3s"></div>
@@ -46,4 +46,4 @@ import{t as e}from"./state-DxpgDKMO.js";import{i as t,t as n}from"./api-tVoG39dL
46
46
  </div>`};n.innerHTML=`<div style="font-size:11px;font-weight:600;margin-bottom:4px;color:var(--text-secondary)">Build Budget</div>
47
47
  ${r(`Workers`,e.spent.workerDispatches,e.maxWorkerDispatches)}
48
48
  ${r(`Self-heal`,e.spent.selfHealRetries,e.maxSelfHealRetries)}
49
- ${r(`Verify`,e.spent.verificationRounds,e.maxVerificationRounds)}`}async function Bt(){try{let t=await fetch(`${n}/api/goal`);if(!t.ok)return;let r=await t.json();r.goal?e.activeGoal={id:r.goal.id,objective:r.goal.objective,status:r.goal.status,createdAt:r.goal.createdAt,updatedAt:r.goal.updatedAt,lastCheckpointSummary:r.goal.lastCheckpoint?.summary,nextAction:r.goal.lastCheckpoint?.nextAction}:e.activeGoal=null,Vt()}catch{}}function Vt(){let t=document.getElementById(`goalCockpit`);if(!t)return;let n=e.activeGoal;if(!n||n.status===`complete`||n.status===`cancelled`){t.hidden=!0,t.innerHTML=``;return}t.hidden=!1,t.replaceChildren();let r=n.status===`paused`?`paused`:n.status===`blocked`?`blocked`:`active`,i=document.createElement(`span`);i.className=`goal-objective`,i.title=n.objective,i.textContent=n.objective;let a=document.createElement(`span`);if(a.className=`goal-status goal-status--${r}`,a.textContent=n.status,t.append(i,a),n.nextAction){let e=document.createElement(`span`);e.className=`goal-next`,e.textContent=n.nextAction,t.append(e)}}function Ht(t,n){let r=new Set([`IDLE`,`I`,`P`,`A`,`B`,`C`,`D`]).has(t)?t:`IDLE`;if(e.orcState=r,r===`IDLE`||r===`D`)document.body.removeAttribute(`data-orc-state`),document.body.style.removeProperty(`--orc-glow`);else{document.body.setAttribute(`data-orc-state`,r);let e=`--orc-glow-${r}`,t=getComputedStyle(document.documentElement).getPropertyValue(e).trim();document.body.style.setProperty(`--orc-glow`,t)}document.body.classList.add(`orc-pulse`),setTimeout(()=>document.body.classList.remove(`orc-pulse`),700);let i=document.getElementById(`orcStateBadge`);i&&(i.textContent={IDLE:``,I:`INTERVIEW`,P:`PLAN`,A:`AUDIT`,B:`BUILD`,C:`CHECK`,D:`DONE`}[r],i.style.display=r===`IDLE`?`none`:`inline-block`);let a=document.getElementById(`pabcRoadmap`),o=document.getElementById(`sharkRunner`),s=document.getElementById(`pabcBrand`);if(a&&o){if(!a.dataset.resizeObserved){a.dataset.resizeObserved=`1`,new ResizeObserver(()=>{F&&o.classList.contains(`running`)&&dt(a,o,F)}).observe(a);let e=0;window.addEventListener(`resize`,()=>{cancelAnimationFrame(e),e=requestAnimationFrame(()=>{F&&o.classList.contains(`running`)&&dt(a,o,F)})})}if(r===`IDLE`)a.classList.remove(`visible`,`shimmer-out`),o.classList.remove(`running`),F=null;else if(r===`D`){P.forEach(e=>{let t=document.getElementById(`dot-${e}`);t&&(t.className=`pabc-dot done`,t.setAttribute(`data-phase`,e))});for(let e=0;e<P.length;e++){let t=document.getElementById(`pabc-conn-${e}`);t&&(t.className=`pabc-connector done`)}o.classList.remove(`running`),F=null,a.classList.add(`shimmer-out`),setTimeout(()=>a.classList.remove(`visible`,`shimmer-out`),1e3)}else{a.classList.remove(`shimmer-out`),a.classList.add(`visible`),o.classList.add(`running`);let e=P.indexOf(r);P.forEach((t,n)=>{let r=document.getElementById(`dot-${t}`);r&&(r.className=`pabc-dot ${n<e?`done`:n===e?`active`:`future`}`,r.setAttribute(`data-phase`,t))});for(let t=0;t<P.length;t++){let n=document.getElementById(`pabc-conn-${t}`);n&&(n.className=`pabc-connector ${t<e?`done`:``}`)}F=r,requestAnimationFrame(()=>dt(a,o,r))}s&&n&&(s.textContent=n)}}var Ut=!1,Wt=Promise.resolve(),Gt=0;function K(){Mt(),Ut||(Ut=!0,tn()),$t(),C(a())}var Kt=K;function qt(e){console.log(`[${e}] connected`),X=2e3,Xt();let t=Date.now()-V<1e4;Wt=r(()=>import(`./ui-BVvHzdHI.js`).then(async n=>{if(n.cleanupToolActivity(),!t)try{await n.loadMessages(),V=Date.now()}catch(t){console.error(`[${e}] loadMessages failed`,t)}await U(`reconnect`,{hydrateRun:!0}).catch(()=>{}).finally(()=>n.reconcileChatBottomAfterRestore(`reconnect`)),r(()=>import(`./memory-h1JXRpv9.js`).then(e=>e.refreshMemorySidebar()),__vite__mapDeps([0])).catch(()=>{}),r(()=>import(`./bgtask-badge-BjVnOXkr.js`).then(e=>e.refreshBgtaskBadge()),__vite__mapDeps([0])).catch(()=>{})}),void 0)}function Jt(){re(`replay_gap`),Wt=r(()=>import(`./ui-BVvHzdHI.js`).then(async e=>{try{await e.loadMessages(),V=Date.now()}catch(e){console.error(`[sse] replay gap loadMessages failed`,e)}await U(`replay_gap`,{hydrateRun:!0}).catch(()=>{}).finally(()=>e.reconcileChatBottomAfterRestore(`replay_gap`))}),__vite__mapDeps([0]))}var Yt=8e3,q=null;function Xt(){q!==null&&(window.clearTimeout(q),q=null)}function Zt(){console.log(`[channel] disconnected`),r(()=>import(`./ui-BVvHzdHI.js`).then(e=>e.cleanupToolActivity()),__vite__mapDeps([0])),q===null&&(q=window.setTimeout(()=>{q=null,l(`idle`),u(`${s.exec} ${c(`ws.disconnected`)}`,`tool-activity`)},Yt))}var J=null,Y=!1,X=2e3,Qt=3e4;function $t(){if(J){Y=!0;try{J.close()}catch{}J=null}}function en(){if(J)return;console.warn(`[channel] /api/events unavailable — falling back to legacy WebSocket`);let e=`ws://${location.host}`,t=new WebSocket(`${e}${n}/?lang=${a()}`);J=t,Y=!1,t.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{console.warn(`[ws] malformed message:`,e.data);return}if(!t||typeof t!=`object`||typeof t.type!=`string`){console.warn(`[ws] invalid message shape:`,t);return}nn(t)};let r=!1;t.onopen=()=>{r=!0,X=2e3,qt(`ws`)},t.onclose=()=>{if(J===t&&(J=null),Y){Y=!1;return}if(r){Zt(),setTimeout(K,2e3);return}X=Math.min(X*2,Qt),setTimeout(K,X)}}function tn(){Me(`widget`,`widget_updated`,e=>{let t=e.chatId,n=e.widgetId;typeof t!=`string`||typeof n!=`string`||r(()=>import(`./iframe-renderer-CRPZFtWm.js`).then(e=>e.refreshFileWidget(t,n)),__vite__mapDeps([0])).catch(e=>console.warn(`[widget] refresh failed:`,e.message))}),Me(`*`,null,e=>{nn({...e,type:e.event})}),ke(()=>qt(`sse`)),Ae(()=>Zt()),je(()=>en())}function nn(t){if(t.type===`agent_tool`){if(f())return;let e=typeof t.traceRunId==`string`&&t.traceRunId?t.traceRunId:null,n=ht(t.traceSeq);if(mt(e)||vt(e,n,t.sseReplay===!0))return;t.isEmployee!==!0&&bt(e);let r=t.toolType===`thinking`?`thinking`:t.toolType===`search`?`search`:t.toolType===`subagent`?`subagent`:`tool`;se({id:`step-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,type:r,icon:t.icon||s.tool,rawIcon:t.rawIcon||t.icon||``,label:t.label||``,isEmployee:t.isEmployee===!0,detail:t.detail||``,stepRef:t.stepRef||``,traceRunId:t.traceRunId||``,traceSeq:t.traceSeq,detailAvailable:t.detailAvailable,detailBytes:t.detailBytes,rawRetentionStatus:t.rawRetentionStatus,status:t.status||`running`,startTime:typeof t.startedAt==`number`&&t.startedAt>0?t.startedAt:Date.now()},typeof t.startedAt==`number`&&t.startedAt>0?t.startedAt:void 0),gt(e,n)}else if(t.type===`agent_output`||t.type===`agent_chunk`){if(f())return;let e=typeof t.traceRunId==`string`&&t.traceRunId?t.traceRunId:null;if(mt(e))return;bt(e);let n=t.text||``;if(e&&typeof t.textLen==`number`){if(t.textLen<=R){t.sseReplay!==!0&&t.textLen<R&&(console.warn(`[ws] live agent_output behind applied cursor — resync (${t.textLen} < ${R})`),R=t.textLen);return}let e=t.textLen-R;e<n.length&&(n=n.slice(-e)),R=t.textLen}fe(n)}else if(t.type===`agent_status`){if(!t.running&&f())return;t.running&&f()&&ce(),t.running===void 0?l(t.status||`idle`):l(t.running?`running`:`idle`),t.agentId&&t.phase&&(I[t.agentId]={phase:t.phase,phaseLabel:t.phaseLabel||``},r(()=>import(`./employees-C0CQgpI9.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0])))}else if(t.type===`bgtask_update`)r(()=>import(`./bgtask-badge-BjVnOXkr.js`).then(e=>e.applyBgtaskUpdate(t)),__vite__mapDeps([0])).catch(()=>{});else if(t.type===`queue_update`)oe(t.pending||0),Array.isArray(t.queued)&&D(t.queued),U(`queue_update`).catch(()=>{});else if(t.type===`agent_retry`){let e=Number(t.delay??0),n=t.reason,r=o(String(n||`429`));u(c(e>0?`ws.retry`:`ws.retryNow`,{cli:o(t.cli||``),reason:r,delay:e}),`tool-activity`)}else if(t.type===`agent_fallback`)u(c(`ws.fallback`,{from:o(t.from||``),to:o(t.to||``)}),`tool-activity`);else if(t.type===`agent_smoke`)u(`${s.warning} ${o(t.cli||`agent`)}: smoke response detected — auto-continuing`,`tool-activity`);else if(t.type===`goal_done`)e.activeGoal=null,Vt(),u(`🎯 Goal completed${t.source===`ai_output`?` (detected from AI output)`:``}`,`tool-activity`);else if(t.type===`goal_cancel`)e.activeGoal=null,Vt(),u(`🎯 Goal cancelled`,`tool-activity`);else if(t.type===`schedule_wakeup`)u(`⏰ Wakeup scheduled in ${t.delaySeconds}s — ${o(String(t.reason||``))}`,`tool-activity`);else if(t.type===`goal_continuation_limit`)u(`⚠️ Goal continuation limit reached (${t.attempts} attempts)`,`tool-activity`);else if(t.type===`goal_continuation`)u(`🎯 Active goal — auto-continuing`,`tool-activity`);else if(t.type===`agent_done`){if(!(t.steered||f())){let e=typeof t.traceRunId==`string`&&t.traceRunId?t.traceRunId:null;if(mt(e)||e&&L&&e!==L)return;yt(e),d(t.text||``,t.toolLog),ct()}}else if(t.type===`orchestrate_done`)yt(null),d(t.text||``),ct();else if(t.type===`clear`){te(),ue(),ne().clear();let e=document.getElementById(`chatMessages`);e&&(e.innerHTML=``),r(()=>import(`./idb-cache-B5PX63p7.js`).then(e=>e.clearScopedCache()),[]).catch(()=>{})}else if(t.type===`session_reset`)u(`${s.refresh} Session reset — history preserved`,`tool-activity`);else if(t.type===`agent_added`||t.type===`agent_updated`||t.type===`agent_deleted`)r(()=>import(`./employees-C0CQgpI9.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0]));else if(t.type===`heartbeat_pending`){let e={pending:t.pending||0,deferredPending:t.deferredPending||0};t.reason!==void 0&&(e.reason=t.reason),t.policy!==void 0&&(e.policy=t.policy),t.jobId!==void 0&&(e.jobId=t.jobId),t.jobName!==void 0&&(e.jobName=t.jobName),Pt(e)}else if(t.type===`orc_state`)rn(t);else if(t.type===`memory_status`)r(()=>import(`./memory-h1JXRpv9.js`).then(e=>e.refreshMemorySidebar()),__vite__mapDeps([0]));else if(t.type===`steer_started`)pe(),yt(null),d(``),l(`steering`);else if(t.type===`new_message`&&(t.source===`telegram`||t.source===`discord`||t.source===`slack`||t.source===`bgtask`||t.source===`cli`||t.source===`goal`||t.external===!0||t.fromQueue===!0)){let e=t.role===`assistant`?`agent`:t.role||`user`,n=t.content||``,i=t.cli;r(()=>import(`./message-history-BWh1dvBM.js`).then(t=>{if(t.historyReloadInFlight()){t.loadMessages().then(()=>t.loadMessages()).catch(e=>console.warn(`[ws] new_message reload after in-flight failed`,e));return}ae(e,n,i)}),__vite__mapDeps([0]))}else t.type===`system_notice`?u(`ℹ️ ${o(t.text||``)}`,`tool-activity`):t.type===`replay_gap`?Jt():t.type===`worker_stalled`?u(`⚠️ Worker stalled: ${o(t.employeeName||t.agentId||``)}`,`tool-activity`):t.type===`worker_disconnected`?u(`🔌 Worker disconnected: ${o(t.agentId||``)} (exit ${o(String(t.exitCode??`?`))})`,`tool-activity`):t.type===`worker_timeout`?u(`⏱️ Worker timed out: ${o(t.employeeName||t.agentId||``)}`,`tool-activity`):t.type===`alert_escalation`?u(o(t.message||``),`tool-activity`):t.type===`schedule_wakeup_failed`?u(`⚠️ Wakeup failed — ${o(String(t.reason||``))}: ${o(t.error||``)}`,`tool-activity`):t.type===`goal_continuation_failed`?u(`⚠️ Goal continuation failed: ${o(t.error||``)}`,`tool-activity`):t.type===`settings_change`?jt(t):t.type===`session_list`?ee(t):(t.type===`session_switched`||t.type===`session_created`)&&window.location.reload()}function rn(e){let t=++Gt;Wt.then(()=>{t===Gt&&ut(e.scope,St)&&(Ht(typeof e.state==`string`?e.state:`IDLE`,e.title),Ft({taskAnchor:e.taskAnchor||null,resolvedSelection:e.resolvedSelection||null,interview:e.interview||null}),zt(e.buildBudget||null,typeof e.state==`string`?e.state:`IDLE`))})}function an(e){return I[e]||null}var on=`sidebarState`,sn=900,cn=768;function ln(){return window.innerWidth<=cn}function Z(){document.body.classList.remove(`left-expanded`,`right-expanded`)}function un(e){let t=`${e}-expanded`,n=e===`left`?`right-expanded`:`left-expanded`,r=!document.body.classList.contains(t);document.body.classList.remove(n),document.body.classList.toggle(t,r)}function dn(){let e={};try{e=JSON.parse(localStorage.getItem(on)||`{}`)}catch{}e.left&&document.body.classList.add(`left-collapsed`),e.right&&document.body.classList.add(`right-collapsed`);let t=ln();document.getElementById(`toggleLeft`)?.addEventListener(`click`,fn),document.getElementById(`toggleRight`)?.addEventListener(`click`,pn),window.addEventListener(`resize`,()=>{let e=ln();if(window.innerWidth>sn){Z();let e={};try{e=JSON.parse(localStorage.getItem(on)||`{}`)}catch{}document.body.classList.toggle(`left-collapsed`,!!e.left),document.body.classList.toggle(`right-collapsed`,!!e.right)}else document.body.classList.remove(`left-collapsed`,`right-collapsed`),e!==t&&Z();t=e,$()}),window.innerWidth<=sn&&(document.body.classList.remove(`left-collapsed`,`right-collapsed`),ln()&&Z()),$()}function Q(){return window.innerWidth<=sn}function fn(){Q()?un(`left`):document.body.classList.toggle(`left-collapsed`),gn(),$()}function pn(){Q()?un(`right`):document.body.classList.toggle(`right-collapsed`),hn()&&document.getElementById(`tabAgents`)?.classList.contains(`active`)&&r(()=>import(`./employees-C0CQgpI9.js`).then(e=>e.loadEmployees(!0)),__vite__mapDeps([0])),gn(),$()}function mn(){return Q()?document.body.classList.contains(`left-expanded`):!document.body.classList.contains(`left-collapsed`)}function hn(){return Q()?document.body.classList.contains(`right-expanded`):!document.body.classList.contains(`right-collapsed`)}function $(){let e=document.getElementById(`toggleLeft`),t=document.getElementById(`toggleRight`);e&&(e.innerHTML=mn()?s.chevronLeft:s.chevronRight),t&&(t.innerHTML=hn()?s.chevronRight:s.chevronLeft)}function gn(){localStorage.setItem(on,JSON.stringify({left:document.body.classList.contains(`left-collapsed`),right:document.body.classList.contains(`right-collapsed`)}))}export{K as a,U as c,Ge as d,Se as f,pn as i,lt as l,hn as n,an as o,fn as r,Kt as s,dn as t,st as u};
49
+ ${r(`Verify`,e.spent.verificationRounds,e.maxVerificationRounds)}`}async function Bt(){try{let t=await fetch(`${n}/api/goal`);if(!t.ok)return;let r=await t.json();r.goal?e.activeGoal={id:r.goal.id,objective:r.goal.objective,status:r.goal.status,createdAt:r.goal.createdAt,updatedAt:r.goal.updatedAt,lastCheckpointSummary:r.goal.lastCheckpoint?.summary,nextAction:r.goal.lastCheckpoint?.nextAction}:e.activeGoal=null,Vt()}catch{}}function Vt(){let t=document.getElementById(`goalCockpit`);if(!t)return;let n=e.activeGoal;if(!n||n.status===`complete`||n.status===`cancelled`){t.hidden=!0,t.innerHTML=``;return}t.hidden=!1,t.replaceChildren();let r=n.status===`paused`?`paused`:n.status===`blocked`?`blocked`:`active`,i=document.createElement(`span`);i.className=`goal-objective`,i.title=n.objective,i.textContent=n.objective;let a=document.createElement(`span`);if(a.className=`goal-status goal-status--${r}`,a.textContent=n.status,t.append(i,a),n.nextAction){let e=document.createElement(`span`);e.className=`goal-next`,e.textContent=n.nextAction,t.append(e)}}function Ht(t,n){let r=new Set([`IDLE`,`I`,`P`,`A`,`B`,`C`,`D`]).has(t)?t:`IDLE`;if(e.orcState=r,r===`IDLE`||r===`D`)document.body.removeAttribute(`data-orc-state`),document.body.style.removeProperty(`--orc-glow`);else{document.body.setAttribute(`data-orc-state`,r);let e=`--orc-glow-${r}`,t=getComputedStyle(document.documentElement).getPropertyValue(e).trim();document.body.style.setProperty(`--orc-glow`,t)}document.body.classList.add(`orc-pulse`),setTimeout(()=>document.body.classList.remove(`orc-pulse`),700);let i=document.getElementById(`orcStateBadge`);i&&(i.textContent={IDLE:``,I:`INTERVIEW`,P:`PLAN`,A:`AUDIT`,B:`BUILD`,C:`CHECK`,D:`DONE`}[r],i.style.display=r===`IDLE`?`none`:`inline-block`);let a=document.getElementById(`pabcRoadmap`),o=document.getElementById(`sharkRunner`),s=document.getElementById(`pabcBrand`);if(a&&o){if(!a.dataset.resizeObserved){a.dataset.resizeObserved=`1`,new ResizeObserver(()=>{F&&o.classList.contains(`running`)&&dt(a,o,F)}).observe(a);let e=0;window.addEventListener(`resize`,()=>{cancelAnimationFrame(e),e=requestAnimationFrame(()=>{F&&o.classList.contains(`running`)&&dt(a,o,F)})})}if(r===`IDLE`)a.classList.remove(`visible`,`shimmer-out`),o.classList.remove(`running`),F=null;else if(r===`D`){P.forEach(e=>{let t=document.getElementById(`dot-${e}`);t&&(t.className=`pabc-dot done`,t.setAttribute(`data-phase`,e))});for(let e=0;e<P.length;e++){let t=document.getElementById(`pabc-conn-${e}`);t&&(t.className=`pabc-connector done`)}o.classList.remove(`running`),F=null,a.classList.add(`shimmer-out`),setTimeout(()=>a.classList.remove(`visible`,`shimmer-out`),1e3)}else{a.classList.remove(`shimmer-out`),a.classList.add(`visible`),o.classList.add(`running`);let e=P.indexOf(r);P.forEach((t,n)=>{let r=document.getElementById(`dot-${t}`);r&&(r.className=`pabc-dot ${n<e?`done`:n===e?`active`:`future`}`,r.setAttribute(`data-phase`,t))});for(let t=0;t<P.length;t++){let n=document.getElementById(`pabc-conn-${t}`);n&&(n.className=`pabc-connector ${t<e?`done`:``}`)}F=r,requestAnimationFrame(()=>dt(a,o,r))}s&&n&&(s.textContent=n)}}var Ut=!1,Wt=Promise.resolve(),Gt=0;function K(){Mt(),Ut||(Ut=!0,tn()),$t(),C(a())}var Kt=K;function qt(e){console.log(`[${e}] connected`),X=2e3,Xt();let t=Date.now()-V<1e4;Wt=r(()=>import(`./ui-yrn3s72A.js`).then(async n=>{if(n.cleanupToolActivity(),!t)try{await n.loadMessages(),V=Date.now()}catch(t){console.error(`[${e}] loadMessages failed`,t)}await U(`reconnect`,{hydrateRun:!0}).catch(()=>{}).finally(()=>n.reconcileChatBottomAfterRestore(`reconnect`)),r(()=>import(`./memory-BcZdf_oz.js`).then(e=>e.refreshMemorySidebar()),__vite__mapDeps([0])).catch(()=>{}),r(()=>import(`./bgtask-badge-CidVvjWb.js`).then(e=>e.refreshBgtaskBadge()),__vite__mapDeps([0])).catch(()=>{})}),void 0)}function Jt(){re(`replay_gap`),Wt=r(()=>import(`./ui-yrn3s72A.js`).then(async e=>{try{await e.loadMessages(),V=Date.now()}catch(e){console.error(`[sse] replay gap loadMessages failed`,e)}await U(`replay_gap`,{hydrateRun:!0}).catch(()=>{}).finally(()=>e.reconcileChatBottomAfterRestore(`replay_gap`))}),__vite__mapDeps([0]))}var Yt=8e3,q=null;function Xt(){q!==null&&(window.clearTimeout(q),q=null)}function Zt(){console.log(`[channel] disconnected`),r(()=>import(`./ui-yrn3s72A.js`).then(e=>e.cleanupToolActivity()),__vite__mapDeps([0])),q===null&&(q=window.setTimeout(()=>{q=null,l(`idle`),u(`${s.exec} ${c(`ws.disconnected`)}`,`tool-activity`)},Yt))}var J=null,Y=!1,X=2e3,Qt=3e4;function $t(){if(J){Y=!0;try{J.close()}catch{}J=null}}function en(){if(J)return;console.warn(`[channel] /api/events unavailable — falling back to legacy WebSocket`);let e=`ws://${location.host}`,t=new WebSocket(`${e}${n}/?lang=${a()}`);J=t,Y=!1,t.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{console.warn(`[ws] malformed message:`,e.data);return}if(!t||typeof t!=`object`||typeof t.type!=`string`){console.warn(`[ws] invalid message shape:`,t);return}nn(t)};let r=!1;t.onopen=()=>{r=!0,X=2e3,qt(`ws`)},t.onclose=()=>{if(J===t&&(J=null),Y){Y=!1;return}if(r){Zt(),setTimeout(K,2e3);return}X=Math.min(X*2,Qt),setTimeout(K,X)}}function tn(){Me(`widget`,`widget_updated`,e=>{let t=e.chatId,n=e.widgetId;typeof t!=`string`||typeof n!=`string`||r(()=>import(`./iframe-renderer-aFXUtTXX.js`).then(e=>e.refreshFileWidget(t,n)),__vite__mapDeps([0])).catch(e=>console.warn(`[widget] refresh failed:`,e.message))}),Me(`*`,null,e=>{nn({...e,type:e.event})}),ke(()=>qt(`sse`)),Ae(()=>Zt()),je(()=>en())}function nn(t){if(t.type===`agent_tool`){if(f())return;let e=typeof t.traceRunId==`string`&&t.traceRunId?t.traceRunId:null,n=ht(t.traceSeq);if(mt(e)||vt(e,n,t.sseReplay===!0))return;t.isEmployee!==!0&&bt(e);let r=t.toolType===`thinking`?`thinking`:t.toolType===`search`?`search`:t.toolType===`subagent`?`subagent`:`tool`;se({id:`step-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,type:r,icon:t.icon||s.tool,rawIcon:t.rawIcon||t.icon||``,label:t.label||``,isEmployee:t.isEmployee===!0,detail:t.detail||``,stepRef:t.stepRef||``,traceRunId:t.traceRunId||``,traceSeq:t.traceSeq,detailAvailable:t.detailAvailable,detailBytes:t.detailBytes,rawRetentionStatus:t.rawRetentionStatus,status:t.status||`running`,startTime:typeof t.startedAt==`number`&&t.startedAt>0?t.startedAt:Date.now()},typeof t.startedAt==`number`&&t.startedAt>0?t.startedAt:void 0),gt(e,n)}else if(t.type===`agent_output`||t.type===`agent_chunk`){if(f())return;let e=typeof t.traceRunId==`string`&&t.traceRunId?t.traceRunId:null;if(mt(e))return;bt(e);let n=t.text||``;if(e&&typeof t.textLen==`number`){if(t.textLen<=R){t.sseReplay!==!0&&t.textLen<R&&(console.warn(`[ws] live agent_output behind applied cursor — resync (${t.textLen} < ${R})`),R=t.textLen);return}let e=t.textLen-R;e<n.length&&(n=n.slice(-e)),R=t.textLen}fe(n)}else if(t.type===`agent_status`){if(!t.running&&f())return;t.running&&f()&&ce(),t.running===void 0?l(t.status||`idle`):l(t.running?`running`:`idle`),t.agentId&&t.phase&&(I[t.agentId]={phase:t.phase,phaseLabel:t.phaseLabel||``},r(()=>import(`./employees-DCju7V1x.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0])))}else if(t.type===`bgtask_update`)r(()=>import(`./bgtask-badge-CidVvjWb.js`).then(e=>e.applyBgtaskUpdate(t)),__vite__mapDeps([0])).catch(()=>{});else if(t.type===`queue_update`)oe(t.pending||0),Array.isArray(t.queued)&&D(t.queued),U(`queue_update`).catch(()=>{});else if(t.type===`agent_retry`){let e=Number(t.delay??0),n=t.reason,r=o(String(n||`429`));u(c(e>0?`ws.retry`:`ws.retryNow`,{cli:o(t.cli||``),reason:r,delay:e}),`tool-activity`)}else if(t.type===`agent_fallback`)u(c(`ws.fallback`,{from:o(t.from||``),to:o(t.to||``)}),`tool-activity`);else if(t.type===`agent_smoke`)u(`${s.warning} ${o(t.cli||`agent`)}: smoke response detected — auto-continuing`,`tool-activity`);else if(t.type===`goal_done`)e.activeGoal=null,Vt(),u(`🎯 Goal completed${t.source===`ai_output`?` (detected from AI output)`:``}`,`tool-activity`);else if(t.type===`goal_cancel`)e.activeGoal=null,Vt(),u(`🎯 Goal cancelled`,`tool-activity`);else if(t.type===`schedule_wakeup`)u(`⏰ Wakeup scheduled in ${t.delaySeconds}s — ${o(String(t.reason||``))}`,`tool-activity`);else if(t.type===`goal_continuation_limit`)u(`⚠️ Goal continuation limit reached (${t.attempts} attempts)`,`tool-activity`);else if(t.type===`goal_continuation`)u(`🎯 Active goal — auto-continuing`,`tool-activity`);else if(t.type===`agent_done`){if(!(t.steered||f())){let e=typeof t.traceRunId==`string`&&t.traceRunId?t.traceRunId:null;if(mt(e)||e&&L&&e!==L)return;yt(e),d(t.text||``,t.toolLog),ct()}}else if(t.type===`orchestrate_done`)yt(null),d(t.text||``),ct();else if(t.type===`clear`){te(),ue(),ne().clear();let e=document.getElementById(`chatMessages`);e&&(e.innerHTML=``),r(()=>import(`./idb-cache-B5PX63p7.js`).then(e=>e.clearScopedCache()),[]).catch(()=>{})}else if(t.type===`session_reset`)u(`${s.refresh} Session reset — history preserved`,`tool-activity`);else if(t.type===`agent_added`||t.type===`agent_updated`||t.type===`agent_deleted`)r(()=>import(`./employees-DCju7V1x.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0]));else if(t.type===`heartbeat_pending`){let e={pending:t.pending||0,deferredPending:t.deferredPending||0};t.reason!==void 0&&(e.reason=t.reason),t.policy!==void 0&&(e.policy=t.policy),t.jobId!==void 0&&(e.jobId=t.jobId),t.jobName!==void 0&&(e.jobName=t.jobName),Pt(e)}else if(t.type===`orc_state`)rn(t);else if(t.type===`memory_status`)r(()=>import(`./memory-BcZdf_oz.js`).then(e=>e.refreshMemorySidebar()),__vite__mapDeps([0]));else if(t.type===`steer_started`)pe(),yt(null),d(``),l(`steering`);else if(t.type===`new_message`&&(t.source===`telegram`||t.source===`discord`||t.source===`slack`||t.source===`bgtask`||t.source===`cli`||t.source===`goal`||t.external===!0||t.fromQueue===!0)){let e=t.role===`assistant`?`agent`:t.role||`user`,n=t.content||``,i=t.cli;r(()=>import(`./message-history-DrEPUdTy.js`).then(t=>{if(t.historyReloadInFlight()){t.loadMessages().then(()=>t.loadMessages()).catch(e=>console.warn(`[ws] new_message reload after in-flight failed`,e));return}ae(e,n,i)}),__vite__mapDeps([0]))}else t.type===`system_notice`?u(`ℹ️ ${o(t.text||``)}`,`tool-activity`):t.type===`replay_gap`?Jt():t.type===`worker_stalled`?u(`⚠️ Worker stalled: ${o(t.employeeName||t.agentId||``)}`,`tool-activity`):t.type===`worker_disconnected`?u(`🔌 Worker disconnected: ${o(t.agentId||``)} (exit ${o(String(t.exitCode??`?`))})`,`tool-activity`):t.type===`worker_timeout`?u(`⏱️ Worker timed out: ${o(t.employeeName||t.agentId||``)}`,`tool-activity`):t.type===`alert_escalation`?u(o(t.message||``),`tool-activity`):t.type===`schedule_wakeup_failed`?u(`⚠️ Wakeup failed — ${o(String(t.reason||``))}: ${o(t.error||``)}`,`tool-activity`):t.type===`goal_continuation_failed`?u(`⚠️ Goal continuation failed: ${o(t.error||``)}`,`tool-activity`):t.type===`settings_change`?jt(t):t.type===`session_list`?ee(t):(t.type===`session_switched`||t.type===`session_created`)&&window.location.reload()}function rn(e){let t=++Gt;Wt.then(()=>{t===Gt&&ut(e.scope,St)&&(Ht(typeof e.state==`string`?e.state:`IDLE`,e.title),Ft({taskAnchor:e.taskAnchor||null,resolvedSelection:e.resolvedSelection||null,interview:e.interview||null}),zt(e.buildBudget||null,typeof e.state==`string`?e.state:`IDLE`))})}function an(e){return I[e]||null}var on=`sidebarState`,sn=900,cn=768;function ln(){return window.innerWidth<=cn}function Z(){document.body.classList.remove(`left-expanded`,`right-expanded`)}function un(e){let t=`${e}-expanded`,n=e===`left`?`right-expanded`:`left-expanded`,r=!document.body.classList.contains(t);document.body.classList.remove(n),document.body.classList.toggle(t,r)}function dn(){let e={};try{e=JSON.parse(localStorage.getItem(on)||`{}`)}catch{}e.left&&document.body.classList.add(`left-collapsed`),e.right&&document.body.classList.add(`right-collapsed`);let t=ln();document.getElementById(`toggleLeft`)?.addEventListener(`click`,fn),document.getElementById(`toggleRight`)?.addEventListener(`click`,pn),window.addEventListener(`resize`,()=>{let e=ln();if(window.innerWidth>sn){Z();let e={};try{e=JSON.parse(localStorage.getItem(on)||`{}`)}catch{}document.body.classList.toggle(`left-collapsed`,!!e.left),document.body.classList.toggle(`right-collapsed`,!!e.right)}else document.body.classList.remove(`left-collapsed`,`right-collapsed`),e!==t&&Z();t=e,$()}),window.innerWidth<=sn&&(document.body.classList.remove(`left-collapsed`,`right-collapsed`),ln()&&Z()),$()}function Q(){return window.innerWidth<=sn}function fn(){Q()?un(`left`):document.body.classList.toggle(`left-collapsed`),gn(),$()}function pn(){Q()?un(`right`):document.body.classList.toggle(`right-collapsed`),hn()&&document.getElementById(`tabAgents`)?.classList.contains(`active`)&&r(()=>import(`./employees-DCju7V1x.js`).then(e=>e.loadEmployees(!0)),__vite__mapDeps([0])),gn(),$()}function mn(){return Q()?document.body.classList.contains(`left-expanded`):!document.body.classList.contains(`left-collapsed`)}function hn(){return Q()?document.body.classList.contains(`right-expanded`):!document.body.classList.contains(`right-collapsed`)}function $(){let e=document.getElementById(`toggleLeft`),t=document.getElementById(`toggleRight`);e&&(e.innerHTML=mn()?s.chevronLeft:s.chevronRight),t&&(t.innerHTML=hn()?s.chevronRight:s.chevronLeft)}function gn(){localStorage.setItem(on,JSON.stringify({left:document.body.classList.contains(`left-collapsed`),right:document.body.classList.contains(`right-collapsed`)}))}export{K as a,U as c,Ge as d,Se as f,pn as i,lt as l,hn as n,an as o,fn as r,Kt as s,dn as t,st as u};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-DlLjK0OJ.js";var t=1;function n(){if(!(typeof globalThis>`u`))return globalThis}e(n,`getCaptureGlobal`);function r(){return!!n()?.mermaidCaptureSizes}e(r,`shouldCaptureSizes`);function i(){return typeof location>`u`?`browser-dev`:`${location.pathname}${location.search}`}e(i,`capturedFromLocation`);function a(e,t){let r=n();if(!r)return;let i=t.node(),a=((i&&`ownerSVGElement`in i?i.ownerSVGElement:null)??i)?.id??`(unknown)`;r.mermaidCapturedSizes??=[];let o={svgId:a,sizes:e};r.mermaidCapturedSizes.push(o),r.mermaidLastCapturedSizes=o}e(a,`emitCapturedSizes`);function o(e,n){let r=[];for(let e of n.nodes)e.isGroup||r.push({id:e.id,width:e.width??0,height:e.height??0});r.length!==0&&a({metadata:{captureVersion:t,capturedAt:new Date().toISOString(),capturedFrom:i()},nodes:r},e)}e(o,`captureNodeSizes`);export{o as captureNodeSizes};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./state-DxpgDKMO.js";import{i as t}from"./api-tVoG39dL.js";import{M as n,O as r,P as i,R as a,j as o}from"./render-B-8i-Rxq.js";var s=[`productivity`,`communication`,`devtools`,`ai-media`,`utility`,`smarthome`,`automation`];function c(e,t){return t?[e.id,e.name,e.description,e.category,e.requires?.env?.join(` `),e.requires?.bins?.join(` `),e.install].filter(Boolean).join(` `).toLowerCase().includes(t):!0}async function l(){try{e.allSkills=await(await i(`/api/skills`)).json(),u()}catch{let e=document.getElementById(`skillsList`);e&&(e.innerHTML=`<div style="color:var(--text-dim);font-size:11px">${a(`skill.loadFail`)}</div>`)}}function u(){let t=document.getElementById(`skillsList`),i=document.getElementById(`skillsCount`);if(!t||!i)return;let l=e.allSkills,u=l;e.currentSkillFilter===`installed`?u=l.filter(e=>e.enabled):e.currentSkillFilter===`other`?u=l.filter(e=>!s.includes(e.category||``)):e.currentSkillFilter!==`all`&&(u=l.filter(t=>t.category===e.currentSkillFilter));let d=e.currentSkillSearch.trim().toLowerCase();u=u.filter(e=>c(e,d));let f=l.filter(e=>e.enabled).length;if(i.textContent=d?a(`skill.countFiltered`,{shown:u.length,active:f,total:l.length}):a(`skill.count`,{active:f,total:l.length}),!u.length){t.innerHTML=`<div class="skill-empty">${n(a(`skill.search.empty`))}</div>`;return}t.innerHTML=u.map(e=>{let t=[];return e.requires?.env&&t.push(`${r.key} `+e.requires.env.map(e=>n(e)).join(`, `)),e.requires?.bins&&t.push(`${r.settings} `+e.requires.bins.map(e=>n(e)).join(`, `)),e.install&&t.push(n(e.install)),`
1
+ import{t as e}from"./state-DxpgDKMO.js";import{i as t}from"./api-tVoG39dL.js";import{M as n,O as r,P as i,R as a,j as o}from"./render-Cd4frZ2U.js";var s=[`productivity`,`communication`,`devtools`,`ai-media`,`utility`,`smarthome`,`automation`];function c(e,t){return t?[e.id,e.name,e.description,e.category,e.requires?.env?.join(` `),e.requires?.bins?.join(` `),e.install].filter(Boolean).join(` `).toLowerCase().includes(t):!0}async function l(){try{e.allSkills=await(await i(`/api/skills`)).json(),u()}catch{let e=document.getElementById(`skillsList`);e&&(e.innerHTML=`<div style="color:var(--text-dim);font-size:11px">${a(`skill.loadFail`)}</div>`)}}function u(){let t=document.getElementById(`skillsList`),i=document.getElementById(`skillsCount`);if(!t||!i)return;let l=e.allSkills,u=l;e.currentSkillFilter===`installed`?u=l.filter(e=>e.enabled):e.currentSkillFilter===`other`?u=l.filter(e=>!s.includes(e.category||``)):e.currentSkillFilter!==`all`&&(u=l.filter(t=>t.category===e.currentSkillFilter));let d=e.currentSkillSearch.trim().toLowerCase();u=u.filter(e=>c(e,d));let f=l.filter(e=>e.enabled).length;if(i.textContent=d?a(`skill.countFiltered`,{shown:u.length,active:f,total:l.length}):a(`skill.count`,{active:f,total:l.length}),!u.length){t.innerHTML=`<div class="skill-empty">${n(a(`skill.search.empty`))}</div>`;return}t.innerHTML=u.map(e=>{let t=[];return e.requires?.env&&t.push(`${r.key} `+e.requires.env.map(e=>n(e)).join(`, `)),e.requires?.bins&&t.push(`${r.settings} `+e.requires.bins.map(e=>n(e)).join(`, `)),e.install&&t.push(n(e.install)),`
2
2
  <div class="skill-card ${e.enabled?`enabled`:``}">
3
3
  <div class="skill-card-header">
4
4
  <span class="skill-emoji">${e.emoji?o(e.emoji):r.tool}</span>
@@ -0,0 +1 @@
1
+ import{n as e}from"./skills-DeG9lWF2.js";export{e as loadSkills};
@@ -0,0 +1 @@
1
+ import{a as e}from"./slash-commands-FoQuZXga.js";export{e as loadCommands};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./api-tVoG39dL.js";import{M as t,R as n}from"./render-B-8i-Rxq.js";import{t as r}from"./locale-DC-ZsWOf.js";var i={activeCli:o(`activeCli`,2,1,2,2,1,3),model:o(`model`,2,1,1,2,1,2),effort:o(`effort`,2,1,1),permissions:o(`permissions`,2,1,1),flushAgent:o(`flushAgent`,2,1,1,2,1,3),employees:o(`employees`,3,3,2,4,1,2),skills:o(`skills`,2,1,1,4,1,3),activeChannel:o(`activeChannel`,2,1,1),telegram:{...o(`telegram`,2,1,2,8),docLinks:[{url:`https://t.me/BotFather`,labelKey:`help.telegram.link.botfather`},{url:`https://core.telegram.org/bots/tutorial`,labelKey:`help.telegram.link.docs`}]},discord:{...o(`discord`,2,1,2,9),docLinks:[{url:`https://discord.com/developers/applications`,labelKey:`help.discord.link.portal`},{url:`https://discord.com/developers/docs/getting-started`,labelKey:`help.discord.link.docs`}]},slack:{...o(`slack`,2,1,2,9),docLinks:[{url:`https://api.slack.com/apps`,labelKey:`help.slack.link.portal`},{url:`https://docs.slack.dev/apis/events-api/using-socket-mode/`,labelKey:`help.slack.link.docs`}]},fallbackOrder:o(`fallbackOrder`,2,1,1,2,1,3),mcp:o(`mcp`,2,1,1,4,1,5),memory:o(`memory`,2,1,2,4,1,2),stt:o(`stt`,2,1,1),promptTemplates:o(`promptTemplates`,2,1,1),chatInput:o(`chatInput`,3,2,2),orchestration:o(`orchestration`,3,2,2,8,1,8),attachments:o(`attachments`,3,2,2),diagrams:o(`diagrams`,3,2,2),keyboardShortcuts:o(`keyboardShortcuts`,3,2,2,3,2,3),session:o(`session`,3,1,2,8,1,9),cliTools:o(`cliTools`,3,1,2,6,1,9),agentControl:o(`agentControl`,3,1,2,6,1,6),goals:o(`goals`,3,1,2,10,1,25)};function a(e){return typeof e==`string`&&Object.prototype.hasOwnProperty.call(i,e)}function o(e,t,n,r,i=2,a=1,o=0){return{titleKey:`help.${e}.title`,introKey:`help.${e}.intro`,effectKey:`help.${e}.effect`,useWhenKeys:s(`help.${e}.use`,t),howToKeys:s(`help.${e}.howTo`,i),exampleKeys:s(`help.${e}.example`,a),avoidWhenKeys:s(`help.${e}.avoid`,n),relatedKeys:s(`help.${e}.related`,r),...o>0?{subcmdKeys:s(`help.${e}.subcmd`,o)}:{}}}function s(e,t){return Array.from({length:t},(t,n)=>`${e}.${n+1}`)}var c=!1,l=null,u=null,d=null,f=null,p=null,m=!1;function h(){c||(c=!0,document.addEventListener(`click`,v),document.addEventListener(`keydown`,y,!0))}function g(e,t=null,n=[e]){if(!i[e]){console.warn(`[help-dialog] unknown topic:`,e);return}b(),p=t,x(e,T(n,e)),l?.classList.add(`open`),l?.setAttribute(`aria-hidden`,`false`),m=!0,requestAnimationFrame(()=>f?.focus())}function _(){if(!m)return;l?.classList.remove(`open`),l?.setAttribute(`aria-hidden`,`true`),m=!1;let e=p;p=null,e?.focus()}function v(e){let t=e.target?.closest(`[data-help-topic]`);if(!t)return;let n=t.getAttribute(`data-help-topic`);if(!a(n)){console.warn(`[help-dialog] invalid topic:`,n);return}e.preventDefault(),g(n,t,w(t.getAttribute(`data-help-topics`),n))}function y(e){!m||e.key!==`Escape`||(e.preventDefault(),e.stopImmediatePropagation(),_())}function b(){if(l&&u&&d&&f)return;l=document.createElement(`div`),l.id=`helpDialog`,l.className=`modal-overlay help-dialog-overlay`,l.setAttribute(`role`,`presentation`),l.setAttribute(`aria-hidden`,`true`),l.addEventListener(`click`,e=>{e.target===l&&_()});let e=document.createElement(`div`);e.className=`modal-box help-dialog-box`,e.setAttribute(`role`,`dialog`),e.setAttribute(`aria-modal`,`true`),e.setAttribute(`aria-labelledby`,`helpDialogTitle`),e.addEventListener(`click`,e=>e.stopPropagation());let t=document.createElement(`div`);t.className=`modal-header help-dialog-header`,u=document.createElement(`span`),u.id=`helpDialogTitle`,f=document.createElement(`button`),f.type=`button`,f.className=`btn-modal-close help-dialog-close`,f.setAttribute(`aria-label`,n(`help.close`)),f.textContent=`x`,f.addEventListener(`click`,()=>_()),d=document.createElement(`div`),d.className=`help-dialog-body`;let r=document.createElement(`div`);r.className=`modal-footer help-dialog-footer`;let i=document.createElement(`button`);i.type=`button`,i.className=`btn-save help-dialog-done`,i.textContent=n(`help.close`),i.addEventListener(`click`,()=>_()),t.append(u,f),r.append(i),e.append(t,d,r),l.append(e),document.body.append(l)}function x(e,t=[e]){if(!u||!d||!f)return;let r=i[e];u.textContent=n(r.titleKey),f.setAttribute(`aria-label`,n(`help.close`)),d.replaceChildren();let a=document.createElement(`div`);if(a.className=`help-dialog-content`,S(a,r),t.length<=1){d.append(a);return}let o=document.createElement(`div`);o.className=`help-dialog-layout`,o.append(C(t,e),a),d.append(o)}function S(e,t){t.docLinks?.length&&E(e,t.docLinks),D(e,n(`help.section.what`),n(t.introKey)),D(e,n(`help.section.effect`),n(t.effectKey),`help-effect-text`),O(e,n(`help.section.useWhen`),t.useWhenKeys),A(e,n(`help.section.howTo`),t.howToKeys),O(e,n(`help.section.example`),t.exampleKeys,!1,`help-example-list`),t.avoidWhenKeys?.length&&O(e,n(`help.section.avoidWhen`),t.avoidWhenKeys),t.subcmdKeys?.length&&j(e,n(`help.section.commands`),t.subcmdKeys),t.relatedKeys?.length&&O(e,n(`help.section.related`),t.relatedKeys,!0)}function C(e,t){let r=document.createElement(`nav`);r.className=`help-dialog-nav`,r.setAttribute(`aria-label`,n(`help.section.related`));for(let a of e){let o=i[a],s=document.createElement(`button`);s.type=`button`,s.className=`help-dialog-nav-item`,s.textContent=n(o.titleKey),a===t&&(s.classList.add(`active`),s.setAttribute(`aria-current`,`page`)),s.addEventListener(`click`,()=>x(a,e)),r.append(s)}return r}function w(e,t){return T(e?.split(/[\s,]+/).filter(Boolean)??[],t)}function T(e,t){let n=[];for(let t of e)a(t)&&!n.includes(t)&&n.push(t);return n.includes(t)||n.unshift(t),n}function E(e,t){let r=document.createElement(`section`);r.className=`help-dialog-section help-doc-links`;let i=document.createElement(`nav`);i.className=`help-doc-links-nav`;for(let e of t){let t=document.createElement(`a`);t.href=e.url,t.target=`_blank`,t.rel=`noopener noreferrer`,t.className=`help-doc-link`,t.textContent=n(e.labelKey);let r=document.createElement(`span`);r.className=`help-doc-link-icon`,r.textContent=`↗`,t.append(r),i.append(t)}r.append(i),e.append(r)}function D(e,t,n,r){let i=k(t),a=document.createElement(`p`);r&&(a.className=r),a.textContent=n,i.append(a),e.append(i)}function O(e,t,r,i=!1,a){let o=k(t),s=document.createElement(`ul`);s.className=a??(i?`help-related-list`:`help-dialog-list`);for(let e of r){let t=document.createElement(`li`);t.textContent=n(e),s.append(t)}o.append(s),e.append(o)}function k(e){let t=document.createElement(`section`);t.className=`help-dialog-section`;let n=document.createElement(`h3`);return n.textContent=e,t.append(n),t}function A(e,t,r){let i=k(t),a=document.createElement(`ol`);a.className=`help-dialog-list help-howto-list`;for(let e of r){let t=document.createElement(`li`);t.textContent=n(e),a.append(t)}i.append(a),e.append(i)}function j(e,t,r){let i=k(t),a=document.createElement(`dl`);a.className=`help-subcmd-list`;for(let e of r){let t=n(e),r=t.indexOf(` — `),i=r>=0?t.slice(0,r):t,o=r>=0?t.slice(r+3):``,s=document.createElement(`dt`);s.className=`help-subcmd-cmd`;let c=document.createElement(`code`);c.textContent=i,s.append(c);let l=document.createElement(`dd`);l.className=`help-subcmd-desc`,l.textContent=o,a.append(s,l)}i.append(a),e.append(i)}var M={mcp:`mcp`,memory:`memory`,model:`model`,effort:`effort`,cli:`activeCli`,skill:`skills`,employee:`employees`,orchestrate:`orchestration`,pabcd:`orchestration`,flush:`flushAgent`,fallback:`fallbackOrder`,prompt:`promptTemplates`,browser:`mcp`,status:`activeCli`,steer:`chatInput`,clear:`session`,compact:`session`,reset:`session`,purge:`session`,new:`session`,switch:`session`,sw:`session`,sessions:`session`,ss:`session`,version:`cliTools`,project:`cliTools`,proj:`cliTools`,ide:`cliTools`,file:`cliTools`,forward:`agentControl`,thought:`agentControl`,goal:`goals`,goalplan:`goals`,gd:`goals`,plan:`goals`,interview:`goals`,deliberate:`goals`,planaudit:`goals`,review:`goals`,search:`mcp`,team:`goals`,task:`goals`,help:`keyboardShortcuts`,h:`keyboardShortcuts`,commands:`keyboardShortcuts`,cmd:`keyboardShortcuts`,fork:`session`,quit:`session`,q:`session`,exit:`session`,telegram:`telegram`,discord:`discord`,slack:`slack`,stt:`stt`,attachments:`attachments`,diagrams:`diagrams`};function N(e){let t=e.replace(/^\//,``).trim().split(/\s+/);if(t.length<2||t[t.length-1].toLowerCase()!==`info`)return!1;let n=M[t[0].toLowerCase()];return n?(g(n),!0):!1}var P=[],F=[],I=-1,L=!1,R=null;function z(e){let t=String(e||``).slice(1).trim().split(/\s+/)[0]||``;return t.includes(`/`)||t.includes(`\\`)}var B=()=>document.getElementById(`cmdDropdown`),V=()=>document.getElementById(`chatInput`);function H(e){let t=String(e||``).toLowerCase();return P.filter(e=>`/${e.name}`.startsWith(t))}function U(e){let t=e.workflow?.workflowArgs||[];return t.length?t.map(e=>e.required?`<${e.name}>`:`[${e.name}]`).join(` `):e.args||``}function W(e){let n=e.workflow;return n?`<span class="cmd-meta">
1
+ import{n as e}from"./api-tVoG39dL.js";import{M as t,R as n}from"./render-Cd4frZ2U.js";import{t as r}from"./locale-DC-ZsWOf.js";var i={activeCli:o(`activeCli`,2,1,2,2,1,3),model:o(`model`,2,1,1,2,1,2),effort:o(`effort`,2,1,1),permissions:o(`permissions`,2,1,1),flushAgent:o(`flushAgent`,2,1,1,2,1,3),employees:o(`employees`,3,3,2,4,1,2),skills:o(`skills`,2,1,1,4,1,3),activeChannel:o(`activeChannel`,2,1,1),telegram:{...o(`telegram`,2,1,2,8),docLinks:[{url:`https://t.me/BotFather`,labelKey:`help.telegram.link.botfather`},{url:`https://core.telegram.org/bots/tutorial`,labelKey:`help.telegram.link.docs`}]},discord:{...o(`discord`,2,1,2,9),docLinks:[{url:`https://discord.com/developers/applications`,labelKey:`help.discord.link.portal`},{url:`https://discord.com/developers/docs/getting-started`,labelKey:`help.discord.link.docs`}]},slack:{...o(`slack`,2,1,2,9),docLinks:[{url:`https://api.slack.com/apps`,labelKey:`help.slack.link.portal`},{url:`https://docs.slack.dev/apis/events-api/using-socket-mode/`,labelKey:`help.slack.link.docs`}]},fallbackOrder:o(`fallbackOrder`,2,1,1,2,1,3),mcp:o(`mcp`,2,1,1,4,1,5),memory:o(`memory`,2,1,2,4,1,2),stt:o(`stt`,2,1,1),promptTemplates:o(`promptTemplates`,2,1,1),chatInput:o(`chatInput`,3,2,2),orchestration:o(`orchestration`,3,2,2,8,1,8),attachments:o(`attachments`,3,2,2),diagrams:o(`diagrams`,3,2,2),keyboardShortcuts:o(`keyboardShortcuts`,3,2,2,3,2,3),session:o(`session`,3,1,2,8,1,9),cliTools:o(`cliTools`,3,1,2,6,1,9),agentControl:o(`agentControl`,3,1,2,6,1,6),goals:o(`goals`,3,1,2,10,1,25)};function a(e){return typeof e==`string`&&Object.prototype.hasOwnProperty.call(i,e)}function o(e,t,n,r,i=2,a=1,o=0){return{titleKey:`help.${e}.title`,introKey:`help.${e}.intro`,effectKey:`help.${e}.effect`,useWhenKeys:s(`help.${e}.use`,t),howToKeys:s(`help.${e}.howTo`,i),exampleKeys:s(`help.${e}.example`,a),avoidWhenKeys:s(`help.${e}.avoid`,n),relatedKeys:s(`help.${e}.related`,r),...o>0?{subcmdKeys:s(`help.${e}.subcmd`,o)}:{}}}function s(e,t){return Array.from({length:t},(t,n)=>`${e}.${n+1}`)}var c=!1,l=null,u=null,d=null,f=null,p=null,m=!1;function h(){c||(c=!0,document.addEventListener(`click`,v),document.addEventListener(`keydown`,y,!0))}function g(e,t=null,n=[e]){if(!i[e]){console.warn(`[help-dialog] unknown topic:`,e);return}b(),p=t,x(e,T(n,e)),l?.classList.add(`open`),l?.setAttribute(`aria-hidden`,`false`),m=!0,requestAnimationFrame(()=>f?.focus())}function _(){if(!m)return;l?.classList.remove(`open`),l?.setAttribute(`aria-hidden`,`true`),m=!1;let e=p;p=null,e?.focus()}function v(e){let t=e.target?.closest(`[data-help-topic]`);if(!t)return;let n=t.getAttribute(`data-help-topic`);if(!a(n)){console.warn(`[help-dialog] invalid topic:`,n);return}e.preventDefault(),g(n,t,w(t.getAttribute(`data-help-topics`),n))}function y(e){!m||e.key!==`Escape`||(e.preventDefault(),e.stopImmediatePropagation(),_())}function b(){if(l&&u&&d&&f)return;l=document.createElement(`div`),l.id=`helpDialog`,l.className=`modal-overlay help-dialog-overlay`,l.setAttribute(`role`,`presentation`),l.setAttribute(`aria-hidden`,`true`),l.addEventListener(`click`,e=>{e.target===l&&_()});let e=document.createElement(`div`);e.className=`modal-box help-dialog-box`,e.setAttribute(`role`,`dialog`),e.setAttribute(`aria-modal`,`true`),e.setAttribute(`aria-labelledby`,`helpDialogTitle`),e.addEventListener(`click`,e=>e.stopPropagation());let t=document.createElement(`div`);t.className=`modal-header help-dialog-header`,u=document.createElement(`span`),u.id=`helpDialogTitle`,f=document.createElement(`button`),f.type=`button`,f.className=`btn-modal-close help-dialog-close`,f.setAttribute(`aria-label`,n(`help.close`)),f.textContent=`x`,f.addEventListener(`click`,()=>_()),d=document.createElement(`div`),d.className=`help-dialog-body`;let r=document.createElement(`div`);r.className=`modal-footer help-dialog-footer`;let i=document.createElement(`button`);i.type=`button`,i.className=`btn-save help-dialog-done`,i.textContent=n(`help.close`),i.addEventListener(`click`,()=>_()),t.append(u,f),r.append(i),e.append(t,d,r),l.append(e),document.body.append(l)}function x(e,t=[e]){if(!u||!d||!f)return;let r=i[e];u.textContent=n(r.titleKey),f.setAttribute(`aria-label`,n(`help.close`)),d.replaceChildren();let a=document.createElement(`div`);if(a.className=`help-dialog-content`,S(a,r),t.length<=1){d.append(a);return}let o=document.createElement(`div`);o.className=`help-dialog-layout`,o.append(C(t,e),a),d.append(o)}function S(e,t){t.docLinks?.length&&E(e,t.docLinks),D(e,n(`help.section.what`),n(t.introKey)),D(e,n(`help.section.effect`),n(t.effectKey),`help-effect-text`),O(e,n(`help.section.useWhen`),t.useWhenKeys),A(e,n(`help.section.howTo`),t.howToKeys),O(e,n(`help.section.example`),t.exampleKeys,!1,`help-example-list`),t.avoidWhenKeys?.length&&O(e,n(`help.section.avoidWhen`),t.avoidWhenKeys),t.subcmdKeys?.length&&j(e,n(`help.section.commands`),t.subcmdKeys),t.relatedKeys?.length&&O(e,n(`help.section.related`),t.relatedKeys,!0)}function C(e,t){let r=document.createElement(`nav`);r.className=`help-dialog-nav`,r.setAttribute(`aria-label`,n(`help.section.related`));for(let a of e){let o=i[a],s=document.createElement(`button`);s.type=`button`,s.className=`help-dialog-nav-item`,s.textContent=n(o.titleKey),a===t&&(s.classList.add(`active`),s.setAttribute(`aria-current`,`page`)),s.addEventListener(`click`,()=>x(a,e)),r.append(s)}return r}function w(e,t){return T(e?.split(/[\s,]+/).filter(Boolean)??[],t)}function T(e,t){let n=[];for(let t of e)a(t)&&!n.includes(t)&&n.push(t);return n.includes(t)||n.unshift(t),n}function E(e,t){let r=document.createElement(`section`);r.className=`help-dialog-section help-doc-links`;let i=document.createElement(`nav`);i.className=`help-doc-links-nav`;for(let e of t){let t=document.createElement(`a`);t.href=e.url,t.target=`_blank`,t.rel=`noopener noreferrer`,t.className=`help-doc-link`,t.textContent=n(e.labelKey);let r=document.createElement(`span`);r.className=`help-doc-link-icon`,r.textContent=`↗`,t.append(r),i.append(t)}r.append(i),e.append(r)}function D(e,t,n,r){let i=k(t),a=document.createElement(`p`);r&&(a.className=r),a.textContent=n,i.append(a),e.append(i)}function O(e,t,r,i=!1,a){let o=k(t),s=document.createElement(`ul`);s.className=a??(i?`help-related-list`:`help-dialog-list`);for(let e of r){let t=document.createElement(`li`);t.textContent=n(e),s.append(t)}o.append(s),e.append(o)}function k(e){let t=document.createElement(`section`);t.className=`help-dialog-section`;let n=document.createElement(`h3`);return n.textContent=e,t.append(n),t}function A(e,t,r){let i=k(t),a=document.createElement(`ol`);a.className=`help-dialog-list help-howto-list`;for(let e of r){let t=document.createElement(`li`);t.textContent=n(e),a.append(t)}i.append(a),e.append(i)}function j(e,t,r){let i=k(t),a=document.createElement(`dl`);a.className=`help-subcmd-list`;for(let e of r){let t=n(e),r=t.indexOf(` — `),i=r>=0?t.slice(0,r):t,o=r>=0?t.slice(r+3):``,s=document.createElement(`dt`);s.className=`help-subcmd-cmd`;let c=document.createElement(`code`);c.textContent=i,s.append(c);let l=document.createElement(`dd`);l.className=`help-subcmd-desc`,l.textContent=o,a.append(s,l)}i.append(a),e.append(i)}var M={mcp:`mcp`,memory:`memory`,model:`model`,effort:`effort`,cli:`activeCli`,skill:`skills`,employee:`employees`,orchestrate:`orchestration`,pabcd:`orchestration`,flush:`flushAgent`,fallback:`fallbackOrder`,prompt:`promptTemplates`,browser:`mcp`,status:`activeCli`,steer:`chatInput`,clear:`session`,compact:`session`,reset:`session`,purge:`session`,new:`session`,switch:`session`,sw:`session`,sessions:`session`,ss:`session`,version:`cliTools`,project:`cliTools`,proj:`cliTools`,ide:`cliTools`,file:`cliTools`,forward:`agentControl`,thought:`agentControl`,goal:`goals`,goalplan:`goals`,gd:`goals`,plan:`goals`,interview:`goals`,deliberate:`goals`,planaudit:`goals`,review:`goals`,search:`mcp`,team:`goals`,task:`goals`,help:`keyboardShortcuts`,h:`keyboardShortcuts`,commands:`keyboardShortcuts`,cmd:`keyboardShortcuts`,fork:`session`,quit:`session`,q:`session`,exit:`session`,telegram:`telegram`,discord:`discord`,slack:`slack`,stt:`stt`,attachments:`attachments`,diagrams:`diagrams`};function N(e){let t=e.replace(/^\//,``).trim().split(/\s+/);if(t.length<2||t[t.length-1].toLowerCase()!==`info`)return!1;let n=M[t[0].toLowerCase()];return n?(g(n),!0):!1}var P=[],F=[],I=-1,L=!1,R=null;function z(e){let t=String(e||``).slice(1).trim().split(/\s+/)[0]||``;return t.includes(`/`)||t.includes(`\\`)}var B=()=>document.getElementById(`cmdDropdown`),V=()=>document.getElementById(`chatInput`);function H(e){let t=String(e||``).toLowerCase();return P.filter(e=>`/${e.name}`.startsWith(t))}function U(e){let t=e.workflow?.workflowArgs||[];return t.length?t.map(e=>e.required?`<${e.name}>`:`[${e.name}]`).join(` `):e.args||``}function W(e){let n=e.workflow;return n?`<span class="cmd-meta">
2
2
  <span class="cmd-chip">${t(n.phase)}</span>
3
3
  <span class="cmd-chip cmd-risk-${t(n.risk)}">${t(n.risk)}</span>
4
4
  <span class="cmd-chip">${t(n.output)}</span>
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-DlLjK0OJ.js";import{t}from"./chunk-X3CZISLH-C1s9nTVF.js";import{O as n,c as r,s as i,x as a}from"./chunk-DU6HZSFF-CqT8wcBs.js";import{Bt as o,ct as s,it as c}from"./vendor-utils-BUFU5ypz.js";import"./chunk-PWAF6VOD-B1cuaLs-.js";import{g as l}from"./chunk-75Z2AOVW-BLiFJXcr.js";import"./chunk-GMAD6QVW-BJLz4nC-.js";import"./chunk-P2QGCYS3-B-9ymCdr.js";import"./chunk-4HAMMTFA-BzeIXjef.js";import"./chunk-GVQU2GXP-BlVn1fMW.js";import"./chunk-OSK3NFVY-CrXjNywV.js";import{t as u}from"./graphlib-Cjg_soTo.js";import"./chunk-F27PBJKO-Ccrogyxp.js";import"./chunk-XXDRQBXY-DEwmqeYc.js";import"./chunk-POPQ4Y6H-Df0_Odad.js";import"./chunk-L3NEJ4N5-FGXu31jw.js";import"./chunk-LQGUR6SS-qUTD5FMI.js";import{t as d}from"./dagre-DDTOgfwg.js";import{i as f,n as p,t as m}from"./chunk-ZLD2IHE6-DOKyEMMC.js";var h=e(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit).attr(`cy`,a().state.padding+a().state.sizeUnit),`drawStartState`),g=e(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,a().state.textHeight).attr(`class`,`divider`).attr(`x2`,a().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=e((e,t)=>{let n=e.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+2*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,r.width+2*a().state.padding).attr(`height`,r.height+2*a().state.padding).attr(`rx`,a().state.radius),n},`drawSimpleState`),v=e((t,n)=>{let r=e(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*a().state.padding).text(t);n||r.attr(`dy`,a().state.textHeight)},`addTspan`),i=t.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+1.3*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),o=i.height,s=t.append(`text`).attr(`x`,a().state.padding).attr(`y`,o+a().state.padding*.4+a().state.dividerMargin+a().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=t.append(`line`).attr(`x1`,a().state.padding).attr(`y1`,a().state.padding+o+a().state.dividerMargin/2).attr(`y2`,a().state.padding+o+a().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,i.width);return u.attr(`x2`,f+3*a().state.padding),t.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,f+2*a().state.padding).attr(`height`,d.height+o+2*a().state.padding).attr(`rx`,a().state.radius),t},`drawDescrState`),y=e((e,t,n)=>{let r=a().state.padding,i=2*a().state.padding,o=e.node().getBBox(),s=o.width,c=o.x,l=e.append(`text`).attr(`x`,0).attr(`y`,a().state.titleShift).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,s);d===s&&(d+=i);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-a().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+a().state.textHeight+a().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,a().state.textHeight*3).attr(`rx`,a().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*a().state.textHeight).attr(`rx`,a().state.radius),e},`addTitleAndBox`),b=e(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,a().state.sizeUnit+a().state.miniPadding).attr(`cx`,a().state.padding+a().state.sizeUnit+a().state.miniPadding).attr(`cy`,a().state.padding+a().state.sizeUnit+a().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit+2).attr(`cy`,a().state.padding+a().state.sizeUnit+2)),`drawEndState`),x=e((e,t)=>{let n=a().state.forkWidth,r=a().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,a().state.padding).attr(`y`,a().state.padding)},`drawForkJoinState`),S=e((e,t,n,r)=>{let o=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(i.lineBreakRegex),u=1.25*a().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}o+=u,e.attr(`x`,t+a().state.noteMargin),e.attr(`y`,n+o+1.25*a().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:o}},`_drawLongText`),C=e((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,a().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*a().state.noteMargin),n.attr(`width`,r+a().state.noteMargin*2),n},`drawNote`),w=e(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type===`default`&&t.descriptions.length===0&&_(i,t),t.type===`default`&&t.descriptions.length>0&&v(i,t);let o=i.node().getBBox();return r.width=o.width+2*a().state.padding,r.height=o.height+2*a().state.padding,r},`drawState`),T=0,E=e(function(r,o,u){let d=e(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);o.points=o.points.filter(e=>!Number.isNaN(e.y));let f=o.points,p=s().x(function(e){return e.x}).y(function(e){return e.y}).curve(c),h=r.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(a().state.arrowMarkerAbsolute&&(g=n(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let e=r.append(`g`).attr(`class`,`stateLabel`),{x:n,y:s}=l.calcLabelPosition(o.points),c=i.getRows(u.title),d=0,f=[],p=0,m=0;for(let r=0;r<=c.length;r++){let i=e.append(`text`).attr(`text-anchor`,`middle`).text(c[r]).attr(`x`,n).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),t.info(a.x,n,s+d),d===0&&(d=i.node().getBBox().height,t.info(`Title height`,d,s)),f.push(i)}let h=d*c.length;if(c.length>1){let e=(c.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*c.length}let g=e.node().getBBox();e.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,n-p/2-a().state.padding/2).attr(`y`,s-h/2-a().state.padding/2-3.5).attr(`width`,p+a().state.padding).attr(`height`,h+a().state.padding),t.info(g)}T++},`drawEdge`),D,O={},k=e(function(){},`setConf`),A=e(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=e(function(e,n,i,s){D=a().state;let c=a().securityLevel,l;c===`sandbox`&&(l=o(`#i`+n));let u=o(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;t.debug(`Rendering diagram `+e);let f=u.select(`[id='${n}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,n+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;r(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=e(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=e((e,n,r,a,o,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<e.length;f++)if(e[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let i;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);i=N(t.doc,e,t.id,!a,o,s,c);{e=y(e,t,a);let n=e.node().getBBox();i.width=n.width,i.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else i=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(i.id+`-note`,e),l.setNode(i.id,i)):(l.setNode(i.id,i),l.setNode(i.id+`-note`,e)),l.setParent(i.id,i.id+`-group`),l.setParent(i.id+`-note`,i.id+`-group`)}else l.setNode(i.id,i)}t.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(e){_++,t.debug(`Setting edge`,e),l.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*i.getRows(e.title).length,labelpos:`c`},`id`+_)}),d(l),t.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(e){e!==void 0&&l.node(e)!==void 0?(t.warn(`Node `+e+`: `+JSON.stringify(l.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(l.node(e).x-l.node(e).width/2)+`,`+(l.node(e).y+(O[e]?O[e].y:0)-l.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,l.node(e).x-l.node(e).width/2),s.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):t.debug(`No Node `+e+`: `+JSON.stringify(l.node(e)))});let b=v.getBBox();l.edges().forEach(function(e){e!==void 0&&l.edge(e)!==void 0&&(t.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(l.edge(e))),E(n,l.edge(e),l.edge(e).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,t.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-DlLjK0OJ.js";import"./chunk-X3CZISLH-C1s9nTVF.js";import"./chunk-DU6HZSFF-CqT8wcBs.js";import"./chunk-PWAF6VOD-B1cuaLs-.js";import"./chunk-75Z2AOVW-BLiFJXcr.js";import"./chunk-GMAD6QVW-BJLz4nC-.js";import"./chunk-P2QGCYS3-B-9ymCdr.js";import"./chunk-4HAMMTFA-BzeIXjef.js";import"./chunk-GVQU2GXP-BlVn1fMW.js";import"./chunk-OSK3NFVY-CrXjNywV.js";import"./chunk-F27PBJKO-Ccrogyxp.js";import"./chunk-XXDRQBXY-DEwmqeYc.js";import"./chunk-POPQ4Y6H-Df0_Odad.js";import"./chunk-L3NEJ4N5-FGXu31jw.js";import"./chunk-LQGUR6SS-qUTD5FMI.js";import{i as t,n,r,t as i}from"./chunk-ZLD2IHE6-DOKyEMMC.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-DlLjK0OJ.js";import{t}from"./chunk-X3CZISLH-C1s9nTVF.js";import"./chunk-DU6HZSFF-CqT8wcBs.js";import"./chunk-PWAF6VOD-B1cuaLs-.js";import"./chunk-75Z2AOVW-BLiFJXcr.js";import"./chunk-GMAD6QVW-BJLz4nC-.js";import"./chunk-P2QGCYS3-B-9ymCdr.js";import"./chunk-4HAMMTFA-BzeIXjef.js";import"./chunk-GVQU2GXP-BlVn1fMW.js";import{o as n}from"./chunk-OSK3NFVY-CrXjNywV.js";import"./chunk-L3NEJ4N5-FGXu31jw.js";import{i as r}from"./chunk-H2I77ZZE-BXf4_vA2.js";var i=5,a=1e-5,o=1e-6;function s(e){let t=[];for(let n=0;n<e.length-1;n++)t.push({a:e[n],b:e[n+1]});return t}e(s,`buildSegmentList`);function c(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,s=r.x-n.x,c=r.y-n.y,l=i*c-a*s;if(l===0)return null;let u=n.x-e.x,d=n.y-e.y,f=(u*c-d*s)/l,p=(u*a-d*i)/l;return f<=o||f>=1-o||p<=o||p>=1-o?null:{point:{x:e.x+f*i,y:e.y+f*a},tA:f,tB:p}}e(c,`segmentIntersection`);function l(e){return Math.abs(e.b.x-e.a.x)>=Math.abs(e.b.y-e.a.y)}e(l,`isHorizontalSeg`);function u(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=s(r.points);for(let a=n+1;a<e.length;a++){let n=e[a],o=s(n.points);for(let[e,a]of i.entries())for(let[i,s]of o.entries()){let o=c(a.a,a.b,s.a,s.b);if(!o)continue;let u=l(a);u!==l(s)&&u?t.push({jumpEdgeId:r.id,otherEdgeId:n.id,segIndex:e,t:o.tA,point:o.point}):t.push({jumpEdgeId:n.id,otherEdgeId:r.id,segIndex:i,t:o.tB,point:o.point})}}}return t}e(u,`findEdgeIntersections`);function d(e){return`${Math.round(e*1e3)/1e3}`}e(d,`fmt`);function f(e){return`${d(e.x)},${d(e.y)}`}e(f,`pointToString`);function p(e){let t=e.b.x-e.a.x,n=e.b.y-e.a.y;return Math.abs(t)>=Math.abs(n)?+(t>=0):+(n>=0)}e(p,`getArcSweepFlag`);var m=.001;function h(e,t){if(e.length<2)return e.map(e=>({...e}));let r=e.map(e=>({...e})),i=t.arrowTypeStart&&n[t.arrowTypeStart];if(i){let t=e[0],n=e[1],a=Math.atan2(n.y-t.y,n.x-t.x);r[0].x=t.x+i*Math.cos(a),r[0].y=t.y+i*Math.sin(a)}let a=t.arrowTypeEnd&&n[t.arrowTypeEnd];if(a){let t=e.length,n=e[t-2],i=e[t-1],o=Math.atan2(i.y-n.y,i.x-n.x);r[t-1].x=i.x-a*Math.cos(o),r[t-1].y=i.y-a*Math.sin(o)}return r}e(h,`applyMarkerOffsets`);function g(e,t,n,r,i){let a=e.point.x,o=e.point.y,s={x:a-t*e.r,y:o-n*e.r},c={x:a+t*e.r,y:o+n*e.r},l=[`L${f(s)}`];return i===`arc`?l.push(`A${d(e.r)},${d(e.r)} 0 0 ${r} ${f(c)}`):l.push(`M${f(c)}`),l}e(g,`emitJump`);function _(e,t,n,r){let i=t.x-e.x,o=t.y-e.y,s=n.x-t.x,c=n.y-t.y,l=Math.hypot(i,o),u=Math.hypot(s,c);if(l<a||u<a)return null;let d=i/l,f=o/l,p=s/u,m=c/u,h=d*p+f*m,g=Math.acos(Math.max(-1,Math.min(1,h)));if(g<a||Math.abs(Math.PI-g)<a)return null;let _=Math.min(r/Math.sin(g/2),l/2,u/2);return{startX:t.x-d*_,startY:t.y-f*_,endX:t.x+p*_,endY:t.y+m*_,ctrlX:t.x,ctrlY:t.y,cutLen:_}}e(_,`computeRoundedCorner`);function v(e,t,n){let r=e.points;if(r.length<2)return``;let a=h(r,e),o=e.curve===`rounded`,c=s(a),l=new Map;for(let e of t){let t=c[e.segIndex];if(!t)continue;let r=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),i=l.get(e.segIndex)??[];i.push({t:e.t,point:e.point,d:e.t*r,r:n.jumpRadius}),l.set(e.segIndex,i)}let u=[`M${f(a[0])}`];for(let e=0;e<c.length;e++){let t=c[e],r=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),s=r===0?0:(t.b.x-t.a.x)/r,h=r===0?0:(t.b.y-t.a.y)/r,v=p(t),y=0;if(o&&e>0){let t=_(a[e-1],a[e],a[e+1]??a[e],i);t&&(y=t.cutLen)}let b=r,x=null;o&&e<c.length-1&&(x=_(a[e],a[e+1],a[e+2]??a[e+1],i),x&&(b=r-x.cutLen));let S=[...l.get(e)??[]].sort((e,t)=>e.t-t.t);for(let e of S)e.r=Math.min(e.r,e.d-y,b-e.d);for(let e=0;e<S.length-1;e++){let t=S[e+1].d-S[e].d;if(S[e].r+S[e+1].r>t){let n=t/2;S[e].r=Math.min(S[e].r,n),S[e+1].r=Math.min(S[e+1].r,n)}}for(let e of S)e.r<m||u.push(...g(e,s,h,v,n.jumpStyle));o&&x?(u.push(`L${d(x.startX)},${d(x.startY)}`),u.push(`Q${d(x.ctrlX)},${d(x.ctrlY)} ${d(x.endX)},${d(x.endY)}`)):u.push(`L${f(t.b)}`)}return u.join(` `)}e(v,`rewriteEdgePath`);function y(e){return/^[\d\s+,.LMelm-]*$/.test(e)}e(y,`isStraightPath`);function b(e){return e?e===`linear`||e===`rounded`||e===`step`||e===`stepBefore`||e===`stepAfter`:!0}e(b,`curveSupportsLineHops`);function x(e){if(!e)return null;try{let t=typeof atob==`function`?atob(e):Buffer.from(e,`base64`).toString(),n=JSON.parse(t);if(!Array.isArray(n))return null;let r=[];for(let e of n)e&&typeof e.x==`number`&&typeof e.y==`number`&&r.push({x:e.x,y:e.y});return r.length>=2?r:null}catch{return null}}e(x,`decodeDataPoints`);function S(e,t,n){if(!n.enabled)return;let r=e.node();if(!r)return;let i=new Map;for(let e of t)i.set(e.id,e);let a=[],o=new Map;for(let e of t){let t=typeof CSS<`u`&&CSS.escape?CSS.escape(e.id):e.id,n=r.querySelector(`path[data-id="${t}"]`);if(!n)continue;o.set(e.id,n);let i=x(n.getAttribute(`data-points`))??e.points;a.push({...e,points:i})}let s=u(a);if(s.length===0)return;let c=new Map;for(let e of s){let t=c.get(e.jumpEdgeId)??[];t.push(e),c.set(e.jumpEdgeId,t)}for(let e of a){let t=c.get(e.id);if(!t||t.length===0)continue;let r=i.get(e.id)?.curve;if(r!==void 0&&!b(r))continue;let a=o.get(e.id);if(!a||r===void 0&&!y(a.getAttribute(`d`)??``))continue;let s=a.getAttribute(`style`)??``,l=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(s),u=l?Number.parseFloat(l[1]):null,d=l?Number.parseFloat(l[2]):null,f=v(e,t,n);if(a.setAttribute(`d`,f),u!==null&&d!==null&&typeof a.getTotalLength==`function`){let e=a.getTotalLength(),t=`0 ${u} ${Math.max(0,e-u-d)} ${d}`,n=s.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${t};`).replace(/;\s*;+/g,`;`);a.setAttribute(`style`,n)}}}e(S,`applyLineJumpsToSvg`);function C(e,{measure:t}){let n=e.config?.swimlane?.lineHops;if(n===!1)return;let r=n===`gap`?`gap`:`arc`,i=e.edges.filter(e=>Array.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));S(t.groups.edgePaths,i,{enabled:!0,jumpRadius:6,jumpStyle:r})}e(C,`applySwimlaneLineJumps`);var w=`__swimlane_default__`,T=21,E=20;function D(e){return Math.max(e.padding??E,E)}e(D,`topLaneHorizontalPadding`);function O(e){let{x:t,y:n,width:r,height:i}=e,a=e.swimlaneContentTop;if(typeof t!=`number`||typeof n!=`number`||typeof r!=`number`||typeof i!=`number`||typeof a!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a)||r<=0||i<=0){delete e.groupTitleRect;return}let o=n-i/2,s=Math.min(a,n+i/2),c=o+Math.min(T,Math.max(0,s-o));if(c<=o){delete e.groupTitleRect;return}e.groupTitleRect={left:t-r/2,right:t+r/2,top:o,bottom:c}}e(O,`assignTopLaneTitleRect`);function k(e){let t=e.direction,n=e.nodes??=[];for(let n of e.nodes??[])n.isGroup&&!n.parentId&&(n.shape=`swimlane`,t&&(n.direction=t));let r=n.filter(e=>!e.isGroup&&!e.parentId);if(r.length===0)return;let i=n.find(e=>e.id===w);i?i.isGroup&&(i.shape=`swimlane`,t&&(i.direction=t)):(i={id:w,label:``,isGroup:!0,shape:`swimlane`,padding:20,...t?{direction:t}:{}},n.push(i));for(let e of r)e.parentId=w}e(k,`prepareLayoutForSwimlanes`);function A(e){let t=new Map;for(let n of e.nodes??[])t.set(n.id,n);let n=[];for(let t of e.edges??[]){let e=typeof t.start==`string`?t.start:void 0,r=typeof t.end==`string`?t.end:void 0;!e||!r||t.labelNodeId||n.push({id:t.id,src:e,dst:r,ref:t})}let r=e.nodes??[],i=r.filter(e=>e.isGroup),a=r.filter(e=>!e.isGroup);return{nodes:[...[...i].reverse(),...a].map(e=>e.id),edges:n,layout:e,nodeById:t}}e(A,`toGraphView`);function j(e,t,n,r){let{layout:i}=e,a=e.nodeById,o=r?.layerGap??100,s=r?.nodeGap??40,c=0;for(let e of t.layers){let t=0;for(let r of e){let e=a.get(r);if(!e){t++;continue}e.layer=c,e.order=t;let i=n.x[r]??t*s,l=n.y[r]??c*o;e.x=i,e.y=l,t++}c++}let l=i.nodes??[],u=new Map,d=[];for(let e of l){if(!e?.isGroup)continue;e.parentId||d.push(e);let t=l.filter(t=>t.parentId===e.id),r=1/0,i=-1/0,a=1/0,o=-1/0;for(let e of t){let t=e.x??n.x[e.id],s=e.y??n.y[e.id],c=e.width??0,l=e.height??0;t!=null&&s!=null&&(r=Math.min(r,t-c/2),i=Math.max(i,t+c/2),a=Math.min(a,s-l/2),o=Math.max(o,s+l/2))}if(r===1/0||a===1/0)e.x=e.x??0,e.y=e.y??0,e.width=e.width??0,e.height=e.height??0;else{let t=e.padding??20,n=e.parentId?t:2*D(e),s=t,c=Math.max(0,i-r)+n,l=Math.max(0,o-a)+s,d=(r+i)/2,f=(a+o)/2;e.x=d,e.y=f,e.width=c,e.height=l,u.set(e.id,{minX:r,maxX:i,minY:a,maxY:o})}}if(d.length>0&&u.size>0){let e=1/0,t=-1/0,n=0;for(let r of d){let i=r.padding??20;i>n&&(n=i);let a=u.get(r.id);a&&(e=Math.min(e,a.minY),t=Math.max(t,a.maxY))}if(e!==1/0&&t!==-1/0){let r=Math.max(0,t-e)+2*Math.max(n,36),i=(e+t)/2;for(let t of d)t.y=i,t.height=r,t.swimlaneContentTop=e;let a=[...d].sort((e,t)=>(e.x??0)-(t.x??0)),o=[],s=[],c=[];for(let e of a){let t=u.get(e.id);if(!t)continue;let n=Math.max(0,t.maxX-t.minX)+2*D(e),r=(t.minX+t.maxX)/2;o.push(e.id),s.push(r),c.push(n)}let l=o.length;if(l>0){let e=new Map;if(l===1)e.set(o[0],c[0]);else{let t=[];for(let e=0;e<l-1;e++)t.push(s[e+1]-s[e]);let n=Array(l);n[0]=0;for(let e=0;e<l-1;e++)n[e+1]=2*t[e]-n[e];let r=0,i=1/0;for(let e=0;e<l;e++){let t=c[e];e%2==0?r=Math.max(r,t-n[e]):i=Math.min(i,n[e]-t)}let a=r;a=r<=i?(r+i)/2:r;for(let t=0;t<l;t++){let r=n[t]+(t%2==0?a:-a),i=Math.max(c[t],r);e.set(o[t],i)}}for(let t of d){let n=e.get(t.id);n!=null&&(t.width=n),O(t)}}}}}e(j,`writeBackToLayoutData`);var ee=`[EdgeLabelNodes]`;function te(e){let n=[],r=[],i=new Map;for(let t of e.nodes)i.set(t.id,t);for(let a of e.edges){if(!a.label||a.label.length===0||a.isLayoutOnly||a.labelNodeId)continue;let e=a.start?i.get(a.start):void 0,o=a.end?i.get(a.end):void 0;if(!e||!o){t.warn(ee,`Edge ${a.id} has missing source or target node`);continue}let s=`edge-label-${a.start}-${a.end}-${a.id}`,c=e.parentId===o.parentId?e.parentId:o.parentId,l={id:s,label:a.label,edgeStart:a.start??``,edgeEnd:a.end??``,shape:`labelRect`,width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:c,isGroup:!1,labelStyle:Array.isArray(a.labelStyle)?a.labelStyle[0]:a.labelStyle??``,...e.dir?{dir:e.dir}:{}};n.push(l),a.labelNodeId=s,a.label=void 0,a.text=void 0;let u={id:`${a.id}-to-label`,start:a.start,end:s,type:`normal`,isLayoutOnly:!0},d={id:`${a.id}-from-label`,start:s,end:a.end,type:`normal`,isLayoutOnly:!0};r.push(u,d)}let a=[...e.nodes,...n],o=[...e.edges,...r];return{...e,nodes:a,edges:o}}e(te,`createEdgeLabelNodes`);var M=.001;function ne(e){let t=e.x??0,n=e.y??0,r=e.width??0,i=e.height??0;return r>0&&i>0?{cx:t,cy:n,rect:se(t,n,r,i)}:void 0}e(ne,`measuredNodeRect`);function N(e){if(e.isGroup)return;let t=ne(e);if(t)return{id:String(e.id??``),cx:t.cx,cy:t.cy,rect:t.rect}}e(N,`nodeBoundsInfoFor`);function P(e,t,n=M){return Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n}e(P,`samePoint`);function F(e,t,n=M){return Math.abs(e.x-t.x)<n}e(F,`sameX`);function I(e,t,n=M){return Math.abs(e.y-t.y)<n}e(I,`sameY`);function L(e,t,n=M){return I(e,t,n)&&Math.abs(e.x-t.x)>n}e(L,`isHorizontalSegment`);function R(e,t,n=M){return F(e,t,n)&&Math.abs(e.y-t.y)>n}e(R,`isVerticalSegment`);function z(e,t,n,r){return Math.max(0,Math.min(Math.max(e,t),Math.max(n,r))-Math.max(Math.min(e,t),Math.min(n,r)))}e(z,`overlapLength`);function B(e,t,n=M){return e.horizontal&&t.horizontal&&I(e.a,t.a,n)?z(e.a.x,e.b.x,t.a.x,t.b.x):e.vertical&&t.vertical&&F(e.a,t.a,n)?z(e.a.y,e.b.y,t.a.y,t.b.y):0}e(B,`sameAxisSegmentOverlapLength`);function re(e,t=M){let n=[];for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1],o=L(i,a,t),s=R(i,a,t);(o||s)&&n.push({index:r,a:i,b:a,horizontal:o,vertical:s})}return n}e(re,`orthogonalSegmentsForPoints`);function V(e,t=M){let n=re(e,t),r=0;for(let e=1;e<n.length;e++)n[e-1].horizontal!==n[e].horizontal&&r++;return r}e(V,`countOrthogonalBends`);function H(e,t=M){let n=[];for(let r of e){let e=n.length>0?n[n.length-1]:void 0;(!e||!P(e,r,t))&&n.push({x:r.x,y:r.y})}return n}e(H,`dedupeConsecutivePoints`);function ie(e,t=M){if(!e||e.length!==4)return;let[n,r,i,a]=e;return L(n,r,t)&&R(r,i,t)&&L(i,a,t)?{kind:`HVH`,p0:n,p1:r,p2:i,p3:a}:R(n,r,t)&&L(r,i,t)&&R(i,a,t)?{kind:`VHV`,p0:n,p1:r,p2:i,p3:a}:void 0}e(ie,`classifyThreeSegmentRoute`);function ae(e,t,n,r=0){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return a>n.left-r&&i<n.right+r&&s>n.top-r&&o<n.bottom+r}e(ae,`segmentBoundsOverlapRect`);function U(e,t,n=0){return e.x>t.left+n&&e.x<t.right-n&&e.y>t.top+n&&e.y<t.bottom-n}e(U,`pointInsideRect`);function W(e,t){return e.left<=t.left&&e.right>=t.right&&e.top<=t.top&&e.bottom>=t.bottom}e(W,`rectContainsRect`);function G(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}e(G,`rectsOverlap`);function oe(e,t){return{left:e.left-t,right:e.right+t,top:e.top-t,bottom:e.bottom+t}}e(oe,`inflateRect`);function se(e,t,n,r){return{left:e-n/2,right:e+n/2,top:t-r/2,bottom:t+r/2}}e(se,`rectFromCenterSize`);function K(e){return ne(e)?.rect}e(K,`rectOfNodeBounds`);function ce(e,t){switch(t){case`top`:return{x:e.cx,y:e.rect.top};case`bottom`:return{x:e.cx,y:e.rect.bottom};case`left`:return{x:e.rect.left,y:e.cy};case`right`:return{x:e.rect.right,y:e.cy}}}e(ce,`portForRectSide`);function le(e,t,n,r,i,a=M){let o=t===`left`||t===`right`,s=r===`left`||r===`right`;if(o&&s){if(t===`right`&&r===`left`&&e.x<n.x||t===`left`&&r===`right`&&e.x>n.x){if(I(e,n,a))return[e,n];let t=(e.x+n.x)/2;return[e,{x:t,y:e.y},{x:t,y:n.y},n]}if(t===r){if(I(e,n,a))return;let r=t===`left`?Math.min(e.x,n.x)-i:Math.max(e.x,n.x)+i;return[e,{x:r,y:e.y},{x:r,y:n.y},n]}return}if(!o&&!s){if(t===r){if(F(e,n,a))return;let r=t===`top`?Math.min(e.y,n.y)-i:Math.max(e.y,n.y)+i;return[e,{x:e.x,y:r},{x:n.x,y:r},n]}if(!(t===`bottom`&&r===`top`&&e.y<n.y||t===`top`&&r===`bottom`&&e.y>n.y))return;if(F(e,n,a))return[e,n];let o=(e.y+n.y)/2;return[e,{x:e.x,y:o},{x:n.x,y:o},n]}if(o&&!s){let i=t===`right`&&n.x>e.x||t===`left`&&n.x<e.x,a=r===`top`&&e.y<n.y||r===`bottom`&&e.y>n.y;return i&&a?[e,{x:n.x,y:e.y},n]:void 0}let c=t===`bottom`&&n.y>e.y||t===`top`&&n.y<e.y,l=r===`left`&&e.x<n.x||r===`right`&&e.x>n.x;return c&&l?[e,{x:e.x,y:n.y},n]:void 0}e(le,`buildOrthogonalPortPath`);function ue(e,t,n,r){return t===`left`||t===`right`?[e,{x:r,y:e.y},{x:r,y:n.y},n]:[e,{x:e.x,y:r},{x:n.x,y:r},n]}e(ue,`buildSameSideTrackPath`);function de(e){let t=new Map,n=[];for(let r of e){if(r.isEdgeLabel)continue;let e=N(r);e&&(t.set(e.id,e),n.push({id:e.id,rect:e.rect}))}return{nodeInfoById:t,realNodeRects:n}}e(de,`collectRealNodeBounds`);function q(e){let t=[],n=[];for(let r of e){let e=N(r);if(!e)continue;let i={id:e.id,rect:e.rect};r.isEdgeLabel?n.push(i):t.push(i)}return{realNodeRects:t,labelNodeRects:n}}e(q,`collectNodeRectEntries`);function fe(e,{includeEdgeLabels:t=!0}={}){let n=[];for(let r of e){if(r.isGroup||!t&&r.isEdgeLabel)continue;let e=r.x??0,i=r.y??0,a=r.width??0,o=r.height??0;n.push({nodeId:r.id,...se(e,i,a,o)})}return n}e(fe,`collectLayoutNodeRects`);function pe(e,t,n=M){let r=e.start,i=e.end;if(!r||!i)return;let a=t.get(r),o=t.get(i);if(!(!a||!o))return{srcId:r,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)<n,collinearY:Math.abs(a.cy-o.cy)<n}}e(pe,`getNodePairGeometry`);function J(e,t,n,r=[],i=0){for(let a of n)if(!r.includes(a.id)&&ae(e,t,a.rect,-i))return!0;return!1}e(J,`segmentHitsAnyRect`);function me(e,t,n,r,i=M,a=1e-6){let o=I(e,t,i),s=F(e,t,i),c=I(n,r,i),l=F(n,r,i);if(o&&c||s&&l||!(o||s)||!(c||l))return!1;let u=o?{a:e,b:t}:{a:n,b:r},d=s?{a:e,b:t}:{a:n,b:r},f=u.a.y,p=Math.min(u.a.x,u.b.x),m=Math.max(u.a.x,u.b.x),h=d.a.x,g=Math.min(d.a.y,d.b.y),_=Math.max(d.a.y,d.b.y);if(h<p||h>m||f<g||f>_)return!1;let v=Math.abs(h-u.a.x)<a&&Math.abs(f-u.a.y)<a||Math.abs(h-u.b.x)<a&&Math.abs(f-u.b.y)<a,y=Math.abs(h-d.a.x)<a&&Math.abs(f-d.a.y)<a||Math.abs(h-d.b.x)<a&&Math.abs(f-d.b.y)<a;return!(v&&y)}e(me,`orthogonalSegmentsCross`);function he(e,t,n,r,i=M){let a=I(e,t,i),o=F(e,t,i),s=I(n,r,i),c=F(n,r,i);return o&&c&&F(e,n,i)?z(e.y,t.y,n.y,r.y)>i:a&&s&&I(e,n,i)?z(e.x,t.x,n.x,r.x)>i:!1}e(he,`sameAxisSegmentsOverlap`);function ge(e,t,n,r,{epsilon:i=M,skipDegenerateOther:a=!1}={}){for(let o of n){if(o===r||o.isLayoutOnly)continue;let n=o.points;if(!(!n||n.length<2))for(let r=0;r<n.length-1;r++){let o=n[r],s=n[r+1];if(!(a&&P(o,s,i))&&(me(e,t,o,s,i)||he(e,t,o,s,i)))return!0}}return!1}e(ge,`segmentConflictsWithAnyEdge`);function _e(e,t,n,r,i=M){let a=I(e,t,i),o=F(e,t,i),s=I(n,r,i),c=F(n,r,i);if(!(a&&c||o&&s))return!1;let l=a?{a:e,b:t}:{a:n,b:r},u=a?{a:n,b:r}:{a:e,b:t},d=l.a.y,f=Math.min(l.a.x,l.b.x),p=Math.max(l.a.x,l.b.x),m=u.a.x,h=Math.min(u.a.y,u.b.y),g=Math.max(u.a.y,u.b.y);return m>f+i&&m<p-i&&d>h+i&&d<g-i}e(_e,`orthogonalSegmentsStrictlyCross`);function ve(e,t,n){let r=Math.min(t,n),i=Math.max(t,n);return e>r+M&&e<i-M}e(ve,`strictlyBetween`);function ye(e,t,n){return F(e,t)&&F(t,n)?ve(t.y,e.y,n.y):I(e,t)&&I(t,n)?ve(t.x,e.x,n.x):!1}e(ye,`isCollinearIntermediate`);function be(e){let t=!1,n=[];for(let r=0;r<e.length;r++){let i=n[n.length-1],a=e[r],o=r+1<e.length?e[r+1]:void 0;if(i&&o){if(P(i,o)){r++,t=!0;continue}if(ye(i,a,o)){t=!0;continue}}n.push(a)}return{points:n,changed:t}}e(be,`simplifyPolylineOnce`);function xe(e){let t=[e[0]];for(let n=1;n<e.length;n++){let r=t[t.length-1],i=e[n];if(!F(r,i)&&!I(r,i)){let e=t.length>=2?t[t.length-2]:void 0,n=e&&F(e,r)?{x:r.x,y:i.y}:{x:i.x,y:r.y};t.push(n)}t.push(i)}let n=[];for(let e of t){let t=n[n.length-1];(!t||!P(t,e))&&n.push(e)}return n}e(xe,`orthogonalizePolyline`);function Se(e){if(e.length<3)return e;let t=[...e];for(let e=0;e<32;e++){let e=be(t);if(t=e.points,!e.changed)break}return t}e(Se,`simplifyPolyline`);var Y=.001,Ce=.5,we=4;function Te(e,t,n){let r=e;if(r.isLayoutOnly||!r.points||r.points.length<n)return;let i=r.start?t.get(r.start):void 0,a=r.end?t.get(r.end):void 0;return{edge:r,points:r.points,srcRect:i?K(i):void 0,dstRect:a?K(a):void 0}}e(Te,`endpointContextFor`);function Ee(e,t,n){if(I(e,t,Y))return{x:e.x<n.left?n.left:n.right,y:e.y};if(F(e,t,Y)){let t=e.y<n.top?n.top:n.bottom;return{x:e.x,y:t}}return{x:Math.min(n.right,Math.max(n.left,e.x)),y:Math.min(n.bottom,Math.max(n.top,e.y))}}e(Ee,`segmentEnterPoint`);function De(e,t,n){let r=n?1:-1,i=n?0:e.length-1;for(;i>=0&&i<e.length&&U(e[i],t,Ce);)i+=r;if(i<0||i>=e.length)return e;let a=i-r;if(a<0||a>=e.length)return e;let o=Ee(e[i],e[a],t);return n?[o,...e.slice(i)]:[...e.slice(0,i+1),o]}e(De,`clipEndpoint`);function Oe(e,t){for(let n of e){let e=Te(n,t,2);if(!e)continue;let r=[...e.points];e.srcRect&&(r=De(r,e.srcRect,!0)),e.dstRect&&(r=De(r,e.dstRect,!1)),r=Se(xe(r)),r=ze(r,e.srcRect,e.dstRect),e.edge.points=Se(xe(r))}}e(Oe,`clipEdgeEndpointsToNodeBoundaries`);function ke(e,t,n,r=!1){if(I(e,t,Y)){if(t.y<n.top-Y||t.y>n.bottom+Y)return t;if(r){if(e.x<n.left-Y)return{x:n.left,y:e.y};if(e.x>n.right+Y)return{x:n.right,y:e.y}}return{x:Math.abs(t.x-n.left)<=Math.abs(t.x-n.right)?n.left:n.right,y:e.y}}if(F(e,t,Y)){if(t.x<n.left-Y||t.x>n.right+Y)return t;if(r){if(e.y<n.top-Y)return{x:e.x,y:n.top};if(e.y>n.bottom+Y)return{x:e.x,y:n.bottom}}let i=Math.abs(t.y-n.top)<=Math.abs(t.y-n.bottom);return{x:e.x,y:i?n.top:n.bottom}}return t}e(ke,`snapEndpointToBoundary`);function Ae(e,t,n){let r=e[t];for(let i=t+n;i>=0&&i<e.length;i+=n){let t=e[i];if(!P(t,r,Y))return t}return e[t+n]}e(Ae,`firstDistinctAdjacent`);function je(e,t){let n=e+we,r=t-we;return n<=r?{lo:n,hi:r}:{lo:(e+t)/2,hi:(e+t)/2}}e(je,`cornerClearanceRange`);function Me(e,t,n){let{lo:r,hi:i}=je(t,n);return Math.min(i,Math.max(r,e))}e(Me,`clampToCornerClearance`);function Ne(e){let t=Math.max(...e.map(e=>e.lo)),n=Math.min(...e.map(e=>e.hi));if(!(t>n))return{lo:t,hi:n}}e(Ne,`intersectRanges`);function Pe(e,t){return t===`left`||t===`right`?je(e.top,e.bottom):je(e.left,e.right)}e(Pe,`clearanceRangeForSide`);function Fe(e,t,n){let r=e.y>=n.top-Y&&e.y<=n.bottom+Y,i=e.x>=n.left-Y&&e.x<=n.right+Y;if(I(e,t,Y)&&r){if(Math.abs(e.x-n.left)<Y)return`left`;if(Math.abs(e.x-n.right)<Y)return`right`}if(F(e,t,Y)&&i){if(Math.abs(e.y-n.top)<Y)return`top`;if(Math.abs(e.y-n.bottom)<Y)return`bottom`}}e(Fe,`terminalSideForSegment`);function Ie(e){return e===`left`||e===`right`}e(Ie,`isHorizontalSide`);function Le(e,t,n,r,i){let a=[],o=n?Fe(e,t,n):void 0,s=r?Fe(t,e,r):void 0;return n&&o&&Ie(o)===i&&a.push(Pe(n,o)),r&&s&&Ie(s)===i&&a.push(Pe(r,s)),a.length>0?Ne(a):void 0}e(Le,`straightClearanceRange`);function Re(e,t,n,r,i){let a=Le(e,t,n,r,i);if(!a)return;let o=i?e.y:e.x,s=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(s-o)<Y))return i?[{x:e.x,y:s},{x:t.x,y:s}]:[{x:s,y:e.y},{x:s,y:t.y}]}e(Re,`clearStraightEndpointCornerAxis`);function ze(e,t,n){if(e.length!==2)return e;let[r,i]=e;return I(r,i,Y)?Re(r,i,t,n,!0)??e:F(r,i,Y)?Re(r,i,t,n,!1)??e:e}e(ze,`clearStraightEndpointCornerConnections`);function Be(e,t,n){return Ie(n)?{x:e.x,y:Me(e.y,t.top,t.bottom)}:{x:Me(e.x,t.left,t.right),y:e.y}}e(Be,`cornerClearedEndpoint`);function Ve(e,t,n,r,i,a){let o=e.map(e=>({...e}));for(let s=t;s>=0&&s<e.length;s+=n){let t=e[s];if(a&&!I(t,r,Y)||!a&&!F(t,r,Y))break;a?o[s].y=i.y:o[s].x=i.x}return o}e(Ve,`moveCollinearEndpointRun`);function He(e,t,n){if(e.length<2)return e;let r=n?0:e.length-1,i=n?1:-1,a=e[r],o=Ae(e,r,i);if(!o)return e;let s=Fe(a,o,t);if(!s)return e;let c=Ie(s),l=Be(a,t,s);return P(a,l,Y)?e:Ve(e,r,i,a,l,c)}e(He,`clearEndpointCornerConnection`);function Ue(e,t,n){let r=Math.min(e.x,t.x)>=n.left-Y&&Math.max(e.x,t.x)<=n.right+Y,i=Math.min(e.y,t.y)>=n.top-Y&&Math.max(e.y,t.y)<=n.bottom+Y;if(Math.abs(e.y-n.top)<Y&&Math.abs(t.y-n.top)<Y&&r)return`top`;if(Math.abs(e.y-n.bottom)<Y&&Math.abs(t.y-n.bottom)<Y&&r)return`bottom`;if(Math.abs(e.x-n.left)<Y&&Math.abs(t.x-n.left)<Y&&i)return`left`;if(Math.abs(e.x-n.right)<Y&&Math.abs(t.x-n.right)<Y&&i)return`right`}e(Ue,`borderSideForSegment`);function We(e,t,n,r){switch(e){case`top`:return F(t,n,Y)&&n.y<r.top-Y;case`bottom`:return F(t,n,Y)&&n.y>r.bottom+Y;case`left`:return I(t,n,Y)&&n.x<r.left-Y;case`right`:return I(t,n,Y)&&n.x>r.right+Y}}e(We,`leavesOutward`);function Ge(e,t,n){if(e.length<3)return e;if(n){let n=Ue(e[0],e[1],t);return n&&We(n,e[1],e[2],t)?e.slice(1):e}let r=e.length-1,i=Ue(e[r-1],e[r],t);return i&&We(i,e[r-1],e[r-2],t)?e.slice(0,r):e}e(Ge,`collapseOwnBorderStub`);function Ke(e,t,n){let r=e;if(t){let e=Ae(r,0,1);if(e){let n=ke(e,r[0],t);n!==r[0]&&(r=[n,...r.slice(1)])}r=Ge(r,t,!0)}if(n){let e=r.length-1,t=Ae(r,e,-1);if(t){let i=ke(t,r[e],n,!0);i!==r[e]&&(r=[...r.slice(0,e),i])}r=Ge(r,n,!1)}let i=ze(r,t,n);return i!==r||r.length===2?i:(t&&(r=He(r,t,!0)),n&&(r=He(r,n,!1)),r)}e(Ke,`snapAndCollapseEndpoints`);function qe(e,t){for(let n of e){let e=Te(n,t,2);if(!e)continue;let r=Ke(H(e.points,Y),e.srcRect,e.dstRect);if(r.length<3){e.edge.points=r;continue}let i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];e.edge.points=i}}e(qe,`prepareEdgeEndpointsForRenderer`);function Je(e){return new Map(e.map(e=>[e.id,e]))}e(Je,`buildNodeMap`);function Ye(e,t){let n=e.parentId,r=null;for(;n;){let e=t.get(n);if(!e?.isGroup)break;r=e.id,n=e.parentId}return r}e(Ye,`resolveTopLevelGroupId`);function Xe(e,t){let n=0,r=e.parentId;for(;r;){let e=t.get(r);if(!e?.isGroup)break;n++,r=e.parentId}return n}e(Xe,`groupDepth`);function Ze(e){let t=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of e){let e=a.x,o=a.y;if(typeof e!=`number`||typeof o!=`number`)continue;let s=a.width??0,c=a.height??0;t=Math.min(t,e-s/2),n=Math.max(n,e+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}return t===1/0||r===1/0?null:{minX:t,maxX:n,minY:r,maxY:i}}e(Ze,`boundsForChildren`);function Qe(e,t){let n=e.padding??20;e.x=(t.minX+t.maxX)/2,e.y=(t.minY+t.maxY)/2,e.width=Math.max(0,t.maxX-t.minX)+n,e.height=Math.max(0,t.maxY-t.minY)+n}e(Qe,`applyGroupBounds`);function $e(e){let t=Je(e),n=e.filter(e=>e.isGroup&&e.parentId).sort((e,n)=>Xe(n,t)-Xe(e,t));for(let t of n){let n=Ze(e.filter(e=>e.parentId===t.id));n&&Qe(t,n)}}e($e,`recomputeNestedGroupBounds`);function et(t,n){let r=t.nodes??[],i=t.edges??[],a=r.filter(e=>!e.isGroup),o=1/0,s=-1/0;for(let e of a){let t=e[n];typeof t==`number`&&(o=Math.min(o,t),s=Math.max(s,t))}if(!Number.isFinite(o)||!Number.isFinite(s))return!1;let c=e(e=>o+s-e,`mirror`);for(let e of r){let t=e[n];typeof t==`number`&&(e[n]=c(t));let r=e.groupTitleRect;r&&(e.groupTitleRect=n===`x`?{...r,left:c(r.right),right:c(r.left)}:{...r,top:c(r.bottom),bottom:c(r.top)})}for(let e of i)for(let t of e.points??[])t[n]=c(t[n]);return!0}e(et,`mirrorAxis`);function tt(e){return(e.nodes??[]).some(e=>!e.isGroup)?et(e,`y`):!0}e(tt,`applyBtDirectionTransform`);function nt(e,t=`LR`){let n=e.nodes??[],r=e.edges??[],i=n.filter(e=>!e.isGroup),a=1/0,o=1/0;for(let e of i){let t=e.x??0,n=e.y??0;t<a&&(a=t),n<o&&(o=n)}if(!Number.isFinite(a)||!Number.isFinite(o))return!1;let s=0,c=0;for(let e of i)s+=e.width??0,c+=e.height??0;let l=s/i.length,u=c/i.length,d=u>0?Math.max(1,l/u):1;for(let e of i){let t=e.x??0,n=((e.y??0)-o)*d+36,r=t-a;e.x=n,e.y=r}for(let e of r)if(e.points)for(let t of e.points){let e=t.x,n=(t.y-o)*d+36,r=e-a;t.x=n,t.y=r}$e(n);let f=n.filter(e=>e.isGroup&&!e.parentId);if(f.length===0)return t===`RL`&&et(e,`x`),!0;let p=Je(n),m=new Map;for(let e of n){if(e.isGroup)continue;let t=Ye(e,p);if(!t)continue;let n=m.get(t)??[];n.push(e),m.set(t,n)}let h=0;for(let e of f){let t=e.padding??0;t>h&&(h=t)}let g=[],_=1/0,v=-1/0;for(let e of f){let t=Ze(m.get(e.id)??[]);t&&(_=Math.min(_,t.minX),v=Math.max(v,t.maxX),g.push({lane:e,contentTop:t.minY,contentBottom:t.maxY,centerY:(t.minY+t.maxY)/2}))}if(_===1/0||v===-1/0)return!0;let y=Math.max(0,v-_)+2*Math.max(h,10),b=36+y,x=(_+v)/2-y/2-36,S=x+b/2,C=Math.max(h,36);g.sort((e,t)=>e.centerY-t.centerY);for(let e=0;e<g.length;e++){let t=g[e],n,r;if(n=e===0?t.contentTop-C:(g[e-1].contentBottom+t.contentTop)/2,e===g.length-1)r=t.contentBottom+C;else{let n=g[e+1];r=(t.contentBottom+n.contentTop)/2}let i=Math.max(0,r-n),a=(n+r)/2;t.lane.x=S,t.lane.y=a,t.lane.width=b,t.lane.height=i,t.lane.swimlaneContentTop=t.contentTop,t.lane.groupTitleRect={left:x,right:x+36,top:n,bottom:r}}return t===`RL`&&et(e,`x`),!0}e(nt,`applyLrDirectionTransform`);var rt=1e-6,it=8,at=[0,it,-it,2*it,-2*it];function ot(e,t){let{nodeInfoById:n,realNodeRects:r}=de(t);for(let t of e){if(t.isLayoutOnly)continue;let i=t.points;if(!i||i.length<4)continue;let a=ie(H(i,rt),rt);if(!a)continue;let{p3:o}=a,s=a.kind===`HVH`,c=pe(t,n,rt);if(!c)continue;let{srcId:l,dstId:u,srcInfo:d,dstInfo:f,collinearX:p,collinearY:m}=c;if(p||m)continue;let h,g=d.rect;for(let n of at){let i,a,c;if(s){let e=f.cy>d.cy?g.bottom:g.top,t=d.cx+n;if(t<=g.left+rt||t>=g.right-rt)continue;i={x:t,y:e},a={x:t,y:o.y},c={x:o.x,y:o.y}}else{let e=f.cx>d.cx?g.right:g.left,t=d.cy+n;if(t<=g.top+rt||t>=g.bottom-rt)continue;i={x:e,y:t},a={x:o.x,y:t},c={x:o.x,y:o.y}}let p=P(i,a,rt),m=P(a,c,rt);if(p&&m||!p&&J(i,a,r,[l],1)||!m&&J(a,c,r,[u],1))continue;let _=!p&&ge(i,a,e,t,{epsilon:rt,skipDegenerateOther:!0}),v=!m&&ge(a,c,e,t,{epsilon:rt,skipDegenerateOther:!0});if(!(_||v)){h=p?[a,c]:m?[i,a]:[i,a,c];break}}h&&(t.points=h)}}e(ot,`portSwapToLShape`);function st(t,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=q(n.values());for(let o of t){if(o.isLayoutOnly)continue;let s=o.points;if(!s||s.length<4)continue;let c=H(s,r);if(c.length<4)continue;let l=c.length-1,u=c[l],d=c[l-1],f=c[l-2],p=u.x-d.x,m=u.y-d.y,h=Math.hypot(p,m);if(h>=10||h<r)continue;let g=d.x-f.x,_=d.y-f.y;if(Math.hypot(g,_)<r)continue;let v=L(d,u,r),y=R(d,u,r),b=L(f,d,r),x=R(f,d,r);if(!(v&&x||y&&b))continue;let S=o.end,C=o.start,w=S?n.get(S):void 0;if(!w)continue;let T=w.x??0,E=w.y??0,D=K(w);if(!D)continue;let O,k;if(x){let e=_<0;O={x:T,y:f.y},k={x:T,y:e?D.bottom:D.top}}else{let e=g>0;O={x:f.x,y:E},k={x:e?D.right:D.left,y:E}}if(J(O,k,i,S?[S]:[],-2)||J(O,k,a,[],-2))continue;if(C){let e=n.get(C),t=e?K(e):void 0;if(t&&U(O,t,2))continue}let A=e((e,t)=>`${e.x.toFixed(3)},${e.y.toFixed(3)}|${t.x.toFixed(3)},${t.y.toFixed(3)}`,`ownSegmentKey`),j=new Set;for(let e=0;e<c.length-1;e++)j.add(A(c[e],c[e+1]));let ee=e((e,n)=>{for(let i of t){if(i===o||i.isLayoutOnly)continue;let t=i.points;if(!(!t||t.length<2))for(let i=0;i<t.length-1;i++){let a=t[i],o=t[i+1];if(!j.has(A(a,o))&&_e(e,n,a,o,r))return!0}}return!1},`segmentCrossesOtherEdge`);if(ee(O,k))continue;if(l-3>=0){let e=c[l-3],t=[C,S].filter(e=>!!e);if(J(e,O,i,t,-2)||ee(e,O))continue}let te=[...c.slice(0,l-2),O,k];o.points=te;let M=o.labelNodeId;if(M){let e=n.get(M);if(e){let t=e.width??0,n=e.height??0;if(t>0&&n>0){let i,a,o=-1;for(let e=0;e<te.length-1;e++){let s=te[e],c=te[e+1],l=Math.hypot(c.x-s.x,c.y-s.y),u=I(s,c,r),d=F(s,c,r);(u&&l>=t+2||d&&l>=n+2)&&l>o&&(o=l,i=(s.x+c.x)/2,a=(s.y+c.y)/2)}i!==void 0&&a!==void 0&&(e.x=i,e.y=a)}}}}}e(st,`collapseShortTerminalStub`);var X=.001,Z=8,Q=re,ct=e((e,t)=>F(e,t,X)||I(e,t,X),`orthogonallyAligned`);function lt(t,n){let r=e((e,t)=>{let n=e.x??0,r=e.y??0,i=t.x-n,a=t.y-r,o=(e.width??0)/2,s=(e.height??0)/2;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),{x:n+(a===0?0:s*i/a),y:r+s}):(i<0&&(o=-o),{x:n+o,y:r+(i===0?0:o*a/i)})},`rectIntersect`),i=e((e,t)=>{let i=H(e.points??[]);if(i.length<2)return;let a=t?e.start:e.end,o=a?n.get(a):void 0,s=o?K(o):void 0;if(!o||!a||!s)return;let c=t?i[0]:i[i.length-1],l=t?i[1]:i[i.length-2],u=r(o,c),d=c;if(ct(l,u)&&(d=l),F(u,d,X))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`V`,coord:u.x,min:Math.min(u.y,d.y),max:Math.max(u.y,d.y),boundary:u,railEnd:d,rect:s};if(I(u,d,X))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`H`,coord:u.y,min:Math.min(u.x,d.x),max:Math.max(u.x,d.x),boundary:u,railEnd:d,rect:s}},`terminalLaneFor`),a=e((e,t)=>Math.max(0,Math.min(e.max,t.max)-Math.max(e.min,t.min)),`projectedOverlapLength`),o=e((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:e.orientation===`H`?(Math.abs(e.boundary.x-e.rect.left)<1||Math.abs(e.boundary.x-e.rect.right)<1)&&F(e.boundary,t.boundary,1):(Math.abs(e.boundary.y-e.rect.top)<1||Math.abs(e.boundary.y-e.rect.bottom)<1)&&I(e.boundary,t.boundary,1),`sameTerminalFace`),s=e((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:a(e,t)>=Z&&Math.abs(e.coord-t.coord)<.5,`exactTerminalLaneConflict`),c=e((e,t)=>{if(e.nodeId!==t.nodeId||e.orientation!==t.orientation||e.orientation!==`H`||e.atStart===t.atStart)return!1;let n=a(e,t);if(n<Z)return!1;let r=e.rect.bottom-e.rect.top;return n<r||n>2*r?!1:o(e,t)&&Math.abs(e.coord-t.coord)<16},`nearTerminalLaneConflict`),l=e((t,n)=>{let r=H(t.edge.points??[]);if(r.length<2)return;let i=t.orientation===`V`?{x:t.boundary.x+n,y:t.boundary.y}:{x:t.boundary.x,y:t.boundary.y+n},a=t.orientation===`V`?{x:t.railEnd.x+n,y:t.railEnd.y}:{x:t.railEnd.x,y:t.railEnd.y+n};if(!e(()=>Math.abs(t.boundary.y-t.rect.top)<1||Math.abs(t.boundary.y-t.rect.bottom)<1?I(i,t.boundary,X)&&i.x>=t.rect.left+1&&i.x<=t.rect.right-1:Math.abs(t.boundary.x-t.rect.left)<1||Math.abs(t.boundary.x-t.rect.right)<1?F(i,t.boundary,X)&&i.y>=t.rect.top+1&&i.y<=t.rect.bottom-1:!1,`boundaryStaysOnSameFace`)())return;if(t.atStart){let e=r.length>1&&P(r[1],t.railEnd,X),n=r.slice(e?2:1),o=n[0];return o&&!ct(o,a)?void 0:[i,a,...n]}let o=r.length>1&&P(r[r.length-2],t.railEnd,X),s=r.slice(0,o?-2:-1),c=s[s.length-1];if(!(c&&!ct(c,a)))return[...s,a,i]},`shiftedCandidate`),u=e(e=>{let t=e.edge,r=H(t.points??[]);if(r.length!==2)return!1;let i=t.start,a=t.end,o=i?n.get(i):void 0,s=a?n.get(a):void 0;if(!o||!s)return!1;let c=o.x??0,l=o.y??0,u=s.x??0,d=s.y??0,[f,p]=r;return I(f,p,X)&&Math.abs(l-d)<1&&Math.abs(c-u)>1||F(f,p,X)&&Math.abs(c-u)<1&&Math.abs(l-d)>1},`laneIsStraightCollinearConnector`),d=[-7,7,-14,14,-21,21];for(let e=0;e<8;e++){let e=t.filter(e=>!e.isLayoutOnly).flatMap(e=>[i(e,!0),i(e,!1)]).filter(e=>!!e),n=!1;for(let t=0;t<e.length&&!n;t++)for(let r=t+1;r<e.length&&!n;r++){let a=e[t],o=e[r];if(a.edge===o.edge||!(s(a,o)||c(a,o)))continue;let f=!s(a,o),p=[a,o].sort((e,t)=>{let n=u(e),r=u(t);return n===r?Number(!t.atStart)-Number(!e.atStart):Number(n)-Number(r)});for(let t of p){for(let r of d){let a=l(t,r);if(!a)continue;let o=i({...t.edge,points:a},t.atStart);if(!(!o||e.some(e=>e.edge!==t.edge&&(s(o,e)||f&&c(o,e))))){t.edge.points=a,n=!0;break}}if(n)break}}if(!n)return}}e(lt,`separateSharedRenderedTerminalLanes`);function ut(t,n){let{realNodeRects:r,labelNodeRects:i}=q(n.values()),a=e((e,n)=>{let a=e.start,o=e.end,s=Q(n);if(s.length!==n.length-1)return!1;let c=[a,o].filter(e=>!!e);for(let e of s)if(J(e.a,e.b,r,c,-2)||J(e.a,e.b,i,[],-2))return!1;for(let n of t){if(n===e||n.isLayoutOnly)continue;let t=n.points;if(!(!t||t.length<2)){for(let e of s)for(let n of Q(H(t)))if(B(e,n,.5)>=Z||_e(e.a,e.b,n.a,n.b,X))return!1}}return!0},`candidateIsSafe`),o=e((e,t)=>{if(t+4>=e.length)return;let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=e[t+4],s=L(n,r)&&R(r,i)&&L(i,a)&&R(a,o)&&F(n,a,X)&&F(n,o,X)&&F(r,i,X)&&(r.x-n.x)*(a.x-i.x)<0,c=R(n,r)&&L(r,i)&&R(i,a)&&L(a,o)&&I(n,a,X)&&I(n,o,X)&&I(r,i,X)&&(r.y-n.y)*(a.y-i.y)<0;if(s||c)return H([...e.slice(0,t+1),o,...e.slice(t+5)]);if(t+5>=e.length)return;let l=e[t+5],u=R(n,r)&&L(r,i)&&R(i,a)&&L(a,o)&&R(o,l)&&F(n,o,X)&&F(n,l,X)&&F(i,a,X)&&(i.x-r.x)*(o.x-a.x)<0,d=L(n,r)&&R(r,i)&&L(i,a)&&R(a,o)&&L(o,l)&&I(n,o,X)&&I(n,l,X)&&I(i,a,X)&&(i.y-r.y)*(o.y-a.y)<0;if(!(!u&&!d))return H([...e.slice(0,t+1),l,...e.slice(t+6)])},`withoutDogleg`);for(let e=0;e<8;e++){let e=!1;for(let n of t){if(n.isLayoutOnly)continue;let t=H(n.points??[]);for(let r=0;r<=t.length-5;r++){let i=o(t,r);if(!(!i||!a(n,i))){n.points=i,e=!0;break}}if(e)break}if(!e)return}}e(ut,`collapseRedundantRectangularDoglegs`);function dt(t,n){let{realNodeRects:r,labelNodeRects:i}=q(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t,n)=>H(e===t?n??[]:e.points??[]),`pointsFor`),s=e((e,t)=>{let n=0;for(let r=0;r<a.length;r++){let i=Q(o(a[r],e,t));for(let s=r+1;s<a.length;s++){let r=Q(o(a[s],e,t));for(let e of i)for(let t of r)_e(e.a,e.b,t.a,t.b,X)&&n++}}return n},`strictCrossingCount`),c=e(e=>{let t=Q(e);if(t.length!==3)return;let n=t[1];if(!(t[0].horizontal===n.horizontal||t[2].horizontal===n.horizontal))return{index:n.index,horizontal:n.horizontal,vertical:n.vertical,segment:n}},`middleRail`),l=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);return r.filter(e=>{if(n.includes(e.id))return!1;let r=e.rect;return t.horizontal?z(t.a.x,t.b.x,r.left,r.right)>=Z&&t.a.y>=r.top-2&&t.a.y<=r.bottom+2:z(t.a.y,t.b.y,r.top,r.bottom)>=Z&&t.a.x>=r.left-2&&t.a.x<=r.right+2})},`blockingRectsFor`),u=e((e,t,n)=>{let r=e.map(e=>({...e}));if(t.horizontal)r[t.index].y=n,r[t.index+1].y=n;else if(t.vertical)r[t.index].x=n,r[t.index+1].x=n;else return;let i=Se(H(r));return Q(i).length===i.length-1?i:void 0},`candidateByMovingRail`),d=e((e,t,n)=>{let c=[e.start,e.end].filter(e=>!!e),l=Q(t);if(l.length!==t.length-1)return!1;for(let e of l)if(J(e.a,e.b,r,c,-2)||J(e.a,e.b,i,[],-2))return!1;for(let t of a)if(t!==e){for(let e of l)for(let n of Q(o(t)))if(B(e,n,.5)>=Z)return!1}return s(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=s(),t=!1;for(let n of a){let r=o(n),i=c(r);if(!i)continue;let a=l(n,i.segment);if(a.length===0)continue;let s=i.horizontal?[Math.min(...a.map(e=>e.rect.top))-20,Math.max(...a.map(e=>e.rect.bottom))+20]:[Math.min(...a.map(e=>e.rect.left))-20,Math.max(...a.map(e=>e.rect.right))+20];for(let a of s){let o=u(r,i.segment,a);if(!(!o||!d(n,o,e))){n.points=o,t=!0;break}}if(t)break}if(!t)return}}e(dt,`liftObstacleHuggingSameSideRails`);function ft(t,n){let r=e(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),i=e(e=>{if(!e.isGroup||e.parentId)return;let t=e.direction,n=typeof t==`string`?t.toUpperCase():``;if(n===`LR`||n===`RL`||n===`BT`)return;let i=r(e),a=e.y,o=e.height;if(!i||typeof a!=`number`||typeof o!=`number`||!Number.isFinite(a)||!Number.isFinite(o)||o<=0)return;let s=i.right-i.left,c=i.bottom-i.top;if(!(c<=0||s<c))return{node:e,rect:i}},`topLaneTitleFor`),a=e((e,t)=>{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+X||n>=t.bottom-X?!1:z(e.a.x,e.b.x,t.left,t.right)>=Z},`horizontalSegmentIntersectsTitle`),o=[...n.values()].map(i).filter(e=>!!e);if(o.length===0)return;let s=0;for(let e of t){if(e.isLayoutOnly)continue;let t=H(e.points??[]);for(let e of Q(t))for(let t of o)a(e,t.rect)&&(s=Math.max(s,t.rect.bottom-e.a.y+4))}if(!(s<=X))for(let e of o){let t=e.node.y,n=e.node.height;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.y=t-s/2,e.node.height=n+s,e.node.groupTitleRect={...e.rect,top:e.rect.top-s,bottom:e.rect.bottom-s})}}e(ft,`liftTopLaneTitleBandsAboveRails`);function pt(t,n){let r=e(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),i=e(e=>{if(!e.isGroup||e.parentId||e.direction!==`LR`)return;let t=r(e),n=e.x,i=e.width;if(!t||typeof n!=`number`||typeof i!=`number`||!Number.isFinite(n)||!Number.isFinite(i)||i<=0)return;let a=t.right-t.left,o=t.bottom-t.top;if(!(a<=0||o<a))return{node:e,rect:t}},`leftLaneTitleFor`),a=e((e,t)=>{if(!e.vertical)return!1;let n=e.a.x;return n<=t.left+X||n>=t.right-X?!1:z(e.a.y,e.b.y,t.top,t.bottom)>=Z},`verticalSegmentIntersectsTitle`),o=e((e,t)=>{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+X||n>=t.bottom-X?!1:z(e.a.x,e.b.x,t.left,t.right)>=Z},`horizontalSegmentIntersectsTitle`),s=[...n.values()].map(i).filter(e=>!!e);if(s.length===0)return;let c=0;for(let e of t){if(e.isLayoutOnly)continue;let t=H(e.points??[]);for(let e of Q(t))for(let t of s)if(a(e,t.rect))c=Math.max(c,t.rect.right-e.a.x+4);else if(o(e,t.rect)){let n=Math.min(e.a.x,e.b.x);c=Math.max(c,t.rect.right-n+4)}}if(!(c<=X))for(let e of s){let t=e.node.x,n=e.node.width;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.x=t-c/2,e.node.width=n+c,e.node.groupTitleRect={...e.rect,left:e.rect.left-c,right:e.rect.right-c})}}e(pt,`shiftLeftLaneTitleBandsLeftOfRails`);function mt(t,n){let{realNodeRects:r}=q(n.values()),i=t.filter(e=>!e.isLayoutOnly),a=e((e,t=new Map)=>H(t.get(e)??e.points??[]),`replacementPointsFor`),o=e((e=new Map)=>{let t=0;for(let n=0;n<i.length;n++){let r=Q(a(i[n],e));for(let o=n+1;o<i.length;o++){let n=Q(a(i[o],e));for(let e of r)for(let r of n)_e(e.a,e.b,r.a,r.b,X)&&t++}}return t},`crossingCount`),s=e((e=new Map)=>i.reduce((t,n)=>t+V(a(n,e)),0),`totalBends`),c=e(e=>{let t=a(e);if(t.length<4)return;let n=t[t.length-2],r=t[t.length-1];if(!(!L(n,r,X)&&!R(n,r,X)))return{tailStart:n,terminal:r}},`terminalTailFor`),l=e((e,t)=>{let n=a(e);if(n.length<3)return;let r=n[0],i=n[1],o;if(L(r,i,X))o={x:i.x,y:t.tailStart.y};else if(R(r,i,X))o={x:t.tailStart.x,y:i.y};else return;let s=Se(H([r,i,o,t.tailStart,t.terminal]));return Q(s).length===s.length-1?s:void 0},`candidateWithDestinationTail`),u=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Q(t))if(J(e.a,e.b,r,n,-2))return!0;return!1},`pathHasNodeHit`),d=e((e,t,n)=>{for(let r of i)if(r!==e){for(let e of Q(t))for(let t of Q(a(r,n)))if(B(e,t,.5)>=Z)return!0}return!1},`pathHasSharedTrack`),f=e((e,t,n)=>!u(e,t)&&!d(e,t,n),`candidateIsSafe`),p=e(()=>{let e=new Map;for(let t of i){let r=t.end;if(!r||!n.has(r)||a(t).length<4)continue;let i=e.get(r)??[];i.push(t),e.set(r,i)}return e},`edgesByDestination`);for(let e=0;e<4;e++){let e=o();if(e===0)return;let t=s(),n,r=e,i=t;for(let t of p().values())for(let a=0;a<t.length;a++)for(let u=a+1;u<t.length;u++){let d=t[a],p=t[u],m=c(d),h=c(p);if(!m||!h)continue;let g=l(d,h),_=l(p,m);if(!g||!_)continue;let v=new Map([[d,g],[p,_]]);if(!f(d,g,v)||!f(p,_,v))continue;let y=o(v),b=s(v);y>=e||y>r||y===r&&b>=i||(n=v,r=y,i=b)}if(!n)return;for(let[e,t]of n)e.points=t}}e(mt,`swapDestinationTerminalTailsToReduceCrossings`);function ht(t,n){let{realNodeRects:r,labelNodeRects:i}=q(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t=new Map)=>H(t.get(e)??e.points??[]),`replacementPointsFor`),s=e((e=new Map)=>{let t=0;for(let n=0;n<a.length;n++){let r=Q(o(a[n],e));for(let i=n+1;i<a.length;i++){let n=Q(o(a[i],e));for(let e of r)for(let r of n)_e(e.a,e.b,r.a,r.b,X)&&t++}}return t},`strictCrossingCount`),c=e((e=new Map)=>a.reduce((t,n)=>t+V(o(n,e)),0),`totalBends`),l=e(e=>{let t=e.start,r=e.end,i=t?n.get(t):void 0,a=r?n.get(r):void 0,o=i?K(i):void 0,s=a?K(a):void 0;return o&&s?{src:o,dst:s}:void 0},`endpointRectsFor`),u=e((e,t,n)=>{if(n.index<=0||n.index+1>=t.length-1)return;let r=l(e);if(r){if(n.vertical){let i=n.a.x,a=Math.min(r.src.left,r.dst.left),o=Math.max(r.src.right,r.dst.right),s=i<a-X?`left`:i>o+X?`right`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`vertical`,side:s,coord:i,min:Math.min(n.a.y,n.b.y),max:Math.max(n.a.y,n.b.y)}:void 0}if(n.horizontal){let i=n.a.y,a=Math.min(r.src.top,r.dst.top),o=Math.max(r.src.bottom,r.dst.bottom),s=i<a-X?`top`:i>o+X?`bottom`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`horizontal`,side:s,coord:i,min:Math.min(n.a.x,n.b.x),max:Math.max(n.a.x,n.b.x)}:void 0}}},`externalRailForSegment`),d=e(()=>{let e=[];for(let t of a){let n=o(t);for(let r of Q(n)){let i=u(t,n,r);i&&e.push(i)}}return e},`collectExternalRails`),f=e((e,t)=>e.edge!==t.edge&&e.axis===t.axis&&e.side===t.side&&z(e.min,e.max,t.min,t.max)>=Z,`railsInteract`),p=e(e=>{let t=[],n=new Set;for(let r of e){if(n.has(r))continue;let i=[r],a=[];for(n.add(r);i.length>0;){let t=i.pop();a.push(t);for(let r of e)!n.has(r)&&f(t,r)&&(n.add(r),i.push(r))}a.length>1&&t.push(a)}return t},`connectedComponents`),m=e(e=>{let t=[];for(let n of e)t.some(e=>Math.abs(e-n.coord)<X)||t.push(n.coord);for(;t.length<e.length;){let n=Math.min(...t),r=Math.max(...t),i=e[0].side;t.push(i===`left`||i===`top`?n-12*(e.length-t.length):r+12*(e.length-t.length))}return t},`uniqueCoordsFor`),h=e(t=>{let n=t.map(e=>e.coord),r=m(t),i=[];if(t.length<=6){let a=Array(r.length).fill(!1),o=[],s=e(()=>{if(o.length===t.length){o.some((e,t)=>Math.abs(e-n[t])>=X)&&i.push([...o]);return}for(let[e,t]of r.entries())a[e]||(a[e]=!0,o.push(t),s(),o.pop(),a[e]=!1)},`visit`);return s(),i}for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++){let r=[...n];[r[e],r[t]]=[r[t],r[e]],i.push(r)}return i},`coordinateAssignmentsFor`),g=e((e,t)=>{let n=new Map;for(let[r,i]of e.entries()){let e=t[r],a=n.get(i.edge)??i.points.map(e=>({x:e.x,y:e.y}));i.axis===`vertical`?(a[i.segmentIndex].x=e,a[i.segmentIndex+1].x=e):(a[i.segmentIndex].y=e,a[i.segmentIndex+1].y=e),n.set(i.edge,a)}let r=new Map;for(let[e,t]of n){let n=Se(H(t));if(Q(n).length!==n.length-1)return;r.set(e,n)}return r},`replacementsForAssignment`),_=e(e=>{for(let[t,n]of e){let e=[t.start,t.end].filter(e=>!!e);for(let t of Q(n))if(J(t.a,t.b,r,e,-2)||J(t.a,t.b,i,[],-2))return!1}for(let t=0;t<a.length;t++){let n=a[t],r=e.has(n),i=Q(o(n,e));for(let n=t+1;n<a.length;n++){let t=a[n];if(!r&&!e.has(t))continue;let s=Q(o(t,e));for(let e of i)for(let t of s)if(B(e,t,.5)>=Z)return!1}}return!0},`candidateIsSafe`);for(let e=0;e<4;e++){let e=s();if(e===0)return;let t,n=e,r=c(),i=1/0;for(let a of p(d()))for(let o of h(a)){let l=g(a,o);if(!l||!_(l))continue;let u=s(l);if(u>=e)continue;let d=c(l),f=a.reduce((e,t,n)=>e+Math.abs(o[n]-t.coord),0);u>n||u===n&&(d>r||d===r&&f>=i)||(t=l,n=u,r=d,i=f)}if(!t)return;for(let[e,n]of t)e.points=n}}e(ht,`reassignCrossingExternalRailChannels`);function gt(t,n){let{realNodeRects:r,labelNodeRects:i}=q(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t,n)=>H(e===t?n??[]:e.points??[]),`pointsFor`),s=e(e=>Q(e).reduce((e,t)=>{let n=t.a.x-t.b.x,r=t.a.y-t.b.y;return e+Math.hypot(n,r)},0),`pathLength`),c=e((e,t)=>{let n=0;for(let r=0;r<a.length;r++){let i=Q(o(a[r],e,t));for(let s=r+1;s<a.length;s++){let r=Q(o(a[s],e,t));for(let e of i)for(let t of r)_e(e.a,e.b,t.a,t.b,X)&&n++}}return n},`strictCrossingCount`),l=e((e,t)=>{if(e.horizontal){let n=e.a.y;return(Math.abs(n-t.top)<1||Math.abs(n-t.bottom)<1)&&z(e.a.x,e.b.x,t.left,t.right)>=Z}if(e.vertical){let n=e.a.x;return(Math.abs(n-t.left)<1||Math.abs(n-t.right)<1)&&z(e.a.y,e.b.y,t.top,t.bottom)>=Z}return!1},`segmentRunsAlongRectBorder`),u=e(e=>{let t=[e.start,e.end].filter(e=>!!e),r=[];for(let e of t){let t=n.get(e),i=t?K(t):void 0;i&&r.push(i)}return r},`endpointRectsFor`),d=e((e,t)=>{if(t+3>=e.length)return[];let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=L(n,r,X)&&R(r,i,X)&&L(i,a,X),s=R(n,r,X)&&L(r,i,X)&&R(i,a,X);if(!o&&!s||!(o?Math.sign(r.x-n.x)!==Math.sign(a.x-i.x):Math.sign(r.y-n.y)!==Math.sign(a.y-i.y)))return[];let c=F(n,a,X)||I(n,a,X)?[]:[{x:n.x,y:a.y},{x:a.x,y:n.y}],l=c.length===0?[[...e.slice(0,t+1),...e.slice(t+3)]]:c.map(n=>[...e.slice(0,t+1),n,...e.slice(t+3)]),u=new Set;return l.map(e=>Se(H(e))).filter(e=>{if(Q(e).length!==e.length-1||!e.some(e=>P(e,a,X)))return!1;let t=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return u.has(t)?!1:(u.add(t),!0)})},`shortcutCandidatesAt`),f=e((e,t,n)=>{let s=[e.start,e.end].filter(e=>!!e),d=u(e);for(let e of Q(t))if(J(e.a,e.b,r,s,-2)||J(e.a,e.b,i,[],-2)||d.some(t=>l(e,t)))return!1;for(let n of a)if(n!==e){for(let e of Q(t))for(let t of Q(o(n)))if(B(e,t,.5)>=Z)return!1}return c(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=c(),t,n,r=e,i=1/0,l=1/0;for(let u of a){let a=o(u),p=V(a,X),m=s(a);for(let o=0;o<=a.length-4;o++)for(let h of d(a,o)){let a=V(h,X),o=s(h);if(!(a<p||a===p&&o<m-X)||!f(u,h,e))continue;let d=c(u,h);d>r||d===r&&(a>i||a===i&&o>=l)||(t=u,n=h,r=d,i=a,l=o)}}if(!t||!n)return;t.points=n}}e(gt,`shortcutRedundantOrthogonalJogs`);function _t(t,n){let r=[];for(let e of n.values()){if(e.isGroup||e.isEdgeLabel)continue;let t=e.x??0,n=e.y??0,i=K(e);i&&r.push({id:String(e.id??``),cx:t,cy:n,rect:i})}if(r.length===0)return;let i=new Map(r.map(e=>[e.id,e])),a=r.map(e=>({id:e.id,rect:e.rect})),o=[`top`,`bottom`,`left`,`right`],s={top:Math.min(...r.map(e=>e.rect.top))-20,bottom:Math.max(...r.map(e=>e.rect.bottom))+20,left:Math.min(...r.map(e=>e.rect.left))-20,right:Math.max(...r.map(e=>e.rect.right))+20},c=t.filter(e=>!e.isLayoutOnly),l=new Map(c.map((e,t)=>[e,t])),u=e(e=>{let t=e===`left`||e===`top`?-1:1,n=[];for(let r=0;r<=2;r++)n.push(s[e]+t*20*r);return n},`outwardTracksForSide`),d=e((e,t=new Map)=>H(t.get(e)??e.points??[]),`replacementPointsFor`),f=e((e,t)=>{let n=0;for(let r of e)for(let e of t)_e(r.a,r.b,e.a,e.b,X)&&n++;return n},`crossingCountBetweenSegments`),p=e((e,t)=>f(Q(e),Q(t)),`crossingCountBetweenPaths`),m=e((t=new Map)=>{let n=0,r=[],i=new Set,a=[],o=e(e=>{i.has(e)||(i.add(e),a.push(e))},`addEdge`);for(let e=0;e<c.length;e++){let i=c[e],a=d(i,t);for(let s=e+1;s<c.length;s++){let e=c[s],l=p(a,d(e,t));l>0&&(n+=l,r.push({first:i,second:e,count:l}),o(i),o(e))}}return a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),{count:n,pairs:r,edgeSet:i,edges:a}},`crossingSnapshot`),h=e((e,t)=>{let n=new Set(t.keys());if(n.size===0)return e.count;let r=0;for(let t of e.pairs)(n.has(t.first)||n.has(t.second))&&(r+=t.count);let i=0;for(let e=0;e<c.length;e++){let r=c[e],a=n.has(r),o=d(r,t);for(let r=e+1;r<c.length;r++){let e=c[r];!a&&!n.has(e)||(i+=p(o,d(e,t)))}}return e.count-r+i},`crossingCountWithReplacements`),g=e(e=>{let t=new Map;for(let n of e.pairs){let e=t.get(n.first)??new Set;e.add(n.second),t.set(n.first,e);let r=t.get(n.second)??new Set;r.add(n.first),t.set(n.second,r)}let n=[],r=new Set;for(let i of e.edges){if(r.has(i))continue;let e=[i],a=[];for(r.add(i);e.length>0;){let n=e.pop();a.push(n);for(let i of t.get(n)??[])r.has(i)||(r.add(i),e.push(i))}a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),a.length>1&&n.push(a)}return n},`crossingComponents`),_=e(e=>[e.start,e.end].filter(e=>!!e),`endpointIdsFor`),v=e(e=>{let t=[];for(let n of g(e)){let e=new Set(n),r=new Set(n.flatMap(e=>_(e))),i=[...n];for(let t of c)e.has(t)||_(t).some(e=>r.has(e))&&i.push(t);i.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),t.push(i)}return t},`pairSearchGroups`),y=e((e,t,n)=>h(e,new Map([[t,n]])),`crossingCountWithSingleReplacement`),b=e(e=>{let t=new Map;for(let n of e.pairs)t.set(n.first,(t.get(n.first)??0)+n.count),t.set(n.second,(t.get(n.second)??0)+n.count);return t},`currentCrossingsByEdge`),x=e(e=>e.slice(1).reduce((t,n,r)=>{let i=e[r];return t+Math.abs(n.x-i.x)+Math.abs(n.y-i.y)},0),`pathLength`),S=e((e=new Map)=>c.reduce((t,n)=>t+V(d(n,e)),0),`totalBends`),C=e((e=new Map)=>c.reduce((t,n)=>t+x(d(n,e)),0),`totalLength`),w=e((e,t,n=new Map)=>{let r=Q(t);for(let t of c)if(t!==e){for(let e of r)for(let r of Q(d(t,n)))if(B(e,r,.5)>=Z)return!0}return!1},`pathHasSegmentConflict`),T=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Q(t))if(J(e.a,e.b,a,n,-2))return!0;return!1},`pathHitsNode`),E=e((e,t)=>{let n=Se(H(t));Q(n).length===n.length-1&&e.push(n)},`pushOrthogonalCandidate`),D=e(e=>e===`left`||e===`right`,`sideIsHorizontal`),O=e((e,t,n)=>{switch(t){case`left`:return Math.min(e.x,n.x)-20;case`right`:return Math.max(e.x,n.x)+20;case`top`:return Math.min(e.y,n.y)-20;case`bottom`:return Math.max(e.y,n.y)+20}},`localTrackForSameSide`),k=e((e,t,n,r)=>{let i=n===`left`||n===`top`?-1:1,a=[O(t,n,r),s[n]];for(let o of a)for(let a=0;a<=2;a++)E(e,ue(t,n,r,o+i*20*a))},`addSameSideCandidates`),A=e((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))E(e,[t,{x:a,y:t.y},{x:a,y:n},{x:r.x,y:n},r])},`addHorizontalToVerticalCandidates`),j=e((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))E(e,[t,{x:t.x,y:a},{x:n,y:a},{x:n,y:r.y},r])},`addVerticalToHorizontalCandidates`),ee=e((e,t,n,r,i)=>{let a=[...u(`top`),...u(`bottom`)];for(let o of u(n))for(let n of u(i))for(let i of a)E(e,[t,{x:o,y:t.y},{x:o,y:i},{x:n,y:i},{x:n,y:r.y},r])},`addHorizontalPairCandidates`),te=e((e,t,n,r,i)=>{let a=[...u(`left`),...u(`right`)];for(let o of u(n))for(let n of u(i))for(let i of a)E(e,[t,{x:t.x,y:o},{x:i,y:o},{x:i,y:n},{x:r.x,y:n},r])},`addVerticalPairCandidates`),M=e(e=>{let t=new Set;return e.map(e=>H(e)).filter(e=>{let n=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return t.has(n)||e.length<2?!1:(t.add(n),!0)})},`dedupeCandidatePaths`),ne=e((e,t,n,r)=>{let i=[],a=le(e,t,n,r,20,X);a&&E(i,a),t===r&&k(i,e,t,n);let o=D(t),s=D(r);return o&&!s?A(i,e,t,n,r):!o&&s?j(i,e,t,n,r):o?ee(i,e,t,n,r):te(i,e,t,n,r),M(i)},`buildCandidatesForSides`),N=e((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=ce(r,s),c=s===`top`||s===`bottom`?u(s):a;for(let r of i){E(e,[t,n,{x:r,y:n.y},{x:r,y:o.y},o]);for(let i of c)E(e,[t,n,{x:r,y:n.y},{x:r,y:i},{x:o.x,y:i},o])}}},`addVerticalDepartureOuterTrackCandidates`),P=e((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=ce(r,s),c=s===`left`||s===`right`?u(s):i;for(let r of a){E(e,[t,n,{x:n.x,y:r},{x:o.x,y:r},o]);for(let i of c)E(e,[t,n,{x:n.x,y:r},{x:i,y:r},{x:i,y:o.y},o])}}},`addHorizontalDepartureOuterTrackCandidates`),F=e(e=>{let t=e.start,n=e.end,r=n?i.get(n):void 0;if(!t||!r)return[];let a=H(e.points??[]);if(a.length<4)return[];let o=a[0],s=a[1],c=[];return R(o,s,X)?N(c,o,s,r):L(o,s,X)&&P(c,o,s,r),c},`terminalPreservingOuterTrackCandidates`),I=e(e=>{let t=e.start,n=e.end,r=t?i.get(t):void 0,a=n?i.get(n):void 0;if(!r||!a)return[];let s=[];for(let e of o){let t=ce(r,e);for(let n of o)s.push(...ne(t,e,ce(a,n),n))}return s.push(...F(e)),s},`candidatePathsFor`),z=e(()=>new Map(c.map(e=>[e,Q(d(e))])),`currentSegmentsByEdge`),re=e((e,t,n)=>{let r=new Set;for(let i of c){if(i===e)continue;let a=n.get(i)??Q(d(i));t.some(e=>a.some(t=>B(e,t,.5)>=Z))&&r.add(i)}return r},`sharedTrackConflictsFor`),ie=e((e,t,n,r)=>{let i=new Set;return I(e).map(e=>Se(H(e))).filter(t=>{if(T(e,t))return!1;let n=t.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return i.has(n)||t.length<2?!1:(i.add(n),!0)}).map(i=>{let a=Q(i),o=0;for(let t of c)t!==e&&(o+=f(a,n.get(t)??Q(d(t))));return{candidate:i,candidateSegments:a,crossings:t.count-(r.get(e)??0)+o,bends:V(i,X),totalBends:V(i),length:x(i)}}).filter(({crossings:e})=>e<=t.count).sort((e,t)=>e.crossings-t.crossings||e.bends-t.bends||e.length-t.length).slice(0,48).map(t=>({path:t.candidate,segments:t.candidateSegments,sharedTrackConflicts:re(e,t.candidateSegments,n),totalBends:t.totalBends,length:t.length}))},`pairCandidatesFor`),ae=e((e,t,n,r,i,a)=>{let o=0;for(let n of e.pairs)(n.first===t||n.second===t||n.first===r||n.second===r)&&(o+=n.count);let s=f(n.segments,i.segments);for(let e of c){if(e===t||e===r)continue;let o=a.get(e)??Q(d(e));s+=f(n.segments,o)+f(i.segments,o)}return e.count-o+s},`pairCrossingCount`),U=e((e,t)=>{for(let n of e.sharedTrackConflicts)if(n!==t)return!1;return!0},`conflictsOnlyWith`),W=e((e,t)=>e.segments.some(e=>t.segments.some(t=>B(e,t,.5)>=Z)),`candidatesShareTrack`),G=e((e,t,n,r)=>U(t,n.edge)&&U(r,e.edge)&&!W(t,r),`pairCandidatesAreCompatible`),oe=e((e,t,n,r,i)=>{let a=ae(e.current,t.edge,n,r.edge,i,e.baseSegments);if(!(a>=e.current.count))return{replacements:new Map([[t.edge,n.path],[r.edge,i.path]]),crossings:a,bends:e.currentBends-(e.baseBendsByEdge.get(t.edge)??0)-(e.baseBendsByEdge.get(r.edge)??0)+n.totalBends+i.totalBends,length:e.currentLength-(e.baseLengthByEdge.get(t.edge)??0)-(e.baseLengthByEdge.get(r.edge)??0)+n.length+i.length}},`scorePairReplacement`),se=e((e,t)=>e.crossings<t.crossings||e.crossings===t.crossings&&(e.bends<t.bends||e.bends===t.bends&&e.length<t.length),`pairScoreIsBetter`),de=e((e,t,n,r)=>{let i=r;for(let r of t.candidates)for(let a of n.candidates){if(!G(t,r,n,a))continue;let o=oe(e,t,r,n,a);o&&se(o,i)&&(i=o)}return i},`bestScoreForOptionPair`),q=e(e=>{let t=S(),n=C(),r=z(),i=b(e),a=new Map(c.map(e=>[e,V(d(e))])),o=new Map(c.map(e=>[e,x(d(e))])),s=new Map,l=v(e);for(let t of l)for(let n of t){if(s.has(n))continue;let t=ie(n,e,r,i);t.length>0&&s.set(n,{edge:n,candidates:t})}let u={replacements:new Map,crossings:e.count,bends:t,length:n},f={current:e,currentBends:t,currentLength:n,baseBendsByEdge:a,baseLengthByEdge:o,baseSegments:r};for(let t of l){let n=new Set(t.filter(t=>e.edgeSet.has(t))),r=t.map(e=>s.get(e)).filter(e=>!!e);for(let e=0;e<r.length;e++){let t=r[e];for(let i=e+1;i<r.length;i++){let e=r[i];!n.has(t.edge)&&!n.has(e.edge)||(u=de(f,t,e,u))}}}return u.replacements.size>0?u.replacements:void 0},`bestPairedReplacement`);for(let e=0;e<4;e++){let e=m(),t=e.count;if(t===0)return;let n,r,i=t,a=1/0;for(let o of e.edges){let s=V(d(o),X);for(let c of I(o)){let l=T(o,c),u=!l&&w(o,c),d=y(e,o,c),f=V(c,X);l||u||(d<t||d===t&&f<s)&&(d>i||d===i&&f>=a||(n=o,r=c,i=d,a=f))}}if(n&&r){n.points=r;continue}let o=q(e);if(!o)return;for(let[e,t]of o)e.points=t}}e(_t,`resolveRenderedOrthogonalCrossings`);var vt=.001,yt=8;function bt(t,n){let{nodeInfoById:r,realNodeRects:i}=de(n),a=[`top`,`bottom`,`left`,`right`],o={top:Math.min(...i.map(e=>e.rect.top))-20,bottom:Math.max(...i.map(e=>e.rect.bottom))+20,left:Math.min(...i.map(e=>e.rect.left))-20,right:Math.max(...i.map(e=>e.rect.right))+20},s=e((e,t,n,r)=>{let i=[],a=le(e,t,n,r,20,vt);return a&&i.push(a),t===r&&i.push(ue(e,t,n,o[t])),i},`buildOrthogonalPathCandidates`),c=e((e,t)=>{for(let n=0;n<e.length-1;n++){let r=e[n],a=e[n+1];if(J(r,a,i,t,1))return!0}return!1},`pathHitsNode`),l=e((e,n,r=!1)=>{let i=0,a=re(e,vt),o=n.start,s=n.end;for(let e of t){if(e===n||e.isLayoutOnly)continue;let t=e.start,c=e.end;if(!r&&o&&s&&(t===o||t===s||c===o||c===s))continue;let l=e.points;if(!(!l||l.length<2))for(let e of a)for(let t of re(l,vt)){if(me(e.a,e.b,t.a,t.b,vt,vt)){i++;continue}B(e,t,vt)>=yt&&i++}}return i},`pathConflictCount`),u=e((e,t)=>{let n=Math.abs(e.y-t.rect.top),r=Math.abs(e.y-t.rect.bottom),i=Math.abs(e.x-t.rect.left),a=Math.abs(e.x-t.rect.right),o=`top`,s=n;return r<s&&(o=`bottom`,s=r),i<s&&(o=`left`,s=i),a<s&&(o=`right`,s=a),o},`nearestSideOfRect`),d=new Map,f=e((e,t,n)=>{let r=d.get(e)??[];r.push({side:t,edgeId:n}),d.set(e,r)},`addFaceClaim`);for(let e of t){if(e.isLayoutOnly)continue;let t=e.points??[];if(t.length<1)continue;let n=e.id??``,i=e.start,a=e.end;if(i){let e=r.get(i);e&&f(i,u(t[0],e),n)}if(a){let e=r.get(a);e&&f(a,u(t[t.length-1],e),n)}}let p=e((e,t,n)=>d.get(e)?.some(e=>e.edgeId!==n&&e.side===t)??!1,`faceIsClaimed`);for(let e of t){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=V(t,vt);if(n<4)continue;let i=e.start,o=e.end;if(!i||!o)continue;let m=r.get(i),h=r.get(o);if(!m||!h)continue;let g=e.id??``,_=l(t,e,!0),v=l(t,e),y,b=_,x=n;for(let t of a){if(p(i,t,g))continue;let n=ce(m,t);for(let r of a){if(p(o,r,g))continue;let a=ce(h,r);for(let u of s(n,t,a,r)){if(c(u,[i,o]))continue;let t=V(u,vt);if(_>0){let n=l(u,e,!0);if(n>b||n===b&&t>=x)continue;b=n,x=t,y=u;continue}l(u,e)>v||t<x&&(x=t,y=u)}}}if(y){e.points=y;let t=d.get(i);t&&d.set(i,t.filter(e=>e.edgeId!==g));let n=d.get(o);n&&d.set(o,n.filter(e=>e.edgeId!==g)),f(i,u(y[0],m),g),f(o,u(y[y.length-1],h),g)}}}e(bt,`simplifyDetouredEdges`);var xt=.001,St=10,Ct=7;function wt(e,t){let n=t?0:e.length-1,r=t?1:-1,i=e[n],a=e[n+r];if(!i||!a)return;let o=a.x-i.x,s=a.y-i.y;if(!(Math.abs(o)+Math.abs(s)<xt)){if(Math.abs(s)<=xt){let e=i.x+Math.sign(o)*St;return{left:Math.min(i.x,e),right:Math.max(i.x,e),top:i.y-Ct,bottom:i.y+Ct}}if(Math.abs(o)<=xt){let e=i.y+Math.sign(s)*St;return{left:i.x-Ct,right:i.x+Ct,top:Math.min(i.y,e),bottom:Math.max(i.y,e)}}return{left:Math.min(i.x,a.x),right:Math.max(i.x,a.x),top:Math.min(i.y,a.y),bottom:Math.max(i.y,a.y)}}}e(wt,`markerClearanceRectFor`);function Tt(e){return{left:Math.min(e.left,e.right),right:Math.max(e.left,e.right),top:Math.min(e.top,e.bottom),bottom:Math.max(e.top,e.bottom)}}e(Tt,`normalizeRect`);function Et(e,t){let n=H(t);return[wt(n,!0),wt(n,!1)].some(t=>t&&G(e,Tt(t)))}e(Et,`labelOverlapsOwnMarker`);function Dt(t,n){let r=[];for(let e of t){if(e.isLayoutOnly)continue;let t=e.points;if(!(!t||t.length<2))for(let n=0;n<t.length-1;n++)r.push({edgeId:e.id,p1:t[n],p2:t[n+1]})}let i=[],a=[];for(let e of n.values()){let t=e.isGroup,n=e.parentId;if(t&&!n){let t=K(e);t&&a.push({id:e.id,rect:t});continue}if(t||e.isEdgeLabel)continue;let r=K(e);r&&i.push({nodeId:e.id,rect:r})}let o=e((e,t)=>{let n=oe(t,3);for(let{nodeId:t,rect:r}of i)if(t!==e&&G(n,r))return!0;return!1},`labelOverlapsForeignNode`),s=e((e,t)=>{let n=oe(t,3);for(let t of r)if(t.edgeId!==e&&ae(t.p1,t.p2,n))return!0;return!1},`labelOverlapsForeignEdge`),c=e((e,t,n)=>o(e,n)||s(t,n),`labelOverlapsAnything`),l=[],u=e(e=>{for(let{id:t,rect:n}of a)if(W(n,e))return t},`findContainingLane`),d=e((e,t)=>l.some(n=>n.labelId!==e&&G(t,n.rect)),`overlapsPlacedLabel`);for(let r of t){if(r.isLayoutOnly)continue;let t=r.labelNodeId;if(!t)continue;let i=n.get(t);if(!i)continue;let f=r.points;if(!f||f.length<2)continue;let p=i.width??0,m=i.height??0;if(p<=0||m<=0)continue;let h=[];for(let e=0;e<f.length-1;e++){let t=f[e],n=f[e+1],r=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);r<xt&&i<xt||r>=xt&&i>=xt||h.push({idx:e,length:r+i,orientation:r>=xt?`horizontal`:`vertical`,midX:(t.x+n.x)/2,midY:(t.y+n.y)/2})}if(h.length===0)continue;let g=h.length>=3?h.filter(e=>e.idx>0&&e.idx<h.length-1):h,_=g.length>0?g:h,v=p>=m?`horizontal`:`vertical`,y=e(e=>[...e].sort((e,t)=>{let n=e.orientation===v;if(n!==(t.orientation===v))return n?-1:1;let r=e.length>=(e.orientation===`horizontal`?p:m)+2;return r===t.length>=(t.orientation===`horizontal`?p:m)+2?t.length-e.length:r?-1:1}),`rankSegments`),b=h[0],x=h[h.length-1],S=[.5,.25,.75,.05,.95,.15,.85,.1,.9],C=e((e,t)=>{let n=f[e.idx],r=f[e.idx+1];return{midX:n.x+(r.x-n.x)*t,midY:n.y+(r.y-n.y)*t}},`anchorAtT`),w=e((e,t,n)=>Math.min(n,Math.max(t,e)),`clamp`),T=e((e,t)=>e.midX>=t.left-xt&&e.midX<=t.right+xt&&e.midY>=t.top-xt&&e.midY<=t.bottom+xt,`pointInsideRectInclusive`),E=e(e=>{let t=se(e.midX,e.midY,p,m),n=u(t);if(n)return{laneId:n,anchor:e,rect:t};let r=a.find(({rect:t})=>T(e,t));if(!r)return;let i=r.rect.left+p/2+1,o=r.rect.right-p/2-1,s=r.rect.top+m/2+1,c=r.rect.bottom-m/2-1;if(i>o||s>c)return;let l={midX:w(e.midX,i,o),midY:w(e.midY,s,c)},d=se(l.midX,l.midY,p,m);return T(e,d)?{laneId:r.id,anchor:l,rect:d}:void 0},`placementForAnchor`),D=e((e,t,n)=>e.orientation===`horizontal`?Math.abs(t.midX-n.x):Math.abs(t.midY-n.y),`distanceAlongSegment`),O=e((e,t)=>{let n=(e.orientation===`horizontal`?p/2:m/2)+12;if(e===b){let r=f[e.idx];if(D(e,t,r)+xt<n)return!1}if(e===x){let r=f[e.idx+1];if(D(e,t,r)+xt<n)return!1}return!0},`labelClearsTerminalEndpoints`),k=e(e=>{let n=y(e);for(let e of n)for(let n of S){let i=C(e,n);if(!O(e,i))continue;let a=E(i);if(a&&!Et(a.rect,f)&&!d(t,a.rect)&&!c(t,r.id,a.rect))return{laneId:a.laneId,anchor:a.anchor}}},`tryPool`),A=e((e,n,i=!1)=>{let a=y(e);for(let e of a){let a={midX:e.midX,midY:e.midY};if(n&&!O(e,a))continue;let c=E(a);if(c&&!Et(c.rect,f)&&!d(t,c.rect)&&!o(t,c.rect)&&(i||!s(r.id,c.rect)))return{laneId:c.laneId,anchor:c.anchor}}},`findLaneContainingFallback`),j=k(_)??(_.length<h.length?k(h):void 0)??A(h,!0)??A(h,!1)??A(h,!1,!0);if(j){i.x=j.anchor.midX,i.y=j.anchor.midY,i.parentId=j.laneId;let e=se(j.anchor.midX,j.anchor.midY,p,m),n=l.findIndex(e=>e.labelId===t);n>=0?l[n]={labelId:t,rect:e}:l.push({labelId:t,rect:e})}}}e(Dt,`anchorLabelsToPolyline`);var Ot=1e-6,kt=8/2,At=3;function jt(e,t){return e<t?`${e}::${t}`:`${t}::${e}`}e(jt,`pairKey`);function Mt(t,n){let{nodeInfoById:r,realNodeRects:i}=de(n),a=new Map;for(let e of n){let t=e.id;if(!e.isGroup&&e.isEdgeLabel){a.set(t,{w:e.width??0,h:e.height??0});continue}}let o=e((n,r,i,o)=>{let s=jt(r,i),c=0,l=e(e=>{if(!e)return;let t=a.get(e);if(!t)return;let n=o===`x`?t.w/2:t.h/2;n>c&&(c=n)},`consider`);l(n.labelNodeId);for(let e of t){if(e===n||e.isLayoutOnly)continue;let t=e.start,r=e.end;!t||!r||jt(t,r)===s&&l(e.labelNodeId)}return c>0?c+At:0},`labelClearanceFor`);for(let e of t){if(e.isLayoutOnly)continue;let n=e.points;if(!ie(n,Ot))continue;let a=pe(e,r,Ot);if(!a)continue;let{srcId:s,dstId:c,srcInfo:l,dstInfo:u,collinearX:d,collinearY:f}=a;if(d===f)continue;let p,m;if(d){let e=u.cy>l.cy;p={x:l.cx,y:e?l.rect.bottom:l.rect.top},m={x:u.cx,y:e?u.rect.top:u.rect.bottom}}else{let e=u.cx>l.cx;p={x:e?l.rect.right:l.rect.left,y:l.cy},m={x:e?u.rect.left:u.rect.right,y:u.cy}}if(J(p,m,i,[s,c],1))continue;let h=o(e,s,c,d?`x`:`y`),g=h>kt?h:kt,_=[0,g,-g];for(let n of _){let r={...p},a={...m};if(d){if(r.x+=n,a.x+=n,r.x<=l.rect.left||r.x>=l.rect.right||a.x<=u.rect.left||a.x>=u.rect.right)continue}else if(r.y+=n,a.y+=n,r.y<=l.rect.top||r.y>=l.rect.bottom||a.y<=u.rect.top||a.y>=u.rect.bottom)continue;if(!J(r,a,i,[s,c],1)&&!ge(r,a,t,e,{epsilon:Ot})){e.points=[r,a];break}}}}e(Mt,`straightenCollinearSiblingDetours`);function Nt(t,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=q(n.values()),o=e((e,t)=>re(t,r).map(n=>({...n,edge:e,interior:n.index>=1&&n.index<=t.length-3})),`segmentsFor`),s=e(()=>{let e=[];for(let n of t){if(n.isLayoutOnly)continue;let t=n.points;!t||t.length<2||e.push(...o(n,H(t)))}return e},`allSegments`),c=e((e,t)=>e.horizontal&&t.horizontal?z(e.a.x,e.b.x,t.a.x,t.b.x)>=8&&Math.abs(e.a.y-t.a.y)<7:e.vertical&&t.vertical?z(e.a.y,e.b.y,t.a.y,t.b.y)>=8&&Math.abs(e.a.x-t.a.x)<7:!1,`hasCrowdedParallelTrack`),l=e((e,n)=>{let s=e.start,l=e.end,u=o(e,n);if(u.length!==n.length-1)return!1;let d=[s,l].filter(e=>!!e),f=e.labelNodeId?[e.labelNodeId]:[];for(let e of u)if(J(e.a,e.b,i,d,-2)||J(e.a,e.b,a,f,-2))return!1;for(let n of t){if(n===e||n.isLayoutOnly)continue;let t=n.points;if(!(!t||t.length<2)){for(let e of u)for(let i of o(n,H(t)))if(c(e,i)||_e(e.a,e.b,i.a,i.b,r))return!1}}return!0},`candidateIsSafe`),u=e((e,t)=>{let n=H(e.edge.points??[]);if(n.length<4||e.index>=n.length-1)return;let r=n.map(e=>({...e}));if(e.horizontal)r[e.index].y+=t,r[e.index+1].y+=t;else if(e.vertical)r[e.index].x+=t,r[e.index+1].x+=t;else return;return o(e.edge,r).length===r.length-1?r:void 0},`shiftedCandidate`),d=e((e,t)=>({x:e.x??(t.left+t.right)/2,y:e.y??(t.top+t.bottom)/2}),`nodeCenter`),f=e(e=>{let t=e.edge,r=H(t.points??[]);if(r.length!==4||e.index!==1)return;let i=t.start?n.get(t.start):void 0,a=t.end?n.get(t.end):void 0,o=i?K(i):void 0,s=a?K(a):void 0,c=r.slice(e.index+2);if(!(!i||!a||!o||!s||c.length===0))return{sourceCenter:d(i,o),targetCenter:d(a,s),sourceRect:o,tail:c}},`sourceDetourContextFor`),p=e((e,t,n,i,a,o)=>{let s=i.y>=n.y,c=s?a.bottom:a.top,l=c+(s?20:-20);if(s&&e.b.y<=l+r||!s&&e.b.y>=l-r)return;let u=e.a.x+t;return H([{x:n.x,y:c},{x:n.x,y:l},{x:u,y:l},{x:u,y:e.b.y},...o],r)},`verticalSourceDetour`),m=e((e,t,n,i,a,o)=>{let s=i.x>=n.x,c=s?a.right:a.left,l=c+(s?20:-20);if(s&&e.b.x<=l+r||!s&&e.b.x>=l-r)return;let u=e.a.y+t;return H([{x:c,y:n.y},{x:l,y:n.y},{x:l,y:u},{x:e.b.x,y:u},...o],r)},`horizontalSourceDetour`),h=e((e,t)=>{let n=f(e);if(n){if(e.vertical)return p(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail);if(e.horizontal)return m(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail)}},`sourceDetourCandidate`),g=[-7,7,-14,14,-21,21];for(let e=0;e<12;e++){let e=s(),t=!1;for(let n=0;n<e.length&&!t;n++)for(let r=n+1;r<e.length&&!t;r++){let i=e[n],a=e[r];if(i.edge===a.edge||!c(i,a))continue;let o=[i,a].filter(e=>e.interior);for(let e of o){for(let n of g){let r=u(e,n);if(r&&l(e.edge,r)){e.edge.points=r,t=!0;break}let i=h(e,n);if(i&&l(e.edge,i)){e.edge.points=i,t=!0;break}}if(t)break}}if(!t)return}}e(Nt,`nudgeSharedInteriorSubpaths`);function Pt(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y,c=i*s-a*o;if(Math.abs(c)<1e-10)return!1;let l=n.x-e.x,u=n.y-e.y,d=(l*s-u*o)/c,f=(l*a-u*i)/c,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}e(Pt,`segmentsIntersect`);function Ft(e){let n=e.nodes??[],r=e.edges??[],i=[];if(!r.length||!n.length)return i;let a=fe(n),o=[];for(let e of r){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=e.start,r=e.end,s=e.labelNodeId,c=e.id??`${n}->${r}`;for(let e of a)if(!(e.nodeId===n||e.nodeId===r)&&!(s&&e.nodeId===s)){for(let n=0;n<t.length-1;n++)if(ae(t[n],t[n+1],e,-1)){i.push({type:`edge-node-overlap`,edgeId:c,targetId:e.nodeId,detail:`segment ${n} passes through node "${e.nodeId}"`});break}}for(let e=0;e<t.length-1;e++)o.push({edgeId:c,start:n,end:r,p1:t[e],p2:t[e+1]})}let s=new Set;for(let e=0;e<o.length;e++)for(let t=e+1;t<o.length;t++){let n=o[e],r=o[t];if(n.edgeId!==r.edgeId&&!(n.start===r.start||n.start===r.end||n.end===r.start||n.end===r.end)&&Pt(n.p1,n.p2,r.p1,r.p2)){let e=n.edgeId<r.edgeId?`${n.edgeId}|${r.edgeId}`:`${r.edgeId}|${n.edgeId}`;s.has(e)||(s.add(e),i.push({type:`edge-edge-crossing`,edgeId:n.edgeId,targetId:r.edgeId,detail:`edges "${n.edgeId}" and "${r.edgeId}" cross`}))}}if(i.length>0){let e=i.filter(e=>e.type===`edge-node-overlap`).length,n=i.filter(e=>e.type===`edge-edge-crossing`).length;t.warn(`[SWIMLANE_VALIDATE] ${i.length} issue(s) detected: ${e} edge-node overlap(s), ${n} edge crossing(s)`);for(let e of i)t.warn(`[SWIMLANE_VALIDATE] ${e.type}: ${e.detail}`)}return i}e(Ft,`validateSwimlanesLayout`);function It(t,n){let r=t.nodes??[],i=t.edges??[],a=r.filter(e=>!e.isGroup);if((n===`LR`||n===`RL`)&&a.length>0&&!nt(t,n)||n===`BT`&&a.length>0&&!tt(t))return;for(let e of i){if(e.isLayoutOnly)continue;let t=e.points;!t||t.length<2||(e.points=Se(xe(t)))}bt(i,r),Mt(i,r),ot(i,r);let o=new Map;for(let e of r)o.set(String(e.id),e);Dt(i,o),Oe(i,o),st(i,o),Nt(i,o),lt(i,o),ut(i,o),dt(i,o),mt(i,o);let s=e(()=>{_t(i,o),ht(i,o),gt(i,o),Dt(i,o),qe(i,o),dt(i,o),Dt(i,o),qe(i,o)},`finalizeRenderedEdges`);s(),Nt(i,o),s(),ft(i,o),pt(i,o),ft(i,o),pt(i,o)}e(It,`postProcessSwimlaneLayout`);function Lt(e){let t=new Map(e.nodeById),n=new Set,r=[];for(let i of e.edges){if(!t.has(i.src)||!t.has(i.dst))continue;let e=`${i.id}:${i.src}->${i.dst}`;n.has(e)||(n.add(e),r.push(i))}return{nodes:[...t.keys()],edges:r,layout:e.layout,nodeById:t}}e(Lt,`normalizeGraph`);function Rt(e,t){return e.edges.filter(e=>e.dst===t)}e(Rt,`incoming`);function zt(e){let t=new Map;for(let n of e.nodes)t.set(n,[]);for(let n of e.edges)t.get(n.src).push(n.dst);return t}e(zt,`buildSuccessorMap`);function Bt(e){let t=zt(e);for(let e of t.values())e.sort((e,t)=>e.localeCompare(t));return t}e(Bt,`buildSortedSuccessorMap`);function Vt(e){let t=new Map;for(let n of e.nodes)t.set(n,0);for(let n of e.edges)t.set(n.dst,(t.get(n.dst)??0)+1);return t}e(Vt,`buildInDegreeMap`);function Ht(e){return[...e.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}e(Ht,`sortedZeroInDegreeNodes`);function Ut(e,t=()=>!0){let n=new Map,r=new Map;for(let t of e.nodes)n.set(t,[]),r.set(t,[]);for(let i of e.edges)t(i)&&(r.get(i.src).push(i.dst),n.get(i.dst).push(i.src));return{preds:n,succs:r}}e(Ut,`buildPredecessorSuccessorMaps`);function Wt(e,t,n,r){let i=0;for(let t of e.nodes)r?.skipGroups&&e.nodeById.get(t)?.isGroup||(i=Math.max(i,n[t]??0));let a=Array.from({length:i+1},()=>[]);for(let i of t)r?.skipGroups&&e.nodeById.get(i)?.isGroup||a[Math.max(0,n[i]??0)].push(i);return a}e(Wt,`buildLayersFromRanks`);function Gt(e){let t=Vt(e),n=Ht(t),r=[],i=Bt(e);for(;n.length;){let e=n.shift();r.push(e);for(let r of i.get(e)??[])if(t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0){let e=0;for(;e<n.length&&n[e]<r;)e++;n.splice(e,0,r)}}return r.length===e.nodes.length?r:null}e(Gt,`topoSortIfAcyclic`);function Kt(e){let t=new Map,n=0;for(let r of e)t.set(r,n),n++;return t}e(Kt,`buildLayerIndex`);function qt(t){let n=Array(t.length),r=e((e,i)=>{if(i-e<=1)return 0;let a=e+i>>1,o=r(e,a)+r(a,i),s=e,c=a,l=e;for(;s<a||c<i;)c>=i||s<a&&t[s]<=t[c]?n[l++]=t[s++]:(n[l++]=t[c++],o+=a-s);for(let r=e;r<i;r++)t[r]=n[r];return o},`count`);return r(0,t.length)}e(qt,`countInversions`);function Jt(t){let n=Lt(t),r=new Map;for(let e of n.nodes)r.set(e,[]);for(let e of n.edges)r.get(e.src).push(e);for(let e of r.values())e.sort((e,t)=>e.dst===t.dst?e.id.localeCompare(t.id):e.dst.localeCompare(t.dst));let i=Object.create(null);for(let e of n.nodes)i[e]=0;let a=[],o=e(e=>{i[e]=1;for(let t of r.get(e)??[]){let e=t.dst;i[e]===0?o(e):i[e]===1&&a.push(t)}i[e]=2},`dfs`),s=[...n.nodes].sort((e,t)=>e.localeCompare(t));for(let e of s)i[e]===0&&o(e);let c=new Set(a.map(e=>`${e.id}:${e.src}->${e.dst}`)),l=n.edges.map(e=>c.has(`${e.id}:${e.src}->${e.dst}`)?{id:e.id,src:e.dst,dst:e.src,weight:e.weight,ref:e.ref}:e);return{acyclic:{nodes:[...n.nodes],edges:l,layout:n.layout,nodeById:new Map(n.nodeById)},reversed:a}}e(Jt,`removeCycles_DFS`);function Yt(t){let n=new Map,r=e(e=>{if(n.has(e))return n.get(e);let i=t.nodeById.get(e);if(!i)return n.set(e,null),null;let a=i.parentId;if(!a)return n.set(e,null),null;let o=r(a)??a;return n.set(e,o),o},`resolve`);for(let e of t.nodes)r(e);return n}e(Yt,`buildTopLaneMap`);function Xt(e){let t=Yt(e);return e=>t.get(e)??null}e(Xt,`createTopLaneResolver`);function Zt(e){let t=[];for(let n of e.layout.nodes??[])n.isGroup&&!n.parentId&&t.push(n.id);return[...new Set(t)].reverse()}e(Zt,`buildTopLaneOrder`);function Qt(e,t){let n=Zt(e);if(!t||t.length===0)return n;let r=new Set(n),i=new Set,a=[];for(let e of t)!r.has(e)||i.has(e)||(i.add(e),a.push(e));for(let e of n)i.has(e)||a.push(e);return a}e(Qt,`resolveTopLaneOrder`);var $t={EPSILON:1e-6},en={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},tn={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function nn(t,n){let r=Lt(t),i=n?.laneOf??(()=>null),a=n?.rankHint,{preds:o}=Ut(r);for(let e of o.values())e.sort((e,t)=>e.localeCompare(t));let s=Gt(r)??[...r.nodes].sort((e,t)=>e.localeCompare(t)),c=new Map;for(let[e,t]of s.entries())c.set(t,e);let l=new Map,u=new Map;for(let e of r.nodes)u.set(e,[]);for(let e of s){let t=(o.get(e)??[]).filter(e=>l.has(e));if(t.length>0){let n=rn(e,t,{laneOf:i,rankHint:a,topoIndex:c});l.set(e,n),u.get(n).push(e)}else l.has(e)||l.set(e,null)}for(let e of r.nodes)l.has(e)||l.set(e,null);let d=new Set;for(let e of r.nodes)(l.get(e)??null)===null&&d.add(e);let f=[...d].sort((e,t)=>{let n=c.get(e)??0,r=c.get(t)??0;return n===r?e.localeCompare(t):n-r}),p=an(r),m=new Map;for(let[e,t]of p.entries())m.set(e,[...t].sort((e,t)=>e.localeCompare(t)));let h=on(m),g=sn(m),_=new Map;for(let e of r.nodes)_.set(e,[]);for(let e of g)for(let t of e.nodes){let n=_.get(t);n?n.push(e.id):_.set(t,[e.id])}let v=[],y=[],b=new Set,x=e(e=>{if(!b.has(e)){b.add(e),v.push(e);for(let t of u.get(e)??[])x(t);y.push(e)}},`walk`);for(let e of f)x(e);for(let e of s)x(e);return{parent:l,children:u,roots:f,componentOf:h,blocks:g,nodeBlocks:_,adjacency:m,preorder:v,postorder:y,topologicalOrder:s}}e(nn,`buildDrivingTree`);function rn(e,t,n){let r=n.laneOf(e);return[...t].sort((e,t)=>{let i=n.laneOf(e),a=n.laneOf(t),o=i!=null&&i===r;if(o!==(a!=null&&a===r))return o?-1:1;let s=n.rankHint?.[e],c=n.rankHint?.[t];if(s!=null&&c!=null&&s!==c)return c-s;let l=n.topoIndex.get(e)??0,u=n.topoIndex.get(t)??0;return l===u?e.localeCompare(t):l-u})[0]}e(rn,`chooseParent`);function an(e){let t=new Map;for(let n of e.nodes)t.set(n,new Set);for(let n of e.edges)t.get(n.src).add(n.dst),t.get(n.dst).add(n.src);return t}e(an,`buildAdjacency`);function on(e){let t=new Map,n=0;for(let r of e.keys()){if(t.has(r))continue;let i=[r];for(;i.length>0;){let r=i.pop();if(!t.has(r)){t.set(r,n);for(let n of e.get(r)??[])t.has(n)||i.push(n)}}n++}return t}e(on,`assignComponents`);function sn(t){let n=new Map,r=new Map,i=[],a=[],o=0,s=e((e,c)=>{n.set(e,++o),r.set(e,o);for(let l of t.get(e)??[])l!==c&&(n.has(l)?(n.get(l)??0)<(n.get(e)??0)&&(i.push([e,l]),r.set(e,Math.min(r.get(e)??o,n.get(l)??o))):(i.push([e,l]),s(l,e),r.set(e,Math.min(r.get(e)??o,r.get(l)??o)),(r.get(l)??0)>=(n.get(e)??0)&&a.push(cn(e,l,i,a.length))))},`visit`);for(let e of t.keys())n.has(e)||s(e,null);return a}e(sn,`computeBlocks`);function cn(e,t,n,r){let i=[],a=new Set;for(;n.length>0;){let r=n.pop();if(i.push(r),a.add(r[0]),a.add(r[1]),r[0]===e&&r[1]===t||r[0]===t&&r[1]===e)break}return{id:r,edges:i,nodes:[...a]}}e(cn,`popBlock`);function ln(t,n,r){let i=[...t.nodes],a=new Map;for(let[e,t]of i.entries())a.set(t,e);let o=i.length,s=Array(o).fill(-1),c=Array(o).fill(0),l=[],u=new Set;for(let e of i){let t=r.parent.get(e)??null,n=a.get(e);n!=null&&(t??(s[n]=-1,c[n]=0,u.has(e)||(u.add(e),l.push(e))))}for(;l.length>0;){let e=l.shift(),t=a.get(e);if(t==null)continue;let n=r.children.get(e)??[];for(let e of n){if(u.has(e))continue;let n=a.get(e);n!=null&&(s[n]=t,c[n]=c[t]+1,u.add(e),l.push(e))}}for(let e of i){if(u.has(e))continue;let t=a.get(e);t!=null&&(s[t]=-1,c[t]=0,u.add(e))}let d=Math.max(1,Math.ceil(Math.log2(Math.max(1,o)))+1),f=Array.from({length:d},()=>Array(o).fill(-1));for(let e=0;e<o;e++)f[0][e]=s[e];for(let e=1;e<d;e++)for(let t=0;t<o;t++){let n=f[e-1][t];f[e][t]=n===-1?-1:f[e-1][n]}let p=e((e,t)=>{if(e===-1||t===-1)return-1;c[e]<c[t]&&([e,t]=[t,e]);let n=c[e]-c[t];for(let t=0;t<d;t++)if(n>>t&1&&(e=f[t][e],e===-1))return-1;if(e===t)return e;for(let n=d-1;n>=0;n--){let r=f[n][e],i=f[n][t];r===-1||i===-1||r!==i&&(e=r,t=i)}return f[0][e]},`lcaIndex`),m=Array.from({length:o},()=>new Map);for(let e of t.edges){let t=e.src,r=e.dst,i=n[t],o=n[r];if(i==null||o==null||(i>o&&([t,r]=[r,t],[i,o]=[o,i]),i==null||o==null||i===o))continue;let s=a.get(t),c=a.get(r);if(s==null||c==null)continue;let l=p(s,c);if(l===-1)continue;let u=m[l];for(let e=i;e<o;e++)u.set(e,(u.get(e)??0)+1)}let h=new Map,g=e((e,t)=>{if(t.size!==0)for(let[n,r]of t)e.set(n,(e.get(n)??0)+r)},`mergeInto`),_=new Set,v=e(e=>{let t=a.get(e);_.add(e);let i=t==null?void 0:m[t],o=i?new Map(i):new Map,s=r.children.get(e)??[];for(let t of s){let r=v(t),i=n[e];if(i!=null){let a=h.get(e);a||(a=new Map,h.set(e,a));let o=r.get(i)??0,s=n[t];s!=null&&s>i&&(o+=1),a.set(t,o)}g(o,r)}return o},`dfs`);for(let e of r.roots)_.has(e)||v(e);for(let e of i)_.has(e)||v(e);return h}e(ln,`computeSubtreeCrossCounts`);function un(t,n,r){let i=new Map,a=e(e=>{let t=r[e]??0,o=[...n.get(e)??[]];o.sort(dn(r));for(let e of o){a(e);let n=i.get(e);n!=null&&(t=Math.min(t,n))}i.set(e,t)},`annotate`);for(let e of t)a(e);return i}e(un,`annotateMinimumLayers`);function dn(e){return(t,n)=>{let r=e[t]??0,i=e[n]??0;return r===i?t.localeCompare(n):r-i}}e(dn,`compareByRankThenId`);function fn(t,n,r,i){let a=0;for(let e of n){let t=r[e]??0;t>a&&(a=t)}let o=Array.from({length:a+1},()=>[]),s=new Set,c=e(e=>{if(s.has(e))return;s.add(e);let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e);for(let t of i(e))c(t)},`emit`);for(let e of t)c(e);for(let e of n)if(!s.has(e)){let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e),s.add(e)}return o}e(fn,`emitNodesInTreeOrder`);function pn(e){let t=[];for(let n of e){let e=new Set,r=[];for(let t of n)e.has(t)||(e.add(t),r.push(t));t.push(r)}return t}e(pn,`deduplicateLayers`);function mn(e,t,n,r){return i=>{let a=e.get(i)??[];if(a.length===0)return[];let o=t[i]??0,s=[],c=[],l=n.get(i);for(let e of a){let t=r.get(e)??o;t>o?s.push({child:e,min:t}):c.push(e)}return s.sort((e,t)=>e.min===t.min?e.child.localeCompare(t.child):e.min-t.min),c.sort((e,t)=>{let n=l?.get(e)??0,i=l?.get(t)??0;if(n!==i)return n-i;let a=r.get(e)??o,s=r.get(t)??o;return a===s?e.localeCompare(t):a-s}),[...s.map(e=>e.child),...c]}}e(mn,`createChildOrderer`);function hn(e,t,n){let r=nn(e,{rankHint:t,laneOf:n}),{children:i,roots:a}=r;for(let t of e.nodes)i.has(t)||i.set(t,[]);let o=ln(e,t,r),s=[...a].sort(dn(t)),c=mn(i,t,o,un(s,i,t)),l=fn(s,e.nodes,t,c);return l=pn(l),l}e(hn,`buildMultitreeLayerOrder`);function gn(e,t,n){let r=new Set(e),i=new Set(t),a=Kt(t),o=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&o.push(a.get(e.dst));return qt(o)}e(gn,`countCrossingsBetweenAdjacent`);function _n(e,t,n){let r=[];for(let e of t){let t=n[e.src],i=n[e.dst];if(t==null||i==null||t===i)continue;let a=e.src,o=e.dst,s=t,c=i;t>i&&(a=e.dst,o=e.src,s=i,c=t);for(let t=s;t<c;t++)r.push({id:`${e.id}@${t}`,src:a,dst:o,ref:e.ref})}let i=0;for(let t=0;t+1<e.length;t++)i+=gn(e[t],e[t+1],r);return i}e(_n,`totalCrossings`);function vn(e,t){let n={...t},{preds:r}=Ut(e),i=Xt(e),a=_n(hn(e,n,i),e.edges,n),o=en.MAX_CROSSING_OPTIMIZATION_PASSES;for(let t=0;t<o;t++){let t=!1,o=[...e.nodes].sort((e,t)=>(n[t]??0)-(n[e]??0));for(let s of o){let o=n[s]??0;if(o===0)continue;let c=0;for(let e of r.get(s)??[])c=Math.max(c,(n[e]??0)+1);if(c>=o)continue;let l=o;n[s]=c;let u=_n(hn(e,n,i),e.edges,n);u<a?(a=u,t=!0):n[s]=l}if(!t)break}return n}e(vn,`optimizeRanksByCrossings`);function yn(e,t){let n=Xt(e),r=[...e.nodes].sort((e,n)=>(t[e]??0)-(t[n]??0)||e.localeCompare(n));for(let i of r){let r=n(i);if(!r)continue;let a=e.edges.filter(e=>e.src===i);if(a.length===0)continue;let o=!1,s=0;for(let e of a){let t=n(e.dst);t==null||t===r?o=!0:s++}if(s===0||o)continue;let c=0,l=!1;for(let t of e.edges){if(t.dst!==i)continue;let e=n(t.src);e&&(e===r?l=!0:c++)}if(c>0||!l)continue;let u=t[i]??0,d=u+s,f=0;for(let n of e.edges)n.dst===i&&(f=Math.max(f,(t[n.src]??0)+1));let p=Math.max(u,f,d);p!==u&&(t[i]=p)}}e(yn,`adjustCrossLaneSources`);function bn(e,t){let n=Lt(e),r=Gt(n)??[...n.nodes].sort(),i=t?.compactSingleInput??!1,a=Xt(n),o=Object.create(null);for(let e of r){let r=Rt(n,e),s=t?.ignoreCrossLaneEdges?r.filter(t=>{let n=a(t.src),r=a(e);return!n||!r?!0:n===r}):r;if(s.length===0)o[e]=0;else if(i&&s.length===1){let t=s[0].src;a(t)===a(e)?o[e]=(o[t]??0)+1:o[e]=o[t]??0}else{let t=-1/0;for(let e of s)t=Math.max(t,(o[e.src]??0)+1);o[e]=t===-1/0?0:t}}return(t?.optimizeRanksByCrossings??!1)&&(o=vn(n,o)),t?.ignoreCrossLaneEdges&&yn(n,o),{layers:hn(n,o,a),rankOf:o,dummy:new Set}}e(bn,`assignLayers_LongestPath`);function xn(t,n){let r=Lt(t),i={...bn(r,{compactSingleInput:n?.compactSingleInput,ignoreCrossLaneEdges:n?.ignoreCrossLaneEdges,optimizeRanksByCrossings:n?.optimizeRanksByCrossings}).rankOf},a=Xt(r),{preds:o,succs:s}=Ut(r,e=>{if(n?.ignoreCrossLaneEdges){let t=a(e.src),n=a(e.dst);if(t&&n&&t!==n)return!1}return!0}),c=Gt(r)??[...r.nodes],l=[...c].reverse(),u=e((e,t)=>{let n=0;for(let t of o.get(e)??[])n=Math.max(n,(i[t]??0)+1);let r=1/0,a=s.get(e)??[];return a.length>0&&(r=Math.min(...a.map(e=>(i[e]??0)-1))),Number.isFinite(r)||(r=Math.max(n,t)),Math.min(Math.max(t,n),r)},`clampFeasible`),d=en.GRAVITY_ITERATIONS,f=e(e=>{let t=!1;for(let n of e){let e=o.get(n)??[],r=s.get(n)??[];if(e.length===0&&r.length===0)continue;let a=e.length>0?e.reduce((e,t)=>e+(i[t]??0)+1,0)/e.length:i[n]??0,c=r.length>0?r.reduce((e,t)=>e+(i[t]??0)-1,0)/r.length:i[n]??0,l=u(n,Math.round((a+c)/2));l!==i[n]&&(i[n]=l,t=!0)}return t},`relaxOrder`);for(let e=0;e<d;e++){let e=f(c),t=f(l);if(!e&&!t)break}for(let e of c){let t=0;for(let n of o.get(e)??[])t=Math.max(t,(i[n]??0)+1);(i[e]??0)<t&&(i[e]=t)}for(let e of l){let t=s.get(e)??[];if(t.length>0){let n=Math.min(...t.map(e=>(i[e]??0)-1));(i[e]??0)>n&&(i[e]=n)}}return{layers:Wt(r,c,i),rankOf:i,dummy:new Set}}e(xn,`assignLayers_Gravity`);function Sn(e){let t=Vt(e),n=Bt(e),r=Ht(t),i=[];for(;r.length>0;){let e=[];for(let a of r){i.push(a);for(let r of n.get(a)??[])t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0&&e.push(r)}r=e.sort((e,t)=>e.localeCompare(t))}return i.length===e.nodes.length?i:null}e(Sn,`topoSortByGenerationIfAcyclic`);function Cn(t,n){let r=Lt(t),i=n?.direction===`LR`?Sn(r)??[...r.nodes].sort():Gt(r)??[...r.nodes].sort(),a=Xt(r),o=e(e=>a(e)??e,`laneOf`),s=Object.create(null),c=new Map,l=e((e,t)=>n?.ignoreCrossLaneEdges??!0?+(o(e)===o(t)):1,`edgeWeight`);for(let e of i){if(r.nodeById.get(e)?.isGroup)continue;let t=Rt(r,e),n=0;if(t.length>0)for(let r of t){let t=r.src,i=s[t]??0;n=Math.max(n,i+l(t,e))}let i=o(e),a=c.get(i)??0,u=Math.max(n,a);s[e]=u,c.set(i,u+1)}return{layers:Wt(r,i,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}e(Cn,`assignLayers_LaneAwareCompact`);function wn(t,n){let r=Lt(n),{rankOf:i}=t,a=t.layers.map(e=>[...e]),o=new Set(t.dummy?[...t.dummy]:[]),s=0,c=new Map(r.nodeById),l=e(e=>{let t=`placeholder-${s++}`,n={id:t,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(t,n),o.add(t);a.length<=e;)a.push([]);return a[e].push(t),i[t]=e,t},`addDummyAt`),u=[...r.edges].sort((e,t)=>e.id===t.id?e.src===t.src?e.dst.localeCompare(t.dst):e.src.localeCompare(t.src):e.id.localeCompare(t.id)),d=[];for(let e of u){let t=i[e.src]??0,n=i[e.dst]??0;if(n-t<=1){d.push(e);continue}let r=e.src;for(let i=t+1,a=0;i<n;i++,a++){let t=l(i);d.push({id:`${e.id}#${a}`,src:r,dst:t,weight:e.weight,ref:e.ref}),r=t}let a=n-t-2;d.push({id:`${e.id}#${Math.max(a+1,0)}`,src:r,dst:e.dst,weight:e.weight,ref:e.ref})}let f={nodes:[...r.nodes,...[...o].filter(e=>!r.nodes.includes(e))],edges:d,layout:r.layout,nodeById:c};return{layering:{layers:a,rankOf:i,dummy:o},graphWithDummies:f}}e(wn,`makeProperLayering`);function Tn(e){let t=e.length;if(t===0)return 1/0;let n=[...e].sort((e,t)=>e-t);return t%2==1?n[(t-1)/2]:.5*(n[t/2-1]+n[t/2])}e(Tn,`median`);function En(e){return e.length===0?1/0:e.reduce((e,t)=>e+t,0)/e.length}e(En,`barycenter`);function Dn(e,t,n,r){let i=new Map;for(let t of e)i.set(t,[]);for(let e of n)r===`down`?t.has(e.src)&&i.has(e.dst)&&i.get(e.dst).push(t.get(e.src)):t.has(e.dst)&&i.has(e.src)&&i.get(e.src).push(t.get(e.dst));return i}e(Dn,`neighborPositionsFor`);function On(e,t,n){let r=n.get(e)??0,i=n.get(t)??0;return r===i?e.localeCompare(t):r-i}e(On,`currentOrderTieBreak`);function kn(e,t,n){let r=new Set(e),i=new Set(t),a=Kt(e),o=Kt(t),s=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&s.push({u:a.get(e.src),v:o.get(e.dst)});return s.sort((e,t)=>e.u===t.u?e.v-t.v:e.u-t.u),qt(s.map(e=>e.v))}e(kn,`countCrossingsBetweenAdjacent`);function An(e,t,n){return[...e].sort((e,r)=>{let i=Tn(t.get(e)??[]),a=Tn(t.get(r)??[]);return i===a?On(e,r,n):isFinite(i)?isFinite(a)?i-a:-1:1})}e(An,`sortByHeuristic`);function jn(e,t,n,r,i,a){let o=Kt(e),s=Kt(t),c=Dn(t,o,n,r);if(!i||!a||a.length===0)return An(t,c,s);let l=new Map;for(let e of t){let t=i(e),n=l.get(t)??[];n.push(e),l.set(t,n)}let u=[];for(let e of a){let t=l.get(e);if(!t||t.length===0)continue;let n=An(t,c,s);u.push(...n)}let d=l.get(null);if(d&&d.length>0){let e=An(d,c,s);for(let t of e){let e=En(c.get(t)??[]),n=u.length;if(isFinite(e)){for(let[t,r]of u.entries())if(e<En(c.get(r)??[])){n=t;break}}u.splice(n,0,t)}}return u}e(jn,`reorderLayer`);function Mn(t,n,r,i,a){let o=[...n],s=new Set(t),c=new Set(n),l=i?new Set(i):null,u=r.filter(e=>s.has(e.src)&&c.has(e.dst)),d=l?r.filter(e=>c.has(e.src)&&l.has(e.dst)):void 0,f=e(e=>{let n=kn(t,e,u);return d&&i&&(n+=kn(e,i,d)),n},`crossingScore`),p=a?new Map:null;if(a&&p)for(let e of n)p.set(e,a(e));let m=!0,h=f(o);for(;m;){m=!1;for(let e=0;e+1<o.length;e++){if(p&&p.get(o[e])!==p.get(o[e+1]))continue;let t=h;[o[e],o[e+1]]=[o[e+1],o[e]];let n=f(o);n<t?(h=n,m=!0):[o[e],o[e+1]]=[o[e+1],o[e]]}}return o}e(Mn,`transposeImprove`);function Nn(e,t,n){let r=e.layers.map(e=>[...e]),i=t.edges,a=Xt(t),o=Qt(t,n?.laneOrder);for(let e=0;e<3;e++){for(let e=1;e<r.length;e++)r[e]=jn(r[e-1],r[e],i,`down`,a,o),r[e]=Mn(r[e-1],r[e],i,r[e+1],a);for(let e=r.length-2;e>=0;e--)r[e]=jn(r[e+1],r[e],i,`up`,a,o),r[e]=Mn(r[e+1],r[e],i,r[e-1],a)}return{layers:r}}e(Nn,`orderLayers`);function Pn(t,n,r){let i=r?.layerGap??tn.DEFAULT_LAYER_GAP,a=r?.nodeGap??tn.DEFAULT_NODE_GAP,o=r?.laneGap??a*2,s=r?.direction??`TB`,c=s===`LR`||s===`RL`,l=t.layers,u=Object.create(null),d=Object.create(null),f=e(e=>n.nodeById.get(e),`getNode`),p=e(e=>f(e)?.width??0,`getWidth`),m=e(e=>f(e)?.height??0,`getHeight`),h=Xt(n),g=Qt(n,r?.laneOrder),_=l.map(e=>e.reduce((e,t)=>Math.max(e,m(t)),0)),v=[];if(c)for(let e=0;e+1<l.length;e++){let t=l[e].reduce((e,t)=>Math.max(e,p(t)),0),n=l[e+1].reduce((e,t)=>Math.max(e,p(t)),0),r=_[e],a=_[e+1],o=r/2+a/2,s=(t+n)/2,c=Math.max(0,s-o-i);v.push(c)}let y=new Set;for(let e of l)for(let t of e)y.add(h(t));let b=y.has(null),x=g.filter(e=>y.has(e)),S=[...b?[null]:[],...x],C=Object.create(null);for(let e of x)C[e]=0;b&&(C.null=0);for(let e of l){let t=Object.create(null),n=[];for(let r of e){let e=h(r);e===null?n.push(r):(t[e]||=[]).push(r)}for(let[e,n]of Object.entries(t)){let t=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);C[e]=Math.max(C[e]??0,t)}if(b&&n.length){let e=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);C.null=Math.max(C.null??0,e)}}let w=new Map;{let e=S.map(e=>(e===null?C.null:C[e])??0),t=-(e.reduce((e,t)=>e+t,0)+o*Math.max(0,S.length-1))/2;for(let n=0;n<S.length;n++){let r=S[n],i=e[n]??0,a=t+i/2;w.set(r,a),t+=i,n<S.length-1&&(t+=o)}}let T=0;for(let[e,t]of l.entries()){let n=_[e]??0,r=new Map;for(let e of t){let t=h(e),n=r.get(t)??[];n.push(e),r.set(t,n)}for(let e of S){let t=r.get(e)??[];if(t.length===0)continue;let i=w.get(e);if(t.length===1){let e=t[0];u[e]=i,d[e]=T+n/2}else{let e=t.map(e=>p(e)),r=i-(e.reduce((e,t)=>e+t,0)+a*(t.length-1))/2;for(let[i,o]of t.entries()){let t=e[i];u[o]=r+t/2,d[o]=T+n/2,r+=t+a}}}let o=v[e]??0;T+=n+i+o}let E=new Map;for(let e of n.edges){let t=e.ref.id;E.has(t)||E.set(t,[]),E.get(t).push(e)}for(let[,e]of E){if(e.length===0)continue;let t=e[0].ref,r=t.start,i=t.end;if(r==null||i==null)continue;let a=Math.round(((u[r]??0)+(u[i]??0))/2),o=new Set;for(let t of e)o.add(t.src),o.add(t.dst);for(let e of o)e===r||e===i||n.nodeById.get(e)?.isDummy&&(u[e]=a)}return{x:u,y:d}}e(Pn,`assignCoordinates`);var Fn=8;function In(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}e(In,`hashString`);function Ln(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}e(Ln,`mulberry32`);function Rn(e,t){let n=[...e],r=Ln(t);for(let e=n.length-1;e>0;e--){let t=Math.floor(r()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n}e(Rn,`deterministicShuffle`);function zn(e,t){let n=0;for(let[r,i]of e.entries())n+=Math.abs(r-(t.get(i)??r));return n}e(zn,`sourceDistance`);function Bn(e,t){let n=new Map;for(let[t,r]of e.entries())n.set(r,t);let r=0;for(let{a:e,b:i,weight:a}of t){let t=n.get(e),o=n.get(i);t==null||o==null||(r+=a*Math.abs(t-o))}return r}e(Bn,`laneArrangementCost`);function Vn(e){let t=Zt(e);if(t.length<2)return[];let n=new Map(t.map((e,t)=>[e,t])),r=Xt(e),i=new Map;for(let t of e.layout.edges??[]){if(t.isLayoutOnly)continue;let a=typeof t.start==`string`?t.start:void 0,o=typeof t.end==`string`?t.end:void 0;if(!a||!o||!e.nodeById.has(a)||!e.nodeById.has(o))continue;let s=r(a),c=r(o);if(!s||!c||s===c)continue;let l=n.get(s),u=n.get(c);if(l==null||u==null)continue;let[d,f]=l<=u?[s,c]:[c,s],p=`${d}\0${f}`,m=i.get(p);m?m.weight++:i.set(p,{a:d,b:f,weight:1})}return[...i.values()]}e(Vn,`buildWeightedLaneEdges`);function Hn(e,t,n){let r=[...e],i=Bn(r,t),a=!0,o=0,s=Math.max(1,r.length);for(;a&&o<s;){a=!1,o++;for(let e=0;e+1<r.length;e++){[r[e],r[e+1]]=[r[e+1],r[e]];let n=Bn(r,t);n<i?(i=n,a=!0):[r[e],r[e+1]]=[r[e+1],r[e]]}}return{order:r,cost:i,sourceDistance:zn(r,n)}}e(Hn,`greedySwitch`);function Un(e,t){return e.cost===t.cost?e.sourceDistance<t.sourceDistance:e.cost<t.cost}e(Un,`isBetterCandidate`);function Wn(e,t,n){let r=[...t].sort((e,t)=>e.a===t.a?e.b.localeCompare(t.b):e.a.localeCompare(t.a)).map(({a:e,b:t,weight:n})=>`${e}:${t}:${n}`).join(`|`);return In(`${e.join(`|`)}#${r}#${n}`)}e(Wn,`seedForRestart`);function Gn(e,t={}){let n=Zt(e);if(n.length<2)return n;let r=Vn(e);if(r.length===0)return n;let i=new Map(n.map((e,t)=>[e,t])),a=Hn(n,r,i),o=Math.max(0,t.restarts??Fn);for(let e=0;e<o;e++){let t=Hn(Rn(n,Wn(n,r,e)),r,i);Un(t,a)&&(a=t)}return a.order}e(Gn,`optimizeTopLaneOrder`);function Kn(e,t){let n=t?.ignoreCrossLaneEdges??!0,r=t?.optimizeRanksByCrossings??!0,i=Lt(e),a=t?.automaticLaneOrdering?Gn(i,{restarts:Fn}):void 0,o=Jt(i),s=o.acyclic,{layering:c,graphWithDummies:l}=wn(n?Cn(s,{compactSingleInput:t?.compactSingleInput??en.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!0,direction:t?.direction}):xn(s,{compactSingleInput:t?.compactSingleInput??en.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:r}),s),u=Nn(c,l,{laneOrder:a}),d=Pn(u,l,{layerGap:t?.layerGap,nodeGap:t?.nodeGap,direction:t?.direction,laneOrder:a});return{acyclic:s,reversed:o.reversed,layering:c,ordered:u,coordinates:d}}e(Kn,`sugiyamaLayout`);var $=$t.EPSILON,qn=8,Jn=15,Yn=15,Xn=25,Zn=20,Qn=10;function $n(e,t,n){let r=e.x??0,i=e.y??0,a=t.x-r,o=t.y-i,s=Math.abs(a),c=Math.abs(o);return s<$&&c<$?n:c>$&&c*3>=s?o>0?`bottom`:`top`:s>$?a>0?`right`:`left`:n}e($n,`chooseOrthogonalSide`);function er(e,t){return Math.abs(e.to-t.from)<$||Math.abs(e.to-t.to)<$?e.to:e.from}e(er,`sharedLineEndpointCoord`);function tr(e,t){return e.orient===`vertical`?{x:e.coord,y:t}:{x:t,y:e.coord}}e(tr,`pointOnLine`);function nr(t,n){let r=t.nodes??[],i=t.edges??[],a=[];for(let e of i)e.isLayoutOnly||a.push({...e,__originalEdge:e});let o=new Map,s=new Map,c=[],l=n===`LR`;for(let e of r)o.set(e.id,e);let u=r.filter(e=>e.isGroup&&!e.parentId);for(let t of u){let n={id:t.id},i=e(e=>{s.set(e.id,n),r.filter(t=>t.parentId===e.id).forEach(i)},`assignLane`);i(t)}let d=r.filter(e=>!e.isGroup&&!e.isEdgeLabel).map(e=>{let t=e.width??10,n=e.height??10,r=e.x??0,i=e.y??0,a=qn;return{nodeId:e.id,minX:r-t/2-a,maxX:r+t/2+a,minY:i-n/2-a,maxY:i+n/2+a,visualXHalfExtent:l?n/2+a:t/2+a}}),f=e((e,t,n,r)=>{let i=c.find(n=>n.orientation===e&&Math.abs(n.coord-t)<1);return i||(i={id:`pipe-${e}-${t.toFixed(0)}`,orientation:e,coord:t,spanMin:n,spanMax:r,tracks:[]},c.push(i)),i.spanMin=Math.min(i.spanMin,n),i.spanMax=Math.max(i.spanMax,r),i},`getOrAddPipe`),p=e((e,t)=>{let n=e.width??10,r=e.height??10,i=e.x??0,a=e.y??0;switch(t){case`top`:return{x:i,y:a-r/2};case`bottom`:return{x:i,y:a+r/2};case`left`:return{x:i-n/2,y:a};case`right`:return{x:i+n/2,y:a}}},`portForSide`),m=e((e,t,n)=>p(e,$n(e,t,n?`bottom`:`top`)),`getOrthogonalPort`),h=[],g=[],_=new Set,v=1e3,y=e((e,t,n)=>{if(h.length===0)return 0;let r=Math.abs(t.y-n.y)<$,i=Math.abs(t.x-n.x)<$;if(!r&&!i)return 0;let a=0;if(r){let r=t.y,i=Math.min(t.x,n.x)-$,o=Math.max(t.x,n.x)+$;if(o<=i)return 0;for(let t of h)t.edgeIndex===e||t.orientation!==`vertical`||t.pipe.coord<i||t.pipe.coord>o||t.from-$<=r&&t.to+$>=r&&(a+=v)}else if(i){let r=t.x,i=Math.min(t.y,n.y)-$,o=Math.max(t.y,n.y)+$;if(o<=i)return 0;for(let t of h)t.edgeIndex===e||t.orientation!==`horizontal`||t.pipe.coord<i||t.pipe.coord>o||t.from-$<=r&&t.to+$>=r&&(a+=v)}return a},`crossingPenalty`),b=a.map((e,t)=>{if(!e.start||!e.end)return{idx:t,crossLane:0,dx:0,dy:0};let n=o.get(e.start),r=o.get(e.end),i=s.get(e.start),a=s.get(e.end);return{idx:t,crossLane:i&&a&&i.id!==a.id?1:0,dx:n&&r?Math.abs((r.x??0)-(n.x??0)):0,dy:n&&r?Math.abs((r.y??0)-(n.y??0)):0}}).sort((e,t)=>{if(e.crossLane!==t.crossLane)return t.crossLane-e.crossLane;let n=e.dx+e.dy,r=t.dx+t.dy;return Math.abs(n-r)>1?n-r:e.idx-t.idx}).map(e=>e.idx),x=e((e,t,n,r)=>{let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return!!d.find(c=>n&&c.nodeId===n||r&&c.nodeId===r?!1:Math.abs(e.x-t.x)>$?c.minY<e.y&&c.maxY>e.y&&c.maxX>i&&c.minX<a:c.minX<e.x&&c.maxX>e.x&&c.maxY>o&&c.minY<s)},`isSegmentBlocked`),S=new Map,C=new Map;for(let e of a)!e.start||!e.end||e.start===e.end||(C.set(e.start,(C.get(e.start)??0)+1),C.set(e.end,(C.get(e.end)??0)+1));let w=e((e,t)=>$n(e,t,`bottom`),`determineSide`),T=new Map;for(let[e,t]of a.entries()){if(!t.start||!t.end||t.start===t.end||t.points&&t.points.length>0)continue;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)continue;let i=(r.x??0)-(n.x??0),a=(r.y??0)-(n.y??0);T.set(e,{edgeIdx:e,srcId:t.start,dstId:t.end,srcSide:w(n,{x:r.x??0,y:r.y??0}),dstSide:w(r,{x:n.x??0,y:n.y??0}),absDx:Math.abs(i),absDy:Math.abs(a),dxSign:Math.sign(i),dySign:Math.sign(a)})}let E=e(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.absDx===0?1/0:e.absDy/e.absDx:e.absDy===0?1/0:e.absDx/e.absDy,`preferenceStrength`),D=e(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.dxSign>=0?`right`:`left`:e.dySign>=0?`bottom`:`top`,`secondarySide`),O=new Map;for(let e of T.values()){let t=`${e.srcId}:${e.srcSide}`;O.has(t)||O.set(t,[]),O.get(t).push(e)}let k=new Map,A=e((e,t)=>`${e}:${t}`,`loadKey`);for(let e of T.values())k.set(A(e.srcId,e.srcSide),(k.get(A(e.srcId,e.srcSide))??0)+1),k.set(A(e.dstId,e.dstSide),(k.get(A(e.dstId,e.dstSide))??0)+1);for(let e of O.values())if(!(e.length<2)){e.sort((e,t)=>{let n=E(e),r=E(t);return Math.abs(n-r)>1e-9?r-n:e.edgeIdx-t.edgeIdx});for(let t=1;t<e.length;t++){let n=e[t],r=D(n),i=k.get(A(n.srcId,n.srcSide))??0,a=k.get(A(n.srcId,r))??0;a>=i||(k.set(A(n.srcId,n.srcSide),i-1),k.set(A(n.srcId,r),a+1),n.srcSide=r)}}let j=e(e=>{let t=e?.shape;return t===`question`||t===`diamond`},`isDiamondNode`),ee=new Map;for(let e of T.values())ee.has(e.dstId)||ee.set(e.dstId,new Set),ee.get(e.dstId).add(e.dstSide);for(let e of T.values()){if(!j(o.get(e.srcId)))continue;let t=ee.get(e.srcId);if(!t?.has(e.srcSide))continue;let n=D(e);if(t.has(n)||(k.get(A(e.srcId,n))??0)>0)continue;let r=k.get(A(e.srcId,e.srcSide))??0;k.set(A(e.srcId,e.srcSide),Math.max(0,r-1)),k.set(A(e.srcId,n),1),e.srcSide=n}for(let e of T.values()){let{edgeIdx:t,srcId:n,dstId:r,srcSide:i,dstSide:a}=e,s=o.get(n),c=o.get(r),l=`${n}:${i}:src`,u=i===`top`||i===`bottom`?c.x??0:c.y??0;S.has(l)||S.set(l,[]),S.get(l).push({edgeIdx:t,oppositeCoord:u});let d=`${r}:${a}:dst`,f=a===`top`||a===`bottom`?s.x??0:s.y??0;S.has(d)||S.set(d,[]),S.get(d).push({edgeIdx:t,oppositeCoord:f})}let te=new Map;for(let[e,t]of S){if(t.length<2)continue;t.sort((e,t)=>e.oppositeCoord-t.oppositeCoord);let n=e.split(`:`),r=n.slice(0,-2).join(`:`),i=n[n.length-2],a=n[n.length-1],s=o.get(r);if(!s)continue;let c=i===`left`||i===`right`?s.height??10:s.width??10,l=s.shape,u=l===`question`||l===`diamond`?c*.3:c,d=Math.min(20,Math.max(8,u/(t.length+1))),f=-(d*(t.length-1))/2;for(let[e,n]of t.entries()){let t=f+e*d,r=`${n.edgeIdx}:${a}`;te.set(r,t)}}let M=e(e=>!!a[e]?.labelNodeId,`edgeHasLabelNode`),ne=e((e,t)=>e?(S.get(`${e}:${t}:src`)??[]).some(({edgeIdx:e})=>M(e))||(S.get(`${e}:${t}:dst`)??[]).some(({edgeIdx:e})=>M(e)):!1,`faceHasLabelNode`),N=e((e,t,n)=>t===`top`||t===`bottom`?{x:e.x+n,y:e.y}:{x:e.x,y:e.y+n},`applyPortOffset`),P=e((e,t,n)=>{let r=T.get(e),i={x:n.x??0,y:n.y??0},a={x:t.x??0,y:t.y??0},o=r?.srcSide??w(t,i),s=r?.dstSide??w(n,a),c=r?p(t,r.srcSide):m(t,i,!0),l=r?p(n,r.dstSide):m(n,a,!1),u=te.get(`${e}:src`),d=te.get(`${e}:dst`);return u!==void 0&&(c=N(c,o,u)),d!==void 0&&(l=N(l,s,d)),{pSrcPort:c,pDstPort:l,srcSide:o,dstSide:s}},`portsForEdge`);for(let t of b){let n=a[t];if(g[t]=[],!n.start||!n.end||n.points&&n.points.length>0||n.start===n.end)continue;let r=o.get(n.start),i=o.get(n.end);if(!r||!i)continue;let{pSrcPort:s,pDstPort:u,srcSide:p,dstSide:m}=P(t,r,i),v={...s},b={...u},w=p===`top`||p===`bottom`,T=m===`top`||m===`bottom`;w?v.y=s.y>(r.y??0)?s.y+Zn:s.y-Zn:v.x=s.x>(r.x??0)?s.x+Zn:s.x-Zn,T?b.y=u.y>(i.y??0)?u.y+Zn:u.y-Zn:b.x=u.x>(i.x??0)?u.x+Zn:u.x-Zn;let E=e((e,t)=>{for(let n of d)if(!t.includes(n.nodeId)&&e.x>n.minX&&e.x<n.maxX&&e.y>n.minY&&e.y<n.maxY)return{inside:!0,obstacle:n};return{inside:!1}},`isPointInObstacle`),D=e((e,t,n,r,i)=>{if(i){let i=e.y>(t.y??0);return{x:(n.x??0)>=e.x?r.maxX+Jn:r.minX-Jn,y:i?r.maxY+Yn:r.minY-Yn,leavesPositiveSide:i}}let a=e.x>(t.x??0),o=(n.y??0)>=e.y;return{x:a?r.maxX+Jn:r.minX-Jn,y:o?r.maxY+Yn:r.minY-Yn,leavesPositiveSide:a}},`obstacleDetour`),O=[],k=[n.start,n.end],A=E(v,k);if(A.inside&&A.obstacle){let e=A.obstacle;if(w){let t=D(s,r,i,e,!0);v.x=t.x,v.y=t.y;let n=t.leavesPositiveSide?Math.min(e.minY-2,s.y+Zn):Math.max(e.maxY+2,s.y-Zn);O=[{x:s.x,y:n},{x:t.x,y:n},{x:t.x,y:t.y}]}else{let t=D(s,r,i,e,!1),n=t.leavesPositiveSide?Math.min(e.minX-2,s.x+Zn):Math.max(e.maxX+2,s.x-Zn);v.x=t.x,v.y=t.y,O=[{x:n,y:s.y},{x:n,y:t.y},{x:t.x,y:t.y}]}}let j=[],ee=E(b,k);if(ee.inside&&ee.obstacle){let e=ee.obstacle;if(T){let t=D(u,i,r,e,!0);b.x=t.x,b.y=t.y,j=[{x:t.x,y:t.y},{x:u.x,y:t.y}]}else{let t=D(u,i,r,e,!1);b.x=t.x,b.y=t.y,j=[{x:t.x,y:t.y},{x:t.x,y:u.y}]}}if(O.length===0&&j.length===0){let e=Jn,r=Math.abs(v.x-b.x)<e,i=Math.abs(v.y-b.y)<e,a=te.get(`${t}:src`)!==void 0||te.get(`${t}:dst`)!==void 0,o=(S.get(`${n.start??``}:${p}:src`)?.length??0)+(S.get(`${n.start??``}:${p}:dst`)?.length??0),c=(S.get(`${n.end??``}:${m}:src`)?.length??0)+(S.get(`${n.end??``}:${m}:dst`)?.length??0),l=o>1||c>1,d=C.get(n.start??``)??0,f=C.get(n.end??``)??0,g=o>1&&ne(n.start,p)||c>1&&ne(n.end,m);if((r||i)&&!a&&(!l||l&&!g&&(o<=1||d<=2)&&(c<=1||f<=2))&&!x(s,u,n.start,n.end)){n.points=[{...s},{...v},{...b},{...u}],_.add(t);let e=i?`horizontal`:`vertical`,r=i?s.y:s.x,a=i?Math.min(s.x,u.x):Math.min(s.y,u.y),o=i?Math.max(s.x,u.x):Math.max(s.y,u.y),c={id:`fast-path-${e}-${r.toFixed(0)}-${t}`,orientation:e,coord:r,spanMin:a,spanMax:o,tracks:[]};h.push({edgeIndex:t,segmentIndex:0,orientation:e,pipe:c,trackIndex:0,from:a,to:o});continue}}v.x=f(`vertical`,v.x,v.y,v.y).coord,b.x=f(`vertical`,b.x,b.y,b.y).coord;let M=Math.min(v.x,b.x)-50,N=Math.max(v.x,b.x)+50,F=Math.min(v.y,b.y)-50,I=Math.max(v.y,b.y)+50;for(let e of d){let t=Math.min(v.x,b.x),n=Math.max(v.x,b.x),r=Math.min(v.y,b.y),i=Math.max(v.y,b.y);e.minX<n&&e.maxX>t&&e.minY<i&&e.maxY>r&&(M=Math.min(M,e.minX-Xn),N=Math.max(N,e.maxX+Xn),F=Math.min(F,e.minY-Xn),I=Math.max(I,e.maxY+Xn))}for(let e of d){if(e.maxX<M||e.minX>N||e.maxY<F||e.minY>I)continue;let t=Jn;f(`horizontal`,e.minY-t,M,N),f(`horizontal`,e.maxY+t,M,N);let n=Yn;f(`vertical`,e.minX-n,F,I),f(`vertical`,e.maxX+n,F,I)}f(`horizontal`,v.y,M,N),f(`horizontal`,b.y,M,N);let L=c.filter(e=>e.orientation===`horizontal`&&e.coord>=F&&e.coord<=I),R=c.filter(e=>e.orientation===`vertical`&&e.coord>=M&&e.coord<=N),z=e((e,t)=>`${e.toFixed(1)},${t.toFixed(1)}`,`getKey`),B=z(v.x,v.y),re=z(b.x,b.y),V=new Map,H=new Map,ie=new Map,ae=new Set,U=[];V.set(B,0),ie.set(B,`n`),U.push({key:B,f:Math.hypot(b.x-v.x,b.y-v.y),pt:v}),ae.add(B);let W=[],G=e((e,t)=>x(e,t,n.start,n.end),`checkSegmentBlocked`),oe={x:b.x,y:v.y},se=G(v,oe),K=G(oe,b),ce=se||K,le={x:v.x,y:b.y},ue=G(v,le),de=G(le,b);if(ce?ue||de||(W=Math.abs(v.x-b.x)<$?[v,b]:[v,le,b]):W=Math.abs(v.y-b.y)<$||Math.abs(v.x-b.x)<$?[v,b]:[v,oe,b],W.length===0)for(;U.length>0;){U.sort((e,t)=>e.f-t.f);let e=U.shift();if(ae.delete(e.key),e.key===re){let e=re,t=b;for(W=[t];H.has(e);){let n=H.get(e);W.unshift(n),t=n,e=z(n.x,n.y)}break}let r=e.pt.x,i=e.pt.y,a=R.sort((e,t)=>e.coord-t.coord),o=a.findIndex(e=>Math.abs(e.coord-r)<1),s=L.sort((e,t)=>e.coord-t.coord),c=s.findIndex(e=>Math.abs(e.coord-i)<1),l=[];o>0&&l.push({x:a[o-1].coord,y:i}),o>=0&&o<a.length-1&&l.push({x:a[o+1].coord,y:i}),c>0&&l.push({x:r,y:s[c-1].coord}),c>=0&&c<s.length-1&&l.push({x:r,y:s[c+1].coord});for(let a of l){let o=Math.min(r,a.x),s=Math.max(r,a.x),c=Math.min(i,a.y),l=Math.max(i,a.y);if(d.some(e=>e.nodeId===n.start||e.nodeId===n.end?!1:o===s?e.minX<r&&e.maxX>r&&e.maxY>c&&e.minY<l:e.minY<i&&e.maxY>i&&e.maxX>o&&e.minX<s))continue;let u=z(a.x,a.y),f=Math.abs(a.x-r)+Math.abs(a.y-i),p=y(t,e.pt,a),m=0,h=b.x-v.x,g=b.y-v.y,_=a.x-r,x=a.y-i;(g>10&&x<-5||g<-10&&x>5)&&(m=Math.abs(x)*100),(h>10&&_<-5||h<-10&&_>5)&&(m+=Math.abs(_)*50);let S=0,C=ie.get(e.key)??`n`,w=Math.abs(_)>$?`h`:`v`;C!==`n`&&C!==w&&(S=50);let T=f+p+m+S,E=(V.get(e.key)??1/0)+T,D=Math.abs(b.x-a.x)+Math.abs(b.y-a.y);if(E<(V.get(u)??1/0))if(H.set(u,e.pt),V.set(u,E),ie.set(u,w),!ae.has(u))U.push({key:u,f:E+D,pt:a}),ae.add(u);else{let e=U.findIndex(e=>e.key===u);e!==-1&&(U[e].f=E+D)}}}if(W.length===0&&(W=[v,{x:v.x,y:b.y},b]),W.length>4){let t=W[0],n=W[W.length-1],r=Math.min(t.x,n.x),i=Math.max(t.x,n.x),a=Math.min(t.y,n.y),o=Math.max(t.y,n.y);for(let e of W)r=Math.min(r,e.x),i=Math.max(i,e.x),a=Math.min(a,e.y),o=Math.max(o,e.y);let s=i>Math.max(t.x,n.x),c=r<Math.min(t.x,n.x);if(l){let e=Yn;if(s){let r=Math.max(t.x,n.x),a=Math.min(t.y,n.y),o=Math.max(t.y,n.y),s=d.filter(e=>e.minX<r&&e.maxX>r&&e.minY<o&&e.maxY>a);if(s.length>0){let r=Math.max(t.x,n.x);for(let t of s){let n=(t.minX+t.maxX)/2;if(t.visualXHalfExtent===void 0||isNaN(t.visualXHalfExtent))continue;let i=n+t.visualXHalfExtent+e;r=Math.max(r,i)}isNaN(r)||(i=r)}}if(c){let i=d.filter(r=>r.minX<Math.min(t.x,n.x)+e&&r.minY<Math.max(t.y,n.y)&&r.maxY>Math.min(t.y,n.y));if(i.length>0){let a=Math.min(t.x,n.x);for(let t of i){let n=(t.minX+t.maxX)/2-t.visualXHalfExtent-e;a=Math.min(a,n)}r=a}}}let u=e(e=>{let r=n.y>t.y,i=d.filter(e=>{let r=Math.min(t.x,n.x)<e.maxX&&Math.max(t.x,n.x)>e.minX,i=Math.min(t.y,n.y)<e.maxY&&Math.max(t.y,n.y)>e.minY;return r&&i}),a=i;if(l&&i.length>0){let t=i.filter(t=>t.minX<e&&t.maxX>e);t.length>0&&(a=t)}if(a.length===0)return n.y;let o=Jn;if(r){let e=Math.max(...a.map(e=>e.maxY))+o;if(e<n.y-$)return e}else{let e=Math.min(...a.map(e=>e.minY))-o;if(e>n.y+$)return e}return n.y},`findBestReturnY`),f=e(e=>{let r=u(e),i={x:e,y:t.y},a={x:e,y:r},o={x:n.x,y:r},s=G(t,i),c=G(i,a),l=G(a,o),d=r===n.y?!1:G(o,n);return!s&&!c&&!l&&!d?Math.abs(r-n.y)<$?[t,i,a,n]:[t,i,a,o,n]:null},`trySimplifyWithDetourX`),p=s&&!c?f(i):c&&!s?f(r):null;p&&(W=p)}let q=[s,...O,...W,...j.reverse(),u];if(q.length>=3){let e=q[q.length-1],t=q[q.length-2],n=q[q.length-3],r=Math.abs(n.y-t.y)<$&&Math.abs(t.y-e.y)<$,i=Math.abs(n.x-t.x)<$&&Math.abs(t.x-e.x)<$;if(r){let r=Math.sign(t.x-n.x),i=Math.sign(e.x-n.x);r!==0&&r===i&&Math.abs(t.x-n.x)>Math.abs(e.x-n.x)&&q.splice(-2,1)}else if(i){let r=Math.sign(t.y-n.y),i=Math.sign(e.y-n.y);r!==0&&r===i&&Math.abs(t.y-n.y)>Math.abs(e.y-n.y)&&q.splice(-2,1)}}let fe=[q[0]];for(let e=1;e<q.length-1;e++){if(e===1){fe.push(q[e]);continue}let t=fe[fe.length-1],n=q[e],r=q[e+1];if(Math.abs(t.y-n.y)<$&&Math.abs(n.y-r.y)<$){if(n.x>t.x!=r.x>n.x){fe.push(n);continue}continue}if(Math.abs(t.x-n.x)<$&&Math.abs(n.x-r.x)<$){if(n.y>t.y!=r.y>n.y){fe.push(n);continue}continue}fe.push(n)}fe.push(q[q.length-1]);for(let e=0;e<fe.length-1;e++){let n=fe[e],r=fe[e+1],i=Math.abs(n.x-r.x)<$?`vertical`:`horizontal`,a=i===`vertical`?n.x:n.y,o=i===`vertical`?Math.min(n.y,r.y):Math.min(n.x,r.x),s=i===`vertical`?Math.max(n.y,r.y):Math.max(n.x,r.x),c=f(i,a,o,s),l={edgeIndex:t,segmentIndex:e,orientation:i,pipe:c,trackIndex:0,from:o,to:s};h.push(l),g[t].push(h.length-1),c.tracks[0]||(c.tracks[0]={index:0,coord:c.coord,segments:[]}),c.tracks[0].segments.push({edgeIndex:t,segmentIndex:e,from:o,to:s})}}let F=e((e,t)=>e.from<t.to&&t.from<e.to,`segmentsOverlap`),I=e((e,t,n,r)=>{let i=!r.segments.some(n=>(n.edgeIndex!==t.edgeIndex||n.segmentIndex!==t.segmentIndex)&&F(n,e)),a=!n.segments.some(n=>(n.edgeIndex!==e.edgeIndex||n.segmentIndex!==e.segmentIndex)&&F(n,t));return i&&a?(e.trackIndex=r.index,t.trackIndex=n.index,n.segments=[...n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),{edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,from:t.from,to:t.to}],r.segments=[...r.segments.filter(e=>e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex),{edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to}],!0):!1},`trySwapSegmentsAcrossTracks`),L=e(e=>{let t=e.tracks.length;return e.tracks[t]={index:t,coord:e.coord,segments:[]},t},`createNewTrack`),R=e((e,t)=>{let n=e.pipe.tracks[e.trackIndex];n.segments=n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),e.trackIndex=t,e.pipe.tracks[t].segments.push({edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to})},`moveSegmentToTrack`),z=e((e,t)=>{let n=g[e.edgeIndex];for(let r of n){let n=h[r];n.pipe===e.pipe&&R(n,t)}},`moveSegmentChainToTrack`),B=e(e=>{let t=g[e.edgeIndex],n=t.indexOf(h.indexOf(e)),r=[];return n>0&&r.push(h[t[n-1]]),n<t.length-1&&r.push(h[t[n+1]]),r},`getAdjacentSegmentsAlongEdge`),re=e((e,t)=>{if(e.orientation===t.orientation)return!1;let n=e.orientation===`horizontal`?e:t,r=e.orientation===`horizontal`?t:e;return r.pipe.coord>n.from&&r.pipe.coord<n.to&&n.pipe.coord>r.from&&n.pipe.coord<r.to},`haveAnyCrossing`),V=e((e,t)=>{for(let n of e.tracks)if(!n.segments.some(e=>(e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex)&&F(e,t)))return n.index;return-1},`findAvailableTrack`),H=e((e,t)=>{if(e.trackIndex===t.trackIndex)return F(e,t);let n=B(e),r=B(t);return n.some(e=>r.some(t=>re(e,t)))},`segmentsConflict`),ie=e((e,t,n)=>{if(I(e,t,e.pipe.tracks[e.trackIndex],t.pipe.tracks[t.trackIndex]))return;let r=V(e.pipe,t);n(t,r===-1?L(e.pipe):r)},`resolveTrackConflict`),ae=e(e=>{let t=0;for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++){let i=e[n],a=e[r];i.pipe===a.pipe&&H(i,a)&&(t++,ie(i,a,z))}return t},`resolveHandleConflicts`),U=new Map,W=e(e=>{if(U.has(e))return U.get(e);let t=g[e];if(t.length===0){let t={dest:0,deviation:0,base:0,delta:0};return U.set(e,t),t}let n=h[t[0]].pipe.coord,r=n;for(let e=1;e<t.length;e++){let i=h[t[e]];if(i.orientation===`horizontal`){let e=i.from,t=i.to;r=Math.abs(e-n)>Math.abs(t-n)?e:t;break}}let i=Math.abs(r-n),a={dest:r,deviation:i,base:n,delta:r-n};return U.set(e,a),a},`getDestInfo`),G=e(()=>{let t=0,n=new Map;for(let[e,t]of a.entries())g[e].length!==0&&t.start&&(n.has(t.start)||n.set(t.start,[]),n.get(t.start).push(e));let r=e(e=>{let t=a[e];if(!t.start||!t.end)return 0;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)return 0;let i=(r.x??0)-(n.x??0),s=(r.y??0)-(n.y??0);return Math.abs(i)+Math.abs(s)},`getEdgeDistance`);for(let e of n.values()){e.sort((e,t)=>{let n=W(e),i=W(t);if(Math.abs(n.deviation-i.deviation)>1)return n.deviation-i.deviation;if(Math.abs(n.dest-i.dest)>1)return n.dest-i.dest;let a=r(e),o=r(t);if(Math.abs(a-o)>1)return o-a;let s=g[e].length,c=g[t].length;if(s!==c)return s-c;if(s===1){let n=g[e][0],r=g[t][0];if(h[n]&&h[r]){let e=h[n],t=h[r],i=Math.abs(e.to-e.from),a=Math.abs(t.to-t.from);if(Math.abs(i-a)>1)return i-a}}return 0});let n=e.map(e=>h[g[e][0]]);t+=ae(n)}return t},`fixSourceHandleCrossings`),oe=e(()=>{let t=0,n=new Map;for(let[e,t]of a.entries())g[e].length!==0&&t.end&&(n.has(t.end)||n.set(t.end,[]),n.get(t.end).push(e));for(let r of n.values()){r.sort((t,n)=>{let r=e(e=>{let t=g[e];if(t.length<2)return 0;let n=h[t[t.length-2]];return Math.abs(n.to-n.from)},`getDist`),i=r(t),a=r(n);return Math.abs(i-a)>.1?i-a:t-n});let n=r.map(e=>h[g[e][g[e].length-1]]);t+=ae(n)}return t},`fixTargetHandleCrossings`),se=e(()=>{let e=0;for(let t of c){let n=[];for(let e of t.tracks)for(let t of e.segments){let e=g[t.edgeIndex].find(e=>h[e].segmentIndex===t.segmentIndex);e!==void 0&&n.push(h[e])}n.sort((e,t)=>e.edgeIndex-t.edgeIndex||e.segmentIndex-t.segmentIndex);for(let t=0;t<n.length;t++)for(let r=t+1;r<n.length;r++){let i=n[t],a=n[r];H(i,a)&&(e++,ie(i,a,R))}}return e},`fixPipeCrossings`),K=0;for(;K<10;){let e=0;if(e+=G(),e+=oe(),e+=se(),e===0)break;K++}let ce=new Map;for(let t of c){let n=[];t.tracks.forEach(e=>{e.segments.forEach(t=>{n.push({edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,trackIndex:e.index,from:t.from,to:t.to})})}),n.sort((e,t)=>e.from-t.from);let r=[];if(n.length>0){let e=[n[0]],t=n[0].to;for(let i=1;i<n.length;i++){let a=n[i];a.from<t?(e.push(a),t=Math.max(t,a.to)):(r.push(e),e=[a],t=a.to)}r.push(e)}for(let n of r){let r=new Set;n.forEach(e=>r.add(e.trackIndex));let i=new Map;n.forEach(e=>{let t=W(e.edgeIndex);i.set(e.trackIndex,(i.get(e.trackIndex)??0)+t.delta)});let a=[...r].filter(e=>(i.get(e)??0)<-1),o=[...r].filter(e=>(i.get(e)??0)>1),s=[...r].filter(e=>Math.abs(i.get(e)??0)<=1);a.sort((e,t)=>(i.get(t)??0)-(i.get(e)??0)),o.sort((e,t)=>(i.get(e)??0)-(i.get(t)??0));let c=e((e,r)=>{n.filter(t=>t.trackIndex===e).forEach(e=>{let n=_.has(e.edgeIndex)?t.coord:r;ce.set(`${e.edgeIndex}-${e.segmentIndex}`,n)})},`assignCoord`),l=0;for(let e of a)l++,c(e,t.coord-l*Qn);if(s.length===0&&r.size>0){let e=[...r].sort((e,t)=>Math.abs(i.get(e)??0)-Math.abs(i.get(t)??0))[0],t=a.indexOf(e);t!==-1&&a.splice(t,1);let n=o.indexOf(e);n!==-1&&o.splice(n,1),s.push(e)}let u=0;for(let e of s){if(u===0)c(e,t.coord);else{let n=u%2==1?1:-1,r=Math.ceil(u/2);c(e,t.coord+n*r*Qn*.5)}u++}let d=0;for(let e of o)d++,c(e,t.coord+d*Qn)}}for(let[e,t]of a.entries()){let n=g[e]??[];if(n.length===0)continue;let r=[],{pSrcPort:i,pDstPort:a}=P(e,o.get(t.start),o.get(t.end)),s=n.map(e=>{let t=h[e],n=ce.get(`${t.edgeIndex}-${t.segmentIndex}`)??t.pipe.coord;return{orient:t.orientation,coord:n,from:t.from,to:t.to}});r.push(i);for(let e=0;e<s.length;e++){let t=s[e],n=r[r.length-1],i=t.orient===`vertical`?n.y:n.x,a=t.orient===`vertical`?n.x:n.y,o=s[e+1],c=e<s.length-1;if(Math.abs(a-t.coord)>$&&r.push(tr(t,i)),c&&o.orient===t.orient)if(Math.abs(t.coord-o.coord)>$){let e=t.orient===`vertical`?(i+o.from)/2:er(t,o);r.push(tr(t,e),tr(o,e))}else (e===0||e===s.length-2)&&r.push(tr(t,er(t,o)));else if(c)r.push(tr(t,o.coord));else{let e=Math.abs(t.from-i)<Math.abs(t.to-i)?t.to:t.from;r.push(tr(t,e))}}let c=r[r.length-1];(Math.abs(c.x-a.x)>$||Math.abs(c.y-a.y)>$)&&r.push(a);let l=[];r.length>0&&l.push(r[0]);for(let e=1;e<r.length;e++){let t=r[e],n=l[l.length-1];(Math.abs(t.x-n.x)>$||Math.abs(t.y-n.y)>$)&&l.push(t)}t.points=l}for(let e of a){let t=e.__originalEdge;t&&e.points&&(t.points=e.points)}t.edges=(t.edges??[]).filter(e=>!e.isLayoutOnly);let le=e((e,t)=>{let n=t.x??0,r=t.y??0,i=t.width??0,a=t.height??0;if(i<=0||a<=0)return e;let o=n-i/2,s=n+i/2,c=r-a/2,l=r+a/2;if(e.x<o||e.x>s||e.y<c||e.y>l)return e;let u=e.x-o,d=s-e.x,f=e.y-c,p=l-e.y,m=Math.min(u,d,f,p);return m===u?{x:o,y:e.y}:m===d?{x:s,y:e.y}:m===f?{x:e.x,y:c}:{x:e.x,y:l}},`nodeBoundaryClamp`);for(let e of t.edges){let t=e.points;if(!t||t.length<2)continue;let n=e.start,r=e.end,i=n?o.get(n):void 0,a=r?o.get(r):void 0;i&&(t[0]=le(t[0],i)),a&&(t[t.length-1]=le(t[t.length-1],a))}return t}e(nr,`routeEdgesOrthogonal`);function rr(e){return e.direction??`TB`}e(rr,`getSwimlaneDirection`);function ir(e){let t=A(e),n=e.config.flowchart?.nodeSpacing??40,r=e.config.flowchart?.rankSpacing??100,i=e.config.swimlane?.ignoreCrossLaneEdges??!0,a=e.config.swimlane?.optimizeRanksByCrossings??!0,o=e.config.swimlane?.automaticLaneOrdering??!1,s=rr(e),{ordered:c,coordinates:l}=Kn(t,{nodeGap:n,layerGap:r,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});j(t,c,l,{nodeGap:n,layerGap:r});for(let t of e.edges??[])delete t.points;nr(e,s);for(let t of e.edges??[])(!t.curve||t.curve===`basis`)&&(t.curve=`rounded`);return It(e,s),Ft(e),s}e(ir,`runSwimlaneLayoutCore`);function ar(e){k(e);let t=te(e);e.nodes=t.nodes,e.edges=t.edges}e(ar,`prepareSwimlaneLayout`);var or=r({prepareLayout:ar,runLayoutCore:ir,afterPaint:C});export{or as render};
@@ -0,0 +1,8 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-DlLjK0OJ.js";import"./chunk-X3CZISLH-C1s9nTVF.js";import"./chunk-DU6HZSFF-CqT8wcBs.js";import"./chunk-PWAF6VOD-B1cuaLs-.js";import"./chunk-75Z2AOVW-BLiFJXcr.js";import"./chunk-GMAD6QVW-BJLz4nC-.js";import"./chunk-P2QGCYS3-B-9ymCdr.js";import"./chunk-4HAMMTFA-BzeIXjef.js";import"./chunk-GVQU2GXP-BlVn1fMW.js";import"./chunk-OSK3NFVY-CrXjNywV.js";import"./chunk-F27PBJKO-Ccrogyxp.js";import"./chunk-XXDRQBXY-DEwmqeYc.js";import"./chunk-POPQ4Y6H-Df0_Odad.js";import"./chunk-L3NEJ4N5-FGXu31jw.js";import"./chunk-LQGUR6SS-qUTD5FMI.js";import"./chunk-LNGE3PJU-Dyjtq0ks.js";import{r as t,t as n}from"./chunk-3NF5O7KM-DXOprKA_.js";var r=n({defaultLayout:`swimlane`,styles:e(e=>`${t(e)}
2
+ .swimlane.cluster rect {
3
+ stroke: ${e.clusterBorder} !important;
4
+ }
5
+ [data-look="neo"].cluster rect {
6
+ filter: none;
7
+ }
8
+ `,`getStyles`)});export{r as diagram};