dominds 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/LICENSE +157 -0
  2. package/README.md +250 -0
  3. package/README.zh.md +161 -0
  4. package/dist/access-control.js +253 -0
  5. package/dist/cli/create.js +263 -0
  6. package/dist/cli/read.js +84 -0
  7. package/dist/cli/tui.js +199 -0
  8. package/dist/cli/webui.js +169 -0
  9. package/dist/cli.js +227 -0
  10. package/dist/dialog-factory.js +53 -0
  11. package/dist/dialog-global-registry.js +68 -0
  12. package/dist/dialog-instance-registry.js +78 -0
  13. package/dist/dialog-run-state.js +198 -0
  14. package/dist/dialog.js +1024 -0
  15. package/dist/evt-registry.js +103 -0
  16. package/dist/index.js +8 -0
  17. package/dist/llm/client.js +69 -0
  18. package/dist/llm/defaults.yaml +386 -0
  19. package/dist/llm/driver.js +3214 -0
  20. package/dist/llm/gen/anthropic.js +611 -0
  21. package/dist/llm/gen/codex.js +375 -0
  22. package/dist/llm/gen/mock.js +326 -0
  23. package/dist/llm/gen/openai.js +470 -0
  24. package/dist/llm/gen/registry.js +26 -0
  25. package/dist/llm/gen.js +2 -0
  26. package/dist/llm/tools-projection.js +37 -0
  27. package/dist/log.js +228 -0
  28. package/dist/mcp/config.js +230 -0
  29. package/dist/mcp/sdk-client.js +129 -0
  30. package/dist/mcp/server-runtime.js +57 -0
  31. package/dist/mcp/stdio-client.js +280 -0
  32. package/dist/mcp/supervisor.js +979 -0
  33. package/dist/mcp/tool-names.js +109 -0
  34. package/dist/minds/builtin/cmdr/persona.md +3 -0
  35. package/dist/minds/builtin/dijiang/knowledge.md +287 -0
  36. package/dist/minds/builtin/dijiang/persona.md +7 -0
  37. package/dist/minds/builtin/fuxi/persona.en.md +59 -0
  38. package/dist/minds/builtin/fuxi/persona.zh.md +49 -0
  39. package/dist/minds/builtin/pangu/persona.en.md +78 -0
  40. package/dist/minds/builtin/pangu/persona.zh.md +71 -0
  41. package/dist/minds/load.js +617 -0
  42. package/dist/minds/minds-i18n.js +131 -0
  43. package/dist/minds/system-prompt.js +281 -0
  44. package/dist/persistence.js +3128 -0
  45. package/dist/problems.js +109 -0
  46. package/dist/server/api-routes.js +1031 -0
  47. package/dist/server/auth.js +180 -0
  48. package/dist/server/mime-types.js +32 -0
  49. package/dist/server/prompts-routes.js +543 -0
  50. package/dist/server/server-core.js +235 -0
  51. package/dist/server/setup-routes.js +697 -0
  52. package/dist/server/static-server.js +132 -0
  53. package/dist/server/websocket-handler.js +1011 -0
  54. package/dist/server.js +164 -0
  55. package/dist/shared/async-fifo-mutex.js +36 -0
  56. package/dist/shared/diligence.js +20 -0
  57. package/dist/shared/dotenv.js +144 -0
  58. package/dist/shared/evt.js +195 -0
  59. package/dist/shared/i18n/driver-messages.js +267 -0
  60. package/dist/shared/i18n/text.js +9 -0
  61. package/dist/shared/i18n/tool-result-messages.js +51 -0
  62. package/dist/shared/rtws-cli.js +73 -0
  63. package/dist/shared/runtime-language.js +47 -0
  64. package/dist/shared/team-mgmt-manual.js +116 -0
  65. package/dist/shared/types/context-health.js +2 -0
  66. package/dist/shared/types/dialog.js +11 -0
  67. package/dist/shared/types/i18n.js +2 -0
  68. package/dist/shared/types/index.js +26 -0
  69. package/dist/shared/types/language.js +40 -0
  70. package/dist/shared/types/problems.js +2 -0
  71. package/dist/shared/types/prompts.js +2 -0
  72. package/dist/shared/types/q4h.js +7 -0
  73. package/dist/shared/types/run-state.js +8 -0
  74. package/dist/shared/types/setup.js +2 -0
  75. package/dist/shared/types/storage.js +10 -0
  76. package/dist/shared/types/tellask.js +8 -0
  77. package/dist/shared/types/tools-registry.js +2 -0
  78. package/dist/shared/types/wire.js +12 -0
  79. package/dist/shared/utils/fmt.js +9 -0
  80. package/dist/shared/utils/html.js +20 -0
  81. package/dist/shared/utils/id.js +18 -0
  82. package/dist/shared/utils/inter-dialog-format.js +101 -0
  83. package/dist/shared/utils/time.js +13 -0
  84. package/dist/static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  85. package/dist/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  86. package/dist/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  87. package/dist/static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  88. package/dist/static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  89. package/dist/static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  90. package/dist/static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  91. package/dist/static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  92. package/dist/static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  93. package/dist/static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  94. package/dist/static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  95. package/dist/static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  96. package/dist/static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  97. package/dist/static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  98. package/dist/static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  99. package/dist/static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  100. package/dist/static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  101. package/dist/static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  102. package/dist/static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  103. package/dist/static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  104. package/dist/static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  105. package/dist/static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  106. package/dist/static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  107. package/dist/static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  108. package/dist/static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  109. package/dist/static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  110. package/dist/static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  111. package/dist/static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  112. package/dist/static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  113. package/dist/static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  114. package/dist/static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  115. package/dist/static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  116. package/dist/static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  117. package/dist/static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  118. package/dist/static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  119. package/dist/static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  120. package/dist/static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  121. package/dist/static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  122. package/dist/static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  123. package/dist/static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  124. package/dist/static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  125. package/dist/static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  126. package/dist/static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  127. package/dist/static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  128. package/dist/static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  129. package/dist/static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  130. package/dist/static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  131. package/dist/static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  132. package/dist/static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  133. package/dist/static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  134. package/dist/static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  135. package/dist/static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  136. package/dist/static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  137. package/dist/static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  138. package/dist/static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  139. package/dist/static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  140. package/dist/static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  141. package/dist/static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  142. package/dist/static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  143. package/dist/static/assets/_baseUniq-Crfl3d5Y.js +661 -0
  144. package/dist/static/assets/_baseUniq-Crfl3d5Y.js.map +1 -0
  145. package/dist/static/assets/arc-CbA_x9GD.js +132 -0
  146. package/dist/static/assets/arc-CbA_x9GD.js.map +1 -0
  147. package/dist/static/assets/architectureDiagram-VXUJARFQ-lcFS8ZQJ.js +8685 -0
  148. package/dist/static/assets/architectureDiagram-VXUJARFQ-lcFS8ZQJ.js.map +1 -0
  149. package/dist/static/assets/blockDiagram-VD42YOAC-B3Q36qRc.js +3608 -0
  150. package/dist/static/assets/blockDiagram-VD42YOAC-B3Q36qRc.js.map +1 -0
  151. package/dist/static/assets/c4Diagram-YG6GDRKO-Mt-aq3VH.js +2482 -0
  152. package/dist/static/assets/c4Diagram-YG6GDRKO-Mt-aq3VH.js.map +1 -0
  153. package/dist/static/assets/channel-BVr1Yke-.js +8 -0
  154. package/dist/static/assets/channel-BVr1Yke-.js.map +1 -0
  155. package/dist/static/assets/chunk-4BX2VUAB-qCIn5Iic.js +17 -0
  156. package/dist/static/assets/chunk-4BX2VUAB-qCIn5Iic.js.map +1 -0
  157. package/dist/static/assets/chunk-55IACEB6-q172NeCV.js +14 -0
  158. package/dist/static/assets/chunk-55IACEB6-q172NeCV.js.map +1 -0
  159. package/dist/static/assets/chunk-B4BG7PRW-CMJmtYzq.js +1827 -0
  160. package/dist/static/assets/chunk-B4BG7PRW-CMJmtYzq.js.map +1 -0
  161. package/dist/static/assets/chunk-DI55MBZ5-DiuwwZPL.js +1916 -0
  162. package/dist/static/assets/chunk-DI55MBZ5-DiuwwZPL.js.map +1 -0
  163. package/dist/static/assets/chunk-FMBD7UC4-06sqZTTn.js +20 -0
  164. package/dist/static/assets/chunk-FMBD7UC4-06sqZTTn.js.map +1 -0
  165. package/dist/static/assets/chunk-QN33PNHL-CnpBNkpP.js +25 -0
  166. package/dist/static/assets/chunk-QN33PNHL-CnpBNkpP.js.map +1 -0
  167. package/dist/static/assets/chunk-QZHKN3VN-CNgjMR-e.js +18 -0
  168. package/dist/static/assets/chunk-QZHKN3VN-CNgjMR-e.js.map +1 -0
  169. package/dist/static/assets/chunk-TZMSLE5B-BxtzW6--.js +109 -0
  170. package/dist/static/assets/chunk-TZMSLE5B-BxtzW6--.js.map +1 -0
  171. package/dist/static/assets/classDiagram-2ON5EDUG-29huvmn-.js +23 -0
  172. package/dist/static/assets/classDiagram-2ON5EDUG-29huvmn-.js.map +1 -0
  173. package/dist/static/assets/classDiagram-v2-WZHVMYZB-29huvmn-.js +23 -0
  174. package/dist/static/assets/classDiagram-v2-WZHVMYZB-29huvmn-.js.map +1 -0
  175. package/dist/static/assets/clone-D2OgLSSn.js +9 -0
  176. package/dist/static/assets/clone-D2OgLSSn.js.map +1 -0
  177. package/dist/static/assets/cose-bilkent-S5V4N54A-BNegDCxl.js +4943 -0
  178. package/dist/static/assets/cose-bilkent-S5V4N54A-BNegDCxl.js.map +1 -0
  179. package/dist/static/assets/cytoscape.esm-Bm8DJGmZ.js +30240 -0
  180. package/dist/static/assets/cytoscape.esm-Bm8DJGmZ.js.map +1 -0
  181. package/dist/static/assets/dagre-6UL2VRFP-f1XrTRSn.js +695 -0
  182. package/dist/static/assets/dagre-6UL2VRFP-f1XrTRSn.js.map +1 -0
  183. package/dist/static/assets/defaultLocale-DVr69WTU.js +207 -0
  184. package/dist/static/assets/defaultLocale-DVr69WTU.js.map +1 -0
  185. package/dist/static/assets/diagram-PSM6KHXK-8w1WbeDi.js +849 -0
  186. package/dist/static/assets/diagram-PSM6KHXK-8w1WbeDi.js.map +1 -0
  187. package/dist/static/assets/diagram-QEK2KX5R-CF4wtMmR.js +303 -0
  188. package/dist/static/assets/diagram-QEK2KX5R-CF4wtMmR.js.map +1 -0
  189. package/dist/static/assets/diagram-S2PKOQOG-8p3Avgn2.js +213 -0
  190. package/dist/static/assets/diagram-S2PKOQOG-8p3Avgn2.js.map +1 -0
  191. package/dist/static/assets/erDiagram-Q2GNP2WA-BMKLxlM9.js +1159 -0
  192. package/dist/static/assets/erDiagram-Q2GNP2WA-BMKLxlM9.js.map +1 -0
  193. package/dist/static/assets/favicon-Cmg5RbCj.svg +8 -0
  194. package/dist/static/assets/flowDiagram-NV44I4VS-CgEuPNK2.js +2332 -0
  195. package/dist/static/assets/flowDiagram-NV44I4VS-CgEuPNK2.js.map +1 -0
  196. package/dist/static/assets/ganttDiagram-JELNMOA3-bJkDCf-9.js +3681 -0
  197. package/dist/static/assets/ganttDiagram-JELNMOA3-bJkDCf-9.js.map +1 -0
  198. package/dist/static/assets/gitGraphDiagram-NY62KEGX-4QE9kesp.js +1206 -0
  199. package/dist/static/assets/gitGraphDiagram-NY62KEGX-4QE9kesp.js.map +1 -0
  200. package/dist/static/assets/graph-CS0Pmm7c.js +597 -0
  201. package/dist/static/assets/graph-CS0Pmm7c.js.map +1 -0
  202. package/dist/static/assets/index-BS6HnGzC.js +112303 -0
  203. package/dist/static/assets/index-BS6HnGzC.js.map +1 -0
  204. package/dist/static/assets/index-DaIsSzC_.css +483 -0
  205. package/dist/static/assets/infoDiagram-WHAUD3N6-ypBcKfUs.js +34 -0
  206. package/dist/static/assets/infoDiagram-WHAUD3N6-ypBcKfUs.js.map +1 -0
  207. package/dist/static/assets/init-ZxktEp_H.js +17 -0
  208. package/dist/static/assets/init-ZxktEp_H.js.map +1 -0
  209. package/dist/static/assets/journeyDiagram-XKPGCS4Q-QnrxDowJ.js +1255 -0
  210. package/dist/static/assets/journeyDiagram-XKPGCS4Q-QnrxDowJ.js.map +1 -0
  211. package/dist/static/assets/kanban-definition-3W4ZIXB7-CfvEc4z5.js +1048 -0
  212. package/dist/static/assets/kanban-definition-3W4ZIXB7-CfvEc4z5.js.map +1 -0
  213. package/dist/static/assets/layout-8TGxpm23.js +2218 -0
  214. package/dist/static/assets/layout-8TGxpm23.js.map +1 -0
  215. package/dist/static/assets/linear-BATBPQQv.js +341 -0
  216. package/dist/static/assets/linear-BATBPQQv.js.map +1 -0
  217. package/dist/static/assets/min-B3oVH3AC.js +42 -0
  218. package/dist/static/assets/min-B3oVH3AC.js.map +1 -0
  219. package/dist/static/assets/mindmap-definition-VGOIOE7T-L7VLwwF8.js +1127 -0
  220. package/dist/static/assets/mindmap-definition-VGOIOE7T-L7VLwwF8.js.map +1 -0
  221. package/dist/static/assets/ordinal-CxptdPJm.js +77 -0
  222. package/dist/static/assets/ordinal-CxptdPJm.js.map +1 -0
  223. package/dist/static/assets/pieDiagram-ADFJNKIX-CFW3zIhM.js +241 -0
  224. package/dist/static/assets/pieDiagram-ADFJNKIX-CFW3zIhM.js.map +1 -0
  225. package/dist/static/assets/quadrantDiagram-AYHSOK5B-B7ssen3E.js +1338 -0
  226. package/dist/static/assets/quadrantDiagram-AYHSOK5B-B7ssen3E.js.map +1 -0
  227. package/dist/static/assets/requirementDiagram-UZGBJVZJ-D0v5BArv.js +1162 -0
  228. package/dist/static/assets/requirementDiagram-UZGBJVZJ-D0v5BArv.js.map +1 -0
  229. package/dist/static/assets/sankeyDiagram-TZEHDZUN-B7slncJe.js +1195 -0
  230. package/dist/static/assets/sankeyDiagram-TZEHDZUN-B7slncJe.js.map +1 -0
  231. package/dist/static/assets/sequenceDiagram-WL72ISMW-oXU2lRh_.js +3875 -0
  232. package/dist/static/assets/sequenceDiagram-WL72ISMW-oXU2lRh_.js.map +1 -0
  233. package/dist/static/assets/stateDiagram-FKZM4ZOC-CFYsEd0x.js +452 -0
  234. package/dist/static/assets/stateDiagram-FKZM4ZOC-CFYsEd0x.js.map +1 -0
  235. package/dist/static/assets/stateDiagram-v2-4FDKWEC3-C0UWaNA7.js +22 -0
  236. package/dist/static/assets/stateDiagram-v2-4FDKWEC3-C0UWaNA7.js.map +1 -0
  237. package/dist/static/assets/timeline-definition-IT6M3QCI-C3KODUrh.js +1223 -0
  238. package/dist/static/assets/timeline-definition-IT6M3QCI-C3KODUrh.js.map +1 -0
  239. package/dist/static/assets/treemap-KMMF4GRG-DAGDLhj2.js +18753 -0
  240. package/dist/static/assets/treemap-KMMF4GRG-DAGDLhj2.js.map +1 -0
  241. package/dist/static/assets/xychartDiagram-PRI3JC2R-C0J9iwTO.js +1888 -0
  242. package/dist/static/assets/xychartDiagram-PRI3JC2R-C0J9iwTO.js.map +1 -0
  243. package/dist/static/index.html +71 -0
  244. package/dist/static/testing/dom-observation-utils.js +425 -0
  245. package/dist/static/testing/e2e-test-helper.js +3119 -0
  246. package/dist/team.js +1160 -0
  247. package/dist/tellask.js +431 -0
  248. package/dist/tool.js +150 -0
  249. package/dist/tools/apply-patch.js +542 -0
  250. package/dist/tools/builtins.js +196 -0
  251. package/dist/tools/context-health.js +177 -0
  252. package/dist/tools/ctrl.js +478 -0
  253. package/dist/tools/diag.js +583 -0
  254. package/dist/tools/env.js +184 -0
  255. package/dist/tools/fs.js +818 -0
  256. package/dist/tools/mcp.js +138 -0
  257. package/dist/tools/mem.js +349 -0
  258. package/dist/tools/os.js +751 -0
  259. package/dist/tools/prompts/team_mgmt.en.md +70 -0
  260. package/dist/tools/prompts/team_mgmt.zh.md +70 -0
  261. package/dist/tools/prompts/ws_mod.en.md +86 -0
  262. package/dist/tools/prompts/ws_mod.zh.md +87 -0
  263. package/dist/tools/registry-snapshot.js +31 -0
  264. package/dist/tools/registry.js +121 -0
  265. package/dist/tools/ripgrep.js +678 -0
  266. package/dist/tools/team-mgmt.js +3300 -0
  267. package/dist/tools/txt.js +3178 -0
  268. package/dist/utils/id.js +72 -0
  269. package/dist/utils/task-doc.js +236 -0
  270. package/dist/utils/task-package.js +522 -0
  271. package/dist/utils/taskdoc-search.js +280 -0
  272. package/dist/utils/taskdoc.js +400 -0
  273. package/package.json +69 -0
@@ -0,0 +1,695 @@
1
+ import { _ as __name, ar as markers_default, as as clear2, at as clear, au as clear$1, l as log, c as getConfig2, av as updateNodeBounds, aw as setNodeElem, ag as insertNode, al as getSubGraphTitleMargins, ah as positionNode, af as insertCluster, ax as insertEdge, ay as positionEdgeLabel, az as insertEdgeLabel } from "./index-BS6HnGzC.js";
2
+ import { i as isUndefined, G as Graph } from "./graph-CS0Pmm7c.js";
3
+ import { l as layout } from "./layout-8TGxpm23.js";
4
+ import { c as clone } from "./clone-D2OgLSSn.js";
5
+ import { m as map } from "./min-B3oVH3AC.js";
6
+ import "./_baseUniq-Crfl3d5Y.js";
7
+ function write(g) {
8
+ var json = {
9
+ options: {
10
+ directed: g.isDirected(),
11
+ multigraph: g.isMultigraph(),
12
+ compound: g.isCompound()
13
+ },
14
+ nodes: writeNodes(g),
15
+ edges: writeEdges(g)
16
+ };
17
+ if (!isUndefined(g.graph())) {
18
+ json.value = clone(g.graph());
19
+ }
20
+ return json;
21
+ }
22
+ function writeNodes(g) {
23
+ return map(g.nodes(), function(v) {
24
+ var nodeValue = g.node(v);
25
+ var parent = g.parent(v);
26
+ var node = { v };
27
+ if (!isUndefined(nodeValue)) {
28
+ node.value = nodeValue;
29
+ }
30
+ if (!isUndefined(parent)) {
31
+ node.parent = parent;
32
+ }
33
+ return node;
34
+ });
35
+ }
36
+ function writeEdges(g) {
37
+ return map(g.edges(), function(e) {
38
+ var edgeValue = g.edge(e);
39
+ var edge = { v: e.v, w: e.w };
40
+ if (!isUndefined(e.name)) {
41
+ edge.name = e.name;
42
+ }
43
+ if (!isUndefined(edgeValue)) {
44
+ edge.value = edgeValue;
45
+ }
46
+ return edge;
47
+ });
48
+ }
49
+ var clusterDb = /* @__PURE__ */ new Map();
50
+ var descendants = /* @__PURE__ */ new Map();
51
+ var parents = /* @__PURE__ */ new Map();
52
+ var clear4 = /* @__PURE__ */ __name(() => {
53
+ descendants.clear();
54
+ parents.clear();
55
+ clusterDb.clear();
56
+ }, "clear");
57
+ var isDescendant = /* @__PURE__ */ __name((id, ancestorId) => {
58
+ const ancestorDescendants = descendants.get(ancestorId) || [];
59
+ log.trace("In isDescendant", ancestorId, " ", id, " = ", ancestorDescendants.includes(id));
60
+ return ancestorDescendants.includes(id);
61
+ }, "isDescendant");
62
+ var edgeInCluster = /* @__PURE__ */ __name((edge, clusterId) => {
63
+ const clusterDescendants = descendants.get(clusterId) || [];
64
+ log.info("Descendants of ", clusterId, " is ", clusterDescendants);
65
+ log.info("Edge is ", edge);
66
+ if (edge.v === clusterId || edge.w === clusterId) {
67
+ return false;
68
+ }
69
+ if (!clusterDescendants) {
70
+ log.debug("Tilt, ", clusterId, ",not in descendants");
71
+ return false;
72
+ }
73
+ return clusterDescendants.includes(edge.v) || isDescendant(edge.v, clusterId) || isDescendant(edge.w, clusterId) || clusterDescendants.includes(edge.w);
74
+ }, "edgeInCluster");
75
+ var copy = /* @__PURE__ */ __name((clusterId, graph, newGraph, rootId) => {
76
+ log.warn(
77
+ "Copying children of ",
78
+ clusterId,
79
+ "root",
80
+ rootId,
81
+ "data",
82
+ graph.node(clusterId),
83
+ rootId
84
+ );
85
+ const nodes = graph.children(clusterId) || [];
86
+ if (clusterId !== rootId) {
87
+ nodes.push(clusterId);
88
+ }
89
+ log.warn("Copying (nodes) clusterId", clusterId, "nodes", nodes);
90
+ nodes.forEach((node) => {
91
+ if (graph.children(node).length > 0) {
92
+ copy(node, graph, newGraph, rootId);
93
+ } else {
94
+ const data = graph.node(node);
95
+ log.info("cp ", node, " to ", rootId, " with parent ", clusterId);
96
+ newGraph.setNode(node, data);
97
+ if (rootId !== graph.parent(node)) {
98
+ log.warn("Setting parent", node, graph.parent(node));
99
+ newGraph.setParent(node, graph.parent(node));
100
+ }
101
+ if (clusterId !== rootId && node !== clusterId) {
102
+ log.debug("Setting parent", node, clusterId);
103
+ newGraph.setParent(node, clusterId);
104
+ } else {
105
+ log.info("In copy ", clusterId, "root", rootId, "data", graph.node(clusterId), rootId);
106
+ log.debug(
107
+ "Not Setting parent for node=",
108
+ node,
109
+ "cluster!==rootId",
110
+ clusterId !== rootId,
111
+ "node!==clusterId",
112
+ node !== clusterId
113
+ );
114
+ }
115
+ const edges = graph.edges(node);
116
+ log.debug("Copying Edges", edges);
117
+ edges.forEach((edge) => {
118
+ log.info("Edge", edge);
119
+ const data2 = graph.edge(edge.v, edge.w, edge.name);
120
+ log.info("Edge data", data2, rootId);
121
+ try {
122
+ if (edgeInCluster(edge, rootId)) {
123
+ log.info("Copying as ", edge.v, edge.w, data2, edge.name);
124
+ newGraph.setEdge(edge.v, edge.w, data2, edge.name);
125
+ log.info("newGraph edges ", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));
126
+ } else {
127
+ log.info(
128
+ "Skipping copy of edge ",
129
+ edge.v,
130
+ "-->",
131
+ edge.w,
132
+ " rootId: ",
133
+ rootId,
134
+ " clusterId:",
135
+ clusterId
136
+ );
137
+ }
138
+ } catch (e) {
139
+ log.error(e);
140
+ }
141
+ });
142
+ }
143
+ log.debug("Removing node", node);
144
+ graph.removeNode(node);
145
+ });
146
+ }, "copy");
147
+ var extractDescendants = /* @__PURE__ */ __name((id, graph) => {
148
+ const children = graph.children(id);
149
+ let res = [...children];
150
+ for (const child of children) {
151
+ parents.set(child, id);
152
+ res = [...res, ...extractDescendants(child, graph)];
153
+ }
154
+ return res;
155
+ }, "extractDescendants");
156
+ var findCommonEdges = /* @__PURE__ */ __name((graph, id1, id2) => {
157
+ const edges1 = graph.edges().filter((edge) => edge.v === id1 || edge.w === id1);
158
+ const edges2 = graph.edges().filter((edge) => edge.v === id2 || edge.w === id2);
159
+ const edges1Prim = edges1.map((edge) => {
160
+ return { v: edge.v === id1 ? id2 : edge.v, w: edge.w === id1 ? id1 : edge.w };
161
+ });
162
+ const edges2Prim = edges2.map((edge) => {
163
+ return { v: edge.v, w: edge.w };
164
+ });
165
+ const result = edges1Prim.filter((edgeIn1) => {
166
+ return edges2Prim.some((edge) => edgeIn1.v === edge.v && edgeIn1.w === edge.w);
167
+ });
168
+ return result;
169
+ }, "findCommonEdges");
170
+ var findNonClusterChild = /* @__PURE__ */ __name((id, graph, clusterId) => {
171
+ const children = graph.children(id);
172
+ log.trace("Searching children of id ", id, children);
173
+ if (children.length < 1) {
174
+ return id;
175
+ }
176
+ let reserve;
177
+ for (const child of children) {
178
+ const _id = findNonClusterChild(child, graph, clusterId);
179
+ const commonEdges = findCommonEdges(graph, clusterId, _id);
180
+ if (_id) {
181
+ if (commonEdges.length > 0) {
182
+ reserve = _id;
183
+ } else {
184
+ return _id;
185
+ }
186
+ }
187
+ }
188
+ return reserve;
189
+ }, "findNonClusterChild");
190
+ var getAnchorId = /* @__PURE__ */ __name((id) => {
191
+ if (!clusterDb.has(id)) {
192
+ return id;
193
+ }
194
+ if (!clusterDb.get(id).externalConnections) {
195
+ return id;
196
+ }
197
+ if (clusterDb.has(id)) {
198
+ return clusterDb.get(id).id;
199
+ }
200
+ return id;
201
+ }, "getAnchorId");
202
+ var adjustClustersAndEdges = /* @__PURE__ */ __name((graph, depth) => {
203
+ if (!graph || depth > 10) {
204
+ log.debug("Opting out, no graph ");
205
+ return;
206
+ } else {
207
+ log.debug("Opting in, graph ");
208
+ }
209
+ graph.nodes().forEach(function(id) {
210
+ const children = graph.children(id);
211
+ if (children.length > 0) {
212
+ log.warn(
213
+ "Cluster identified",
214
+ id,
215
+ " Replacement id in edges: ",
216
+ findNonClusterChild(id, graph, id)
217
+ );
218
+ descendants.set(id, extractDescendants(id, graph));
219
+ clusterDb.set(id, { id: findNonClusterChild(id, graph, id), clusterData: graph.node(id) });
220
+ }
221
+ });
222
+ graph.nodes().forEach(function(id) {
223
+ const children = graph.children(id);
224
+ const edges = graph.edges();
225
+ if (children.length > 0) {
226
+ log.debug("Cluster identified", id, descendants);
227
+ edges.forEach((edge) => {
228
+ const d1 = isDescendant(edge.v, id);
229
+ const d2 = isDescendant(edge.w, id);
230
+ if (d1 ^ d2) {
231
+ log.warn("Edge: ", edge, " leaves cluster ", id);
232
+ log.warn("Descendants of XXX ", id, ": ", descendants.get(id));
233
+ clusterDb.get(id).externalConnections = true;
234
+ }
235
+ });
236
+ } else {
237
+ log.debug("Not a cluster ", id, descendants);
238
+ }
239
+ });
240
+ for (let id of clusterDb.keys()) {
241
+ const nonClusterChild = clusterDb.get(id).id;
242
+ const parent = graph.parent(nonClusterChild);
243
+ if (parent !== id && clusterDb.has(parent) && !clusterDb.get(parent).externalConnections) {
244
+ clusterDb.get(id).id = parent;
245
+ }
246
+ }
247
+ graph.edges().forEach(function(e) {
248
+ const edge = graph.edge(e);
249
+ log.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e));
250
+ log.warn("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(graph.edge(e)));
251
+ let v = e.v;
252
+ let w = e.w;
253
+ log.warn(
254
+ "Fix XXX",
255
+ clusterDb,
256
+ "ids:",
257
+ e.v,
258
+ e.w,
259
+ "Translating: ",
260
+ clusterDb.get(e.v),
261
+ " --- ",
262
+ clusterDb.get(e.w)
263
+ );
264
+ if (clusterDb.get(e.v) || clusterDb.get(e.w)) {
265
+ log.warn("Fixing and trying - removing XXX", e.v, e.w, e.name);
266
+ v = getAnchorId(e.v);
267
+ w = getAnchorId(e.w);
268
+ graph.removeEdge(e.v, e.w, e.name);
269
+ if (v !== e.v) {
270
+ const parent = graph.parent(v);
271
+ clusterDb.get(parent).externalConnections = true;
272
+ edge.fromCluster = e.v;
273
+ }
274
+ if (w !== e.w) {
275
+ const parent = graph.parent(w);
276
+ clusterDb.get(parent).externalConnections = true;
277
+ edge.toCluster = e.w;
278
+ }
279
+ log.warn("Fix Replacing with XXX", v, w, e.name);
280
+ graph.setEdge(v, w, edge, e.name);
281
+ }
282
+ });
283
+ log.warn("Adjusted Graph", write(graph));
284
+ extractor(graph, 0);
285
+ log.trace(clusterDb);
286
+ }, "adjustClustersAndEdges");
287
+ var extractor = /* @__PURE__ */ __name((graph, depth) => {
288
+ log.warn("extractor - ", depth, write(graph), graph.children("D"));
289
+ if (depth > 10) {
290
+ log.error("Bailing out");
291
+ return;
292
+ }
293
+ let nodes = graph.nodes();
294
+ let hasChildren = false;
295
+ for (const node of nodes) {
296
+ const children = graph.children(node);
297
+ hasChildren = hasChildren || children.length > 0;
298
+ }
299
+ if (!hasChildren) {
300
+ log.debug("Done, no node has children", graph.nodes());
301
+ return;
302
+ }
303
+ log.debug("Nodes = ", nodes, depth);
304
+ for (const node of nodes) {
305
+ log.debug(
306
+ "Extracting node",
307
+ node,
308
+ clusterDb,
309
+ clusterDb.has(node) && !clusterDb.get(node).externalConnections,
310
+ !graph.parent(node),
311
+ graph.node(node),
312
+ graph.children("D"),
313
+ " Depth ",
314
+ depth
315
+ );
316
+ if (!clusterDb.has(node)) {
317
+ log.debug("Not a cluster", node, depth);
318
+ } else if (!clusterDb.get(node).externalConnections && graph.children(node) && graph.children(node).length > 0) {
319
+ log.warn(
320
+ "Cluster without external connections, without a parent and with children",
321
+ node,
322
+ depth
323
+ );
324
+ const graphSettings = graph.graph();
325
+ let dir = graphSettings.rankdir === "TB" ? "LR" : "TB";
326
+ if (clusterDb.get(node)?.clusterData?.dir) {
327
+ dir = clusterDb.get(node).clusterData.dir;
328
+ log.warn("Fixing dir", clusterDb.get(node).clusterData.dir, dir);
329
+ }
330
+ const clusterGraph = new Graph({
331
+ multigraph: true,
332
+ compound: true
333
+ }).setGraph({
334
+ rankdir: dir,
335
+ nodesep: 50,
336
+ ranksep: 50,
337
+ marginx: 8,
338
+ marginy: 8
339
+ }).setDefaultEdgeLabel(function() {
340
+ return {};
341
+ });
342
+ log.warn("Old graph before copy", write(graph));
343
+ copy(node, graph, clusterGraph, node);
344
+ graph.setNode(node, {
345
+ clusterNode: true,
346
+ id: node,
347
+ clusterData: clusterDb.get(node).clusterData,
348
+ label: clusterDb.get(node).label,
349
+ graph: clusterGraph
350
+ });
351
+ log.warn("New graph after copy node: (", node, ")", write(clusterGraph));
352
+ log.debug("Old graph after copy", write(graph));
353
+ } else {
354
+ log.warn(
355
+ "Cluster ** ",
356
+ node,
357
+ " **not meeting the criteria !externalConnections:",
358
+ !clusterDb.get(node).externalConnections,
359
+ " no parent: ",
360
+ !graph.parent(node),
361
+ " children ",
362
+ graph.children(node) && graph.children(node).length > 0,
363
+ graph.children("D"),
364
+ depth
365
+ );
366
+ log.debug(clusterDb);
367
+ }
368
+ }
369
+ nodes = graph.nodes();
370
+ log.warn("New list of nodes", nodes);
371
+ for (const node of nodes) {
372
+ const data = graph.node(node);
373
+ log.warn(" Now next level", node, data);
374
+ if (data?.clusterNode) {
375
+ extractor(data.graph, depth + 1);
376
+ }
377
+ }
378
+ }, "extractor");
379
+ var sorter = /* @__PURE__ */ __name((graph, nodes) => {
380
+ if (nodes.length === 0) {
381
+ return [];
382
+ }
383
+ let result = Object.assign([], nodes);
384
+ nodes.forEach((node) => {
385
+ const children = graph.children(node);
386
+ const sorted = sorter(graph, children);
387
+ result = [...result, ...sorted];
388
+ });
389
+ return result;
390
+ }, "sorter");
391
+ var sortNodesByHierarchy = /* @__PURE__ */ __name((graph) => sorter(graph, graph.children()), "sortNodesByHierarchy");
392
+ var recursiveRender = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id, parentCluster, siteConfig) => {
393
+ log.warn("Graph in recursive render:XAX", write(graph), parentCluster);
394
+ const dir = graph.graph().rankdir;
395
+ log.trace("Dir in recursive render - dir:", dir);
396
+ const elem = _elem.insert("g").attr("class", "root");
397
+ if (!graph.nodes()) {
398
+ log.info("No nodes found for", graph);
399
+ } else {
400
+ log.info("Recursive render XXX", graph.nodes());
401
+ }
402
+ if (graph.edges().length > 0) {
403
+ log.info("Recursive edges", graph.edge(graph.edges()[0]));
404
+ }
405
+ const clusters = elem.insert("g").attr("class", "clusters");
406
+ const edgePaths = elem.insert("g").attr("class", "edgePaths");
407
+ const edgeLabels = elem.insert("g").attr("class", "edgeLabels");
408
+ const nodes = elem.insert("g").attr("class", "nodes");
409
+ await Promise.all(
410
+ graph.nodes().map(async function(v) {
411
+ const node = graph.node(v);
412
+ if (parentCluster !== void 0) {
413
+ const data = JSON.parse(JSON.stringify(parentCluster.clusterData));
414
+ log.trace(
415
+ "Setting data for parent cluster XXX\n Node.id = ",
416
+ v,
417
+ "\n data=",
418
+ data.height,
419
+ "\nParent cluster",
420
+ parentCluster.height
421
+ );
422
+ graph.setNode(parentCluster.id, data);
423
+ if (!graph.parent(v)) {
424
+ log.trace("Setting parent", v, parentCluster.id);
425
+ graph.setParent(v, parentCluster.id, data);
426
+ }
427
+ }
428
+ log.info("(Insert) Node XXX" + v + ": " + JSON.stringify(graph.node(v)));
429
+ if (node?.clusterNode) {
430
+ log.info("Cluster identified XBX", v, node.width, graph.node(v));
431
+ const { ranksep, nodesep } = graph.graph();
432
+ node.graph.setGraph({
433
+ ...node.graph.graph(),
434
+ ranksep: ranksep + 25,
435
+ nodesep
436
+ });
437
+ const o = await recursiveRender(
438
+ nodes,
439
+ node.graph,
440
+ diagramType,
441
+ id,
442
+ graph.node(v),
443
+ siteConfig
444
+ );
445
+ const newEl = o.elem;
446
+ updateNodeBounds(node, newEl);
447
+ node.diff = o.diff || 0;
448
+ log.info(
449
+ "New compound node after recursive render XAX",
450
+ v,
451
+ "width",
452
+ // node,
453
+ node.width,
454
+ "height",
455
+ node.height
456
+ // node.x,
457
+ // node.y
458
+ );
459
+ setNodeElem(newEl, node);
460
+ } else {
461
+ if (graph.children(v).length > 0) {
462
+ log.trace(
463
+ "Cluster - the non recursive path XBX",
464
+ v,
465
+ node.id,
466
+ node,
467
+ node.width,
468
+ "Graph:",
469
+ graph
470
+ );
471
+ log.trace(findNonClusterChild(node.id, graph));
472
+ clusterDb.set(node.id, { id: findNonClusterChild(node.id, graph), node });
473
+ } else {
474
+ log.trace("Node - the non recursive path XAX", v, nodes, graph.node(v), dir);
475
+ await insertNode(nodes, graph.node(v), { config: siteConfig, dir });
476
+ }
477
+ }
478
+ })
479
+ );
480
+ const processEdges = /* @__PURE__ */ __name(async () => {
481
+ const edgePromises = graph.edges().map(async function(e) {
482
+ const edge = graph.edge(e.v, e.w, e.name);
483
+ log.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(e));
484
+ log.info("Edge " + e.v + " -> " + e.w + ": ", e, " ", JSON.stringify(graph.edge(e)));
485
+ log.info(
486
+ "Fix",
487
+ clusterDb,
488
+ "ids:",
489
+ e.v,
490
+ e.w,
491
+ "Translating: ",
492
+ clusterDb.get(e.v),
493
+ clusterDb.get(e.w)
494
+ );
495
+ await insertEdgeLabel(edgeLabels, edge);
496
+ });
497
+ await Promise.all(edgePromises);
498
+ }, "processEdges");
499
+ await processEdges();
500
+ log.info("Graph before layout:", JSON.stringify(write(graph)));
501
+ log.info("############################################# XXX");
502
+ log.info("### Layout ### XXX");
503
+ log.info("############################################# XXX");
504
+ layout(graph);
505
+ log.info("Graph after layout:", JSON.stringify(write(graph)));
506
+ let diff = 0;
507
+ let { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig);
508
+ await Promise.all(
509
+ sortNodesByHierarchy(graph).map(async function(v) {
510
+ const node = graph.node(v);
511
+ log.info(
512
+ "Position XBX => " + v + ": (" + node.x,
513
+ "," + node.y,
514
+ ") width: ",
515
+ node.width,
516
+ " height: ",
517
+ node.height
518
+ );
519
+ if (node?.clusterNode) {
520
+ node.y += subGraphTitleTotalMargin;
521
+ log.info(
522
+ "A tainted cluster node XBX1",
523
+ v,
524
+ node.id,
525
+ node.width,
526
+ node.height,
527
+ node.x,
528
+ node.y,
529
+ graph.parent(v)
530
+ );
531
+ clusterDb.get(node.id).node = node;
532
+ positionNode(node);
533
+ } else {
534
+ if (graph.children(v).length > 0) {
535
+ log.info(
536
+ "A pure cluster node XBX1",
537
+ v,
538
+ node.id,
539
+ node.x,
540
+ node.y,
541
+ node.width,
542
+ node.height,
543
+ graph.parent(v)
544
+ );
545
+ node.height += subGraphTitleTotalMargin;
546
+ graph.node(node.parentId);
547
+ const halfPadding = node?.padding / 2 || 0;
548
+ const labelHeight = node?.labelBBox?.height || 0;
549
+ const offsetY = labelHeight - halfPadding || 0;
550
+ log.debug("OffsetY", offsetY, "labelHeight", labelHeight, "halfPadding", halfPadding);
551
+ await insertCluster(clusters, node);
552
+ clusterDb.get(node.id).node = node;
553
+ } else {
554
+ const parent = graph.node(node.parentId);
555
+ node.y += subGraphTitleTotalMargin / 2;
556
+ log.info(
557
+ "A regular node XBX1 - using the padding",
558
+ node.id,
559
+ "parent",
560
+ node.parentId,
561
+ node.width,
562
+ node.height,
563
+ node.x,
564
+ node.y,
565
+ "offsetY",
566
+ node.offsetY,
567
+ "parent",
568
+ parent,
569
+ parent?.offsetY,
570
+ node
571
+ );
572
+ positionNode(node);
573
+ }
574
+ }
575
+ })
576
+ );
577
+ graph.edges().forEach(function(e) {
578
+ const edge = graph.edge(e);
579
+ log.info("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(edge), edge);
580
+ edge.points.forEach((point) => point.y += subGraphTitleTotalMargin / 2);
581
+ const startNode = graph.node(e.v);
582
+ var endNode = graph.node(e.w);
583
+ const paths = insertEdge(edgePaths, edge, clusterDb, diagramType, startNode, endNode, id);
584
+ positionEdgeLabel(edge, paths);
585
+ });
586
+ graph.nodes().forEach(function(v) {
587
+ const n = graph.node(v);
588
+ log.info(v, n.type, n.diff);
589
+ if (n.isGroup) {
590
+ diff = n.diff;
591
+ }
592
+ });
593
+ log.warn("Returning from recursive render XAX", elem, diff);
594
+ return { elem, diff };
595
+ }, "recursiveRender");
596
+ var render = /* @__PURE__ */ __name(async (data4Layout, svg) => {
597
+ const graph = new Graph({
598
+ multigraph: true,
599
+ compound: true
600
+ }).setGraph({
601
+ rankdir: data4Layout.direction,
602
+ nodesep: data4Layout.config?.nodeSpacing || data4Layout.config?.flowchart?.nodeSpacing || data4Layout.nodeSpacing,
603
+ ranksep: data4Layout.config?.rankSpacing || data4Layout.config?.flowchart?.rankSpacing || data4Layout.rankSpacing,
604
+ marginx: 8,
605
+ marginy: 8
606
+ }).setDefaultEdgeLabel(function() {
607
+ return {};
608
+ });
609
+ const element = svg.select("g");
610
+ markers_default(element, data4Layout.markers, data4Layout.type, data4Layout.diagramId);
611
+ clear2();
612
+ clear();
613
+ clear$1();
614
+ clear4();
615
+ data4Layout.nodes.forEach((node) => {
616
+ graph.setNode(node.id, { ...node });
617
+ if (node.parentId) {
618
+ graph.setParent(node.id, node.parentId);
619
+ }
620
+ });
621
+ log.debug("Edges:", data4Layout.edges);
622
+ data4Layout.edges.forEach((edge) => {
623
+ if (edge.start === edge.end) {
624
+ const nodeId = edge.start;
625
+ const specialId1 = nodeId + "---" + nodeId + "---1";
626
+ const specialId2 = nodeId + "---" + nodeId + "---2";
627
+ const node = graph.node(nodeId);
628
+ graph.setNode(specialId1, {
629
+ domId: specialId1,
630
+ id: specialId1,
631
+ parentId: node.parentId,
632
+ labelStyle: "",
633
+ label: "",
634
+ padding: 0,
635
+ shape: "labelRect",
636
+ // shape: 'rect',
637
+ style: "",
638
+ width: 10,
639
+ height: 10
640
+ });
641
+ graph.setParent(specialId1, node.parentId);
642
+ graph.setNode(specialId2, {
643
+ domId: specialId2,
644
+ id: specialId2,
645
+ parentId: node.parentId,
646
+ labelStyle: "",
647
+ padding: 0,
648
+ // shape: 'rect',
649
+ shape: "labelRect",
650
+ label: "",
651
+ style: "",
652
+ width: 10,
653
+ height: 10
654
+ });
655
+ graph.setParent(specialId2, node.parentId);
656
+ const edge1 = structuredClone(edge);
657
+ const edgeMid = structuredClone(edge);
658
+ const edge2 = structuredClone(edge);
659
+ edge1.label = "";
660
+ edge1.arrowTypeEnd = "none";
661
+ edge1.id = nodeId + "-cyclic-special-1";
662
+ edgeMid.arrowTypeStart = "none";
663
+ edgeMid.arrowTypeEnd = "none";
664
+ edgeMid.id = nodeId + "-cyclic-special-mid";
665
+ edge2.label = "";
666
+ if (node.isGroup) {
667
+ edge1.fromCluster = nodeId;
668
+ edge2.toCluster = nodeId;
669
+ }
670
+ edge2.id = nodeId + "-cyclic-special-2";
671
+ edge2.arrowTypeStart = "none";
672
+ graph.setEdge(nodeId, specialId1, edge1, nodeId + "-cyclic-special-0");
673
+ graph.setEdge(specialId1, specialId2, edgeMid, nodeId + "-cyclic-special-1");
674
+ graph.setEdge(specialId2, nodeId, edge2, nodeId + "-cyc<lic-special-2");
675
+ } else {
676
+ graph.setEdge(edge.start, edge.end, { ...edge }, edge.id);
677
+ }
678
+ });
679
+ log.warn("Graph at first:", JSON.stringify(write(graph)));
680
+ adjustClustersAndEdges(graph);
681
+ log.warn("Graph after XAX:", JSON.stringify(write(graph)));
682
+ const siteConfig = getConfig2();
683
+ await recursiveRender(
684
+ element,
685
+ graph,
686
+ data4Layout.type,
687
+ data4Layout.diagramId,
688
+ void 0,
689
+ siteConfig
690
+ );
691
+ }, "render");
692
+ export {
693
+ render
694
+ };
695
+ //# sourceMappingURL=dagre-6UL2VRFP-f1XrTRSn.js.map