@diagrammo/dgmo 0.90.0 → 0.91.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 (179) hide show
  1. package/dist/advanced.d.ts +156 -2
  2. package/dist/advanced.js +558 -115
  3. package/dist/block.d.ts +10 -1
  4. package/dist/block.js +46 -39
  5. package/dist/{calculator-PX3JHKAS.js → calculator-3LZUWOBK.js} +1 -1
  6. package/dist/chart-meta.js +12 -12
  7. package/dist/{charts-d3-QW4ERNUE.js → charts-d3-YXD6VGZQ.js} +3 -3
  8. package/dist/{chunk-64KSPLU2.js → chunk-273GB7WK.js} +4 -4
  9. package/dist/{chunk-GYBKG4Z6.js → chunk-2A4OFZ2Z.js} +2 -2
  10. package/dist/{chunk-YWRZG6GN.js → chunk-2AM6VA3A.js} +8 -8
  11. package/dist/{chunk-PQ5NW3QZ.js → chunk-2UV627GG.js} +4 -4
  12. package/dist/{chunk-AAC3XQWV.js → chunk-37QQXKFV.js} +8 -9
  13. package/dist/{chunk-RCBHL2B5.js → chunk-3LINSNJT.js} +112 -112
  14. package/dist/{chunk-5TZPIKNV.js → chunk-3SLRZKLB.js} +2 -2
  15. package/dist/{chunk-X3WYJ5T7.js → chunk-3YTAOMMN.js} +1 -1
  16. package/dist/{chunk-A5EE66RQ.js → chunk-53BJIOLF.js} +1 -1
  17. package/dist/{chunk-QRIW46LR.js → chunk-57L2JPP2.js} +6 -2
  18. package/dist/{chunk-IIOLFAGJ.js → chunk-5DIBB2QG.js} +51 -32
  19. package/dist/{chunk-7Z2VFRP5.js → chunk-5U6DXIMV.js} +47 -24
  20. package/dist/{chunk-5M6PMV5Z.js → chunk-5VPWIC6T.js} +3 -3
  21. package/dist/{chunk-SLO22FPS.js → chunk-634LDSN6.js} +1 -1
  22. package/dist/{chunk-G5BGW4BX.js → chunk-6NO3MNBC.js} +3 -3
  23. package/dist/{chunk-NUYWNKHH.js → chunk-6QEXWMBP.js} +12 -16
  24. package/dist/{chunk-POBNN5DP.js → chunk-7BBRSOKS.js} +2 -2
  25. package/dist/{chunk-NFWRIC2V.js → chunk-AR4QVMWG.js} +4 -1
  26. package/dist/{chunk-JRQ4LBQI.js → chunk-B6EUFLRP.js} +4 -4
  27. package/dist/{chunk-LNQDICFJ.js → chunk-CPGKRI7H.js} +5 -8
  28. package/dist/{chunk-ZNNVI5SR.js → chunk-CU2PZLZP.js} +53 -31
  29. package/dist/{chunk-LBRHDWEA.js → chunk-CVZBLHHW.js} +1 -1
  30. package/dist/{chunk-S4LLHDGK.js → chunk-CXIPV2FY.js} +3 -3
  31. package/dist/{chunk-ICYPGWOV.js → chunk-D7DXNQW5.js} +2 -2
  32. package/dist/{chunk-54YUDXGP.js → chunk-D7PP35BA.js} +1 -1
  33. package/dist/{chunk-RRBV4HIM.js → chunk-DLX7MEN4.js} +1 -1
  34. package/dist/{chunk-S7C32S2T.js → chunk-EDPDAUBL.js} +2 -2
  35. package/dist/{chunk-LC5LY5V2.js → chunk-EP7BT3HU.js} +1 -1
  36. package/dist/{chunk-ICZ7M6IZ.js → chunk-EQJ3U5EW.js} +1 -1
  37. package/dist/{chunk-K4GUO7FV.js → chunk-F2436VRR.js} +1 -1
  38. package/dist/{chunk-5M52RPAS.js → chunk-F26ZPBSF.js} +2 -2
  39. package/dist/{chunk-3BQCSQQJ.js → chunk-FJCYK4K3.js} +11 -11
  40. package/dist/{chunk-PXEUQ7EG.js → chunk-G22UV5AF.js} +4 -4
  41. package/dist/{chunk-CUY56BK4.js → chunk-G3EUQMV4.js} +3 -3
  42. package/dist/{chunk-I6FWHICD.js → chunk-GCDW3WAY.js} +5 -5
  43. package/dist/{chunk-WHRIN7N3.js → chunk-HFG7KQOY.js} +12 -14
  44. package/dist/{chunk-SVQDLYX7.js → chunk-HLVGZXM5.js} +1 -1
  45. package/dist/{chunk-3HBR3YAN.js → chunk-HSGWR2FL.js} +6 -6
  46. package/dist/{chunk-RNXX2GOQ.js → chunk-HWXUQCDY.js} +2 -2
  47. package/dist/{chunk-YE7D2S75.js → chunk-HYV6GSXM.js} +5 -2
  48. package/dist/{chunk-AHWA36O7.js → chunk-II4XJETG.js} +1 -1
  49. package/dist/{chunk-EB7AEM2H.js → chunk-IMKPFW67.js} +3 -3
  50. package/dist/{chunk-C4W62JZO.js → chunk-IS6WFBX7.js} +2 -2
  51. package/dist/{chunk-SMEVBJJJ.js → chunk-IUBCDNT2.js} +1 -1
  52. package/dist/{chunk-TQ644YGV.js → chunk-IWTUXGHN.js} +3 -3
  53. package/dist/{chunk-PNCKZFPE.js → chunk-J2SQNZ6D.js} +1 -1
  54. package/dist/{chunk-YKGUSW6D.js → chunk-JA2S7PHR.js} +7 -7
  55. package/dist/{chunk-IRVQT4GR.js → chunk-JJQWCI35.js} +2 -2
  56. package/dist/chunk-JJUDOR4I.js +110 -0
  57. package/dist/{chunk-VCHYS3RD.js → chunk-K3BYD3WU.js} +1 -1
  58. package/dist/{chunk-EEYQFJVK.js → chunk-KFXY5IW2.js} +2 -2
  59. package/dist/{chunk-Y6GQQ4Y2.js → chunk-LKR4FACF.js} +1 -3
  60. package/dist/{chunk-IJ27L3R4.js → chunk-MA42PIGJ.js} +1 -1
  61. package/dist/{chunk-GQVXYRPC.js → chunk-MI6SJJQU.js} +1 -1
  62. package/dist/{chunk-DXPT2HPH.js → chunk-MJKQ5ZYY.js} +2 -2
  63. package/dist/{chunk-J3ODKAWN.js → chunk-MNL547RV.js} +5 -5
  64. package/dist/{chunk-2EDJPHXQ.js → chunk-N254IJM2.js} +6 -6
  65. package/dist/{layout-search-YKUL4VBV.js → chunk-NWPMLX2V.js} +27 -30
  66. package/dist/{chunk-COPSI54O.js → chunk-PSGSFRRE.js} +2 -2
  67. package/dist/{chunk-FDRHBQUG.js → chunk-PUZ63XZM.js} +8 -8
  68. package/dist/{chunk-MIVSVEK4.js → chunk-PZVTFQI2.js} +2 -2
  69. package/dist/{chunk-W7QN5BC5.js → chunk-Q3N7PI3B.js} +180 -7
  70. package/dist/{chunk-HX2KJEPD.js → chunk-QKJ6MQXW.js} +1 -3
  71. package/dist/{chunk-NJYA4QSN.js → chunk-QVKTAU7P.js} +1 -1
  72. package/dist/{chunk-EK7JYFCL.js → chunk-R7BSF7Z7.js} +1 -1
  73. package/dist/{chunk-PIHAUVA4.js → chunk-RHXIUUWB.js} +1 -1
  74. package/dist/{chunk-GXP344YZ.js → chunk-RMTOZALT.js} +6 -3
  75. package/dist/{chunk-CYF2X3CG.js → chunk-ROCBGUJN.js} +7 -7
  76. package/dist/{chunk-RY5RRKYN.js → chunk-RVTYIGWZ.js} +3 -3
  77. package/dist/{chunk-NMKLX57Y.js → chunk-SKF7XLCM.js} +1 -1
  78. package/dist/{chunk-NP2SE6MQ.js → chunk-SMTWQ66K.js} +5 -5
  79. package/dist/{chunk-3AX6MCI6.js → chunk-SPQVER4T.js} +2 -2
  80. package/dist/{chunk-A5PUOHIS.js → chunk-SWBHH2UW.js} +1 -1
  81. package/dist/{chunk-7TF3QOOD.js → chunk-TIVMAITN.js} +14 -0
  82. package/dist/{chunk-4IYJOXGS.js → chunk-TLPY4ZBI.js} +604 -430
  83. package/dist/{chunk-U762HK4D.js → chunk-TPEYEOXA.js} +4 -4
  84. package/dist/{chunk-FS2LZBHG.js → chunk-UWJP4JSZ.js} +2 -2
  85. package/dist/{chunk-JX4RCC6B.js → chunk-V3KHZQPK.js} +2 -2
  86. package/dist/{chunk-RJYFHEP4.js → chunk-VGSSAMLA.js} +2 -2
  87. package/dist/{chunk-HIVJBESO.js → chunk-VMD2CYVP.js} +35 -36
  88. package/dist/{chunk-OSIUWQ3N.js → chunk-WNTPJZU7.js} +1 -1
  89. package/dist/{chunk-R2PTZ6QM.js → chunk-WTE27AJT.js} +7 -7
  90. package/dist/{chunk-OWJVSJLA.js → chunk-XLAREWBK.js} +2 -2
  91. package/dist/{chunk-NY56FM55.js → chunk-XLPJJ35N.js} +2 -2
  92. package/dist/{chunk-DNMICILX.js → chunk-XQTRGKQ3.js} +3 -3
  93. package/dist/{chunk-QOZ4RVQY.js → chunk-YZG37S7L.js} +3 -3
  94. package/dist/{chunk-62VWZ3SE.js → chunk-ZB2Q67NO.js} +10 -10
  95. package/dist/completion-registry.js +2 -2
  96. package/dist/{compute-JAP5E2E4.js → compute-2XWFVO7K.js} +1 -1
  97. package/dist/{dgmo-router-BJBXSZMV.js → dgmo-router-YHBMKTXY.js} +32 -32
  98. package/dist/{dimensions-AMA2S7RO.js → dimensions-QMGWJQTR.js} +3 -3
  99. package/dist/{flowchart-parser-ADZIFVCH.js → flowchart-parser-BLJ6RA53.js} +2 -2
  100. package/dist/{flowchart-renderer-CAG6ZNJ6.js → flowchart-renderer-FXRQKXAK.js} +10 -6
  101. package/dist/index.js +37 -37
  102. package/dist/{layout-5VSMZPMG.js → layout-5HCEF7VO.js} +1 -1
  103. package/dist/{layout-VQ2USZJ3.js → layout-6PLSBB5X.js} +2 -2
  104. package/dist/{layout-UIV56NUA.js → layout-B7PQRAMB.js} +1 -1
  105. package/dist/{layout-C6MKMOBI.js → layout-CCVCLZ6S.js} +1 -1
  106. package/dist/{layout-T2PGKQUQ.js → layout-CRUAP7JG.js} +2 -2
  107. package/dist/{layout-UFB2O4AO.js → layout-G42FDCF3.js} +2 -2
  108. package/dist/{layout-6OSF2UGP.js → layout-IV4H2FLB.js} +2 -2
  109. package/dist/{layout-4RRC7XU7.js → layout-JTNRSGOS.js} +6 -3
  110. package/dist/{layout-H4K54IW3.js → layout-RBLD5EGX.js} +6 -3
  111. package/dist/{layout-SW3XWYKC.js → layout-ROAVGBUC.js} +1 -1
  112. package/dist/{layout-QS2SESBU.js → layout-T2DQ4M77.js} +6 -2
  113. package/dist/{layout-ZP7XYVXF.js → layout-YKGQRFDM.js} +2 -4
  114. package/dist/layout-search-L75YOBME.js +42 -0
  115. package/dist/{parser-NAUUUCI3.js → parser-2XCDVLSN.js} +2 -2
  116. package/dist/{parser-ESZ5J5IJ.js → parser-4QNRCGU5.js} +2 -2
  117. package/dist/{parser-W2DWCCLO.js → parser-6NSQLPTS.js} +2 -2
  118. package/dist/{parser-223VOHSB.js → parser-6X4GGH2R.js} +2 -2
  119. package/dist/{parser-B2FWP7ZO.js → parser-D6YRVV75.js} +2 -2
  120. package/dist/{parser-T2RVIRDG.js → parser-EY3VJWBE.js} +2 -2
  121. package/dist/{parser-KFIK3EOO.js → parser-EYF4ZSZO.js} +2 -2
  122. package/dist/{parser-2PNV7UI3.js → parser-H2DJEAPG.js} +2 -2
  123. package/dist/{parser-OV2WDSEV.js → parser-ILWAA3QJ.js} +2 -2
  124. package/dist/{parser-FV6RGALQ.js → parser-KMFMNZYI.js} +2 -2
  125. package/dist/{parser-LGUT7KKH.js → parser-MDSVVCJP.js} +2 -2
  126. package/dist/{parser-HPR7G7F6.js → parser-QL4DEPVA.js} +3 -3
  127. package/dist/{parser-BJDQX4KV.js → parser-UEDPLM46.js} +2 -2
  128. package/dist/{parser-E5HFYL7B.js → parser-UL6WN6W5.js} +2 -2
  129. package/dist/{parser-5ZD2NKGU.js → parser-ULSUK36C.js} +2 -2
  130. package/dist/{parser-57YQEEMC.js → parser-UY3K4ROB.js} +1 -1
  131. package/dist/{parser-MYRGCK7Q.js → parser-UYQNNQKT.js} +2 -2
  132. package/dist/{parser-NJ5VEZA3.js → parser-VG747VR6.js} +2 -2
  133. package/dist/{parser-CA5WC5HF.js → parser-VK4PNDX4.js} +2 -2
  134. package/dist/{parser-JFNDS5E5.js → parser-X5FQ36KJ.js} +2 -2
  135. package/dist/{parser-I4HZVIHX.js → parser-XO5IAXMT.js} +2 -2
  136. package/dist/{parser-WFY4ZJUW.js → parser-YVHO2NRM.js} +2 -2
  137. package/dist/{parser-J3BM2AP2.js → parser-YWZGIU3C.js} +2 -2
  138. package/dist/{parser-4B2PIXHI.js → parser-ZFLSULFC.js} +2 -2
  139. package/dist/{parser-RARXAHC7.js → parser-ZR7JAKSW.js} +1 -1
  140. package/dist/{renderer-3QM2DK7I.js → renderer-43IVPARP.js} +3 -3
  141. package/dist/{renderer-GWH5ACJ5.js → renderer-4MEZYGU6.js} +2 -2
  142. package/dist/{renderer-A3PMPUO6.js → renderer-54GXA3UO.js} +5 -5
  143. package/dist/{renderer-W22GX72R.js → renderer-7EAWN7MC.js} +4 -4
  144. package/dist/{renderer-IO3D5E4E.js → renderer-7SEXPBGM.js} +3 -3
  145. package/dist/{renderer-B3CPMS5R.js → renderer-B7B7BQM3.js} +7 -7
  146. package/dist/{renderer-IG72UJHW.js → renderer-I2LYSQBV.js} +3 -3
  147. package/dist/{renderer-OPDSKCQS.js → renderer-J2LOMTBC.js} +3 -3
  148. package/dist/{renderer-TTKTBB4C.js → renderer-JUH6M3XF.js} +6 -6
  149. package/dist/{renderer-COSJM7UG.js → renderer-KY6O5JTX.js} +33 -33
  150. package/dist/{renderer-PLRMST57.js → renderer-LHTDI5RV.js} +4 -4
  151. package/dist/{renderer-3W5T3IU6.js → renderer-LWL3IJOF.js} +3 -3
  152. package/dist/{renderer-SBXCPA3S.js → renderer-NCIDGJ2R.js} +5 -5
  153. package/dist/{renderer-AM4VZSBQ.js → renderer-OPA4JJKX.js} +4 -4
  154. package/dist/{renderer-O5RQHGK2.js → renderer-QMNC7TGN.js} +4 -4
  155. package/dist/{renderer-UVFGW2O6.js → renderer-QQNPJGAP.js} +3 -3
  156. package/dist/{renderer-WQ654YT5.js → renderer-R7RK7FKI.js} +1 -1
  157. package/dist/{renderer-TMQNTUQS.js → renderer-RFP55AW7.js} +10 -7
  158. package/dist/{renderer-FXCVH2M5.js → renderer-S3NFBJCY.js} +10 -7
  159. package/dist/{renderer-OA5D3ZKB.js → renderer-SD4ZHHAR.js} +6 -4
  160. package/dist/{renderer-PSMRAL72.js → renderer-SE7Z5AOL.js} +3 -3
  161. package/dist/{renderer-ON4PTUHJ.js → renderer-T2WUA7MC.js} +5 -5
  162. package/dist/{renderer-KK5BU5K2.js → renderer-TWKEZ3DD.js} +3 -3
  163. package/dist/{renderer-MK47ESCB.js → renderer-U5PD72G7.js} +3 -3
  164. package/dist/{renderer-52CHSV6S.js → renderer-VCTKBUTR.js} +5 -5
  165. package/dist/{renderer-PXGCR7N4.js → renderer-VNZTWATB.js} +3 -3
  166. package/dist/{renderer-4Z7FRQ2A.js → renderer-YDNWK6RI.js} +1 -1
  167. package/dist/{renderer-B4KE3NM4.js → renderer-YDOWBIUB.js} +4 -4
  168. package/dist/{renderer-LD2H7WGP.js → renderer-YQPZ7O2C.js} +1 -1
  169. package/dist/{renderer-6OOJNEQE.js → renderer-ZQ77CM6Y.js} +4 -4
  170. package/dist/{renderer-radial-42LVSG74.js → renderer-radial-TNNEL3YN.js} +4 -4
  171. package/dist/{resolver-XSXE2TRX.js → resolver-6DJLZF6Y.js} +1 -1
  172. package/dist/{state-parser-ROKY5KSI.js → state-parser-NIIVOU2Y.js} +2 -2
  173. package/dist/{state-renderer-MMG23G4W.js → state-renderer-TVLEG32M.js} +11 -7
  174. package/package.json +1 -1
  175. package/dist/chunk-6EK55ART.js +0 -116
  176. package/dist/chunk-HTNLLT34.js +0 -72
  177. /package/dist/{chunk-3FCSOYN4.js → chunk-5P2L5QXE.js} +0 -0
  178. /package/dist/{chunk-HJRP6PXL.js → chunk-BQVTV4LB.js} +0 -0
  179. /package/dist/{chunk-LYRDIVSY.js → chunk-GLCMUTO5.js} +0 -0
package/dist/advanced.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  renderCountdown,
3
3
  renderCountdownForExport
4
- } from "./chunk-A5PUOHIS.js";
4
+ } from "./chunk-SWBHH2UW.js";
5
5
  import {
6
6
  renderClock,
7
7
  renderClockForExport
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  renderBracket,
11
11
  renderBracketForExport
12
- } from "./chunk-RY5RRKYN.js";
12
+ } from "./chunk-RVTYIGWZ.js";
13
13
  import {
14
14
  renderRaci,
15
15
  renderRaciForExport
@@ -23,11 +23,11 @@ import {
23
23
  computeActivations,
24
24
  groupMessagesBySection,
25
25
  renderSequenceDiagram
26
- } from "./chunk-4IYJOXGS.js";
26
+ } from "./chunk-TLPY4ZBI.js";
27
27
  import {
28
28
  mapContentAspect,
29
29
  mapExportDimensions
30
- } from "./chunk-AHWA36O7.js";
30
+ } from "./chunk-II4XJETG.js";
31
31
  import {
32
32
  renderPyramid,
33
33
  renderPyramidForExport
@@ -40,12 +40,12 @@ import {
40
40
  layoutTreemapRadial,
41
41
  renderTreemapRadial,
42
42
  renderTreemapRadialForExport
43
- } from "./chunk-S4LLHDGK.js";
43
+ } from "./chunk-CXIPV2FY.js";
44
44
  import {
45
45
  layoutTreemap,
46
46
  renderTreemap,
47
47
  renderTreemapForExport
48
- } from "./chunk-5M6PMV5Z.js";
48
+ } from "./chunk-5VPWIC6T.js";
49
49
  import {
50
50
  renderLiveLinkCard
51
51
  } from "./chunk-A6YINTY6.js";
@@ -54,16 +54,16 @@ import {
54
54
  layoutBlock,
55
55
  renderBlock,
56
56
  renderBlockForExport
57
- } from "./chunk-MIVSVEK4.js";
57
+ } from "./chunk-PZVTFQI2.js";
58
58
  import {
59
59
  renderGoal,
60
60
  renderGoalForExport
61
- } from "./chunk-G5BGW4BX.js";
62
- import "./chunk-A5EE66RQ.js";
61
+ } from "./chunk-6NO3MNBC.js";
62
+ import "./chunk-53BJIOLF.js";
63
63
  import {
64
64
  renderState,
65
65
  renderStateForExport
66
- } from "./chunk-YKGUSW6D.js";
66
+ } from "./chunk-JA2S7PHR.js";
67
67
  import {
68
68
  collapseStateGroups
69
69
  } from "./chunk-SQ7IY53Q.js";
@@ -74,11 +74,11 @@ import {
74
74
  renderQuadrantFocusForExport,
75
75
  renderTechRadar,
76
76
  renderTechRadarForExport
77
- } from "./chunk-PIHAUVA4.js";
77
+ } from "./chunk-RHXIUUWB.js";
78
78
  import {
79
79
  renderJourneyMap,
80
80
  renderJourneyMapForExport
81
- } from "./chunk-PQ5NW3QZ.js";
81
+ } from "./chunk-2UV627GG.js";
82
82
  import {
83
83
  layoutJourneyMap
84
84
  } from "./chunk-HLE5QGZJ.js";
@@ -86,15 +86,15 @@ import {
86
86
  computeCycleLayout,
87
87
  renderCycle,
88
88
  renderCycleForExport
89
- } from "./chunk-K4GUO7FV.js";
89
+ } from "./chunk-F2436VRR.js";
90
90
  import {
91
91
  resolveMap
92
- } from "./chunk-3AX6MCI6.js";
92
+ } from "./chunk-SPQVER4T.js";
93
93
  import {
94
94
  renderMap,
95
95
  renderMapForExport,
96
96
  renderMapLayout
97
- } from "./chunk-GYBKG4Z6.js";
97
+ } from "./chunk-2A4OFZ2Z.js";
98
98
  import "./chunk-G2KHLANR.js";
99
99
  import {
100
100
  albersSkewFallback,
@@ -102,7 +102,7 @@ import {
102
102
  mapBackgroundColor,
103
103
  mapNeutralLandColor,
104
104
  rebuildMapProjection
105
- } from "./chunk-QRIW46LR.js";
105
+ } from "./chunk-57L2JPP2.js";
106
106
  import {
107
107
  decodeFeatures,
108
108
  regionAt
@@ -113,19 +113,19 @@ import {
113
113
  inferRoles,
114
114
  parseAndLayoutInfra,
115
115
  renderInfra
116
- } from "./chunk-R2PTZ6QM.js";
116
+ } from "./chunk-WTE27AJT.js";
117
117
  import {
118
118
  computeInfra
119
- } from "./chunk-ICZ7M6IZ.js";
119
+ } from "./chunk-EQJ3U5EW.js";
120
120
  import {
121
121
  layoutInfra
122
- } from "./chunk-3FCSOYN4.js";
122
+ } from "./chunk-5P2L5QXE.js";
123
123
  import {
124
124
  measurePertAnalysisBlock,
125
125
  renderPert,
126
126
  renderPertAnalysisBlock,
127
127
  renderPertForExport
128
- } from "./chunk-LNQDICFJ.js";
128
+ } from "./chunk-CPGKRI7H.js";
129
129
  import {
130
130
  analyzePert,
131
131
  buildSimulationContext,
@@ -137,44 +137,57 @@ import {
137
137
  import {
138
138
  layoutPert,
139
139
  relayoutPert
140
- } from "./chunk-64KSPLU2.js";
140
+ } from "./chunk-273GB7WK.js";
141
141
  import {
142
142
  calculateSchedule,
143
143
  collectTasks,
144
144
  resolveTaskName
145
- } from "./chunk-Y6GQQ4Y2.js";
145
+ } from "./chunk-LKR4FACF.js";
146
146
  import {
147
147
  buildTagLaneRowList,
148
148
  renderGantt
149
- } from "./chunk-3HBR3YAN.js";
149
+ } from "./chunk-HSGWR2FL.js";
150
150
  import {
151
151
  renderFamily,
152
152
  renderFamilyForExport
153
- } from "./chunk-OWJVSJLA.js";
153
+ } from "./chunk-XLAREWBK.js";
154
154
  import {
155
155
  collapseMindmapTree
156
156
  } from "./chunk-UZ7EZW3B.js";
157
157
  import {
158
158
  renderMindmap,
159
159
  renderMindmapForExport
160
- } from "./chunk-I6FWHICD.js";
160
+ } from "./chunk-GCDW3WAY.js";
161
161
  import {
162
162
  layoutMindmap
163
- } from "./chunk-LBRHDWEA.js";
163
+ } from "./chunk-CVZBLHHW.js";
164
164
  import {
165
165
  layoutWireframe
166
- } from "./chunk-LYRDIVSY.js";
166
+ } from "./chunk-GLCMUTO5.js";
167
167
  import {
168
168
  renderWireframe
169
- } from "./chunk-NP2SE6MQ.js";
169
+ } from "./chunk-SMTWQ66K.js";
170
170
  import {
171
171
  renderFlowchart,
172
172
  renderFlowchartForExport
173
- } from "./chunk-J3ODKAWN.js";
173
+ } from "./chunk-MNL547RV.js";
174
174
  import "./chunk-26EVL454.js";
175
175
  import {
176
176
  layoutGraph
177
- } from "./chunk-ZNNVI5SR.js";
177
+ } from "./chunk-CU2PZLZP.js";
178
+ import {
179
+ CONTAINER_FILL_OPACITY,
180
+ CONTAINER_STROKE_OPACITY,
181
+ CONTAINER_STROKE_WIDTH,
182
+ SKETCH_VISUALS,
183
+ renderSketch,
184
+ renderSketchForExport,
185
+ sketchColors,
186
+ sketchContainerFill,
187
+ sketchEdgeGeometry,
188
+ sketchLabelSpot,
189
+ sketchNeutralFill
190
+ } from "./chunk-MJKQ5ZYY.js";
178
191
  import {
179
192
  IMAGE_NOT_UPLOADED,
180
193
  WHITEBOARD_LABEL_MIN_FONT,
@@ -198,7 +211,7 @@ import {
198
211
  whiteboardShapeAt,
199
212
  whiteboardShapeContains,
200
213
  wrapWhiteboardLabel
201
- } from "./chunk-S7C32S2T.js";
214
+ } from "./chunk-EDPDAUBL.js";
202
215
  import {
203
216
  renderC4ComponentsForExport,
204
217
  renderC4Containers,
@@ -207,25 +220,30 @@ import {
207
220
  renderC4ContextForExport,
208
221
  renderC4Deployment,
209
222
  renderC4DeploymentForExport
210
- } from "./chunk-FDRHBQUG.js";
223
+ } from "./chunk-PUZ63XZM.js";
224
+ import {
225
+ CYLINDER_RY,
226
+ QUEUE_CAP,
227
+ layoutC4Components,
228
+ layoutC4Containers,
229
+ layoutC4Context,
230
+ layoutC4Deployment,
231
+ rollUpContextRelationships
232
+ } from "./chunk-K3BYD3WU.js";
211
233
  import {
212
234
  renderBoxesAndLines,
213
235
  renderBoxesAndLinesForExport
214
- } from "./chunk-2EDJPHXQ.js";
215
- import {
216
- layoutBoxesAndLines
217
- } from "./chunk-W7QN5BC5.js";
236
+ } from "./chunk-N254IJM2.js";
218
237
  import {
219
238
  layoutSwimlane
220
239
  } from "./chunk-AUS7V54P.js";
221
- import "./chunk-EJS3K44P.js";
222
- import "./chunk-QT3KDDXK.js";
223
240
  import {
224
241
  renderSwimlaneForExport
225
- } from "./chunk-RRBV4HIM.js";
242
+ } from "./chunk-DLX7MEN4.js";
243
+ import "./chunk-XBJJP2HN.js";
226
244
  import {
227
245
  layoutFamily
228
- } from "./chunk-IJ27L3R4.js";
246
+ } from "./chunk-MA42PIGJ.js";
229
247
  import "./chunk-IVKC4GID.js";
230
248
  import {
231
249
  computeCardArchive,
@@ -233,26 +251,31 @@ import {
233
251
  isArchiveColumn,
234
252
  renderKanban,
235
253
  renderKanbanForExport
236
- } from "./chunk-EB7AEM2H.js";
254
+ } from "./chunk-IMKPFW67.js";
237
255
  import {
238
256
  renderClassDiagram,
239
257
  renderClassDiagramForExport
240
- } from "./chunk-QOZ4RVQY.js";
258
+ } from "./chunk-YZG37S7L.js";
241
259
  import {
242
260
  layoutClassDiagram
243
- } from "./chunk-7Z2VFRP5.js";
261
+ } from "./chunk-5U6DXIMV.js";
244
262
  import {
245
263
  renderERDiagram,
246
264
  renderERDiagramForExport
247
- } from "./chunk-PXEUQ7EG.js";
265
+ } from "./chunk-G22UV5AF.js";
248
266
  import "./chunk-KATED53P.js";
249
267
  import {
250
268
  layoutERDiagram
251
- } from "./chunk-IIOLFAGJ.js";
252
- import "./chunk-HTNLLT34.js";
253
- import "./chunk-6EK55ART.js";
269
+ } from "./chunk-5DIBB2QG.js";
270
+ import "./chunk-JJUDOR4I.js";
271
+ import "./chunk-NWPMLX2V.js";
272
+ import "./chunk-EJS3K44P.js";
273
+ import {
274
+ layoutBoxesAndLines
275
+ } from "./chunk-Q3N7PI3B.js";
254
276
  import "./chunk-RJNZHFNG.js";
255
277
  import "./chunk-5DH3KYFH.js";
278
+ import "./chunk-QT3KDDXK.js";
256
279
  import {
257
280
  SKETCH_AUTO_LAYOUT_DEFAULTS,
258
281
  SKETCH_FOOT_H,
@@ -267,37 +290,14 @@ import {
267
290
  layoutSketch,
268
291
  sketchSlotToPx
269
292
  } from "./chunk-6BQSDF77.js";
270
- import {
271
- CONTAINER_FILL_OPACITY,
272
- CONTAINER_STROKE_OPACITY,
273
- CONTAINER_STROKE_WIDTH,
274
- SKETCH_VISUALS,
275
- renderSketch,
276
- renderSketchForExport,
277
- sketchColors,
278
- sketchContainerFill,
279
- sketchEdgeGeometry,
280
- sketchLabelSpot,
281
- sketchNeutralFill
282
- } from "./chunk-DXPT2HPH.js";
283
- import "./chunk-XBJJP2HN.js";
284
- import {
285
- CYLINDER_RY,
286
- QUEUE_CAP,
287
- layoutC4Components,
288
- layoutC4Containers,
289
- layoutC4Context,
290
- layoutC4Deployment,
291
- rollUpContextRelationships
292
- } from "./chunk-VCHYS3RD.js";
293
293
  import {
294
294
  renderBody,
295
295
  renderBodyForExport
296
- } from "./chunk-ICYPGWOV.js";
296
+ } from "./chunk-D7DXNQW5.js";
297
297
  import {
298
298
  renderVersionControl,
299
299
  renderVersionControlForExport
300
- } from "./chunk-HJRP6PXL.js";
300
+ } from "./chunk-BQVTV4LB.js";
301
301
  import {
302
302
  collapseOrgTree,
303
303
  focusOrgTree
@@ -305,13 +305,13 @@ import {
305
305
  import {
306
306
  renderOrg,
307
307
  renderOrgForExport
308
- } from "./chunk-JRQ4LBQI.js";
308
+ } from "./chunk-B6EUFLRP.js";
309
309
  import {
310
310
  layoutOrg
311
- } from "./chunk-GQVXYRPC.js";
311
+ } from "./chunk-MI6SJJQU.js";
312
312
  import {
313
313
  layoutSitemap
314
- } from "./chunk-54YUDXGP.js";
314
+ } from "./chunk-D7PP35BA.js";
315
315
  import {
316
316
  collapseSitemapTree
317
317
  } from "./chunk-UNCCZ3NU.js";
@@ -319,13 +319,13 @@ import "./chunk-BS7SV7C3.js";
319
319
  import {
320
320
  renderSitemap,
321
321
  renderSitemapForExport
322
- } from "./chunk-U762HK4D.js";
322
+ } from "./chunk-TPEYEOXA.js";
323
323
  import {
324
324
  clearEventLineMuted,
325
325
  focusEventLine,
326
326
  renderEventLine,
327
327
  renderEventLineForExport
328
- } from "./chunk-TQ644YGV.js";
328
+ } from "./chunk-IWTUXGHN.js";
329
329
  import "./chunk-NPWVOFB3.js";
330
330
  import {
331
331
  parseInlineMarkdown,
@@ -349,11 +349,11 @@ import {
349
349
  renderSlopeChart,
350
350
  renderVenn,
351
351
  renderWordCloud
352
- } from "./chunk-RCBHL2B5.js";
352
+ } from "./chunk-3LINSNJT.js";
353
353
  import {
354
354
  layoutBracket
355
355
  } from "./chunk-ABP5BUD6.js";
356
- import "./chunk-POBNN5DP.js";
356
+ import "./chunk-7BBRSOKS.js";
357
357
  import {
358
358
  CHART_TYPE_DESCRIPTIONS,
359
359
  chartTypeParsers,
@@ -363,7 +363,7 @@ import {
363
363
  knownChartTypeIds,
364
364
  parseDgmo,
365
365
  parseVisualization
366
- } from "./chunk-HIVJBESO.js";
366
+ } from "./chunk-VMD2CYVP.js";
367
367
  import "./chunk-EOYPX6SF.js";
368
368
  import {
369
369
  parseCountdown,
@@ -407,15 +407,15 @@ import {
407
407
  } from "./chunk-A2RUBBVT.js";
408
408
  import {
409
409
  parseBracket
410
- } from "./chunk-X3WYJ5T7.js";
410
+ } from "./chunk-3YTAOMMN.js";
411
411
  import {
412
412
  parseBody
413
- } from "./chunk-SMEVBJJJ.js";
413
+ } from "./chunk-IUBCDNT2.js";
414
414
  import "./chunk-BDXC7MDK.js";
415
415
  import {
416
416
  renderLegendSvg,
417
417
  renderLegendSvgFromConfig
418
- } from "./chunk-EEYQFJVK.js";
418
+ } from "./chunk-KFXY5IW2.js";
419
419
  import "./chunk-KMU65FYM.js";
420
420
  import "./chunk-EPDBWATV.js";
421
421
  import {
@@ -424,12 +424,12 @@ import {
424
424
  parseChart,
425
425
  parseDataRowValues,
426
426
  parseExtendedChart
427
- } from "./chunk-WHRIN7N3.js";
427
+ } from "./chunk-HFG7KQOY.js";
428
428
  import "./chunk-2CW5ZTNH.js";
429
429
  import {
430
430
  formatDateLabel,
431
431
  renderTimeline
432
- } from "./chunk-3BQCSQQJ.js";
432
+ } from "./chunk-FJCYK4K3.js";
433
433
  import {
434
434
  computeTimeTicks
435
435
  } from "./chunk-YRYKTYMQ.js";
@@ -438,7 +438,7 @@ import {
438
438
  } from "./chunk-24YPR5EH.js";
439
439
  import {
440
440
  renderLegendD3
441
- } from "./chunk-NJYA4QSN.js";
441
+ } from "./chunk-QVKTAU7P.js";
442
442
  import "./chunk-XCKNFFKM.js";
443
443
  import "./chunk-X6IZP2BD.js";
444
444
  import "./chunk-SEKNYIMO.js";
@@ -460,10 +460,10 @@ import {
460
460
  } from "./chunk-MKFQ5E7J.js";
461
461
  import {
462
462
  parseCycle
463
- } from "./chunk-NFWRIC2V.js";
463
+ } from "./chunk-AR4QVMWG.js";
464
464
  import {
465
465
  parseJourneyMap
466
- } from "./chunk-COPSI54O.js";
466
+ } from "./chunk-PSGSFRRE.js";
467
467
  import {
468
468
  parsePyramid
469
469
  } from "./chunk-M6J25PAZ.js";
@@ -472,10 +472,10 @@ import {
472
472
  } from "./chunk-EWERNTOX.js";
473
473
  import {
474
474
  parseTreemap
475
- } from "./chunk-RNXX2GOQ.js";
475
+ } from "./chunk-HWXUQCDY.js";
476
476
  import {
477
477
  parseBlock
478
- } from "./chunk-JX4RCC6B.js";
478
+ } from "./chunk-V3KHZQPK.js";
479
479
  import "./chunk-XSVWUOUZ.js";
480
480
  import {
481
481
  parseGoal
@@ -483,13 +483,13 @@ import {
483
483
  import {
484
484
  looksLikeMap,
485
485
  parseMap
486
- } from "./chunk-YE7D2S75.js";
486
+ } from "./chunk-HYV6GSXM.js";
487
487
  import {
488
488
  parseBoxesAndLines
489
- } from "./chunk-GXP344YZ.js";
489
+ } from "./chunk-RMTOZALT.js";
490
490
  import {
491
491
  parseSketch
492
- } from "./chunk-NMKLX57Y.js";
492
+ } from "./chunk-SKF7XLCM.js";
493
493
  import "./chunk-NWSPPGIE.js";
494
494
  import {
495
495
  WHITEBOARD_COLORS,
@@ -508,42 +508,42 @@ import {
508
508
  } from "./chunk-IHK3Y2HG.js";
509
509
  import {
510
510
  parseSwimlane
511
- } from "./chunk-PNCKZFPE.js";
511
+ } from "./chunk-J2SQNZ6D.js";
512
512
  import {
513
513
  parseFamily
514
- } from "./chunk-C4W62JZO.js";
514
+ } from "./chunk-IS6WFBX7.js";
515
515
  import "./chunk-QQJUTGQH.js";
516
516
  import {
517
517
  parseMindmap
518
- } from "./chunk-DNMICILX.js";
518
+ } from "./chunk-XQTRGKQ3.js";
519
519
  import {
520
520
  parseEventLine
521
- } from "./chunk-RJYFHEP4.js";
521
+ } from "./chunk-VGSSAMLA.js";
522
522
  import {
523
523
  addDurationToDate,
524
524
  parseTimelineDate
525
525
  } from "./chunk-OYKNMFUY.js";
526
526
  import {
527
527
  parseVersionControl
528
- } from "./chunk-SVQDLYX7.js";
528
+ } from "./chunk-HLVGZXM5.js";
529
529
  import {
530
530
  parseKanban
531
- } from "./chunk-IRVQT4GR.js";
531
+ } from "./chunk-JJQWCI35.js";
532
532
  import {
533
533
  parseC4
534
- } from "./chunk-LC5LY5V2.js";
534
+ } from "./chunk-EP7BT3HU.js";
535
535
  import {
536
536
  INFRA_BEHAVIOR_KEYS,
537
537
  extractSymbols as extractSymbols4,
538
538
  parseInfra
539
- } from "./chunk-CUY56BK4.js";
539
+ } from "./chunk-G3EUQMV4.js";
540
540
  import {
541
541
  parseGantt
542
- } from "./chunk-NUYWNKHH.js";
542
+ } from "./chunk-6QEXWMBP.js";
543
543
  import {
544
544
  normalizePertSourceForShare,
545
545
  resolveOrgImports
546
- } from "./chunk-EK7JYFCL.js";
546
+ } from "./chunk-R7BSF7Z7.js";
547
547
  import {
548
548
  decodeDiagramUrl,
549
549
  decodeViewState,
@@ -552,7 +552,7 @@ import {
552
552
  } from "./chunk-RE27AX7O.js";
553
553
  import {
554
554
  parseDgmoChartType
555
- } from "./chunk-YWRZG6GN.js";
555
+ } from "./chunk-2AM6VA3A.js";
556
556
  import {
557
557
  allTasks,
558
558
  parseRaci
@@ -561,7 +561,7 @@ import {
561
561
  extractPertSymbols,
562
562
  looksLikePert,
563
563
  parsePert
564
- } from "./chunk-AAC3XQWV.js";
564
+ } from "./chunk-37QQXKFV.js";
565
565
  import "./chunk-2SKMEL7V.js";
566
566
  import {
567
567
  parseLiveLink
@@ -588,7 +588,7 @@ import {
588
588
  isSequenceNote,
589
589
  looksLikeSequence,
590
590
  parseSequenceDgmo
591
- } from "./chunk-62VWZ3SE.js";
591
+ } from "./chunk-ZB2Q67NO.js";
592
592
  import {
593
593
  RULE_COUNT,
594
594
  inferParticipantType
@@ -597,23 +597,23 @@ import {
597
597
  extractSymbols,
598
598
  looksLikeFlowchart,
599
599
  parseFlowchart
600
- } from "./chunk-SLO22FPS.js";
601
- import "./chunk-7TF3QOOD.js";
600
+ } from "./chunk-634LDSN6.js";
601
+ import "./chunk-TIVMAITN.js";
602
602
  import {
603
603
  looksLikeState,
604
604
  parseState
605
- } from "./chunk-NY56FM55.js";
605
+ } from "./chunk-XLPJJ35N.js";
606
606
  import "./chunk-NXMESY4J.js";
607
607
  import {
608
608
  extractSymbols as extractSymbols2,
609
609
  looksLikeClassDiagram,
610
610
  parseClassDiagram
611
- } from "./chunk-OSIUWQ3N.js";
611
+ } from "./chunk-WNTPJZU7.js";
612
612
  import {
613
613
  extractSymbols as extractSymbols3,
614
614
  looksLikeERDiagram,
615
615
  parseERDiagram
616
- } from "./chunk-5TZPIKNV.js";
616
+ } from "./chunk-3SLRZKLB.js";
617
617
  import "./chunk-KSZHIAI2.js";
618
618
  import "./chunk-O753JUEZ.js";
619
619
  import {
@@ -624,11 +624,11 @@ import {
624
624
  import {
625
625
  findOrgNodeIdByName,
626
626
  parseOrg
627
- } from "./chunk-FS2LZBHG.js";
627
+ } from "./chunk-UWJP4JSZ.js";
628
628
  import {
629
629
  looksLikeSitemap,
630
630
  parseSitemap
631
- } from "./chunk-5M52RPAS.js";
631
+ } from "./chunk-F26ZPBSF.js";
632
632
  import "./chunk-IYULMRBE.js";
633
633
  import {
634
634
  displayName,
@@ -637,7 +637,7 @@ import {
637
637
  } from "./chunk-NOTA6TEI.js";
638
638
  import {
639
639
  parseWireframe
640
- } from "./chunk-CYF2X3CG.js";
640
+ } from "./chunk-ROCBGUJN.js";
641
641
  import {
642
642
  RACI_ERROR_CODES,
643
643
  RACI_WARNING_CODES,
@@ -650,7 +650,7 @@ import {
650
650
  resolveTagColor,
651
651
  resolveTagValue,
652
652
  tagAttrKey
653
- } from "./chunk-HX2KJEPD.js";
653
+ } from "./chunk-QKJ6MQXW.js";
654
654
  import {
655
655
  ALL_CHART_TYPES,
656
656
  chartTypes,
@@ -1630,6 +1630,279 @@ function startClocks(root = document) {
1630
1630
  window.setInterval(() => tickClocks(document), 1e3);
1631
1631
  }
1632
1632
 
1633
+ // src/validate-diagram.ts
1634
+ var FLOWCHART_STRUCTURE_CODE = "E_FLOWCHART_STRUCTURE";
1635
+ function structureError(line2, message) {
1636
+ return { line: line2, message, severity: "error", code: FLOWCHART_STRUCTURE_CODE };
1637
+ }
1638
+ function validateFlowchartStructure(dgmo) {
1639
+ let parsed;
1640
+ try {
1641
+ parsed = parseFlowchart(dgmo);
1642
+ } catch {
1643
+ return [];
1644
+ }
1645
+ const nodes = parsed.nodes ?? [];
1646
+ const edges = parsed.edges ?? [];
1647
+ if (nodes.length === 0 || edges.length === 0) return [];
1648
+ const out = /* @__PURE__ */ new Map();
1649
+ const inc = /* @__PURE__ */ new Map();
1650
+ for (const n of nodes) {
1651
+ out.set(n.id, []);
1652
+ inc.set(n.id, []);
1653
+ }
1654
+ for (const e of edges) {
1655
+ out.get(e.source)?.push(e.target);
1656
+ inc.get(e.target)?.push(e.source);
1657
+ }
1658
+ const issues = [];
1659
+ for (const n of nodes) {
1660
+ if (n.shape !== "decision") continue;
1661
+ const branches = out.get(n.id)?.length ?? 0;
1662
+ if (branches < 2) {
1663
+ issues.push(
1664
+ structureError(
1665
+ n.lineNumber,
1666
+ `Decision "${n.label}" has ${branches === 0 ? "no" : "only one"} outgoing branch \u2014 a decision needs at least two (e.g. -yes-> / -no->, or specific labels like -retirement-> / -survivor->).`
1667
+ )
1668
+ );
1669
+ }
1670
+ }
1671
+ const starts = nodes.filter(
1672
+ (n) => (inc.get(n.id)?.length ?? 0) === 0 && (out.get(n.id)?.length ?? 0) > 0
1673
+ );
1674
+ const ends = nodes.filter(
1675
+ (n) => (out.get(n.id)?.length ?? 0) === 0 && (inc.get(n.id)?.length ?? 0) > 0
1676
+ );
1677
+ if (starts.length === 0) {
1678
+ issues.push(
1679
+ structureError(
1680
+ 0,
1681
+ "Flowchart has no entry point \u2014 every node has an incoming arrow, so the flow loops with no start. Add a start node that nothing points to."
1682
+ )
1683
+ );
1684
+ }
1685
+ if (ends.length === 0) {
1686
+ issues.push(
1687
+ structureError(
1688
+ 0,
1689
+ "Flowchart has no end \u2014 every node has an outgoing arrow, so the flow never stops. Add a terminal node where the flow ends."
1690
+ )
1691
+ );
1692
+ }
1693
+ if (starts.length > 0 && ends.length > 0) {
1694
+ const forward = reach(
1695
+ starts.map((n) => n.id),
1696
+ out
1697
+ );
1698
+ const backward = reach(
1699
+ ends.map((n) => n.id),
1700
+ inc
1701
+ );
1702
+ for (const n of nodes) {
1703
+ if (!forward.has(n.id) || !backward.has(n.id)) {
1704
+ issues.push(
1705
+ structureError(
1706
+ n.lineNumber,
1707
+ `Node "${n.label}" is not connected to the flow \u2014 it must lie on a path from the start to an end. Wire it into the diagram or remove it.`
1708
+ )
1709
+ );
1710
+ }
1711
+ }
1712
+ }
1713
+ return issues;
1714
+ }
1715
+ function reach(seeds, adj) {
1716
+ const seen = new Set(seeds);
1717
+ const queue = [...seeds];
1718
+ while (queue.length > 0) {
1719
+ const id = queue.shift();
1720
+ for (const next of adj.get(id) ?? []) {
1721
+ if (!seen.has(next)) {
1722
+ seen.add(next);
1723
+ queue.push(next);
1724
+ }
1725
+ }
1726
+ }
1727
+ return seen;
1728
+ }
1729
+ function validateDiagram(source, options = {}) {
1730
+ const chartType = parseDgmoChartType(source);
1731
+ let diagnostics;
1732
+ if (chartType === "map" && options.mapData) {
1733
+ try {
1734
+ diagnostics = resolveMap(
1735
+ parseMap(source),
1736
+ options.mapData
1737
+ ).diagnostics.slice();
1738
+ } catch {
1739
+ diagnostics = parseDgmo(source).diagnostics.slice();
1740
+ }
1741
+ } else {
1742
+ diagnostics = parseDgmo(source).diagnostics.slice();
1743
+ }
1744
+ if (chartType === "flowchart") {
1745
+ diagnostics.push(...validateFlowchartStructure(source));
1746
+ }
1747
+ const blocking = (d) => d.severity === "error" || d.code === INVALID_COLOR_CODE;
1748
+ return {
1749
+ chartType,
1750
+ errors: diagnostics.filter(blocking),
1751
+ warnings: diagnostics.filter((d) => !blocking(d))
1752
+ };
1753
+ }
1754
+ var plural = (n, word) => `${n} ${word}${n > 1 ? "s" : ""}`;
1755
+ function formatDiagramValidation(v) {
1756
+ const { chartType, errors, warnings } = v;
1757
+ if (errors.length === 0 && warnings.length === 0) {
1758
+ return {
1759
+ text: `Valid ${chartType ? `${chartType} diagram` : "diagram"} \u2014 no errors or warnings.`,
1760
+ isError: false
1761
+ };
1762
+ }
1763
+ const typeLabel = chartType ? ` in ${chartType} diagram` : "";
1764
+ const parts = [];
1765
+ if (errors.length > 0) {
1766
+ parts.push(
1767
+ `${plural(errors.length, "error")}${warnings.length > 0 ? `, ${plural(warnings.length, "warning")}` : ""}${typeLabel}
1768
+ `
1769
+ );
1770
+ parts.push("Errors:");
1771
+ for (const e of errors) parts.push(` ${formatDgmoError(e)}`);
1772
+ }
1773
+ if (warnings.length > 0) {
1774
+ if (errors.length === 0) {
1775
+ parts.push(
1776
+ `Valid with ${plural(warnings.length, "warning")}${typeLabel}
1777
+ `
1778
+ );
1779
+ } else {
1780
+ parts.push("");
1781
+ }
1782
+ parts.push("Warnings:");
1783
+ for (const w of warnings) parts.push(` ${formatDgmoError(w)}`);
1784
+ }
1785
+ return { text: parts.join("\n"), isError: errors.length > 0 };
1786
+ }
1787
+
1788
+ // src/agent-reference.ts
1789
+ function parseTypeAliases(markdown) {
1790
+ const m = markdown.match(/<!--\s*TYPE-ALIASES:\s*([^>]*?)-->/);
1791
+ const map = /* @__PURE__ */ new Map();
1792
+ if (!m) return map;
1793
+ for (const pair of (m[1] ?? "").trim().split(/\s+/)) {
1794
+ const [alias, target] = pair.split("=");
1795
+ if (alias && target) map.set(alias.trim(), target.trim());
1796
+ }
1797
+ return map;
1798
+ }
1799
+ function extractColorRule(markdown) {
1800
+ const m = markdown.match(
1801
+ /<!--\s*COLORS start\s*-->([\s\S]*?)<!--\s*COLORS end\s*-->/
1802
+ );
1803
+ return m ? (m[1] ?? "").trim() : null;
1804
+ }
1805
+ function extractTitleRule(markdown) {
1806
+ const m = markdown.match(
1807
+ /<!--\s*TITLE start\s*-->([\s\S]*?)<!--\s*TITLE end\s*-->/
1808
+ );
1809
+ return m ? (m[1] ?? "").trim() : null;
1810
+ }
1811
+ function extractCategorizeRule(markdown) {
1812
+ const m = markdown.match(
1813
+ /<!--\s*CATEGORIZE start\s*-->([\s\S]*?)<!--\s*CATEGORIZE end\s*-->/
1814
+ );
1815
+ return m ? (m[1] ?? "").trim() : null;
1816
+ }
1817
+ function extractSection(markdown, chartType) {
1818
+ const aliases = parseTypeAliases(markdown);
1819
+ const resolved = aliases.get(chartType) ?? chartType;
1820
+ const startRe = new RegExp(`<!--\\s*TYPE:${resolved}\\s*-->`);
1821
+ const startMatch = startRe.exec(markdown);
1822
+ if (!startMatch) return null;
1823
+ const after = startMatch.index + startMatch[0].length;
1824
+ const rest = markdown.slice(after);
1825
+ const nextType = rest.search(/<!--\s*TYPE:[a-z0-9-]+\s*-->/);
1826
+ const nextH2 = rest.search(/^## /m);
1827
+ const ends = [nextType, nextH2].filter((n) => n !== -1);
1828
+ const end = ends.length ? after + Math.min(...ends) : markdown.length;
1829
+ return markdown.slice(after, end).trim();
1830
+ }
1831
+ function referenceForChartType(markdown, chartType) {
1832
+ const raw = extractSection(markdown, chartType);
1833
+ if (!raw) return null;
1834
+ const section = raw.replace(
1835
+ /[ \t]*<!--\s*TIPS (?:start|end)\s*-->[ \t]*\n?/g,
1836
+ ""
1837
+ );
1838
+ const universal = [
1839
+ extractColorRule(markdown),
1840
+ extractTitleRule(markdown),
1841
+ extractCategorizeRule(markdown)
1842
+ ].filter(Boolean);
1843
+ return universal.length ? `${universal.join("\n\n")}
1844
+
1845
+ ---
1846
+
1847
+ ${section}` : section;
1848
+ }
1849
+ function formatChartTypeList() {
1850
+ const meta = new Map(chartTypes.map((c) => [c.id, c]));
1851
+ const types = Object.keys(CHART_TYPE_DESCRIPTIONS).filter(
1852
+ (id) => !meta.get(id)?.internal
1853
+ );
1854
+ const lines = types.map((id) => {
1855
+ const desc = CHART_TYPE_DESCRIPTIONS[id];
1856
+ const mark = meta.get(id)?.beta ? " [beta \u2014 expect rough edges]" : "";
1857
+ return desc ? `- ${id}${mark}: ${desc}` : `- ${id}${mark}`;
1858
+ });
1859
+ return `Supported chart types (${types.length}):
1860
+
1861
+ ${lines.join("\n")}`;
1862
+ }
1863
+ function isExampleFor(name, chartType) {
1864
+ const slash = name.indexOf("/");
1865
+ if (slash !== -1) return name.slice(0, slash) === chartType;
1866
+ return name === chartType || name.startsWith(chartType + "-");
1867
+ }
1868
+ var EXAMPLES_SHOWN = 5;
1869
+ async function formatExamples(names, read, chartType) {
1870
+ const sorted = [...names].sort();
1871
+ if (!chartType) {
1872
+ return {
1873
+ text: `Available examples (${sorted.length}):
1874
+
1875
+ ${sorted.map((n) => `- ${n}`).join("\n")}
1876
+
1877
+ Call get_examples with a chart_type to see the full DGMO source.`,
1878
+ isError: false
1879
+ };
1880
+ }
1881
+ const matching = sorted.filter((n) => isExampleFor(n, chartType));
1882
+ if (matching.length === 0) {
1883
+ return {
1884
+ text: `No examples found for "${chartType}". Use get_examples() without arguments to see all available examples.`,
1885
+ isError: true
1886
+ };
1887
+ }
1888
+ const parts = [];
1889
+ for (const n of matching.slice(0, EXAMPLES_SHOWN)) {
1890
+ const source = await read(n);
1891
+ parts.push(`## ${n}
1892
+
1893
+ \`\`\`dgmo
1894
+ ${source.trim()}
1895
+ \`\`\``);
1896
+ }
1897
+ let text = parts.join("\n\n---\n\n");
1898
+ if (matching.length > EXAMPLES_SHOWN) {
1899
+ text += `
1900
+
1901
+ (Showing ${EXAMPLES_SHOWN} of ${matching.length} examples)`;
1902
+ }
1903
+ return { text, isError: false };
1904
+ }
1905
+
1633
1906
  // src/map/load-data.ts
1634
1907
  async function loadNodeBuiltins() {
1635
1908
  const [{ readFile }, { fileURLToPath }, { dirname, resolve }] = await Promise.all([
@@ -2174,15 +2447,170 @@ function fontPortabilityWarning(runs) {
2174
2447
  }).join(", ");
2175
2448
  return `This diagram uses characters the bundled Inter font does not contain: ${described}. They were drawn with a font installed on this machine, so the image is correct here \u2014 but a machine without a font for those characters draws nothing at all, with no error. Install a font covering them wherever this runs, or check the output there.`;
2176
2449
  }
2450
+
2451
+ // src/cloud-space.ts
2452
+ var CLOUD_API = "https://api.diagrammo.app";
2453
+ var CloudSpaceError = class extends Error {
2454
+ constructor(message, status) {
2455
+ super(message);
2456
+ this.status = status;
2457
+ this.name = "CloudSpaceError";
2458
+ }
2459
+ status;
2460
+ };
2461
+ function describeStatus(status, detail) {
2462
+ const why = detail ? `: ${detail.replace(/\.+$/, "")}` : "";
2463
+ switch (status) {
2464
+ case 401:
2465
+ return `The API key was refused (401)${why}. Check DGMO_API_KEY \u2014 it may be mistyped or revoked.`;
2466
+ case 403:
2467
+ return `The API key may not do this (403)${why}.`;
2468
+ case 404:
2469
+ return `Not found (404)${why}. Check the space, folder, title or id.`;
2470
+ case 409:
2471
+ return `Another write to this diagram landed first (409)${why}. Try again.`;
2472
+ default:
2473
+ return `The Cloud API answered ${status}${why}.`;
2474
+ }
2475
+ }
2476
+ async function call(target, method, rest, body) {
2477
+ const doFetch = target.fetch ?? fetch;
2478
+ const url = `${CLOUD_API}/spaces/${encodeURIComponent(target.spaceId)}${rest}`;
2479
+ let res;
2480
+ try {
2481
+ res = await doFetch(url, {
2482
+ method,
2483
+ headers: {
2484
+ authorization: `Bearer ${target.apiKey}`,
2485
+ accept: "application/json",
2486
+ ...body === void 0 ? {} : { "content-type": "application/json" }
2487
+ },
2488
+ ...body === void 0 ? {} : { body: JSON.stringify(body) }
2489
+ });
2490
+ } catch (err) {
2491
+ throw new CloudSpaceError(
2492
+ `Could not reach ${CLOUD_API}: ${err.message}`
2493
+ );
2494
+ }
2495
+ const text = await res.text();
2496
+ let data;
2497
+ try {
2498
+ data = text ? JSON.parse(text) : null;
2499
+ } catch {
2500
+ data = null;
2501
+ }
2502
+ if (!res.ok) {
2503
+ const problem = data ?? {};
2504
+ const detail = typeof problem.detail === "string" ? problem.detail : typeof problem.title === "string" ? problem.title : "";
2505
+ throw new CloudSpaceError(describeStatus(res.status, detail), res.status);
2506
+ }
2507
+ return { status: res.status, data };
2508
+ }
2509
+ var sameName = (a, b) => a.replace(/[A-Z]/g, (c) => c.toLowerCase()) === b.replace(/[A-Z]/g, (c) => c.toLowerCase());
2510
+ var rootIsNull = (id) => id === "" ? null : id;
2511
+ function folderPath(folders, folderId) {
2512
+ const byId = new Map(folders.map((f) => [f.id, f]));
2513
+ const names = [];
2514
+ const start = rootIsNull(folderId);
2515
+ let cur = start === null ? void 0 : byId.get(start);
2516
+ while (cur && names.length <= folders.length) {
2517
+ names.unshift(cur.name);
2518
+ const up = rootIsNull(cur.parentId);
2519
+ cur = up === null ? void 0 : byId.get(up);
2520
+ }
2521
+ return names.join("/");
2522
+ }
2523
+ function resolveFolder(folders, path) {
2524
+ const parts = (path ?? "").split("/").map((p) => p.trim()).filter(Boolean);
2525
+ let parentId = null;
2526
+ for (const name of parts) {
2527
+ const hit = folders.find(
2528
+ (f) => rootIsNull(f.parentId) === parentId && sameName(f.name, name)
2529
+ );
2530
+ if (!hit)
2531
+ throw new CloudSpaceError(
2532
+ `No folder "${parts.join("/")}" in this space (stopped at "${name}").`,
2533
+ 404
2534
+ );
2535
+ parentId = hit.id;
2536
+ }
2537
+ return parentId;
2538
+ }
2539
+ var contentsOf = (target) => call(target, "GET", "/contents").then((r) => r.data);
2540
+ async function putSpaceDiagram(target, diagram) {
2541
+ const contents = await contentsOf(target);
2542
+ const folderId = resolveFolder(contents.folders, diagram.folder);
2543
+ const { status, data } = await call(target, "PUT", "/diagrams", {
2544
+ title: diagram.title,
2545
+ source: diagram.source,
2546
+ chartType: parseDgmoChartType(diagram.source),
2547
+ folderId
2548
+ });
2549
+ return {
2550
+ action: status === 201 ? "created" : "updated",
2551
+ id: data.id,
2552
+ title: data.title,
2553
+ folder: folderPath(contents.folders, data.folderId),
2554
+ version: data.version
2555
+ };
2556
+ }
2557
+ async function getSpaceDiagram(target, which) {
2558
+ const contents = await contentsOf(target);
2559
+ let id;
2560
+ if ("id" in which) id = which.id;
2561
+ else {
2562
+ const folderId = resolveFolder(contents.folders, which.folder);
2563
+ const hit = contents.items.find(
2564
+ (d) => rootIsNull(d.folderId) === folderId && sameName(d.title, which.title)
2565
+ );
2566
+ if (!hit)
2567
+ throw new CloudSpaceError(
2568
+ `No diagram titled "${which.title}" in ${folderId === null ? "the space root" : `folder "${which.folder}"`}.`,
2569
+ 404
2570
+ );
2571
+ id = hit.id;
2572
+ }
2573
+ const { data } = await call(
2574
+ target,
2575
+ "GET",
2576
+ `/diagrams/${encodeURIComponent(id)}`
2577
+ );
2578
+ return {
2579
+ id: data.id,
2580
+ title: data.title,
2581
+ folder: folderPath(contents.folders, data.folderId),
2582
+ chartType: data.chartType,
2583
+ version: data.version,
2584
+ updatedAt: data.updatedAt,
2585
+ source: data.source
2586
+ };
2587
+ }
2588
+ async function listSpaceDiagrams(target) {
2589
+ const contents = await contentsOf(target);
2590
+ return contents.items.map((d) => ({
2591
+ id: d.id,
2592
+ title: d.title,
2593
+ folder: folderPath(contents.folders, d.folderId),
2594
+ chartType: d.chartType,
2595
+ version: d.version,
2596
+ updatedAt: d.updatedAt
2597
+ })).sort(
2598
+ (a, b) => `${a.folder}/${a.title}`.localeCompare(`${b.folder}/${b.title}`)
2599
+ );
2600
+ }
2177
2601
  export {
2178
2602
  ALL_CHART_TYPES,
2179
2603
  ARROW_DIAGNOSTIC_CODES,
2180
2604
  CHART_TYPE_DESCRIPTIONS,
2605
+ CLOUD_API,
2181
2606
  CONTAINER_FILL_OPACITY,
2182
2607
  CONTAINER_STROKE_OPACITY,
2183
2608
  CONTAINER_STROKE_WIDTH,
2184
2609
  CYLINDER_RY,
2610
+ CloudSpaceError,
2185
2611
  DEFAULT_FONT_NAME,
2612
+ EXAMPLES_SHOWN,
2613
+ FLOWCHART_STRUCTURE_CODE,
2186
2614
  FONT_FAMILY,
2187
2615
  DEFAULT_DIM_OPACITY as HOVER_DIM_OPACITY,
2188
2616
  IMAGE_NOT_UPLOADED,
@@ -2282,11 +2710,15 @@ export {
2282
2710
  emitWhiteboardElement,
2283
2711
  encodeDiagramUrl,
2284
2712
  encodeViewState,
2713
+ extractCategorizeRule,
2285
2714
  extractSymbols2 as extractClassSymbols,
2715
+ extractColorRule,
2286
2716
  extractSymbols3 as extractErSymbols,
2287
2717
  extractSymbols as extractFlowchartSymbols,
2288
2718
  extractSymbols4 as extractInfraSymbols,
2289
2719
  extractPertSymbols,
2720
+ extractSection,
2721
+ extractTitleRule,
2290
2722
  findOrgNodeIdByName,
2291
2723
  fitWhiteboardLabel,
2292
2724
  fitWrapped,
@@ -2294,8 +2726,11 @@ export {
2294
2726
  focusEventLine,
2295
2727
  focusOrgTree,
2296
2728
  fontPortabilityWarning,
2729
+ formatChartTypeList,
2297
2730
  formatDateLabel,
2298
2731
  formatDgmoError,
2732
+ formatDiagramValidation,
2733
+ formatExamples,
2299
2734
  formatOffsetLabel,
2300
2735
  getAllChartTypes,
2301
2736
  getAvailablePalettes,
@@ -2307,6 +2742,7 @@ export {
2307
2742
  getRenderCategory,
2308
2743
  getSeriesColors,
2309
2744
  getSimpleChartLegendGroups,
2745
+ getSpaceDiagram,
2310
2746
  groupMessagesBySection,
2311
2747
  hexToHSL,
2312
2748
  hexToHSLString,
@@ -2316,6 +2752,7 @@ export {
2316
2752
  inkOutlinePath,
2317
2753
  invalidColorDiagnostic,
2318
2754
  isArchiveColumn,
2755
+ isExampleFor,
2319
2756
  isExtendedChartType,
2320
2757
  isInvalidColorToken,
2321
2758
  isRecognizedColorName,
@@ -2350,6 +2787,7 @@ export {
2350
2787
  layoutTreemapRadial,
2351
2788
  layoutWireframe,
2352
2789
  legendEntryWidth,
2790
+ listSpaceDiagrams,
2353
2791
  loadMapData,
2354
2792
  looksLikeClassDiagram,
2355
2793
  looksLikeERDiagram,
@@ -2421,15 +2859,18 @@ export {
2421
2859
  parseTechRadar,
2422
2860
  parseTimelineDate,
2423
2861
  parseTreemap,
2862
+ parseTypeAliases,
2424
2863
  parseVersionControl,
2425
2864
  parseVisualization,
2426
2865
  parseWhiteboard,
2427
2866
  parseWireframe,
2867
+ putSpaceDiagram,
2428
2868
  cellAppendMarker as raciCellAppendMarker,
2429
2869
  cellCycle as raciCellCycle,
2430
2870
  cellRemove as raciCellRemove,
2431
2871
  cellReplace as raciCellReplace,
2432
2872
  rebuildMapProjection,
2873
+ referenceForChartType,
2433
2874
  registerPalette,
2434
2875
  relayoutPert,
2435
2876
  render,
@@ -2562,6 +3003,8 @@ export {
2562
3003
  uncoveredCharacters,
2563
3004
  parseDgmo as validate,
2564
3005
  validateComputed,
3006
+ validateDiagram,
3007
+ validateFlowchartStructure,
2565
3008
  validateInfra,
2566
3009
  validateLabelCharacters,
2567
3010
  validateThemeFile,