@pi-outpost/embed 0.40.0 → 0.40.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/dist/{CodeEditor-Cb6i9oIs.cjs → CodeEditor-B699PZlx.cjs} +1 -1
  2. package/dist/{CodeEditor-2Vx8PHAy.js → CodeEditor-CxKTvrhG.js} +5 -5
  3. package/dist/PdfViewer-COOgvLyp.js +428 -0
  4. package/dist/PdfViewer-Dyou2VMw.cjs +1 -0
  5. package/dist/{abnfDiagram-WEYOIA3C-B2ss_Vsq.js → abnfDiagram-WEYOIA3C-B_dTFm2g.js} +5 -5
  6. package/dist/{abnfDiagram-WEYOIA3C-DMn87p58.cjs → abnfDiagram-WEYOIA3C-Dk2VD3Iw.cjs} +1 -1
  7. package/dist/{arc-CLGGhOeW.js → arc-37kcMiGl.js} +1 -1
  8. package/dist/{arc-Dh2Zrypi.cjs → arc-C7P0rHQr.cjs} +1 -1
  9. package/dist/architecture-WOLXFQ4H-Dg4VU8sZ.js +2 -0
  10. package/dist/architecture-WOLXFQ4H-u_y_0ZVC.cjs +1 -0
  11. package/dist/architectureDiagram-ZHVYKT53-Bud-mHjo.cjs +36 -0
  12. package/dist/{architectureDiagram-ZHVYKT53-C5QppHvM.js → architectureDiagram-ZHVYKT53-CslNYmQN.js} +48 -64
  13. package/dist/{blockDiagram-RJAE7QA3-DOvlohR9.js → blockDiagram-RJAE7QA3-Dgm9J6pS.js} +27 -38
  14. package/dist/{blockDiagram-RJAE7QA3-CODM9GdZ.cjs → blockDiagram-RJAE7QA3-lEBn-_Yn.cjs} +2 -2
  15. package/dist/{c4Diagram-XDPPPE54-eTVK3Kzy.cjs → c4Diagram-XDPPPE54-BKNqVY-U.cjs} +1 -1
  16. package/dist/{c4Diagram-XDPPPE54-8dwnUpAO.js → c4Diagram-XDPPPE54-rbzhqhW5.js} +8 -8
  17. package/dist/channel-AESWk0Yw.cjs +1 -0
  18. package/dist/{channel-B1lf-ehw.js → channel-CEoRf1uz.js} +1 -1
  19. package/dist/{chunk-2E7WHVMD-DkV-cet-.cjs → chunk-2E7WHVMD-BNsJOdNP.cjs} +1 -1
  20. package/dist/{chunk-2E7WHVMD-Dg_Sckag.js → chunk-2E7WHVMD-Vo-POJc_.js} +3 -3
  21. package/dist/{chunk-4EMNKR2T-C2XrT3x_.js → chunk-4EMNKR2T-BIO9veC4.js} +1 -1
  22. package/dist/{chunk-4EMNKR2T-DfeN909d.cjs → chunk-4EMNKR2T-CGAdq4EA.cjs} +1 -1
  23. package/dist/{chunk-55XCU76K-d9D4PS_7.cjs → chunk-55XCU76K-IpMfjRYv.cjs} +1 -1
  24. package/dist/{chunk-55XCU76K-CADZXRVb.js → chunk-55XCU76K-o8OgDLPD.js} +3 -3
  25. package/dist/{chunk-7S6XSTFO-DV8etStf.js → chunk-7S6XSTFO-DrDRohsE.js} +4 -4
  26. package/dist/{chunk-7S6XSTFO-DJ37SdG5.cjs → chunk-7S6XSTFO-ejBVk-tI.cjs} +1 -1
  27. package/dist/{chunk-AQDTSKZB-DElrkKED.cjs → chunk-AQDTSKZB-B-MpZ-y2.cjs} +7 -7
  28. package/dist/{chunk-AQDTSKZB-CUCC855j.js → chunk-AQDTSKZB-DUZx386i.js} +14 -73
  29. package/dist/chunk-DSNLSHJZ-BxQ7lMXY.cjs +129 -0
  30. package/dist/{chunk-DSNLSHJZ-Bicto10E.js → chunk-DSNLSHJZ-DPpiuUZK.js} +627 -624
  31. package/dist/{chunk-HAGFOTED-Dykk1LyE.cjs → chunk-HAGFOTED-BUPxFGdn.cjs} +1 -1
  32. package/dist/{chunk-HAGFOTED-BjDmRfgG.js → chunk-HAGFOTED-ceXO12G4.js} +6 -6
  33. package/dist/{chunk-HNE4Q36P-C-j5Nn9f.cjs → chunk-HNE4Q36P-CCHAgwa3.cjs} +1 -1
  34. package/dist/{chunk-HNE4Q36P-5u7dvjgt.js → chunk-HNE4Q36P-uON_vFhT.js} +6 -6
  35. package/dist/{chunk-NGNAAXSQ-kHtfTQLE.cjs → chunk-NGNAAXSQ-BaBpWF2S.cjs} +6 -6
  36. package/dist/{chunk-NGNAAXSQ-DM0DL2MX.js → chunk-NGNAAXSQ-uUWLDjAm.js} +46 -50
  37. package/dist/{chunk-NQOKRVIF-CpOc5MEh.cjs → chunk-NQOKRVIF-DcZqKWzv.cjs} +1 -1
  38. package/dist/{chunk-NQOKRVIF-DUgN94ic.js → chunk-NQOKRVIF-DmOxzSOQ.js} +9 -9
  39. package/dist/{chunk-UHW7PFBP-NbzzxkEP.js → chunk-UHW7PFBP-BTk1ZC8L.js} +1 -1
  40. package/dist/{chunk-UHW7PFBP-SZ8KvGM0.cjs → chunk-UHW7PFBP-Bays5Zi8.cjs} +1 -1
  41. package/dist/{chunk-VQ5W62QI-D3c9tcDC.js → chunk-VQ5W62QI-Bvcxpp51.js} +2 -2
  42. package/dist/{chunk-VQ5W62QI-CsW6i5Ev.cjs → chunk-VQ5W62QI-Dw9Kffnl.cjs} +1 -1
  43. package/dist/{chunk-WQQL4CDK-l3Yf4SAX.js → chunk-WQQL4CDK-C3yDIFZ3.js} +8 -8
  44. package/dist/{chunk-WQQL4CDK-TvwGUFeE.cjs → chunk-WQQL4CDK-DxEEyQzx.cjs} +1 -1
  45. package/dist/{chunk-XXDRQBXY-IzhWXllg.js → chunk-XXDRQBXY-CNtMgRT_.js} +1 -1
  46. package/dist/{chunk-XXDRQBXY-yMT3rT5Y.cjs → chunk-XXDRQBXY-DfReYcER.cjs} +1 -1
  47. package/dist/{chunk-YZO67HFG-CLf5aoHk.cjs → chunk-YZO67HFG-DCQIFG8j.cjs} +1 -1
  48. package/dist/{chunk-YZO67HFG-DWHo0c6-.js → chunk-YZO67HFG-WF3jklBn.js} +2 -2
  49. package/dist/{chunk-ZAUX2LTX-BwjEPfG0.cjs → chunk-ZAUX2LTX-DIQkgUFr.cjs} +1 -1
  50. package/dist/{chunk-ZAUX2LTX-COHXRsvU.js → chunk-ZAUX2LTX-P8LAwm_U.js} +3 -3
  51. package/dist/{chunk-ZCHMQSOR-Cw-9SNln.js → chunk-ZCHMQSOR-BbO7eY2w.js} +78 -80
  52. package/dist/chunk-ZCHMQSOR-Cg8zPt0w.cjs +1 -0
  53. package/dist/{classDiagram-v2-4MYWR3UA-vsmkJ0Cx.js → classDiagram-v2-4MYWR3UA-DIjHIULx.js} +16 -16
  54. package/dist/{classDiagram-v2-4MYWR3UA-wLbwKHvU.cjs → classDiagram-v2-4MYWR3UA-DyMM0DMP.cjs} +2 -2
  55. package/dist/{clike-8rZWBES0.cjs → clike-I-fVVl3d.cjs} +1 -1
  56. package/dist/{clike-D-dOQnrm.js → clike-VB7owi7S.js} +1 -5
  57. package/dist/{conversationExport-BmvGyAf-.cjs → conversationExport-Co-E1-fF.cjs} +1 -1
  58. package/dist/{conversationExport-CBiBLWVk.js → conversationExport-KyCOByU5.js} +7 -8
  59. package/dist/conversationHistory-BYekdNUk.cjs +31 -0
  60. package/dist/conversationHistory-DPZF00Qz.js +21639 -0
  61. package/dist/{core-D_MCdR2m.js → core-BGZbe1UJ.js} +2 -6
  62. package/dist/{core-BrupIPpc.cjs → core-CmCLKhYZ.cjs} +2 -2
  63. package/dist/{cose-bilkent-JH36ORCC-qPjrc3_9.js → cose-bilkent-JH36ORCC-DjbvRWCz.js} +58 -71
  64. package/dist/cose-bilkent-JH36ORCC-KeNQ2SMA.cjs +1 -0
  65. package/dist/cynefin-EF2NZ3EQ-BBhIrDKD.cjs +1 -0
  66. package/dist/cynefin-EF2NZ3EQ-DDZjUykJ.js +2 -0
  67. package/dist/{cynefinDiagram-WF24UDRP-CHBmFbqk.cjs → cynefinDiagram-WF24UDRP-BC09SRT2.cjs} +1 -1
  68. package/dist/{cynefinDiagram-WF24UDRP-BhWkOxCi.js → cynefinDiagram-WF24UDRP-DEFG-MNh.js} +5 -5
  69. package/dist/cytoscape.esm-BN8NndIc.cjs +321 -0
  70. package/dist/{cytoscape.esm-Cq7KPj0t.js → cytoscape.esm-BmhLauwj.js} +412 -513
  71. package/dist/dagre-NK4GIZVX-D0_oLrA9.cjs +4 -0
  72. package/dist/{dagre-NK4GIZVX-CJfLDa-C.js → dagre-NK4GIZVX-D6Xuc_Nw.js} +43 -47
  73. package/dist/{diagram-CBK3MWTC-2pAHlnGJ.js → diagram-CBK3MWTC-CuUrHQAz.js} +7 -7
  74. package/dist/{diagram-CBK3MWTC-B_5GBGbb.cjs → diagram-CBK3MWTC-DbXGbFMz.cjs} +1 -1
  75. package/dist/{diagram-I5XIIV2D-CQ_Y9NJs.js → diagram-I5XIIV2D-DbwsxgDf.js} +5 -5
  76. package/dist/{diagram-I5XIIV2D-BPxYY-Kp.cjs → diagram-I5XIIV2D-Dom9usNq.cjs} +1 -1
  77. package/dist/{diagram-ODIL2UCW-pyDNtrY0.cjs → diagram-ODIL2UCW-CLSAtgxG.cjs} +2 -2
  78. package/dist/{diagram-ODIL2UCW-BJL-7QWJ.js → diagram-ODIL2UCW-CSnuo9bJ.js} +7 -15
  79. package/dist/{diagram-PFBEJUXE-CXd3x3TA.js → diagram-PFBEJUXE-ChA6KYWw.js} +6 -6
  80. package/dist/{diagram-PFBEJUXE-BUvTWvw5.cjs → diagram-PFBEJUXE-DAIw33Bx.cjs} +1 -1
  81. package/dist/{diagram-RJA3I4VV-T3Hd1koB.cjs → diagram-RJA3I4VV-Bt-BxYua.cjs} +1 -1
  82. package/dist/{diagram-RJA3I4VV-eMNhs7pW.js → diagram-RJA3I4VV-DCygetH_.js} +5 -5
  83. package/dist/{diagram-TYUNFSNR-CWpFSB2K.js → diagram-TYUNFSNR-BSq4ni3b.js} +22 -35
  84. package/dist/diagram-TYUNFSNR-Dy2nkVin.cjs +200 -0
  85. package/dist/{dist-Dvqp7T4I.cjs → dist-2ynRxsSC.cjs} +1 -1
  86. package/dist/{dist-B7I27gkN.cjs → dist-AeGgfThs.cjs} +1 -1
  87. package/dist/{dist-Dwv2VYAL.cjs → dist-BB5r6V4R.cjs} +1 -1
  88. package/dist/{dist-BvsCdwbL.cjs → dist-BDenKBYL.cjs} +1 -1
  89. package/dist/{dist-BhXQJ0x3.js → dist-BJHB0x8Y.js} +12 -18
  90. package/dist/{dist-BWlGU9XM.js → dist-BTD5L343.js} +3 -3
  91. package/dist/{dist-Dr4zY56l.js → dist-BWEDf1a-.js} +2 -2
  92. package/dist/{dist-BlD6NhiG.js → dist-BWVp6Da-.js} +4 -7
  93. package/dist/{dist-B8gmxwh-.cjs → dist-C6eKaA9j.cjs} +1 -1
  94. package/dist/{dist-C0_uLrCb.cjs → dist-CCIM600Y.cjs} +1 -1
  95. package/dist/{dist-BZcglaBe.cjs → dist-CFf_g4kk.cjs} +1 -1
  96. package/dist/{dist-DPXHxuWb.js → dist-CGZbBQje.js} +2 -2
  97. package/dist/{dist-Xjm88mbq.js → dist-CIBKGNWD.js} +4 -4
  98. package/dist/{dist-DqbI0un6.cjs → dist-CQNYwGEy.cjs} +1 -1
  99. package/dist/{dist-CyFPTQ2l.cjs → dist-CT7H4C9g.cjs} +1 -1
  100. package/dist/{dist-BBUKMRrs.js → dist-CYUF5YPj.js} +2 -2
  101. package/dist/{dist-DWv23S35.js → dist-CZhfI1u7.js} +1 -1
  102. package/dist/{dist-CHKg1Qb9.js → dist-ChWDi62w.js} +3 -3
  103. package/dist/dist-CmF-TINl.cjs +1 -0
  104. package/dist/{dist-C8jjSrIs.cjs → dist-Cz8GulTe.cjs} +1 -1
  105. package/dist/{dist-qNFo_ASR.cjs → dist-D6LkseRA.cjs} +1 -1
  106. package/dist/{dist-BZjcsPqi.cjs → dist-DEZD35IP.cjs} +7 -7
  107. package/dist/{dist-DZrtSp8H.js → dist-DNg4hNu7.js} +3 -3
  108. package/dist/dist-D_oMTxAl.cjs +2 -0
  109. package/dist/{dist-BfQGuM1r.js → dist-DaJf_JYz.js} +4 -4
  110. package/dist/dist-Dpu_aN4m.cjs +1 -0
  111. package/dist/{dist-CA6ERWRG.js → dist-DszFZlYh.js} +2 -2
  112. package/dist/{dist-qq9a_ch2.js → dist-Kg2QsUg8.js} +4 -4
  113. package/dist/{dist-FSzij9Rn.js → dist-LM11INLG.js} +2 -2
  114. package/dist/{dist-C9dtxVRR.cjs → dist-M4fo1U45.cjs} +1 -1
  115. package/dist/{dist-BhNvvg0I.js → dist-gn9y7Yb8.js} +116 -119
  116. package/dist/{dist-B0lO3k1f.js → dist-hv72z6I6.js} +3 -3
  117. package/dist/{dist-Bppoi_v9.js → dist-lPCEVnGX.js} +2 -2
  118. package/dist/{dist-D8I4FQ-Q.cjs → dist-rfjaCa2V.cjs} +1 -1
  119. package/dist/{docxExport-BGYavEI-.js → docxExport-DpgcioIA.js} +2 -2
  120. package/dist/{docxExport-B24fOHFl.cjs → docxExport-ZYp4tZ7k.cjs} +1 -1
  121. package/dist/{ebnfDiagram-V4P3TTPT-DAoJZ85k.cjs → ebnfDiagram-V4P3TTPT-6xhHNshj.cjs} +1 -1
  122. package/dist/{ebnfDiagram-V4P3TTPT-B7cCNP3X.js → ebnfDiagram-V4P3TTPT-e4I3Otpa.js} +5 -5
  123. package/dist/{elk-QONTBCTQ-BYnAuRAH.js → elk-QONTBCTQ-B8RYU1Ay.js} +746 -1241
  124. package/dist/elk-QONTBCTQ-hBYUI6Nr.cjs +27 -0
  125. package/dist/{erDiagram-KYQIGQAA-BKkxORU3.js → erDiagram-KYQIGQAA-BTNANm6p.js} +14 -14
  126. package/dist/{erDiagram-KYQIGQAA-BIlejnVi.cjs → erDiagram-KYQIGQAA-DsqyoDOz.cjs} +1 -1
  127. package/dist/eventmodeling-K75KTNOO-Ckh9Djrw.js +2 -0
  128. package/dist/eventmodeling-K75KTNOO-DKYlYG2c.cjs +1 -0
  129. package/dist/flowDiagram-IUGLLWBU-BJlVRCj8.js +15 -0
  130. package/dist/flowDiagram-IUGLLWBU-CsC_IEV_.cjs +1 -0
  131. package/dist/{ganttDiagram-R7GPNTJY-BGcXo1KA.cjs → ganttDiagram-R7GPNTJY-B1juClwW.cjs} +2 -2
  132. package/dist/{ganttDiagram-R7GPNTJY-dcubAqZI.js → ganttDiagram-R7GPNTJY-CEGQ6hzi.js} +18 -26
  133. package/dist/gitGraph-VSP46ZUC-5x2CrP9e.js +2 -0
  134. package/dist/gitGraph-VSP46ZUC-Cgx_wrMl.cjs +1 -0
  135. package/dist/{gitGraphDiagram-PDYL7XHY-BoJsALki.cjs → gitGraphDiagram-PDYL7XHY-6cCNinUi.cjs} +1 -1
  136. package/dist/{gitGraphDiagram-PDYL7XHY-CfRYMd3w.js → gitGraphDiagram-PDYL7XHY-D_ADFBrL.js} +4 -4
  137. package/dist/info-OHQRW6UA-DDzA9eXN.cjs +1 -0
  138. package/dist/info-OHQRW6UA-DkaWmfEE.js +2 -0
  139. package/dist/{infoDiagram-MVDRKAX5-B1QBSTSo.cjs → infoDiagram-MVDRKAX5-CVeFOzof.cjs} +1 -1
  140. package/dist/{infoDiagram-MVDRKAX5-BYGrp2QT.js → infoDiagram-MVDRKAX5-Dkuw3h5s.js} +4 -4
  141. package/dist/{ishikawaDiagram-HPEHV2GE-BWJo3pFM.cjs → ishikawaDiagram-HPEHV2GE-92CAbMpi.cjs} +2 -2
  142. package/dist/{ishikawaDiagram-HPEHV2GE-C32LoFQd.js → ishikawaDiagram-HPEHV2GE-oTSoKUOA.js} +5 -7
  143. package/dist/{javascript-CIP6I0eT.js → javascript-BSRoJWCv.js} +1 -8
  144. package/dist/javascript-B_OkdA1F.cjs +1 -0
  145. package/dist/{journeyDiagram-BOSHW7O7-DJ9OKW8H.js → journeyDiagram-BOSHW7O7-CMbGxPLA.js} +4 -4
  146. package/dist/{journeyDiagram-BOSHW7O7-090H5NM8.cjs → journeyDiagram-BOSHW7O7-Cb_yTQWF.cjs} +1 -1
  147. package/dist/{kanban-definition-FNSA4HC5-BhC2u-9L.cjs → kanban-definition-FNSA4HC5-DlUMoAIT.cjs} +1 -1
  148. package/dist/{kanban-definition-FNSA4HC5-FqIvMKJw.js → kanban-definition-FNSA4HC5-DzEQcVPw.js} +10 -10
  149. package/dist/{katex-DTnCNBYg.js → katex-BOYcAQ2I.js} +17 -26
  150. package/dist/{katex-DBUQi-HZ.cjs → katex-C-T_oEhv.cjs} +5 -5
  151. package/dist/lib-CRTt_FoR.cjs +26 -0
  152. package/dist/{lib-DILNlJGg.js → lib-CSMo4o20.js} +1522 -1452
  153. package/dist/{line-CJjnW4T-.js → line-0VTxwDiV.js} +1 -1
  154. package/dist/{line-DjYp3Ff8.cjs → line-ZwhMGa3_.cjs} +1 -1
  155. package/dist/linear-Bh2vuvAF.cjs +1 -0
  156. package/dist/{linear-DVFZQF4V.js → linear-CxE0kir0.js} +2 -3
  157. package/dist/{loadReferencedImage-CkvnSeQi.js → loadReferencedImage-2qNdVVhQ.js} +2 -2
  158. package/dist/{loadReferencedImage-CHTgZKAP.cjs → loadReferencedImage-qVqyIGz2.cjs} +1 -1
  159. package/dist/mermaid-parser.core-DKJw9lm9.cjs +6 -0
  160. package/dist/{mermaid-parser.core-CI12FMcX.js → mermaid-parser.core-IoY9gmm6.js} +19 -25
  161. package/dist/{mermaid.core-2PafqU96.cjs → mermaid.core-73kk5oPm.cjs} +7 -7
  162. package/dist/{mermaid.core-BxQmR6RW.js → mermaid.core-C8dp1dnD.js} +69 -75
  163. package/dist/{mermaidToImage-DowDuCUe.js → mermaidToImage-B2aJB9x8.js} +4900 -2274
  164. package/dist/mermaidToImage-qujM0Ggp.cjs +28 -0
  165. package/dist/{mindmap-definition-6OY57UG3-C0JXAaiI.js → mindmap-definition-6OY57UG3-CXobmoZM.js} +13 -13
  166. package/dist/{mindmap-definition-6OY57UG3-QMaMZxqJ.cjs → mindmap-definition-6OY57UG3-DLx3d1V6.cjs} +1 -1
  167. package/dist/packet-JDAUHWVQ-7Kdl1aNj.js +2 -0
  168. package/dist/packet-JDAUHWVQ-BB_DuPiR.cjs +1 -0
  169. package/dist/{pdf-D6MygsxO.js → pdf-CL7gVGT1.js} +3278 -3383
  170. package/dist/pdf-HcLHRelN.cjs +54 -0
  171. package/dist/{pegDiagram-ECIUJNBX-agFLe55J.cjs → pegDiagram-ECIUJNBX-B-eSDSQK.cjs} +1 -1
  172. package/dist/{pegDiagram-ECIUJNBX-BluDPMz-.js → pegDiagram-ECIUJNBX-ODBWqs1V.js} +5 -5
  173. package/dist/pi-outpost-embed.cjs +15 -15
  174. package/dist/pi-outpost-embed.js +160 -325
  175. package/dist/pie-XZMESJXO-CxP1ntAS.cjs +1 -0
  176. package/dist/pie-XZMESJXO-vkOzPeYA.js +2 -0
  177. package/dist/{pieDiagram-GNMPY74T-Bkt6LXIr.cjs → pieDiagram-GNMPY74T-BtYyKCrf.cjs} +1 -1
  178. package/dist/{pieDiagram-GNMPY74T-D2Dlw9oL.js → pieDiagram-GNMPY74T-DYDC5z2D.js} +7 -7
  179. package/dist/{quadrantDiagram-D57K4MC3-vbdBbRAF.js → quadrantDiagram-D57K4MC3-BfQWcg-D.js} +3 -3
  180. package/dist/{quadrantDiagram-D57K4MC3-BwUPO-ri.cjs → quadrantDiagram-D57K4MC3-Cu6JmzPE.cjs} +1 -1
  181. package/dist/radar-ABXABTNO-BIDY5R4F.cjs +1 -0
  182. package/dist/radar-ABXABTNO-DvS23EDt.js +2 -0
  183. package/dist/railroad-I3PHUGI6-BRbLa2w3.cjs +1 -0
  184. package/dist/railroad-I3PHUGI6-DH5Ttw2P.js +2 -0
  185. package/dist/railroad-abnf-LNEFI6M7-Qj3WuV4C.cjs +1 -0
  186. package/dist/railroad-abnf-LNEFI6M7-wA0DIfJr.js +2 -0
  187. package/dist/railroad-ebnf-DWYD2UWJ-C7YCjuXb.cjs +1 -0
  188. package/dist/railroad-ebnf-DWYD2UWJ-CkakbyYF.js +2 -0
  189. package/dist/railroad-peg-JR7BVNR7-CpVGf7CG.cjs +1 -0
  190. package/dist/railroad-peg-JR7BVNR7-Kw2gXekA.js +2 -0
  191. package/dist/{railroadDiagram-Y72NRBL7-CJ9MP3wV.cjs → railroadDiagram-Y72NRBL7-BdHmqKV_.cjs} +1 -1
  192. package/dist/{railroadDiagram-Y72NRBL7-B2x_q8pa.js → railroadDiagram-Y72NRBL7-ChQwG3mZ.js} +5 -5
  193. package/dist/{requirementDiagram-EQYSW5RA-CP0M11vC.cjs → requirementDiagram-EQYSW5RA-CDQ6Nza1.cjs} +1 -1
  194. package/dist/{requirementDiagram-EQYSW5RA-j7VZ-e65.js → requirementDiagram-EQYSW5RA-Dj4E0fE3.js} +13 -13
  195. package/dist/{rolldown-runtime-DArdT4gl.js → rolldown-runtime-5HNE8Q1r.js} +1 -1
  196. package/dist/rolldown-runtime-DbbDpzbe.cjs +1 -0
  197. package/dist/{sankeyDiagram-SY24JHO5-B7NuxaKG.cjs → sankeyDiagram-SY24JHO5-BPFkmPzT.cjs} +1 -1
  198. package/dist/{sankeyDiagram-SY24JHO5-Cgewgbc8.js → sankeyDiagram-SY24JHO5-luxVW4uf.js} +2 -2
  199. package/dist/{sequenceDiagram-BLEHNHQU-B5THoiqW.cjs → sequenceDiagram-BLEHNHQU-DX51aIRY.cjs} +1 -1
  200. package/dist/{sequenceDiagram-BLEHNHQU-DsjvHcWN.js → sequenceDiagram-BLEHNHQU-H4rQDzp-.js} +6 -6
  201. package/dist/{sizeCapture-INFHLROL-B5Lg3qGn.js → sizeCapture-INFHLROL-Uzko9_4n.js} +1 -1
  202. package/dist/sizeCapture-INFHLROL-bi8MyHwB.cjs +1 -0
  203. package/dist/{src-Dkp7vqs8.js → src-65Lfw03T.js} +12 -18
  204. package/dist/src-BN1VgXwj.cjs +1 -0
  205. package/dist/{stateDiagram-v2-A6IESKWZ-BD0FNkiB.js → stateDiagram-v2-A6IESKWZ-DBJ11U2p.js} +14 -14
  206. package/dist/{stateDiagram-v2-A6IESKWZ-Dqzvdrv1.cjs → stateDiagram-v2-A6IESKWZ-Dbp783Hd.cjs} +1 -1
  207. package/dist/{swimlanes-B3ENRKFQ-Do-xntE9.js → swimlanes-B3ENRKFQ-Bp3vZCmK.js} +38 -60
  208. package/dist/swimlanes-B3ENRKFQ-DY1V--Rq.cjs +1 -0
  209. package/dist/swimlanesDiagram-AYQRV4AK-COavJcG4.js +27 -0
  210. package/dist/swimlanesDiagram-AYQRV4AK-dUd5QjxZ.cjs +8 -0
  211. package/dist/{timeline-definition-JXYKGLGB-Cxi2ay-W.js → timeline-definition-JXYKGLGB-BE6iAj4r.js} +5 -5
  212. package/dist/{timeline-definition-JXYKGLGB-B_QITrmE.cjs → timeline-definition-JXYKGLGB-DKhMPFBi.cjs} +1 -1
  213. package/dist/treeView-D4JQ5SDB-BAXbN8Bf.cjs +1 -0
  214. package/dist/treeView-D4JQ5SDB-BAub6u3e.js +2 -0
  215. package/dist/treemap-SAJKECNS-DlyYa6yd.js +2 -0
  216. package/dist/treemap-SAJKECNS-EjU-hEqB.cjs +1 -0
  217. package/dist/{typescript-C93MG6Zk.js → typescript-4QjI-Ug2.js} +1 -8
  218. package/dist/typescript-CUdTaGTg.cjs +1 -0
  219. package/dist/{usecaseDiagram-WPOLBNNX-_GFZAFdK.cjs → usecaseDiagram-WPOLBNNX-BRWufOTq.cjs} +6 -6
  220. package/dist/{usecaseDiagram-WPOLBNNX-C5u6uogx.js → usecaseDiagram-WPOLBNNX-DY9Md_AG.js} +36 -48
  221. package/dist/{vennDiagram-Q3Y3IDCW-CircfM4o.js → vennDiagram-Q3Y3IDCW-DbPGt27W.js} +4 -4
  222. package/dist/{vennDiagram-Q3Y3IDCW-Bf1i94bS.cjs → vennDiagram-Q3Y3IDCW-NYVHk5sI.cjs} +1 -1
  223. package/dist/wardley-7MLQ67FV-BDYz-MEd.js +2 -0
  224. package/dist/wardley-7MLQ67FV-BdwutaJ8.cjs +1 -0
  225. package/dist/{wardleyDiagram-IVAIDKWA-BOSseRAa.js → wardleyDiagram-IVAIDKWA-BHkJFpfC.js} +5 -5
  226. package/dist/{wardleyDiagram-IVAIDKWA-Cr5LS-u2.cjs → wardleyDiagram-IVAIDKWA-DsYJNlmX.cjs} +1 -1
  227. package/dist/{xychartDiagram-4URNHDU4-DOUN6alM.cjs → xychartDiagram-4URNHDU4-B_g46bSg.cjs} +1 -1
  228. package/dist/{xychartDiagram-4URNHDU4-C4X8LFY4.js → xychartDiagram-4URNHDU4-IvFjWG-y.js} +8 -8
  229. package/package.json +14 -14
  230. package/dist/PdfViewer-BJfC4rzg.js +0 -428
  231. package/dist/PdfViewer-D6C-NAyn.cjs +0 -1
  232. package/dist/architecture-WOLXFQ4H-DupyKILn.cjs +0 -1
  233. package/dist/architecture-WOLXFQ4H-X4ZWxzi-.js +0 -3
  234. package/dist/architectureDiagram-ZHVYKT53-DBfdIpyr.cjs +0 -36
  235. package/dist/channel-BRczbI_M.cjs +0 -1
  236. package/dist/chunk-DSNLSHJZ-DZO9xahH.cjs +0 -129
  237. package/dist/chunk-ZCHMQSOR-7slscxYq.cjs +0 -1
  238. package/dist/conversationHistory-DN1r7WZT.cjs +0 -287
  239. package/dist/conversationHistory-DwB6hasI.js +0 -43647
  240. package/dist/cose-bilkent-JH36ORCC-Cc2qvpLA.cjs +0 -1
  241. package/dist/cynefin-EF2NZ3EQ-BB_WO8YQ.js +0 -3
  242. package/dist/cynefin-EF2NZ3EQ-Du3-s5Z7.cjs +0 -1
  243. package/dist/cytoscape.esm-uHsEX1XI.cjs +0 -321
  244. package/dist/dagre-NK4GIZVX-BI_akQkH.cjs +0 -4
  245. package/dist/diagram-TYUNFSNR-B_p2UHsR.cjs +0 -200
  246. package/dist/dist-DEl2Ze0j.cjs +0 -2
  247. package/dist/dist-DJbgM591.cjs +0 -1
  248. package/dist/dist-Dja2VlN5.cjs +0 -1
  249. package/dist/elk-QONTBCTQ-BDAptnPT.cjs +0 -27
  250. package/dist/eventmodeling-K75KTNOO-CMoz0K5S.js +0 -3
  251. package/dist/eventmodeling-K75KTNOO-DZdZrgwl.cjs +0 -1
  252. package/dist/flowDiagram-IUGLLWBU-BSiCLGuL.cjs +0 -1
  253. package/dist/flowDiagram-IUGLLWBU-DL_I6QCE.js +0 -16
  254. package/dist/gitGraph-VSP46ZUC-DoTshgkY.js +0 -3
  255. package/dist/gitGraph-VSP46ZUC-lawIO6K6.cjs +0 -1
  256. package/dist/info-OHQRW6UA-DPTZOb30.js +0 -3
  257. package/dist/info-OHQRW6UA-deop1PPz.cjs +0 -1
  258. package/dist/javascript-Gn0piXHk.cjs +0 -1
  259. package/dist/lib-BDkAiWI9.cjs +0 -26
  260. package/dist/linear-Nt9BuHfn.cjs +0 -1
  261. package/dist/mermaid-parser.core-BHBS1DqP.cjs +0 -6
  262. package/dist/mermaidToImage-CSR5Vyvs.cjs +0 -25
  263. package/dist/packet-JDAUHWVQ-Bcik24Kz.js +0 -3
  264. package/dist/packet-JDAUHWVQ-CrY7ylWJ.cjs +0 -1
  265. package/dist/pdf-BcvU2rBV.cjs +0 -54
  266. package/dist/pie-XZMESJXO-BYQC-ufi.js +0 -3
  267. package/dist/pie-XZMESJXO-WjCBboSE.cjs +0 -1
  268. package/dist/radar-ABXABTNO-BoQ7hH7Z.cjs +0 -1
  269. package/dist/radar-ABXABTNO-MxbyaZja.js +0 -3
  270. package/dist/railroad-I3PHUGI6-DckUArT-.js +0 -3
  271. package/dist/railroad-I3PHUGI6-DuGTlHry.cjs +0 -1
  272. package/dist/railroad-abnf-LNEFI6M7-DmAJaMEu.js +0 -3
  273. package/dist/railroad-abnf-LNEFI6M7-DoWf9u55.cjs +0 -1
  274. package/dist/railroad-ebnf-DWYD2UWJ-Bf05ZyW1.cjs +0 -1
  275. package/dist/railroad-ebnf-DWYD2UWJ-CS2AUYSv.js +0 -3
  276. package/dist/railroad-peg-JR7BVNR7-B-nctVbV.js +0 -3
  277. package/dist/railroad-peg-JR7BVNR7-CcV5KH4m.cjs +0 -1
  278. package/dist/rolldown-runtime-DF3sbh8G.cjs +0 -1
  279. package/dist/sizeCapture-INFHLROL-bJ2ZX4Du.cjs +0 -1
  280. package/dist/src-D9o9TOtH.cjs +0 -1
  281. package/dist/swimlanes-B3ENRKFQ-DEsfJ_Va.cjs +0 -1
  282. package/dist/swimlanesDiagram-AYQRV4AK-CU4USE4p.cjs +0 -8
  283. package/dist/swimlanesDiagram-AYQRV4AK-ora_Y3LB.js +0 -27
  284. package/dist/treeView-D4JQ5SDB-C3ticT1s.cjs +0 -1
  285. package/dist/treeView-D4JQ5SDB-CEuRf8gK.js +0 -3
  286. package/dist/treemap-SAJKECNS-BwIfwvl-.cjs +0 -1
  287. package/dist/treemap-SAJKECNS-DiC0668-.js +0 -3
  288. package/dist/typescript-BarIi8q9.cjs +0 -1
  289. package/dist/wardley-7MLQ67FV-BoIyQQ0E.cjs +0 -1
  290. package/dist/wardley-7MLQ67FV-CFF6IT1d.js +0 -3
@@ -1,4 +1,4 @@
1
- const e=require("./chunk-Y2CYZVJY-CnmLqFtv.cjs"),t=require("./src-D9o9TOtH.cjs"),n=require("./chunk-DSNLSHJZ-DZO9xahH.cjs"),r=require("./chunk-7S6XSTFO-DJ37SdG5.cjs");require("./chunk-YZO67HFG-CLf5aoHk.cjs");const i=require("./chunk-AQDTSKZB-DElrkKED.cjs");require("./chunk-UHW7PFBP-SZ8KvGM0.cjs");const a=require("./chunk-J5ZVWO5B-CK5HGA-t.cjs");require("./chunk-HAGFOTED-Dykk1LyE.cjs"),require("./chunk-ZAUX2LTX-BwjEPfG0.cjs"),require("./chunk-WQQL4CDK-TvwGUFeE.cjs");const o=require("./chunk-XXDRQBXY-yMT3rT5Y.cjs"),s=require("./chunk-VQ5W62QI-CsW6i5Ev.cjs");require("./chunk-HNE4Q36P-C-j5Nn9f.cjs");const c=require("./mermaid.core-2PafqU96.cjs");function l(e){console&&console.error&&console.error(`Error: ${e}`)}function u(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function d(e){let t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}function f(e){function t(){}t.prototype=e;let n=new t;function r(){return typeof n.bar}return r(),r(),e}function p(e){return m(e)?e.LABEL:e.name}function m(e){return typeof e.LABEL==`string`&&e.LABEL!==``}var h=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}},g=class extends h{constructor(e){super([]),this.idx=1,Object.assign(this,E(e))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},_=class extends h{constructor(e){super(e.definition),this.orgText=``,Object.assign(this,E(e))}},v=class extends h{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,E(e))}},y=class extends h{constructor(e){super(e.definition),this.idx=1,Object.assign(this,E(e))}},b=class extends h{constructor(e){super(e.definition),this.idx=1,Object.assign(this,E(e))}},x=class extends h{constructor(e){super(e.definition),this.idx=1,Object.assign(this,E(e))}},S=class extends h{constructor(e){super(e.definition),this.idx=1,Object.assign(this,E(e))}},C=class extends h{constructor(e){super(e.definition),this.idx=1,Object.assign(this,E(e))}},w=class extends h{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,E(e))}},T=class{constructor(e){this.idx=1,Object.assign(this,E(e))}accept(e){e.visit(this)}};function ee(e){return e.map(te)}function te(e){function t(e){return e.map(te)}if(e instanceof g){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return typeof e.label==`string`&&(t.label=e.label),t}if(e instanceof v)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof y)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof b)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof x)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:te(new T({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof C)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:te(new T({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof S)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof w)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof T){let t={type:`Terminal`,name:e.terminalType.name,label:p(e.terminalType),idx:e.idx};typeof e.label==`string`&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=n instanceof RegExp?n.source:n),t}if(e instanceof _)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}function E(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var D=class{visit(e){let t=e;switch(t.constructor){case g:return this.visitNonTerminal(t);case v:return this.visitAlternative(t);case y:return this.visitOption(t);case b:return this.visitRepetitionMandatory(t);case x:return this.visitRepetitionMandatoryWithSeparator(t);case C:return this.visitRepetitionWithSeparator(t);case S:return this.visitRepetition(t);case w:return this.visitAlternation(t);case T:return this.visitTerminal(t);case _:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function O(e){return e instanceof v||e instanceof y||e instanceof S||e instanceof b||e instanceof x||e instanceof C||e instanceof T||e instanceof _}function k(e,t=[]){return e instanceof y||e instanceof S||e instanceof C?!0:e instanceof w?e.definition.some(e=>k(e,t)):e instanceof g&&t.includes(e)?!1:e instanceof h&&(e instanceof g&&t.push(e),e.definition.every(e=>k(e,t)))}function ne(e){return e instanceof w}function A(e){if(e instanceof g)return`SUBRULE`;if(e instanceof y)return`OPTION`;if(e instanceof w)return`OR`;if(e instanceof b)return`AT_LEAST_ONE`;if(e instanceof x)return`AT_LEAST_ONE_SEP`;if(e instanceof C)return`MANY_SEP`;if(e instanceof S)return`MANY`;if(e instanceof T)return`CONSUME`;throw Error(`non exhaustive match`)}var re=class{walk(e,t=[]){e.definition.forEach((n,r)=>{let i=e.definition.slice(r+1);if(n instanceof g)this.walkProdRef(n,i,t);else if(n instanceof T)this.walkTerminal(n,i,t);else if(n instanceof v)this.walkFlat(n,i,t);else if(n instanceof y)this.walkOption(n,i,t);else if(n instanceof b)this.walkAtLeastOne(n,i,t);else if(n instanceof x)this.walkAtLeastOneSep(n,i,t);else if(n instanceof C)this.walkManySep(n,i,t);else if(n instanceof S)this.walkMany(n,i,t);else if(n instanceof w)this.walkOr(n,i,t);else throw Error(`non exhaustive match`)})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){let r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){let r=[new y({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=ie(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new y({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=ie(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);e.definition.forEach(e=>{let t=new v({definition:[e]});this.walk(t,r)})}};function ie(e,t,n){return[new y({definition:[new T({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function j(e){if(e instanceof g)return j(e.referencedRule);if(e instanceof T)return oe(e);if(O(e))return M(e);if(ne(e))return ae(e);throw Error(`non exhaustive match`)}function M(e){let t=[],n=e.definition,r=0,i=n.length>r,a,o=!0;for(;i&&o;)a=n[r],o=k(a),t=t.concat(j(a)),r+=1,i=n.length>r;return[...new Set(t)]}function ae(e){let t=e.definition.map(e=>j(e));return[...new Set(t.flat())]}function oe(e){return[e.terminalType]}var se=`_~IN~_`,ce=class extends re{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){let r=ue(e.referencedRule,e.idx)+this.topProd.name,i=j(new v({definition:t.concat(n)}));this.follows[r]=i}};function le(e){let t={};return e.forEach(e=>{let n=new ce(e).startWalking();Object.assign(t,n)}),t}function ue(e,t){return e.name+t+se}function N(e){return e.charCodeAt(0)}function de(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function fe(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t],e[t]=!0}function pe(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}function me(){throw Error(`Internal Error - Should never get here!`)}function he(e){return e.type===`Character`}var ge=[];for(let e=N(`0`);e<=N(`9`);e++)ge.push(e);var _e=[N(`_`)].concat(ge);for(let e=N(`a`);e<=N(`z`);e++)_e.push(e);for(let e=N(`A`);e<=N(`Z`);e++)_e.push(e);var ve=[N(` `),N(`\f`),N(`
1
+ const e=require("./chunk-Y2CYZVJY-CnmLqFtv.cjs"),t=require("./src-BN1VgXwj.cjs"),n=require("./chunk-DSNLSHJZ-BxQ7lMXY.cjs"),r=require("./chunk-7S6XSTFO-ejBVk-tI.cjs");require("./chunk-YZO67HFG-DCQIFG8j.cjs");const i=require("./chunk-AQDTSKZB-B-MpZ-y2.cjs");require("./chunk-UHW7PFBP-Bays5Zi8.cjs");const a=require("./chunk-J5ZVWO5B-CK5HGA-t.cjs");require("./chunk-HAGFOTED-BUPxFGdn.cjs"),require("./chunk-ZAUX2LTX-DIQkgUFr.cjs"),require("./chunk-WQQL4CDK-DxEEyQzx.cjs");const o=require("./chunk-XXDRQBXY-DfReYcER.cjs"),s=require("./chunk-VQ5W62QI-Dw9Kffnl.cjs");require("./chunk-HNE4Q36P-CCHAgwa3.cjs");const c=require("./mermaid.core-73kk5oPm.cjs");function l(e){console&&console.error&&console.error(`Error: ${e}`)}function u(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function d(e){let t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}function f(e){function t(){}t.prototype=e;let n=new t;function r(){return typeof n.bar}return r(),r(),e}function p(e){return m(e)?e.LABEL:e.name}function m(e){return typeof e.LABEL==`string`&&e.LABEL!==``}var h=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}},g=class extends h{constructor(e){super([]),this.idx=1,Object.assign(this,E(e))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},_=class extends h{constructor(e){super(e.definition),this.orgText=``,Object.assign(this,E(e))}},v=class extends h{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,E(e))}},y=class extends h{constructor(e){super(e.definition),this.idx=1,Object.assign(this,E(e))}},b=class extends h{constructor(e){super(e.definition),this.idx=1,Object.assign(this,E(e))}},x=class extends h{constructor(e){super(e.definition),this.idx=1,Object.assign(this,E(e))}},S=class extends h{constructor(e){super(e.definition),this.idx=1,Object.assign(this,E(e))}},C=class extends h{constructor(e){super(e.definition),this.idx=1,Object.assign(this,E(e))}},w=class extends h{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,E(e))}},T=class{constructor(e){this.idx=1,Object.assign(this,E(e))}accept(e){e.visit(this)}};function ee(e){return e.map(te)}function te(e){function t(e){return e.map(te)}if(e instanceof g){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return typeof e.label==`string`&&(t.label=e.label),t}if(e instanceof v)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof y)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof b)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof x)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:te(new T({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof C)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:te(new T({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof S)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof w)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof T){let t={type:`Terminal`,name:e.terminalType.name,label:p(e.terminalType),idx:e.idx};typeof e.label==`string`&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=n instanceof RegExp?n.source:n),t}if(e instanceof _)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}function E(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var D=class{visit(e){let t=e;switch(t.constructor){case g:return this.visitNonTerminal(t);case v:return this.visitAlternative(t);case y:return this.visitOption(t);case b:return this.visitRepetitionMandatory(t);case x:return this.visitRepetitionMandatoryWithSeparator(t);case C:return this.visitRepetitionWithSeparator(t);case S:return this.visitRepetition(t);case w:return this.visitAlternation(t);case T:return this.visitTerminal(t);case _:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function O(e){return e instanceof v||e instanceof y||e instanceof S||e instanceof b||e instanceof x||e instanceof C||e instanceof T||e instanceof _}function k(e,t=[]){return e instanceof y||e instanceof S||e instanceof C?!0:e instanceof w?e.definition.some(e=>k(e,t)):e instanceof g&&t.includes(e)?!1:e instanceof h&&(e instanceof g&&t.push(e),e.definition.every(e=>k(e,t)))}function ne(e){return e instanceof w}function A(e){if(e instanceof g)return`SUBRULE`;if(e instanceof y)return`OPTION`;if(e instanceof w)return`OR`;if(e instanceof b)return`AT_LEAST_ONE`;if(e instanceof x)return`AT_LEAST_ONE_SEP`;if(e instanceof C)return`MANY_SEP`;if(e instanceof S)return`MANY`;if(e instanceof T)return`CONSUME`;throw Error(`non exhaustive match`)}var re=class{walk(e,t=[]){e.definition.forEach((n,r)=>{let i=e.definition.slice(r+1);if(n instanceof g)this.walkProdRef(n,i,t);else if(n instanceof T)this.walkTerminal(n,i,t);else if(n instanceof v)this.walkFlat(n,i,t);else if(n instanceof y)this.walkOption(n,i,t);else if(n instanceof b)this.walkAtLeastOne(n,i,t);else if(n instanceof x)this.walkAtLeastOneSep(n,i,t);else if(n instanceof C)this.walkManySep(n,i,t);else if(n instanceof S)this.walkMany(n,i,t);else if(n instanceof w)this.walkOr(n,i,t);else throw Error(`non exhaustive match`)})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){let r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){let r=[new y({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=ie(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new y({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=ie(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);e.definition.forEach(e=>{let t=new v({definition:[e]});this.walk(t,r)})}};function ie(e,t,n){return[new y({definition:[new T({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function j(e){if(e instanceof g)return j(e.referencedRule);if(e instanceof T)return oe(e);if(O(e))return M(e);if(ne(e))return ae(e);throw Error(`non exhaustive match`)}function M(e){let t=[],n=e.definition,r=0,i=n.length>r,a,o=!0;for(;i&&o;)a=n[r],o=k(a),t=t.concat(j(a)),r+=1,i=n.length>r;return[...new Set(t)]}function ae(e){let t=e.definition.map(e=>j(e));return[...new Set(t.flat())]}function oe(e){return[e.terminalType]}var se=`_~IN~_`,ce=class extends re{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){let r=ue(e.referencedRule,e.idx)+this.topProd.name,i=j(new v({definition:t.concat(n)}));this.follows[r]=i}};function le(e){let t={};return e.forEach(e=>{let n=new ce(e).startWalking();Object.assign(t,n)}),t}function ue(e,t){return e.name+t+se}function N(e){return e.charCodeAt(0)}function de(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function fe(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t],e[t]=!0}function pe(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}function me(){throw Error(`Internal Error - Should never get here!`)}function he(e){return e.type===`Character`}var ge=[];for(let e=N(`0`);e<=N(`9`);e++)ge.push(e);var _e=[N(`_`)].concat(ge);for(let e=N(`a`);e<=N(`z`);e++)_e.push(e);for(let e=N(`A`);e<=N(`Z`);e++)_e.push(e);var ve=[N(` `),N(`\f`),N(`
2
2
  `),N(`\r`),N(` `),N(`\v`),N(` `),N(`\xA0`),N(` `),N(` `),N(` `),N(` `),N(` `),N(` `),N(` `),N(` `),N(` `),N(` `),N(` `),N(` `),N(`\u2028`),N(`\u2029`),N(` `),N(` `),N(` `),N(``)],ye=/[0-9a-fA-F]/,be=/[0-9]/,xe=/[1-9]/,Se=class{constructor(){this.idx=0,this.input=``,this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar(`/`);let t=this.disjunction();this.consumeChar(`/`);let n={type:`Flags`,loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case`g`:fe(n,`global`);break;case`i`:fe(n,`ignoreCase`);break;case`m`:fe(n,`multiLine`);break;case`u`:fe(n,`unicode`);break;case`y`:fe(n,`sticky`)}if(this.idx!==this.input.length)throw Error(`Redundant input: `+this.input.substring(this.idx));return{type:`Pattern`,flags:n,value:t,loc:this.loc(0)}}disjunction(){let e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()===`|`;)this.consumeChar(`|`),e.push(this.alternative());return{type:`Disjunction`,value:e,loc:this.loc(t)}}alternative(){let e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:`Alternative`,value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case`^`:return{type:`StartAnchor`,loc:this.loc(e)};case`$`:return{type:`EndAnchor`,loc:this.loc(e)};case`\\`:switch(this.popChar()){case`b`:return{type:`WordBoundary`,loc:this.loc(e)};case`B`:return{type:`NonWordBoundary`,loc:this.loc(e)}}throw Error(`Invalid Assertion Escape`);case`(`:this.consumeChar(`?`);let t;switch(this.popChar()){case`=`:t=`Lookahead`;break;case`!`:t=`NegativeLookahead`;break;case`<`:switch(this.popChar()){case`=`:t=`Lookbehind`;break;case`!`:t=`NegativeLookbehind`}}pe(t);let n=this.disjunction();return this.consumeChar(`)`),{type:t,value:n,loc:this.loc(e)}}return me()}quantifier(e=!1){let t,n=this.idx;switch(this.popChar()){case`*`:t={atLeast:0,atMost:1/0};break;case`+`:t={atLeast:1,atMost:1/0};break;case`?`:t={atLeast:0,atMost:1};break;case`{`:let n=this.integerIncludingZero();switch(this.popChar()){case`}`:t={atLeast:n,atMost:n};break;case`,`:let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar(`}`)}if(e===!0&&t===void 0)return;pe(t)}if((e!==!0||t!==void 0)&&pe(t))return this.peekChar(0)===`?`?(this.consumeChar(`?`),t.greedy=!1):t.greedy=!0,t.type=`Quantifier`,t.loc=this.loc(n),t}atom(){let e,t=this.idx;switch(this.peekChar()){case`.`:e=this.dotAll();break;case`\\`:e=this.atomEscape();break;case`[`:e=this.characterClass();break;case`(`:e=this.group()}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),pe(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):me()}dotAll(){return this.consumeChar(`.`),{type:`Set`,complement:!0,value:[N(`
3
3
  `),N(`\r`),N(`\u2028`),N(`\u2029`)]}}atomEscape(){switch(this.consumeChar(`\\`),this.peekChar()){case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:return this.decimalEscapeAtom();case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:`GroupBackReference`,value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case`d`:e=ge;break;case`D`:e=ge,t=!0;break;case`s`:e=ve;break;case`S`:e=ve,t=!0;break;case`w`:e=_e;break;case`W`:e=_e,t=!0}return pe(e)?{type:`Set`,value:e,complement:t}:me()}controlEscapeAtom(){let e;switch(this.popChar()){case`f`:e=N(`\f`);break;case`n`:e=N(`
4
4
  `);break;case`r`:e=N(`\r`);break;case`t`:e=N(` `);break;case`v`:e=N(`\v`)}return pe(e)?{type:`Character`,value:e}:me()}controlLetterEscapeAtom(){this.consumeChar(`c`);let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error(`Invalid `);return{type:`Character`,value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar(`0`),{type:`Character`,value:N(`\0`)}}hexEscapeSequenceAtom(){return this.consumeChar(`x`),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar(`u`),this.parseHexDigits(4)}identityEscapeAtom(){return{type:`Character`,value:N(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case`
@@ -19,7 +19,7 @@ const e=require("./chunk-Y2CYZVJY-CnmLqFtv.cjs"),t=require("./src-D9o9TOtH.cjs")
19
19
  Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
20
20
  See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:F.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}function Je(e){return e.filter(e=>e.PATTERN.test(``)).map(e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' must not match an empty string`,type:F.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}var Ye=/[^\\[][\^]|^\^/;function Xe(e){class t extends Ce{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{let n=e.PATTERN;try{let e=Ee(n),r=new t;return r.visit(e),r.found}catch{return Ye.test(n.source)}}).map(e=>({message:`Unexpected RegExp Anchor Error:
21
21
  Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
22
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:F.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}function Ze(e){return e.filter(e=>{let t=e[Re];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' may NOT contain global('g') or multiline('m')`,type:F.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}function Qe(e){let t=[],n=e.map(n=>e.reduce((e,r)=>n.PATTERN.source===r.PATTERN.source&&!t.includes(r)&&r.PATTERN!==I.NA?(t.push(r),e.push(r),e):e,[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{let t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(`, `)} <-`,type:F.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}function $e(e){return e.filter(e=>{if(!Object.hasOwn(e,`GROUP`))return!1;let t=e.GROUP;return t!==I.SKIPPED&&t!==I.NA&&typeof t!=`string`}).map(e=>({message:`Token Type: ->`+e.name+`<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String`,type:F.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}function et(e,t){return e.filter(e=>e.PUSH_MODE!==void 0&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:F.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}function tt(e){let t=[],n=e.reduce((e,t,n)=>{let r=t.PATTERN;return r===I.NA||(typeof r==`string`?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&rt(r)&&e.push({str:r.source,idx:n,tokenType:t})),e},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:a})=>{if(r<i&&nt(n,e.PATTERN)){let n=`Token: ->${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:F.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}})}),t}function nt(e,t){if(t instanceof RegExp){if(it(t))return!1;let n=t.exec(e);return n!==null&&n.index===0}if(typeof t==`function`)return t(e,0,[],{});if(Object.hasOwn(t,`exec`))return t.exec(e,0,[],{});if(typeof t==`string`)return t===e;throw Error(`non exhaustive match`)}function rt(e){return[`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`].find(t=>e.source.indexOf(t)!==-1)===void 0}function it(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}function at(e){let t=e.ignoreCase?`iy`:`y`;return RegExp(`${e.source}`,t)}function ot(e,t,n){let r=[];return Object.hasOwn(e,`defaultMode`)||r.push({message:`A MultiMode Lexer cannot be initialized without a <defaultMode> property in its definition
22
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:F.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}function Ze(e){return e.filter(e=>{let t=e[Re];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' may NOT contain global('g') or multiline('m')`,type:F.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}function Qe(e){let t=[],n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source===r.PATTERN.source&&!t.includes(r)&&r.PATTERN!==I.NA&&(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{let t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(`, `)} <-`,type:F.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}function $e(e){return e.filter(e=>{if(!Object.hasOwn(e,`GROUP`))return!1;let t=e.GROUP;return t!==I.SKIPPED&&t!==I.NA&&typeof t!=`string`}).map(e=>({message:`Token Type: ->`+e.name+`<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String`,type:F.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}function et(e,t){return e.filter(e=>e.PUSH_MODE!==void 0&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:F.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}function tt(e){let t=[],n=e.reduce((e,t,n)=>{let r=t.PATTERN;return r===I.NA||(typeof r==`string`?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&rt(r)&&e.push({str:r.source,idx:n,tokenType:t})),e},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:a})=>{if(r<i&&nt(n,e.PATTERN)){let n=`Token: ->${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:F.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}})}),t}function nt(e,t){if(t instanceof RegExp){if(it(t))return!1;let n=t.exec(e);return n!==null&&n.index===0}if(typeof t==`function`)return t(e,0,[],{});if(Object.hasOwn(t,`exec`))return t.exec(e,0,[],{});if(typeof t==`string`)return t===e;throw Error(`non exhaustive match`)}function rt(e){return[`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`].find(t=>e.source.indexOf(t)!==-1)===void 0}function it(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}function at(e){let t=e.ignoreCase?`iy`:`y`;return RegExp(`${e.source}`,t)}function ot(e,t,n){let r=[];return Object.hasOwn(e,`defaultMode`)||r.push({message:`A MultiMode Lexer cannot be initialized without a <defaultMode> property in its definition
23
23
  `,type:F.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,`modes`)||r.push({message:`A MultiMode Lexer cannot be initialized without a <modes> property in its definition
24
24
  `,type:F.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,`modes`)&&Object.hasOwn(e,`defaultMode`)&&!Object.hasOwn(e.modes,e.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${ze}: <${e.defaultMode}>which does not exist\n`,type:F.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,`modes`)&&Object.keys(e.modes).forEach(t=>{let n=e.modes[t];n.forEach((e,i)=>{e===void 0?r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${t}> at index: <${i}>\n`,type:F.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,`LONGER_ALT`)&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{i!==void 0&&!n.includes(i)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${t}>\n`,type:F.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),r}function st(e,t,n){let r=[],i=!1,a=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Re]!==I.NA),o=pt(n);return t&&a.forEach(e=>{let t=dt(e,o);if(t!==!1){let n={message:ft(e,t),type:t.issue,tokenType:e};r.push(n)}else Object.hasOwn(e,`LINE_BREAKS`)?e.LINE_BREAKS===!0&&(i=!0):Le(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
25
25
  This Lexer has been defined to track line and column information,
@@ -65,13 +65,13 @@ For Further details.`,r},buildEmptyRepetitionError(e){let t=A(e.repetition);retu
65
65
  `)}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,`ignoredIssues`))throw Error(`The <ignoredIssues> IParserConfig property has been deprecated.
66
66
  Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
67
67
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
68
- For further details.`);this.skipValidations=Object.hasOwn(t,`skipValidations`)?t.skipValidations:B.skipValidations}};Jr.DEFER_DEFINITION_ERRORS_HANDLING=!1,Gr(Jr,[sr,pr,Or,kr,jr,Ar,Mr,zr,Wr]);var Yr=class extends Jr{constructor(e,t=B){let n=Object.assign({},t);n.outputCst=!0,super(e,n)}},Xr=e.n(e=>e!==void 0&&e>=0,`isKnownLocation`);function Zr(e,t){let n=e.lexer.tokenize(t);if(n.errors.length>0){let r=n.errors[0],i=Xr(r.offset)?r.offset:t.length,a=i+(Xr(r.length)?r.length:0);throw Error(`Error lexing ${e.diagramType} diagram: ${r.message} at line ${r.line??1}, column ${r.column??1} [${i},${a})`)}e.parser.input=n.tokens;let r=e.entry();if(e.parser.errors.length>0)throw Error(`Error parsing ${e.diagramType} diagram: ${e.parser.errors[0].message}`);e.visit(r)}e.n(Zr,`runChevrotainParse`);var H={SOLID_ARROW:0,BACK_ARROW:1,LINE_SOLID:2,CIRCLE_ARROW:3,CROSS_ARROW:4,CIRCLE_ARROW_REVERSED:5,CROSS_ARROW_REVERSED:6},Qr=`LR`,$r=n.f.usecase,ei=e.n(()=>({actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,symbols:new Map,direction:Qr,relationshipCounter:0,noteCounter:0,accTitle:``,accDescription:``,ast:void 0,config:structuredClone($r)}),`createModel`),ti=e.n(e=>{if(!(e.actors instanceof Map)||!(e.useCases instanceof Map)||!(e.systemBoundaries instanceof Map)||!Array.isArray(e.relationships)||!(e.notes instanceof Map)||!(e.jsonNodes instanceof Map)||!(e.classDefs instanceof Map)||!(e.symbols instanceof Map)||![`TB`,`TD`,`BT`,`RL`,`LR`].includes(e.direction)||!Number.isSafeInteger(e.relationshipCounter)||e.relationshipCounter<0||!Number.isSafeInteger(e.noteCounter)||e.noteCounter<0||typeof e.accTitle!=`string`||typeof e.accDescription!=`string`||!e.config)throw Error(`Cannot commit an incomplete usecase model`)},`assertCompleteModel`),U=ei(),ni=e.n(()=>structuredClone(U.config),`getConfig`),ri=e.n(()=>U.ast,`getAST`),ii=e.n(e=>{let t=structuredClone(e);ti(t);let r=n.v(),i=n._();try{n.U(t.accTitle),n.H(t.accDescription),U=t}catch(e){throw n.U(r),n.H(i),e}},`commit`),ai=e.n(()=>{U=ei(),n.a()},`clear`),oi=e.n(()=>U.actors,`getActors`),si=e.n(e=>U.actors.get(e),`getActor`),ci=e.n(()=>U.useCases,`getUseCases`),li=e.n(e=>U.useCases.get(e),`getUseCase`),ui=e.n(()=>U.systemBoundaries,`getSystemBoundaries`),di=e.n(e=>U.systemBoundaries.get(e),`getSystemBoundary`),fi=e.n(()=>U.relationships,`getRelationships`),pi=e.n(()=>U.notes,`getNotes`),mi=e.n(e=>U.notes.get(e),`getNote`),hi=e.n(()=>U.jsonNodes,`getJsonNodes`),gi=e.n(e=>U.jsonNodes.get(e),`getJsonNode`),_i=e.n(()=>U.classDefs,`getClassDefs`),vi=e.n(e=>U.classDefs.get(e),`getClassDef`),yi=e.n(()=>U.direction,`getDirection`),bi=e.n(e=>{let t=new Map;for(let n of[`default`,...e]){let e=U.classDefs.get(n);if(e)for(let n of e.styles){let e=n.trim(),r=e.indexOf(`:`),i=(r===-1?e:e.slice(0,r)).trim();i&&t.set(i,e)}}return[...t.values()]},`getCompiledStyles`),xi=e.n(e=>e.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`),`escapeJsonPointerPart`),Si=e.n(e=>typeof e==`string`?e:e===null?`null`:String(e),`displayJsonScalar`),Ci=e.n((t,n,r=e=>e)=>{let i=[],a=e.n((e,t,n)=>{i.push({key:r(e),accessibleKey:r(t),value:r(n)})},`append`),o=e.n((e,t,r)=>{if(Array.isArray(e)){if(e.length===0){a(t,t,`[]`);return}if(e.every(e=>e===null||[`string`,`number`,`boolean`].includes(typeof e))){for(let[n,r]of e.entries())a(n===0?t:``,t,Si(r));return}for(let[n,i]of e.entries())o(i,`${t}[${n}]`,`${r}/${n}`);return}if(typeof e==`object`&&e){let i=e,s=n[r]??Object.keys(i);if(s.length===0){a(t,t,`{}`);return}for(let e of s){let n=t?`${t}.${e}`:e;o(i[e],n,`${r}/${xi(e)}`)}return}a(t,t,Si(e))},`visit`);return o(t,``,``),i},`flattenJsonRows`),wi=e.n(e=>{switch(e.type){case`hollow`:return`usecaseActorHollow`;case`awesome`:return`usecaseActorAwesome`;case`icon`:return`usecaseActorIcon`;case`normal`:return`usecaseActor`}},`actorShape`),Ti=e.n(e=>e.shape===`ellipse`?e.business?`usecaseBusiness`:`usecaseEllipse`:e.shape,`useCaseShape`),Ei=e.n(e=>{switch(e){case H.SOLID_ARROW:return{arrowTypeStart:`none`,arrowTypeEnd:`arrow_point`};case H.BACK_ARROW:return{arrowTypeStart:`arrow_point`,arrowTypeEnd:`none`};case H.CIRCLE_ARROW:return{arrowTypeStart:`none`,arrowTypeEnd:`arrow_circle`};case H.CROSS_ARROW:return{arrowTypeStart:`none`,arrowTypeEnd:`arrow_cross`};case H.CIRCLE_ARROW_REVERSED:return{arrowTypeStart:`arrow_circle`,arrowTypeEnd:`none`};case H.CROSS_ARROW_REVERSED:return{arrowTypeStart:`arrow_cross`,arrowTypeEnd:`none`};case H.LINE_SOLID:return{arrowTypeStart:`none`,arrowTypeEnd:`none`}}},`associationMarkers`),Di=e.n(e=>{switch(e.type){case`include`:case`extend`:return{arrowTypeStart:`none`,arrowTypeEnd:`arrow_point`,pattern:`dotted`,label:e.type,labelType:`text`};case`generalization`:return{arrowTypeStart:`none`,arrowTypeEnd:`extension`,pattern:`solid`};case`association`:return{...Ei(e.arrowType),pattern:`solid`,...e.label?{label:e.label}:{},...e.labelType?{labelType:e.labelType}:{}}}},`relationshipVisuals`),Oi=e.n(e=>e.animate||e.animation?[`edge-animation-${e.animation??`fast`}`]:[],`animationClasses`),ki=e.n((...e)=>e.filter(e=>!!e).join(` `),`classNames`),Ai={getConfig:ni,createModel:ei,commit:ii,getAST:ri,clear:ai,setDiagramTitle:n.q,getDiagramTitle:n.C,setAccTitle:n.U,getAccTitle:n.v,setAccDescription:n.H,getAccDescription:n._,getActors:oi,getActor:si,getUseCases:ci,getUseCase:li,getSystemBoundaries:ui,getSystemBoundary:di,getRelationships:fi,getNotes:pi,getNote:mi,getJsonNodes:hi,getJsonNode:gi,getClassDefs:_i,getClassDef:vi,getDirection:yi,getData:e.n(()=>{let t=n.b(),r={...U.config,...t.usecase},i=e.n(e=>n.z(e,t),`sanitize`),a=e.n(e=>i(U.actors.get(e)?.label??U.useCases.get(e)?.label??U.jsonNodes.get(e)?.id??U.notes.get(e)?.label??e),`endpointLabel`),o=[],s=[],c=0,l=0;for(let e of U.actors.values())o.push({id:e.id,label:i(e.label),labelType:e.labelType,shape:wi(e),isGroup:!1,padding:10,look:t.look,colorIndex:c++,cssClasses:ki(`default`,`usecase-actor`,`usecase-actor-${e.type}`,e.business&&`usecase-business`,...e.classes),cssStyles:[...e.styles],cssCompiledStyles:bi(e.classes),actorType:e.type,business:e.business,...e.icon?{icon:e.icon}:{},...e.stereotype?{stereotype:i(e.stereotype)}:{},...e.parentId?{parentId:e.parentId}:{}});for(let e of U.useCases.values())o.push({id:e.id,label:i(e.label),labelType:e.labelType,shape:Ti(e),isGroup:!1,padding:e.shape===`ellipse`?20:10,look:t.look,colorIndex:c++,cssClasses:ki(`default`,`usecase-element`,`usecase-${e.shape}`,e.business&&`usecase-business`,...e.classes),cssStyles:[...e.styles],cssCompiledStyles:bi(e.classes),business:e.business,...e.stereotype?{stereotype:i(e.stereotype)}:{},...e.parentId?{parentId:e.parentId}:{}});for(let e of U.notes.values())o.push({id:e.id,label:i(e.label),labelType:e.labelType,shape:`note`,isGroup:!1,padding:10,look:t.look,cssClasses:`default usecase-note`,cssStyles:[],cssCompiledStyles:bi([]),noteTarget:e.target,noteTargetLabel:i(U.actors.get(e.target)?.label??U.useCases.get(e.target)?.label??U.jsonNodes.get(e.target)?.id??e.target)});for(let e of U.jsonNodes.values())o.push({id:e.id,label:i(e.id),labelType:`text`,shape:`usecaseJsonTable`,isGroup:!1,padding:10,look:t.look,cssClasses:ki(`default`,`usecase-json-table`,...e.classes),cssStyles:[...e.styles],cssCompiledStyles:bi(e.classes),jsonRows:Ci(e.value,e.propertyOrder,i)});for(let e of U.systemBoundaries.values())o.push({id:e.id,label:i(e.label),labelType:e.labelType,shape:`usecaseSystemBoundary`,isGroup:!0,padding:20,look:t.look,colorIndex:l++,cssClasses:ki(`default`,`system-boundary`,`system-boundary-${e.type}`,...e.classes),cssStyles:[...e.styles],cssCompiledStyles:bi(e.classes),boundaryType:e.type});for(let e of U.relationships){let{label:n,...r}=Di(e);s.push({id:e.id,start:e.source,end:e.target,source:e.source,target:e.target,sourceLabel:a(e.source),targetLabel:a(e.target),type:`edge`,relationshipType:e.type,internal:!1,...r,...n===void 0?{}:{label:i(n)},labelpos:`c`,classes:ki(`default`,`relationship`,`relationship-${e.type}`,...e.classes,...Oi(e)),style:[...e.styles],cssCompiledStyles:bi(e.classes),animate:e.animate,...e.animation?{animation:e.animation}:{},look:t.look,thickness:`normal`,minlen:e.minlen,isUserDefinedId:e.explicitId})}for(let e of U.notes.values())s.push({id:`${e.id}-edge`,start:e.id,end:e.target,source:e.id,target:e.target,type:`edge`,relationshipType:`note`,sourceLabel:a(e.id),targetLabel:a(e.target),internal:!0,pattern:`dotted`,arrowTypeStart:`none`,arrowTypeEnd:`none`,labelpos:`c`,classes:`default relationship relationship-note`,style:[],cssCompiledStyles:bi([]),animate:!1,look:t.look,thickness:`normal`,minlen:1,isUserDefinedId:!1});for(let e of o)e.wrappingWidth??=r.wrappingWidth,!e.isGroup&&!e.shape.startsWith(`usecaseActor`)&&(e.minWidth??=r.minNodeWidth),(e.shape===`usecaseEllipse`||e.shape===`usecaseBusiness`)&&(e.spreadPorts=!0);return{nodes:o,edges:s,config:t,type:`usecase`,layoutAlgorithm:`dagre`,direction:yi(),nodeSpacing:r.nodeSpacing,rankSpacing:r.rankSpacing,actorFontSize:r.actorFontSize,actorFontFamily:r.actorFontFamily,actorFontWeight:r.actorFontWeight,usecaseFontSize:r.usecaseFontSize,usecaseFontFamily:r.usecaseFontFamily,usecaseFontWeight:r.usecaseFontWeight,diagramPadding:r.diagramPadding,useMaxWidth:r.useMaxWidth,markers:[`point`,`circle`,`cross`,`extension`]}},`getData`)};function ji(e,t,n){let r=[n];return r.index=t,r.input=e,r}e.n(ji,`customMatch`);var Mi=e.n((e,t)=>{if(e[t]!==`"`||e[t+1]!=="`")return null;for(let n=t+2;n<e.length-1;n++)if(e[n]==="`"&&e[n+1]===`"`)return ji(e,t,e.slice(t,n+2));return null},`matchMarkdownString`),Ni=e.n((e,t)=>{if(e[t]!==`%`||e[t+1]!==`%`)return null;for(let n=t-1;n>=0;n--){let t=e[n];if(t===`
68
+ For further details.`);this.skipValidations=Object.hasOwn(t,`skipValidations`)?t.skipValidations:B.skipValidations}};Jr.DEFER_DEFINITION_ERRORS_HANDLING=!1,Gr(Jr,[sr,pr,Or,kr,jr,Ar,Mr,zr,Wr]);var Yr=class extends Jr{constructor(e,t=B){let n=Object.assign({},t);n.outputCst=!0,super(e,n)}},Xr=e.n(e=>e!==void 0&&e>=0,`isKnownLocation`);function Zr(e,t){let n=e.lexer.tokenize(t);if(n.errors.length>0){let r=n.errors[0],i=Xr(r.offset)?r.offset:t.length,a=i+(Xr(r.length)?r.length:0);throw Error(`Error lexing ${e.diagramType} diagram: ${r.message} at line ${r.line??1}, column ${r.column??1} [${i},${a})`)}e.parser.input=n.tokens;let r=e.entry();if(e.parser.errors.length>0)throw Error(`Error parsing ${e.diagramType} diagram: ${e.parser.errors[0].message}`);e.visit(r)}e.n(Zr,`runChevrotainParse`);var H={SOLID_ARROW:0,BACK_ARROW:1,LINE_SOLID:2,CIRCLE_ARROW:3,CROSS_ARROW:4,CIRCLE_ARROW_REVERSED:5,CROSS_ARROW_REVERSED:6},Qr=`LR`,$r=n.f.usecase,ei=e.n(()=>({actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,symbols:new Map,direction:Qr,relationshipCounter:0,noteCounter:0,accTitle:``,accDescription:``,ast:void 0,config:structuredClone($r)}),`createModel`),ti=e.n(e=>{if(!(e.actors instanceof Map)||!(e.useCases instanceof Map)||!(e.systemBoundaries instanceof Map)||!Array.isArray(e.relationships)||!(e.notes instanceof Map)||!(e.jsonNodes instanceof Map)||!(e.classDefs instanceof Map)||!(e.symbols instanceof Map)||![`TB`,`TD`,`BT`,`RL`,`LR`].includes(e.direction)||!Number.isSafeInteger(e.relationshipCounter)||e.relationshipCounter<0||!Number.isSafeInteger(e.noteCounter)||e.noteCounter<0||typeof e.accTitle!=`string`||typeof e.accDescription!=`string`||!e.config)throw Error(`Cannot commit an incomplete usecase model`)},`assertCompleteModel`),U=ei(),ni=e.n(()=>structuredClone(U.config),`getConfig`),ri=e.n(()=>U.ast,`getAST`),ii=e.n(e=>{let t=structuredClone(e);ti(t);let r=n.v(),i=n._();try{n.U(t.accTitle),n.H(t.accDescription),U=t}catch(e){throw n.U(r),n.H(i),e}},`commit`),ai=e.n(()=>{U=ei(),n.a()},`clear`),oi=e.n(()=>U.actors,`getActors`),si=e.n(e=>U.actors.get(e),`getActor`),ci=e.n(()=>U.useCases,`getUseCases`),li=e.n(e=>U.useCases.get(e),`getUseCase`),ui=e.n(()=>U.systemBoundaries,`getSystemBoundaries`),di=e.n(e=>U.systemBoundaries.get(e),`getSystemBoundary`),fi=e.n(()=>U.relationships,`getRelationships`),pi=e.n(()=>U.notes,`getNotes`),mi=e.n(e=>U.notes.get(e),`getNote`),hi=e.n(()=>U.jsonNodes,`getJsonNodes`),gi=e.n(e=>U.jsonNodes.get(e),`getJsonNode`),_i=e.n(()=>U.classDefs,`getClassDefs`),vi=e.n(e=>U.classDefs.get(e),`getClassDef`),yi=e.n(()=>U.direction,`getDirection`),bi=e.n(e=>{let t=new Map;for(let n of[`default`,...e]){let e=U.classDefs.get(n);if(e)for(let n of e.styles){let e=n.trim(),r=e.indexOf(`:`),i=(r===-1?e:e.slice(0,r)).trim();i&&t.set(i,e)}}return[...t.values()]},`getCompiledStyles`),xi=e.n(e=>e.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`),`escapeJsonPointerPart`),Si=e.n(e=>typeof e==`string`?e:e===null?`null`:String(e),`displayJsonScalar`),Ci=e.n((t,n,r=e=>e)=>{let i=[],a=e.n((e,t,n)=>{i.push({key:r(e),accessibleKey:r(t),value:r(n)})},`append`),o=e.n((e,t,r)=>{if(Array.isArray(e)){if(e.length===0){a(t,t,`[]`);return}if(e.every(e=>e===null||[`string`,`number`,`boolean`].includes(typeof e))){for(let[n,r]of e.entries())a(n===0?t:``,t,Si(r));return}for(let[n,i]of e.entries())o(i,`${t}[${n}]`,`${r}/${n}`)}else if(typeof e==`object`&&e){let i=e,s=n[r]??Object.keys(i);if(s.length===0){a(t,t,`{}`);return}for(let e of s){let n=t?`${t}.${e}`:e;o(i[e],n,`${r}/${xi(e)}`)}}else a(t,t,Si(e))},`visit`);return o(t,``,``),i},`flattenJsonRows`),wi=e.n(e=>{switch(e.type){case`hollow`:return`usecaseActorHollow`;case`awesome`:return`usecaseActorAwesome`;case`icon`:return`usecaseActorIcon`;case`normal`:return`usecaseActor`}},`actorShape`),Ti=e.n(e=>e.shape===`ellipse`?e.business?`usecaseBusiness`:`usecaseEllipse`:e.shape,`useCaseShape`),Ei=e.n(e=>{switch(e){case H.SOLID_ARROW:return{arrowTypeStart:`none`,arrowTypeEnd:`arrow_point`};case H.BACK_ARROW:return{arrowTypeStart:`arrow_point`,arrowTypeEnd:`none`};case H.CIRCLE_ARROW:return{arrowTypeStart:`none`,arrowTypeEnd:`arrow_circle`};case H.CROSS_ARROW:return{arrowTypeStart:`none`,arrowTypeEnd:`arrow_cross`};case H.CIRCLE_ARROW_REVERSED:return{arrowTypeStart:`arrow_circle`,arrowTypeEnd:`none`};case H.CROSS_ARROW_REVERSED:return{arrowTypeStart:`arrow_cross`,arrowTypeEnd:`none`};case H.LINE_SOLID:return{arrowTypeStart:`none`,arrowTypeEnd:`none`}}},`associationMarkers`),Di=e.n(e=>{switch(e.type){case`include`:case`extend`:return{arrowTypeStart:`none`,arrowTypeEnd:`arrow_point`,pattern:`dotted`,label:e.type,labelType:`text`};case`generalization`:return{arrowTypeStart:`none`,arrowTypeEnd:`extension`,pattern:`solid`};case`association`:return{...Ei(e.arrowType),pattern:`solid`,...e.label?{label:e.label}:{},...e.labelType?{labelType:e.labelType}:{}}}},`relationshipVisuals`),Oi=e.n(e=>e.animate||e.animation?[`edge-animation-${e.animation??`fast`}`]:[],`animationClasses`),ki=e.n((...e)=>e.filter(e=>!!e).join(` `),`classNames`),Ai={getConfig:ni,createModel:ei,commit:ii,getAST:ri,clear:ai,setDiagramTitle:n.q,getDiagramTitle:n.C,setAccTitle:n.U,getAccTitle:n.v,setAccDescription:n.H,getAccDescription:n._,getActors:oi,getActor:si,getUseCases:ci,getUseCase:li,getSystemBoundaries:ui,getSystemBoundary:di,getRelationships:fi,getNotes:pi,getNote:mi,getJsonNodes:hi,getJsonNode:gi,getClassDefs:_i,getClassDef:vi,getDirection:yi,getData:e.n(()=>{let t=n.b(),r={...U.config,...t.usecase},i=e.n(e=>n.z(e,t),`sanitize`),a=e.n(e=>i(U.actors.get(e)?.label??U.useCases.get(e)?.label??U.jsonNodes.get(e)?.id??U.notes.get(e)?.label??e),`endpointLabel`),o=[],s=[],c=0,l=0;for(let e of U.actors.values())o.push({id:e.id,label:i(e.label),labelType:e.labelType,shape:wi(e),isGroup:!1,padding:10,look:t.look,colorIndex:c++,cssClasses:ki(`default`,`usecase-actor`,`usecase-actor-${e.type}`,e.business&&`usecase-business`,...e.classes),cssStyles:[...e.styles],cssCompiledStyles:bi(e.classes),actorType:e.type,business:e.business,...e.icon?{icon:e.icon}:{},...e.stereotype?{stereotype:i(e.stereotype)}:{},...e.parentId?{parentId:e.parentId}:{}});for(let e of U.useCases.values())o.push({id:e.id,label:i(e.label),labelType:e.labelType,shape:Ti(e),isGroup:!1,padding:e.shape===`ellipse`?20:10,look:t.look,colorIndex:c++,cssClasses:ki(`default`,`usecase-element`,`usecase-${e.shape}`,e.business&&`usecase-business`,...e.classes),cssStyles:[...e.styles],cssCompiledStyles:bi(e.classes),business:e.business,...e.stereotype?{stereotype:i(e.stereotype)}:{},...e.parentId?{parentId:e.parentId}:{}});for(let e of U.notes.values())o.push({id:e.id,label:i(e.label),labelType:e.labelType,shape:`note`,isGroup:!1,padding:10,look:t.look,cssClasses:`default usecase-note`,cssStyles:[],cssCompiledStyles:bi([]),noteTarget:e.target,noteTargetLabel:i(U.actors.get(e.target)?.label??U.useCases.get(e.target)?.label??U.jsonNodes.get(e.target)?.id??e.target)});for(let e of U.jsonNodes.values())o.push({id:e.id,label:i(e.id),labelType:`text`,shape:`usecaseJsonTable`,isGroup:!1,padding:10,look:t.look,cssClasses:ki(`default`,`usecase-json-table`,...e.classes),cssStyles:[...e.styles],cssCompiledStyles:bi(e.classes),jsonRows:Ci(e.value,e.propertyOrder,i)});for(let e of U.systemBoundaries.values())o.push({id:e.id,label:i(e.label),labelType:e.labelType,shape:`usecaseSystemBoundary`,isGroup:!0,padding:20,look:t.look,colorIndex:l++,cssClasses:ki(`default`,`system-boundary`,`system-boundary-${e.type}`,...e.classes),cssStyles:[...e.styles],cssCompiledStyles:bi(e.classes),boundaryType:e.type});for(let e of U.relationships){let{label:n,...r}=Di(e);s.push({id:e.id,start:e.source,end:e.target,source:e.source,target:e.target,sourceLabel:a(e.source),targetLabel:a(e.target),type:`edge`,relationshipType:e.type,internal:!1,...r,...n===void 0?{}:{label:i(n)},labelpos:`c`,classes:ki(`default`,`relationship`,`relationship-${e.type}`,...e.classes,...Oi(e)),style:[...e.styles],cssCompiledStyles:bi(e.classes),animate:e.animate,...e.animation?{animation:e.animation}:{},look:t.look,thickness:`normal`,minlen:e.minlen,isUserDefinedId:e.explicitId})}for(let e of U.notes.values())s.push({id:`${e.id}-edge`,start:e.id,end:e.target,source:e.id,target:e.target,type:`edge`,relationshipType:`note`,sourceLabel:a(e.id),targetLabel:a(e.target),internal:!0,pattern:`dotted`,arrowTypeStart:`none`,arrowTypeEnd:`none`,labelpos:`c`,classes:`default relationship relationship-note`,style:[],cssCompiledStyles:bi([]),animate:!1,look:t.look,thickness:`normal`,minlen:1,isUserDefinedId:!1});for(let e of o)e.wrappingWidth??=r.wrappingWidth,!e.isGroup&&!e.shape.startsWith(`usecaseActor`)&&(e.minWidth??=r.minNodeWidth),(e.shape===`usecaseEllipse`||e.shape===`usecaseBusiness`)&&(e.spreadPorts=!0);return{nodes:o,edges:s,config:t,type:`usecase`,layoutAlgorithm:`dagre`,direction:yi(),nodeSpacing:r.nodeSpacing,rankSpacing:r.rankSpacing,actorFontSize:r.actorFontSize,actorFontFamily:r.actorFontFamily,actorFontWeight:r.actorFontWeight,usecaseFontSize:r.usecaseFontSize,usecaseFontFamily:r.usecaseFontFamily,usecaseFontWeight:r.usecaseFontWeight,diagramPadding:r.diagramPadding,useMaxWidth:r.useMaxWidth,markers:[`point`,`circle`,`cross`,`extension`]}},`getData`)};function ji(e,t,n){let r=[n];return r.index=t,r.input=e,r}e.n(ji,`customMatch`);var Mi=e.n((e,t)=>{if(e[t]!==`"`||e[t+1]!=="`")return null;for(let n=t+2;n<e.length-1;n++)if(e[n]==="`"&&e[n+1]===`"`)return ji(e,t,e.slice(t,n+2));return null},`matchMarkdownString`),Ni=e.n((e,t)=>{if(e[t]!==`%`||e[t+1]!==`%`)return null;for(let n=t-1;n>=0;n--){let t=e[n];if(t===`
69
69
  `||t===`\r`)break;if(t!==` `&&t!==` `)return null}let n=t+2;for(;n<e.length&&e[n]!==`
70
70
  `&&e[n]!==`\r`;)n++;return ji(e,t,e.slice(t,n))},`matchComment`),Pi=e.n((e,t)=>{for(let n=t-1;n>=0;n--){let t=e[n];if(t===`
71
- `||t===`\r`)return!0;if(t!==` `&&t!==` `)return!1}return!0},`isIndentedLineStart`),Fi=e.n((e,t,n)=>{if(!Pi(e,t))return null;let r=n.exec(e.slice(t));return r?ji(e,t,r[0]):null},`matchAccessibilityLine`),Ii=e.n((e,t)=>{if(!Pi(e,t))return null;let n=/^accDescr[\t ]*{/.exec(e.slice(t));if(!n)return null;let r=e.indexOf(`}`,t+n[0].length);return r===-1?null:ji(e,t,e.slice(t,r+1))},`matchAccDescrBlock`),Li=e.n((e,t)=>{if(e[t]!==`{`)return null;let n=0,r=!1,i=!1;for(let a=t;a<e.length;a++){let o=e[a];if(r){i?i=!1:o===`\\`?i=!0:o===`"`&&(r=!1);continue}if(o===`"`)r=!0;else if(o===`{`)n++;else if(o===`}`&&--n===0)return ji(e,t,e.slice(t,a+1))}return null},`matchJsonObject`),Ri=e.n((e,t)=>{let n=e.indexOf(`>>`,t);if(n===-1||/[\n\r]/.test(e.slice(t,n)))return null;let r=e.slice(t,n);return r.trim()?ji(e,t,r):null},`matchStereotypeText`),W=L({name:`LABEL_TEXT`,pattern:I.NA}),zi=L({name:`WORD`,pattern:I.NA,categories:W}),Bi=L({name:`NUMBER`,pattern:/(?:\d+\.\d+|\d+|\.\d+)(?:[A-Za-z]+)?/,categories:W}),G=L({name:`IDENTIFIER`,pattern:/\w+/,longer_alt:Bi,categories:zi}),Vi=L({name:`HWS`,pattern:/[\t ]+/,group:I.SKIPPED}),K=L({name:`MARKDOWN_STRING`,pattern:Mi,start_chars_hint:[`"`],line_breaks:!0}),Hi=L({name:`UNCLOSED_MARKDOWN_STRING`,pattern:/"`[^]*/,line_breaks:!0}),Ui=L({name:`COMMENT`,pattern:Ni,start_chars_hint:[`%`],line_breaks:!1}),q=L({name:`NEWLINE`,pattern:/\r\n|\n|\r/,line_breaks:!0}),Wi=L({name:`ACC_DESCR_BLOCK`,pattern:Ii,start_chars_hint:[`a`],line_breaks:!0}),Gi=/^accTitle[\t ]*:[^\n\r]*/,Ki=/^accDescr[\t ]*:[^\n\r]*/,qi=L({name:`ACC_TITLE_LINE`,pattern:e.n((e,t)=>Fi(e,t,Gi),`pattern`),start_chars_hint:[`a`],line_breaks:!1}),Ji=L({name:`ACC_DESCR_LINE`,pattern:e.n((e,t)=>Fi(e,t,Ki),`pattern`),start_chars_hint:[`a`],line_breaks:!1}),Yi=L({name:`JSON_DECLARATION_START`,pattern:/json[\t ]+\w+[\t ]*@[\t ]*(?={)/,push_mode:`jsonBody`}),Xi=L({name:`JSON_OBJECT_LITERAL`,pattern:Li,start_chars_hint:[`{`],line_breaks:!0,pop_mode:!0}),Zi=L({name:`UNCLOSED_JSON_OBJECT_LITERAL`,pattern:/{[^]*/,line_breaks:!0,pop_mode:!0}),J=e.n((e,t)=>L({name:e,pattern:t,longer_alt:G,categories:zi}),`keyword`),Qi=J(`USECASE`,/usecase-beta/),$i=J(`ACTOR`,/actor/),ea=J(`SYSTEM_BOUNDARY`,/systemBoundary/),ta=J(`END`,/end/),na=J(`DIRECTION`,/direction/),ra=J(`TD`,/TD/),ia=J(`TB`,/TB/),aa=J(`BT`,/BT/),oa=J(`LR`,/LR/),sa=J(`RL`,/RL/),ca=J(`NOTE`,/note/),la=J(`FOR`,/for/),ua=J(`JSON`,/json/),da=J(`CLASS_DEF`,/classDef/),fa=J(`CLASS`,/class/),pa=J(`STYLE`,/style/),ma=J(`INCLUDE`,/include/i),ha=J(`EXTEND`,/extend/i),ga=J(`TRUE`,/true/),_a=J(`FALSE`,/false/),va=L({name:`GENERALIZATION`,pattern:/--\|>/}),ya=L({name:`DEPENDENCY_ARROW`,pattern:/\.\.>/}),ba=L({name:`STEREOTYPE_START`,pattern:/<</,push_mode:`stereotype`}),xa=L({name:`STEREOTYPE_END`,pattern:/>>/,pop_mode:!0}),Sa=L({name:`STEREOTYPE_TEXT`,pattern:Ri,line_breaks:!1}),Ca=L({name:`UNCLOSED_STEREOTYPE_TEXT`,pattern:/[^\n\r]+/,line_breaks:!1,pop_mode:!0}),wa=L({name:`CLASS_SEPARATOR`,pattern:/:::/}),Ta=L({name:`FORWARD_SOLID`,pattern:/--+>/}),Ea=L({name:`BACKWARD_SOLID`,pattern:/<--+/}),Da=L({name:`FORWARD_CIRCLE`,pattern:/--o/}),Oa=L({name:`BACKWARD_CIRCLE`,pattern:/o--/}),ka=L({name:`FORWARD_CROSS`,pattern:/--x/}),Aa=L({name:`BACKWARD_CROSS`,pattern:/x--/}),Y=L({name:`MARKERLESS_SOLID`,pattern:/--+/}),ja=L({name:`METADATA_START`,pattern:/@{/}),Ma=L({name:`AT`,pattern:/@/,categories:W}),Na=L({name:`LBRACE`,pattern:/{/}),Pa=L({name:`RBRACE`,pattern:/}/}),Fa=L({name:`LBRACKET`,pattern:/\[/}),Ia=L({name:`RBRACKET`,pattern:/]/}),La=L({name:`LPAREN`,pattern:/\(/}),Ra=L({name:`RPAREN`,pattern:/\)/}),X=L({name:`COMMA`,pattern:/,/,categories:W}),za=L({name:`COLON`,pattern:/:/,categories:W}),Ba=L({name:`HASH_COLOR`,pattern:/#[\dA-Fa-f]+/,categories:W}),Z=L({name:`PLAIN_STRING`,pattern:/"[^\n\r"]*"|'[^\n\r']*'/}),Va=L({name:`CSS_IDENTIFIER`,pattern:/--[A-Z_a-z][\w-]*|[A-Z_a-z]\w*(?:-\w+)+/,categories:W}),Ha=L({name:`CSS_ESCAPED_COMMA`,pattern:/\\,/,categories:W}),Ua=L({name:`DASH`,pattern:/-/,categories:W}),Wa=L({name:`DOT`,pattern:/\./,categories:W}),Ga=L({name:`PERCENT`,pattern:/%/,categories:W}),Ka=L({name:`CSS_PUNCTUATION`,pattern:/[!#$&*+/=?^_|~]/,categories:W}),qa=[W,zi,Vi,K,Hi,Ui,q,Wi,qi,Ji,Yi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,wa,Ta,Ea,Da,Oa,ka,Aa,Y,ja,Ma,Na,Pa,Fa,Ia,La,Ra,X,za,Ba,Z,Va,G,Bi,Ha,Ua,Wa,Ga,Ka,L({name:`LABEL_PUNCTUATION`,pattern:/[;<>\\`]/,categories:W}),L({name:`LABEL_SYMBOL`,pattern:/[^\t\n\r !-~]+/,categories:W})],Ja={defaultMode:`defaultMode`,modes:{defaultMode:[...qa],jsonBody:[Xi,Zi],stereotype:[xa,Sa,Ca]}},Ya=[...qa,Xi,Zi,xa,Sa,Ca],Xa=new I(Ja),Za=e.n(e=>qt(e,W)||e.tokenType===Z||e.tokenType===K,`isLabelToken`),Qa={allowmixing:!0,newpage:!0,package:!0,rectangle:!0,skinparam:!0},$a=new class extends Yr{static{e.n(this,`UsecaseParser`)}constructor(){super(Ya,{nodeLocationTracking:`full`}),this.RULE(`start`,()=>{this.CONSUME(Qi),this.SUBRULE(this.lineEnd),this.MANY(()=>this.SUBRULE(this.line))}),this.RULE(`line`,()=>{this.OR([{ALT:e.n(()=>this.SUBRULE(this.blankLine),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.commentLine),`ALT`)},{GATE:e.n(()=>this.isStatementStart(),`GATE`),ALT:e.n(()=>this.SUBRULE(this.statement),`ALT`)}])}),this.RULE(`statement`,()=>{this.OR([{ALT:e.n(()=>this.SUBRULE(this.accTitleStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.accDescrStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.directionStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.actorStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.systemBoundaryStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.noteStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.jsonStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.classDefStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.classStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.styleStatement),`ALT`)},{GATE:e.n(()=>this.isMetadataAssignment(),`GATE`),ALT:e.n(()=>this.SUBRULE(this.metadataAssignmentStatement),`ALT`)},{GATE:e.n(()=>!this.isForbiddenPlantUmlStatement(),`GATE`),ALT:e.n(()=>this.SUBRULE(this.entityStatement),`ALT`)}])}),this.RULE(`lineEnd`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(q),`ALT`)},{ALT:e.n(()=>this.CONSUME(R),`ALT`)}])}),this.RULE(`blankLine`,()=>{this.CONSUME(q)}),this.RULE(`commentLine`,()=>{this.CONSUME(Ui),this.SUBRULE(this.lineEnd)}),this.RULE(`accTitleStatement`,()=>{this.CONSUME(qi),this.SUBRULE(this.lineEnd)}),this.RULE(`accDescrStatement`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(Ji),`ALT`)},{ALT:e.n(()=>this.CONSUME(Wi),`ALT`)}]),this.SUBRULE(this.lineEnd)}),this.RULE(`actorStatement`,()=>{this.CONSUME($i),this.SUBRULE(this.actorItem),this.OPTION(()=>{this.OR([{ALT:e.n(()=>this.AT_LEAST_ONE(()=>{this.CONSUME(X),this.SUBRULE2(this.actorItem)}),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.relationTail),`ALT`)}])}),this.SUBRULE(this.lineEnd)}),this.RULE(`actorItem`,()=>{this.SUBRULE(this.actorName),this.OPTION(()=>this.SUBRULE(this.metadata)),this.OPTION2(()=>this.SUBRULE(this.stereotype)),this.OPTION3(()=>this.SUBRULE(this.classSuffix))}),this.RULE(`actorName`,()=>{this.OR([{ALT:e.n(()=>{this.CONSUME(G),this.OPTION(()=>{this.CONSUME(La),this.SUBRULE(this.nodeLabel),this.CONSUME(Ra)})},`ALT`)},{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(K),`ALT`)}])}),this.RULE(`actorDeclarationOnly`,()=>{this.CONSUME($i),this.SUBRULE(this.actorItem),this.MANY(()=>{this.CONSUME(X),this.SUBRULE2(this.actorItem)}),this.SUBRULE(this.lineEnd)}),this.RULE(`entityStatement`,()=>{this.SUBRULE(this.entityName),this.OPTION(()=>this.SUBRULE(this.relationTail)),this.SUBRULE(this.lineEnd)}),this.RULE(`entityName`,()=>{this.OR([{ALT:e.n(()=>{this.CONSUME(G),this.OPTION(()=>{this.OR2([{ALT:e.n(()=>{this.CONSUME(La),this.SUBRULE(this.nodeLabel),this.CONSUME(Ra)},`ALT`)},{ALT:e.n(()=>{this.CONSUME(Fa),this.SUBRULE2(this.nodeLabel),this.CONSUME(Ia)},`ALT`)}])})},`ALT`)},{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(K),`ALT`)}]),this.OPTION2(()=>this.SUBRULE(this.useCaseMetadata)),this.OPTION3(()=>this.SUBRULE(this.stereotype)),this.OPTION4(()=>this.SUBRULE(this.classSuffix))}),this.RULE(`nodeLabel`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(K),`ALT`)},{ALT:e.n(()=>this.AT_LEAST_ONE(()=>this.CONSUME(W)),`ALT`)}])}),this.RULE(`useCaseMetadata`,()=>{this.SUBRULE(this.metadata)}),this.RULE(`relationTail`,()=>{this.OPTION({GATE:e.n(()=>this.LA(1).tokenType===G&&this.LA(2).tokenType===Ma,`GATE`),DEF:e.n(()=>{this.CONSUME(G),this.CONSUME(Ma)},`DEF`)}),this.SUBRULE(this.arrow),this.SUBRULE(this.entityName)}),this.RULE(`arrow`,()=>{this.OR([{ALT:e.n(()=>this.SUBRULE(this.semanticRelation),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.forwardSolidOperator),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.backwardSolidOperator),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.markerlessSolidOperator),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.forwardCircleOperator),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.backwardCircleOperator),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.forwardCrossOperator),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.backwardCrossOperator),`ALT`)}])}),this.RULE(`forwardSolidOperator`,()=>{this.CONSUME(Ta)}),this.RULE(`backwardSolidOperator`,()=>{this.CONSUME(Ea),this.OPTION({GATE:e.n(()=>this.LA(0).image===`<--`&&this.hasLabeledRight([Y]),`GATE`),DEF:e.n(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Y)},`DEF`)})}),this.RULE(`markerlessSolidOperator`,()=>{this.CONSUME(Y),this.OPTION({GATE:e.n(()=>this.LA(0).image===`--`&&this.hasLabeledRight([Ta,Y,Da,ka]),`GATE`),DEF:e.n(()=>{this.SUBRULE(this.edgeLabel),this.OR([{ALT:e.n(()=>this.CONSUME(Ta),`ALT`)},{ALT:e.n(()=>this.CONSUME2(Y),`ALT`)},{ALT:e.n(()=>this.CONSUME(Da),`ALT`)},{ALT:e.n(()=>this.CONSUME(ka),`ALT`)}])},`DEF`)})}),this.RULE(`forwardCircleOperator`,()=>{this.CONSUME(Da)}),this.RULE(`backwardCircleOperator`,()=>{this.CONSUME(Oa),this.OPTION({GATE:e.n(()=>this.hasLabeledRight([Y]),`GATE`),DEF:e.n(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Y)},`DEF`)})}),this.RULE(`forwardCrossOperator`,()=>{this.CONSUME(ka)}),this.RULE(`backwardCrossOperator`,()=>{this.CONSUME(Aa),this.OPTION({GATE:e.n(()=>this.hasLabeledRight([Y]),`GATE`),DEF:e.n(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Y)},`DEF`)})}),this.RULE(`edgeLabel`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(K),`ALT`)},{ALT:e.n(()=>this.AT_LEAST_ONE(()=>this.CONSUME(W)),`ALT`)}])}),this.RULE(`semanticRelation`,()=>{this.OR([{ALT:e.n(()=>{this.CONSUME(ya),this.CONSUME(za),this.OR2([{ALT:e.n(()=>this.CONSUME(ma),`ALT`)},{ALT:e.n(()=>this.CONSUME(ha),`ALT`)}])},`ALT`)},{ALT:e.n(()=>this.CONSUME(va),`ALT`)}])}),this.RULE(`metadata`,()=>{this.CONSUME(ja),this.MANY(()=>this.CONSUME(q)),this.OPTION(()=>{this.SUBRULE(this.metadataProperty),this.MANY2(()=>{this.SUBRULE(this.metadataSeparator),this.SUBRULE2(this.metadataProperty)}),this.OPTION2(()=>this.CONSUME(X)),this.MANY3(()=>this.CONSUME2(q))}),this.CONSUME(Pa)}),this.RULE(`metadataProperty`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(G),`ALT`)},{ALT:e.n(()=>this.CONSUME(Z),`ALT`)}]),this.CONSUME(za),this.OR2([{ALT:e.n(()=>this.CONSUME2(G),`ALT`)},{ALT:e.n(()=>this.CONSUME2(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(ga),`ALT`)},{ALT:e.n(()=>this.CONSUME(_a),`ALT`)}])}),this.RULE(`metadataSeparator`,()=>{this.OR([{ALT:e.n(()=>{this.CONSUME(X),this.MANY(()=>this.CONSUME(q))},`ALT`)},{ALT:e.n(()=>{this.AT_LEAST_ONE(()=>this.CONSUME2(q)),this.OPTION(()=>this.CONSUME2(X)),this.MANY2(()=>this.CONSUME3(q))},`ALT`)}])}),this.RULE(`systemBoundaryStatement`,()=>{this.CONSUME(ea),this.SUBRULE(this.systemBoundaryName),this.OPTION(()=>this.SUBRULE(this.metadata)),this.OPTION2(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd),this.SUBRULE(this.systemBoundaryContent),this.CONSUME(ta),this.SUBRULE2(this.lineEnd)}),this.RULE(`systemBoundaryName`,()=>{this.OR([{ALT:e.n(()=>{this.CONSUME(G),this.OPTION(()=>{this.OR2([{ALT:e.n(()=>{this.CONSUME(La),this.SUBRULE(this.nodeLabel),this.CONSUME(Ra)},`ALT`)},{ALT:e.n(()=>{this.CONSUME(Fa),this.SUBRULE2(this.nodeLabel),this.CONSUME(Ia)},`ALT`)}])})},`ALT`)},{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(K),`ALT`)}])}),this.RULE(`systemBoundaryContent`,()=>{this.MANY(()=>{this.OR([{ALT:e.n(()=>this.SUBRULE(this.blankLine),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.commentLine),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.boundaryElement),`ALT`)}])})}),this.RULE(`boundaryElement`,()=>{this.OR([{ALT:e.n(()=>this.SUBRULE(this.actorDeclarationOnly),`ALT`)},{ALT:e.n(()=>{this.SUBRULE(this.entityName),this.SUBRULE(this.lineEnd)},`ALT`)}])}),this.RULE(`metadataAssignmentStatement`,()=>{this.SUBRULE(this.metadataAssignmentTarget),this.SUBRULE(this.metadata),this.SUBRULE(this.lineEnd)}),this.RULE(`metadataAssignmentTarget`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(G),`ALT`)},{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(K),`ALT`)}])}),this.RULE(`noteStatement`,()=>{this.CONSUME(ca),this.CONSUME(la),this.CONSUME(G),this.SUBRULE(this.nodeLabel),this.SUBRULE(this.lineEnd)}),this.RULE(`stereotype`,()=>{this.CONSUME(ba),this.CONSUME(Sa),this.CONSUME(xa)}),this.RULE(`classSuffix`,()=>{this.CONSUME(wa),this.CONSUME(G),this.MANY(()=>{this.CONSUME(X),this.CONSUME2(G)})}),this.RULE(`jsonStatement`,()=>{this.CONSUME(Yi),this.CONSUME(Xi),this.OPTION(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd)}),this.RULE(`directionStatement`,()=>{this.CONSUME(na),this.OR([{ALT:e.n(()=>this.CONSUME(ra),`ALT`)},{ALT:e.n(()=>this.CONSUME(ia),`ALT`)},{ALT:e.n(()=>this.CONSUME(aa),`ALT`)},{ALT:e.n(()=>this.CONSUME(oa),`ALT`)},{ALT:e.n(()=>this.CONSUME(sa),`ALT`)}]),this.SUBRULE(this.lineEnd)}),this.RULE(`classDefStatement`,()=>{this.CONSUME(da),this.CONSUME(G),this.MANY(()=>{this.CONSUME(X),this.CONSUME2(G)}),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE(`classStatement`,()=>{this.CONSUME(fa),this.CONSUME(G),this.MANY(()=>{this.CONSUME(X),this.CONSUME2(G)}),this.CONSUME3(G),this.MANY2(()=>{this.CONSUME2(X),this.CONSUME4(G)}),this.SUBRULE(this.lineEnd)}),this.RULE(`styleStatement`,()=>{this.CONSUME(pa),this.CONSUME(G),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE(`styles`,()=>{this.SUBRULE(this.styleValue),this.MANY(()=>{this.CONSUME(X),this.SUBRULE2(this.styleValue)})}),this.RULE(`styleValue`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(zi),`ALT`)},{ALT:e.n(()=>this.CONSUME(Va),`ALT`)},{ALT:e.n(()=>{this.CONSUME(Y),this.CONSUME2(zi)},`ALT`)}]),this.CONSUME(za),this.AT_LEAST_ONE(()=>this.SUBRULE(this.styleComponent))}),this.RULE(`styleComponent`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(zi),`ALT`)},{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(Bi),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ba),`ALT`)},{ALT:e.n(()=>this.CONSUME(Va),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ha),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ua),`ALT`)},{ALT:e.n(()=>this.CONSUME(Wa),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ga),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ka),`ALT`)},{ALT:e.n(()=>this.CONSUME(za),`ALT`)},{ALT:e.n(()=>this.CONSUME(La),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ra),`ALT`)},{ALT:e.n(()=>this.CONSUME(Fa),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ia),`ALT`)},{ALT:e.n(()=>this.CONSUME(Na),`ALT`)},{ALT:e.n(()=>this.CONSUME(Pa),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ma),`ALT`)},{ALT:e.n(()=>this.CONSUME(Y),`ALT`)}])}),this.performSelfAnalysis()}isMetadataAssignment(){let e=this.LA(1).tokenType;return(e===G||e===Z||e===K)&&this.LA(2).tokenType===ja}isStatementStart(){let e=this.LA(1).tokenType;return e!==R&&e!==q&&e!==Ui}isForbiddenPlantUmlStatement(){return this.LA(1).tokenType===G&&Qa[this.LA(1).image.toLowerCase()]===!0}hasLabeledRight(e){if(!Za(this.LA(1)))return!1;for(let t=2;;t++){let n=this.LA(t);if(e.includes(n.tokenType))return!0;if(!Za(n))return!1}}},eo=class extends Error{constructor(e,t,n){super(`${e} (line ${t}, column ${n})`),this.line=t,this.column=n,this.name=`UsecaseJsonError`}static{e.n(this,`UsecaseJsonError`)}},to=e.n((e,t,n,r)=>{let i=n,a=r,o=Math.min(Math.max(t,0),e.length);for(let t=0;t<o;t++){let n=e[t];n===`\r`?(i++,a=1):n===`
72
- `?(t===0||e[t-1]!==`\r`)&&(i++,a=1):a++}return{line:i,column:a}},`locationAtOffset`),no=e.n((e,t,n,r)=>{let i=/\bposition (\d+)\b/u.exec(e);if(i)return to(t,Number.parseInt(i[1],10),n,r);let a=/\bline (\d+) column (\d+)\b/u.exec(e);if(a){let e=Number.parseInt(a[1],10),t=Number.parseInt(a[2],10);return{line:n+e-1,column:e===1?r+t-1:t}}if(/unexpected end|end of json input/iu.test(e))return to(t,t.length,n,r)},`locationFromErrorMessage`),Q=class extends Error{constructor(e){super(`Invalid JSON token`),this.offset=e}static{e.n(this,`JsonWalkError`)}},ro=class{constructor(e){this.text=e,this.offset=0,this.propertyOrder={}}static{e.n(this,`PropertyOrderCollector`)}collect(){if(this.skipWhitespace(),this.collectValue(``),this.skipWhitespace(),this.offset!==this.text.length)throw new Q(this.offset);return this.propertyOrder}collectValue(e){this.skipWhitespace();let t=this.text[this.offset];if(t===`{`)this.collectObject(e);else if(t===`[`)this.collectArray(e);else if(t===`"`)this.readString(!1);else if(t===`t`)this.consumeLiteral(`true`);else if(t===`f`)this.consumeLiteral(`false`);else if(t===`n`)this.consumeLiteral(`null`);else if(t===`-`||t>=`0`&&t<=`9`)this.consumeNumber();else throw new Q(this.offset)}collectObject(e){this.offset++;let t=[],n=new Set;if(this.propertyOrder[e]=t,this.skipWhitespace(),this.text[this.offset]===`}`){this.offset++;return}for(;this.offset<this.text.length;){if(this.text[this.offset]!==`"`)throw new Q(this.offset);let r=this.readString(!0),i=`${e}/${r.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`)}`;if(n.has(r)?this.deletePointerSubtree(i):(n.add(r),t.push(r)),this.skipWhitespace(),this.text[this.offset]!==`:`)throw new Q(this.offset);if(this.offset++,this.collectValue(i),this.skipWhitespace(),this.text[this.offset]===`}`){this.offset++;return}if(this.text[this.offset]!==`,`)throw new Q(this.offset);this.offset++,this.skipWhitespace()}throw new Q(this.offset)}collectArray(e){if(this.offset++,this.skipWhitespace(),this.text[this.offset]===`]`){this.offset++;return}let t=0;for(;this.offset<this.text.length;){if(this.collectValue(`${e}/${t}`),t++,this.skipWhitespace(),this.text[this.offset]===`]`){this.offset++;return}if(this.text[this.offset]!==`,`)throw new Q(this.offset);this.offset++,this.skipWhitespace()}throw new Q(this.offset)}readString(e){this.offset++;let t=``;for(;this.offset<this.text.length;){let n=this.offset,r=this.text[this.offset++];if(r===`"`)return t;if(r.charCodeAt(0)<32)throw new Q(n);if(r!==`\\`){e&&(t+=r);continue}let i=this.offset,a=this.text[this.offset++];switch(a){case`"`:case`\\`:case`/`:e&&(t+=a);break;case`b`:e&&(t+=`\b`);break;case`f`:e&&(t+=`\f`);break;case`n`:e&&(t+=`
71
+ `||t===`\r`)return!0;if(t!==` `&&t!==` `)return!1}return!0},`isIndentedLineStart`),Fi=e.n((e,t,n)=>{if(!Pi(e,t))return null;let r=n.exec(e.slice(t));return r?ji(e,t,r[0]):null},`matchAccessibilityLine`),Ii=e.n((e,t)=>{if(!Pi(e,t))return null;let n=/^accDescr[\t ]*{/.exec(e.slice(t));if(!n)return null;let r=e.indexOf(`}`,t+n[0].length);return r===-1?null:ji(e,t,e.slice(t,r+1))},`matchAccDescrBlock`),Li=e.n((e,t)=>{if(e[t]!==`{`)return null;let n=0,r=!1,i=!1;for(let a=t;a<e.length;a++){let o=e[a];if(r)i?i=!1:o===`\\`?i=!0:o===`"`&&(r=!1);else if(o===`"`)r=!0;else if(o===`{`)n++;else if(o===`}`&&--n===0)return ji(e,t,e.slice(t,a+1))}return null},`matchJsonObject`),Ri=e.n((e,t)=>{let n=e.indexOf(`>>`,t);if(n===-1||/[\n\r]/.test(e.slice(t,n)))return null;let r=e.slice(t,n);return r.trim()?ji(e,t,r):null},`matchStereotypeText`),W=L({name:`LABEL_TEXT`,pattern:I.NA}),zi=L({name:`WORD`,pattern:I.NA,categories:W}),Bi=L({name:`NUMBER`,pattern:/(?:\d+\.\d+|\d+|\.\d+)(?:[A-Za-z]+)?/,categories:W}),G=L({name:`IDENTIFIER`,pattern:/\w+/,longer_alt:Bi,categories:zi}),Vi=L({name:`HWS`,pattern:/[\t ]+/,group:I.SKIPPED}),K=L({name:`MARKDOWN_STRING`,pattern:Mi,start_chars_hint:[`"`],line_breaks:!0}),Hi=L({name:`UNCLOSED_MARKDOWN_STRING`,pattern:/"`[^]*/,line_breaks:!0}),Ui=L({name:`COMMENT`,pattern:Ni,start_chars_hint:[`%`],line_breaks:!1}),q=L({name:`NEWLINE`,pattern:/\r\n|\n|\r/,line_breaks:!0}),Wi=L({name:`ACC_DESCR_BLOCK`,pattern:Ii,start_chars_hint:[`a`],line_breaks:!0}),Gi=/^accTitle[\t ]*:[^\n\r]*/,Ki=/^accDescr[\t ]*:[^\n\r]*/,qi=L({name:`ACC_TITLE_LINE`,pattern:e.n((e,t)=>Fi(e,t,Gi),`pattern`),start_chars_hint:[`a`],line_breaks:!1}),Ji=L({name:`ACC_DESCR_LINE`,pattern:e.n((e,t)=>Fi(e,t,Ki),`pattern`),start_chars_hint:[`a`],line_breaks:!1}),Yi=L({name:`JSON_DECLARATION_START`,pattern:/json[\t ]+\w+[\t ]*@[\t ]*(?={)/,push_mode:`jsonBody`}),Xi=L({name:`JSON_OBJECT_LITERAL`,pattern:Li,start_chars_hint:[`{`],line_breaks:!0,pop_mode:!0}),Zi=L({name:`UNCLOSED_JSON_OBJECT_LITERAL`,pattern:/{[^]*/,line_breaks:!0,pop_mode:!0}),J=e.n((e,t)=>L({name:e,pattern:t,longer_alt:G,categories:zi}),`keyword`),Qi=J(`USECASE`,/usecase-beta/),$i=J(`ACTOR`,/actor/),ea=J(`SYSTEM_BOUNDARY`,/systemBoundary/),ta=J(`END`,/end/),na=J(`DIRECTION`,/direction/),ra=J(`TD`,/TD/),ia=J(`TB`,/TB/),aa=J(`BT`,/BT/),oa=J(`LR`,/LR/),sa=J(`RL`,/RL/),ca=J(`NOTE`,/note/),la=J(`FOR`,/for/),ua=J(`JSON`,/json/),da=J(`CLASS_DEF`,/classDef/),fa=J(`CLASS`,/class/),pa=J(`STYLE`,/style/),ma=J(`INCLUDE`,/include/i),ha=J(`EXTEND`,/extend/i),ga=J(`TRUE`,/true/),_a=J(`FALSE`,/false/),va=L({name:`GENERALIZATION`,pattern:/--\|>/}),ya=L({name:`DEPENDENCY_ARROW`,pattern:/\.\.>/}),ba=L({name:`STEREOTYPE_START`,pattern:/<</,push_mode:`stereotype`}),xa=L({name:`STEREOTYPE_END`,pattern:/>>/,pop_mode:!0}),Sa=L({name:`STEREOTYPE_TEXT`,pattern:Ri,line_breaks:!1}),Ca=L({name:`UNCLOSED_STEREOTYPE_TEXT`,pattern:/[^\n\r]+/,line_breaks:!1,pop_mode:!0}),wa=L({name:`CLASS_SEPARATOR`,pattern:/:::/}),Ta=L({name:`FORWARD_SOLID`,pattern:/--+>/}),Ea=L({name:`BACKWARD_SOLID`,pattern:/<--+/}),Da=L({name:`FORWARD_CIRCLE`,pattern:/--o/}),Oa=L({name:`BACKWARD_CIRCLE`,pattern:/o--/}),ka=L({name:`FORWARD_CROSS`,pattern:/--x/}),Aa=L({name:`BACKWARD_CROSS`,pattern:/x--/}),Y=L({name:`MARKERLESS_SOLID`,pattern:/--+/}),ja=L({name:`METADATA_START`,pattern:/@{/}),Ma=L({name:`AT`,pattern:/@/,categories:W}),Na=L({name:`LBRACE`,pattern:/{/}),Pa=L({name:`RBRACE`,pattern:/}/}),Fa=L({name:`LBRACKET`,pattern:/\[/}),Ia=L({name:`RBRACKET`,pattern:/]/}),La=L({name:`LPAREN`,pattern:/\(/}),Ra=L({name:`RPAREN`,pattern:/\)/}),X=L({name:`COMMA`,pattern:/,/,categories:W}),za=L({name:`COLON`,pattern:/:/,categories:W}),Ba=L({name:`HASH_COLOR`,pattern:/#[\dA-Fa-f]+/,categories:W}),Z=L({name:`PLAIN_STRING`,pattern:/"[^\n\r"]*"|'[^\n\r']*'/}),Va=L({name:`CSS_IDENTIFIER`,pattern:/--[A-Z_a-z][\w-]*|[A-Z_a-z]\w*(?:-\w+)+/,categories:W}),Ha=L({name:`CSS_ESCAPED_COMMA`,pattern:/\\,/,categories:W}),Ua=L({name:`DASH`,pattern:/-/,categories:W}),Wa=L({name:`DOT`,pattern:/\./,categories:W}),Ga=L({name:`PERCENT`,pattern:/%/,categories:W}),Ka=L({name:`CSS_PUNCTUATION`,pattern:/[!#$&*+/=?^_|~]/,categories:W}),qa=[W,zi,Vi,K,Hi,Ui,q,Wi,qi,Ji,Yi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,wa,Ta,Ea,Da,Oa,ka,Aa,Y,ja,Ma,Na,Pa,Fa,Ia,La,Ra,X,za,Ba,Z,Va,G,Bi,Ha,Ua,Wa,Ga,Ka,L({name:`LABEL_PUNCTUATION`,pattern:/[;<>\\`]/,categories:W}),L({name:`LABEL_SYMBOL`,pattern:/[^\t\n\r !-~]+/,categories:W})],Ja={defaultMode:`defaultMode`,modes:{defaultMode:[...qa],jsonBody:[Xi,Zi],stereotype:[xa,Sa,Ca]}},Ya=[...qa,Xi,Zi,xa,Sa,Ca],Xa=new I(Ja),Za=e.n(e=>qt(e,W)||e.tokenType===Z||e.tokenType===K,`isLabelToken`),Qa={allowmixing:!0,newpage:!0,package:!0,rectangle:!0,skinparam:!0},$a=new class extends Yr{static{e.n(this,`UsecaseParser`)}constructor(){super(Ya,{nodeLocationTracking:`full`}),this.RULE(`start`,()=>{this.CONSUME(Qi),this.SUBRULE(this.lineEnd),this.MANY(()=>this.SUBRULE(this.line))}),this.RULE(`line`,()=>{this.OR([{ALT:e.n(()=>this.SUBRULE(this.blankLine),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.commentLine),`ALT`)},{GATE:e.n(()=>this.isStatementStart(),`GATE`),ALT:e.n(()=>this.SUBRULE(this.statement),`ALT`)}])}),this.RULE(`statement`,()=>{this.OR([{ALT:e.n(()=>this.SUBRULE(this.accTitleStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.accDescrStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.directionStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.actorStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.systemBoundaryStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.noteStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.jsonStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.classDefStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.classStatement),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.styleStatement),`ALT`)},{GATE:e.n(()=>this.isMetadataAssignment(),`GATE`),ALT:e.n(()=>this.SUBRULE(this.metadataAssignmentStatement),`ALT`)},{GATE:e.n(()=>!this.isForbiddenPlantUmlStatement(),`GATE`),ALT:e.n(()=>this.SUBRULE(this.entityStatement),`ALT`)}])}),this.RULE(`lineEnd`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(q),`ALT`)},{ALT:e.n(()=>this.CONSUME(R),`ALT`)}])}),this.RULE(`blankLine`,()=>{this.CONSUME(q)}),this.RULE(`commentLine`,()=>{this.CONSUME(Ui),this.SUBRULE(this.lineEnd)}),this.RULE(`accTitleStatement`,()=>{this.CONSUME(qi),this.SUBRULE(this.lineEnd)}),this.RULE(`accDescrStatement`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(Ji),`ALT`)},{ALT:e.n(()=>this.CONSUME(Wi),`ALT`)}]),this.SUBRULE(this.lineEnd)}),this.RULE(`actorStatement`,()=>{this.CONSUME($i),this.SUBRULE(this.actorItem),this.OPTION(()=>{this.OR([{ALT:e.n(()=>this.AT_LEAST_ONE(()=>{this.CONSUME(X),this.SUBRULE2(this.actorItem)}),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.relationTail),`ALT`)}])}),this.SUBRULE(this.lineEnd)}),this.RULE(`actorItem`,()=>{this.SUBRULE(this.actorName),this.OPTION(()=>this.SUBRULE(this.metadata)),this.OPTION2(()=>this.SUBRULE(this.stereotype)),this.OPTION3(()=>this.SUBRULE(this.classSuffix))}),this.RULE(`actorName`,()=>{this.OR([{ALT:e.n(()=>{this.CONSUME(G),this.OPTION(()=>{this.CONSUME(La),this.SUBRULE(this.nodeLabel),this.CONSUME(Ra)})},`ALT`)},{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(K),`ALT`)}])}),this.RULE(`actorDeclarationOnly`,()=>{this.CONSUME($i),this.SUBRULE(this.actorItem),this.MANY(()=>{this.CONSUME(X),this.SUBRULE2(this.actorItem)}),this.SUBRULE(this.lineEnd)}),this.RULE(`entityStatement`,()=>{this.SUBRULE(this.entityName),this.OPTION(()=>this.SUBRULE(this.relationTail)),this.SUBRULE(this.lineEnd)}),this.RULE(`entityName`,()=>{this.OR([{ALT:e.n(()=>{this.CONSUME(G),this.OPTION(()=>{this.OR2([{ALT:e.n(()=>{this.CONSUME(La),this.SUBRULE(this.nodeLabel),this.CONSUME(Ra)},`ALT`)},{ALT:e.n(()=>{this.CONSUME(Fa),this.SUBRULE2(this.nodeLabel),this.CONSUME(Ia)},`ALT`)}])})},`ALT`)},{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(K),`ALT`)}]),this.OPTION2(()=>this.SUBRULE(this.useCaseMetadata)),this.OPTION3(()=>this.SUBRULE(this.stereotype)),this.OPTION4(()=>this.SUBRULE(this.classSuffix))}),this.RULE(`nodeLabel`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(K),`ALT`)},{ALT:e.n(()=>this.AT_LEAST_ONE(()=>this.CONSUME(W)),`ALT`)}])}),this.RULE(`useCaseMetadata`,()=>{this.SUBRULE(this.metadata)}),this.RULE(`relationTail`,()=>{this.OPTION({GATE:e.n(()=>this.LA(1).tokenType===G&&this.LA(2).tokenType===Ma,`GATE`),DEF:e.n(()=>{this.CONSUME(G),this.CONSUME(Ma)},`DEF`)}),this.SUBRULE(this.arrow),this.SUBRULE(this.entityName)}),this.RULE(`arrow`,()=>{this.OR([{ALT:e.n(()=>this.SUBRULE(this.semanticRelation),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.forwardSolidOperator),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.backwardSolidOperator),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.markerlessSolidOperator),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.forwardCircleOperator),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.backwardCircleOperator),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.forwardCrossOperator),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.backwardCrossOperator),`ALT`)}])}),this.RULE(`forwardSolidOperator`,()=>{this.CONSUME(Ta)}),this.RULE(`backwardSolidOperator`,()=>{this.CONSUME(Ea),this.OPTION({GATE:e.n(()=>this.LA(0).image===`<--`&&this.hasLabeledRight([Y]),`GATE`),DEF:e.n(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Y)},`DEF`)})}),this.RULE(`markerlessSolidOperator`,()=>{this.CONSUME(Y),this.OPTION({GATE:e.n(()=>this.LA(0).image===`--`&&this.hasLabeledRight([Ta,Y,Da,ka]),`GATE`),DEF:e.n(()=>{this.SUBRULE(this.edgeLabel),this.OR([{ALT:e.n(()=>this.CONSUME(Ta),`ALT`)},{ALT:e.n(()=>this.CONSUME2(Y),`ALT`)},{ALT:e.n(()=>this.CONSUME(Da),`ALT`)},{ALT:e.n(()=>this.CONSUME(ka),`ALT`)}])},`DEF`)})}),this.RULE(`forwardCircleOperator`,()=>{this.CONSUME(Da)}),this.RULE(`backwardCircleOperator`,()=>{this.CONSUME(Oa),this.OPTION({GATE:e.n(()=>this.hasLabeledRight([Y]),`GATE`),DEF:e.n(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Y)},`DEF`)})}),this.RULE(`forwardCrossOperator`,()=>{this.CONSUME(ka)}),this.RULE(`backwardCrossOperator`,()=>{this.CONSUME(Aa),this.OPTION({GATE:e.n(()=>this.hasLabeledRight([Y]),`GATE`),DEF:e.n(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(Y)},`DEF`)})}),this.RULE(`edgeLabel`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(K),`ALT`)},{ALT:e.n(()=>this.AT_LEAST_ONE(()=>this.CONSUME(W)),`ALT`)}])}),this.RULE(`semanticRelation`,()=>{this.OR([{ALT:e.n(()=>{this.CONSUME(ya),this.CONSUME(za),this.OR2([{ALT:e.n(()=>this.CONSUME(ma),`ALT`)},{ALT:e.n(()=>this.CONSUME(ha),`ALT`)}])},`ALT`)},{ALT:e.n(()=>this.CONSUME(va),`ALT`)}])}),this.RULE(`metadata`,()=>{this.CONSUME(ja),this.MANY(()=>this.CONSUME(q)),this.OPTION(()=>{this.SUBRULE(this.metadataProperty),this.MANY2(()=>{this.SUBRULE(this.metadataSeparator),this.SUBRULE2(this.metadataProperty)}),this.OPTION2(()=>this.CONSUME(X)),this.MANY3(()=>this.CONSUME2(q))}),this.CONSUME(Pa)}),this.RULE(`metadataProperty`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(G),`ALT`)},{ALT:e.n(()=>this.CONSUME(Z),`ALT`)}]),this.CONSUME(za),this.OR2([{ALT:e.n(()=>this.CONSUME2(G),`ALT`)},{ALT:e.n(()=>this.CONSUME2(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(ga),`ALT`)},{ALT:e.n(()=>this.CONSUME(_a),`ALT`)}])}),this.RULE(`metadataSeparator`,()=>{this.OR([{ALT:e.n(()=>{this.CONSUME(X),this.MANY(()=>this.CONSUME(q))},`ALT`)},{ALT:e.n(()=>{this.AT_LEAST_ONE(()=>this.CONSUME2(q)),this.OPTION(()=>this.CONSUME2(X)),this.MANY2(()=>this.CONSUME3(q))},`ALT`)}])}),this.RULE(`systemBoundaryStatement`,()=>{this.CONSUME(ea),this.SUBRULE(this.systemBoundaryName),this.OPTION(()=>this.SUBRULE(this.metadata)),this.OPTION2(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd),this.SUBRULE(this.systemBoundaryContent),this.CONSUME(ta),this.SUBRULE2(this.lineEnd)}),this.RULE(`systemBoundaryName`,()=>{this.OR([{ALT:e.n(()=>{this.CONSUME(G),this.OPTION(()=>{this.OR2([{ALT:e.n(()=>{this.CONSUME(La),this.SUBRULE(this.nodeLabel),this.CONSUME(Ra)},`ALT`)},{ALT:e.n(()=>{this.CONSUME(Fa),this.SUBRULE2(this.nodeLabel),this.CONSUME(Ia)},`ALT`)}])})},`ALT`)},{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(K),`ALT`)}])}),this.RULE(`systemBoundaryContent`,()=>{this.MANY(()=>{this.OR([{ALT:e.n(()=>this.SUBRULE(this.blankLine),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.commentLine),`ALT`)},{ALT:e.n(()=>this.SUBRULE(this.boundaryElement),`ALT`)}])})}),this.RULE(`boundaryElement`,()=>{this.OR([{ALT:e.n(()=>this.SUBRULE(this.actorDeclarationOnly),`ALT`)},{ALT:e.n(()=>{this.SUBRULE(this.entityName),this.SUBRULE(this.lineEnd)},`ALT`)}])}),this.RULE(`metadataAssignmentStatement`,()=>{this.SUBRULE(this.metadataAssignmentTarget),this.SUBRULE(this.metadata),this.SUBRULE(this.lineEnd)}),this.RULE(`metadataAssignmentTarget`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(G),`ALT`)},{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(K),`ALT`)}])}),this.RULE(`noteStatement`,()=>{this.CONSUME(ca),this.CONSUME(la),this.CONSUME(G),this.SUBRULE(this.nodeLabel),this.SUBRULE(this.lineEnd)}),this.RULE(`stereotype`,()=>{this.CONSUME(ba),this.CONSUME(Sa),this.CONSUME(xa)}),this.RULE(`classSuffix`,()=>{this.CONSUME(wa),this.CONSUME(G),this.MANY(()=>{this.CONSUME(X),this.CONSUME2(G)})}),this.RULE(`jsonStatement`,()=>{this.CONSUME(Yi),this.CONSUME(Xi),this.OPTION(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd)}),this.RULE(`directionStatement`,()=>{this.CONSUME(na),this.OR([{ALT:e.n(()=>this.CONSUME(ra),`ALT`)},{ALT:e.n(()=>this.CONSUME(ia),`ALT`)},{ALT:e.n(()=>this.CONSUME(aa),`ALT`)},{ALT:e.n(()=>this.CONSUME(oa),`ALT`)},{ALT:e.n(()=>this.CONSUME(sa),`ALT`)}]),this.SUBRULE(this.lineEnd)}),this.RULE(`classDefStatement`,()=>{this.CONSUME(da),this.CONSUME(G),this.MANY(()=>{this.CONSUME(X),this.CONSUME2(G)}),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE(`classStatement`,()=>{this.CONSUME(fa),this.CONSUME(G),this.MANY(()=>{this.CONSUME(X),this.CONSUME2(G)}),this.CONSUME3(G),this.MANY2(()=>{this.CONSUME2(X),this.CONSUME4(G)}),this.SUBRULE(this.lineEnd)}),this.RULE(`styleStatement`,()=>{this.CONSUME(pa),this.CONSUME(G),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE(`styles`,()=>{this.SUBRULE(this.styleValue),this.MANY(()=>{this.CONSUME(X),this.SUBRULE2(this.styleValue)})}),this.RULE(`styleValue`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(zi),`ALT`)},{ALT:e.n(()=>this.CONSUME(Va),`ALT`)},{ALT:e.n(()=>{this.CONSUME(Y),this.CONSUME2(zi)},`ALT`)}]),this.CONSUME(za),this.AT_LEAST_ONE(()=>this.SUBRULE(this.styleComponent))}),this.RULE(`styleComponent`,()=>{this.OR([{ALT:e.n(()=>this.CONSUME(zi),`ALT`)},{ALT:e.n(()=>this.CONSUME(Z),`ALT`)},{ALT:e.n(()=>this.CONSUME(Bi),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ba),`ALT`)},{ALT:e.n(()=>this.CONSUME(Va),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ha),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ua),`ALT`)},{ALT:e.n(()=>this.CONSUME(Wa),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ga),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ka),`ALT`)},{ALT:e.n(()=>this.CONSUME(za),`ALT`)},{ALT:e.n(()=>this.CONSUME(La),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ra),`ALT`)},{ALT:e.n(()=>this.CONSUME(Fa),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ia),`ALT`)},{ALT:e.n(()=>this.CONSUME(Na),`ALT`)},{ALT:e.n(()=>this.CONSUME(Pa),`ALT`)},{ALT:e.n(()=>this.CONSUME(Ma),`ALT`)},{ALT:e.n(()=>this.CONSUME(Y),`ALT`)}])}),this.performSelfAnalysis()}isMetadataAssignment(){let e=this.LA(1).tokenType;return(e===G||e===Z||e===K)&&this.LA(2).tokenType===ja}isStatementStart(){let e=this.LA(1).tokenType;return e!==R&&e!==q&&e!==Ui}isForbiddenPlantUmlStatement(){return this.LA(1).tokenType===G&&Qa[this.LA(1).image.toLowerCase()]===!0}hasLabeledRight(e){if(!Za(this.LA(1)))return!1;for(let t=2;;t++){let n=this.LA(t);if(e.includes(n.tokenType))return!0;if(!Za(n))return!1}}},eo=class extends Error{constructor(e,t,n){super(`${e} (line ${t}, column ${n})`),this.line=t,this.column=n,this.name=`UsecaseJsonError`}static{e.n(this,`UsecaseJsonError`)}},to=e.n((e,t,n,r)=>{let i=n,a=r,o=Math.min(Math.max(t,0),e.length);for(let t=0;t<o;t++){let n=e[t];n===`\r`?(i++,a=1):n===`
72
+ `?(t===0||e[t-1]!==`\r`)&&(i++,a=1):a++}return{line:i,column:a}},`locationAtOffset`),no=e.n((e,t,n,r)=>{let i=/\bposition (\d+)\b/u.exec(e);if(i)return to(t,Number.parseInt(i[1],10),n,r);let a=/\bline (\d+) column (\d+)\b/u.exec(e);if(a){let e=Number.parseInt(a[1],10),t=Number.parseInt(a[2],10);return{line:n+e-1,column:e===1?r+t-1:t}}if(/unexpected end|end of json input/iu.test(e))return to(t,t.length,n,r)},`locationFromErrorMessage`),Q=class extends Error{constructor(e){super(`Invalid JSON token`),this.offset=e}static{e.n(this,`JsonWalkError`)}},ro=class{constructor(e){this.text=e,this.offset=0,this.propertyOrder={}}static{e.n(this,`PropertyOrderCollector`)}collect(){if(this.skipWhitespace(),this.collectValue(``),this.skipWhitespace(),this.offset!==this.text.length)throw new Q(this.offset);return this.propertyOrder}collectValue(e){this.skipWhitespace();let t=this.text[this.offset];if(t===`{`)this.collectObject(e);else if(t===`[`)this.collectArray(e);else if(t===`"`)this.readString(!1);else if(t===`t`)this.consumeLiteral(`true`);else if(t===`f`)this.consumeLiteral(`false`);else if(t===`n`)this.consumeLiteral(`null`);else if(t===`-`||t>=`0`&&t<=`9`)this.consumeNumber();else throw new Q(this.offset)}collectObject(e){this.offset++;let t=[],n=new Set;if(this.propertyOrder[e]=t,this.skipWhitespace(),this.text[this.offset]===`}`)this.offset++;else{for(;this.offset<this.text.length;){if(this.text[this.offset]!==`"`)throw new Q(this.offset);let r=this.readString(!0),i=`${e}/${r.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`)}`;if(n.has(r)?this.deletePointerSubtree(i):(n.add(r),t.push(r)),this.skipWhitespace(),this.text[this.offset]!==`:`)throw new Q(this.offset);if(this.offset++,this.collectValue(i),this.skipWhitespace(),this.text[this.offset]===`}`){this.offset++;return}if(this.text[this.offset]!==`,`)throw new Q(this.offset);this.offset++,this.skipWhitespace()}throw new Q(this.offset)}}collectArray(e){if(this.offset++,this.skipWhitespace(),this.text[this.offset]===`]`){this.offset++;return}let t=0;for(;this.offset<this.text.length;){if(this.collectValue(`${e}/${t}`),t++,this.skipWhitespace(),this.text[this.offset]===`]`){this.offset++;return}if(this.text[this.offset]!==`,`)throw new Q(this.offset);this.offset++,this.skipWhitespace()}throw new Q(this.offset)}readString(e){this.offset++;let t=``;for(;this.offset<this.text.length;){let n=this.offset,r=this.text[this.offset++];if(r===`"`)return t;if(r.charCodeAt(0)<32)throw new Q(n);if(r!==`\\`){e&&(t+=r);continue}let i=this.offset,a=this.text[this.offset++];switch(a){case`"`:case`\\`:case`/`:e&&(t+=a);break;case`b`:e&&(t+=`\b`);break;case`f`:e&&(t+=`\f`);break;case`n`:e&&(t+=`
73
73
  `);break;case`r`:e&&(t+=`\r`);break;case`t`:e&&(t+=` `);break;case`u`:{let n=this.text.slice(this.offset,this.offset+4);if(!/^[\dA-Fa-f]{4}$/u.test(n))throw new Q(this.offset);e&&(t+=String.fromCharCode(Number.parseInt(n,16))),this.offset+=4;break}default:throw new Q(i)}}throw new Q(this.offset)}consumeLiteral(e){let t=0;for(let n of e){if(this.text[this.offset+t]!==n)throw new Q(this.offset+t);t++}this.offset+=e.length}consumeNumber(){if(this.text[this.offset]===`-`&&this.offset++,this.text[this.offset]===`0`)this.offset++;else if(this.text[this.offset]>=`1`&&this.text[this.offset]<=`9`)for(;this.text[this.offset]>=`0`&&this.text[this.offset]<=`9`;)this.offset++;else throw new Q(this.offset);if(this.text[this.offset]===`.`){if(this.offset++,this.text[this.offset]<`0`||this.text[this.offset]>`9`)throw new Q(this.offset);for(;this.text[this.offset]>=`0`&&this.text[this.offset]<=`9`;)this.offset++}if(this.text[this.offset]===`e`||this.text[this.offset]===`E`){if(this.offset++,(this.text[this.offset]===`+`||this.text[this.offset]===`-`)&&this.offset++,this.text[this.offset]<`0`||this.text[this.offset]>`9`)throw new Q(this.offset);for(;this.text[this.offset]>=`0`&&this.text[this.offset]<=`9`;)this.offset++}}skipWhitespace(){for(;this.offset<this.text.length;){let e=this.text[this.offset];if(e!==` `&&e!==` `&&e!==`
74
- `&&e!==`\r`)return;this.offset++}}deletePointerSubtree(e){let t=`${e}/`;for(let n of Object.keys(this.propertyOrder))(n===e||n.startsWith(t))&&delete this.propertyOrder[n]}};function io(e,t,n){let r;try{r=JSON.parse(e)}catch(r){let i=r instanceof Error?r.message:String(r),a=no(i,e,t,n);if(!a){let r=0;try{new ro(e).collect()}catch(e){e instanceof Q&&(r=e.offset)}a=to(e,r,t,n)}throw new eo(`Invalid JSON: ${i}`,a.line,a.column)}if(typeof r!=`object`||!r||Array.isArray(r))throw new eo(`JSON value must have an object root`,t,n);return{value:r,propertyOrder:new ro(e).collect()}}e.n(io,`parseOrderedJsonObject`);var ao=e.n(e=>({shape:e.type===`normal`?`actor`:e.type===`hollow`?`actor-hollow`:e.type===`awesome`?`actor-awesome`:`actor-icon`,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`actor`,actorType:e.type,business:e.business,labelType:e.labelType,...e.icon?{icon:e.icon}:{},...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),`actorNode`),oo=e.n(e=>({shape:e.shape,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`usecase`,useCaseShape:e.shape,business:e.business,labelType:e.labelType,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),`useCaseNode`),so=e.n(e=>({label:e.label,shape:`note`,attrs:{kind:`note`,target:e.target,labelType:e.labelType}}),`noteNode`),co=e.n(e=>({label:e.id,shape:`json-table`,...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`json`,value:e.value,propertyOrder:e.propertyOrder,labelType:`text`}}),`jsonNode`),lo=e.n(e=>({id:e.id,source:e.source,target:e.target,...e.label?{label:e.label}:{},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{relationshipType:e.type,arrowType:e.arrowType,minlen:e.minlen,explicitId:e.explicitId,animate:e.animate,...e.animation?{animation:e.animation}:{},...e.labelType?{labelType:e.labelType}:{}}}),`relationshipEdge`),uo=e.n(e=>({id:`${e.id}-edge`,source:e.id,target:e.target,attrs:{relationshipType:`note`,arrowType:H.LINE_SOLID,pattern:`dotted`,minlen:1,explicitId:!1,animate:!1,internal:!0}}),`noteEdge`),fo=e.n((e,t,n,r)=>{let i={};for(let t of e.getActors().values())i[t.id]=ao(t);for(let t of e.getUseCases().values())i[t.id]=oo(t);for(let t of e.getNotes().values())i[t.id]=so(t);for(let t of e.getJsonNodes().values())i[t.id]=co(t);let a={};for(let t of e.getSystemBoundaries().values())a[t.id]={...t.label===t.id?{}:{title:t.label},nodes:[...t.members],...t.classes.length?{classes:[...t.classes]}:{},...t.styles.length?{styles:[...t.styles]}:{},attrs:{kind:`systemBoundary`,boundaryType:t.type,labelType:t.labelType}};let o={};for(let t of e.getClassDefs().values())o[t.id]={styles:[...t.styles]};let s=e.getDirection();return{version:1,diagramType:`usecase`,source:t,header:{keyword:`usecase`,direction:s===`TD`?`TB`:s,span:n},...e.getAccTitle()?{accTitle:e.getAccTitle()}:{},...e.getAccDescription()?{accDescr:e.getAccDescription()}:{},nodes:i,edges:[...e.getRelationships().map(lo),...[...e.getNotes().values()].map(uo)],groups:a,classDefs:o,statements:r}},`buildUsecaseGraphAST`),$=e.n(e=>`line ${e.line}, column ${e.column} [${e.span[0]},${e.span[1]})`,`locationText`),po=e.n(e=>e===void 0?``:` (label "${e}")`,`labelSuffix`),mo=e.n(e=>e.generated?e.label:void 0,`generatedFrom`),ho=e.n((e,t)=>{for(let n of t)e.includes(n)||e.push(n)},`pushUnique`),go=class{constructor(e){this.db=e,this.source=``,this.statements=[],this.elements=[],this.boundaries=[],this.jsonDrafts=[],this.relationshipDrafts=[],this.noteDrafts=[],this.metadataAssignments=[],this.classAssignments=[],this.styleAssignments=[],this.classDefinitions=[],this.directions=[],this.model=e.createModel()}static{e.n(this,`UsecaseModelBuilder`)}reset(e){this.model=this.db.createModel(),this.source=e,this.statements=[],this.elements.length=0,this.boundaries.length=0,this.jsonDrafts.length=0,this.relationshipDrafts.length=0,this.noteDrafts.length=0,this.metadataAssignments.length=0,this.classAssignments.length=0,this.styleAssignments.length=0,this.classDefinitions.length=0,this.directions.length=0}addElement(e){this.elements.push(e)}addBoundary(e){this.boundaries.push(e)}addJson(e){this.jsonDrafts.push(e)}addRelationship(e){this.relationshipDrafts.push(e)}addNote(e){this.noteDrafts.push(e)}addMetadataAssignment(e,t,n,r){this.metadataAssignments.push({target:e,targetLocation:t,metadata:n,statement:r})}addClassDef(e,t){this.classDefinitions.push({ids:e,styles:t})}addClassAssignment(e,t){this.classAssignments.push({targets:e,classes:t})}addStyleAssignment(e,t,n){this.styleAssignments.push({target:e,location:t,styles:n})}setDirection(e){this.directions.push(e===`TD`?`TB`:e)}setAccTitle(e){this.model.accTitle=e}setAccDescription(e){this.model.accDescription=e}setStatements(e){this.statements=e}getActors(){return this.model.actors}getUseCases(){return this.model.useCases}getSystemBoundaries(){return this.model.systemBoundaries}getRelationships(){return this.model.relationships}getNotes(){return this.model.notes}getJsonNodes(){return this.model.jsonNodes}getClassDefs(){return this.model.classDefs}getDirection(){return this.model.direction}getAccTitle(){return this.model.accTitle}getAccDescription(){return this.model.accDescription}finalize(e){let t=new Map,n=new Map,r=new Map,i=new Map;for(let e of this.relationshipDrafts)this.recordFirst(i,e.source.id,e.source.location.span[0]),this.recordFirst(i,e.target.id,e.target.location.span[0]);for(let e of this.elements)this.recordFirst(i,e.id,e.location.span[0]);for(let e of this.boundaries)this.recordFirst(i,e.id,e.location.span[0]);for(let e of this.jsonDrafts)this.recordFirst(i,e.id,e.location.span[0]);let a=[...this.elements.map(e=>({offset:e.location.span[0],type:`element`,value:e})),...this.boundaries.map(e=>({offset:e.location.span[0],type:`boundary`,value:e})),...this.jsonDrafts.map(e=>({offset:e.location.span[0],type:`json`,value:e})),...this.relationshipDrafts.filter(e=>e.explicitId).map(e=>({offset:e.explicitIdLocation.span[0],type:`edge`,value:e}))].sort((e,t)=>e.offset-t.offset);for(let e of a)e.type===`element`?this.collectElement(e.value,t,n):e.type===`boundary`?this.collectBoundary(e.value,t,r):e.type===`json`?this.registerUnique(t,e.value.id,`json`,e.value.location,!1):this.registerUnique(t,e.value.explicitId,`edge`,e.value.explicitIdLocation,!1);this.materializeElements(n,i),this.materializeBoundaries(r,i),this.materializeJson(i);let o=this.materializeRelationships(t,n,i);this.reorderElements(n,i),this.applyMetadataAssignments(t,n,r,o),this.validateAndRefreshElements(n),this.refreshBoundaries(r,n),this.materializeNotes(t),this.applyClassDefinitions(),this.applyClassesAndStyles(t,o),this.model.direction=this.directions.at(-1)??this.model.direction,this.model.symbols=new Map([...t].map(([e,t])=>[e,t.kind]));let s=fo(this,this.source,e,this.statements);return this.model.ast=s,this.db.commit(this.model),s}collectElement(e,t,n){let r=t.get(e.id),i=mo({generated:e.generated,label:e.label.text});r&&r.kind!==e.kind&&this.conflict(`ID '${e.id}' is declared as both ${r.kind} and ${e.kind}`,e.location,r.location,i,mo(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,mo(r));let a=n.get(e.id);if(!a){let r={kind:e.kind,id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],...e.parentId?{parentId:e.parentId,parentLocation:e.parentLocation}:{},...e.shape?{shape:e.shape}:{},...e.stereotype?{stereotype:e.stereotype,stereotypeLocation:e.location}:{}};this.applyDeclarationMetadata(r,e.metadata),n.set(e.id,r),t.set(e.id,{kind:e.kind,location:e.location,generated:e.generated,label:e.label.text});return}(a.label.text!==e.label.text||a.label.type!==e.label.type)&&this.conflict(`ID '${e.id}' has conflicting labels`,e.location,a.location),e.shape&&a.shape&&e.shape!==a.shape&&this.conflict(`Use case '${e.id}' has conflicting shapes`,e.location,a.location),e.parentId&&a.parentId&&e.parentId!==a.parentId&&this.conflict(`Element '${e.id}' belongs to more than one system boundary`,e.parentLocation??e.location,a.parentLocation??a.location),e.stereotype&&a.stereotype&&e.stereotype!==a.stereotype&&this.conflict(`Element '${e.id}' has conflicting stereotypes`,e.location,a.stereotypeLocation??a.location),a.shape??=e.shape,a.parentId??=e.parentId,a.parentLocation??=e.parentLocation,a.stereotype??=e.stereotype,a.stereotypeLocation??=e.stereotype?e.location:void 0,ho(a.classes,e.classes),this.applyDeclarationMetadata(a,e.metadata)}collectBoundary(e,t,n){let r=t.get(e.id),i=mo({generated:e.generated,label:e.label.text});r&&r.kind!==`boundary`&&this.conflict(`ID '${e.id}' is declared as both ${r.kind} and boundary`,e.location,r.location,i,mo(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,mo(r));let a=n.get(e.id);if(a){(a.label.text!==e.label.text||a.label.type!==e.label.type)&&this.conflict(`Boundary '${e.id}' has conflicting titles`,e.location,a.location),ho(a.classes,e.classes);return}n.set(e.id,{id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],styles:[],members:[]}),t.set(e.id,{kind:`boundary`,location:e.location,generated:e.generated,label:e.label.text})}materializeElements(e,t){for(let n of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))this.setElementModel(n)}materializeBoundaries(e,t){for(let n of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))this.model.systemBoundaries.set(n.id,{id:n.id,label:n.label.text,labelType:n.label.type,type:n.type??`rect`,members:[],classes:[...n.classes],styles:[...n.styles]})}materializeJson(e){for(let t of[...this.jsonDrafts].sort((t,n)=>(e.get(t.id)??0)-(e.get(n.id)??0)))this.model.jsonNodes.set(t.id,{id:t.id,value:t.value,propertyOrder:t.propertyOrder,classes:[...t.classes],styles:[]})}materializeRelationships(e,t,n){let r=new Map,i=0;for(let a of this.relationshipDrafts){let o=this.resolveEndpoint(a.source,e,t,n),s=this.resolveEndpoint(a.target,e,t,n);this.validateRelationship(a,o,s,e);let c=a.explicitId??`edge-${i++}`,l={id:c,explicitId:!!a.explicitId,source:a.source.id,target:a.target.id,type:a.type,arrowType:a.arrowType,...a.label?{label:a.label.text,labelType:a.label.type}:{},minlen:a.minlen,classes:[],styles:[],animate:!1};this.model.relationships.push(l),r.set(c,{draft:a,relationship:l})}return this.model.relationshipCounter=i,r}resolveEndpoint(e,t,n,r){if(e.classesOnReference&&!e.declaration)throw Error(`Relationship endpoint '${e.id}' uses ::: without declaring the node at ${$(e.location)}`);let i=t.get(e.id);return i?i.kind:(n.set(e.id,{kind:`usecase`,id:e.id,label:e.label,location:e.location,generated:e.generated,shape:`ellipse`,classes:[]}),t.set(e.id,{kind:`usecase`,location:e.location,generated:e.generated,label:e.label.text}),this.recordFirst(r,e.id,e.location.span[0]),`usecase`)}reorderElements(e,t){let n=new Map(this.model.actors),r=new Map(this.model.useCases);this.model.actors.clear(),this.model.useCases.clear();for(let i of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0))){!n.has(i.id)&&!r.has(i.id)&&this.setElementModel(i);let e=n.get(i.id)??this.model.actors.get(i.id),t=r.get(i.id)??this.model.useCases.get(i.id);e?this.model.actors.set(i.id,e):t&&this.model.useCases.set(i.id,t)}}applyMetadataAssignments(e,t,n,r){for(let i of this.metadataAssignments){let a=e.get(i.target);if(!a){let e=this.inferMetadataKind(i.metadata);throw Error(`Metadata target '${i.target}' is unresolved${e?` (metadata implies ${e})`:``} at ${$(i.targetLocation)}`)}if(a.kind===`actor`||a.kind===`usecase`)this.applyStandaloneElementMetadata(t.get(i.target),i.metadata);else if(a.kind===`boundary`){let e=n.get(i.target);for(let t of i.metadata.properties)(t.key!==`type`||t.value!==`rect`&&t.value!==`package`)&&this.invalidMetadata(i.target,a.kind,t),e.type=t.value}else if(a.kind===`edge`){let e=r.get(i.target);if(!e)throw Error(`Metadata target '${i.target}' is not an explicit edge at ${$(i.targetLocation)}`);i.statement.kind=`edgeMetadata`,i.statement.edges=[{id:i.target,span:i.statement.span,idSpan:i.targetLocation.span,...i.statement.metadata?{metadata:i.statement.metadata}:{}}],delete i.statement.nodes;for(let t of i.metadata.properties)t.key===`animate`&&typeof t.value==`boolean`?e.relationship.animate=t.value:t.key===`animation`&&(t.value===`fast`||t.value===`slow`)?(e.relationship.animation=t.value,e.relationship.animate=!0):this.invalidMetadata(i.target,a.kind,t)}else for(let e of i.metadata.properties)this.invalidMetadata(i.target,a.kind,e)}for(let{relationship:e}of r.values())e.animation&&(e.animate=!0)}applyStandaloneElementMetadata(e,t){for(let n of t.properties)e.kind===`actor`?this.applyActorProperty(e,n,!0):n.key===`business`&&typeof n.value==`boolean`?e.business=n.value:this.invalidMetadata(e.id,e.kind,n)}applyDeclarationMetadata(e,t){if(t)for(let n of t.properties)e.kind===`actor`?this.applyActorProperty(e,n,!1):n.key===`business`&&typeof n.value==`boolean`?(e.business!==void 0&&e.business!==n.value&&this.conflict(`Use case '${e.id}' has conflicting business metadata`,n.location,e.location),e.business=n.value):this.invalidMetadata(e.id,e.kind,n)}applyActorProperty(e,t,n){t.key===`type`&&(t.value===`normal`||t.value===`hollow`||t.value===`awesome`)?(!n&&e.actorType!==void 0&&e.actorType!==t.value&&this.conflict(`Actor '${e.id}' has conflicting type metadata`,t.location,e.location),e.actorType=t.value):t.key===`icon`&&typeof t.value==`string`?(!n&&e.icon!==void 0&&e.icon!==t.value&&this.conflict(`Actor '${e.id}' has conflicting icon metadata`,t.location,e.location),e.icon=t.value):t.key===`business`&&typeof t.value==`boolean`?(!n&&e.business!==void 0&&e.business!==t.value&&this.conflict(`Actor '${e.id}' has conflicting business metadata`,t.location,e.location),e.business=t.value):this.invalidMetadata(e.id,e.kind,t)}validateAndRefreshElements(e){for(let t of e.values()){let e=t.icon?`icon`:t.actorType??`normal`;if(t.kind===`actor`){if(t.icon&&t.actorType&&t.actorType!==`normal`)throw Error(`Actor '${t.id}' cannot combine icon with type '${t.actorType}' at ${$(t.location)}`);if(t.business&&(e===`icon`||e===`awesome`))throw Error(`Business actor '${t.id}' must use normal or hollow geometry at ${$(t.location)}`)}else if((t.shape??`ellipse`)===`rect`&&t.business)throw Error(`Rectangular use case '${t.id}' cannot be a business use case at ${$(t.location)}`);this.setElementModel(t)}}refreshBoundaries(e,t){for(let t of e.values())t.members.length=0;for(let t of[...this.elements].sort((e,t)=>e.location.span[0]-t.location.span[0])){if(!t.parentId)continue;let n=e.get(t.parentId);if(!n)throw Error(`Parent boundary '${t.parentId}' for '${t.id}' is unresolved at ${$(t.parentLocation??t.location)}`);n.members.includes(t.id)||n.members.push(t.id)}for(let n of t.values())if(n.parentId&&!e.has(n.parentId))throw Error(`Parent boundary '${n.parentId}' for '${n.id}' is unresolved at ${$(n.parentLocation??n.location)}`);for(let t of e.values()){let e=this.model.systemBoundaries.get(t.id);e.type=t.type??`rect`,e.members=[...t.members],e.classes=[...t.classes],e.styles=[...t.styles]}}materializeNotes(e){let t=0;for(let n of this.noteDrafts){let r=e.get(n.target);if(!r)throw Error(`Note target '${n.target}' is unresolved at ${$(n.targetLocation)}`);r.kind!==`actor`&&r.kind!==`usecase`&&this.conflict(`Note target '${n.target}' must be an actor or use case, not ${r.kind}`,n.targetLocation,r.location);let i=`note-${t++}`;this.model.notes.set(i,{id:i,target:n.target,label:n.label.text,labelType:n.label.type})}this.model.noteCounter=t}applyClassDefinitions(){for(let e of this.classDefinitions)for(let t of e.ids)this.model.classDefs.set(t,{id:t,styles:[...e.styles]})}applyClassesAndStyles(e,t){for(let n of this.classAssignments)for(let r of n.targets)ho(this.getStylable(r.id,e,t,r.location).classes,n.classes);for(let n of this.styleAssignments)this.getStylable(n.target,e,t,n.location).styles.push(...n.styles)}getStylable(e,t,n,r){let i=t.get(e)?.kind,a=i===`actor`?this.model.actors.get(e):i===`usecase`?this.model.useCases.get(e):i===`boundary`?this.model.systemBoundaries.get(e):i===`json`?this.model.jsonNodes.get(e):i===`edge`?n.get(e)?.relationship:void 0;if(!a)throw Error(`Class/style target '${e}' is unresolved or anonymous at ${$(r)}`);return a}validateRelationship(t,n,r,i){let a=e.n(e=>e===`actor`||e===`usecase`||e===`json`,`allowed`);if(a(n)||this.conflict(`Relationship source '${t.source.id}' cannot be ${n}`,t.source.location,i.get(t.source.id).location),a(r)||this.conflict(`Relationship target '${t.target.id}' cannot be ${r}`,t.target.location,i.get(t.target.id).location),(t.type===`include`||t.type===`extend`)&&(n!==`usecase`||r!==`usecase`))throw Error(`${t.type} relationship requires use-case endpoints at ${$(t.location)}`);if(t.type===`generalization`&&(n!==`actor`&&n!==`usecase`||n!==r))throw Error(`Generalization requires actor-to-actor or use-case-to-use-case endpoints at ${$(t.location)}`);if(t.type===`association`&&(n===`json`||r===`json`)&&![0,1,2].includes(t.arrowType))throw Error(`JSON relationship '${t.source.id}' to '${t.target.id}' permits only point, reversed-point, or markerless solid association at ${$(t.location)}`)}setElementModel(e){if(e.kind===`actor`){let t=e.icon?`icon`:e.actorType??`normal`;this.model.useCases.delete(e.id),this.model.actors.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,type:t,...e.icon?{icon:e.icon}:{},business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.actors.get(e.id)?.styles??[]})}else this.model.actors.delete(e.id),this.model.useCases.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,shape:e.shape??`ellipse`,business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.useCases.get(e.id)?.styles??[]})}inferMetadataKind(e){let t=new Set([`actor`,`usecase`,`boundary`,`edge`]);for(let n of e.properties)if(n.key===`icon`)t.clear(),t.add(`actor`);else if(n.key===`animate`||n.key===`animation`)t.clear(),t.add(`edge`);else if(n.key===`type`)t.clear(),n.value===`rect`||n.value===`package`?t.add(`boundary`):(n.value===`normal`||n.value===`hollow`||n.value===`awesome`)&&t.add(`actor`);else if(n.key===`business`)t.delete(`boundary`),t.delete(`edge`);else return;return t.size===1?[...t][0]:void 0}invalidMetadata(e,t,n){throw Error(`Metadata property '${n.key}' is invalid for ${t} '${e}' at ${$(n.location)}`)}registerUnique(e,t,n,r,i){let a=e.get(t);a&&this.conflict(`ID '${t}' is declared more than once (${a.kind} and ${n})`,r,a.location,void 0,mo(a)),e.set(t,{kind:n,location:r,generated:i})}recordFirst(e,t,n){let r=e.get(t);(r===void 0||n<r)&&e.set(t,n)}conflict(e,t,n,r,i){throw Error(`${e} at ${$(t)}${po(r)}; previous declaration at ${$(n)}${po(i)}`)}},_o=$a.getBaseCstVisitorConstructor(),vo=new class extends _o{constructor(){super(),this.builder=new go(Ai),this.source=``,this.anonymousEdge=0,this.anonymousNote=0,this.validateVisitor()}static{e.n(this,`UsecaseVisitor`)}build(e,t){this.source=t,this.parentBoundary=void 0,this.anonymousEdge=0,this.anonymousNote=0,this.builder.reset(t),this.visit(e)}start(e){let t=this.tokens(e,`USECASE`)[0],n=[];for(let t of this.nodes(e,`line`))n.push(this.visit(t));this.builder.setStatements(n),this.builder.finalize(this.tokenSpan(t))}line(e){let t=this.firstNode(e,`blankLine`,`commentLine`,`statement`);return this.wrap(t,this.visit(t))}statement(e){return this.visit(this.firstNode(e,`accTitleStatement`,`accDescrStatement`,`directionStatement`,`actorStatement`,`systemBoundaryStatement`,`noteStatement`,`jsonStatement`,`classDefStatement`,`classStatement`,`styleStatement`,`metadataAssignmentStatement`,`entityStatement`))}lineEnd(e){}blankLine(e){return{kind:`blank`,span:this.tokenSpan(this.tokens(e,`NEWLINE`)[0])}}commentLine(e){return{kind:`comment`,span:this.tokenSpan(this.tokens(e,`COMMENT`)[0])}}accTitleStatement(e){let t=this.tokens(e,`ACC_TITLE_LINE`)[0].image;return this.builder.setAccTitle(t.slice(t.indexOf(`:`)+1).trim()),{kind:`accTitle`,span:[0,0]}}accDescrStatement(e){let t=this.tokens(e,`ACC_DESCR_LINE`)[0],n=this.tokens(e,`ACC_DESCR_BLOCK`)[0],r=t?t.image.slice(t.image.indexOf(`:`)+1).trim():n.image.slice(n.image.indexOf(`{`)+1,n.image.lastIndexOf(`}`)).trim();return this.builder.setAccDescription(r),{kind:`accDescr`,span:[0,0]}}actorStatement(e){let t=this.nodes(e,`actorItem`),n=t.map(e=>this.visit(e)),r=this.nodes(e,`relationTail`)[0],i=n.map((e,n)=>this.actorOccurrence(t[n],e,!0));for(let e of n)this.builder.addElement(this.actorDraft(e));if(!r)return{kind:`node`,span:[0,0],nodes:i};let a=this.visit(r);a.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(a.target));let o=this.relationshipDraft(n[0],a,this.nodeLocation(r));this.builder.addRelationship(o);let s=o.explicitId??`edge-${this.anonymousEdge++}`;return i.push(this.entityOccurrence(this.nodes(r.children,`entityName`)[0],a.target,a.target.explicitDeclaration)),{kind:`edge`,span:[0,0],nodes:i,edges:[{id:s,span:[0,0],...o.explicitIdLocation?{idSpan:o.explicitIdLocation.span}:{},...o.label?{labelSpan:o.label.span}:{}}]}}actorItem(e){let t=this.visit(this.nodes(e,`actorName`)[0]),n=this.nodes(e,`metadata`)[0],r=this.nodes(e,`stereotype`)[0],i=this.nodes(e,`classSuffix`)[0],a=i?this.visit(i):{classes:[],spans:[]};return{...t,...n?{metadata:this.visit(n)}:{},...r?{stereotype:this.visit(r)}:{},classes:a.classes,classSpans:a.spans}}actorName(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0];if(t){let n=this.nodes(e,`nodeLabel`)[0],r=n?this.visit(n):this.tokenLabel(t);return{id:t.image,label:r,location:this.tokenLocation(t),generated:!1,classes:[],classSpans:[]}}let r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[],classSpans:[]}}actorDeclarationOnly(e){let t=this.nodes(e,`actorItem`),n=t.map(e=>this.visit(e));for(let e of n)this.builder.addElement(this.actorDraft(e));return{kind:`node`,span:[0,0],nodes:n.map((e,n)=>this.actorOccurrence(t[n],e,!0))}}entityStatement(e){let t=this.nodes(e,`entityName`),n=this.visit(t[0]),r=this.nodes(e,`relationTail`)[0];if(!r)return n.explicitDeclaration=!0,n.shape??=`ellipse`,this.builder.addElement(this.entityDraft(n)),{kind:`node`,span:[0,0],nodes:[this.entityOccurrence(t[0],n,!0)]};n.explicitDeclaration&&this.builder.addElement(this.entityDraft(n));let i=this.visit(r);i.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(i.target));let a={source:this.endpoint(n),target:this.endpoint(i.target),location:this.nodeLocation(r),...i.explicitId?{explicitId:i.explicitId,explicitIdLocation:i.explicitIdLocation}:{},...i.arrow};this.builder.addRelationship(a);let o=a.explicitId??`edge-${this.anonymousEdge++}`;return{kind:`edge`,span:[0,0],nodes:[this.entityOccurrence(t[0],n,n.explicitDeclaration),this.entityOccurrence(this.nodes(r.children,`entityName`)[0],i.target,i.target.explicitDeclaration)],edges:[{id:o,span:[0,0],...a.explicitIdLocation?{idSpan:a.explicitIdLocation.span}:{},...a.label?{labelSpan:a.label.span}:{}}]}}entityName(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0],r=this.nodes(e,`nodeLabel`)[0],i=this.nodes(e,`useCaseMetadata`)[0],a=this.nodes(e,`stereotype`)[0],o=this.nodes(e,`classSuffix`)[0],s=o?this.visit(o):{classes:[],spans:[]};if(t){let n=r?this.visit(r):this.tokenLabel(t),o=r?this.tokens(e,`LBRACKET`).length?`rect`:`ellipse`:void 0;return{id:t.image,label:n,location:this.tokenLocation(t),generated:!1,...o?{shape:o}:{},...i?{metadata:this.visit(i)}:{},...a?{stereotype:this.visit(a)}:{},classes:s.classes,classSpans:s.spans,explicitDeclaration:!!(o||i||a)}}let c=this.tokenLabel(n);return{id:this.generateId(c.text),label:c,location:this.tokenLocation(n),generated:!0,...i?{metadata:this.visit(i)}:{},...a?{stereotype:this.visit(a)}:{},classes:s.classes,classSpans:s.spans,explicitDeclaration:!!(i||a)}}nodeLabel(e){let t=this.allTokens(e);if(t.length===1&&(t[0].tokenType.name===`PLAIN_STRING`||t[0].tokenType.name===`MARKDOWN_STRING`))return this.tokenLabel(t[0]);let n=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return{text:this.source.slice(n[0],n[1]),type:`text`,span:n}}useCaseMetadata(e){return this.visit(this.nodes(e,`metadata`)[0])}relationTail(e){let t=this.tokens(e,`IDENTIFIER`)[0];return{...t?{explicitId:t.image,explicitIdLocation:this.tokenLocation(t)}:{},arrow:this.visit(this.nodes(e,`arrow`)[0]),target:this.visit(this.nodes(e,`entityName`)[0])}}arrow(e){return this.visit(this.firstNode(e,`semanticRelation`,`forwardSolidOperator`,`backwardSolidOperator`,`markerlessSolidOperator`,`forwardCircleOperator`,`backwardCircleOperator`,`forwardCrossOperator`,`backwardCrossOperator`))}edgeLabel(e){return this.nodeLabel(e)}semanticRelation(e){if(this.tokens(e,`GENERALIZATION`).length)return{type:`generalization`,arrowType:H.SOLID_ARROW,minlen:1};let t=this.tokens(e,`INCLUDE`).length?`include`:`extend`,n=this.tokens(e,t===`include`?`INCLUDE`:`EXTEND`)[0];return{type:t,arrowType:H.SOLID_ARROW,label:{text:t,type:`text`,span:this.tokenSpan(n)},minlen:1}}metadata(e){return{properties:this.nodes(e,`metadataProperty`).map(e=>this.visit(e)),location:this.ctxLocation(e)}}metadataProperty(e){let t=this.allTokens(e).filter(e=>e.tokenType.name!==`COLON`),n=t[0],r=t[1],i=r.tokenType.name===`TRUE`||r.tokenType.name!==`FALSE`&&this.decodePlain(r),a=[n.startOffset,(r.endOffset??r.startOffset)+1];return{key:this.decodePlain(n),value:i,span:a,keySpan:this.contentSpan(n),valueSpan:this.contentSpan(r),location:this.tokenLocation(n)}}metadataSeparator(e){}systemBoundaryStatement(e){let t=this.visit(this.nodes(e,`systemBoundaryName`)[0]),n=this.nodes(e,`classSuffix`)[0],r=n?this.visit(n):{classes:[],spans:[]};t.classes=r.classes,this.builder.addBoundary(t);let i=this.parentBoundary;this.parentBoundary={id:t.id,location:t.location};let a=this.nodes(e,`systemBoundaryContent`)[0],o=a?this.visit(a):[];this.parentBoundary=i;let s=this.tokens(e,`END`)[0],c=this.nodes(e,`metadata`)[0],l=c?this.visit(c):void 0,u={kind:`group`,span:[0,0],group:t.id,idSpan:t.location.span,titleSpan:t.label.span,endSpan:this.tokenSpan(s),classSpans:r.spans,...l?{metadata:l.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))}:{},...o.length?{children:o}:{}};return l&&this.builder.addMetadataAssignment(t.id,t.location,l,u),u}systemBoundaryName(e){let t=this.tokens(e,`IDENTIFIER`)[0];if(t){let n=this.nodes(e,`nodeLabel`)[0];return{id:t.image,label:n?this.visit(n):this.tokenLabel(t),location:this.tokenLocation(t),generated:!1,classes:[]}}let n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0],r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[]}}systemBoundaryContent(e){return[...this.nodes(e,`blankLine`),...this.nodes(e,`commentLine`),...this.nodes(e,`boundaryElement`)].sort((e,t)=>(e.location?.startOffset??0)-(t.location?.startOffset??0)).map(e=>this.wrap(e,this.visit(e)))}boundaryElement(e){let t=this.nodes(e,`actorDeclarationOnly`)[0];if(t)return this.visit(t);let n=this.nodes(e,`entityName`)[0],r=this.visit(n);return r.explicitDeclaration=!0,r.shape??=`ellipse`,this.builder.addElement(this.entityDraft(r)),{kind:`node`,span:[0,0],nodes:[this.entityOccurrence(n,r,!0)]}}metadataAssignmentStatement(e){let t=this.visit(this.nodes(e,`metadataAssignmentTarget`)[0]),n=this.visit(this.nodes(e,`metadata`)[0]),r={kind:`metadata`,span:[0,0],nodes:[{id:t.id,span:t.location.span,idSpan:t.location.span}],metadata:n.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))};return this.builder.addMetadataAssignment(t.id,t.location,n,r),r}metadataAssignmentTarget(e){let t=this.allTokens(e)[0],n=this.tokenLabel(t);return{id:t.tokenType.name===`IDENTIFIER`?t.image:this.generateId(n.text),location:this.tokenLocation(t)}}noteStatement(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.visit(this.nodes(e,`nodeLabel`)[0]);return this.builder.addNote({target:t.image,targetLocation:this.tokenLocation(t),label:n,location:this.ctxLocation(e)}),{kind:`note`,span:[0,0],ref:`note-${this.anonymousNote++}`,refSpan:n.span,nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}stereotype(e){let t=this.tokens(e,`STEREOTYPE_TEXT`)[0];return{value:t.image.trim(),span:this.tokenSpan(t)}}classSuffix(e){let t=this.tokens(e,`IDENTIFIER`);return{classes:t.map(e=>e.image),spans:t.map(e=>this.tokenSpan(e))}}jsonStatement(e){let t=this.tokens(e,`JSON_DECLARATION_START`)[0],n=this.tokens(e,`JSON_OBJECT_LITERAL`)[0],r=/^json[\t ]+(\w+)/.exec(t.image),i=r[1],a=r[0].length-i.length,o={span:[t.startOffset+a,t.startOffset+a+i.length],line:t.startLine??1,column:(t.startColumn??1)+a},s=io(n.image,n.startLine??1,n.startColumn??1),c=this.nodes(e,`classSuffix`)[0],l=c?this.visit(c):{classes:[],spans:[]},u={id:i,value:s.value,propertyOrder:s.propertyOrder,location:o,classes:l.classes};return this.builder.addJson(u),{kind:`json`,span:[0,0],nodes:[{id:i,span:o.span,idSpan:o.span,defines:!0,classSpans:l.spans}],classSpans:l.spans}}directionStatement(e){let t=this.allTokens(e).find(e=>[`TD`,`TB`,`BT`,`RL`,`LR`].includes(e.tokenType.name));return this.builder.setDirection(t.image),{kind:`direction`,span:[0,0]}}classDefStatement(e){let t=this.tokens(e,`IDENTIFIER`),n=this.visit(this.nodes(e,`styles`)[0]);return this.builder.addClassDef(t.map(e=>e.image),n),{kind:`classDef`,span:[0,0],ref:t[0].image,refSpan:this.tokenSpan(t[0])}}classStatement(e){let t=this.tokens(e,`IDENTIFIER`),n=1;for(;n<t.length&&this.source.slice((t[n-1].endOffset??t[n-1].startOffset)+1,t[n].startOffset).includes(`,`);n++);let r=t.slice(0,n).map(e=>({id:e.image,location:this.tokenLocation(e)})),i=t.slice(n).map(e=>e.image);return this.builder.addClassAssignment(r,i),{kind:`classAssign`,span:[0,0],ref:i[0],refSpan:this.tokenSpan(t[n]),nodes:r.map(({id:e,location:t})=>({id:e,span:t.span,idSpan:t.span}))}}styleStatement(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.visit(this.nodes(e,`styles`)[0]);return this.builder.addStyleAssignment(t.image,this.tokenLocation(t),n),{kind:`style`,span:[0,0],nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}styles(e){return this.nodes(e,`styleValue`).map(e=>this.visit(e))}styleValue(e){let t=this.allTokens(e),n=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return this.source.slice(n[0],n[1]).replaceAll(`\\,`,`,`)}styleComponent(e){return this.allTokens(e).map(e=>e.image).join(``)}forwardSolidOperator(e){let t=this.tokens(e,`FORWARD_SOLID`)[0];return{type:`association`,arrowType:H.SOLID_ARROW,minlen:this.solidMinlen(t)}}backwardSolidOperator(e){let t=this.tokens(e,`BACKWARD_SOLID`)[0],n=this.nodes(e,`edgeLabel`)[0],r=n?this.tokens(e,`MARKERLESS_SOLID`).at(-1):t;return{type:`association`,arrowType:H.BACK_ARROW,minlen:this.solidMinlen(r),...n?{label:this.visit(n)}:{}}}markerlessSolidOperator(e){let t=this.nodes(e,`edgeLabel`)[0],n=this.allTokens(e);if(!t)return{type:`association`,arrowType:H.LINE_SOLID,minlen:this.solidMinlen(this.tokens(e,`MARKERLESS_SOLID`)[0])};let r=n.at(-1),i=r.tokenType.name===`FORWARD_SOLID`?H.SOLID_ARROW:r.tokenType.name===`FORWARD_CIRCLE`?H.CIRCLE_ARROW:r.tokenType.name===`FORWARD_CROSS`?H.CROSS_ARROW:H.LINE_SOLID;return{type:`association`,arrowType:i,label:this.visit(t),minlen:i===H.SOLID_ARROW||i===H.LINE_SOLID?this.solidMinlen(r):1}}forwardCircleOperator(e){return{type:`association`,arrowType:H.CIRCLE_ARROW,minlen:1}}backwardCircleOperator(e){let t=this.nodes(e,`edgeLabel`)[0];return{type:`association`,arrowType:H.CIRCLE_ARROW_REVERSED,minlen:1,...t?{label:this.visit(t)}:{}}}forwardCrossOperator(e){return{type:`association`,arrowType:H.CROSS_ARROW,minlen:1}}backwardCrossOperator(e){let t=this.nodes(e,`edgeLabel`)[0];return{type:`association`,arrowType:H.CROSS_ARROW_REVERSED,minlen:1,...t?{label:this.visit(t)}:{}}}actorDraft(e){return{id:e.id,kind:`actor`,label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}entityDraft(e){return{id:e.id,kind:`usecase`,label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.shape?{shape:e.shape}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}endpoint(e,t=e.explicitDeclaration??!0){return{id:e.id,label:e.label,location:e.location,generated:e.generated,declaration:t,classesOnReference:e.classes.length>0}}relationshipDraft(e,t,n){return{source:this.endpoint(e,!0),target:this.endpoint(t.target),location:n,...t.explicitId?{explicitId:t.explicitId,explicitIdLocation:t.explicitIdLocation}:{},...t.arrow}}actorOccurrence(e,t,n){return{id:t.id,span:this.nodeSpan(e),idSpan:t.location.span,labelSpan:t.label.span,...n?{defines:!0}:{},...t.stereotype?{stereotypeSpan:t.stereotype.span}:{},...t.metadata?{metadata:t.metadata.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))}:{},...t.classSpans.length?{classSpans:t.classSpans}:{}}}entityOccurrence(e,t,n){return this.actorOccurrence(e,t,n)}wrap(e,t){if(t.kind===`blank`||t.kind===`comment`)return t;t.span=this.nodeSpan(e);for(let e of t.edges??[])e.span=t.span;return t}tokenLabel(e){let t=e.tokenType.name===`MARKDOWN_STRING`?`markdown`:`text`,n=t===`markdown`?2:+(e.tokenType.name===`PLAIN_STRING`),r=this.tokenSpan(e,n);return{text:this.source.slice(r[0],r[1]),type:t,span:r}}decodePlain(e){return e.tokenType.name===`PLAIN_STRING`?e.image.slice(1,-1):e.image}contentSpan(e){return this.tokenSpan(e,e.tokenType.name===`PLAIN_STRING`?1:e.tokenType.name===`MARKDOWN_STRING`?2:0)}generateId(e){return e.replace(/\W/g,`_`)}solidMinlen(e){return Math.max(1,(e.image.match(/-/g)?.length??2)-1)}nodeLocation(e){let t=this.allTokens(e.children)[0];return{span:this.nodeSpan(e),line:t.startLine??1,column:t.startColumn??1}}ctxLocation(e){let t=this.allTokens(e).filter(e=>e.tokenType.name!==`NEWLINE`&&e.tokenType.name!==`EOF`),n=t[0],r=t.at(-1);return{span:[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)],line:n.startLine??1,column:n.startColumn??1}}tokenLocation(e){let t=e.tokenType.name===`PLAIN_STRING`?1:e.tokenType.name===`MARKDOWN_STRING`?2:0;return{span:this.tokenSpan(e,t),line:e.startLine??1,column:(e.startColumn??1)+t}}nodeSpan(e){let t=this.allTokens(e.children).filter(e=>e.tokenType.name!==`NEWLINE`&&e.tokenType.name!==`EOF`),n=t[0],r=t.at(-1);if(!n||!r)throw Error(`Usecase CST node has no source token`);return[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)]}tokenSpan(e,t=0){return[e.startOffset+t,Math.min(this.source.length,(e.endOffset??e.startOffset+e.image.length-1)+1-t)]}nodes(e,t){return(e[t]??[]).filter(e=>`children`in e)}tokens(e,t){return(e[t]??[]).filter(e=>`tokenTypeIdx`in e)}firstNode(e,...t){for(let n of t){let t=this.nodes(e,n)[0];if(t)return t}throw Error(`Usecase CST is missing one of: ${t.join(`, `)}`)}allTokens(e){let t=[];for(let n of Object.values(e))for(let e of n)`tokenTypeIdx`in e?t.push(e):t.push(...this.allTokens(e.children));return t.sort((e,t)=>e.startOffset-t.startOffset)}},yo={parse:e.n(async t=>{Ai.clear(),$a.input=[];try{Zr({diagramType:`usecase`,lexer:Xa,parser:$a,entry:e.n(()=>$a.start(),`entry`),visit:e.n(e=>vo.build(e,t),`visit`)},t)}catch(e){Ai.clear();let n=$a.errors[0];if(n){let{token:r}=n,i=Xr(r.startOffset)?r.startOffset:t.length,a=Xr(r.endOffset)?r.endOffset+1:i,o=Xr(r.startLine)?r.startLine:t.slice(0,i).split(/\r\n|\r|\n/).length,s=Math.max(t.lastIndexOf(`
74
+ `&&e!==`\r`)return;this.offset++}}deletePointerSubtree(e){let t=`${e}/`;for(let n of Object.keys(this.propertyOrder))(n===e||n.startsWith(t))&&delete this.propertyOrder[n]}};function io(e,t,n){let r;try{r=JSON.parse(e)}catch(r){let i=r instanceof Error?r.message:String(r),a=no(i,e,t,n);if(!a){let r=0;try{new ro(e).collect()}catch(e){e instanceof Q&&(r=e.offset)}a=to(e,r,t,n)}throw new eo(`Invalid JSON: ${i}`,a.line,a.column)}if(typeof r!=`object`||!r||Array.isArray(r))throw new eo(`JSON value must have an object root`,t,n);return{value:r,propertyOrder:new ro(e).collect()}}e.n(io,`parseOrderedJsonObject`);var ao=e.n(e=>({shape:e.type===`normal`?`actor`:e.type===`hollow`?`actor-hollow`:e.type===`awesome`?`actor-awesome`:`actor-icon`,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`actor`,actorType:e.type,business:e.business,labelType:e.labelType,...e.icon?{icon:e.icon}:{},...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),`actorNode`),oo=e.n(e=>({shape:e.shape,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`usecase`,useCaseShape:e.shape,business:e.business,labelType:e.labelType,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),`useCaseNode`),so=e.n(e=>({label:e.label,shape:`note`,attrs:{kind:`note`,target:e.target,labelType:e.labelType}}),`noteNode`),co=e.n(e=>({label:e.id,shape:`json-table`,...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`json`,value:e.value,propertyOrder:e.propertyOrder,labelType:`text`}}),`jsonNode`),lo=e.n(e=>({id:e.id,source:e.source,target:e.target,...e.label?{label:e.label}:{},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{relationshipType:e.type,arrowType:e.arrowType,minlen:e.minlen,explicitId:e.explicitId,animate:e.animate,...e.animation?{animation:e.animation}:{},...e.labelType?{labelType:e.labelType}:{}}}),`relationshipEdge`),uo=e.n(e=>({id:`${e.id}-edge`,source:e.id,target:e.target,attrs:{relationshipType:`note`,arrowType:H.LINE_SOLID,pattern:`dotted`,minlen:1,explicitId:!1,animate:!1,internal:!0}}),`noteEdge`),fo=e.n((e,t,n,r)=>{let i={};for(let t of e.getActors().values())i[t.id]=ao(t);for(let t of e.getUseCases().values())i[t.id]=oo(t);for(let t of e.getNotes().values())i[t.id]=so(t);for(let t of e.getJsonNodes().values())i[t.id]=co(t);let a={};for(let t of e.getSystemBoundaries().values())a[t.id]={...t.label===t.id?{}:{title:t.label},nodes:[...t.members],...t.classes.length?{classes:[...t.classes]}:{},...t.styles.length?{styles:[...t.styles]}:{},attrs:{kind:`systemBoundary`,boundaryType:t.type,labelType:t.labelType}};let o={};for(let t of e.getClassDefs().values())o[t.id]={styles:[...t.styles]};let s=e.getDirection();return{version:1,diagramType:`usecase`,source:t,header:{keyword:`usecase`,direction:s===`TD`?`TB`:s,span:n},...e.getAccTitle()?{accTitle:e.getAccTitle()}:{},...e.getAccDescription()?{accDescr:e.getAccDescription()}:{},nodes:i,edges:[...e.getRelationships().map(lo),...[...e.getNotes().values()].map(uo)],groups:a,classDefs:o,statements:r}},`buildUsecaseGraphAST`),$=e.n(e=>`line ${e.line}, column ${e.column} [${e.span[0]},${e.span[1]})`,`locationText`),po=e.n(e=>e===void 0?``:` (label "${e}")`,`labelSuffix`),mo=e.n(e=>e.generated?e.label:void 0,`generatedFrom`),ho=e.n((e,t)=>{for(let n of t)e.includes(n)||e.push(n)},`pushUnique`),go=class{constructor(e){this.db=e,this.source=``,this.statements=[],this.elements=[],this.boundaries=[],this.jsonDrafts=[],this.relationshipDrafts=[],this.noteDrafts=[],this.metadataAssignments=[],this.classAssignments=[],this.styleAssignments=[],this.classDefinitions=[],this.directions=[],this.model=e.createModel()}static{e.n(this,`UsecaseModelBuilder`)}reset(e){this.model=this.db.createModel(),this.source=e,this.statements=[],this.elements.length=0,this.boundaries.length=0,this.jsonDrafts.length=0,this.relationshipDrafts.length=0,this.noteDrafts.length=0,this.metadataAssignments.length=0,this.classAssignments.length=0,this.styleAssignments.length=0,this.classDefinitions.length=0,this.directions.length=0}addElement(e){this.elements.push(e)}addBoundary(e){this.boundaries.push(e)}addJson(e){this.jsonDrafts.push(e)}addRelationship(e){this.relationshipDrafts.push(e)}addNote(e){this.noteDrafts.push(e)}addMetadataAssignment(e,t,n,r){this.metadataAssignments.push({target:e,targetLocation:t,metadata:n,statement:r})}addClassDef(e,t){this.classDefinitions.push({ids:e,styles:t})}addClassAssignment(e,t){this.classAssignments.push({targets:e,classes:t})}addStyleAssignment(e,t,n){this.styleAssignments.push({target:e,location:t,styles:n})}setDirection(e){this.directions.push(e===`TD`?`TB`:e)}setAccTitle(e){this.model.accTitle=e}setAccDescription(e){this.model.accDescription=e}setStatements(e){this.statements=e}getActors(){return this.model.actors}getUseCases(){return this.model.useCases}getSystemBoundaries(){return this.model.systemBoundaries}getRelationships(){return this.model.relationships}getNotes(){return this.model.notes}getJsonNodes(){return this.model.jsonNodes}getClassDefs(){return this.model.classDefs}getDirection(){return this.model.direction}getAccTitle(){return this.model.accTitle}getAccDescription(){return this.model.accDescription}finalize(e){let t=new Map,n=new Map,r=new Map,i=new Map;for(let e of this.relationshipDrafts)this.recordFirst(i,e.source.id,e.source.location.span[0]),this.recordFirst(i,e.target.id,e.target.location.span[0]);for(let e of this.elements)this.recordFirst(i,e.id,e.location.span[0]);for(let e of this.boundaries)this.recordFirst(i,e.id,e.location.span[0]);for(let e of this.jsonDrafts)this.recordFirst(i,e.id,e.location.span[0]);let a=[...this.elements.map(e=>({offset:e.location.span[0],type:`element`,value:e})),...this.boundaries.map(e=>({offset:e.location.span[0],type:`boundary`,value:e})),...this.jsonDrafts.map(e=>({offset:e.location.span[0],type:`json`,value:e})),...this.relationshipDrafts.filter(e=>e.explicitId).map(e=>({offset:e.explicitIdLocation.span[0],type:`edge`,value:e}))].sort((e,t)=>e.offset-t.offset);for(let e of a)e.type===`element`?this.collectElement(e.value,t,n):e.type===`boundary`?this.collectBoundary(e.value,t,r):e.type===`json`?this.registerUnique(t,e.value.id,`json`,e.value.location,!1):this.registerUnique(t,e.value.explicitId,`edge`,e.value.explicitIdLocation,!1);this.materializeElements(n,i),this.materializeBoundaries(r,i),this.materializeJson(i);let o=this.materializeRelationships(t,n,i);this.reorderElements(n,i),this.applyMetadataAssignments(t,n,r,o),this.validateAndRefreshElements(n),this.refreshBoundaries(r,n),this.materializeNotes(t),this.applyClassDefinitions(),this.applyClassesAndStyles(t,o),this.model.direction=this.directions.at(-1)??this.model.direction,this.model.symbols=new Map([...t].map(([e,t])=>[e,t.kind]));let s=fo(this,this.source,e,this.statements);return this.model.ast=s,this.db.commit(this.model),s}collectElement(e,t,n){let r=t.get(e.id),i=mo({generated:e.generated,label:e.label.text});r&&r.kind!==e.kind&&this.conflict(`ID '${e.id}' is declared as both ${r.kind} and ${e.kind}`,e.location,r.location,i,mo(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,mo(r));let a=n.get(e.id);if(a)(a.label.text!==e.label.text||a.label.type!==e.label.type)&&this.conflict(`ID '${e.id}' has conflicting labels`,e.location,a.location),e.shape&&a.shape&&e.shape!==a.shape&&this.conflict(`Use case '${e.id}' has conflicting shapes`,e.location,a.location),e.parentId&&a.parentId&&e.parentId!==a.parentId&&this.conflict(`Element '${e.id}' belongs to more than one system boundary`,e.parentLocation??e.location,a.parentLocation??a.location),e.stereotype&&a.stereotype&&e.stereotype!==a.stereotype&&this.conflict(`Element '${e.id}' has conflicting stereotypes`,e.location,a.stereotypeLocation??a.location),a.shape??=e.shape,a.parentId??=e.parentId,a.parentLocation??=e.parentLocation,a.stereotype??=e.stereotype,a.stereotypeLocation??=e.stereotype?e.location:void 0,ho(a.classes,e.classes),this.applyDeclarationMetadata(a,e.metadata);else{let r={kind:e.kind,id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],...e.parentId?{parentId:e.parentId,parentLocation:e.parentLocation}:{},...e.shape?{shape:e.shape}:{},...e.stereotype?{stereotype:e.stereotype,stereotypeLocation:e.location}:{}};this.applyDeclarationMetadata(r,e.metadata),n.set(e.id,r),t.set(e.id,{kind:e.kind,location:e.location,generated:e.generated,label:e.label.text})}}collectBoundary(e,t,n){let r=t.get(e.id),i=mo({generated:e.generated,label:e.label.text});r&&r.kind!==`boundary`&&this.conflict(`ID '${e.id}' is declared as both ${r.kind} and boundary`,e.location,r.location,i,mo(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,mo(r));let a=n.get(e.id);a?((a.label.text!==e.label.text||a.label.type!==e.label.type)&&this.conflict(`Boundary '${e.id}' has conflicting titles`,e.location,a.location),ho(a.classes,e.classes)):(n.set(e.id,{id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],styles:[],members:[]}),t.set(e.id,{kind:`boundary`,location:e.location,generated:e.generated,label:e.label.text}))}materializeElements(e,t){for(let n of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))this.setElementModel(n)}materializeBoundaries(e,t){for(let n of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))this.model.systemBoundaries.set(n.id,{id:n.id,label:n.label.text,labelType:n.label.type,type:n.type??`rect`,members:[],classes:[...n.classes],styles:[...n.styles]})}materializeJson(e){for(let t of[...this.jsonDrafts].sort((t,n)=>(e.get(t.id)??0)-(e.get(n.id)??0)))this.model.jsonNodes.set(t.id,{id:t.id,value:t.value,propertyOrder:t.propertyOrder,classes:[...t.classes],styles:[]})}materializeRelationships(e,t,n){let r=new Map,i=0;for(let a of this.relationshipDrafts){let o=this.resolveEndpoint(a.source,e,t,n),s=this.resolveEndpoint(a.target,e,t,n);this.validateRelationship(a,o,s,e);let c=a.explicitId??`edge-${i++}`,l={id:c,explicitId:!!a.explicitId,source:a.source.id,target:a.target.id,type:a.type,arrowType:a.arrowType,...a.label?{label:a.label.text,labelType:a.label.type}:{},minlen:a.minlen,classes:[],styles:[],animate:!1};this.model.relationships.push(l),r.set(c,{draft:a,relationship:l})}return this.model.relationshipCounter=i,r}resolveEndpoint(e,t,n,r){if(e.classesOnReference&&!e.declaration)throw Error(`Relationship endpoint '${e.id}' uses ::: without declaring the node at ${$(e.location)}`);let i=t.get(e.id);return i?i.kind:(n.set(e.id,{kind:`usecase`,id:e.id,label:e.label,location:e.location,generated:e.generated,shape:`ellipse`,classes:[]}),t.set(e.id,{kind:`usecase`,location:e.location,generated:e.generated,label:e.label.text}),this.recordFirst(r,e.id,e.location.span[0]),`usecase`)}reorderElements(e,t){let n=new Map(this.model.actors),r=new Map(this.model.useCases);this.model.actors.clear(),this.model.useCases.clear();for(let i of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0))){!n.has(i.id)&&!r.has(i.id)&&this.setElementModel(i);let e=n.get(i.id)??this.model.actors.get(i.id),t=r.get(i.id)??this.model.useCases.get(i.id);e?this.model.actors.set(i.id,e):t&&this.model.useCases.set(i.id,t)}}applyMetadataAssignments(e,t,n,r){for(let i of this.metadataAssignments){let a=e.get(i.target);if(!a){let e=this.inferMetadataKind(i.metadata);throw Error(`Metadata target '${i.target}' is unresolved${e?` (metadata implies ${e})`:``} at ${$(i.targetLocation)}`)}if(a.kind===`actor`||a.kind===`usecase`)this.applyStandaloneElementMetadata(t.get(i.target),i.metadata);else if(a.kind===`boundary`){let e=n.get(i.target);for(let t of i.metadata.properties)(t.key!==`type`||t.value!==`rect`&&t.value!==`package`)&&this.invalidMetadata(i.target,a.kind,t),e.type=t.value}else if(a.kind===`edge`){let e=r.get(i.target);if(!e)throw Error(`Metadata target '${i.target}' is not an explicit edge at ${$(i.targetLocation)}`);i.statement.kind=`edgeMetadata`,i.statement.edges=[{id:i.target,span:i.statement.span,idSpan:i.targetLocation.span,...i.statement.metadata?{metadata:i.statement.metadata}:{}}],delete i.statement.nodes;for(let t of i.metadata.properties)t.key===`animate`&&typeof t.value==`boolean`?e.relationship.animate=t.value:t.key===`animation`&&(t.value===`fast`||t.value===`slow`)?(e.relationship.animation=t.value,e.relationship.animate=!0):this.invalidMetadata(i.target,a.kind,t)}else for(let e of i.metadata.properties)this.invalidMetadata(i.target,a.kind,e)}for(let{relationship:e}of r.values())e.animation&&(e.animate=!0)}applyStandaloneElementMetadata(e,t){for(let n of t.properties)e.kind===`actor`?this.applyActorProperty(e,n,!0):n.key===`business`&&typeof n.value==`boolean`?e.business=n.value:this.invalidMetadata(e.id,e.kind,n)}applyDeclarationMetadata(e,t){if(t)for(let n of t.properties)e.kind===`actor`?this.applyActorProperty(e,n,!1):n.key===`business`&&typeof n.value==`boolean`?(e.business!==void 0&&e.business!==n.value&&this.conflict(`Use case '${e.id}' has conflicting business metadata`,n.location,e.location),e.business=n.value):this.invalidMetadata(e.id,e.kind,n)}applyActorProperty(e,t,n){t.key===`type`&&(t.value===`normal`||t.value===`hollow`||t.value===`awesome`)?(!n&&e.actorType!==void 0&&e.actorType!==t.value&&this.conflict(`Actor '${e.id}' has conflicting type metadata`,t.location,e.location),e.actorType=t.value):t.key===`icon`&&typeof t.value==`string`?(!n&&e.icon!==void 0&&e.icon!==t.value&&this.conflict(`Actor '${e.id}' has conflicting icon metadata`,t.location,e.location),e.icon=t.value):t.key===`business`&&typeof t.value==`boolean`?(!n&&e.business!==void 0&&e.business!==t.value&&this.conflict(`Actor '${e.id}' has conflicting business metadata`,t.location,e.location),e.business=t.value):this.invalidMetadata(e.id,e.kind,t)}validateAndRefreshElements(e){for(let t of e.values()){let e=t.icon?`icon`:t.actorType??`normal`;if(t.kind===`actor`){if(t.icon&&t.actorType&&t.actorType!==`normal`)throw Error(`Actor '${t.id}' cannot combine icon with type '${t.actorType}' at ${$(t.location)}`);if(t.business&&(e===`icon`||e===`awesome`))throw Error(`Business actor '${t.id}' must use normal or hollow geometry at ${$(t.location)}`)}else if((t.shape??`ellipse`)===`rect`&&t.business)throw Error(`Rectangular use case '${t.id}' cannot be a business use case at ${$(t.location)}`);this.setElementModel(t)}}refreshBoundaries(e,t){for(let t of e.values())t.members.length=0;for(let t of[...this.elements].sort((e,t)=>e.location.span[0]-t.location.span[0])){if(!t.parentId)continue;let n=e.get(t.parentId);if(!n)throw Error(`Parent boundary '${t.parentId}' for '${t.id}' is unresolved at ${$(t.parentLocation??t.location)}`);n.members.includes(t.id)||n.members.push(t.id)}for(let n of t.values())if(n.parentId&&!e.has(n.parentId))throw Error(`Parent boundary '${n.parentId}' for '${n.id}' is unresolved at ${$(n.parentLocation??n.location)}`);for(let t of e.values()){let e=this.model.systemBoundaries.get(t.id);e.type=t.type??`rect`,e.members=[...t.members],e.classes=[...t.classes],e.styles=[...t.styles]}}materializeNotes(e){let t=0;for(let n of this.noteDrafts){let r=e.get(n.target);if(!r)throw Error(`Note target '${n.target}' is unresolved at ${$(n.targetLocation)}`);r.kind!==`actor`&&r.kind!==`usecase`&&this.conflict(`Note target '${n.target}' must be an actor or use case, not ${r.kind}`,n.targetLocation,r.location);let i=`note-${t++}`;this.model.notes.set(i,{id:i,target:n.target,label:n.label.text,labelType:n.label.type})}this.model.noteCounter=t}applyClassDefinitions(){for(let e of this.classDefinitions)for(let t of e.ids)this.model.classDefs.set(t,{id:t,styles:[...e.styles]})}applyClassesAndStyles(e,t){for(let n of this.classAssignments)for(let r of n.targets)ho(this.getStylable(r.id,e,t,r.location).classes,n.classes);for(let n of this.styleAssignments)this.getStylable(n.target,e,t,n.location).styles.push(...n.styles)}getStylable(e,t,n,r){let i=t.get(e)?.kind,a=i===`actor`?this.model.actors.get(e):i===`usecase`?this.model.useCases.get(e):i===`boundary`?this.model.systemBoundaries.get(e):i===`json`?this.model.jsonNodes.get(e):i===`edge`?n.get(e)?.relationship:void 0;if(!a)throw Error(`Class/style target '${e}' is unresolved or anonymous at ${$(r)}`);return a}validateRelationship(t,n,r,i){let a=e.n(e=>e===`actor`||e===`usecase`||e===`json`,`allowed`);if(a(n)||this.conflict(`Relationship source '${t.source.id}' cannot be ${n}`,t.source.location,i.get(t.source.id).location),a(r)||this.conflict(`Relationship target '${t.target.id}' cannot be ${r}`,t.target.location,i.get(t.target.id).location),(t.type===`include`||t.type===`extend`)&&(n!==`usecase`||r!==`usecase`))throw Error(`${t.type} relationship requires use-case endpoints at ${$(t.location)}`);if(t.type===`generalization`&&(n!==`actor`&&n!==`usecase`||n!==r))throw Error(`Generalization requires actor-to-actor or use-case-to-use-case endpoints at ${$(t.location)}`);if(t.type===`association`&&(n===`json`||r===`json`)&&![0,1,2].includes(t.arrowType))throw Error(`JSON relationship '${t.source.id}' to '${t.target.id}' permits only point, reversed-point, or markerless solid association at ${$(t.location)}`)}setElementModel(e){if(e.kind===`actor`){let t=e.icon?`icon`:e.actorType??`normal`;this.model.useCases.delete(e.id),this.model.actors.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,type:t,...e.icon?{icon:e.icon}:{},business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.actors.get(e.id)?.styles??[]})}else this.model.actors.delete(e.id),this.model.useCases.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,shape:e.shape??`ellipse`,business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.useCases.get(e.id)?.styles??[]})}inferMetadataKind(e){let t=new Set([`actor`,`usecase`,`boundary`,`edge`]);for(let n of e.properties)if(n.key===`icon`)t.clear(),t.add(`actor`);else if(n.key===`animate`||n.key===`animation`)t.clear(),t.add(`edge`);else if(n.key===`type`)t.clear(),n.value===`rect`||n.value===`package`?t.add(`boundary`):(n.value===`normal`||n.value===`hollow`||n.value===`awesome`)&&t.add(`actor`);else if(n.key===`business`)t.delete(`boundary`),t.delete(`edge`);else return;return t.size===1?[...t][0]:void 0}invalidMetadata(e,t,n){throw Error(`Metadata property '${n.key}' is invalid for ${t} '${e}' at ${$(n.location)}`)}registerUnique(e,t,n,r,i){let a=e.get(t);a&&this.conflict(`ID '${t}' is declared more than once (${a.kind} and ${n})`,r,a.location,void 0,mo(a)),e.set(t,{kind:n,location:r,generated:i})}recordFirst(e,t,n){let r=e.get(t);(r===void 0||n<r)&&e.set(t,n)}conflict(e,t,n,r,i){throw Error(`${e} at ${$(t)}${po(r)}; previous declaration at ${$(n)}${po(i)}`)}},_o=$a.getBaseCstVisitorConstructor(),vo=new class extends _o{constructor(){super(),this.builder=new go(Ai),this.source=``,this.anonymousEdge=0,this.anonymousNote=0,this.validateVisitor()}static{e.n(this,`UsecaseVisitor`)}build(e,t){this.source=t,this.parentBoundary=void 0,this.anonymousEdge=0,this.anonymousNote=0,this.builder.reset(t),this.visit(e)}start(e){let t=this.tokens(e,`USECASE`)[0],n=[];for(let t of this.nodes(e,`line`))n.push(this.visit(t));this.builder.setStatements(n),this.builder.finalize(this.tokenSpan(t))}line(e){let t=this.firstNode(e,`blankLine`,`commentLine`,`statement`);return this.wrap(t,this.visit(t))}statement(e){return this.visit(this.firstNode(e,`accTitleStatement`,`accDescrStatement`,`directionStatement`,`actorStatement`,`systemBoundaryStatement`,`noteStatement`,`jsonStatement`,`classDefStatement`,`classStatement`,`styleStatement`,`metadataAssignmentStatement`,`entityStatement`))}lineEnd(e){}blankLine(e){return{kind:`blank`,span:this.tokenSpan(this.tokens(e,`NEWLINE`)[0])}}commentLine(e){return{kind:`comment`,span:this.tokenSpan(this.tokens(e,`COMMENT`)[0])}}accTitleStatement(e){let t=this.tokens(e,`ACC_TITLE_LINE`)[0].image;return this.builder.setAccTitle(t.slice(t.indexOf(`:`)+1).trim()),{kind:`accTitle`,span:[0,0]}}accDescrStatement(e){let t=this.tokens(e,`ACC_DESCR_LINE`)[0],n=this.tokens(e,`ACC_DESCR_BLOCK`)[0],r=t?t.image.slice(t.image.indexOf(`:`)+1).trim():n.image.slice(n.image.indexOf(`{`)+1,n.image.lastIndexOf(`}`)).trim();return this.builder.setAccDescription(r),{kind:`accDescr`,span:[0,0]}}actorStatement(e){let t=this.nodes(e,`actorItem`),n=t.map(e=>this.visit(e)),r=this.nodes(e,`relationTail`)[0],i=n.map((e,n)=>this.actorOccurrence(t[n],e,!0));for(let e of n)this.builder.addElement(this.actorDraft(e));if(!r)return{kind:`node`,span:[0,0],nodes:i};let a=this.visit(r);a.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(a.target));let o=this.relationshipDraft(n[0],a,this.nodeLocation(r));this.builder.addRelationship(o);let s=o.explicitId??`edge-${this.anonymousEdge++}`;return i.push(this.entityOccurrence(this.nodes(r.children,`entityName`)[0],a.target,a.target.explicitDeclaration)),{kind:`edge`,span:[0,0],nodes:i,edges:[{id:s,span:[0,0],...o.explicitIdLocation?{idSpan:o.explicitIdLocation.span}:{},...o.label?{labelSpan:o.label.span}:{}}]}}actorItem(e){let t=this.visit(this.nodes(e,`actorName`)[0]),n=this.nodes(e,`metadata`)[0],r=this.nodes(e,`stereotype`)[0],i=this.nodes(e,`classSuffix`)[0],a=i?this.visit(i):{classes:[],spans:[]};return{...t,...n?{metadata:this.visit(n)}:{},...r?{stereotype:this.visit(r)}:{},classes:a.classes,classSpans:a.spans}}actorName(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0];if(t){let n=this.nodes(e,`nodeLabel`)[0],r=n?this.visit(n):this.tokenLabel(t);return{id:t.image,label:r,location:this.tokenLocation(t),generated:!1,classes:[],classSpans:[]}}let r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[],classSpans:[]}}actorDeclarationOnly(e){let t=this.nodes(e,`actorItem`),n=t.map(e=>this.visit(e));for(let e of n)this.builder.addElement(this.actorDraft(e));return{kind:`node`,span:[0,0],nodes:n.map((e,n)=>this.actorOccurrence(t[n],e,!0))}}entityStatement(e){let t=this.nodes(e,`entityName`),n=this.visit(t[0]),r=this.nodes(e,`relationTail`)[0];if(!r)return n.explicitDeclaration=!0,n.shape??=`ellipse`,this.builder.addElement(this.entityDraft(n)),{kind:`node`,span:[0,0],nodes:[this.entityOccurrence(t[0],n,!0)]};n.explicitDeclaration&&this.builder.addElement(this.entityDraft(n));let i=this.visit(r);i.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(i.target));let a={source:this.endpoint(n),target:this.endpoint(i.target),location:this.nodeLocation(r),...i.explicitId?{explicitId:i.explicitId,explicitIdLocation:i.explicitIdLocation}:{},...i.arrow};this.builder.addRelationship(a);let o=a.explicitId??`edge-${this.anonymousEdge++}`;return{kind:`edge`,span:[0,0],nodes:[this.entityOccurrence(t[0],n,n.explicitDeclaration),this.entityOccurrence(this.nodes(r.children,`entityName`)[0],i.target,i.target.explicitDeclaration)],edges:[{id:o,span:[0,0],...a.explicitIdLocation?{idSpan:a.explicitIdLocation.span}:{},...a.label?{labelSpan:a.label.span}:{}}]}}entityName(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0],r=this.nodes(e,`nodeLabel`)[0],i=this.nodes(e,`useCaseMetadata`)[0],a=this.nodes(e,`stereotype`)[0],o=this.nodes(e,`classSuffix`)[0],s=o?this.visit(o):{classes:[],spans:[]};if(t){let n=r?this.visit(r):this.tokenLabel(t),o=r?this.tokens(e,`LBRACKET`).length?`rect`:`ellipse`:void 0;return{id:t.image,label:n,location:this.tokenLocation(t),generated:!1,...o?{shape:o}:{},...i?{metadata:this.visit(i)}:{},...a?{stereotype:this.visit(a)}:{},classes:s.classes,classSpans:s.spans,explicitDeclaration:!!(o||i||a)}}let c=this.tokenLabel(n);return{id:this.generateId(c.text),label:c,location:this.tokenLocation(n),generated:!0,...i?{metadata:this.visit(i)}:{},...a?{stereotype:this.visit(a)}:{},classes:s.classes,classSpans:s.spans,explicitDeclaration:!!(i||a)}}nodeLabel(e){let t=this.allTokens(e);if(t.length===1&&(t[0].tokenType.name===`PLAIN_STRING`||t[0].tokenType.name===`MARKDOWN_STRING`))return this.tokenLabel(t[0]);let n=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return{text:this.source.slice(n[0],n[1]),type:`text`,span:n}}useCaseMetadata(e){return this.visit(this.nodes(e,`metadata`)[0])}relationTail(e){let t=this.tokens(e,`IDENTIFIER`)[0];return{...t?{explicitId:t.image,explicitIdLocation:this.tokenLocation(t)}:{},arrow:this.visit(this.nodes(e,`arrow`)[0]),target:this.visit(this.nodes(e,`entityName`)[0])}}arrow(e){return this.visit(this.firstNode(e,`semanticRelation`,`forwardSolidOperator`,`backwardSolidOperator`,`markerlessSolidOperator`,`forwardCircleOperator`,`backwardCircleOperator`,`forwardCrossOperator`,`backwardCrossOperator`))}edgeLabel(e){return this.nodeLabel(e)}semanticRelation(e){if(this.tokens(e,`GENERALIZATION`).length)return{type:`generalization`,arrowType:H.SOLID_ARROW,minlen:1};let t=this.tokens(e,`INCLUDE`).length?`include`:`extend`,n=this.tokens(e,t===`include`?`INCLUDE`:`EXTEND`)[0];return{type:t,arrowType:H.SOLID_ARROW,label:{text:t,type:`text`,span:this.tokenSpan(n)},minlen:1}}metadata(e){return{properties:this.nodes(e,`metadataProperty`).map(e=>this.visit(e)),location:this.ctxLocation(e)}}metadataProperty(e){let t=this.allTokens(e).filter(e=>e.tokenType.name!==`COLON`),n=t[0],r=t[1],i=r.tokenType.name===`TRUE`||r.tokenType.name!==`FALSE`&&this.decodePlain(r),a=[n.startOffset,(r.endOffset??r.startOffset)+1];return{key:this.decodePlain(n),value:i,span:a,keySpan:this.contentSpan(n),valueSpan:this.contentSpan(r),location:this.tokenLocation(n)}}metadataSeparator(e){}systemBoundaryStatement(e){let t=this.visit(this.nodes(e,`systemBoundaryName`)[0]),n=this.nodes(e,`classSuffix`)[0],r=n?this.visit(n):{classes:[],spans:[]};t.classes=r.classes,this.builder.addBoundary(t);let i=this.parentBoundary;this.parentBoundary={id:t.id,location:t.location};let a=this.nodes(e,`systemBoundaryContent`)[0],o=a?this.visit(a):[];this.parentBoundary=i;let s=this.tokens(e,`END`)[0],c=this.nodes(e,`metadata`)[0],l=c?this.visit(c):void 0,u={kind:`group`,span:[0,0],group:t.id,idSpan:t.location.span,titleSpan:t.label.span,endSpan:this.tokenSpan(s),classSpans:r.spans,...l?{metadata:l.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))}:{},...o.length?{children:o}:{}};return l&&this.builder.addMetadataAssignment(t.id,t.location,l,u),u}systemBoundaryName(e){let t=this.tokens(e,`IDENTIFIER`)[0];if(t){let n=this.nodes(e,`nodeLabel`)[0];return{id:t.image,label:n?this.visit(n):this.tokenLabel(t),location:this.tokenLocation(t),generated:!1,classes:[]}}let n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0],r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[]}}systemBoundaryContent(e){return[...this.nodes(e,`blankLine`),...this.nodes(e,`commentLine`),...this.nodes(e,`boundaryElement`)].sort((e,t)=>(e.location?.startOffset??0)-(t.location?.startOffset??0)).map(e=>this.wrap(e,this.visit(e)))}boundaryElement(e){let t=this.nodes(e,`actorDeclarationOnly`)[0];if(t)return this.visit(t);let n=this.nodes(e,`entityName`)[0],r=this.visit(n);return r.explicitDeclaration=!0,r.shape??=`ellipse`,this.builder.addElement(this.entityDraft(r)),{kind:`node`,span:[0,0],nodes:[this.entityOccurrence(n,r,!0)]}}metadataAssignmentStatement(e){let t=this.visit(this.nodes(e,`metadataAssignmentTarget`)[0]),n=this.visit(this.nodes(e,`metadata`)[0]),r={kind:`metadata`,span:[0,0],nodes:[{id:t.id,span:t.location.span,idSpan:t.location.span}],metadata:n.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))};return this.builder.addMetadataAssignment(t.id,t.location,n,r),r}metadataAssignmentTarget(e){let t=this.allTokens(e)[0],n=this.tokenLabel(t);return{id:t.tokenType.name===`IDENTIFIER`?t.image:this.generateId(n.text),location:this.tokenLocation(t)}}noteStatement(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.visit(this.nodes(e,`nodeLabel`)[0]);return this.builder.addNote({target:t.image,targetLocation:this.tokenLocation(t),label:n,location:this.ctxLocation(e)}),{kind:`note`,span:[0,0],ref:`note-${this.anonymousNote++}`,refSpan:n.span,nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}stereotype(e){let t=this.tokens(e,`STEREOTYPE_TEXT`)[0];return{value:t.image.trim(),span:this.tokenSpan(t)}}classSuffix(e){let t=this.tokens(e,`IDENTIFIER`);return{classes:t.map(e=>e.image),spans:t.map(e=>this.tokenSpan(e))}}jsonStatement(e){let t=this.tokens(e,`JSON_DECLARATION_START`)[0],n=this.tokens(e,`JSON_OBJECT_LITERAL`)[0],r=/^json[\t ]+(\w+)/.exec(t.image),i=r[1],a=r[0].length-i.length,o={span:[t.startOffset+a,t.startOffset+a+i.length],line:t.startLine??1,column:(t.startColumn??1)+a},s=io(n.image,n.startLine??1,n.startColumn??1),c=this.nodes(e,`classSuffix`)[0],l=c?this.visit(c):{classes:[],spans:[]},u={id:i,value:s.value,propertyOrder:s.propertyOrder,location:o,classes:l.classes};return this.builder.addJson(u),{kind:`json`,span:[0,0],nodes:[{id:i,span:o.span,idSpan:o.span,defines:!0,classSpans:l.spans}],classSpans:l.spans}}directionStatement(e){let t=this.allTokens(e).find(e=>[`TD`,`TB`,`BT`,`RL`,`LR`].includes(e.tokenType.name));return this.builder.setDirection(t.image),{kind:`direction`,span:[0,0]}}classDefStatement(e){let t=this.tokens(e,`IDENTIFIER`),n=this.visit(this.nodes(e,`styles`)[0]);return this.builder.addClassDef(t.map(e=>e.image),n),{kind:`classDef`,span:[0,0],ref:t[0].image,refSpan:this.tokenSpan(t[0])}}classStatement(e){let t=this.tokens(e,`IDENTIFIER`),n=1;for(;n<t.length&&this.source.slice((t[n-1].endOffset??t[n-1].startOffset)+1,t[n].startOffset).includes(`,`);n++);let r=t.slice(0,n).map(e=>({id:e.image,location:this.tokenLocation(e)})),i=t.slice(n).map(e=>e.image);return this.builder.addClassAssignment(r,i),{kind:`classAssign`,span:[0,0],ref:i[0],refSpan:this.tokenSpan(t[n]),nodes:r.map(({id:e,location:t})=>({id:e,span:t.span,idSpan:t.span}))}}styleStatement(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.visit(this.nodes(e,`styles`)[0]);return this.builder.addStyleAssignment(t.image,this.tokenLocation(t),n),{kind:`style`,span:[0,0],nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}styles(e){return this.nodes(e,`styleValue`).map(e=>this.visit(e))}styleValue(e){let t=this.allTokens(e),n=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return this.source.slice(n[0],n[1]).replaceAll(`\\,`,`,`)}styleComponent(e){return this.allTokens(e).map(e=>e.image).join(``)}forwardSolidOperator(e){let t=this.tokens(e,`FORWARD_SOLID`)[0];return{type:`association`,arrowType:H.SOLID_ARROW,minlen:this.solidMinlen(t)}}backwardSolidOperator(e){let t=this.tokens(e,`BACKWARD_SOLID`)[0],n=this.nodes(e,`edgeLabel`)[0],r=n?this.tokens(e,`MARKERLESS_SOLID`).at(-1):t;return{type:`association`,arrowType:H.BACK_ARROW,minlen:this.solidMinlen(r),...n?{label:this.visit(n)}:{}}}markerlessSolidOperator(e){let t=this.nodes(e,`edgeLabel`)[0],n=this.allTokens(e);if(!t)return{type:`association`,arrowType:H.LINE_SOLID,minlen:this.solidMinlen(this.tokens(e,`MARKERLESS_SOLID`)[0])};let r=n.at(-1),i=r.tokenType.name===`FORWARD_SOLID`?H.SOLID_ARROW:r.tokenType.name===`FORWARD_CIRCLE`?H.CIRCLE_ARROW:r.tokenType.name===`FORWARD_CROSS`?H.CROSS_ARROW:H.LINE_SOLID;return{type:`association`,arrowType:i,label:this.visit(t),minlen:i===H.SOLID_ARROW||i===H.LINE_SOLID?this.solidMinlen(r):1}}forwardCircleOperator(e){return{type:`association`,arrowType:H.CIRCLE_ARROW,minlen:1}}backwardCircleOperator(e){let t=this.nodes(e,`edgeLabel`)[0];return{type:`association`,arrowType:H.CIRCLE_ARROW_REVERSED,minlen:1,...t?{label:this.visit(t)}:{}}}forwardCrossOperator(e){return{type:`association`,arrowType:H.CROSS_ARROW,minlen:1}}backwardCrossOperator(e){let t=this.nodes(e,`edgeLabel`)[0];return{type:`association`,arrowType:H.CROSS_ARROW_REVERSED,minlen:1,...t?{label:this.visit(t)}:{}}}actorDraft(e){return{id:e.id,kind:`actor`,label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}entityDraft(e){return{id:e.id,kind:`usecase`,label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.shape?{shape:e.shape}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}endpoint(e,t=e.explicitDeclaration??!0){return{id:e.id,label:e.label,location:e.location,generated:e.generated,declaration:t,classesOnReference:e.classes.length>0}}relationshipDraft(e,t,n){return{source:this.endpoint(e,!0),target:this.endpoint(t.target),location:n,...t.explicitId?{explicitId:t.explicitId,explicitIdLocation:t.explicitIdLocation}:{},...t.arrow}}actorOccurrence(e,t,n){return{id:t.id,span:this.nodeSpan(e),idSpan:t.location.span,labelSpan:t.label.span,...n?{defines:!0}:{},...t.stereotype?{stereotypeSpan:t.stereotype.span}:{},...t.metadata?{metadata:t.metadata.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))}:{},...t.classSpans.length?{classSpans:t.classSpans}:{}}}entityOccurrence(e,t,n){return this.actorOccurrence(e,t,n)}wrap(e,t){if(t.kind===`blank`||t.kind===`comment`)return t;t.span=this.nodeSpan(e);for(let e of t.edges??[])e.span=t.span;return t}tokenLabel(e){let t=e.tokenType.name===`MARKDOWN_STRING`?`markdown`:`text`,n=t===`markdown`?2:+(e.tokenType.name===`PLAIN_STRING`),r=this.tokenSpan(e,n);return{text:this.source.slice(r[0],r[1]),type:t,span:r}}decodePlain(e){return e.tokenType.name===`PLAIN_STRING`?e.image.slice(1,-1):e.image}contentSpan(e){return this.tokenSpan(e,e.tokenType.name===`PLAIN_STRING`?1:e.tokenType.name===`MARKDOWN_STRING`?2:0)}generateId(e){return e.replace(/\W/g,`_`)}solidMinlen(e){return Math.max(1,(e.image.match(/-/g)?.length??2)-1)}nodeLocation(e){let t=this.allTokens(e.children)[0];return{span:this.nodeSpan(e),line:t.startLine??1,column:t.startColumn??1}}ctxLocation(e){let t=this.allTokens(e).filter(e=>e.tokenType.name!==`NEWLINE`&&e.tokenType.name!==`EOF`),n=t[0],r=t.at(-1);return{span:[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)],line:n.startLine??1,column:n.startColumn??1}}tokenLocation(e){let t=e.tokenType.name===`PLAIN_STRING`?1:e.tokenType.name===`MARKDOWN_STRING`?2:0;return{span:this.tokenSpan(e,t),line:e.startLine??1,column:(e.startColumn??1)+t}}nodeSpan(e){let t=this.allTokens(e.children).filter(e=>e.tokenType.name!==`NEWLINE`&&e.tokenType.name!==`EOF`),n=t[0],r=t.at(-1);if(!n||!r)throw Error(`Usecase CST node has no source token`);return[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)]}tokenSpan(e,t=0){return[e.startOffset+t,Math.min(this.source.length,(e.endOffset??e.startOffset+e.image.length-1)+1-t)]}nodes(e,t){return(e[t]??[]).filter(e=>`children`in e)}tokens(e,t){return(e[t]??[]).filter(e=>`tokenTypeIdx`in e)}firstNode(e,...t){for(let n of t){let t=this.nodes(e,n)[0];if(t)return t}throw Error(`Usecase CST is missing one of: ${t.join(`, `)}`)}allTokens(e){let t=[];for(let n of Object.values(e))for(let e of n)`tokenTypeIdx`in e?t.push(e):t.push(...this.allTokens(e.children));return t.sort((e,t)=>e.startOffset-t.startOffset)}},yo={parse:e.n(async t=>{Ai.clear(),$a.input=[];try{Zr({diagramType:`usecase`,lexer:Xa,parser:$a,entry:e.n(()=>$a.start(),`entry`),visit:e.n(e=>vo.build(e,t),`visit`)},t)}catch(e){Ai.clear();let n=$a.errors[0];if(n){let{token:r}=n,i=Xr(r.startOffset)?r.startOffset:t.length,a=Xr(r.endOffset)?r.endOffset+1:i,o=Xr(r.startLine)?r.startLine:t.slice(0,i).split(/\r\n|\r|\n/).length,s=Math.max(t.lastIndexOf(`
75
75
  `,i-1),t.lastIndexOf(`\r`,i-1)),c=Xr(r.startColumn)?r.startColumn:i-s,l=e instanceof Error?e.message:String(e);throw Error(`${l} at line ${o}, column ${c} [${i},${a})`)}throw e}},`parse`)},bo=[`point`,`circle`,`cross`,`extension`],xo={usecaseActor:!0,usecaseActorHollow:!0,usecaseActorAwesome:!0,usecaseActorIcon:!0},So=e.n((e,t)=>{let[n,r]=[e,t].map(e=>e.replace(/[^\w-]+/g,`_`).replace(/^_+|_+$/g,``)||`element`);return`usecase-${n}-${r}`},`usecaseDomId`),Co=e.n(e=>`usecase-${e.replace(/[^\w-]+/g,`_`).replace(/^_+|_+$/g,``)||`element`}`,`usecaseNodeDomId`),wo=e.n((e,t)=>t===`markdown`?i.i(e).map(e=>e.map(e=>e.content).join(` `)).join(`
76
76
  `):e,`getAccessibleLabel`),To=e.n(e=>{let t=wo(e.label??e.id,e.labelType);if(xo[e.shape]){let n=e.actorType&&e.actorType!==`normal`?`${e.actorType} `:``;return`${e.business?`business `:``}${n}actor ${t}${e.stereotype?`, stereotype ${e.stereotype}`:``}`}if(e.shape===`note`)return`Note for ${e.noteTargetLabel??e.noteTarget??``}: ${t}`;if(e.shape===`usecaseJsonTable`){let n=(e.jsonRows??[]).map(e=>`${e.accessibleKey}: ${e.value}`).join(`; `);return n?`${t}: ${n}`:t}let n=e.stereotype?`, stereotype ${e.stereotype}`:``;return`${e.business?`business `:``}use case ${t}${n}`},`getUsecaseNodeAccessibleName`),Eo=e.n(e=>`${e.boundaryType} system boundary ${wo(e.label??e.id,e.labelType)}`,`getUsecaseBoundaryAccessibleName`),Do=e.n(e=>e.relationshipType===`note`?``:`${e.relationshipType===`association`&&e.label?`association ${wo(e.label,e.labelType)}`:e.relationshipType} from ${e.sourceLabel} to ${e.targetLabel}`,`getUsecaseEdgeAccessibleName`),Oo=e.n(e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),`escapePlainLabel`),ko=e.n(e=>e.replace(/([*[\\\]_`])/g,`\\$1`),`escapeMarkdownMarkers`),Ao=e.n((e,t)=>{e.diagramId=t,e.markers=[...bo];for(let t of e.nodes){let e=t;if(e.domId=Co(t.id),t.label!==void 0&&t.labelType===`text`&&(t.label=Oo(t.label)),t.stereotype&&=Oo(t.stereotype),!t.isGroup&&t.shape===`usecaseJsonTable`&&(t.jsonRows=t.jsonRows?.map(e=>({...e,key:Oo(e.key),value:Oo(e.value)}))),!t.isGroup&&(t.shape===`usecaseEllipse`||t.shape===`rect`)&&t.stereotype){let n=t.label??Oo(t.id);t.label=`\xAB${ko(t.stereotype)}\xBB<br/>${t.labelType===`text`?ko(n):n}`,t.labelType=`markdown`,e.hasFoldedStereotype=!0,delete t.stereotype}}for(let t of e.edges)t.label!==void 0&&t.labelType===`text`&&(t.label=Oo(t.label));return e},`prepareUsecaseLayoutData`),jo=e.n((e,n,r)=>{for(let t of n.nodes){let i=typeof t.domId==`string`?t.domId:So(n.diagramId,t.id),a=e.select(`#${i}`),o=t.isGroup?`boundary`:xo[t.shape]?`actor`:t.shape===`note`?`note`:t.shape===`usecaseJsonTable`?`json`:`usecase`,s=r.nodes.get(t.id)??t.id;if(a.attr(`data-usecase-id`,t.id).attr(`data-usecase-kind`,o).attr(`role`,`img`).attr(`aria-label`,s),!t.isGroup&&(t.shape===`usecaseEllipse`||t.shape===`rect`)&&`hasFoldedStereotype`in t&&t.hasFoldedStereotype===!0){let e=a.node(),t=e?.querySelector(`.nodeLabel`),n=t?.querySelector(`p`)??t,r=n?.firstChild;if(n&&r?.nodeType===3){let e=n.ownerDocument.createElement(`span`);e.className=`usecase-stereotype`,n.insertBefore(e,r),e.appendChild(r)}else e?.querySelector(`.label tspan tspan, .label tspan`)?.classList.add(`usecase-stereotype`)}}let i=new Map(n.edges.map(e=>[e.id,e]));e.selectAll(`path[data-et="edge"]`).each(function(){let e=i.get(this.getAttribute(`data-id`)??``);if(!e)return;let a=t.p(this);a.attr(`id`,So(n.diagramId,e.id)).attr(`data-usecase-id`,e.id).attr(`data-usecase-kind`,e.internal?`note-connector`:`relationship`),e.internal?a.attr(`aria-hidden`,`true`):a.attr(`role`,`img`).attr(`aria-label`,r.edges.get(e.id)??e.id)})},`annotateUsecaseElements`),Mo=e.n((e,t)=>{e.style(`--mermaid-usecase-actor-font-size`,`${t.actorFontSize}px`).style(`--mermaid-usecase-actor-font-family`,t.actorFontFamily).style(`--mermaid-usecase-actor-font-weight`,t.actorFontWeight).style(`--mermaid-usecase-font-size`,`${t.usecaseFontSize}px`).style(`--mermaid-usecase-font-family`,t.usecaseFontFamily).style(`--mermaid-usecase-font-weight`,t.usecaseFontWeight)},`applyUsecaseFonts`),No={draw:e.n(async(e,i,a,l)=>{t.m.info(`Drawing usecase diagram (unified)`,i);let{layout:u}=n.b(),d=l.db,f=d.getData(),p=new Map(f.nodes.map(e=>[e.id,wo(e.label??e.id,e.labelType)])),m={nodes:new Map(f.nodes.map(e=>[e.id,e.isGroup?Eo(e):To(e.shape===`note`?{...e,noteTargetLabel:p.get(e.noteTarget??``)}:e)])),edges:new Map(f.edges.map(e=>[e.id,Do({...e,sourceLabel:p.get(e.source)??e.sourceLabel,targetLabel:p.get(e.target)??e.targetLabel})]))},h=o.t(i,f.config.securityLevel);f.layoutAlgorithm=c.i(u),Ao(f,i),Mo(h,f),await c.a(f,h),jo(h,f,m);let g=f.diagramPadding;r._.insertTitle(h,`usecaseDiagramTitleText`,0,d.getDiagramTitle?.()??``),s.t(h,g,`usecaseDiagram`,f.useMaxWidth),Mo(h,f)},`draw`)},Po=e.n(e=>({actorBkg:e.usecaseActorBkg??e.actorBkg??e.mainBkg,actorBorder:e.usecaseActorBorder??e.actorBorder??e.primaryColor,bkg:e.usecaseBkg??e.mainBkg,border:e.usecaseBorder??e.nodeBorder??e.primaryColor,boundaryBkg:e.usecaseBoundaryBkg??e.clusterBkg,boundaryBorder:e.usecaseBoundaryBorder??e.clusterBorder,includeLine:e.usecaseIncludeLine??e.lineColor,extendLine:e.usecaseExtendLine??e.lineColor}),`roleColors`),Fo=e.n(e=>{let{theme:t,bkgColorArray:r,borderColorArray:i}=e;if(!a.i(t,i))return``;let o=n.y().usecase?.colorScheme===`rotate`,s=a.o(e.look),c=s===`handDrawn`,l=a.r(r),u=``;for(let e=0;e<a.a(i);e++){let t=i[e],n=l?`fill: ${r[e%r.length]};`:``,a=`[data-look="${s}"][data-color-id="color-${e}"]`;u+=`
77
77
 
@@ -1,18 +1,18 @@
1
1
  import { n as e } from "./chunk-Y2CYZVJY-CwsV_8W4.js";
2
- import { m as t, p as n } from "./src-Dkp7vqs8.js";
3
- import { C as r, H as i, U as a, _ as o, a as s, b as c, f as l, q as u, v as d, y as f, z as p } from "./chunk-DSNLSHJZ-Bicto10E.js";
4
- import { _ as m } from "./chunk-7S6XSTFO-DV8etStf.js";
5
- import "./chunk-YZO67HFG-DWHo0c6-.js";
6
- import { i as h } from "./chunk-AQDTSKZB-CUCC855j.js";
7
- import "./chunk-UHW7PFBP-NbzzxkEP.js";
2
+ import { m as t, p as n } from "./src-65Lfw03T.js";
3
+ import { C as r, H as i, U as a, _ as o, a as s, b as c, f as l, q as u, v as d, y as f, z as p } from "./chunk-DSNLSHJZ-DPpiuUZK.js";
4
+ import { _ as m } from "./chunk-7S6XSTFO-DrDRohsE.js";
5
+ import "./chunk-YZO67HFG-WF3jklBn.js";
6
+ import { i as h } from "./chunk-AQDTSKZB-DUZx386i.js";
7
+ import "./chunk-UHW7PFBP-BTk1ZC8L.js";
8
8
  import { a as g, i as _, o as ee, r as v } from "./chunk-J5ZVWO5B-DEP-pB-1.js";
9
- import "./chunk-HAGFOTED-BjDmRfgG.js";
10
- import "./chunk-ZAUX2LTX-COHXRsvU.js";
11
- import "./chunk-WQQL4CDK-l3Yf4SAX.js";
12
- import { t as te } from "./chunk-XXDRQBXY-IzhWXllg.js";
13
- import { t as ne } from "./chunk-VQ5W62QI-D3c9tcDC.js";
14
- import "./chunk-HNE4Q36P-5u7dvjgt.js";
15
- import { a as re, i as ie } from "./mermaid.core-BxQmR6RW.js";
9
+ import "./chunk-HAGFOTED-ceXO12G4.js";
10
+ import "./chunk-ZAUX2LTX-P8LAwm_U.js";
11
+ import "./chunk-WQQL4CDK-C3yDIFZ3.js";
12
+ import { t as te } from "./chunk-XXDRQBXY-CNtMgRT_.js";
13
+ import { t as ne } from "./chunk-VQ5W62QI-Bvcxpp51.js";
14
+ import "./chunk-HNE4Q36P-uON_vFhT.js";
15
+ import { a as re, i as ie } from "./mermaid.core-C8dp1dnD.js";
16
16
  //#region ../node_modules/@chevrotain/utils/lib/src/print.js
17
17
  function ae(e) {
18
18
  /* istanbul ignore else - can't override global.console in node.js */
@@ -1302,6 +1302,7 @@ function tt(e, t) {
1302
1302
  n("misc mapping", () => {
1303
1303
  o = r.map((e) => e.tokenTypeIdx), s = r.map((e) => {
1304
1304
  let t = e.GROUP;
1305
+ /* istanbul ignore next */
1305
1306
  if (t !== I.SKIPPED) {
1306
1307
  if (typeof t == "string") return t;
1307
1308
  if (t === void 0) return !1;
@@ -1498,7 +1499,7 @@ function ft(e) {
1498
1499
  }));
1499
1500
  }
1500
1501
  function pt(e) {
1501
- let t = [], n = e.map((n) => e.reduce((e, r) => n.PATTERN.source === r.PATTERN.source && !t.includes(r) && r.PATTERN !== I.NA ? (t.push(r), e.push(r), e) : e, []));
1502
+ let t = [], n = e.map((n) => e.reduce((e, r) => (n.PATTERN.source === r.PATTERN.source && !t.includes(r) && r.PATTERN !== I.NA && (t.push(r), e.push(r)), e), []));
1502
1503
  return n = n.filter(Boolean), n.filter((e) => e.length > 1).map((e) => {
1503
1504
  let t = e.map((e) => e.name);
1504
1505
  return {
@@ -4478,9 +4479,7 @@ var H = {
4478
4479
  return;
4479
4480
  }
4480
4481
  for (let [n, i] of e.entries()) o(i, `${t}[${n}]`, `${r}/${n}`);
4481
- return;
4482
- }
4483
- if (typeof e == "object" && e) {
4482
+ } else if (typeof e == "object" && e) {
4484
4483
  let i = e, s = n[r] ?? Object.keys(i);
4485
4484
  if (s.length === 0) {
4486
4485
  a(t, t, "{}");
@@ -4490,9 +4489,7 @@ var H = {
4490
4489
  let n = t ? `${t}.${e}` : e;
4491
4490
  o(i[e], n, `${r}/${Ii(e)}`);
4492
4491
  }
4493
- return;
4494
- }
4495
- a(t, t, Li(e));
4492
+ } else a(t, t, Li(e));
4496
4493
  }, "visit");
4497
4494
  return o(t, "", ""), i;
4498
4495
  }, "flattenJsonRows"), zi = /* @__PURE__ */ e((e) => {
@@ -4780,11 +4777,8 @@ var qi = /* @__PURE__ */ e((e, t) => {
4780
4777
  let n = 0, r = !1, i = !1;
4781
4778
  for (let a = t; a < e.length; a++) {
4782
4779
  let o = e[a];
4783
- if (r) {
4784
- i ? i = !1 : o === "\\" ? i = !0 : o === "\"" && (r = !1);
4785
- continue;
4786
- }
4787
- if (o === "\"") r = !0;
4780
+ if (r) i ? i = !1 : o === "\\" ? i = !0 : o === "\"" && (r = !1);
4781
+ else if (o === "\"") r = !0;
4788
4782
  else if (o === "{") n++;
4789
4783
  else if (o === "}" && --n === 0) return Ki(e, t, e.slice(t, a + 1));
4790
4784
  }
@@ -5442,22 +5436,21 @@ var qi = /* @__PURE__ */ e((e, t) => {
5442
5436
  collectObject(e) {
5443
5437
  this.offset++;
5444
5438
  let t = [], n = /* @__PURE__ */ new Set();
5445
- if (this.propertyOrder[e] = t, this.skipWhitespace(), this.text[this.offset] === "}") {
5446
- this.offset++;
5447
- return;
5448
- }
5449
- for (; this.offset < this.text.length;) {
5450
- if (this.text[this.offset] !== "\"") throw new Q(this.offset);
5451
- let r = this.readString(!0), i = `${e}/${r.replaceAll("~", "~0").replaceAll("/", "~1")}`;
5452
- if (n.has(r) ? this.deletePointerSubtree(i) : (n.add(r), t.push(r)), this.skipWhitespace(), this.text[this.offset] !== ":") throw new Q(this.offset);
5453
- if (this.offset++, this.collectValue(i), this.skipWhitespace(), this.text[this.offset] === "}") {
5454
- this.offset++;
5455
- return;
5439
+ if (this.propertyOrder[e] = t, this.skipWhitespace(), this.text[this.offset] === "}") this.offset++;
5440
+ else {
5441
+ for (; this.offset < this.text.length;) {
5442
+ if (this.text[this.offset] !== "\"") throw new Q(this.offset);
5443
+ let r = this.readString(!0), i = `${e}/${r.replaceAll("~", "~0").replaceAll("/", "~1")}`;
5444
+ if (n.has(r) ? this.deletePointerSubtree(i) : (n.add(r), t.push(r)), this.skipWhitespace(), this.text[this.offset] !== ":") throw new Q(this.offset);
5445
+ if (this.offset++, this.collectValue(i), this.skipWhitespace(), this.text[this.offset] === "}") {
5446
+ this.offset++;
5447
+ return;
5448
+ }
5449
+ if (this.text[this.offset] !== ",") throw new Q(this.offset);
5450
+ this.offset++, this.skipWhitespace();
5456
5451
  }
5457
- if (this.text[this.offset] !== ",") throw new Q(this.offset);
5458
- this.offset++, this.skipWhitespace();
5452
+ throw new Q(this.offset);
5459
5453
  }
5460
- throw new Q(this.offset);
5461
5454
  }
5462
5455
  collectArray(e) {
5463
5456
  if (this.offset++, this.skipWhitespace(), this.text[this.offset] === "]") {
@@ -5827,7 +5820,8 @@ var xo = /* @__PURE__ */ e((e) => ({
5827
5820
  });
5828
5821
  r && r.kind !== e.kind && this.conflict(`ID '${e.id}' is declared as both ${r.kind} and ${e.kind}`, e.location, r.location, i, ko(r)), r && (r.generated || e.generated) && this.conflict(`Generated ID '${e.id}' collides with another declaration`, e.location, r.location, i, ko(r));
5829
5822
  let a = n.get(e.id);
5830
- if (!a) {
5823
+ if (a) (a.label.text !== e.label.text || a.label.type !== e.label.type) && this.conflict(`ID '${e.id}' has conflicting labels`, e.location, a.location), e.shape && a.shape && e.shape !== a.shape && this.conflict(`Use case '${e.id}' has conflicting shapes`, e.location, a.location), e.parentId && a.parentId && e.parentId !== a.parentId && this.conflict(`Element '${e.id}' belongs to more than one system boundary`, e.parentLocation ?? e.location, a.parentLocation ?? a.location), e.stereotype && a.stereotype && e.stereotype !== a.stereotype && this.conflict(`Element '${e.id}' has conflicting stereotypes`, e.location, a.stereotypeLocation ?? a.location), a.shape ??= e.shape, a.parentId ??= e.parentId, a.parentLocation ??= e.parentLocation, a.stereotype ??= e.stereotype, a.stereotypeLocation ??= e.stereotype ? e.location : void 0, Ao(a.classes, e.classes), this.applyDeclarationMetadata(a, e.metadata);
5824
+ else {
5831
5825
  let r = {
5832
5826
  kind: e.kind,
5833
5827
  id: e.id,
@@ -5851,9 +5845,7 @@ var xo = /* @__PURE__ */ e((e) => ({
5851
5845
  generated: e.generated,
5852
5846
  label: e.label.text
5853
5847
  });
5854
- return;
5855
5848
  }
5856
- (a.label.text !== e.label.text || a.label.type !== e.label.type) && this.conflict(`ID '${e.id}' has conflicting labels`, e.location, a.location), e.shape && a.shape && e.shape !== a.shape && this.conflict(`Use case '${e.id}' has conflicting shapes`, e.location, a.location), e.parentId && a.parentId && e.parentId !== a.parentId && this.conflict(`Element '${e.id}' belongs to more than one system boundary`, e.parentLocation ?? e.location, a.parentLocation ?? a.location), e.stereotype && a.stereotype && e.stereotype !== a.stereotype && this.conflict(`Element '${e.id}' has conflicting stereotypes`, e.location, a.stereotypeLocation ?? a.location), a.shape ??= e.shape, a.parentId ??= e.parentId, a.parentLocation ??= e.parentLocation, a.stereotype ??= e.stereotype, a.stereotypeLocation ??= e.stereotype ? e.location : void 0, Ao(a.classes, e.classes), this.applyDeclarationMetadata(a, e.metadata);
5857
5849
  }
5858
5850
  collectBoundary(e, t, n) {
5859
5851
  let r = t.get(e.id), i = ko({
@@ -5862,11 +5854,7 @@ var xo = /* @__PURE__ */ e((e) => ({
5862
5854
  });
5863
5855
  r && r.kind !== "boundary" && this.conflict(`ID '${e.id}' is declared as both ${r.kind} and boundary`, e.location, r.location, i, ko(r)), r && (r.generated || e.generated) && this.conflict(`Generated ID '${e.id}' collides with another declaration`, e.location, r.location, i, ko(r));
5864
5856
  let a = n.get(e.id);
5865
- if (a) {
5866
- (a.label.text !== e.label.text || a.label.type !== e.label.type) && this.conflict(`Boundary '${e.id}' has conflicting titles`, e.location, a.location), Ao(a.classes, e.classes);
5867
- return;
5868
- }
5869
- n.set(e.id, {
5857
+ a ? ((a.label.text !== e.label.text || a.label.type !== e.label.type) && this.conflict(`Boundary '${e.id}' has conflicting titles`, e.location, a.location), Ao(a.classes, e.classes)) : (n.set(e.id, {
5870
5858
  id: e.id,
5871
5859
  label: e.label,
5872
5860
  location: e.location,
@@ -5879,7 +5867,7 @@ var xo = /* @__PURE__ */ e((e) => ({
5879
5867
  location: e.location,
5880
5868
  generated: e.generated,
5881
5869
  label: e.label.text
5882
- });
5870
+ }));
5883
5871
  }
5884
5872
  materializeElements(e, t) {
5885
5873
  for (let n of [...e.values()].sort((e, n) => (t.get(e.id) ?? 0) - (t.get(n.id) ?? 0))) this.setElementModel(n);
@@ -1,9 +1,9 @@
1
1
  import { n as e } from "./chunk-Y2CYZVJY-CwsV_8W4.js";
2
- import { p as t } from "./src-Dkp7vqs8.js";
3
- import { C as n, H as r, U as i, _ as a, a as o, c as s, f as c, it as l, nt as u, q as d, rt as f, tt as p, v as m, y as h } from "./chunk-DSNLSHJZ-Bicto10E.js";
4
- import { i as g } from "./chunk-7S6XSTFO-DV8etStf.js";
2
+ import { p as t } from "./src-65Lfw03T.js";
3
+ import { C as n, H as r, U as i, _ as a, a as o, c as s, f as c, it as l, nt as u, q as d, rt as f, tt as p, v as m, y as h } from "./chunk-DSNLSHJZ-DPpiuUZK.js";
4
+ import { i as g } from "./chunk-7S6XSTFO-DrDRohsE.js";
5
5
  import { t as _ } from "./rough.esm-D2JJJ0Ot.js";
6
- import { o as v } from "./mermaid.core-BxQmR6RW.js";
6
+ import { o as v } from "./mermaid.core-C8dp1dnD.js";
7
7
  //#region ../node_modules/khroma/dist/methods/transparentize.js
8
8
  var y = (e, t) => f(e, "a", -t), b = 1e-10;
9
9
  function x(e, t) {